!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("CTC",[],e):"object"==typeof exports?exports.CTC=e():t.CTC=e()}(this,()=>(()=>{"use strict";var t={124:(t,e,n)=>{n.r(e),n.d(e,{CapabilityDetector:()=>w,CopyEngine:()=>T,CopyRuntime:()=>ot,FAILURE_REASONS:()=>x,default:()=>ct,getCopyPayload:()=>nt,initRuntime:()=>at,sanitizeSourceNode:()=>Z});var r=n(72),o=n.n(r),a=n(825),i=n.n(a),c=n(659),s=n.n(c),u=n(56),l=n.n(u),f=n(540),p=n.n(f),d=n(113),h=n.n(d),y=n(208),b={};b.styleTagTransform=h(),b.setAttributes=l(),b.insert=s().bind(null,"head"),b.domAPI=i(),b.insertStyleElement=p();o()(y.A,b);y.A&&y.A.locals&&y.A.locals;function v(t){return v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},v(t)}function m(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,g(r.key),r)}}function g(t){var e=function(t,e){if("object"!=v(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=v(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==v(e)?e:e+""}var x={IOS_SAFARI_RESTRICTION:"ios_safari_restriction",NO_USER_GESTURE:"no_user_gesture",INSECURE_CONTEXT:"insecure_context",EMPTY_SOURCE:"empty_source",IFRAME_RESTRICTION:"iframe_restriction",PERMISSION_DENIED:"permission_denied",CLIPBOARD_WRITE_UNSUPPORTED:"clipboard_write_unsupported",IMAGE_CONVERSION_FAILED:"image_conversion_failed",UNKNOWN_ERROR:"unknown_error"},w=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)},(e=[{key:"detect",value:function(){var t="undefined"!=typeof window&&window.isSecureContext||"undefined"!=typeof location&&"https:"===location.protocol,e="undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText,n="undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.write,r="undefined"!=typeof ClipboardItem,o="undefined"!=typeof navigator&&/iPad|iPhone|iPod/.test(navigator.userAgent),a="undefined"!=typeof navigator&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent),i=o&&a,c="undefined"!=typeof window&&window.self!==window.top;return{secureContext:t,clipboardAPI:e,clipboardWriteAPI:n,clipboardItem:r,ios:o,safari:a,iosSafari:i,iframe:c,userGesture:this._hasRecentUserGesture(),canUseClipboardAPI:t&&e&&!c,canUseClipboardWrite:t&&n&&r&&!c,shouldUseFallback:!e||!t||c}}},{key:"_hasRecentUserGesture",value:function(){return!0}}])&&m(t.prototype,e),n&&m(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function A(t){return A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},A(t)}function C(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,a,i,c=[],s=!0,u=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(c.push(r.value),c.length!==e);s=!0);}catch(t){u=!0,o=t}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(u)throw o}}return c}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return E(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return E(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function E(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function k(){k=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var a=e&&e.prototype instanceof v?e:v,i=Object.create(a.prototype),c=new L(r||[]);return o(i,"_invoke",{value:_(t,n,c)}),i}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var p="suspendedStart",d="suspendedYield",h="executing",y="completed",b={};function v(){}function m(){}function g(){}var x={};u(x,i,function(){return this});var w=Object.getPrototypeOf,C=w&&w(w(N([])));C&&C!==n&&r.call(C,i)&&(x=C);var E=g.prototype=v.prototype=Object.create(x);function j(t){["next","throw","return"].forEach(function(e){u(t,e,function(t){return this._invoke(e,t)})})}function S(t,e){function n(o,a,i,c){var s=f(t[o],t,a);if("throw"!==s.type){var u=s.arg,l=u.value;return l&&"object"==A(l)&&r.call(l,"__await")?e.resolve(l.__await).then(function(t){n("next",t,i,c)},function(t){n("throw",t,i,c)}):e.resolve(l).then(function(t){u.value=t,i(u)},function(t){return n("throw",t,i,c)})}c(s.arg)}var a;o(this,"_invoke",{value:function(t,r){function o(){return new e(function(e,o){n(t,r,e,o)})}return a=a?a.then(o,o):o()}})}function _(e,n,r){var o=p;return function(a,i){if(o===h)throw Error("Generator is already running");if(o===y){if("throw"===a)throw i;return{value:t,done:!0}}for(r.method=a,r.arg=i;;){var c=r.delegate;if(c){var s=O(c,r);if(s){if(s===b)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var u=f(e,n,r);if("normal"===u.type){if(o=r.done?y:d,u.arg===b)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=y,r.method="throw",r.arg=u.arg)}}}function O(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,O(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),b;var a=f(o,e.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,b;var i=a.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,b):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,b)}function I(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function N(e){if(e||""===e){var n=e[i];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return a.next=a}}throw new TypeError(A(e)+" is not iterable")}return m.prototype=g,o(E,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:m,configurable:!0}),m.displayName=u(g,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,u(t,s,"GeneratorFunction")),t.prototype=Object.create(E),t},e.awrap=function(t){return{__await:t}},j(S.prototype),u(S.prototype,c,function(){return this}),e.AsyncIterator=S,e.async=function(t,n,r,o,a){void 0===a&&(a=Promise);var i=new S(l(t,n,r,o),a);return e.isGeneratorFunction(n)?i:i.next().then(function(t){return t.done?t.value:i.next()})},j(E),u(E,s,"Generator"),u(E,i,function(){return this}),u(E,"toString",function(){return"[object Generator]"}),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=N,L.prototype={constructor:L,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return c.type="throw",c.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,b):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),b},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),b}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:N(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),b}},e}function j(t,e,n){return(e=I(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function S(t,e,n,r,o,a,i){try{var c=t[a](i),s=c.value}catch(t){return void n(t)}c.done?e(s):Promise.resolve(s).then(r,o)}function _(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var a=t.apply(e,n);function i(t){S(a,r,o,i,c,"next",t)}function c(t){S(a,r,o,i,c,"throw",t)}i(void 0)})}}function O(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,I(r.key),r)}}function I(t){var e=function(t,e){if("object"!=A(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=A(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==A(e)?e:e+""}var T=function(){return t=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.detector=e||new w},e=[{key:"execute",value:(a=_(k().mark(function t(e){var n,r,o,a,i,c;return k().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.value,r=e.htmlValue,o=e.imageBlob,a=e.copyAs,i=void 0===a?"text":a,e.context,e.intent,e.source,"image"!==i){t.next=6;break}if(o){t.next=4;break}return t.abrupt("return",{success:!1,reason:x.EMPTY_SOURCE});case 4:t.next=8;break;case 6:if(n&&"string"==typeof n&&""!==n.trim()){t.next=8;break}return t.abrupt("return",{success:!1,reason:x.EMPTY_SOURCE});case 8:if((c=this.detector.detect()).secureContext){t.next=11;break}return t.abrupt("return",{success:!1,reason:x.INSECURE_CONTEXT});case 11:if(!c.iframe){t.next=13;break}return t.abrupt("return",{success:!1,reason:x.IFRAME_RESTRICTION});case 13:t.t0=i,t.next="html"===t.t0?16:"text_and_html"===t.t0?17:"image"===t.t0?18:"svg"===t.t0?19:("json"===t.t0||t.t0,20);break;case 16:return t.abrupt("return",this._copyRich({"text/html":r||n},n,c));case 17:case 19:return t.abrupt("return",this._copyRich({"text/plain":n,"text/html":r||n},n,c));case 18:return t.abrupt("return",this._copyRich(j({},o.type||"image/png",o),n||null,c));case 20:return t.abrupt("return",this._copyText(n,c));case 21:case"end":return t.stop()}},t,this)})),function(t){return a.apply(this,arguments)})},{key:"_copyText",value:(o=_(k().mark(function t(e,n){return k().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!n.iosSafari){t.next=12;break}if(t.prev=1,!n.canUseClipboardAPI){t.next=6;break}return t.next=5,navigator.clipboard.writeText(e);case 5:case 16:return t.abrupt("return",{success:!0});case 6:case 22:return t.abrupt("return",this._fallbackCopy(e));case 9:return t.prev=9,t.t0=t.catch(1),t.abrupt("return",{success:!1,reason:x.IOS_SAFARI_RESTRICTION});case 12:if(!n.canUseClipboardAPI){t.next=22;break}return t.prev=13,t.next=16,navigator.clipboard.writeText(e);case 19:return t.prev=19,t.t1=t.catch(13),t.abrupt("return",this._fallbackCopy(e));case 23:case"end":return t.stop()}},t,this,[[1,9],[13,19]])})),function(t,e){return o.apply(this,arguments)})},{key:"_copyRich",value:(r=_(k().mark(function t(e,n,r){var o,a,i,c,s,u,l,f;return k().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!r.canUseClipboardWrite){t.next=12;break}for(t.prev=1,o={},a=0,i=Object.entries(e);a<i.length;a++)c=C(i[a],2),s=c[0],(u=c[1])instanceof Blob?o[s]=u:o[s]=new Blob([u],{type:s});return l=new ClipboardItem(o),t.next=7,navigator.clipboard.write([l]);case 7:return t.abrupt("return",{success:!0});case 10:t.prev=10,t.t0=t.catch(1);case 12:if(!e["text/html"]||e["text/html"]instanceof Blob){t.next=16;break}if(!(f=this._fallbackCopyHtml(e["text/html"],n)).success){t.next=16;break}return t.abrupt("return",f);case 16:if(!n){t.next=18;break}return t.abrupt("return",this._fallbackCopy(n));case 18:return t.abrupt("return",{success:!1,reason:x.CLIPBOARD_WRITE_UNSUPPORTED});case 19:case"end":return t.stop()}},t,this,[[1,10]])})),function(t,e,n){return r.apply(this,arguments)})},{key:"_fallbackCopy",value:function(t){if("undefined"==typeof document)return{success:!1,reason:x.UNKNOWN_ERROR};try{var e=document.createElement("textarea");e.value=t,e.style.position="fixed",e.style.left="-999999px",e.style.top="-999999px",document.body.appendChild(e),e.focus(),e.select();var n=document.execCommand ("copy");return document.body.removeChild(e),n?{success:!0}:{success:!1,reason:x.UNKNOWN_ERROR}}catch(t){return{success:!1,reason:x.UNKNOWN_ERROR}}}},{key:"_fallbackCopyHtml",value:function(t,e){if("undefined"==typeof document)return{success:!1,reason:x.UNKNOWN_ERROR};try{var n=document.createElement("div");n.innerHTML=t,n.style.position="fixed",n.style.left="-999999px",n.style.top="-999999px",document.body.appendChild(n);var r=document.createRange();r.selectNodeContents(n);var o=window.getSelection();o.removeAllRanges(),o.addRange(r);var a=document.execCommand ("copy");return o.removeAllRanges(),document.body.removeChild(n),a?{success:!0}:e?this._fallbackCopy(e):{success:!1,reason:x.UNKNOWN_ERROR}}catch(t){return e?this._fallbackCopy(e):{success:!1,reason:x.UNKNOWN_ERROR}}}}],e&&O(t.prototype,e),n&&O(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n,r,o,a}();function L(){L=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var a=e&&e.prototype instanceof v?e:v,i=Object.create(a.prototype),c=new I(r||[]);return o(i,"_invoke",{value:j(t,n,c)}),i}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var p="suspendedStart",d="suspendedYield",h="executing",y="completed",b={};function v(){}function m(){}function g(){}var x={};u(x,i,function(){return this});var w=Object.getPrototypeOf,A=w&&w(w(T([])));A&&A!==n&&r.call(A,i)&&(x=A);var C=g.prototype=v.prototype=Object.create(x);function E(t){["next","throw","return"].forEach(function(e){u(t,e,function(t){return this._invoke(e,t)})})}function k(t,e){function n(o,a,i,c){var s=f(t[o],t,a);if("throw"!==s.type){var u=s.arg,l=u.value;return l&&"object"==M(l)&&r.call(l,"__await")?e.resolve(l.__await).then(function(t){n("next",t,i,c)},function(t){n("throw",t,i,c)}):e.resolve(l).then(function(t){u.value=t,i(u)},function(t){return n("throw",t,i,c)})}c(s.arg)}var a;o(this,"_invoke",{value:function(t,r){function o(){return new e(function(e,o){n(t,r,e,o)})}return a=a?a.then(o,o):o()}})}function j(e,n,r){var o=p;return function(a,i){if(o===h)throw Error("Generator is already running");if(o===y){if("throw"===a)throw i;return{value:t,done:!0}}for(r.method=a,r.arg=i;;){var c=r.delegate;if(c){var s=S(c,r);if(s){if(s===b)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var u=f(e,n,r);if("normal"===u.type){if(o=r.done?y:d,u.arg===b)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=y,r.method="throw",r.arg=u.arg)}}}function S(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,S(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),b;var a=f(o,e.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,b;var i=a.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,b):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,b)}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function T(e){if(e||""===e){var n=e[i];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return a.next=a}}throw new TypeError(M(e)+" is not iterable")}return m.prototype=g,o(C,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:m,configurable:!0}),m.displayName=u(g,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,u(t,s,"GeneratorFunction")),t.prototype=Object.create(C),t},e.awrap=function(t){return{__await:t}},E(k.prototype),u(k.prototype,c,function(){return this}),e.AsyncIterator=k,e.async=function(t,n,r,o,a){void 0===a&&(a=Promise);var i=new k(l(t,n,r,o),a);return e.isGeneratorFunction(n)?i:i.next().then(function(t){return t.done?t.value:i.next()})},E(C),u(C,s,"Generator"),u(C,i,function(){return this}),u(C,"toString",function(){return"[object Generator]"}),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=T,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(O),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return c.type="throw",c.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,b):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),b},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),O(n),b}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;O(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:T(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),b}},e}function N(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function B(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,G(r.key),r)}}function R(t,e,n){return e&&B(t.prototype,e),n&&B(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function P(t,e,n,r,o,a,i){try{var c=t[a](i),s=c.value}catch(t){return void n(t)}c.done?e(s):Promise.resolve(s).then(r,o)}function U(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var a=t.apply(e,n);function i(t){P(a,r,o,i,c,"next",t)}function c(t){P(a,r,o,i,c,"throw",t)}i(void 0)})}}function M(t){return M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},M(t)}function F(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function D(t,e,n){return(e=G(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function G(t){var e=function(t,e){if("object"!=M(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=M(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==M(e)?e:e+""}t=n.hmd(t);var q={copy:'<svg aria-hidden="true" focusable="false" role="img" viewBox="0 0 16 16" width="16" height="16" fill="currentColor"><path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"></path><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path></svg>',success:'<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" fill="currentColor"><path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path></svg>'},W={title:"Copy to Clipboard",copy:"Copy to Clipboard",copied:"Copied!",tooltip:"Copy"},Y={observe:!0,lazyLoad:!1,legacyFallback:!1,debug:!1},z="ctc-js-wrapper",H="data-ctc-bound";function K(t,e){"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(t,{detail:e}))}function V(t,e){var n=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?F(Object(n),!0).forEach(function(e){D(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):F(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},t);return Object.keys(e||{}).forEach(function(r){Array.isArray(e[r])?n[r]=e[r].slice():"object"===M(e[r])&&null!==e[r]?n[r]=V(t[r]||{},e[r]):n[r]=e[r]}),n}function Z(t){var e=t.cloneNode(!0);return e.querySelectorAll('[data-ctc-button="true"]').forEach(function(t){t.remove()}),e.hasAttribute&&e.hasAttribute("id")&&e.removeAttribute("id"),e.querySelectorAll("[id]").forEach(function(t){t.removeAttribute("id")}),e.querySelectorAll("[data-ctc-bound], [data-selector-id], [data-clipboard-type], [data-copy-format]").forEach(function(t){t.removeAttribute("data-ctc-bound"),t.removeAttribute("data-selector-id"),t.removeAttribute("data-clipboard-type"),t.removeAttribute("data-copy-format")}),e}function J(t){return t.split("\n").map(function(t){return t.trim()}).filter(function(t){return t.length>0}).join("\n").trim()}function Q(t,e){if(!t)return{text:"",html:"",copyAs:"text"};var n=e.copy_as||"text",r=e.format;if("google-docs"===r.copyFormat)return function(t){var e=Array.from(t.querySelectorAll('[data-ctc-button="true"]')),n=e.map(function(t){return t.style.display});e.forEach(function(t){t.style.display="none"});var r=document.createRange();r.selectNode(t);var o=window.getSelection();o&&(o.removeAllRanges(),o.addRange(r),document.execCommand ("copy"),o.removeAllRanges()),e.forEach(function(t,e){t.style.display=n[e]||""})}(t),{text:null,html:null,copyAs:"google-docs"};var o=Z(t),a=o.textContent||"",i=o.innerHTML||"",c=function(t,e){var n=t;return e.removeSpaces&&(n=(n=n.replace(/(<([^>]+)>)/gi,"")).replace(/[\t\n\r]+/gm," ")),e.trimLines&&(n=n.split("\n").map(function(t){return t.trim()}).filter(Boolean).join("\n")),n.trim()}(a,r);switch(n){case"text":default:return{text:c,copyAs:"text"};case"html":return{text:c,html:i,copyAs:"html"};case"text_and_html":return{text:J(a),html:i,copyAs:"text_and_html"};case"image":var s=t.querySelector("img")||("IMG"===t.tagName?t:null),u=t.querySelector("canvas")||("CANVAS"===t.tagName?t:null);return{text:s&&(s.alt||s.src)||c,imageElement:s,canvasElement:u,copyAs:"image"};case"json":var l=c;try{var f=JSON.parse(l);l=JSON.stringify(f,null,2)}catch(t){}return{text:l,copyAs:"json"};case"svg":var p=o.querySelector("svg")||("svg"===o.tagName||"SVG"===o.tagName?o:null);if(p){p.removeAttribute("class");var d=J(p.outerHTML);return{text:d,html:d,copyAs:"svg"}}return{text:i,html:i,copyAs:"svg"}}}var X={png:"image/png",jpeg:"image/jpeg",jpg:"image/jpeg",webp:"image/webp"};function $(t){var e=(t||"png").toLowerCase();return{mimeType:X[e]||"image/png",quality:["jpeg","jpg","webp"].includes(e)?.92:void 0}}function tt(t){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.92,n=$(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"png"),r=n.mimeType,o=n.quality,a=null!=o?o:e;return new Promise(function(e,n){var o=document.createElement("canvas"),i=o.getContext("2d"),c=function(t){t?e(t):n(new Error("Canvas toBlob returned null"))};if(t.complete&&t.naturalWidth>0)try{return o.width=t.naturalWidth,o.height=t.naturalHeight,i.drawImage(t,0,0),void(void 0!==a&&["image/jpeg","image/webp"].includes(r)?o.toBlob(c,r,a):o.toBlob(c,r))}catch(t){}var s=new Image;s.crossOrigin="anonymous",s.onload=function(){o.width=s.naturalWidth,o.height=s.naturalHeight,i.drawImage(s,0,0),void 0!==a&&["image/jpeg","image/webp"].includes(r)?o.toBlob(c,r,a):o.toBlob(c,r)},s.onerror=function(){return n(new Error("Image load failed — may be cross-origin without CORS headers"))},s.src=t.src})}function et(t){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.92,n=$(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"png"),r=n.mimeType,o=n.quality,a=null!=o?o:e;return new Promise(function(e,n){try{void 0!==a&&["image/jpeg","image/webp"].includes(r)?t.toBlob(function(t){return t?e(t):n(new Error("Canvas toBlob returned null"))},r,a):t.toBlob(function(t){return t?e(t):n(new Error("Canvas toBlob returned null"))},r)}catch(t){n(new Error("Canvas toBlob failed — canvas may be tainted"))}})}function nt(t,e){return rt.apply(this,arguments)}function rt(){return rt=U(L().mark(function t(e,n){var r,o,a,i,c,s,u,l,f,p,d,h,y,b,v=arguments;return L().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(r=v.length>2&&void 0!==v[2]?v[2]:{},e){t.next=3;break}return t.abrupt("return",{value:"",clipboardType:"text"});case 3:if(o=r.removeSpaces,a=void 0===o||o,i=r.trimLines,c=void 0!==i&&i,s=r.removeSelectors,u=r.imageFormat,l=void 0===u?"png":u,f=r.imageQuality,p=void 0===f?.92:f,"google-docs"!==(d=Q(e,{copy_as:n||"text",format:{removeSpaces:a,trimLines:c,copyFormat:"default"}})).copyAs){t.next=8;break}return t.abrupt("return",{value:"",clipboardType:"google-docs",copyAs:"google-docs"});case 8:if(h=d.copyAs||n||"text",y={value:d.text||"",clipboardType:h,copyAs:h},d.html&&["html","text_and_html","svg"].includes(h)&&(y.htmlValue=d.html),"image"!==h){t.next=33;break}if(b=null,t.prev=13,!d.canvasElement){t.next=20;break}return t.next=17,et(d.canvasElement,l,p);case 17:b=t.sent,t.next=24;break;case 20:if(!d.imageElement){t.next=24;break}return t.next=23,tt(d.imageElement,l,p);case 23:b=t.sent;case 24:t.next=32;break;case 26:return t.prev=26,t.t0=t.catch(13),y.value=d.text||"",y.clipboardType="text",y.copyAs="text",t.abrupt("return",y);case 32:b?y.imageBlob=b:(y.value=d.text||"",y.clipboardType="text",y.copyAs="text");case 33:return t.abrupt("return",y);case 34:case"end":return t.stop()}},t,null,[[13,26]])})),rt.apply(this,arguments)}var ot=function(){return R(function t(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};N(this,t),this.config=this.normalizeConfig(n),this.boundElements=new Map,this.observer=null,this.engine=new T,this.detector=new w,"undefined"!=typeof document&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",function(){e.bindAll(),e.setupObserver()}):(this.bindAll(),this.setupObserver()))},[{key:"normalizeConfig",value:function(t){return{selectors:(t.selectors||[]).map(function(t,e){return function(t,e){var n,r=t.id||"selector-".concat(e),o=V({label:W.copy,copiedLabel:W.copied,title:W.title,style:"button",position:"inside",icon:q.copy,successIcon:q.success},t.button||{}),a=V({mode:"text",copyFormat:"default",trimLines:!1,removeSpaces:!0},t.format||{});return{id:r,selector:t.selector||"",copy_as:t.copy_as||"text",image_format:t.image_format||"png",image_quality:null!==(n=t.image_quality)&&void 0!==n?n:.92,button:o,format:a,governance:V({masked:!1,ttl:0,roles:[]},t.governance||{}),conditions:t.conditions||[],meta:t.meta||{},callbacks:t.callbacks||{}}}(t,e)}),globals:V({defaultStrings:W,icons:q,analyticsEnabled:!1,governanceEnabled:!1},t.globals||{}),flags:V(Y,t.flags||{}),callbacks:t.callbacks||{}}}},{key:"bindAll",value:function(){var t=this;this.config.selectors.forEach(function(e){e.selector&&document.querySelectorAll(e.selector).forEach(function(n){return t.attachToNode(n,e)})})}},{key:"setupObserver",value:function(){var t=this;this.config.flags.observe&&"undefined"!=typeof MutationObserver&&(this.observer&&this.observer.disconnect(),this.observer=new MutationObserver(function(e){e.forEach(function(e){e.addedNodes.forEach(function(e){e instanceof HTMLElement&&t.config.selectors.forEach(function(n){e.matches&&e.matches(n.selector)&&t.attachToNode(e,n),(e.querySelectorAll?e.querySelectorAll(n.selector):[]).forEach(function(e){return t.attachToNode(e,n)})})})})}),this.observer.observe(document.body,{childList:!0,subtree:!0}))}},{key:"markNode",value:function(t,e){var n=t.getAttribute(H),r=n?n.split(","):[];r.includes(e)||(r.push(e),t.setAttribute(H,r.join(",")))}},{key:"attachToNode",value:function(t,e){if(t instanceof HTMLElement){var n=t.getAttribute(H);if(!n||!n.split(",").includes(e.id)){var r=this.ensureWrapper(t,e),o=this.createButton(r,e);if(o){if("outside"===e.button.position&&r.parentElement){var a=document.createElement("div");a.className="ctc-js-btn-container ctc-js-btn-container--outside",a.appendChild(o),r.parentElement.insertBefore(a,r)}else e.button.position,r.appendChild(o);this.markNode(r,e.id),this.boundElements.set(o,{wrapper:r,selectorConfig:e})}}}}},{key:"ensureWrapper",value:function(t,e){if(t.classList&&t.classList.contains(z))return t;var n=t.closest(".".concat(z));return n||((n=document.createElement("span")).className="".concat(z," copy-the-code-wrap copy-the-code-style-").concat(e.button.style),n.dataset.selectorId=e.id,n.dataset.selector=e.selector,n.dataset.clipboardType=e.copy_as||e.clipboard_type||"text",n.dataset.copyFormat=e.format.copyFormat||"default",n.dataset.buttonText=e.button.label||this.config.globals.defaultStrings.copy,n.dataset.buttonCopyText=e.button.copiedLabel||this.config.globals.defaultStrings.copied,n.dataset.buttonTitle=e.button.title||this.config.globals.defaultStrings.title,n.dataset.buttonPosition=e.button.position||"inside",n.dataset.formatMode=e.format.mode||"text",n.dataset.trimLines=e.format.trimLines?"1":"",n.dataset.removeSpaces=e.format.removeSpaces?"1":"",t.parentElement&&t.parentElement.insertBefore(n,t),n.appendChild(t),n)}},{key:"createButton",value:function(t,e){var n=this,r=document.createElement("button");r.type="button",r.className="ctc-js-btn ctc-js-btn--".concat(e.button.style||"button"),r.setAttribute("aria-label",e.button.title||this.config.globals.defaultStrings.title),r.id=function(){return"".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"ctc-js","-").concat(Math.random().toString(36).slice(2,10))}(),r.dataset.selectorId=e.id,r.dataset.ctcButton="true";var o=document.createElement("span");o.classList.add("ctc-js-icon--default"),o.innerHTML=e.button.icon||this.config.globals.icons.copy;var a=document.createElement("span");a.classList.add("ctc-js-icon--copied"),a.innerHTML=e.button.successIcon||this.config.globals.icons.success;var i=document.createElement("span");return i.className="ctc-js-btn__text",i.textContent=e.button.label||this.config.globals.defaultStrings.copy,r.appendChild(o),r.appendChild(a),r.appendChild(i),r.addEventListener("click",function(o){o.preventDefault(),n.handleCopy({button:r,wrapper:t,selectorConfig:e,event:o})}),r}},{key:"handleCopy",value:(t=U(L().mark(function t(e){var n,r,o,a,i,c,s,u,l,f,p,d,h,y,b,v,m,g,x,w=this;return L().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(a=e.button,i=e.wrapper,c=e.selectorConfig,e.event,s=null!==(n=c.meta)&&void 0!==n&&n.targetSelector&&i.querySelector(c.meta.targetSelector)?i.querySelector(c.meta.targetSelector):i,"google-docs"!==(u=Q(s,c)).copyAs){t.next=14;break}if(this.setButtonState(a,c,!0),K("copy:success",{type:"copy:success",selectorId:c.id,selector:c.selector,clipboardType:"google-docs",contentType:c.format.mode,masked:c.governance.masked,copyFormat:c.format.copyFormat,buttonStyle:c.button.style,page:"undefined"!=typeof window?window.location.pathname:"",pageTitle:"undefined"!=typeof document?document.title:"",context:{},timestamp:Date.now(),message:c.button.copiedLabel||this.config.globals.defaultStrings.copied}),"function"!=typeof this.config.callbacks.onAfterCopy){t.next=10;break}return t.next=10,this.config.callbacks.onAfterCopy({success:!0},{},c);case 10:if("function"!=typeof c.callbacks.onAfterCopy){t.next=13;break}return t.next=13,c.callbacks.onAfterCopy({success:!0},{},c);case 13:return t.abrupt("return");case 14:if(l=u.copyAs||c.copy_as||"text",f={value:u.text||"",htmlValue:u.html||"",imageBlob:null,copyAs:l,clipboardType:l,context:{selectorId:c.id,selector:c.selector,buttonStyle:c.button.style,elementTag:s?s.tagName:void 0},intent:(null===(r=c.meta)||void 0===r?void 0:r.intent)||null,source:(null===(o=c.meta)||void 0===o?void 0:o.source)||null},t.prev=16,"function"!=typeof this.config.callbacks.onBeforeCopy){t.next=24;break}return t.next=20,this.config.callbacks.onBeforeCopy(f,c);case 20:if(t.t0=t.sent,t.t0){t.next=23;break}t.t0=f;case 23:f=t.t0;case 24:if("function"!=typeof c.callbacks.onBeforeCopy){t.next=31;break}return t.next=27,c.callbacks.onBeforeCopy(f,c);case 27:if(t.t1=t.sent,t.t1){t.next=30;break}t.t1=f;case 30:f=t.t1;case 31:if(p=this.detector.detect(),"function"!=typeof this.config.callbacks.onCapabilityCheck){t.next=39;break}return t.next=35,this.config.callbacks.onCapabilityCheck(p,c);case 35:if(t.t2=t.sent,t.t2){t.next=38;break}t.t2=p;case 38:p=t.t2;case 39:if("function"!=typeof c.callbacks.onCapabilityCheck){t.next=46;break}return t.next=42,c.callbacks.onCapabilityCheck(p,c);case 42:if(t.t3=t.sent,t.t3){t.next=45;break}t.t3=p;case 45:p=t.t3;case 46:if(d=f.value,"function"!=typeof this.config.callbacks.onContentFormat){t.next=54;break}return t.next=50,this.config.callbacks.onContentFormat(d,c,s);case 50:if(t.t4=t.sent,t.t4){t.next=53;break}t.t4=d;case 53:d=t.t4;case 54:if("function"!=typeof c.callbacks.onContentFormat){t.next=61;break}return t.next=57,c.callbacks.onContentFormat(d,c,s);case 57:if(t.t5=t.sent,t.t5){t.next=60;break}t.t5=d;case 60:d=t.t5;case 61:if(f.value=d,"image"!==f.copyAs||f.imageBlob){t.next=95;break}if(y=c.image_format||"png",b=null!==(h=c.image_quality)&&void 0!==h?h:.92,!u.imageElement){t.next=79;break}return t.prev=66,t.next=69,tt(u.imageElement,y,b);case 69:f.imageBlob=t.sent,t.next=77;break;case 72:t.prev=72,t.t6=t.catch(66),f.copyAs="text",f.clipboardType="text",f.value=u.text||"";case 77:t.next=95;break;case 79:if(!u.canvasElement){t.next=93;break}return t.prev=80,t.next=83,et(u.canvasElement,y,b);case 83:f.imageBlob=t.sent,t.next=91;break;case 86:t.prev=86,t.t7=t.catch(80),f.copyAs="text",f.clipboardType="text",f.value=u.text||"";case 91:t.next=95;break;case 93:f.copyAs="text",f.clipboardType="text";case 95:return t.next=97,this.engine.execute(f);case 97:if(!(v=t.sent).success){t.next=113;break}if(this.setButtonState(a,c,!0),K("copy:success",m={type:"copy:success",selectorId:c.id,selector:c.selector,clipboardType:f.clipboardType,contentType:c.format.mode,masked:c.governance.masked,copyFormat:c.format.copyFormat,buttonStyle:c.button.style,page:"undefined"!=typeof window?window.location.pathname:"",pageTitle:"undefined"!=typeof document?document.title:"",context:f.context,timestamp:Date.now(),message:c.button.copiedLabel||this.config.globals.defaultStrings.copied}),"function"!=typeof this.config.callbacks.onAfterCopy){t.next=105;break}return t.next=105,this.config.callbacks.onAfterCopy(v,f,c);case 105:if("function"!=typeof c.callbacks.onAfterCopy){t.next=108;break}return t.next=108,c.callbacks.onAfterCopy(v,f,c);case 108:"function"==typeof this.config.callbacks.onSuccess&&this.config.callbacks.onSuccess(m),"function"==typeof c.callbacks.onSuccess&&c.callbacks.onSuccess(m),c.governance.ttl&&c.governance.ttl>0&&setTimeout(U(L().mark(function t(){return L().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,w.engine.execute({value:""});case 2:K("copy:mask-expired",{type:"copy:mask-expired",selectorId:c.id,ttl:c.governance.ttl,clearedAt:Date.now()});case 4:case"end":return t.stop()}},t)})),1e3*c.governance.ttl),t.next=124;break;case 113:if(K("copy:error",g={type:"copy:error",selectorId:c.id,selector:c.selector,clipboardType:f.clipboardType,error:v.reason||"Unknown error",reason:v.reason,page:"undefined"!=typeof window?window.location.pathname:"",timestamp:Date.now()}),"function"!=typeof this.config.callbacks.onCopyError){t.next=118;break}return t.next=118,this.config.callbacks.onCopyError(v,f,c);case 118:if("function"!=typeof c.callbacks.onCopyError){t.next=121;break}return t.next=121,c.callbacks.onCopyError(v,f,c);case 121:"function"==typeof this.config.callbacks.onError&&this.config.callbacks.onError(g),"function"==typeof c.callbacks.onError&&c.callbacks.onError(g),this.setButtonState(a,c,!1);case 124:t.next=139;break;case 126:if(t.prev=126,t.t8=t.catch(16),K("copy:error",x={type:"copy:error",selectorId:c.id,selector:c.selector,clipboardType:f.clipboardType,error:t.t8 instanceof Error?t.t8.message:t.t8,page:"undefined"!=typeof window?window.location.pathname:"",timestamp:Date.now()}),"function"!=typeof this.config.callbacks.onCopyError){t.next=133;break}return t.next=133,this.config.callbacks.onCopyError({success:!1,reason:t.t8.message||"Unknown error"},f,c);case 133:if("function"!=typeof c.callbacks.onCopyError){t.next=136;break}return t.next=136,c.callbacks.onCopyError({success:!1,reason:t.t8.message||"Unknown error"},f,c);case 136:"function"==typeof this.config.callbacks.onError&&this.config.callbacks.onError(x),"function"==typeof c.callbacks.onError&&c.callbacks.onError(x),this.setButtonState(a,c,!1);case 139:case"end":return t.stop()}},t,this,[[16,126],[66,72],[80,86]])})),function(e){return t.apply(this,arguments)})},{key:"setButtonState",value:function(t,e,n){var r=this,o=t.querySelector(".ctc-js-btn__text"),a="ctc-js-btn--copied";n?(t.classList.add(a),o&&(o.textContent=e.button.copiedLabel||this.config.globals.defaultStrings.copied)):(t.classList.remove(a),o&&(o.textContent=e.button.label||this.config.globals.defaultStrings.copy)),window.setTimeout(function(){t.classList.remove(a),o&&(o.textContent=e.button.label||r.config.globals.defaultStrings.copy)},e.button.timeout||1200)}},{key:"destroy",value:function(){this.observer&&this.observer.disconnect(),this.boundElements.forEach(function(t,e){e.remove();var n=t.wrapper,r=t.selectorConfig,o=n.getAttribute(H);if(o){var a=o.split(",").filter(function(t){return t!==r.id});a.length?n.setAttribute(H,a.join(",")):n.removeAttribute(H)}}),this.boundElements.clear()}}]);var t}();function at(){return new ot(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})}var it=function(){return R(function t(){var e,n,r,o,a,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(N(this,t),"object"!==M(i)||Array.isArray(i)){var s={selectors:[{selector:i||"",clipboard_type:(null==c?void 0:c.clipboardType)||"text",button:{label:(null==c||null===(e=c.default)||void 0===e?void 0:e.text)||W.copy,copiedLabel:(null==c||null===(n=c.copied)||void 0===n?void 0:n.text)||W.copied,icon:(null==c||null===(r=c.default)||void 0===r?void 0:r.icon)||q.copy,successIcon:(null==c||null===(o=c.copied)||void 0===o?void 0:o.icon)||q.success,className:null==c||null===(a=c.default)||void 0===a?void 0:a.class,timeout:(null==c?void 0:c.timeOut)||1e3},format:{mode:(null==c?void 0:c.copyAs)||"text"},callbacks:{onSuccess:null==c?void 0:c.success,onError:null==c?void 0:c.error}}]};this.runtime=new ot(s)}else this.runtime=new ot(i)},[{key:"destroy",value:function(){this.runtime&&"function"==typeof this.runtime.destroy&&this.runtime.destroy()}}])}();void 0!==t.exports&&(t.exports=it,t.exports.initRuntime=at,t.exports.CopyRuntime=ot,t.exports.CopyEngine=T,t.exports.CapabilityDetector=w,t.exports.FAILURE_REASONS=x,t.exports.getCopyPayload=nt,t.exports.sanitizeSourceNode=Z),"undefined"!=typeof window&&(window.CTC=it,window.CTC.initRuntime=at,window.CTC.CopyRuntime=ot,window.CTC.CopyEngine=T,window.CTC.CapabilityDetector=w,window.CTC.FAILURE_REASONS=x,window.CTC.getCopyPayload=nt,window.CTC.sanitizeSourceNode=Z,window.CopyTheCodeRuntime={init:at,CopyRuntime:ot,CopyEngine:T,CapabilityDetector:w,getCopyPayload:nt,sanitizeSourceNode:Z});const ct=it},208:(t,e,n)=>{n.d(e,{A:()=>c});var r=n(354),o=n.n(r),a=n(314),i=n.n(a)()(o());i.push([t.id,'\n[id^="ctc-js-"] {\n    --ctc-js-btn-bg: linear-gradient(45deg, #c34f84, #903bd9, #eb5e35);\n    --ctc-js-btn-bg-hover: linear-gradient(45deg, #eb5e35, #903bd9, #c34f84);\n    --ctc-js-btn-color: white;\n    --ctc-js-text-color: white;\n}\n\n[id^="ctc-js-"].ctc-js-btn,\n[id^="ctc-js-"].ctc-js-btn:hover,\n[id^="ctc-js-"].ctc-js-btn:focus {\n    height: auto;\n    min-width: auto;\n    background: var(--ctc-js-btn-bg);\n    display: inline-flex;\n    align-items: center;\n    max-width: max-content;\n    gap: 5px;\n    margin: 2px 0;\n    border-radius: 2px;\n    border: none;\n    color: var(--ctc-js-btn-color);\n    padding: 4px 6px;\n    font-size: 10px;\n    cursor: pointer;\n    line-height: 1;\n    font-weight: 500;\n}\n\n[id^="ctc-js-"] svg {\n    height: 1em;\n    width: 1em;\n    line-height: 1em;\n    font-size: 10px;\n}\n\n[id^="ctc-js-"] .ctc-js-icon--copied {\n    display: none;\n}\n\n[id^="ctc-js-"].ctc-js-btn--copied .ctc-js-icon--copied {\n    display: block;\n}\n\n[id^="ctc-js-"].ctc-js-btn--copied .ctc-js-icon--default {\n    display: none;\n}\n\n[id^="ctc-js-"] .ctc-js-btn__text {\n    color: var(--ctc-js-text-color);\n}\n\n[id^="ctc-js-"]:hover,\n[id^="ctc-js-"]:focus {\n    outline: none;\n    box-shadow: none;\n    text-shadow: none;\n    background: var(--ctc-js-btn-bg-hover);\n}\n\n[id^="ctc-js-"].ctc-js-btn--default:hover,\n[id^="ctc-js-"].ctc-js-btn--default:focus {\n    border-color: transparent;\n    color: white;\n    height: auto;\n}\n',"",{version:3,sources:["webpack://./src/style.css"],names:[],mappings:"AAAA;;CAEC;AACD;IACI,kEAAkE;IAClE,wEAAwE;IACxE,yBAAyB;IACzB,0BAA0B;AAC9B;;AAEA;;;IAGI,YAAY;IACZ,eAAe;IACf,gCAAgC;IAChC,oBAAoB;IACpB,mBAAmB;IACnB,sBAAsB;IACtB,QAAQ;IACR,aAAa;IACb,kBAAkB;IAClB,YAAY;IACZ,8BAA8B;IAC9B,gBAAgB;IAChB,eAAe;IACf,eAAe;IACf,cAAc;IACd,gBAAgB;AACpB;;AAEA;IACI,WAAW;IACX,UAAU;IACV,gBAAgB;IAChB,eAAe;AACnB;;AAEA;IACI,aAAa;AACjB;;AAEA;IACI,cAAc;AAClB;;AAEA;IACI,aAAa;AACjB;;AAEA;IACI,+BAA+B;AACnC;;AAEA;;IAEI,aAAa;IACb,gBAAgB;IAChB,iBAAiB;IACjB,sCAAsC;AAC1C;;AAEA;;IAEI,yBAAyB;IACzB,YAAY;IACZ,YAAY;AAChB",sourcesContent:['\n[id^="ctc-js-"] {\n    --ctc-js-btn-bg: linear-gradient(45deg, #c34f84, #903bd9, #eb5e35);\n    --ctc-js-btn-bg-hover: linear-gradient(45deg, #eb5e35, #903bd9, #c34f84);\n    --ctc-js-btn-color: white;\n    --ctc-js-text-color: white;\n}\n\n[id^="ctc-js-"].ctc-js-btn,\n[id^="ctc-js-"].ctc-js-btn:hover,\n[id^="ctc-js-"].ctc-js-btn:focus {\n    height: auto;\n    min-width: auto;\n    background: var(--ctc-js-btn-bg);\n    display: inline-flex;\n    align-items: center;\n    max-width: max-content;\n    gap: 5px;\n    margin: 2px 0;\n    border-radius: 2px;\n    border: none;\n    color: var(--ctc-js-btn-color);\n    padding: 4px 6px;\n    font-size: 10px;\n    cursor: pointer;\n    line-height: 1;\n    font-weight: 500;\n}\n\n[id^="ctc-js-"] svg {\n    height: 1em;\n    width: 1em;\n    line-height: 1em;\n    font-size: 10px;\n}\n\n[id^="ctc-js-"] .ctc-js-icon--copied {\n    display: none;\n}\n\n[id^="ctc-js-"].ctc-js-btn--copied .ctc-js-icon--copied {\n    display: block;\n}\n\n[id^="ctc-js-"].ctc-js-btn--copied .ctc-js-icon--default {\n    display: none;\n}\n\n[id^="ctc-js-"] .ctc-js-btn__text {\n    color: var(--ctc-js-text-color);\n}\n\n[id^="ctc-js-"]:hover,\n[id^="ctc-js-"]:focus {\n    outline: none;\n    box-shadow: none;\n    text-shadow: none;\n    background: var(--ctc-js-btn-bg-hover);\n}\n\n[id^="ctc-js-"].ctc-js-btn--default:hover,\n[id^="ctc-js-"].ctc-js-btn--default:focus {\n    border-color: transparent;\n    color: white;\n    height: auto;\n}\n'],sourceRoot:""}]);const c=i},314:t=>{t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var n="",r=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],"){")),e[2]&&(n+="@media ".concat(e[2]," {")),r&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),r&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n}).join("")},e.i=function(t,n,r,o,a){"string"==typeof t&&(t=[[null,t,void 0]]);var i={};if(r)for(var c=0;c<this.length;c++){var s=this[c][0];null!=s&&(i[s]=!0)}for(var u=0;u<t.length;u++){var l=[].concat(t[u]);r&&i[l[0]]||(void 0!==a&&(void 0===l[5]||(l[1]="@layer".concat(l[5].length>0?" ".concat(l[5]):""," {").concat(l[1],"}")),l[5]=a),n&&(l[2]?(l[1]="@media ".concat(l[2]," {").concat(l[1],"}"),l[2]=n):l[2]=n),o&&(l[4]?(l[1]="@supports (".concat(l[4],"){").concat(l[1],"}"),l[4]=o):l[4]="".concat(o)),e.push(l))}},e}},354:t=>{t.exports=function(t){var e=t[1],n=t[3];if(!n)return e;if("function"==typeof btoa){var r=btoa(unescape(encodeURIComponent(JSON.stringify(n)))),o="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(r),a="/*# ".concat(o," */");return[e].concat([a]).join("\n")}return[e].join("\n")}},72:t=>{var e=[];function n(t){for(var n=-1,r=0;r<e.length;r++)if(e[r].identifier===t){n=r;break}return n}function r(t,r){for(var a={},i=[],c=0;c<t.length;c++){var s=t[c],u=r.base?s[0]+r.base:s[0],l=a[u]||0,f="".concat(u," ").concat(l);a[u]=l+1;var p=n(f),d={css:s[1],media:s[2],sourceMap:s[3],supports:s[4],layer:s[5]};if(-1!==p)e[p].references++,e[p].updater(d);else{var h=o(d,r);r.byIndex=c,e.splice(c,0,{identifier:f,updater:h,references:1})}i.push(f)}return i}function o(t,e){var n=e.domAPI(e);n.update(t);return function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap&&e.supports===t.supports&&e.layer===t.layer)return;n.update(t=e)}else n.remove()}}t.exports=function(t,o){var a=r(t=t||[],o=o||{});return function(t){t=t||[];for(var i=0;i<a.length;i++){var c=n(a[i]);e[c].references--}for(var s=r(t,o),u=0;u<a.length;u++){var l=n(a[u]);0===e[l].references&&(e[l].updater(),e.splice(l,1))}a=s}}},659:t=>{var e={};t.exports=function(t,n){var r=function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}e[t]=n}return e[t]}(t);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},540:t=>{t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},56:(t,e,n)=>{t.exports=function(t){var e=n.nc;e&&t.setAttribute("nonce",e)}},825:t=>{t.exports=function(t){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=t.insertStyleElement(t);return{update:function(n){!function(t,e,n){var r="";n.supports&&(r+="@supports (".concat(n.supports,"){")),n.media&&(r+="@media ".concat(n.media," {"));var o=void 0!==n.layer;o&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,o&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var a=n.sourceMap;a&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),e.styleTagTransform(r,t,e.options)}(e,t,n)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},113:t=>{t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var a=e[r]={id:r,loaded:!1,exports:{}};return t[r](a,a.exports,n),a.loaded=!0,a.exports}return n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.hmd=t=>((t=Object.create(t)).children||(t.children=[]),Object.defineProperty(t,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+t.id)}}),t),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.nc=void 0,n(124)})());