!function(t){if("object"==typeofexports&&"undefined"!=typeofmodule)module.exports=t();elseif("function"==typeofdefine&&define.amd)define([],t);else{vare;e="undefined"!=typeofwindow?window:"undefined"!=typeofglobal?global:"undefined"!=typeofself?self:this,e.Clipboard=t()}}(function(){vart,e,n;returnfunctiont(e,n,o){functioni(a,c){if(!n[a]){if(!e[a]){varl="function"==typeofrequire&&require;if(!c&&l)returnl(a,!0);if(r)returnr(a,!0);vars=newError("Cannot find module '"+a+"'");throws.code="MODULE_NOT_FOUND",s}varu=n[a]={exports:{}};e[a][0].call(u.exports,function(t){varn=e[a][1][t];returni(n||t)},u,u.exports,t,e,n,o)}returnn[a].exports}for(varr="function"==typeofrequire&&require,a=0;a<o.length;a++)i(o[a]);returni}({1:[function(t,e,n){functiono(t,e){for(;t&&t.nodeType!==i;){if("function"==typeoft.matches&&t.matches(e))returnt;t=t.parentNode}}vari=9;if("undefined"!=typeofElement&&!Element.prototype.matches){varr=Element.prototype;r.matches=r.matchesSelector||r.mozMatchesSelector||r.msMatchesSelector||r.oMatchesSelector||r.webkitMatchesSelector}e.exports=o},{}],2:[function(t,e,n){functiono(t,e,n,o,r){vara=i.apply(this,arguments);returnt.addEventListener(n,a,r),{destroy:function(){t.removeEventListener(n,a,r)}}}functioni(t,e,n,o){returnfunction(n){n.delegateTarget=r(n.target,e),n.delegateTarget&&o.call(t,n)}}varr=t("./closest");e.exports=o},{"./closest":1}],3:[function(t,e,n){n.node=function(t){returnvoid0!==t&&tinstanceofHTMLElement&&1===t.nodeType},n.nodeList=function(t){vare=Object.prototype.toString.call(t);returnvoid0!==t&&("[object NodeList]"===e||"[object HTMLCollection]"===e)&&"length"int&&(0===t.length||n.node(t[0]))},n.string=function(t){return"string"==typeoft||tinstanceofString},n.fn=function(t){return"[object Function]"===Object.prototype.toString.call(t)}},{}],4:[function(t,e,n){functiono(t,e,n){if(!t&&!e&&!n)thrownewError("Missing required arguments");if(!c.string(e))thrownewTypeError("Second argument must be a String");if(!c.fn(n))thrownewTypeError("Third argument must be a Function");if(c.node(t))returni(t,e,n);if(c.nodeList(t))returnr(t,e,n);if(c.string(t))returna(t,e,n);thrownewTypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}functioni(t,e,n){returnt.addEventListener(e,n),{destroy:function(){t.removeEventListener(e,n)}}}functionr(t,e,n){returnArray.prototype.forEach.call(t,function(t){t.addEventListener(e,n)}),{destroy:function(){Array.prototype.forEach.call(t,function(t){t.removeEventListener(e,n)})}}}functiona(t,e,n){returnl(document.body,t,e,n)}varc=t("./is"),l=t("delegate");e.exports=o},{"./is":3,delegate:2}],5:[function(t,e,n){functiono(t){vare;if("SELECT"===t.nodeName)t.focus(),e=t.value;elseif("INPUT"===t.nodeName||"TEXTAREA"===t.nodeName){varn=t.hasAttribute("readonly");n||t.setAttribute("readonly",""),t.select(),t.setSelectionRange(0,t.value.length),n||t.removeAttribute("readonly"),e=t.value}else{t.hasAttribute("contenteditable")&&t.focus();varo=window.getSelection(),i=document.createRange();i.selectNodeContents(t),o.removeAllRanges(),o.addRange(i),e=o.toString()}returne}e.exports=o},{}],6:[function(t,e,n){functiono(){}o.prototype={on:function(t,e,n){varo=this.e||(this.e={});return(o[t]||(o[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){functiono(){i.off(t,o),e.apply(n,arguments)}vari=this;returno._=e,this.on(t,o,n)},emit:function(t){vare=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),o=0,i=n.length;for(o;o<i;o++)n[o].fn.apply(n[o].ctx,e);returnthis},off:function(t,e){varn=this.e||(this.e={}),o=n[t],i=[];if(o&&e)for(varr=0,a=o.length;r<a;r++)o[r].fn!==e&&o[r].fn._!==e&&i.push(o[r]);returni.length?n[t]=i:deleten[t],this}},e.exports=o},{}],7:[function(e,n,o){!function(i,r){if("function"==typeoft&&t.amd)t(["module","select"],r);elseif(void0!==o)r(n,e("select"));else{vara={exports:{}};r(a,i.select),i.clipboardAction=a.exports}}(this,function(t,e){"use strict";functionn(t){returnt&&t.__esModule?t:{default:t}}functiono(t,e){if(!(tinstanceofe))thrownewTypeError("Cannot call a class as a function")}vari=n(e),r="function"==typeofSymbol&&"symbol"==typeofSymbol.iterator?function(t){returntypeoft}:function(t){returnt&&"function"==typeofSymbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeoft},a=function(){functiont(t,e){for(varn=0;n<e.length;n++){varo=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"ino&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}returnfunction(e,n,o){returnn&&t(e.prototype,n),o&&t(e,o),e}}(),c=function(){functiont(e){o(this,t),this.resolveOptions(e),this.initSelection()}returna(t,[{key:"resolveOptions",value:functiont(){vare=arguments.length>0&&void0!==arguments[0]?arguments[0]:{};this.action=e.action,this.container=e.container,this.emitter=e.emitter,this.target=e.target,this.text=e.text,this.trigger=e.trigger,this.selectedText=""}},{key:"initSelection",value:functiont(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:functiont(){vare=this,n="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){returne.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[n?"right":"left"]="-9999px";varo=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=o+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=(0,i.default)(this.fakeElem),this.copyText()}},{key:"removeFake",value:functiont(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:functiont(){this.selectedText=(0,i.default)(this.target),this.copyText()}},{key:"copyText",value:functiont(){vare=void0;try{e=document.execCommand(this.action)}catch(t){e=!1}this.handleResult(e)}},{key:"handleResult",value:functiont(e){this.emitter.emit(e?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:functiont(){this.trigger&&this.trigger.focus(),window.getSelection().removeAllRanges()}},{key:"destroy",value:functiont(){this.removeFake()}},{key:"action",set:functiont(){vare=arguments.length>0&&void0!==arguments[0]?arguments[0]:"copy";if(this._action=e,"copy"!==this._action&&"cut"!==this._action)thrownewError('Invalid "action" value, use either "copy" or "cut"')},get:functiont(){returnthis._action}},{key:"target",set:functiont(e){if(void0!==e){if(!e||"object"!==(void0===e?"undefined":r(e))||1!==e.nodeType)thrownewError('Invalid "target" value, use a valid Element');if("copy"===this.action&&e.hasAttribute("disabled"))thrownewError('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(e.hasAttribute("readonly")||e.hasAttribute("disabled")))thrownewError('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=e}},get:functiont(){returnthis._target}}]),t}();t.exports=c})},{select:5}],8:[function(e,n,o){!function(i,r){if("function"==typeoft&&t.amd)t(["module","./clipboard-action","tiny-emitter","good-listener"],r);elseif(void0!==o)r(n,e("./clipboard-action"),e("tiny-emitter"),e("good-listener"));else{vara={exports:{}};r(a,i.clipboardAction,i.tinyEmitter,i.goodListener),i.clipboard=a.exports}}(this,function(t,e,n,o){"use strict";functioni(t){returnt&&t.__esModule?t:{default:t}}functionr(t,e){if(!(tinstanceofe))thrownewTypeError("Cannot call a class as a function")}functiona(t,e){if(!t)thrownewReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeofe&&"function"!=typeofe?t:e}functionc(t,e){if("function"!=typeofe&&null!==e)thrownewTypeError("Super expression must either be null or a function, not "+typeofe);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}functionl(t,e){varn="data-clipboard-"+t;if(e.hasAttribute(n))returne.getAttribute(n)}vars=i(e),u=i(n),f=i(o),d="function"==typeofSymbol&&"symbol"==typeofSymbol.iterator?function(t){returntypeoft}:function(t){returnt&&"function"==typeofSymbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeoft},h=function(){functiont(t,e){for(varn=0;n<e.length;n++){varo=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"ino&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}returnfunction(e,n,o){returnn&&t(e.prototype,n),o&&t(e,o),e}}(),p=function(t){functione(t,n){r(this,e);varo=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));returno.resolveOptions(n),o.listenClick(t),o}returnc(e,t),h(e,[{key:"resolveOptions",value:functiont(){vare=arguments.length>0&&void0!==arguments[0]?arguments[0]:{};this.action="function"==typeofe.action?e.action:this.defaultAction,this.target="function"==typeofe.target?e.target:this.defaultTarget,this.text="function"==typeofe.text?e.text:this.defaultText,this.container="object"===d(e.container)?e.container:document.body}},{key:"listenClick",value:functiont(e){varn=this;this.listener=(0,f.default)(e,"click",function(t){returnn.onClick(t)})}},{key:"onClick",value:functiont(e){varn=e.delegateTarget||e.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=news.default({action:this.action(n),target:this.target(n),text:this.text(n),container:this.container,trigger:n,emitter:this})}},{key:"defaultAction",value:functiont(e){returnl("action",e)}},{key:"defaultTarget",value:functiont(e){varn=l("target",e);if(n)returndocument.querySelector(n)}},{key:"defaultText",value:functiont(e){returnl("text",e)}},{key:"destroy",value:functiont(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:functiont(){vare=arguments.length>0&&void0!==arguments[0]?arguments[0]:["copy","cut"],n="string"==typeofe?[e]:e,o=!!document.queryCommandSupported;returnn.forEach(function(t){o=o&&!!document.queryCommandSupported(t)}),o}}]),e}(u.default);t.exports=p})},{"./clipboard-action":7,"good-listener":4,"tiny-emitter":6}]},{},[8])(8)});