@uploadcare/file-uploader 1.9.0-alpha.0 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/abstract/ActivityBlock.d.ts +0 -1
- package/abstract/ActivityBlock.d.ts.map +1 -1
- package/abstract/ActivityBlock.js +0 -1
- package/blocks/CameraSource/CameraSource.js +7 -2
- package/blocks/ExternalSource/ExternalSource.js +7 -2
- package/blocks/FileItem/FileItem.d.ts.map +1 -1
- package/blocks/FileItem/FileItem.js +4 -7
- package/blocks/Icon/Icon.d.ts +0 -1
- package/blocks/Icon/Icon.d.ts.map +1 -1
- package/blocks/Icon/Icon.js +0 -3
- package/blocks/UrlSource/UrlSource.js +7 -2
- package/blocks/themes/uc-basic/index.css +0 -1
- package/blocks/themes/uc-basic/svg-sprite.d.ts +1 -1
- package/blocks/themes/uc-basic/svg-sprite.js +1 -1
- package/env.d.ts +1 -1
- package/env.js +1 -1
- package/index.d.ts +0 -1
- package/index.js +0 -1
- package/index.ssr.d.ts +1 -68
- package/index.ssr.d.ts.map +1 -1
- package/index.ssr.js +23 -75
- package/package.json +3 -6
- package/solutions/file-uploader/regular/FileUploaderRegular.js +0 -1
- package/web/file-uploader.iife.min.js +29 -392
- package/web/file-uploader.min.js +29 -392
- package/web/uc-basic.min.css +1 -1
- package/web/uc-cloud-image-editor.min.js +1 -1
- package/web/uc-file-uploader-inline.min.css +1 -1
- package/web/uc-file-uploader-inline.min.js +29 -392
- package/web/uc-file-uploader-minimal.min.js +3 -3
- package/web/uc-file-uploader-regular.min.css +1 -1
- package/web/uc-file-uploader-regular.min.js +29 -392
- package/web/uc-img.min.js +1 -1
- package/blocks/LocalEditorImage/LocalEditorImage.d.ts +0 -22
- package/blocks/LocalEditorImage/LocalEditorImage.d.ts.map +0 -1
- package/blocks/LocalEditorImage/LocalEditorImage.js +0 -139
- package/blocks/LocalEditorImage/localEditorImage.css +0 -19
|
@@ -1,392 +1,29 @@
|
|
|
1
|
-
/** * @license * MIT License * * Copyright (c) 2022 Uploadcare (hello@uploadcare.com). All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * */ "use strict";var UC=(()=>{var Sm=Object.create;var cr=Object.defineProperty;var Im=Object.getOwnPropertyDescriptor;var Em=Object.getOwnPropertyNames;var Vc=Object.getPrototypeOf,wm=Object.prototype.hasOwnProperty;var Mm=Reflect.get;var Tm=(S,v,t)=>v in S?cr(S,v,{enumerable:!0,configurable:!0,writable:!0,value:t}):S[v]=t;var e=(S,v)=>cr(S,"name",{value:v,configurable:!0});var $c=(S,v)=>()=>(v||S((v={exports:{}}).exports,v),v.exports),Am=(S,v)=>{for(var t in v)cr(S,t,{get:v[t],enumerable:!0})},Zc=(S,v,t,u)=>{if(v&&typeof v=="object"||typeof v=="function")for(let x of Em(v))!wm.call(S,x)&&x!==t&&cr(S,x,{get:()=>v[x],enumerable:!(u=Im(v,x))||u.enumerable});return S};var Jc=(S,v,t)=>(t=S!=null?Sm(Vc(S)):{},Zc(v||!S||!S.__esModule?cr(t,"default",{value:S,enumerable:!0}):t,S)),Om=S=>Zc(cr({},"__esModule",{value:!0}),S);var st=(S,v,t)=>(Tm(S,typeof v!="symbol"?v+"":v,t),t);var qe=(S,v,t)=>Mm(Vc(S),t,v);var Ca=$c((ba,Il)=>{e(function(v,t){typeof ba=="object"&&typeof Il=="object"?Il.exports=t():typeof define=="function"&&define.amd?define([],t):typeof ba=="object"?ba.colorPicker=t():(v.tui=v.tui||{},v.tui.colorPicker=t())},"webpackUniversalModuleDefinition")(window,function(){return function(S){var v={};function t(u){if(v[u])return v[u].exports;var x=v[u]={i:u,l:!1,exports:{}};return S[u].call(x.exports,x,x.exports,t),x.l=!0,x.exports}return e(t,"__webpack_require__"),t.m=S,t.c=v,t.d=function(u,x,y){t.o(u,x)||Object.defineProperty(u,x,{enumerable:!0,get:y})},t.r=function(u){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(u,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(u,"__esModule",{value:!0})},t.t=function(u,x){if(x&1&&(u=t(u)),x&8||x&4&&typeof u=="object"&&u&&u.__esModule)return u;var y=Object.create(null);if(t.r(y),Object.defineProperty(y,"default",{enumerable:!0,value:u}),x&2&&typeof u!="string")for(var I in u)t.d(y,I,function(l){return u[l]}.bind(null,I));return y},t.n=function(u){var x=u&&u.__esModule?e(function(){return u.default},"getDefault"):e(function(){return u},"getModuleExports");return t.d(x,"a",x),x},t.o=function(u,x){return Object.prototype.hasOwnProperty.call(u,x)},t.p="dist",t(t.s=33)}([function(S,v,t){"use strict";function u(x,y){var I=Object.prototype.hasOwnProperty,l,c,T,P;for(T=1,P=arguments.length;T<P;T+=1){l=arguments[T];for(c in l)I.call(l,c)&&(x[c]=l[c])}return x}e(u,"extend"),S.exports=u},function(S,v,t){"use strict";function u(x){return x instanceof Array}e(u,"isArray"),S.exports=u},function(S,v,t){"use strict";var u=t(1),x=t(6),y=t(7);function I(l,c,T){u(l)?x(l,c,T):y(l,c,T)}e(I,"forEach"),S.exports=I},function(S,v,t){"use strict";function u(x){return x===void 0}e(u,"isUndefined"),S.exports=u},function(S,v,t){"use strict";var u=t(22),x=t(2),y=t(6),I=t(7),l=t(37),c=0,T={getLength:function(P){var L=0;return I(P,function(){L+=1}),L},map:function(P,L,N){var j=[];return x(P,function(){j.push(L.apply(N||null,arguments))}),j},filter:function(P,L,N){var j=[];return y(P,function(b){L.apply(N||null,arguments)&&j.push(b)}),j},generateId:function(){return c+=1,c},isOldBrowser:function(){return u.msie&&u.version<9}(),sendHostName:function(){l("color-picker","UA-129987462-1")}};S.exports=T},function(S,v,t){"use strict";var u=t(1);function x(y,I,l){var c,T;if(l=l||0,!u(I))return-1;if(Array.prototype.indexOf)return Array.prototype.indexOf.call(I,y,l);for(T=I.length,c=l;l>=0&&c<T;c+=1)if(I[c]===y)return c;return-1}e(x,"inArray"),S.exports=x},function(S,v,t){"use strict";function u(x,y,I){var l=0,c=x.length;for(I=I||null;l<c&&y.call(I,x[l],l,x)!==!1;l+=1);}e(u,"forEachArray"),S.exports=u},function(S,v,t){"use strict";function u(x,y,I){var l;I=I||null;for(l in x)if(x.hasOwnProperty(l)&&y.call(I,x[l],l,x)===!1)break}e(u,"forEachOwnProperties"),S.exports=u},function(S,v,t){"use strict";var u=t(39),x=t(13),y=t(41),I=t(3),l=t(9),c=t(19),T=t(4);function P(L,N){var j=T.generateId();L=L||{},I(N)&&(N=l.appendHTMLElement("div")),u(N,"tui-view-"+j),this.id=j,this.container=N,this.childs=new c(function(b){return b.id}),this.parent=null}e(P,"View"),P.prototype.addChild=function(L,N){N&&N.call(L,this),L.parent=this,this.childs.add(L)},P.prototype.removeChild=function(L,N){var j=y(L)?this.childs.items[L]:L;N&&N.call(j,this),this.childs.remove(j.id)},P.prototype.render=function(){this.childs.each(function(L){L.render()})},P.prototype.recursive=function(L,N){x(L)&&(N||L(this),this.childs.each(function(j){j.recursive(L)}))},P.prototype.resize=function(){for(var L=Array.prototype.slice.call(arguments),N=this.parent;N;)x(N._onResize)&&N._onResize.apply(N,L),N=N.parent},P.prototype._beforeDestroy=function(){},P.prototype._destroy=function(){this._beforeDestroy(),this.container.innerHTML="",this.id=this.parent=this.childs=this.container=null},P.prototype.destroy=function(L){this.childs&&(this.childs.each(function(N){N.destroy(!0),N._destroy()}),this.childs.clear()),!L&&this._destroy()},P.prototype.getViewBound=function(){var L=this.container.getBoundingClientRect();return{x:L.left,y:L.top,width:L.right-L.left,height:L.bottom-L.top}},S.exports=P},function(S,v,t){"use strict";var u={appendHTMLElement:function(x,y,I){var l=document.createElement(x);return l.className=I||"",y?y.appendChild(l):document.body.appendChild(l),l}};S.exports=u},function(S,v,t){"use strict";var u=t(0),x=t(20),y=t(11),I=t(21),l=t(1),c=t(13),T=t(2),P=/\s+/g;function L(){this.events=null,this.contexts=null}e(L,"CustomEvents"),L.mixin=function(N){u(N.prototype,L.prototype)},L.prototype._getHandlerItem=function(N,j){var b={handler:N};return j&&(b.context=j),b},L.prototype._safeEvent=function(N){var j=this.events,b;return j||(j=this.events={}),N&&(b=j[N],b||(b=[],j[N]=b),j=b),j},L.prototype._safeContext=function(){var N=this.contexts;return N||(N=this.contexts=[]),N},L.prototype._indexOfContext=function(N){for(var j=this._safeContext(),b=0;j[b];){if(N===j[b][0])return b;b+=1}return-1},L.prototype._memorizeContext=function(N){var j,b;x(N)&&(j=this._safeContext(),b=this._indexOfContext(N),b>-1?j[b][1]+=1:j.push([N,1]))},L.prototype._forgetContext=function(N){var j,b;x(N)&&(j=this._safeContext(),b=this._indexOfContext(N),b>-1&&(j[b][1]-=1,j[b][1]<=0&&j.splice(b,1)))},L.prototype._bindEvent=function(N,j,b){var r=this._safeEvent(N);this._memorizeContext(b),r.push(this._getHandlerItem(j,b))},L.prototype.on=function(N,j,b){var r=this;y(N)?(N=N.split(P),T(N,function(m){r._bindEvent(m,j,b)})):I(N)&&(b=j,T(N,function(m,p){r.on(p,m,b)}))},L.prototype.once=function(N,j,b){var r=this;if(I(N)){b=j,T(N,function(p,i){r.once(i,p,b)});return}function m(){j.apply(b,arguments),r.off(N,m,b)}e(m,"onceHandler"),this.on(N,m,b)},L.prototype._spliceMatches=function(N,j){var b=0,r;if(l(N))for(r=N.length;b<r;b+=1)j(N[b])===!0&&(N.splice(b,1),r-=1,b-=1)},L.prototype._matchHandler=function(N){var j=this;return function(b){var r=N===b.handler;return r&&j._forgetContext(b.context),r}},L.prototype._matchContext=function(N){var j=this;return function(b){var r=N===b.context;return r&&j._forgetContext(b.context),r}},L.prototype._matchHandlerAndContext=function(N,j){var b=this;return function(r){var m=N===r.handler,p=j===r.context,i=m&&p;return i&&b._forgetContext(r.context),i}},L.prototype._offByEventName=function(N,j){var b=this,r=c(j),m=b._matchHandler(j);N=N.split(P),T(N,function(p){var i=b._safeEvent(p);r?b._spliceMatches(i,m):(T(i,function(a){b._forgetContext(a.context)}),b.events[p]=[])})},L.prototype._offByHandler=function(N){var j=this,b=this._matchHandler(N);T(this._safeEvent(),function(r){j._spliceMatches(r,b)})},L.prototype._offByObject=function(N,j){var b=this,r;this._indexOfContext(N)<0?T(N,function(m,p){b.off(p,m)}):y(j)?(r=this._matchContext(N),b._spliceMatches(this._safeEvent(j),r)):c(j)?(r=this._matchHandlerAndContext(j,N),T(this._safeEvent(),function(m){b._spliceMatches(m,r)})):(r=this._matchContext(N),T(this._safeEvent(),function(m){b._spliceMatches(m,r)}))},L.prototype.off=function(N,j){y(N)?this._offByEventName(N,j):arguments.length?c(N)?this._offByHandler(N):I(N)&&this._offByObject(N,j):(this.events={},this.contexts=[])},L.prototype.fire=function(N){this.invoke.apply(this,arguments)},L.prototype.invoke=function(N){var j,b,r,m;if(!this.hasListener(N))return!0;for(j=this._safeEvent(N),b=Array.prototype.slice.call(arguments,1),r=0;j[r];){if(m=j[r],m.handler.apply(m.context,b)===!1)return!1;r+=1}return!0},L.prototype.hasListener=function(N){return this.getListenerLength(N)>0},L.prototype.getListenerLength=function(N){var j=this._safeEvent(N);return j.length},S.exports=L},function(S,v,t){"use strict";function u(x){return typeof x=="string"||x instanceof String}e(u,"isString"),S.exports=u},function(S,v,t){"use strict";var u=/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i,x={leadingZero:function(y,I){var l="",c=0;if((y+"").length>I)return y+"";for(;c<I-1;c+=1)l+="0";return(l+y).slice(I*-1)},isValidRGB:function(y){return u.test(y)},hexToRGB:function(y){var I,l,c;return x.isValidRGB(y)?(y=y.substring(1),I=parseInt(y.substr(0,2),16),l=parseInt(y.substr(2,2),16),c=parseInt(y.substr(4,2),16),[I,l,c]):!1},rgbToHEX:function(y,I,l){var c="#"+x.leadingZero(y.toString(16),2)+x.leadingZero(I.toString(16),2)+x.leadingZero(l.toString(16),2);return x.isValidRGB(c)?c:!1},rgbToHSV:function(y,I,l){var c,T,P,L,N,j;if(y/=255,I/=255,l/=255,c=Math.max(y,I,l),T=Math.min(y,I,l),N=c,j=c-T,L=c===0?0:j/c,c===T)P=0;else{switch(c){case y:P=(I-l)/j+(I<l?6:0);break;case I:P=(l-y)/j+2;break;case l:P=(y-I)/j+4;break}P/=6}return[Math.round(P*360),Math.round(L*100),Math.round(N*100)]},hsvToRGB:function(y,I,l){var c,T,P,L,N,j,b,r;if(y=Math.max(0,Math.min(360,y)),I=Math.max(0,Math.min(100,I)),l=Math.max(0,Math.min(100,l)),I/=100,l/=100,I===0)return c=T=P=l,[Math.round(c*255),Math.round(T*255),Math.round(P*255)];switch(y/=60,L=Math.floor(y),N=y-L,j=l*(1-I),b=l*(1-I*N),r=l*(1-I*(1-N)),L){case 0:c=l,T=r,P=j;break;case 1:c=b,T=l,P=j;break;case 2:c=j,T=l,P=r;break;case 3:c=j,T=b,P=l;break;case 4:c=r,T=j,P=l;break;default:c=l,T=j,P=b;break}return[Math.round(c*255),Math.round(T*255),Math.round(P*255)]}};S.exports=x},function(S,v,t){"use strict";function u(x){return x instanceof Function}e(u,"isFunction"),S.exports=u},function(S,v,t){"use strict";var u=t(11),x=t(2),y=t(26);function I(T,P,L,N){if(u(P)){x(P.split(/\s+/g),function(j){l(T,j,L,N)});return}x(P,function(j,b){l(T,b,j,L)})}e(I,"on");function l(T,P,L,N){function j(b){L.call(N||T,b||window.event)}e(j,"eventHandler"),"addEventListener"in T?T.addEventListener(P,j):"attachEvent"in T&&T.attachEvent("on"+P,j),c(T,P,L,j)}e(l,"bindEvent");function c(T,P,L,N){var j=y(T,P),b=!1;x(j,function(r){return r.handler===L?(b=!0,!1):!0}),b||j.push({handler:L,wrappedHandler:N})}e(c,"memorizeHandler"),S.exports=I},function(S,v,t){"use strict";function u(x){if(x.preventDefault){x.preventDefault();return}x.returnValue=!1}e(u,"preventDefault"),S.exports=u},function(S,v,t){"use strict";function u(x){return x.replace(/([A-Z])/g,function(y){return"-"+y.toLowerCase()})}e(u,"convertToKebabCase"),S.exports=u},function(S,v,t){"use strict";var u=t(11),x=t(2),y=t(26);function I(T,P,L){if(u(P)){x(P.split(/\s+/g),function(N){l(T,N,L)});return}x(P,function(N,j){l(T,j,N)})}e(I,"off");function l(T,P,L){var N=y(T,P),j;L?(x(N,function(b,r){return L===b.handler?(c(T,P,b.wrappedHandler),j=r,!1):!0}),N.splice(j,1)):(x(N,function(b){c(T,P,b.wrappedHandler)}),N.splice(0,N.length))}e(l,"unbindEvent");function c(T,P,L){"removeEventListener"in T?T.removeEventListener(P,L):"detachEvent"in T&&T.detachEvent("on"+P,L)}e(c,"removeHandler"),S.exports=I},function(S,v,t){"use strict";var u=t(50);function x(y,I){var l=u(I.prototype);l.constructor=y,y.prototype=l}e(x,"inherit"),S.exports=x},function(S,v,t){"use strict";var u=t(6),x=t(7),y=t(0),I=t(1),l=t(20),c=t(13),T=t(21),P=t(4),L=Array.prototype.slice;function N(j){this.items={},this.length=0,c(j)&&(this.getItemID=j)}e(N,"Collection"),N.and=function(j){var b;return j=L.call(arguments),b=j.length,function(r){for(var m=0;m<b;m+=1)if(!j[m].call(null,r))return!1;return!0}},N.or=function(j){var b;return j=L.call(arguments),b=j.length,function(r){for(var m=1,p=j[0].call(null,r);m<b;m+=1)p=p||j[m].call(null,r);return p}},N.merge=function(j){var b={},r=new N(j.getItemID);return u(arguments,function(m){y(b,m.items)}),r.items=b,r.length=P.getLength(r.items),r},N.prototype.getItemID=function(j){return j._id+""},N.prototype.add=function(j){var b,r;if(arguments.length>1){u(L.call(arguments),function(m){this.add(m)},this);return}b=this.getItemID(j),r=this.items,r[b]||(this.length+=1),r[b]=j},N.prototype.remove=function(j){var b=[],r,m;return this.length?arguments.length>1?(b=P.map(L.call(arguments),function(p){return this.remove(p)},this),b):(r=this.items,T(j)&&(j=this.getItemID(j)),r[j]?(this.length-=1,m=r[j],delete r[j],m):b):b},N.prototype.clear=function(){this.items={},this.length=0},N.prototype.has=function(j){var b,r;return this.length?(b=c(j),r=!1,b?this.each(function(m){return j(m)===!0?(r=!0,!1):!0}):(j=T(j)?this.getItemID(j):j,r=l(this.items[j])),r):!1},N.prototype.doWhenHas=function(j,b,r){var m=this.items[j];l(m)&&b.call(r||this,m)},N.prototype.find=function(j){var b=new N;return this.hasOwnProperty("getItemID")&&(b.getItemID=this.getItemID),this.each(function(r){j(r)===!0&&b.add(r)}),b},N.prototype.groupBy=function(j,b){var r={},m=c(j),p=this.getItemID,i,a;if(I(j)){if(u(j,function(n){r[n+""]=new N(p)}),!b)return r;j=b,m=!0}return this.each(function(n){m?a=j(n):(a=n[j],c(a)&&(a=a.apply(n))),i=r[a],i||(i=r[a]=new N(p)),i.add(n)}),r},N.prototype.single=function(){var j;return this.each(function(b){return j=b,!1},this),j},N.prototype.sort=function(j){var b=[];return this.each(function(r){b.push(r)}),c(j)&&(b=b.sort(j)),b},N.prototype.each=function(j,b){x(this.items,j,b||this)},N.prototype.toArray=function(){return this.length?P.map(this.items,function(j){return j}):[]},S.exports=N},function(S,v,t){"use strict";var u=t(3),x=t(36);function y(I){return!u(I)&&!x(I)}e(y,"isExisty"),S.exports=y},function(S,v,t){"use strict";function u(x){return x===Object(x)}e(u,"isObject"),S.exports=u},function(S,v,t){"use strict";var u={chrome:!1,firefox:!1,safari:!1,msie:!1,edge:!1,others:!1,version:0};typeof window!="undefined"&&window.navigator&&x();function x(){var y=window.navigator,I=y.appName.replace(/\s/g,"_"),l=y.userAgent,c=/MSIE\s([0-9]+[.0-9]*)/,T=/Trident.*rv:11\./,P=/Edge\/(\d+)\./,L={firefox:/Firefox\/(\d+)\./,chrome:/Chrome\/(\d+)\./,safari:/Version\/([\d.]+).*Safari\/(\d+)/},N,j,b={Microsoft_Internet_Explorer:function(){var m=l.match(c);m?(u.msie=!0,u.version=parseFloat(m[1])):u.others=!0},Netscape:function(){var m=!1;if(T.exec(l))u.msie=!0,u.version=11,m=!0;else if(P.exec(l))u.edge=!0,u.version=l.match(P)[1],m=!0;else for(N in L)if(L.hasOwnProperty(N)&&(j=l.match(L[N]),j&&j.length>1)){u[N]=m=!0,u.version=parseFloat(j[1]||0);break}m||(u.others=!0)}},r=b[I];r&&b[I]()}e(x,"detectBrowser"),S.exports=u},function(S,v,t){"use strict";var u=t(3);function x(y){return!y||!y.className?"":u(y.className.baseVal)?y.className:y.className.baseVal}e(x,"getClass"),S.exports=x},function(S,v,t){"use strict";(function(u){var x=t(10),y=t(42),I=t(44),l=t(47),c=t(28),T=t(17),P=t(14),L=t(15),N=t(0);function j(b,r){P(r,"mousedown",this._onMouseDown,this),this.options=N({distance:10},b),this.container=r,this._isMoved=!1,this._distance=0,this._dragStartFired=!1,this._dragStartEventData=null}e(j,"Drag"),j.prototype.destroy=function(){T(this.container,"mousedown",this._onMouseDown),this.options=this.container=this._isMoved=this._distance=this._dragStartFired=this._dragStartEventData=null},j.prototype._toggleDragEvent=function(b){var r=this.container;b?(y(r),P(window,"dragstart",L),P(u.document,{mousemove:this._onMouseMove,mouseup:this._onMouseUp},this)):(I(r),T(window,"dragstart",L),T(u.document,{mousemove:this._onMouseMove,mouseup:this._onMouseUp}))},j.prototype._getEventData=function(b){return{target:c(b),originEvent:b}},j.prototype._onMouseDown=function(b){l(b)===0&&(this._distance=0,this._dragStartFired=!1,this._dragStartEventData=this._getEventData(b),this._toggleDragEvent(!0))},j.prototype._onMouseMove=function(b){var r=this.options.distance;if(L(b),this._isMoved=!0,this._distance<r){this._distance+=1;return}if(!this._dragStartFired&&(this._dragStartFired=!0,!this.invoke("dragStart",this._dragStartEventData))){this._toggleDragEvent(!1);return}this.fire("drag",this._getEventData(b))},j.prototype._onMouseUp=function(b){if(this._toggleDragEvent(!1),this._isMoved){this._isMoved=!1,this.fire("dragEnd",this._getEventData(b));return}this.fire("click",this._getEventData(b))},x.mixin(j),S.exports=j}).call(this,t(25))},function(S,v){var t;t=function(){return this}();try{t=t||new Function("return this")()}catch{typeof window=="object"&&(t=window)}S.exports=t},function(S,v,t){"use strict";var u="_feEventKey";function x(y,I){var l=y[u],c;return l||(l=y[u]={}),c=l[I],c||(c=l[I]=[]),c}e(x,"safeEvent"),S.exports=x},function(S,v,t){"use strict";function u(x){var y=document.documentElement.style,I,l;for(I=0,l=x.length;I<l;I+=1)if(x[I]in y)return x[I];return!1}e(u,"testCSSProp"),S.exports=u},function(S,v,t){"use strict";function u(x){return x.target||x.srcElement}e(u,"getTarget"),S.exports=u},function(S,v,t){"use strict";var u=t(10),x=t(28),y=t(17),I=t(14),l=t(30),c=t(0),T=t(18),P=t(9),L=t(12),N=t(8),j=t(51);function b(r,m){this.options=c({cssPrefix:"tui-colorpicker-",preset:["#181818","#282828","#383838","#585858","#B8B8B8","#D8D8D8","#E8E8E8","#F8F8F8","#AB4642","#DC9656","#F7CA88","#A1B56C","#86C1B9","#7CAFC2","#BA8BAF","#A16946"],detailTxt:"Detail"},r),m=P.appendHTMLElement("div",m,this.options.cssPrefix+"palette-container"),N.call(this,r,m)}e(b,"Palette"),T(b,N),b.prototype._onClick=function(r){var m=this.options,p=x(r),i={};if(l(p,m.cssPrefix+"palette-button")){i.color=p.value,this.fire("_selectColor",i);return}l(p,m.cssPrefix+"palette-toggle-slider")&&this.fire("_toggleSlider")},b.prototype._onChange=function(r){var m=this.options,p=x(r),i={};l(p,m.cssPrefix+"palette-hex")&&(i.color=p.value,this.fire("_selectColor",i))},b.prototype._beforeDestroy=function(){this._toggleEvent(!1)},b.prototype._toggleEvent=function(r){var m=this.options,p=this.container,i=r?I:y,a;i(p,"click",this._onClick,this),a=p.querySelector("."+m.cssPrefix+"palette-hex",p),a&&i(a,"change",this._onChange,this)},b.prototype.render=function(r){var m=this.options,p="";this._toggleEvent(!1),p=j({cssPrefix:m.cssPrefix,preset:m.preset,detailTxt:m.detailTxt,color:r,isValidRGB:L.isValidRGB,getItemClass:function(i){return i?"":" "+m.cssPrefix+"color-transparent"},isSelected:function(i){return i===r?" "+m.cssPrefix+"selected":""}}),this.container.innerHTML=p,this._toggleEvent(!0)},u.mixin(b),S.exports=b},function(S,v,t){"use strict";var u=t(5),x=t(23);function y(I,l){var c;return I.classList?I.classList.contains(l):(c=x(I).split(/\s+/),u(l,c)>-1)}e(y,"hasClass"),S.exports=y},function(S,v,t){"use strict";var u=t(10),x=t(53),y=t(54),I=t(30),l=t(0),c=t(18),T=t(9),P=t(32),L=t(12),N=t(8),j=t(24),b=t(57),r=-7,m=112,p=-3,i=115,a=359.99;function n(f,_){_=T.appendHTMLElement("div",_,f.cssPrefix+"slider-container"),_.style.display="none",N.call(this,f,_),this.options=l({color:"#f8f8f8",cssPrefix:"tui-colorpicker-"},f),this._dragDataCache={},this.sliderHandleElement=null,this.huebarHandleElement=null,this.baseColorElement=null,this.drag=new j({distance:0},_),this.colorSliderPosLimitRange=[r,m],this.huebarPosLimitRange=[p,i],this.drag.on({dragStart:this._onDragStart,drag:this._onDrag,dragEnd:this._onDragEnd,click:this._onClick},this)}e(n,"Slider"),c(n,N),n.prototype._beforeDestroy=function(){this.drag.off(),this.drag=this.options=this._dragDataCache=this.sliderHandleElement=this.huebarHandleElement=this.baseColorElement=null},n.prototype.toggle=function(f){this.container.style.display=f?"block":"none"},n.prototype.isVisible=function(){return this.container.style.display==="block"},n.prototype.render=function(f){var _=this.container,h=this.options,E=b.layout,w,A;L.isValidRGB(f)&&(E=E.replace(/{{slider}}/,b.slider),E=E.replace(/{{huebar}}/,b.huebar),E=E.replace(/{{cssPrefix}}/g,h.cssPrefix),E=E.replace(/{{id}}/g,h.id),this.container.innerHTML=E,this.sliderSvgElement=_.querySelector("."+h.cssPrefix+"svg-slider"),this.huebarSvgElement=_.querySelector("."+h.cssPrefix+"svg-huebar"),this.sliderHandleElement=_.querySelector("."+h.cssPrefix+"slider-handle"),this.huebarHandleElement=_.querySelector("."+h.cssPrefix+"huebar-handle"),this.baseColorElement=_.querySelector("."+h.cssPrefix+"slider-basecolor"),w=L.hexToRGB(f),A=L.rgbToHSV.apply(null,w),this.moveHue(A[0],!0),this.moveSaturationAndValue(A[1],A[2],!0))},n.prototype._setColorSliderPosMax=function(){var f=this.sliderSvgElement.getClientRects()[0];f&&(this.colorSliderPosLimitRange[1]=f.height-10)},n.prototype._moveColorSliderHandle=function(f,_,h){var E=this.sliderHandleElement,w;_=Math.max(this.colorSliderPosLimitRange[0],_),_=Math.min(this.colorSliderPosLimitRange[1],_),f=Math.max(this.colorSliderPosLimitRange[0],f),f=Math.min(this.colorSliderPosLimitRange[1],f),P.setTranslateXY(E,f,_),w=_>50?"white":"black",P.setStrokeColor(E,w),h||this.fire("_selectColor",{color:L.rgbToHEX.apply(null,this.getRGB())})},n.prototype.moveSaturationAndValue=function(f,_,h){var E,w,A,D;f=f||0,_=_||0,E=Math.abs(this.colorSliderPosLimitRange[0]),w=this.colorSliderPosLimitRange[1],A=f*w/100-E,D=w-_*w/100-E,this._moveColorSliderHandle(A,D,h)},n.prototype._moveColorSliderByPosition=function(f,_){var h=this.colorSliderPosLimitRange[0];this._moveColorSliderHandle(f+h,_+h)},n.prototype.getSaturationAndValue=function(){var f=Math.abs(this.colorSliderPosLimitRange[0]),_=f+this.colorSliderPosLimitRange[1],h=P.getTranslateXY(this.sliderHandleElement),E,w;return E=(h[1]+f)/_*100,w=100-(h[0]+f)/_*100,[E,w]},n.prototype._setHueBarPosMax=function(){var f=this.huebarSvgElement.getClientRects()[0];f&&(this.huebarPosLimitRange[1]=f.height-7)},n.prototype._moveHueHandle=function(f,_){var h=this.huebarHandleElement,E=this.baseColorElement,w,A;f=Math.max(this.huebarPosLimitRange[0],f),f=Math.min(this.huebarPosLimitRange[1],f),P.setTranslateY(h,f),w=L.hsvToRGB(this.getHue(),100,100),A=L.rgbToHEX.apply(null,w),P.setGradientColorStop(E,A),_||this.fire("_selectColor",{color:L.rgbToHEX.apply(null,this.getRGB())})},n.prototype.moveHue=function(f,_){var h=0,E,w;E=Math.abs(this.huebarPosLimitRange[0]),w=E+this.huebarPosLimitRange[1],f=f||0,h=w*f/a-E,this._moveHueHandle(h,_)},n.prototype._moveHueByPosition=function(f){var _=this.huebarPosLimitRange[0];this._moveHueHandle(f+_)},n.prototype.getHue=function(){var f=this.huebarHandleElement,_=P.getTranslateXY(f),h,E;return h=Math.abs(this.huebarPosLimitRange[0]),E=h+this.huebarPosLimitRange[1],(_[0]+h)*a/E},n.prototype.getHSV=function(){var f=this.getSaturationAndValue(),_=this.getHue();return[_].concat(f)},n.prototype.getRGB=function(){return L.hsvToRGB.apply(null,this.getHSV())},n.prototype._prepareColorSliderForMouseEvent=function(f){var _=this.options,h=y(f.target,"."+_.cssPrefix+"slider-part"),E;return E=this._dragDataCache={isColorSlider:I(h,_.cssPrefix+"slider-left"),parentElement:h},E},n.prototype._onClick=function(f){var _=this._prepareColorSliderForMouseEvent(f),h=x(f.originEvent,_.parentElement);_.isColorSlider?this._moveColorSliderByPosition(h[0],h[1]):this._moveHueByPosition(h[1]),this._dragDataCache=null},n.prototype._onDragStart=function(f){this._setColorSliderPosMax(),this._setHueBarPosMax(),this._prepareColorSliderForMouseEvent(f)},n.prototype._onDrag=function(f){var _=this._dragDataCache,h=x(f.originEvent,_.parentElement);_.isColorSlider?this._moveColorSliderByPosition(h[0],h[1]):this._moveHueByPosition(h[1])},n.prototype._onDragEnd=function(){this._dragDataCache=null},u.mixin(n),S.exports=n},function(S,v,t){"use strict";var u=t(4).isOldBrowser,x=/[\.\-0-9]+/g,y=-6,I={getTranslateXY:function(l){var c;return u?(c=l.style,[parseFloat(c.top),parseFloat(c.left)]):(c=l.getAttribute("transform"),c?(c=c.match(x),[parseFloat(c[1]),parseFloat(c[0])]):[0,0])},setTranslateXY:function(l,c,T){u?(l.style.left=c+"px",l.style.top=T+"px"):l.setAttribute("transform","translate("+c+","+T+")")},setTranslateY:function(l,c){u?l.style.top=c+"px":l.setAttribute("transform","translate("+y+","+c+")")},setStrokeColor:function(l,c){u?l.strokecolor=c:l.setAttribute("stroke",c)},setGradientColorStop:function(l,c){u?l.color=c:l.setAttribute("stop-color",c)}};S.exports=I},function(S,v,t){t(34),S.exports=t(35)},function(S,v,t){},function(S,v,t){"use strict";var u=t(19),x=t(8),y=t(24),I=t(48),l=t(29),c=t(31),T=t(12),P=t(32),L={Collection:u,View:x,Drag:y,create:I,Palette:l,Slider:c,colorutil:T,svgvml:P};S.exports=L},function(S,v,t){"use strict";function u(x){return x===null}e(u,"isNull"),S.exports=u},function(S,v,t){"use strict";var u=t(3),x=t(38),y=7*24*60*60*1e3;function I(c){var T=new Date().getTime();return T-c>y}e(I,"isExpired");function l(c,T){var P="https://www.google-analytics.com/collect",L=location.hostname,N="event",j="use",b="TOAST UI "+c+" for "+L+": Statistics",r=window.localStorage.getItem(b);!u(window.tui)&&window.tui.usageStatistics===!1||r&&!I(r)||(window.localStorage.setItem(b,new Date().getTime()),setTimeout(function(){(document.readyState==="interactive"||document.readyState==="complete")&&x(P,{v:1,t:N,tid:T,cid:L,dp:L,dh:c,el:c,ec:j})},1e3))}e(l,"sendHostname"),S.exports=l},function(S,v,t){"use strict";var u=t(7);function x(y,I){var l=document.createElement("img"),c="";return u(I,function(T,P){c+="&"+P+"="+T}),c=c.substring(1),l.src=y+"?"+c,l.style.display="none",document.body.appendChild(l),document.body.removeChild(l),l}e(x,"imagePing"),S.exports=x},function(S,v,t){"use strict";var u=t(2),x=t(5),y=t(23),I=t(40);function l(c){var T=Array.prototype.slice.call(arguments,1),P=c.classList,L=[],N;if(P){u(T,function(j){c.classList.add(j)});return}N=y(c),N&&(T=[].concat(N.split(/\s+/),T)),u(T,function(j){x(j,L)<0&&L.push(j)}),I(c,L)}e(l,"addClass"),S.exports=l},function(S,v,t){"use strict";var u=t(1),x=t(3);function y(I,l){if(l=u(l)?l.join(" "):l,l=l.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),x(I.className.baseVal)){I.className=l;return}I.className.baseVal=l}e(y,"setClassName"),S.exports=y},function(S,v,t){"use strict";function u(x){return typeof x=="number"||x instanceof Number}e(u,"isNumber"),S.exports=u},function(S,v,t){"use strict";var u=t(14),x=t(15),y=t(43),I=t(27),l="onselectstart"in document,c="prevUserSelect",T=I(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);function P(L){L||(L=document),l?u(L,"selectstart",x):(L=L===document?document.documentElement:L,y(L,c,L.style[T]),L.style[T]="none")}e(P,"disableTextSelection"),S.exports=P},function(S,v,t){"use strict";var u=t(16);function x(y,I,l){if(y.dataset){y.dataset[I]=l;return}y.setAttribute("data-"+u(I),l)}e(x,"setData"),S.exports=x},function(S,v,t){"use strict";var u=t(17),x=t(15),y=t(45),I=t(46),l=t(27),c="onselectstart"in document,T="prevUserSelect",P=l(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);function L(N){N||(N=document),c?u(N,"selectstart",x):(N=N===document?document.documentElement:N,N.style[P]=y(N,T)||"auto",I(N,T))}e(L,"enableTextSelection"),S.exports=L},function(S,v,t){"use strict";var u=t(16);function x(y,I){return y.dataset?y.dataset[I]:y.getAttribute("data-"+u(I))}e(x,"getData"),S.exports=x},function(S,v,t){"use strict";var u=t(16);function x(y,I){if(y.dataset){delete y.dataset[I];return}y.removeAttribute("data-"+u(I))}e(x,"removeData"),S.exports=x},function(S,v,t){"use strict";var u=t(22),x=t(5),y=["0","1","3","5","7"],I=["2","6"],l=["4"];function c(P){return u.msie&&u.version<=8?T(P):P.button}e(c,"getMouseButton");function T(P){var L=String(P.button);return x(L,y)>-1?0:x(L,I)>-1?2:x(L,l)>-1?1:null}e(T,"getMouseButtonIE8AndEarlier"),S.exports=c},function(S,v,t){"use strict";var u=t(10),x=t(0),y=t(4),I=t(12),l=t(49),c=t(29),T=t(31),P=0;function L(){return P+=1,P}e(L,"generateId");function N(j){var b;if(!(this instanceof N))return new N(j);if(j=this.options=x({container:null,color:"#f8f8f8",preset:["#181818","#282828","#383838","#585858","#b8b8b8","#d8d8d8","#e8e8e8","#f8f8f8","#ab4642","#dc9656","#f7ca88","#a1b56c","#86c1b9","#7cafc2","#ba8baf","#a16946"],cssPrefix:"tui-colorpicker-",detailTxt:"Detail",id:L(),usageStatistics:!0},j),!j.container)throw new Error("ColorPicker(): need container option.");b=this.layout=new l(j,j.container),this.palette=new c(j,b.container),this.palette.on({_selectColor:this._onSelectColorInPalette,_toggleSlider:this._onToggleSlider},this),this.slider=new T(j,b.container),this.slider.on("_selectColor",this._onSelectColorInSlider,this),b.addChild(this.palette),b.addChild(this.slider),this.render(j.color),j.usageStatistics&&y.sendHostName()}e(N,"ColorPicker"),N.prototype._onSelectColorInPalette=function(j){var b=j.color,r=this.options;if(!I.isValidRGB(b)&&b!==""){this.render();return}this.fire("selectColor",{color:b,origin:"palette"}),r.color!==b&&(r.color=b,this.render(b))},N.prototype._onToggleSlider=function(){this.slider.toggle(!this.slider.isVisible())},N.prototype._onSelectColorInSlider=function(j){var b=j.color,r=this.options;this.fire("selectColor",{color:b,origin:"slider"}),r.color!==b&&(r.color=b,this.palette.render(b))},N.prototype.setColor=function(j){if(!I.isValidRGB(j))throw new Error("ColorPicker#setColor(): need valid hex string color value");this.options.color=j,this.render(j)},N.prototype.getColor=function(){return this.options.color},N.prototype.toggle=function(j){this.layout.container.style.display=j?"block":"none"},N.prototype.render=function(j){this.layout.render(j||this.options.color)},N.prototype.destroy=function(){this.layout.destroy(),this.options.container.innerHTML="",this.layout=this.slider=this.palette=this.options=null},u.mixin(N),S.exports=N},function(S,v,t){"use strict";var u=t(0),x=t(18),y=t(9),I=t(8);function l(c,T){this.options=u({cssPrefix:"tui-colorpicker-"},c),T=y.appendHTMLElement("div",T,this.options.cssPrefix+"container"),I.call(this,c,T),this.render()}e(l,"Layout"),x(l,I),l.prototype.render=function(c){this.recursive(function(T){T.render(c)},!0)},S.exports=l},function(S,v,t){"use strict";function u(x){function y(){}return e(y,"F"),y.prototype=x,new y}e(u,"createObject"),S.exports=u},function(S,v,t){"use strict";var u=t(52);S.exports=function(x){var y=['<li><input class="{{cssPrefix}}palette-button{{isSelected @this}}{{getItemClass @this}}" type="button"',"{{if isValidRGB @this}}",' style="background-color:{{@this}};color:{{@this}}"',"{{/if}}",'title="{{@this}}" value="{{@this}}" /></li>'].join(""),I=['<ul class="{{cssPrefix}}clearfix">',"{{each preset}}",y,"{{/each}}","</ul>",'<div class="{{cssPrefix}}clearfix" style="overflow:hidden">','<input type="button" class="{{cssPrefix}}palette-toggle-slider" value="{{detailTxt}}" />','<input type="text" class="{{cssPrefix}}palette-hex" value="{{color}}" maxlength="7" />','<span class="{{cssPrefix}}palette-preview" style="background-color:{{color}};color:{{color}}">{{color}}</span>',"</div>"].join(` `);return u(I,x)}},function(S,v,t){"use strict";var u=t(5),x=t(2),y=t(1),I=t(11),l=t(0),c=/{{\s?|\s?}}/g,T=/^[a-zA-Z0-9_@]+\[[a-zA-Z0-9_@"']+\]$/,P=/\[\s?|\s?\]/,L=/^[a-zA-Z_]+\.[a-zA-Z_]+$/,N=/\./,j=/^["']\w+["']$/,b=/"|'/g,r=/^-?\d+\.?\d*$/,m=2,p={if:_,each:h,with:E},i="a".split(/a/).length===3,a=function(){return i?function(H,V){return H.split(V)}:function(H,V){var lt=[],rt=0,St,q;for(V.global||(V=new RegExp(V,"g")),St=V.exec(H);St!==null;)q=St.index,lt.push(H.slice(rt,q)),rt=q+St[0].length,St=V.exec(H);return lt.push(H.slice(rt)),lt}}();function n(H,V){var lt,rt=V[H];return H==="true"?rt=!0:H==="false"?rt=!1:j.test(H)?rt=H.replace(b,""):T.test(H)?(lt=H.split(P),rt=n(lt[0],V)[n(lt[1],V)]):L.test(H)?(lt=H.split(N),rt=n(lt[0],V)[lt[1]]):r.test(H)&&(rt=parseFloat(H)),rt}e(n,"getValueFromContext");function f(H,V){var lt=[H],rt=[],St=0,q=0;return x(V,function(_t,G){_t.indexOf("if")===0?St+=1:_t==="/if"?St-=1:!St&&(_t.indexOf("elseif")===0||_t==="else")&&(lt.push(_t==="else"?["true"]:_t.split(" ").slice(1)),rt.push(V.slice(q,G)),q=G+1)}),rt.push(V.slice(q)),{exps:lt,sourcesInsideIf:rt}}e(f,"extractElseif");function _(H,V,lt){var rt=f(H,V),St=!1,q="";return x(rt.exps,function(_t,G){return St=D(_t,lt),St&&(q=B(rt.sourcesInsideIf[G],lt)),!St}),q}e(_,"handleIf");function h(H,V,lt){var rt=D(H,lt),St=y(rt)?"@index":"@key",q={},_t="";return x(rt,function(G,Ut){q[St]=Ut,q["@this"]=G,l(lt,q),_t+=B(V.slice(),lt)}),_t}e(h,"handleEach");function E(H,V,lt){var rt=u("as",H),St=H[rt+1],q=D(H.slice(0,rt),lt),_t={};return _t[St]=q,B(V,l(lt,_t))||""}e(E,"handleWith");function w(H,V,lt){var rt=H.splice(V+1,lt-V);return rt.pop(),rt}e(w,"extractSourcesInsideBlock");function A(H,V,lt){for(var rt=p[H],St=1,q=0,_t,G=q+m,Ut=V[G];St&&I(Ut);)Ut.indexOf(H)===0?St+=1:Ut.indexOf("/"+H)===0&&(St-=1,_t=G),G+=m,Ut=V[G];if(St)throw Error(H+" needs {{/"+H+"}} expression.");return V[q]=rt(V[q].split(" ").slice(1),w(V,q,_t),lt),V}e(A,"handleBlockHelper");function D(H,V){var lt=n(H[0],V);return lt instanceof Function?z(lt,H.slice(1),V):lt}e(D,"handleExpression");function z(H,V,lt){var rt=[];return x(V,function(St){rt.push(n(St,lt))}),H.apply(null,rt)}e(z,"executeFunction");function B(H,V){for(var lt=1,rt=H[lt],St,q,_t;I(rt);)St=rt.split(" "),q=St[0],p[q]?(_t=A(q,H.splice(lt,H.length-lt),V),H=H.concat(_t)):H[lt]=D(St,V),lt+=m,rt=H[lt];return H.join("")}e(B,"compile");function Y(H,V){return B(a(H,c),V)}e(Y,"template"),S.exports=Y},function(S,v,t){"use strict";var u=t(1);function x(y,I){var l=u(y),c=l?y[0]:y.clientX,T=l?y[1]:y.clientY,P;return I?(P=I.getBoundingClientRect(),[c-P.left-I.clientLeft,T-P.top-I.clientTop]):[c,T]}e(x,"getMousePosition"),S.exports=x},function(S,v,t){"use strict";var u=t(55);function x(y,I){var l=y.parentNode;if(u(y,I))return y;for(;l&&l!==document;){if(u(l,I))return l;l=l.parentNode}return null}e(x,"closest"),S.exports=x},function(S,v,t){"use strict";var u=t(5),x=t(56),y=Element.prototype,I=y.matches||y.webkitMatchesSelector||y.mozMatchesSelector||y.msMatchesSelector||function(c){var T=this.document||this.ownerDocument;return u(this,x(T.querySelectorAll(c)))>-1};function l(c,T){return I.call(c,T)}e(l,"matches"),S.exports=l},function(S,v,t){"use strict";var u=t(6);function x(y){var I;try{I=Array.prototype.slice.call(y)}catch{I=[],u(y,function(c){I.push(c)})}return I}e(x,"toArray"),S.exports=x},function(S,v,t){"use strict";(function(u){var x=t(4).isOldBrowser,y=['<div class="{{cssPrefix}}slider-left {{cssPrefix}}slider-part">{{slider}}</div>','<div class="{{cssPrefix}}slider-right {{cssPrefix}}slider-part">{{huebar}}</div>'].join(`
|
|
2
|
-
`),I=['<svg class="{{cssPrefix}}svg {{cssPrefix}}svg-slider">',"<defs>",'<linearGradient id="{{cssPrefix}}svg-fill-color-{{id}}" x1="0%" y1="0%" x2="100%" y2="0%">','<stop offset="0%" stop-color="rgb(255,255,255)" />','<stop class="{{cssPrefix}}slider-basecolor" offset="100%" stop-color="rgb(255,0,0)" />',"</linearGradient>",'<linearGradient id="{{cssPrefix}}svn-fill-black-{{id}}" x1="0%" y1="0%" x2="0%" y2="100%">','<stop offset="0%" style="stop-color:rgb(0,0,0);stop-opacity:0" />','<stop offset="100%" style="stop-color:rgb(0,0,0);stop-opacity:1" />',"</linearGradient>","</defs>",'<rect width="100%" height="100%" fill="url(#{{cssPrefix}}svg-fill-color-{{id}})"></rect>','<rect width="100%" height="100%" fill="url(#{{cssPrefix}}svn-fill-black-{{id}})"></rect>','<path transform="translate(0,0)" class="{{cssPrefix}}slider-handle" d="M0 7.5 L15 7.5 M7.5 15 L7.5 0 M2 7 a5.5 5.5 0 1 1 0 1 Z" stroke="black" stroke-width="0.75" fill="none" />',"</svg>"].join(` `),l=['<div class="{{cssPrefix}}vml-slider">','<v:rect strokecolor="none" class="{{cssPrefix}}vml {{cssPrefix}}vml-slider-bg">','<v:fill class="{{cssPrefix}}vml {{cssPrefix}}slider-basecolor" type="gradient" method="none" color="#ff0000" color2="#fff" angle="90" />',"</v:rect>",'<v:rect strokecolor="#ccc" class="{{cssPrefix}}vml {{cssPrefix}}vml-slider-bg">','<v:fill type="gradient" method="none" color="black" color2="white" o:opacity2="0%" class="{{cssPrefix}}vml" />',"</v:rect>",'<v:shape class="{{cssPrefix}}vml {{cssPrefix}}slider-handle" coordsize="1 1" style="width:1px;height:1px;"path="m 0,7 l 14,7 m 7,14 l 7,0 ar 12,12 2,2 z" filled="false" stroked="true" />',"</div>"].join(` `),c=['<svg class="{{cssPrefix}}svg {{cssPrefix}}svg-huebar">',"<defs>",'<linearGradient id="g-{{id}}" x1="0%" y1="0%" x2="0%" y2="100%">','<stop offset="0%" stop-color="rgb(255,0,0)" />','<stop offset="16.666%" stop-color="rgb(255,255,0)" />','<stop offset="33.333%" stop-color="rgb(0,255,0)" />','<stop offset="50%" stop-color="rgb(0,255,255)" />','<stop offset="66.666%" stop-color="rgb(0,0,255)" />','<stop offset="83.333%" stop-color="rgb(255,0,255)" />','<stop offset="100%" stop-color="rgb(255,0,0)" />',"</linearGradient>","</defs>",'<rect width="18px" height="100%" fill="url(#g-{{id}})"></rect>','<path transform="translate(-6,-3)" class="{{cssPrefix}}huebar-handle" d="M0 0 L4 4 L0 8 L0 0 Z" fill="black" stroke="none" />',"</svg>"].join(` `),T=['<div class="{{cssPrefix}}vml-huebar">','<v:rect strokecolor="#ccc" class="{{cssPrefix}}vml {{cssPrefix}}vml-huebar-bg">','<v:fill type="gradient" method="none" colors="0% rgb(255,0,0), 16.666% rgb(255,255,0), 33.333% rgb(0,255,0), 50% rgb(0,255,255), 66.666% rgb(0,0,255), 83.333% rgb(255,0,255), 100% rgb(255,0,0)" angle="180" class="{{cssPrefix}}vml" />',"</v:rect>",'<v:shape class="{{cssPrefix}}vml {{cssPrefix}}huebar-handle" coordsize="1 1" style="width:1px;height:1px;position:absolute;z-index:1;right:22px;top:-3px;"path="m 0,0 l 4,4 l 0,8 l 0,0 z" filled="true" fillcolor="black" stroked="false" />',"</div>"].join(` `);x&&u.document.namespaces.add("v","urn:schemas-microsoft-com:vml"),S.exports={layout:y,slider:x?l:I,huebar:x?T:c}}).call(this,t(25))}])})});var Jh=$c((_a,El)=>{e(function(v,t){typeof _a=="object"&&typeof El=="object"?El.exports=t(Ca()):typeof define=="function"&&define.amd?define(["tui-color-picker"],t):typeof _a=="object"?_a.tui=t(Ca()):(v.tui=v.tui||{},v.tui.ImageEditor=t(v.tui.colorPicker))},"webpackUniversalModuleDefinition")(self,function(S){return function(){var v={2777:function(y,I,l){var c=c||{version:"4.6.0"};if(I.fabric=c,typeof document!="undefined"&&typeof window!="undefined")document instanceof(typeof HTMLDocument!="undefined"?HTMLDocument:Document)?c.document=document:c.document=document.implementation.createHTMLDocument(""),c.window=window;else{var T=l(4960),P=new T.JSDOM(decodeURIComponent("%3C!DOCTYPE%20html%3E%3Chtml%3E%3Chead%3E%3C%2Fhead%3E%3Cbody%3E%3C%2Fbody%3E%3C%2Fhtml%3E"),{features:{FetchExternalResources:["img"]},resources:"usable"}).window;c.document=P.document,c.jsdomImplForWrapper=l(6759).implForWrapper,c.nodeCanvas=l(6272).Canvas,c.window=P,DOMParser=c.window.DOMParser}c.isTouchSupported="ontouchstart"in c.window||"ontouchstart"in c.document||c.window&&c.window.navigator&&c.window.navigator.maxTouchPoints>0,c.isLikelyNode=typeof Buffer!="undefined"&&typeof window=="undefined",c.SHARED_ATTRIBUTES=["display","transform","fill","fill-opacity","fill-rule","opacity","stroke","stroke-dasharray","stroke-linecap","stroke-dashoffset","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","id","paint-order","vector-effect","instantiated_by_use","clip-path"],c.DPI=96,c.reNum="(?:[-+]?(?:\\d+|\\d*\\.\\d+)(?:[eE][-+]?\\d+)?)",c.commaWsp="(?:\\s+,?\\s*|,\\s*)",c.rePathCommand=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/ig,c.reNonWord=/[ \n\.,;!\?\-]/,c.fontPaths={},c.iMatrix=[1,0,0,1,0,0],c.svgNS="http://www.w3.org/2000/svg",c.perfLimitSizeTotal=2097152,c.maxCacheSideLimit=4096,c.minCacheSideLimit=256,c.charWidthsCache={},c.textureSize=2048,c.disableStyleCopyPaste=!1,c.enableGLFiltering=!0,c.devicePixelRatio=c.window.devicePixelRatio||c.window.webkitDevicePixelRatio||c.window.mozDevicePixelRatio||1,c.browserShadowBlurConstant=1,c.arcToSegmentsCache={},c.boundsOfCurveCache={},c.cachesBoundsOfCurve=!0,c.forceGLPutImageData=!1,c.initFilterBackend=function(){if(c.enableGLFiltering&&c.isWebglSupported&&c.isWebglSupported(c.textureSize))return console.log("max texture size: "+c.maxTextureSize),new c.WebglFilterBackend({tileSize:c.textureSize});if(c.Canvas2dFilterBackend)return new c.Canvas2dFilterBackend},typeof document!="undefined"&&typeof window!="undefined"&&(window.fabric=c),function(){function b(n,f){if(this.__eventListeners[n]){var _=this.__eventListeners[n];f?_[_.indexOf(f)]=!1:c.util.array.fill(_,!1)}}e(b,"_removeEventListener");function r(n,f){if(this.__eventListeners||(this.__eventListeners={}),arguments.length===1)for(var _ in n)this.on(_,n[_]);else this.__eventListeners[n]||(this.__eventListeners[n]=[]),this.__eventListeners[n].push(f);return this}e(r,"on");function m(n,f){var _=function(){f.apply(this,arguments),this.off(n,_)}.bind(this);this.on(n,_)}e(m,"_once");function p(n,f){if(arguments.length===1)for(var _ in n)m.call(this,_,n[_]);else m.call(this,n,f);return this}e(p,"once");function i(n,f){if(!this.__eventListeners)return this;if(arguments.length===0)for(n in this.__eventListeners)b.call(this,n);else if(arguments.length===1&&typeof arguments[0]=="object")for(var _ in n)b.call(this,_,n[_]);else b.call(this,n,f);return this}e(i,"off");function a(n,f){if(!this.__eventListeners)return this;var _=this.__eventListeners[n];if(!_)return this;for(var h=0,E=_.length;h<E;h++)_[h]&&_[h].call(this,f||{});return this.__eventListeners[n]=_.filter(function(w){return w!==!1}),this}e(a,"fire"),c.Observable={fire:a,on:r,once:p,off:i}}(),c.Collection={_objects:[],add:function(){if(this._objects.push.apply(this._objects,arguments),this._onObjectAdded)for(var b=0,r=arguments.length;b<r;b++)this._onObjectAdded(arguments[b]);return this.renderOnAddRemove&&this.requestRenderAll(),this},insertAt:function(b,r,m){var p=this._objects;return m?p[r]=b:p.splice(r,0,b),this._onObjectAdded&&this._onObjectAdded(b),this.renderOnAddRemove&&this.requestRenderAll(),this},remove:function(){for(var b=this._objects,r,m=!1,p=0,i=arguments.length;p<i;p++)r=b.indexOf(arguments[p]),r!==-1&&(m=!0,b.splice(r,1),this._onObjectRemoved&&this._onObjectRemoved(arguments[p]));return this.renderOnAddRemove&&m&&this.requestRenderAll(),this},forEachObject:function(b,r){for(var m=this.getObjects(),p=0,i=m.length;p<i;p++)b.call(r,m[p],p,m);return this},getObjects:function(b){return typeof b=="undefined"?this._objects.concat():this._objects.filter(function(r){return r.type===b})},item:function(b){return this._objects[b]},isEmpty:function(){return this._objects.length===0},size:function(){return this._objects.length},contains:function(b,r){return this._objects.indexOf(b)>-1?!0:r?this._objects.some(function(m){return typeof m.contains=="function"&&m.contains(b,!0)}):!1},complexity:function(){return this._objects.reduce(function(b,r){return b+=r.complexity?r.complexity():0,b},0)}},c.CommonMethods={_setOptions:function(b){for(var r in b)this.set(r,b[r])},_initGradient:function(b,r){b&&b.colorStops&&!(b instanceof c.Gradient)&&this.set(r,new c.Gradient(b))},_initPattern:function(b,r,m){b&&b.source&&!(b instanceof c.Pattern)?this.set(r,new c.Pattern(b,m)):m&&m()},_setObject:function(b){for(var r in b)this._set(r,b[r])},set:function(b,r){return typeof b=="object"?this._setObject(b):this._set(b,r),this},_set:function(b,r){this[b]=r},toggle:function(b){var r=this.get(b);return typeof r=="boolean"&&this.set(b,!r),this},get:function(b){return this[b]}},function(b){var r=Math.sqrt,m=Math.atan2,p=Math.pow,i=Math.PI/180,a=Math.PI/2;c.util={cos:function(n){if(n===0)return 1;n<0&&(n=-n);var f=n/a;switch(f){case 1:case 3:return 0;case 2:return-1}return Math.cos(n)},sin:function(n){if(n===0)return 0;var f=n/a,_=1;switch(n<0&&(_=-1),f){case 1:return _;case 2:return 0;case 3:return-_}return Math.sin(n)},removeFromArray:function(n,f){var _=n.indexOf(f);return _!==-1&&n.splice(_,1),n},getRandomInt:function(n,f){return Math.floor(Math.random()*(f-n+1))+n},degreesToRadians:function(n){return n*i},radiansToDegrees:function(n){return n/i},rotatePoint:function(n,f,_){var h=new c.Point(n.x-f.x,n.y-f.y),E=c.util.rotateVector(h,_);return new c.Point(E.x,E.y).addEquals(f)},rotateVector:function(n,f){var _=c.util.sin(f),h=c.util.cos(f),E=n.x*h-n.y*_,w=n.x*_+n.y*h;return{x:E,y:w}},transformPoint:function(n,f,_){return _?new c.Point(f[0]*n.x+f[2]*n.y,f[1]*n.x+f[3]*n.y):new c.Point(f[0]*n.x+f[2]*n.y+f[4],f[1]*n.x+f[3]*n.y+f[5])},makeBoundingBoxFromPoints:function(n,f){if(f)for(var _=0;_<n.length;_++)n[_]=c.util.transformPoint(n[_],f);var h=[n[0].x,n[1].x,n[2].x,n[3].x],E=c.util.array.min(h),w=c.util.array.max(h),A=w-E,D=[n[0].y,n[1].y,n[2].y,n[3].y],z=c.util.array.min(D),B=c.util.array.max(D),Y=B-z;return{left:E,top:z,width:A,height:Y}},invertTransform:function(n){var f=1/(n[0]*n[3]-n[1]*n[2]),_=[f*n[3],-f*n[1],-f*n[2],f*n[0]],h=c.util.transformPoint({x:n[4],y:n[5]},_,!0);return _[4]=-h.x,_[5]=-h.y,_},toFixed:function(n,f){return parseFloat(Number(n).toFixed(f))},parseUnit:function(n,f){var _=/\D{0,2}$/.exec(n),h=parseFloat(n);switch(f||(f=c.Text.DEFAULT_SVG_FONT_SIZE),_[0]){case"mm":return h*c.DPI/25.4;case"cm":return h*c.DPI/2.54;case"in":return h*c.DPI;case"pt":return h*c.DPI/72;case"pc":return h*c.DPI/72*12;case"em":return h*f;default:return h}},falseFunction:function(){return!1},getKlass:function(n,f){return n=c.util.string.camelize(n.charAt(0).toUpperCase()+n.slice(1)),c.util.resolveNamespace(f)[n]},getSvgAttributes:function(n){var f=["instantiated_by_use","style","id","class"];switch(n){case"linearGradient":f=f.concat(["x1","y1","x2","y2","gradientUnits","gradientTransform"]);break;case"radialGradient":f=f.concat(["gradientUnits","gradientTransform","cx","cy","r","fx","fy","fr"]);break;case"stop":f=f.concat(["offset","stop-color","stop-opacity"]);break}return f},resolveNamespace:function(n){if(!n)return c;var f=n.split("."),_=f.length,h,E=b||c.window;for(h=0;h<_;++h)E=E[f[h]];return E},loadImage:function(n,f,_,h){if(!n){f&&f.call(_,n);return}var E=c.util.createImage(),w=e(function(){f&&f.call(_,E,!1),E=E.onload=E.onerror=null},"onLoadCallback");E.onload=w,E.onerror=function(){c.log("Error loading "+E.src),f&&f.call(_,null,!0),E=E.onload=E.onerror=null},n.indexOf("data")!==0&&h!==void 0&&h!==null&&(E.crossOrigin=h),n.substring(0,14)==="data:image/svg"&&(E.onload=null,c.util.loadImageInDom(E,w)),E.src=n},loadImageInDom:function(n,f){var _=c.document.createElement("div");_.style.width=_.style.height="1px",_.style.left=_.style.top="-100%",_.style.position="absolute",_.appendChild(n),c.document.querySelector("body").appendChild(_),n.onload=function(){f(),_.parentNode.removeChild(_),_=null}},enlivenObjects:function(n,f,_,h){n=n||[];var E=[],w=0,A=n.length;function D(){++w===A&&f&&f(E.filter(function(z){return z}))}if(e(D,"onLoaded"),!A){f&&f(E);return}n.forEach(function(z,B){if(!z||!z.type){D();return}var Y=c.util.getKlass(z.type,_);Y.fromObject(z,function(H,V){V||(E[B]=H),h&&h(z,H,V),D()})})},enlivenPatterns:function(n,f){n=n||[];function _(){++E===w&&f&&f(h)}e(_,"onLoaded");var h=[],E=0,w=n.length;if(!w){f&&f(h);return}n.forEach(function(A,D){A&&A.source?new c.Pattern(A,function(z){h[D]=z,_()}):(h[D]=A,_())})},groupSVGElements:function(n,f,_){var h;return n&&n.length===1?n[0]:(f&&(f.width&&f.height?f.centerPoint={x:f.width/2,y:f.height/2}:(delete f.width,delete f.height)),h=new c.Group(n,f),typeof _!="undefined"&&(h.sourcePath=_),h)},populateWithProperties:function(n,f,_){if(_&&Object.prototype.toString.call(_)==="[object Array]")for(var h=0,E=_.length;h<E;h++)_[h]in n&&(f[_[h]]=n[_[h]])},drawDashedLine:function(n,f,_,h,E,w){var A=h-f,D=E-_,z=r(A*A+D*D),B=m(D,A),Y=w.length,H=0,V=!0;for(n.save(),n.translate(f,_),n.moveTo(0,0),n.rotate(B),f=0;z>f;)f+=w[H++%Y],f>z&&(f=z),n[V?"lineTo":"moveTo"](f,0),V=!V;n.restore()},createCanvasElement:function(){return c.document.createElement("canvas")},copyCanvasElement:function(n){var f=c.util.createCanvasElement();return f.width=n.width,f.height=n.height,f.getContext("2d").drawImage(n,0,0),f},toDataURL:function(n,f,_){return n.toDataURL("image/"+f,_)},createImage:function(){return c.document.createElement("img")},multiplyTransformMatrices:function(n,f,_){return[n[0]*f[0]+n[2]*f[1],n[1]*f[0]+n[3]*f[1],n[0]*f[2]+n[2]*f[3],n[1]*f[2]+n[3]*f[3],_?0:n[0]*f[4]+n[2]*f[5]+n[4],_?0:n[1]*f[4]+n[3]*f[5]+n[5]]},qrDecompose:function(n){var f=m(n[1],n[0]),_=p(n[0],2)+p(n[1],2),h=r(_),E=(n[0]*n[3]-n[2]*n[1])/h,w=m(n[0]*n[2]+n[1]*n[3],_);return{angle:f/i,scaleX:h,scaleY:E,skewX:w/i,skewY:0,translateX:n[4],translateY:n[5]}},calcRotateMatrix:function(n){if(!n.angle)return c.iMatrix.concat();var f=c.util.degreesToRadians(n.angle),_=c.util.cos(f),h=c.util.sin(f);return[_,h,-h,_,0,0]},calcDimensionsMatrix:function(n){var f=typeof n.scaleX=="undefined"?1:n.scaleX,_=typeof n.scaleY=="undefined"?1:n.scaleY,h=[n.flipX?-f:f,0,0,n.flipY?-_:_,0,0],E=c.util.multiplyTransformMatrices,w=c.util.degreesToRadians;return n.skewX&&(h=E(h,[1,0,Math.tan(w(n.skewX)),1],!0)),n.skewY&&(h=E(h,[1,Math.tan(w(n.skewY)),0,1],!0)),h},composeMatrix:function(n){var f=[1,0,0,1,n.translateX||0,n.translateY||0],_=c.util.multiplyTransformMatrices;return n.angle&&(f=_(f,c.util.calcRotateMatrix(n))),(n.scaleX!==1||n.scaleY!==1||n.skewX||n.skewY||n.flipX||n.flipY)&&(f=_(f,c.util.calcDimensionsMatrix(n))),f},resetObjectTransform:function(n){n.scaleX=1,n.scaleY=1,n.skewX=0,n.skewY=0,n.flipX=!1,n.flipY=!1,n.rotate(0)},saveObjectTransform:function(n){return{scaleX:n.scaleX,scaleY:n.scaleY,skewX:n.skewX,skewY:n.skewY,angle:n.angle,left:n.left,flipX:n.flipX,flipY:n.flipY,top:n.top}},isTransparent:function(n,f,_,h){h>0&&(f>h?f-=h:f=0,_>h?_-=h:_=0);var E=!0,w,A,D=n.getImageData(f,_,h*2||1,h*2||1),z=D.data.length;for(w=3;w<z&&(A=D.data[w],E=A<=0,E!==!1);w+=4);return D=null,E},parsePreserveAspectRatioAttribute:function(n){var f="meet",_="Mid",h="Mid",E=n.split(" "),w;return E&&E.length&&(f=E.pop(),f!=="meet"&&f!=="slice"?(w=f,f="meet"):E.length&&(w=E.pop())),_=w!=="none"?w.slice(1,4):"none",h=w!=="none"?w.slice(5,8):"none",{meetOrSlice:f,alignX:_,alignY:h}},clearFabricFontCache:function(n){n=(n||"").toLowerCase(),n?c.charWidthsCache[n]&&delete c.charWidthsCache[n]:c.charWidthsCache={}},limitDimsByArea:function(n,f){var _=Math.sqrt(f*n),h=Math.floor(f/_);return{x:Math.floor(_),y:h}},capValue:function(n,f,_){return Math.max(n,Math.min(f,_))},findScaleToFit:function(n,f){return Math.min(f.width/n.width,f.height/n.height)},findScaleToCover:function(n,f){return Math.max(f.width/n.width,f.height/n.height)},matrixToSVG:function(n){return"matrix("+n.map(function(f){return c.util.toFixed(f,c.Object.NUM_FRACTION_DIGITS)}).join(" ")+")"},removeTransformFromObject:function(n,f){var _=c.util.invertTransform(f),h=c.util.multiplyTransformMatrices(_,n.calcOwnMatrix());c.util.applyTransformToObject(n,h)},addTransformToObject:function(n,f){c.util.applyTransformToObject(n,c.util.multiplyTransformMatrices(f,n.calcOwnMatrix()))},applyTransformToObject:function(n,f){var _=c.util.qrDecompose(f),h=new c.Point(_.translateX,_.translateY);n.flipX=!1,n.flipY=!1,n.set("scaleX",_.scaleX),n.set("scaleY",_.scaleY),n.skewX=_.skewX,n.skewY=_.skewY,n.angle=_.angle,n.setPositionByOrigin(h,"center","center")},sizeAfterTransform:function(n,f,_){var h=n/2,E=f/2,w=[{x:-h,y:-E},{x:h,y:-E},{x:-h,y:E},{x:h,y:E}],A=c.util.calcDimensionsMatrix(_),D=c.util.makeBoundingBoxFromPoints(w,A);return{x:D.width,y:D.height}}}}(I),function(){var b=Array.prototype.join,r={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7},m={m:"l",M:"L"};function p(tt,Z,dt,X,$,K,Q,yt,vt,It,wt){var Et=c.util.cos(tt),ct=c.util.sin(tt),et=c.util.cos(Z),nt=c.util.sin(Z),ht=dt*$*et-X*K*nt+Q,gt=X*$*et+dt*K*nt+yt,bt=It+vt*(-dt*$*ct-X*K*Et),Lt=wt+vt*(-X*$*ct+dt*K*Et),Gt=ht+vt*(dt*$*nt+X*K*et),Wt=gt+vt*(X*$*nt-dt*K*et);return["C",bt,Lt,Gt,Wt,ht,gt]}e(p,"segmentToBezier");function i(tt,Z,dt,X,$,K,Q){var yt=Math.PI,vt=Q*yt/180,It=c.util.sin(vt),wt=c.util.cos(vt),Et=0,ct=0;dt=Math.abs(dt),X=Math.abs(X);var et=-wt*tt*.5-It*Z*.5,nt=-wt*Z*.5+It*tt*.5,ht=dt*dt,gt=X*X,bt=nt*nt,Lt=et*et,Gt=ht*gt-ht*bt-gt*Lt,Wt=0;if(Gt<0){var Ct=Math.sqrt(1-Gt/(ht*gt));dt*=Ct,X*=Ct}else Wt=($===K?-1:1)*Math.sqrt(Gt/(ht*bt+gt*Lt));var Xt=Wt*dt*nt/X,Zt=-Wt*X*et/dt,ie=wt*Xt-It*Zt+tt*.5,Ie=It*Xt+wt*Zt+Z*.5,de=a(1,0,(et-Xt)/dt,(nt-Zt)/X),me=a((et-Xt)/dt,(nt-Zt)/X,(-et-Xt)/dt,(-nt-Zt)/X);K===0&&me>0?me-=2*yt:K===1&&me<0&&(me+=2*yt);for(var ae=Math.ceil(Math.abs(me/yt*2)),ye=[],Ae=me/ae,Fe=8/3*Math.sin(Ae/4)*Math.sin(Ae/4)/Math.sin(Ae/2),Ot=de+Ae,kt=0;kt<ae;kt++)ye[kt]=p(de,Ot,wt,It,dt,X,ie,Ie,Fe,Et,ct),Et=ye[kt][5],ct=ye[kt][6],de=Ot,Ot+=Ae;return ye}e(i,"arcToSegments");function a(tt,Z,dt,X){var $=Math.atan2(Z,tt),K=Math.atan2(X,dt);return K>=$?K-$:2*Math.PI-($-K)}e(a,"calcVectorAngle");function n(tt,Z,dt,X,$,K,Q,yt){var vt;if(c.cachesBoundsOfCurve&&(vt=b.call(arguments),c.boundsOfCurveCache[vt]))return c.boundsOfCurveCache[vt];var It=Math.sqrt,wt=Math.min,Et=Math.max,ct=Math.abs,et=[],nt=[[],[]],ht,gt,bt,Lt,Gt,Wt,Ct,Xt;gt=6*tt-12*dt+6*$,ht=-3*tt+9*dt-9*$+3*Q,bt=3*dt-3*tt;for(var Zt=0;Zt<2;++Zt){if(Zt>0&&(gt=6*Z-12*X+6*K,ht=-3*Z+9*X-9*K+3*yt,bt=3*X-3*Z),ct(ht)<1e-12){if(ct(gt)<1e-12)continue;Lt=-bt/gt,0<Lt&&Lt<1&&et.push(Lt);continue}Ct=gt*gt-4*bt*ht,!(Ct<0)&&(Xt=It(Ct),Gt=(-gt+Xt)/(2*ht),0<Gt&&Gt<1&&et.push(Gt),Wt=(-gt-Xt)/(2*ht),0<Wt&&Wt<1&&et.push(Wt))}for(var ie,Ie,de=et.length,me=de,ae;de--;)Lt=et[de],ae=1-Lt,ie=ae*ae*ae*tt+3*ae*ae*Lt*dt+3*ae*Lt*Lt*$+Lt*Lt*Lt*Q,nt[0][de]=ie,Ie=ae*ae*ae*Z+3*ae*ae*Lt*X+3*ae*Lt*Lt*K+Lt*Lt*Lt*yt,nt[1][de]=Ie;nt[0][me]=tt,nt[1][me]=Z,nt[0][me+1]=Q,nt[1][me+1]=yt;var ye=[{x:wt.apply(null,nt[0]),y:wt.apply(null,nt[1])},{x:Et.apply(null,nt[0]),y:Et.apply(null,nt[1])}];return c.cachesBoundsOfCurve&&(c.boundsOfCurveCache[vt]=ye),ye}e(n,"getBoundsOfCurve");function f(tt,Z,dt){for(var X=dt[1],$=dt[2],K=dt[3],Q=dt[4],yt=dt[5],vt=dt[6],It=dt[7],wt=i(vt-tt,It-Z,X,$,Q,yt,K),Et=0,ct=wt.length;Et<ct;Et++)wt[Et][1]+=tt,wt[Et][2]+=Z,wt[Et][3]+=tt,wt[Et][4]+=Z,wt[Et][5]+=tt,wt[Et][6]+=Z;return wt}e(f,"fromArcToBeziers");function _(tt){var Z=0,dt=0,X=tt.length,$=0,K=0,Q,yt,vt,It=[],wt,Et,ct;for(yt=0;yt<X;++yt){switch(vt=!1,Q=tt[yt].slice(0),Q[0]){case"l":Q[0]="L",Q[1]+=Z,Q[2]+=dt;case"L":Z=Q[1],dt=Q[2];break;case"h":Q[1]+=Z;case"H":Q[0]="L",Q[2]=dt,Z=Q[1];break;case"v":Q[1]+=dt;case"V":Q[0]="L",dt=Q[1],Q[1]=Z,Q[2]=dt;break;case"m":Q[0]="M",Q[1]+=Z,Q[2]+=dt;case"M":Z=Q[1],dt=Q[2],$=Q[1],K=Q[2];break;case"c":Q[0]="C",Q[1]+=Z,Q[2]+=dt,Q[3]+=Z,Q[4]+=dt,Q[5]+=Z,Q[6]+=dt;case"C":Et=Q[3],ct=Q[4],Z=Q[5],dt=Q[6];break;case"s":Q[0]="S",Q[1]+=Z,Q[2]+=dt,Q[3]+=Z,Q[4]+=dt;case"S":wt==="C"?(Et=2*Z-Et,ct=2*dt-ct):(Et=Z,ct=dt),Z=Q[3],dt=Q[4],Q[0]="C",Q[5]=Q[3],Q[6]=Q[4],Q[3]=Q[1],Q[4]=Q[2],Q[1]=Et,Q[2]=ct,Et=Q[3],ct=Q[4];break;case"q":Q[0]="Q",Q[1]+=Z,Q[2]+=dt,Q[3]+=Z,Q[4]+=dt;case"Q":Et=Q[1],ct=Q[2],Z=Q[3],dt=Q[4];break;case"t":Q[0]="T",Q[1]+=Z,Q[2]+=dt;case"T":wt==="Q"?(Et=2*Z-Et,ct=2*dt-ct):(Et=Z,ct=dt),Q[0]="Q",Z=Q[1],dt=Q[2],Q[1]=Et,Q[2]=ct,Q[3]=Z,Q[4]=dt;break;case"a":Q[0]="A",Q[6]+=Z,Q[7]+=dt;case"A":vt=!0,It=It.concat(f(Z,dt,Q)),Z=Q[6],dt=Q[7];break;case"z":case"Z":Z=$,dt=K;break;default:}vt||It.push(Q),wt=Q[0]}return It}e(_,"makePathSimpler");function h(tt,Z,dt,X){return Math.sqrt((dt-tt)*(dt-tt)+(X-Z)*(X-Z))}e(h,"calcLineLength");function E(tt){return tt*tt*tt}e(E,"CB1");function w(tt){return 3*tt*tt*(1-tt)}e(w,"CB2");function A(tt){return 3*tt*(1-tt)*(1-tt)}e(A,"CB3");function D(tt){return(1-tt)*(1-tt)*(1-tt)}e(D,"CB4");function z(tt,Z,dt,X,$,K,Q,yt){return function(vt){var It=E(vt),wt=w(vt),Et=A(vt),ct=D(vt);return{x:Q*It+$*wt+dt*Et+tt*ct,y:yt*It+K*wt+X*Et+Z*ct}}}e(z,"getPointOnCubicBezierIterator");function B(tt,Z,dt,X,$,K,Q,yt){return function(vt){var It=1-vt,wt=3*It*It*(dt-tt)+6*It*vt*($-dt)+3*vt*vt*(Q-$),Et=3*It*It*(X-Z)+6*It*vt*(K-X)+3*vt*vt*(yt-K);return Math.atan2(Et,wt)}}e(B,"getTangentCubicIterator");function Y(tt){return tt*tt}e(Y,"QB1");function H(tt){return 2*tt*(1-tt)}e(H,"QB2");function V(tt){return(1-tt)*(1-tt)}e(V,"QB3");function lt(tt,Z,dt,X,$,K){return function(Q){var yt=Y(Q),vt=H(Q),It=V(Q);return{x:$*yt+dt*vt+tt*It,y:K*yt+X*vt+Z*It}}}e(lt,"getPointOnQuadraticBezierIterator");function rt(tt,Z,dt,X,$,K){return function(Q){var yt=1-Q,vt=2*yt*(dt-tt)+2*Q*($-dt),It=2*yt*(X-Z)+2*Q*(K-X);return Math.atan2(It,vt)}}e(rt,"getTangentQuadraticIterator");function St(tt,Z,dt){var X={x:Z,y:dt},$,K=0,Q;for(Q=1;Q<=100;Q+=1)$=tt(Q/100),K+=h(X.x,X.y,$.x,$.y),X=$;return K}e(St,"pathIterator");function q(tt,Z){for(var dt=0,X=0,$=tt.iterator,K={x:tt.x,y:tt.y},Q,yt,vt=.01,It=tt.angleFinder,wt;X<Z&&dt<=1&&vt>1e-4;)Q=$(dt),wt=dt,yt=h(K.x,K.y,Q.x,Q.y),yt+X>Z?(vt/=2,dt-=vt):(K=Q,dt+=vt,X+=yt);return Q.angle=It(wt),Q}e(q,"findPercentageForDistance");function _t(tt){for(var Z=0,dt=tt.length,X,$=0,K=0,Q=0,yt=0,vt=[],It,wt,Et,ct=0;ct<dt;ct++){switch(X=tt[ct],wt={x:$,y:K,command:X[0]},X[0]){case"M":wt.length=0,Q=$=X[1],yt=K=X[2];break;case"L":wt.length=h($,K,X[1],X[2]),$=X[1],K=X[2];break;case"C":It=z($,K,X[1],X[2],X[3],X[4],X[5],X[6]),Et=B($,K,X[1],X[2],X[3],X[4],X[5],X[6]),wt.iterator=It,wt.angleFinder=Et,wt.length=St(It,$,K),$=X[5],K=X[6];break;case"Q":It=lt($,K,X[1],X[2],X[3],X[4]),Et=rt($,K,X[1],X[2],X[3],X[4]),wt.iterator=It,wt.angleFinder=Et,wt.length=St(It,$,K),$=X[3],K=X[4];break;case"Z":case"z":wt.destX=Q,wt.destY=yt,wt.length=h($,K,Q,yt),$=Q,K=yt;break}Z+=wt.length,vt.push(wt)}return vt.push({length:Z,x:$,y:K}),vt}e(_t,"getPathSegmentsInfo");function G(tt,Z,dt){dt||(dt=_t(tt));for(var X=0;Z-dt[X].length>0&&X<dt.length-2;)Z-=dt[X].length,X++;var $=dt[X],K=Z/$.length,Q=$.command,yt=tt[X],vt;switch(Q){case"M":return{x:$.x,y:$.y,angle:0};case"Z":case"z":return vt=new c.Point($.x,$.y).lerp(new c.Point($.destX,$.destY),K),vt.angle=Math.atan2($.destY-$.y,$.destX-$.x),vt;case"L":return vt=new c.Point($.x,$.y).lerp(new c.Point(yt[1],yt[2]),K),vt.angle=Math.atan2(yt[2]-$.y,yt[1]-$.x),vt;case"C":return q($,Z);case"Q":return q($,Z)}}e(G,"getPointOnPath");function Ut(tt){var Z=[],dt=[],X,$,K=c.rePathCommand,Q="[-+]?(?:\\d*\\.\\d+|\\d+\\.?)(?:[eE][-+]?\\d+)?\\s*",yt="("+Q+")"+c.commaWsp,vt="([01])"+c.commaWsp+"?",It=yt+"?"+yt+"?"+yt+vt+vt+yt+"?("+Q+")",wt=new RegExp(It,"g"),Et,ct,et;if(!tt||!tt.match)return Z;et=tt.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi);for(var nt=0,ht,gt=et.length;nt<gt;nt++){X=et[nt],ct=X.slice(1).trim(),dt.length=0;var bt=X.charAt(0);if(ht=[bt],bt.toLowerCase()==="a")for(var Lt;Lt=wt.exec(ct);)for(var Gt=1;Gt<Lt.length;Gt++)dt.push(Lt[Gt]);else for(;Et=K.exec(ct);)dt.push(Et[0]);for(var Gt=0,Wt=dt.length;Gt<Wt;Gt++)$=parseFloat(dt[Gt]),isNaN($)||ht.push($);var Ct=r[bt.toLowerCase()],Xt=m[bt]||bt;if(ht.length-1>Ct)for(var Zt=1,ie=ht.length;Zt<ie;Zt+=Ct)Z.push([bt].concat(ht.slice(Zt,Zt+Ct))),bt=Xt;else Z.push(ht)}return Z}e(Ut,"parsePath");function xt(tt,Z){var dt=[],X,$=new c.Point(tt[0].x,tt[0].y),K=new c.Point(tt[1].x,tt[1].y),Q=tt.length,yt=1,vt=0,It=Q>2;for(Z=Z||0,It&&(yt=tt[2].x<K.x?-1:tt[2].x===K.x?0:1,vt=tt[2].y<K.y?-1:tt[2].y===K.y?0:1),dt.push(["M",$.x-yt*Z,$.y-vt*Z]),X=1;X<Q;X++){if(!$.eq(K)){var wt=$.midPointFrom(K);dt.push(["Q",$.x,$.y,wt.x,wt.y])}$=tt[X],X+1<tt.length&&(K=tt[X+1])}return It&&(yt=$.x>tt[X-2].x?1:$.x===tt[X-2].x?0:-1,vt=$.y>tt[X-2].y?1:$.y===tt[X-2].y?0:-1),dt.push(["L",$.x+yt*Z,$.y+vt*Z]),dt}e(xt,"getSmoothPathFromPoints");function Ht(tt,Z,dt){return dt&&(Z=c.util.multiplyTransformMatrices(Z,[1,0,0,1,-dt.x,-dt.y])),tt.map(function(X){for(var $=X.slice(0),K={},Q=1;Q<X.length-1;Q+=2)K.x=X[Q],K.y=X[Q+1],K=c.util.transformPoint(K,Z),$[Q]=K.x,$[Q+1]=K.y;return $})}e(Ht,"transformPath");function it(tt,Z,dt,X,$,K,Q,yt,vt){for(var It=0,wt=0,Et,ct=[],et=i(yt-tt,vt-Z,dt,X,K,Q,$),nt=0,ht=et.length;nt<ht;nt++)Et=n(It,wt,et[nt][1],et[nt][2],et[nt][3],et[nt][4],et[nt][5],et[nt][6]),ct.push({x:Et[0].x+tt,y:Et[0].y+Z}),ct.push({x:Et[1].x+tt,y:Et[1].y+Z}),It=et[nt][5],wt=et[nt][6];return ct}e(it,"getBoundsOfArc");function ut(tt,Z,dt,X){X=X.slice(0).unshift("X");var $=f(Z,dt,X);$.forEach(function(K){tt.bezierCurveTo.apply(tt,K.slice(1))})}e(ut,"drawArc"),c.util.joinPath=function(tt){return tt.map(function(Z){return Z.join(" ")}).join(" ")},c.util.parsePath=Ut,c.util.makePathSimpler=_,c.util.getSmoothPathFromPoints=xt,c.util.getPathSegmentsInfo=_t,c.util.getBoundsOfCurve=n,c.util.getPointOnPath=G,c.util.transformPath=Ht,c.util.fromArcToBeizers=f,c.util.getBoundsOfArc=it,c.util.drawArc=ut}(),function(){var b=Array.prototype.slice;function r(n,f){for(var _=b.call(arguments,2),h=[],E=0,w=n.length;E<w;E++)h[E]=_.length?n[E][f].apply(n[E],_):n[E][f].call(n[E]);return h}e(r,"invoke");function m(n,f){return a(n,f,function(_,h){return _>=h})}e(m,"max");function p(n,f){return a(n,f,function(_,h){return _<h})}e(p,"min");function i(n,f){for(var _=n.length;_--;)n[_]=f;return n}e(i,"fill");function a(n,f,_){if(!(!n||n.length===0)){var h=n.length-1,E=f?n[h][f]:n[h];if(f)for(;h--;)_(n[h][f],E)&&(E=n[h][f]);else for(;h--;)_(n[h],E)&&(E=n[h]);return E}}e(a,"find"),c.util.array={fill:i,invoke:r,min:p,max:m}}(),function(){function b(m,p,i){if(i)if(!c.isLikelyNode&&p instanceof Element)m=p;else if(p instanceof Array){m=[];for(var a=0,n=p.length;a<n;a++)m[a]=b({},p[a],i)}else if(p&&typeof p=="object")for(var f in p)f==="canvas"||f==="group"?m[f]=null:p.hasOwnProperty(f)&&(m[f]=b({},p[f],i));else m=p;else for(var f in p)m[f]=p[f];return m}e(b,"extend");function r(m,p){return b({},m,p)}e(r,"clone"),c.util.object={extend:b,clone:r},c.util.object.extend(c.util,c.Observable)}(),function(){function b(a){return a.replace(/-+(.)?/g,function(n,f){return f?f.toUpperCase():""})}e(b,"camelize");function r(a,n){return a.charAt(0).toUpperCase()+(n?a.slice(1):a.slice(1).toLowerCase())}e(r,"capitalize");function m(a){return a.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}e(m,"escapeXml");function p(a){var n=0,f,_=[];for(n=0,f;n<a.length;n++)(f=i(a,n))!==!1&&_.push(f);return _}e(p,"graphemeSplit");function i(a,n){var f=a.charCodeAt(n);if(isNaN(f))return"";if(f<55296||f>57343)return a.charAt(n);if(55296<=f&&f<=56319){if(a.length<=n+1)throw"High surrogate without following low surrogate";var _=a.charCodeAt(n+1);if(56320>_||_>57343)throw"High surrogate without following low surrogate";return a.charAt(n)+a.charAt(n+1)}if(n===0)throw"Low surrogate without preceding high surrogate";var h=a.charCodeAt(n-1);if(55296>h||h>56319)throw"Low surrogate without preceding high surrogate";return!1}e(i,"getWholeChar"),c.util.string={camelize:b,capitalize:r,escapeXml:m,graphemeSplit:p}}(),function(){var b=Array.prototype.slice,r=e(function(){},"emptyFunction"),m=function(){for(var f in{toString:1})if(f==="toString")return!1;return!0}(),p=e(function(f,_,h){for(var E in _)E in f.prototype&&typeof f.prototype[E]=="function"&&(_[E]+"").indexOf("callSuper")>-1?f.prototype[E]=function(w){return function(){var A=this.constructor.superclass;this.constructor.superclass=h;var D=_[w].apply(this,arguments);if(this.constructor.superclass=A,w!=="initialize")return D}}(E):f.prototype[E]=_[E],m&&(_.toString!==Object.prototype.toString&&(f.prototype.toString=_.toString),_.valueOf!==Object.prototype.valueOf&&(f.prototype.valueOf=_.valueOf))},"addMethods");function i(){}e(i,"Subclass");function a(f){for(var _=null,h=this;h.constructor.superclass;){var E=h.constructor.superclass.prototype[f];if(h[f]!==E){_=E;break}h=h.constructor.superclass.prototype}return _?arguments.length>1?_.apply(this,b.call(arguments,1)):_.call(this):console.log("tried to callSuper "+f+", method not found in prototype chain",this)}e(a,"callSuper");function n(){var f=null,_=b.call(arguments,0);typeof _[0]=="function"&&(f=_.shift());function h(){this.initialize.apply(this,arguments)}e(h,"klass"),h.superclass=f,h.subclasses=[],f&&(i.prototype=f.prototype,h.prototype=new i,f.subclasses.push(h));for(var E=0,w=_.length;E<w;E++)p(h,_[E],f);return h.prototype.initialize||(h.prototype.initialize=r),h.prototype.constructor=h,h.prototype.callSuper=a,h}e(n,"createClass"),c.util.createClass=n}(),function(){var b=!!c.document.createElement("div").attachEvent,r=["touchstart","touchmove","touchend"];c.util.addListener=function(p,i,a,n){p&&p.addEventListener(i,a,b?!1:n)},c.util.removeListener=function(p,i,a,n){p&&p.removeEventListener(i,a,b?!1:n)};function m(p){var i=p.changedTouches;return i&&i[0]?i[0]:p}e(m,"getTouchInfo"),c.util.getPointer=function(p){var i=p.target,a=c.util.getScrollLeftTop(i),n=m(p);return{x:n.clientX+a.left,y:n.clientY+a.top}},c.util.isTouchEvent=function(p){return r.indexOf(p.type)>-1||p.pointerType==="touch"}}(),function(){function b(n,f){var _=n.style;if(!_)return n;if(typeof f=="string")return n.style.cssText+=";"+f,f.indexOf("opacity")>-1?a(n,f.match(/opacity:\s*(\d?\.?\d*)/)[1]):n;for(var h in f)if(h==="opacity")a(n,f[h]);else{var E=h==="float"||h==="cssFloat"?typeof _.styleFloat=="undefined"?"cssFloat":"styleFloat":h;_[E]=f[h]}return n}e(b,"setStyle");var r=c.document.createElement("div"),m=typeof r.style.opacity=="string",p=typeof r.style.filter=="string",i=/alpha\s*\(\s*opacity\s*=\s*([^\)]+)\)/,a=e(function(n){return n},"setOpacity");m?a=e(function(n,f){return n.style.opacity=f,n},"setOpacity"):p&&(a=e(function(n,f){var _=n.style;return n.currentStyle&&!n.currentStyle.hasLayout&&(_.zoom=1),i.test(_.filter)?(f=f>=.9999?"":"alpha(opacity="+f*100+")",_.filter=_.filter.replace(i,f)):_.filter+=" alpha(opacity="+f*100+")",n},"setOpacity")),c.util.setStyle=b}(),function(){var b=Array.prototype.slice;function r(D){return typeof D=="string"?c.document.getElementById(D):D}e(r,"getById");var m,p=e(function(D){return b.call(D,0)},"toArray");try{m=p(c.document.childNodes)instanceof Array}catch{}m||(p=e(function(D){for(var z=new Array(D.length),B=D.length;B--;)z[B]=D[B];return z},"toArray"));function i(D,z){var B=c.document.createElement(D);for(var Y in z)Y==="class"?B.className=z[Y]:Y==="for"?B.htmlFor=z[Y]:B.setAttribute(Y,z[Y]);return B}e(i,"makeElement");function a(D,z){D&&(" "+D.className+" ").indexOf(" "+z+" ")===-1&&(D.className+=(D.className?" ":"")+z)}e(a,"addClass");function n(D,z,B){return typeof z=="string"&&(z=i(z,B)),D.parentNode&&D.parentNode.replaceChild(z,D),z.appendChild(D),z}e(n,"wrapElement");function f(D){for(var z=0,B=0,Y=c.document.documentElement,H=c.document.body||{scrollLeft:0,scrollTop:0};D&&(D.parentNode||D.host)&&(D=D.parentNode||D.host,D===c.document?(z=H.scrollLeft||Y.scrollLeft||0,B=H.scrollTop||Y.scrollTop||0):(z+=D.scrollLeft||0,B+=D.scrollTop||0),!(D.nodeType===1&&D.style.position==="fixed")););return{left:z,top:B}}e(f,"getScrollLeftTop");function _(D){var z,B=D&&D.ownerDocument,Y={left:0,top:0},H={left:0,top:0},V,lt={borderLeftWidth:"left",borderTopWidth:"top",paddingLeft:"left",paddingTop:"top"};if(!B)return H;for(var rt in lt)H[lt[rt]]+=parseInt(h(D,rt),10)||0;return z=B.documentElement,typeof D.getBoundingClientRect!="undefined"&&(Y=D.getBoundingClientRect()),V=f(D),{left:Y.left+V.left-(z.clientLeft||0)+H.left,top:Y.top+V.top-(z.clientTop||0)+H.top}}e(_,"getElementOffset");var h;c.document.defaultView&&c.document.defaultView.getComputedStyle?h=e(function(D,z){var B=c.document.defaultView.getComputedStyle(D,null);return B?B[z]:void 0},"getElementStyle"):h=e(function(D,z){var B=D.style[z];return!B&&D.currentStyle&&(B=D.currentStyle[z]),B},"getElementStyle"),function(){var D=c.document.documentElement.style,z="userSelect"in D?"userSelect":"MozUserSelect"in D?"MozUserSelect":"WebkitUserSelect"in D?"WebkitUserSelect":"KhtmlUserSelect"in D?"KhtmlUserSelect":"";function B(H){return typeof H.onselectstart!="undefined"&&(H.onselectstart=c.util.falseFunction),z?H.style[z]="none":typeof H.unselectable=="string"&&(H.unselectable="on"),H}e(B,"makeElementUnselectable");function Y(H){return typeof H.onselectstart!="undefined"&&(H.onselectstart=null),z?H.style[z]="":typeof H.unselectable=="string"&&(H.unselectable=""),H}e(Y,"makeElementSelectable"),c.util.makeElementUnselectable=B,c.util.makeElementSelectable=Y}();function E(D){var z=c.jsdomImplForWrapper(D);return z._canvas||z._image}e(E,"getNodeCanvas");function w(D){if(c.isLikelyNode){var z=c.jsdomImplForWrapper(D);z&&(z._image=null,z._canvas=null,z._currentSrc=null,z._attributes=null,z._classList=null)}}e(w,"cleanUpJsdomNode");function A(D,z){D.imageSmoothingEnabled=D.imageSmoothingEnabled||D.webkitImageSmoothingEnabled||D.mozImageSmoothingEnabled||D.msImageSmoothingEnabled||D.oImageSmoothingEnabled,D.imageSmoothingEnabled=z}e(A,"setImageSmoothing"),c.util.setImageSmoothing=A,c.util.getById=r,c.util.toArray=p,c.util.addClass=a,c.util.makeElement=i,c.util.wrapElement=n,c.util.getScrollLeftTop=f,c.util.getElementOffset=_,c.util.getNodeCanvas=E,c.util.cleanUpJsdomNode=w}(),function(){function b(p,i){return p+(/\?/.test(p)?"&":"?")+i}e(b,"addParamToUrl");function r(){}e(r,"emptyFn");function m(p,i){i||(i={});var a=i.method?i.method.toUpperCase():"GET",n=i.onComplete||function(){},f=new c.window.XMLHttpRequest,_=i.body||i.parameters;return f.onreadystatechange=function(){f.readyState===4&&(n(f),f.onreadystatechange=r)},a==="GET"&&(_=null,typeof i.parameters=="string"&&(p=b(p,i.parameters))),f.open(a,p,!0),(a==="POST"||a==="PUT")&&f.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),f.send(_),f}e(m,"request"),c.util.request=m}(),c.log=console.log,c.warn=console.warn,function(){function b(){return!1}e(b,"noop");function r(f,_,h,E){return-h*Math.cos(f/E*(Math.PI/2))+h+_}e(r,"defaultEasing");function m(f){var _=!1;return a(function(h){f||(f={});var E=h||+new Date,w=f.duration||500,A=E+w,D,z=f.onChange||b,B=f.abort||b,Y=f.onComplete||b,H=f.easing||r,V="startValue"in f?f.startValue:0,lt="endValue"in f?f.endValue:100,rt=f.byValue||lt-V;f.onStart&&f.onStart(),e(function St(q){D=q||+new Date;var _t=D>A?w:D-E,G=_t/w,Ut=H(_t,V,rt,w),xt=Math.abs((Ut-V)/rt);if(!_){if(B(Ut,xt,G)){Y(lt,1,1);return}if(D>A){z(lt,1,1),Y(lt,1,1);return}else z(Ut,xt,G),a(St)}},"tick")(E)}),function(){_=!0}}e(m,"animate");var p=c.window.requestAnimationFrame||c.window.webkitRequestAnimationFrame||c.window.mozRequestAnimationFrame||c.window.oRequestAnimationFrame||c.window.msRequestAnimationFrame||function(f){return c.window.setTimeout(f,1e3/60)},i=c.window.cancelAnimationFrame||c.window.clearTimeout;function a(){return p.apply(c.window,arguments)}e(a,"requestAnimFrame");function n(){return i.apply(c.window,arguments)}e(n,"cancelAnimFrame"),c.util.animate=m,c.util.requestAnimFrame=a,c.util.cancelAnimFrame=n}(),function(){function b(m,p,i){var a="rgba("+parseInt(m[0]+i*(p[0]-m[0]),10)+","+parseInt(m[1]+i*(p[1]-m[1]),10)+","+parseInt(m[2]+i*(p[2]-m[2]),10);return a+=","+(m&&p?parseFloat(m[3]+i*(p[3]-m[3])):1),a+=")",a}e(b,"calculateColor");function r(m,p,i,a){var n=new c.Color(m).getSource(),f=new c.Color(p).getSource(),_=a.onComplete,h=a.onChange;return a=a||{},c.util.animate(c.util.object.extend(a,{duration:i||500,startValue:n,endValue:f,byValue:f,easing:function(E,w,A,D){var z=a.colorEasing?a.colorEasing(E,D):1-Math.cos(E/D*(Math.PI/2));return b(w,A,z)},onComplete:function(E,w,A){if(_)return _(b(f,f,0),w,A)},onChange:function(E,w,A){if(h){if(Array.isArray(E))return h(b(E,E,0),w,A);h(E,w,A)}}}))}e(r,"animateColor"),c.util.animateColor=r}(),function(){function b(it,ut,tt,Z){return it<Math.abs(ut)?(it=ut,Z=tt/4):ut===0&&it===0?Z=tt/(2*Math.PI)*Math.asin(1):Z=tt/(2*Math.PI)*Math.asin(ut/it),{a:it,c:ut,p:tt,s:Z}}e(b,"normalize");function r(it,ut,tt){return it.a*Math.pow(2,10*(ut-=1))*Math.sin((ut*tt-it.s)*(2*Math.PI)/it.p)}e(r,"elastic");function m(it,ut,tt,Z){return tt*((it=it/Z-1)*it*it+1)+ut}e(m,"easeOutCubic");function p(it,ut,tt,Z){return it/=Z/2,it<1?tt/2*it*it*it+ut:tt/2*((it-=2)*it*it+2)+ut}e(p,"easeInOutCubic");function i(it,ut,tt,Z){return tt*(it/=Z)*it*it*it+ut}e(i,"easeInQuart");function a(it,ut,tt,Z){return-tt*((it=it/Z-1)*it*it*it-1)+ut}e(a,"easeOutQuart");function n(it,ut,tt,Z){return it/=Z/2,it<1?tt/2*it*it*it*it+ut:-tt/2*((it-=2)*it*it*it-2)+ut}e(n,"easeInOutQuart");function f(it,ut,tt,Z){return tt*(it/=Z)*it*it*it*it+ut}e(f,"easeInQuint");function _(it,ut,tt,Z){return tt*((it=it/Z-1)*it*it*it*it+1)+ut}e(_,"easeOutQuint");function h(it,ut,tt,Z){return it/=Z/2,it<1?tt/2*it*it*it*it*it+ut:tt/2*((it-=2)*it*it*it*it+2)+ut}e(h,"easeInOutQuint");function E(it,ut,tt,Z){return-tt*Math.cos(it/Z*(Math.PI/2))+tt+ut}e(E,"easeInSine");function w(it,ut,tt,Z){return tt*Math.sin(it/Z*(Math.PI/2))+ut}e(w,"easeOutSine");function A(it,ut,tt,Z){return-tt/2*(Math.cos(Math.PI*it/Z)-1)+ut}e(A,"easeInOutSine");function D(it,ut,tt,Z){return it===0?ut:tt*Math.pow(2,10*(it/Z-1))+ut}e(D,"easeInExpo");function z(it,ut,tt,Z){return it===Z?ut+tt:tt*(-Math.pow(2,-10*it/Z)+1)+ut}e(z,"easeOutExpo");function B(it,ut,tt,Z){return it===0?ut:it===Z?ut+tt:(it/=Z/2,it<1?tt/2*Math.pow(2,10*(it-1))+ut:tt/2*(-Math.pow(2,-10*--it)+2)+ut)}e(B,"easeInOutExpo");function Y(it,ut,tt,Z){return-tt*(Math.sqrt(1-(it/=Z)*it)-1)+ut}e(Y,"easeInCirc");function H(it,ut,tt,Z){return tt*Math.sqrt(1-(it=it/Z-1)*it)+ut}e(H,"easeOutCirc");function V(it,ut,tt,Z){return it/=Z/2,it<1?-tt/2*(Math.sqrt(1-it*it)-1)+ut:tt/2*(Math.sqrt(1-(it-=2)*it)+1)+ut}e(V,"easeInOutCirc");function lt(it,ut,tt,Z){var dt=1.70158,X=0,$=tt;if(it===0)return ut;if(it/=Z,it===1)return ut+tt;X||(X=Z*.3);var K=b($,tt,X,dt);return-r(K,it,Z)+ut}e(lt,"easeInElastic");function rt(it,ut,tt,Z){var dt=1.70158,X=0,$=tt;if(it===0)return ut;if(it/=Z,it===1)return ut+tt;X||(X=Z*.3);var K=b($,tt,X,dt);return K.a*Math.pow(2,-10*it)*Math.sin((it*Z-K.s)*(2*Math.PI)/K.p)+K.c+ut}e(rt,"easeOutElastic");function St(it,ut,tt,Z){var dt=1.70158,X=0,$=tt;if(it===0)return ut;if(it/=Z/2,it===2)return ut+tt;X||(X=Z*.44999999999999996);var K=b($,tt,X,dt);return it<1?-.5*r(K,it,Z)+ut:K.a*Math.pow(2,-10*(it-=1))*Math.sin((it*Z-K.s)*(2*Math.PI)/K.p)*.5+K.c+ut}e(St,"easeInOutElastic");function q(it,ut,tt,Z,dt){return dt===void 0&&(dt=1.70158),tt*(it/=Z)*it*((dt+1)*it-dt)+ut}e(q,"easeInBack");function _t(it,ut,tt,Z,dt){return dt===void 0&&(dt=1.70158),tt*((it=it/Z-1)*it*((dt+1)*it+dt)+1)+ut}e(_t,"easeOutBack");function G(it,ut,tt,Z,dt){return dt===void 0&&(dt=1.70158),it/=Z/2,it<1?tt/2*(it*it*(((dt*=1.525)+1)*it-dt))+ut:tt/2*((it-=2)*it*(((dt*=1.525)+1)*it+dt)+2)+ut}e(G,"easeInOutBack");function Ut(it,ut,tt,Z){return tt-xt(Z-it,0,tt,Z)+ut}e(Ut,"easeInBounce");function xt(it,ut,tt,Z){return(it/=Z)<.36363636363636365?tt*(7.5625*it*it)+ut:it<.7272727272727273?tt*(7.5625*(it-=.5454545454545454)*it+.75)+ut:it<.9090909090909091?tt*(7.5625*(it-=.8181818181818182)*it+.9375)+ut:tt*(7.5625*(it-=.9545454545454546)*it+.984375)+ut}e(xt,"easeOutBounce");function Ht(it,ut,tt,Z){return it<Z/2?Ut(it*2,0,tt,Z)*.5+ut:xt(it*2-Z,0,tt,Z)*.5+tt*.5+ut}e(Ht,"easeInOutBounce"),c.util.ease={easeInQuad:function(it,ut,tt,Z){return tt*(it/=Z)*it+ut},easeOutQuad:function(it,ut,tt,Z){return-tt*(it/=Z)*(it-2)+ut},easeInOutQuad:function(it,ut,tt,Z){return it/=Z/2,it<1?tt/2*it*it+ut:-tt/2*(--it*(it-2)-1)+ut},easeInCubic:function(it,ut,tt,Z){return tt*(it/=Z)*it*it+ut},easeOutCubic:m,easeInOutCubic:p,easeInQuart:i,easeOutQuart:a,easeInOutQuart:n,easeInQuint:f,easeOutQuint:_,easeInOutQuint:h,easeInSine:E,easeOutSine:w,easeInOutSine:A,easeInExpo:D,easeOutExpo:z,easeInOutExpo:B,easeInCirc:Y,easeOutCirc:H,easeInOutCirc:V,easeInElastic:lt,easeOutElastic:rt,easeInOutElastic:St,easeInBack:q,easeOutBack:_t,easeInOutBack:G,easeInBounce:Ut,easeOutBounce:xt,easeInOutBounce:Ht}}(),function(b){"use strict";var r=b.fabric||(b.fabric={}),m=r.util.object.extend,p=r.util.object.clone,i=r.util.toFixed,a=r.util.parseUnit,n=r.util.multiplyTransformMatrices,f=["path","circle","polygon","polyline","ellipse","rect","line","image","text"],_=["symbol","image","marker","pattern","view","svg"],h=["pattern","defs","symbol","metadata","clipPath","mask","desc"],E=["symbol","g","a","svg","clipPath","defs"],w={cx:"left",x:"left",r:"radius",cy:"top",y:"top",display:"visible",visibility:"visible",transform:"transformMatrix","fill-opacity":"fillOpacity","fill-rule":"fillRule","font-family":"fontFamily","font-size":"fontSize","font-style":"fontStyle","font-weight":"fontWeight","letter-spacing":"charSpacing","paint-order":"paintFirst","stroke-dasharray":"strokeDashArray","stroke-dashoffset":"strokeDashOffset","stroke-linecap":"strokeLineCap","stroke-linejoin":"strokeLineJoin","stroke-miterlimit":"strokeMiterLimit","stroke-opacity":"strokeOpacity","stroke-width":"strokeWidth","text-decoration":"textDecoration","text-anchor":"textAnchor",opacity:"opacity","clip-path":"clipPath","clip-rule":"clipRule","vector-effect":"strokeUniform","image-rendering":"imageSmoothing"},A={stroke:"strokeOpacity",fill:"fillOpacity"},D="font-size",z="clip-path";r.svgValidTagNamesRegEx=H(f),r.svgViewBoxElementsRegEx=H(_),r.svgInvalidAncestorsRegEx=H(h),r.svgValidParentsRegEx=H(E),r.cssRules={},r.gradientDefs={},r.clipPaths={};function B(X){return X in w?w[X]:X}e(B,"normalizeAttr");function Y(X,$,K,Q){var yt=Object.prototype.toString.call($)==="[object Array]",vt;if((X==="fill"||X==="stroke")&&$==="none")$="";else{if(X==="strokeUniform")return $==="non-scaling-stroke";if(X==="strokeDashArray")$==="none"?$=null:$=$.replace(/,/g," ").split(/\s+/).map(parseFloat);else if(X==="transformMatrix")K&&K.transformMatrix?$=n(K.transformMatrix,r.parseTransformAttribute($)):$=r.parseTransformAttribute($);else if(X==="visible")$=$!=="none"&&$!=="hidden",K&&K.visible===!1&&($=!1);else if(X==="opacity")$=parseFloat($),K&&typeof K.opacity!="undefined"&&($*=K.opacity);else if(X==="textAnchor")$=$==="start"?"left":$==="end"?"right":"center";else if(X==="charSpacing")vt=a($,Q)/Q*1e3;else if(X==="paintFirst"){var It=$.indexOf("fill"),wt=$.indexOf("stroke"),$="fill";(It>-1&&wt>-1&&wt<It||It===-1&&wt>-1)&&($="stroke")}else{if(X==="href"||X==="xlink:href"||X==="font")return $;if(X==="imageSmoothing")return $==="optimizeQuality";vt=yt?$.map(a):a($,Q)}}return!yt&&isNaN(vt)?$:vt}e(Y,"normalizeValue");function H(X){return new RegExp("^("+X.join("|")+")\\b","i")}e(H,"getSvgRegex");function V(X){for(var $ in A)if(!(typeof X[A[$]]=="undefined"||X[$]==="")){if(typeof X[$]=="undefined"){if(!r.Object.prototype[$])continue;X[$]=r.Object.prototype[$]}if(X[$].indexOf("url(")!==0){var K=new r.Color(X[$]);X[$]=K.setAlpha(i(K.getAlpha()*X[A[$]],2)).toRgba()}}return X}e(V,"_setStrokeFillOpacity");function lt(X,$){var K,Q=[],yt,vt,It;for(vt=0,It=$.length;vt<It;vt++)K=$[vt],yt=X.getElementsByTagName(K),Q=Q.concat(Array.prototype.slice.call(yt));return Q}e(lt,"_getMultipleNodes"),r.parseTransformAttribute=function(){function X(Ct,Xt){var Zt=r.util.cos(Xt[0]),ie=r.util.sin(Xt[0]),Ie=0,de=0;Xt.length===3&&(Ie=Xt[1],de=Xt[2]),Ct[0]=Zt,Ct[1]=ie,Ct[2]=-ie,Ct[3]=Zt,Ct[4]=Ie-(Zt*Ie-ie*de),Ct[5]=de-(ie*Ie+Zt*de)}e(X,"rotateMatrix");function $(Ct,Xt){var Zt=Xt[0],ie=Xt.length===2?Xt[1]:Xt[0];Ct[0]=Zt,Ct[3]=ie}e($,"scaleMatrix");function K(Ct,Xt,Zt){Ct[Zt]=Math.tan(r.util.degreesToRadians(Xt[0]))}e(K,"skewMatrix");function Q(Ct,Xt){Ct[4]=Xt[0],Xt.length===2&&(Ct[5]=Xt[1])}e(Q,"translateMatrix");var yt=r.iMatrix,vt=r.reNum,It=r.commaWsp,wt="(?:(skewX)\\s*\\(\\s*("+vt+")\\s*\\))",Et="(?:(skewY)\\s*\\(\\s*("+vt+")\\s*\\))",ct="(?:(rotate)\\s*\\(\\s*("+vt+")(?:"+It+"("+vt+")"+It+"("+vt+"))?\\s*\\))",et="(?:(scale)\\s*\\(\\s*("+vt+")(?:"+It+"("+vt+"))?\\s*\\))",nt="(?:(translate)\\s*\\(\\s*("+vt+")(?:"+It+"("+vt+"))?\\s*\\))",ht="(?:(matrix)\\s*\\(\\s*("+vt+")"+It+"("+vt+")"+It+"("+vt+")"+It+"("+vt+")"+It+"("+vt+")"+It+"("+vt+")\\s*\\))",gt="(?:"+ht+"|"+nt+"|"+et+"|"+ct+"|"+wt+"|"+Et+")",bt="(?:"+gt+"(?:"+It+"*"+gt+")*)",Lt="^\\s*(?:"+bt+"?)\\s*$",Gt=new RegExp(Lt),Wt=new RegExp(gt,"g");return function(Ct){var Xt=yt.concat(),Zt=[];if(!Ct||Ct&&!Gt.test(Ct))return Xt;Ct.replace(Wt,function(Ie){var de=new RegExp(gt).exec(Ie).filter(function(ye){return!!ye}),me=de[1],ae=de.slice(2).map(parseFloat);switch(me){case"translate":Q(Xt,ae);break;case"rotate":ae[0]=r.util.degreesToRadians(ae[0]),X(Xt,ae);break;case"scale":$(Xt,ae);break;case"skewX":K(Xt,ae,2);break;case"skewY":K(Xt,ae,1);break;case"matrix":Xt=ae;break}Zt.push(Xt.concat()),Xt=yt.concat()});for(var ie=Zt[0];Zt.length>1;)Zt.shift(),ie=r.util.multiplyTransformMatrices(ie,Zt[0]);return ie}}();function rt(X,$){var K,Q;X.replace(/;\s*$/,"").split(";").forEach(function(yt){var vt=yt.split(":");K=vt[0].trim().toLowerCase(),Q=vt[1].trim(),$[K]=Q})}e(rt,"parseStyleString");function St(X,$){var K,Q;for(var yt in X)typeof X[yt]!="undefined"&&(K=yt.toLowerCase(),Q=X[yt],$[K]=Q)}e(St,"parseStyleObject");function q(X,$){var K={};for(var Q in r.cssRules[$])if(_t(X,Q.split(" ")))for(var yt in r.cssRules[$][Q])K[yt]=r.cssRules[$][Q][yt];return K}e(q,"getGlobalStylesForElement");function _t(X,$){var K,Q=!0;return K=Ut(X,$.pop()),K&&$.length&&(Q=G(X,$)),K&&Q&&$.length===0}e(_t,"elementMatchesRule");function G(X,$){for(var K,Q=!0;X.parentNode&&X.parentNode.nodeType===1&&$.length;)Q&&(K=$.pop()),X=X.parentNode,Q=Ut(X,K);return $.length===0}e(G,"doesSomeParentMatch");function Ut(X,$){var K=X.nodeName,Q=X.getAttribute("class"),yt=X.getAttribute("id"),vt,It;if(vt=new RegExp("^"+K,"i"),$=$.replace(vt,""),yt&&$.length&&(vt=new RegExp("#"+yt+"(?![a-zA-Z\\-]+)","i"),$=$.replace(vt,"")),Q&&$.length)for(Q=Q.split(" "),It=Q.length;It--;)vt=new RegExp("\\."+Q[It]+"(?![a-zA-Z\\-]+)","i"),$=$.replace(vt,"");return $.length===0}e(Ut,"selectorMatches");function xt(X,$){var K;if(X.getElementById&&(K=X.getElementById($)),K)return K;var Q,yt,vt,It=X.getElementsByTagName("*");for(yt=0,vt=It.length;yt<vt;yt++)if(Q=It[yt],$===Q.getAttribute("id"))return Q}e(xt,"elementById");function Ht(X){for(var $=lt(X,["use","svg:use"]),K=0;$.length&&K<$.length;){var Q=$[K],yt=Q.getAttribute("xlink:href")||Q.getAttribute("href");if(yt===null)return;var vt=yt.substr(1),It=Q.getAttribute("x")||0,wt=Q.getAttribute("y")||0,Et=xt(X,vt).cloneNode(!0),ct=(Et.getAttribute("transform")||"")+" translate("+It+", "+wt+")",et,nt=$.length,ht,gt,bt,Lt,Gt=r.svgNS;if(ut(Et),/^svg$/i.test(Et.nodeName)){var Wt=Et.ownerDocument.createElementNS(Gt,"g");for(gt=0,bt=Et.attributes,Lt=bt.length;gt<Lt;gt++)ht=bt.item(gt),Wt.setAttributeNS(Gt,ht.nodeName,ht.nodeValue);for(;Et.firstChild;)Wt.appendChild(Et.firstChild);Et=Wt}for(gt=0,bt=Q.attributes,Lt=bt.length;gt<Lt;gt++)ht=bt.item(gt),!(ht.nodeName==="x"||ht.nodeName==="y"||ht.nodeName==="xlink:href"||ht.nodeName==="href")&&(ht.nodeName==="transform"?ct=ht.nodeValue+" "+ct:Et.setAttribute(ht.nodeName,ht.nodeValue));Et.setAttribute("transform",ct),Et.setAttribute("instantiated_by_use","1"),Et.removeAttribute("id"),et=Q.parentNode,et.replaceChild(Et,Q),$.length===nt&&K++}}e(Ht,"parseUseDirectives");var it=new RegExp("^\\s*("+r.reNum+"+)\\s*,?\\s*("+r.reNum+"+)\\s*,?\\s*("+r.reNum+"+)\\s*,?\\s*("+r.reNum+"+)\\s*$");function ut(X){if(!r.svgViewBoxElementsRegEx.test(X.nodeName))return{};var $=X.getAttribute("viewBox"),K=1,Q=1,yt=0,vt=0,It,wt,Et,ct,et=X.getAttribute("width"),nt=X.getAttribute("height"),ht=X.getAttribute("x")||0,gt=X.getAttribute("y")||0,bt=X.getAttribute("preserveAspectRatio")||"",Lt=!$||!($=$.match(it)),Gt=!et||!nt||et==="100%"||nt==="100%",Wt=Lt&&Gt,Ct={},Xt="",Zt=0,ie=0;if(Ct.width=0,Ct.height=0,Ct.toBeParsed=Wt,Lt&&(ht||gt)&&X.parentNode&&X.parentNode.nodeName!=="#document"&&(Xt=" translate("+a(ht)+" "+a(gt)+") ",Et=(X.getAttribute("transform")||"")+Xt,X.setAttribute("transform",Et),X.removeAttribute("x"),X.removeAttribute("y")),Wt)return Ct;if(Lt)return Ct.width=a(et),Ct.height=a(nt),Ct;if(yt=-parseFloat($[1]),vt=-parseFloat($[2]),It=parseFloat($[3]),wt=parseFloat($[4]),Ct.minX=yt,Ct.minY=vt,Ct.viewBoxWidth=It,Ct.viewBoxHeight=wt,Gt?(Ct.width=It,Ct.height=wt):(Ct.width=a(et),Ct.height=a(nt),K=Ct.width/It,Q=Ct.height/wt),bt=r.util.parsePreserveAspectRatioAttribute(bt),bt.alignX!=="none"&&(bt.meetOrSlice==="meet"&&(Q=K=K>Q?Q:K),bt.meetOrSlice==="slice"&&(Q=K=K>Q?K:Q),Zt=Ct.width-It*K,ie=Ct.height-wt*K,bt.alignX==="Mid"&&(Zt/=2),bt.alignY==="Mid"&&(ie/=2),bt.alignX==="Min"&&(Zt=0),bt.alignY==="Min"&&(ie=0)),K===1&&Q===1&&yt===0&&vt===0&&ht===0&>===0)return Ct;if((ht||gt)&&X.parentNode.nodeName!=="#document"&&(Xt=" translate("+a(ht)+" "+a(gt)+") "),Et=Xt+" matrix("+K+" 0 0 "+Q+" "+(yt*K+Zt)+" "+(vt*Q+ie)+") ",X.nodeName==="svg"){for(ct=X.ownerDocument.createElementNS(r.svgNS,"g");X.firstChild;)ct.appendChild(X.firstChild);X.appendChild(ct)}else ct=X,ct.removeAttribute("x"),ct.removeAttribute("y"),Et=ct.getAttribute("transform")+Et;return ct.setAttribute("transform",Et),Ct}e(ut,"applyViewboxTransform");function tt(X,$){for(;X&&(X=X.parentNode);)if(X.nodeName&&$.test(X.nodeName.replace("svg:",""))&&!X.getAttribute("instantiated_by_use"))return!0;return!1}e(tt,"hasAncestorWithNodeName"),r.parseSVGDocument=function(X,$,K,Q){if(X){Ht(X);var yt=r.Object.__uid++,vt,It,wt=ut(X),Et=r.util.toArray(X.getElementsByTagName("*"));if(wt.crossOrigin=Q&&Q.crossOrigin,wt.svgUid=yt,Et.length===0&&r.isLikelyNode){Et=X.selectNodes('//*[name(.)!="svg"]');var ct=[];for(vt=0,It=Et.length;vt<It;vt++)ct[vt]=Et[vt];Et=ct}var et=Et.filter(function(ht){return ut(ht),r.svgValidTagNamesRegEx.test(ht.nodeName.replace("svg:",""))&&!tt(ht,r.svgInvalidAncestorsRegEx)});if(!et||et&&!et.length){$&&$([],{});return}var nt={};Et.filter(function(ht){return ht.nodeName.replace("svg:","")==="clipPath"}).forEach(function(ht){var gt=ht.getAttribute("id");nt[gt]=r.util.toArray(ht.getElementsByTagName("*")).filter(function(bt){return r.svgValidTagNamesRegEx.test(bt.nodeName.replace("svg:",""))})}),r.gradientDefs[yt]=r.getGradientDefs(X),r.cssRules[yt]=r.getCSSRules(X),r.clipPaths[yt]=nt,r.parseElements(et,function(ht,gt){$&&($(ht,wt,gt,Et),delete r.gradientDefs[yt],delete r.cssRules[yt],delete r.clipPaths[yt])},p(wt),K,Q)}};function Z(X,$){var K=["gradientTransform","x1","x2","y1","y2","gradientUnits","cx","cy","r","fx","fy"],Q="xlink:href",yt=$.getAttribute(Q).substr(1),vt=xt(X,yt);if(vt&&vt.getAttribute(Q)&&Z(X,vt),K.forEach(function(wt){vt&&!$.hasAttribute(wt)&&vt.hasAttribute(wt)&&$.setAttribute(wt,vt.getAttribute(wt))}),!$.children.length)for(var It=vt.cloneNode(!0);It.firstChild;)$.appendChild(It.firstChild);$.removeAttribute(Q)}e(Z,"recursivelyParseGradientsXlink");var dt=new RegExp("(normal|italic)?\\s*(normal|small-caps)?\\s*(normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900)?\\s*("+r.reNum+"(?:px|cm|mm|em|pt|pc|in)*)(?:\\/(normal|"+r.reNum+"))?\\s+(.*)");m(r,{parseFontDeclaration:function(X,$){var K=X.match(dt);if(K){var Q=K[1],yt=K[3],vt=K[4],It=K[5],wt=K[6];Q&&($.fontStyle=Q),yt&&($.fontWeight=isNaN(parseFloat(yt))?yt:parseFloat(yt)),vt&&($.fontSize=a(vt)),wt&&($.fontFamily=wt),It&&($.lineHeight=It==="normal"?1:It)}},getGradientDefs:function(X){var $=["linearGradient","radialGradient","svg:linearGradient","svg:radialGradient"],K=lt(X,$),Q,yt=0,vt={};for(yt=K.length;yt--;)Q=K[yt],Q.getAttribute("xlink:href")&&Z(X,Q),vt[Q.getAttribute("id")]=Q;return vt},parseAttributes:function(X,$,K){if(X){var Q,yt={},vt,It;typeof K=="undefined"&&(K=X.getAttribute("svgUid")),X.parentNode&&r.svgValidParentsRegEx.test(X.parentNode.nodeName)&&(yt=r.parseAttributes(X.parentNode,$,K));var wt=$.reduce(function(bt,Lt){return Q=X.getAttribute(Lt),Q&&(bt[Lt]=Q),bt},{}),Et=m(q(X,K),r.parseStyleAttribute(X));wt=m(wt,Et),Et[z]&&X.setAttribute(z,Et[z]),vt=It=yt.fontSize||r.Text.DEFAULT_SVG_FONT_SIZE,wt[D]&&(wt[D]=vt=a(wt[D],It));var ct,et,nt={};for(var ht in wt)ct=B(ht),et=Y(ct,wt[ht],yt,vt),nt[ct]=et;nt&&nt.font&&r.parseFontDeclaration(nt.font,nt);var gt=m(yt,nt);return r.svgValidParentsRegEx.test(X.nodeName)?gt:V(gt)}},parseElements:function(X,$,K,Q,yt){new r.ElementsParser(X,$,K,Q,yt).parse()},parseStyleAttribute:function(X){var $={},K=X.getAttribute("style");return K&&(typeof K=="string"?rt(K,$):St(K,$)),$},parsePointsAttribute:function(X){if(!X)return null;X=X.replace(/,/g," ").trim(),X=X.split(/\s+/);var $=[],K,Q;for(K=0,Q=X.length;K<Q;K+=2)$.push({x:parseFloat(X[K]),y:parseFloat(X[K+1])});return $},getCSSRules:function(X){var $=X.getElementsByTagName("style"),K,Q,yt={},vt;for(K=0,Q=$.length;K<Q;K++){var It=$[K].textContent;It=It.replace(/\/\*[\s\S]*?\*\//g,""),It.trim()!==""&&(vt=It.match(/[^{]*\{[\s\S]*?\}/g),vt=vt.map(function(wt){return wt.trim()}),vt.forEach(function(wt){var Et=wt.match(/([\s\S]*?)\s*\{([^}]*)\}/),ct={},et=Et[2].trim(),nt=et.replace(/;$/,"").split(/\s*;\s*/);for(K=0,Q=nt.length;K<Q;K++){var ht=nt[K].split(/\s*:\s*/),gt=ht[0],bt=ht[1];ct[gt]=bt}wt=Et[1],wt.split(",").forEach(function(Lt){Lt=Lt.replace(/^svg/i,"").trim(),Lt!==""&&(yt[Lt]?r.util.object.extend(yt[Lt],ct):yt[Lt]=r.util.object.clone(ct))})}))}return yt},loadSVGFromURL:function(X,$,K,Q){X=X.replace(/^\n\s*/,"").trim(),new r.util.request(X,{method:"get",onComplete:yt});function yt(vt){var It=vt.responseXML;if(!It||!It.documentElement)return $&&$(null),!1;r.parseSVGDocument(It.documentElement,function(wt,Et,ct,et){$&&$(wt,Et,ct,et)},K,Q)}e(yt,"onComplete")},loadSVGFromString:function(X,$,K,Q){var yt=new r.window.DOMParser,vt=yt.parseFromString(X.trim(),"text/xml");r.parseSVGDocument(vt.documentElement,function(It,wt,Et,ct){$(It,wt,Et,ct)},K,Q)}})}(I),c.ElementsParser=function(b,r,m,p,i,a){this.elements=b,this.callback=r,this.options=m,this.reviver=p,this.svgUid=m&&m.svgUid||0,this.parsingOptions=i,this.regexUrl=/^url\(['"]?#([^'"]+)['"]?\)/g,this.doc=a},function(b){b.parse=function(){this.instances=new Array(this.elements.length),this.numElements=this.elements.length,this.createObjects()},b.createObjects=function(){var r=this;this.elements.forEach(function(m,p){m.setAttribute("svgUid",r.svgUid),r.createObject(m,p)})},b.findTag=function(r){return c[c.util.string.capitalize(r.tagName.replace("svg:",""))]},b.createObject=function(r,m){var p=this.findTag(r);if(p&&p.fromElement)try{p.fromElement(r,this.createCallback(m,r),this.options)}catch(i){c.log(i)}else this.checkIfDone()},b.createCallback=function(r,m){var p=this;return function(i){var a;p.resolveGradient(i,m,"fill"),p.resolveGradient(i,m,"stroke"),i instanceof c.Image&&i._originalElement&&(a=i.parsePreserveAspectRatioAttribute(m)),i._removeTransformMatrix(a),p.resolveClipPath(i,m),p.reviver&&p.reviver(m,i),p.instances[r]=i,p.checkIfDone()}},b.extractPropertyDefinition=function(r,m,p){var i=r[m],a=this.regexUrl;if(a.test(i)){a.lastIndex=0;var n=a.exec(i)[1];return a.lastIndex=0,c[p][this.svgUid][n]}},b.resolveGradient=function(r,m,p){var i=this.extractPropertyDefinition(r,p,"gradientDefs");if(i){var a=m.getAttribute(p+"-opacity"),n=c.Gradient.fromElement(i,r,a,this.options);r.set(p,n)}},b.createClipPathCallback=function(r,m){return function(p){p._removeTransformMatrix(),p.fillRule=p.clipRule,m.push(p)}},b.resolveClipPath=function(r,m){var p=this.extractPropertyDefinition(r,"clipPath","clipPaths"),i,a,n,f,_,h;if(p){f=[],n=c.util.invertTransform(r.calcTransformMatrix());for(var E=p[0].parentNode,w=m;w.parentNode&&w.getAttribute("clip-path")!==r.clipPath;)w=w.parentNode;w.parentNode.appendChild(E);for(var A=0;A<p.length;A++)i=p[A],a=this.findTag(i),a.fromElement(i,this.createClipPathCallback(r,f),this.options);f.length===1?p=f[0]:p=new c.Group(f),_=c.util.multiplyTransformMatrices(n,p.calcTransformMatrix()),p.clipPath&&this.resolveClipPath(p,w);var h=c.util.qrDecompose(_);p.flipX=!1,p.flipY=!1,p.set("scaleX",h.scaleX),p.set("scaleY",h.scaleY),p.angle=h.angle,p.skewX=h.skewX,p.skewY=0,p.setPositionByOrigin({x:h.translateX,y:h.translateY},"center","center"),r.clipPath=p}else delete r.clipPath},b.checkIfDone=function(){--this.numElements===0&&(this.instances=this.instances.filter(function(r){return r!=null}),this.callback(this.instances,this.elements))}}(c.ElementsParser.prototype),function(b){"use strict";var r=b.fabric||(b.fabric={});if(r.Point){r.warn("fabric.Point is already defined");return}r.Point=m;function m(p,i){this.x=p,this.y=i}e(m,"Point"),m.prototype={type:"point",constructor:m,add:function(p){return new m(this.x+p.x,this.y+p.y)},addEquals:function(p){return this.x+=p.x,this.y+=p.y,this},scalarAdd:function(p){return new m(this.x+p,this.y+p)},scalarAddEquals:function(p){return this.x+=p,this.y+=p,this},subtract:function(p){return new m(this.x-p.x,this.y-p.y)},subtractEquals:function(p){return this.x-=p.x,this.y-=p.y,this},scalarSubtract:function(p){return new m(this.x-p,this.y-p)},scalarSubtractEquals:function(p){return this.x-=p,this.y-=p,this},multiply:function(p){return new m(this.x*p,this.y*p)},multiplyEquals:function(p){return this.x*=p,this.y*=p,this},divide:function(p){return new m(this.x/p,this.y/p)},divideEquals:function(p){return this.x/=p,this.y/=p,this},eq:function(p){return this.x===p.x&&this.y===p.y},lt:function(p){return this.x<p.x&&this.y<p.y},lte:function(p){return this.x<=p.x&&this.y<=p.y},gt:function(p){return this.x>p.x&&this.y>p.y},gte:function(p){return this.x>=p.x&&this.y>=p.y},lerp:function(p,i){return typeof i=="undefined"&&(i=.5),i=Math.max(Math.min(1,i),0),new m(this.x+(p.x-this.x)*i,this.y+(p.y-this.y)*i)},distanceFrom:function(p){var i=this.x-p.x,a=this.y-p.y;return Math.sqrt(i*i+a*a)},midPointFrom:function(p){return this.lerp(p)},min:function(p){return new m(Math.min(this.x,p.x),Math.min(this.y,p.y))},max:function(p){return new m(Math.max(this.x,p.x),Math.max(this.y,p.y))},toString:function(){return this.x+","+this.y},setXY:function(p,i){return this.x=p,this.y=i,this},setX:function(p){return this.x=p,this},setY:function(p){return this.y=p,this},setFromPoint:function(p){return this.x=p.x,this.y=p.y,this},swap:function(p){var i=this.x,a=this.y;this.x=p.x,this.y=p.y,p.x=i,p.y=a},clone:function(){return new m(this.x,this.y)}}}(I),function(b){"use strict";var r=b.fabric||(b.fabric={});if(r.Intersection){r.warn("fabric.Intersection is already defined");return}function m(p){this.status=p,this.points=[]}e(m,"Intersection"),r.Intersection=m,r.Intersection.prototype={constructor:m,appendPoint:function(p){return this.points.push(p),this},appendPoints:function(p){return this.points=this.points.concat(p),this}},r.Intersection.intersectLineLine=function(p,i,a,n){var f,_=(n.x-a.x)*(p.y-a.y)-(n.y-a.y)*(p.x-a.x),h=(i.x-p.x)*(p.y-a.y)-(i.y-p.y)*(p.x-a.x),E=(n.y-a.y)*(i.x-p.x)-(n.x-a.x)*(i.y-p.y);if(E!==0){var w=_/E,A=h/E;0<=w&&w<=1&&0<=A&&A<=1?(f=new m("Intersection"),f.appendPoint(new r.Point(p.x+w*(i.x-p.x),p.y+w*(i.y-p.y)))):f=new m}else _===0||h===0?f=new m("Coincident"):f=new m("Parallel");return f},r.Intersection.intersectLinePolygon=function(p,i,a){var n=new m,f=a.length,_,h,E,w;for(w=0;w<f;w++)_=a[w],h=a[(w+1)%f],E=m.intersectLineLine(p,i,_,h),n.appendPoints(E.points);return n.points.length>0&&(n.status="Intersection"),n},r.Intersection.intersectPolygonPolygon=function(p,i){var a=new m,n=p.length,f;for(f=0;f<n;f++){var _=p[f],h=p[(f+1)%n],E=m.intersectLinePolygon(_,h,i);a.appendPoints(E.points)}return a.points.length>0&&(a.status="Intersection"),a},r.Intersection.intersectPolygonRectangle=function(p,i,a){var n=i.min(a),f=i.max(a),_=new r.Point(f.x,n.y),h=new r.Point(n.x,f.y),E=m.intersectLinePolygon(n,_,p),w=m.intersectLinePolygon(_,f,p),A=m.intersectLinePolygon(f,h,p),D=m.intersectLinePolygon(h,n,p),z=new m;return z.appendPoints(E.points),z.appendPoints(w.points),z.appendPoints(A.points),z.appendPoints(D.points),z.points.length>0&&(z.status="Intersection"),z}}(I),function(b){"use strict";var r=b.fabric||(b.fabric={});if(r.Color){r.warn("fabric.Color is already defined.");return}function m(i){i?this._tryParsingColor(i):this.setSource([0,0,0,1])}e(m,"Color"),r.Color=m,r.Color.prototype={_tryParsingColor:function(i){var a;i in m.colorNameMap&&(i=m.colorNameMap[i]),i==="transparent"&&(a=[255,255,255,0]),a||(a=m.sourceFromHex(i)),a||(a=m.sourceFromRgb(i)),a||(a=m.sourceFromHsl(i)),a||(a=[0,0,0,1]),a&&this.setSource(a)},_rgbToHsl:function(i,a,n){i/=255,a/=255,n/=255;var f,_,h,E=r.util.array.max([i,a,n]),w=r.util.array.min([i,a,n]);if(h=(E+w)/2,E===w)f=_=0;else{var A=E-w;switch(_=h>.5?A/(2-E-w):A/(E+w),E){case i:f=(a-n)/A+(a<n?6:0);break;case a:f=(n-i)/A+2;break;case n:f=(i-a)/A+4;break}f/=6}return[Math.round(f*360),Math.round(_*100),Math.round(h*100)]},getSource:function(){return this._source},setSource:function(i){this._source=i},toRgb:function(){var i=this.getSource();return"rgb("+i[0]+","+i[1]+","+i[2]+")"},toRgba:function(){var i=this.getSource();return"rgba("+i[0]+","+i[1]+","+i[2]+","+i[3]+")"},toHsl:function(){var i=this.getSource(),a=this._rgbToHsl(i[0],i[1],i[2]);return"hsl("+a[0]+","+a[1]+"%,"+a[2]+"%)"},toHsla:function(){var i=this.getSource(),a=this._rgbToHsl(i[0],i[1],i[2]);return"hsla("+a[0]+","+a[1]+"%,"+a[2]+"%,"+i[3]+")"},toHex:function(){var i=this.getSource(),a,n,f;return a=i[0].toString(16),a=a.length===1?"0"+a:a,n=i[1].toString(16),n=n.length===1?"0"+n:n,f=i[2].toString(16),f=f.length===1?"0"+f:f,a.toUpperCase()+n.toUpperCase()+f.toUpperCase()},toHexa:function(){var i=this.getSource(),a;return a=Math.round(i[3]*255),a=a.toString(16),a=a.length===1?"0"+a:a,this.toHex()+a.toUpperCase()},getAlpha:function(){return this.getSource()[3]},setAlpha:function(i){var a=this.getSource();return a[3]=i,this.setSource(a),this},toGrayscale:function(){var i=this.getSource(),a=parseInt((i[0]*.3+i[1]*.59+i[2]*.11).toFixed(0),10),n=i[3];return this.setSource([a,a,a,n]),this},toBlackWhite:function(i){var a=this.getSource(),n=(a[0]*.3+a[1]*.59+a[2]*.11).toFixed(0),f=a[3];return i=i||127,n=Number(n)<Number(i)?0:255,this.setSource([n,n,n,f]),this},overlayWith:function(i){i instanceof m||(i=new m(i));var a=[],n=this.getAlpha(),f=.5,_=this.getSource(),h=i.getSource(),E;for(E=0;E<3;E++)a.push(Math.round(_[E]*(1-f)+h[E]*f));return a[3]=n,this.setSource(a),this}},r.Color.reRGBa=/^rgba?\(\s*(\d{1,3}(?:\.\d+)?\%?)\s*,\s*(\d{1,3}(?:\.\d+)?\%?)\s*,\s*(\d{1,3}(?:\.\d+)?\%?)\s*(?:\s*,\s*((?:\d*\.?\d+)?)\s*)?\)$/i,r.Color.reHSLa=/^hsla?\(\s*(\d{1,3})\s*,\s*(\d{1,3}\%)\s*,\s*(\d{1,3}\%)\s*(?:\s*,\s*(\d+(?:\.\d+)?)\s*)?\)$/i,r.Color.reHex=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,r.Color.colorNameMap={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aqua:"#00FFFF",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000000",blanchedalmond:"#FFEBCD",blue:"#0000FF",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#00FFFF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",darkgreen:"#006400",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",fuchsia:"#FF00FF",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgray:"#D3D3D3",lightgrey:"#D3D3D3",lightgreen:"#90EE90",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",lime:"#00FF00",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#FF00FF",maroon:"#800000",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",navy:"#000080",oldlace:"#FDF5E6",olive:"#808000",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",purple:"#800080",rebeccapurple:"#663399",red:"#FF0000",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",silver:"#C0C0C0",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",teal:"#008080",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",white:"#FFFFFF",whitesmoke:"#F5F5F5",yellow:"#FFFF00",yellowgreen:"#9ACD32"};function p(i,a,n){return n<0&&(n+=1),n>1&&(n-=1),n<.16666666666666666?i+(a-i)*6*n:n<.5?a:n<.6666666666666666?i+(a-i)*(.6666666666666666-n)*6:i}e(p,"hue2rgb"),r.Color.fromRgb=function(i){return m.fromSource(m.sourceFromRgb(i))},r.Color.sourceFromRgb=function(i){var a=i.match(m.reRGBa);if(a){var n=parseInt(a[1],10)/(/%$/.test(a[1])?100:1)*(/%$/.test(a[1])?255:1),f=parseInt(a[2],10)/(/%$/.test(a[2])?100:1)*(/%$/.test(a[2])?255:1),_=parseInt(a[3],10)/(/%$/.test(a[3])?100:1)*(/%$/.test(a[3])?255:1);return[parseInt(n,10),parseInt(f,10),parseInt(_,10),a[4]?parseFloat(a[4]):1]}},r.Color.fromRgba=m.fromRgb,r.Color.fromHsl=function(i){return m.fromSource(m.sourceFromHsl(i))},r.Color.sourceFromHsl=function(i){var a=i.match(m.reHSLa);if(a){var n=(parseFloat(a[1])%360+360)%360/360,f=parseFloat(a[2])/(/%$/.test(a[2])?100:1),_=parseFloat(a[3])/(/%$/.test(a[3])?100:1),h,E,w;if(f===0)h=E=w=_;else{var A=_<=.5?_*(f+1):_+f-_*f,D=_*2-A;h=p(D,A,n+.3333333333333333),E=p(D,A,n),w=p(D,A,n-.3333333333333333)}return[Math.round(h*255),Math.round(E*255),Math.round(w*255),a[4]?parseFloat(a[4]):1]}},r.Color.fromHsla=m.fromHsl,r.Color.fromHex=function(i){return m.fromSource(m.sourceFromHex(i))},r.Color.sourceFromHex=function(i){if(i.match(m.reHex)){var a=i.slice(i.indexOf("#")+1),n=a.length===3||a.length===4,f=a.length===8||a.length===4,_=n?a.charAt(0)+a.charAt(0):a.substring(0,2),h=n?a.charAt(1)+a.charAt(1):a.substring(2,4),E=n?a.charAt(2)+a.charAt(2):a.substring(4,6),w=f?n?a.charAt(3)+a.charAt(3):a.substring(6,8):"FF";return[parseInt(_,16),parseInt(h,16),parseInt(E,16),parseFloat((parseInt(w,16)/255).toFixed(2))]}},r.Color.fromSource=function(i){var a=new m;return a.setSource(i),a}}(I),function(b){"use strict";var r=b.fabric||(b.fabric={}),m=["e","se","s","sw","w","nw","n","ne","e"],p=["ns","nesw","ew","nwse"],i={},a="left",n="top",f="right",_="bottom",h="center",E={top:_,bottom:n,left:f,right:a,center:h},w=r.util.radiansToDegrees,A=Math.sign||function(ct){return(ct>0)-(ct<0)||+ct};function D(ct,et){var nt=ct.angle+w(Math.atan2(et.y,et.x))+360;return Math.round(nt%360/45)}e(D,"findCornerQuadrant");function z(ct,et){var nt=et.transform.target,ht=nt.canvas,gt=r.util.object.clone(et);gt.target=nt,ht&&ht.fire("object:"+ct,gt),nt.fire(ct,et)}e(z,"fireEvent");function B(ct,et){var nt=et.canvas,ht=nt.uniScaleKey,gt=ct[ht];return nt.uniformScaling&&!gt||!nt.uniformScaling&>}e(B,"scaleIsProportional");function Y(ct){return ct.originX===h&&ct.originY===h}e(Y,"isTransformCentered");function H(ct,et,nt){var ht=ct.lockScalingX,gt=ct.lockScalingY;return!!(ht&>||!et&&(ht||gt)&&nt||ht&&et==="x"||gt&&et==="y")}e(H,"scalingIsForbidden");function V(ct,et,nt){var ht="not-allowed",gt=B(ct,nt),bt="";if(et.x!==0&&et.y===0?bt="x":et.x===0&&et.y!==0&&(bt="y"),H(nt,bt,gt))return ht;var Lt=D(nt,et);return m[Lt]+"-resize"}e(V,"scaleCursorStyleHandler");function lt(ct,et,nt){var ht="not-allowed";if(et.x!==0&&nt.lockSkewingY||et.y!==0&&nt.lockSkewingX)return ht;var gt=D(nt,et)%4;return p[gt]+"-resize"}e(lt,"skewCursorStyleHandler");function rt(ct,et,nt){return ct[nt.canvas.altActionKey]?i.skewCursorStyleHandler(ct,et,nt):i.scaleCursorStyleHandler(ct,et,nt)}e(rt,"scaleSkewCursorStyleHandler");function St(ct,et,nt){var ht=ct[nt.canvas.altActionKey];if(et.x===0)return ht?"skewX":"scaleY";if(et.y===0)return ht?"skewY":"scaleX"}e(St,"scaleOrSkewActionName");function q(ct,et,nt){return nt.lockRotation?"not-allowed":et.cursorStyle}e(q,"rotationStyleHandler");function _t(ct,et,nt,ht){return{e:ct,transform:et,pointer:{x:nt,y:ht}}}e(_t,"commonEventInfo");function G(ct){return function(et,nt,ht,gt){var bt=nt.target,Lt=bt.getCenterPoint(),Gt=bt.translateToOriginPoint(Lt,nt.originX,nt.originY),Wt=ct(et,nt,ht,gt);return bt.setPositionByOrigin(Gt,nt.originX,nt.originY),Wt}}e(G,"wrapWithFixedAnchor");function Ut(ct,et){return function(nt,ht,gt,bt){var Lt=et(nt,ht,gt,bt);return Lt&&z(ct,_t(nt,ht,gt,bt)),Lt}}e(Ut,"wrapWithFireEvent");function xt(ct,et,nt,ht,gt){var bt=ct.target,Lt=bt.controls[ct.corner],Gt=bt.canvas.getZoom(),Wt=bt.padding/Gt,Ct=bt.toLocalPoint(new r.Point(ht,gt),et,nt);return Ct.x>=Wt&&(Ct.x-=Wt),Ct.x<=-Wt&&(Ct.x+=Wt),Ct.y>=Wt&&(Ct.y-=Wt),Ct.y<=Wt&&(Ct.y+=Wt),Ct.x-=Lt.offsetX,Ct.y-=Lt.offsetY,Ct}e(xt,"getLocalPoint");function Ht(ct){return ct.flipX!==ct.flipY}e(Ht,"targetHasOneFlip");function it(ct,et,nt,ht,gt){if(ct[et]!==0){var bt=ct._getTransformedDimensions()[ht],Lt=gt/bt*ct[nt];ct.set(nt,Lt)}}e(it,"compensateScaleForSkew");function ut(ct,et,nt,ht){var gt=et.target,bt=gt._getTransformedDimensions(0,gt.skewY),Lt=xt(et,et.originX,et.originY,nt,ht),Gt=Math.abs(Lt.x*2)-bt.x,Wt=gt.skewX,Ct;Gt<2?Ct=0:(Ct=w(Math.atan2(Gt/gt.scaleX,bt.y/gt.scaleY)),et.originX===a&&et.originY===_&&(Ct=-Ct),et.originX===f&&et.originY===n&&(Ct=-Ct),Ht(gt)&&(Ct=-Ct));var Xt=Wt!==Ct;if(Xt){var Zt=gt._getTransformedDimensions().y;gt.set("skewX",Ct),it(gt,"skewY","scaleY","y",Zt)}return Xt}e(ut,"skewObjectX");function tt(ct,et,nt,ht){var gt=et.target,bt=gt._getTransformedDimensions(gt.skewX,0),Lt=xt(et,et.originX,et.originY,nt,ht),Gt=Math.abs(Lt.y*2)-bt.y,Wt=gt.skewY,Ct;Gt<2?Ct=0:(Ct=w(Math.atan2(Gt/gt.scaleY,bt.x/gt.scaleX)),et.originX===a&&et.originY===_&&(Ct=-Ct),et.originX===f&&et.originY===n&&(Ct=-Ct),Ht(gt)&&(Ct=-Ct));var Xt=Wt!==Ct;if(Xt){var Zt=gt._getTransformedDimensions().x;gt.set("skewY",Ct),it(gt,"skewX","scaleX","x",Zt)}return Xt}e(tt,"skewObjectY");function Z(ct,et,nt,ht){var gt=et.target,bt=gt.skewX,Lt,Gt=et.originY;if(gt.lockSkewingX)return!1;if(bt===0){var Wt=xt(et,h,h,nt,ht);Wt.x>0?Lt=a:Lt=f}else bt>0&&(Lt=Gt===n?a:f),bt<0&&(Lt=Gt===n?f:a),Ht(gt)&&(Lt=Lt===a?f:a);et.originX=Lt;var Ct=Ut("skewing",G(ut));return Ct(ct,et,nt,ht)}e(Z,"skewHandlerX");function dt(ct,et,nt,ht){var gt=et.target,bt=gt.skewY,Lt,Gt=et.originX;if(gt.lockSkewingY)return!1;if(bt===0){var Wt=xt(et,h,h,nt,ht);Wt.y>0?Lt=n:Lt=_}else bt>0&&(Lt=Gt===a?n:_),bt<0&&(Lt=Gt===a?_:n),Ht(gt)&&(Lt=Lt===n?_:n);et.originY=Lt;var Ct=Ut("skewing",G(tt));return Ct(ct,et,nt,ht)}e(dt,"skewHandlerY");function X(ct,et,nt,ht){var gt=et,bt=gt.target,Lt=bt.translateToOriginPoint(bt.getCenterPoint(),gt.originX,gt.originY);if(bt.lockRotation)return!1;var Gt=Math.atan2(gt.ey-Lt.y,gt.ex-Lt.x),Wt=Math.atan2(ht-Lt.y,nt-Lt.x),Ct=w(Wt-Gt+gt.theta),Xt=!0;if(bt.snapAngle>0){var Zt=bt.snapAngle,ie=bt.snapThreshold||Zt,Ie=Math.ceil(Ct/Zt)*Zt,de=Math.floor(Ct/Zt)*Zt;Math.abs(Ct-de)<ie?Ct=de:Math.abs(Ct-Ie)<ie&&(Ct=Ie)}return Ct<0&&(Ct=360+Ct),Ct%=360,Xt=bt.angle!==Ct,bt.angle=Ct,Xt}e(X,"rotationWithSnapping");function $(ct,et,nt,ht,gt){gt=gt||{};var bt=et.target,Lt=bt.lockScalingX,Gt=bt.lockScalingY,Wt=gt.by,Ct,Xt,Zt,ie,Ie=B(ct,bt),de=H(bt,Wt,Ie),me,ae,ye=et.gestureScale;if(de)return!1;if(ye)Xt=et.scaleX*ye,Zt=et.scaleY*ye;else{if(Ct=xt(et,et.originX,et.originY,nt,ht),me=Wt!=="y"?A(Ct.x):1,ae=Wt!=="x"?A(Ct.y):1,et.signX||(et.signX=me),et.signY||(et.signY=ae),bt.lockScalingFlip&&(et.signX!==me||et.signY!==ae))return!1;if(ie=bt._getTransformedDimensions(),Ie&&!Wt){var Ae=Math.abs(Ct.x)+Math.abs(Ct.y),Fe=et.original,Ot=Math.abs(ie.x*Fe.scaleX/bt.scaleX)+Math.abs(ie.y*Fe.scaleY/bt.scaleY),kt=Ae/Ot;Xt=Fe.scaleX*kt,Zt=Fe.scaleY*kt}else Xt=Math.abs(Ct.x*bt.scaleX/ie.x),Zt=Math.abs(Ct.y*bt.scaleY/ie.y);Y(et)&&(Xt*=2,Zt*=2),et.signX!==me&&Wt!=="y"&&(et.originX=E[et.originX],Xt*=-1,et.signX=me),et.signY!==ae&&Wt!=="x"&&(et.originY=E[et.originY],Zt*=-1,et.signY=ae)}var Bt=bt.scaleX,Yt=bt.scaleY;return Wt?(Wt==="x"&&bt.set("scaleX",Xt),Wt==="y"&&bt.set("scaleY",Zt)):(!Lt&&bt.set("scaleX",Xt),!Gt&&bt.set("scaleY",Zt)),Bt!==bt.scaleX||Yt!==bt.scaleY}e($,"scaleObject");function K(ct,et,nt,ht){return $(ct,et,nt,ht)}e(K,"scaleObjectFromCorner");function Q(ct,et,nt,ht){return $(ct,et,nt,ht,{by:"x"})}e(Q,"scaleObjectX");function yt(ct,et,nt,ht){return $(ct,et,nt,ht,{by:"y"})}e(yt,"scaleObjectY");function vt(ct,et,nt,ht){return ct[et.target.canvas.altActionKey]?i.skewHandlerX(ct,et,nt,ht):i.scalingY(ct,et,nt,ht)}e(vt,"scalingYOrSkewingX");function It(ct,et,nt,ht){return ct[et.target.canvas.altActionKey]?i.skewHandlerY(ct,et,nt,ht):i.scalingX(ct,et,nt,ht)}e(It,"scalingXOrSkewingY");function wt(ct,et,nt,ht){var gt=et.target,bt=xt(et,et.originX,et.originY,nt,ht),Lt=gt.strokeWidth/(gt.strokeUniform?gt.scaleX:1),Gt=Y(et)?2:1,Wt=gt.width,Ct=Math.abs(bt.x*Gt/gt.scaleX)-Lt;return gt.set("width",Math.max(Ct,0)),Wt!==Ct}e(wt,"changeWidth");function Et(ct,et,nt,ht){var gt=et.target,bt=nt-et.offsetX,Lt=ht-et.offsetY,Gt=!gt.get("lockMovementX")&>.left!==bt,Wt=!gt.get("lockMovementY")&>.top!==Lt;return Gt&>.set("left",bt),Wt&>.set("top",Lt),(Gt||Wt)&&z("moving",_t(ct,et,nt,ht)),Gt||Wt}e(Et,"dragHandler"),i.scaleCursorStyleHandler=V,i.skewCursorStyleHandler=lt,i.scaleSkewCursorStyleHandler=rt,i.rotationWithSnapping=Ut("rotating",G(X)),i.scalingEqually=Ut("scaling",G(K)),i.scalingX=Ut("scaling",G(Q)),i.scalingY=Ut("scaling",G(yt)),i.scalingYOrSkewingX=vt,i.scalingXOrSkewingY=It,i.changeWidth=Ut("resizing",G(wt)),i.skewHandlerX=Z,i.skewHandlerY=dt,i.dragHandler=Et,i.scaleOrSkewActionName=St,i.rotationStyleHandler=q,i.fireEvent=z,i.wrapWithFixedAnchor=G,i.wrapWithFireEvent=Ut,i.getLocalPoint=xt,r.controlsUtils=i}(I),function(b){"use strict";var r=b.fabric||(b.fabric={}),m=r.util.degreesToRadians,p=r.controlsUtils;function i(n,f,_,h,E){h=h||{};var w=this.sizeX||h.cornerSize||E.cornerSize,A=this.sizeY||h.cornerSize||E.cornerSize,D=typeof h.transparentCorners!="undefined"?h.transparentCorners:E.transparentCorners,z=D?"stroke":"fill",B=!D&&(h.cornerStrokeColor||E.cornerStrokeColor),Y=f,H=_,V;n.save(),n.fillStyle=h.cornerColor||E.cornerColor,n.strokeStyle=h.cornerStrokeColor||E.cornerStrokeColor,w>A?(V=w,n.scale(1,A/w),H=_*w/A):A>w?(V=A,n.scale(w/A,1),Y=f*A/w):V=w,n.lineWidth=1,n.beginPath(),n.arc(Y,H,V/2,0,2*Math.PI,!1),n[z](),B&&n.stroke(),n.restore()}e(i,"renderCircleControl");function a(n,f,_,h,E){h=h||{};var w=this.sizeX||h.cornerSize||E.cornerSize,A=this.sizeY||h.cornerSize||E.cornerSize,D=typeof h.transparentCorners!="undefined"?h.transparentCorners:E.transparentCorners,z=D?"stroke":"fill",B=!D&&(h.cornerStrokeColor||E.cornerStrokeColor),Y=w/2,H=A/2;n.save(),n.fillStyle=h.cornerColor||E.cornerColor,n.strokeStyle=h.cornerStrokeColor||E.cornerStrokeColor,n.lineWidth=1,n.translate(f,_),n.rotate(m(E.angle)),n[z+"Rect"](-Y,-H,w,A),B&&n.strokeRect(-Y,-H,w,A),n.restore()}e(a,"renderSquareControl"),p.renderCircleControl=i,p.renderSquareControl=a}(I),function(b){"use strict";var r=b.fabric||(b.fabric={});function m(p){for(var i in p)this[i]=p[i]}e(m,"Control"),r.Control=m,r.Control.prototype={visible:!0,actionName:"scale",angle:0,x:0,y:0,offsetX:0,offsetY:0,sizeX:null,sizeY:null,touchSizeX:null,touchSizeY:null,cursorStyle:"crosshair",withConnection:!1,actionHandler:function(){},mouseDownHandler:function(){},mouseUpHandler:function(){},getActionHandler:function(){return this.actionHandler},getMouseDownHandler:function(){return this.mouseDownHandler},getMouseUpHandler:function(){return this.mouseUpHandler},cursorStyleHandler:function(p,i){return i.cursorStyle},getActionName:function(p,i){return i.actionName},getVisibility:function(p,i){var a=p._controlsVisibility;return a&&typeof a[i]!="undefined"?a[i]:this.visible},setVisibility:function(p){this.visible=p},positionHandler:function(p,i){var a=r.util.transformPoint({x:this.x*p.x+this.offsetX,y:this.y*p.y+this.offsetY},i);return a},calcCornerCoords:function(p,i,a,n,f){var _,h,E,w,A=f?this.touchSizeX:this.sizeX,D=f?this.touchSizeY:this.sizeY;if(A&&D&&A!==D){var z=Math.atan2(D,A),B=Math.sqrt(A*A+D*D)/2,Y=z-r.util.degreesToRadians(p),H=Math.PI/2-z-r.util.degreesToRadians(p);_=B*r.util.cos(Y),h=B*r.util.sin(Y),E=B*r.util.cos(H),w=B*r.util.sin(H)}else{var V=A&&D?A:i;B=V*.7071067812;var Y=r.util.degreesToRadians(45-p);_=E=B*r.util.cos(Y),h=w=B*r.util.sin(Y)}return{tl:{x:a-w,y:n-E},tr:{x:a+_,y:n-h},bl:{x:a-_,y:n+h},br:{x:a+w,y:n+E}}},render:function(p,i,a,n,f){switch(n=n||{},n.cornerStyle||f.cornerStyle){case"circle":r.controlsUtils.renderCircleControl.call(this,p,i,a,n,f);break;default:r.controlsUtils.renderSquareControl.call(this,p,i,a,n,f)}}}}(I),function(){function b(a,n){var f=a.getAttribute("style"),_=a.getAttribute("offset")||0,h,E,w,A;if(_=parseFloat(_)/(/%$/.test(_)?100:1),_=_<0?0:_>1?1:_,f){var D=f.split(/\s*;\s*/);for(D[D.length-1]===""&&D.pop(),A=D.length;A--;){var z=D[A].split(/\s*:\s*/),B=z[0].trim(),Y=z[1].trim();B==="stop-color"?h=Y:B==="stop-opacity"&&(w=Y)}}return h||(h=a.getAttribute("stop-color")||"rgb(0,0,0)"),w||(w=a.getAttribute("stop-opacity")),h=new c.Color(h),E=h.getAlpha(),w=isNaN(parseFloat(w))?1:parseFloat(w),w*=E*n,{offset:_,color:h.toRgb(),opacity:w}}e(b,"getColorStop");function r(a){return{x1:a.getAttribute("x1")||0,y1:a.getAttribute("y1")||0,x2:a.getAttribute("x2")||"100%",y2:a.getAttribute("y2")||0}}e(r,"getLinearCoords");function m(a){return{x1:a.getAttribute("fx")||a.getAttribute("cx")||"50%",y1:a.getAttribute("fy")||a.getAttribute("cy")||"50%",r1:0,x2:a.getAttribute("cx")||"50%",y2:a.getAttribute("cy")||"50%",r2:a.getAttribute("r")||"50%"}}e(m,"getRadialCoords");var p=c.util.object.clone;c.Gradient=c.util.createClass({offsetX:0,offsetY:0,gradientTransform:null,gradientUnits:"pixels",type:"linear",initialize:function(a){a||(a={}),a.coords||(a.coords={});var n,f=this;Object.keys(a).forEach(function(_){f[_]=a[_]}),this.id?this.id+="_"+c.Object.__uid++:this.id=c.Object.__uid++,n={x1:a.coords.x1||0,y1:a.coords.y1||0,x2:a.coords.x2||0,y2:a.coords.y2||0},this.type==="radial"&&(n.r1=a.coords.r1||0,n.r2=a.coords.r2||0),this.coords=n,this.colorStops=a.colorStops.slice()},addColorStop:function(a){for(var n in a){var f=new c.Color(a[n]);this.colorStops.push({offset:parseFloat(n),color:f.toRgb(),opacity:f.getAlpha()})}return this},toObject:function(a){var n={type:this.type,coords:this.coords,colorStops:this.colorStops,offsetX:this.offsetX,offsetY:this.offsetY,gradientUnits:this.gradientUnits,gradientTransform:this.gradientTransform?this.gradientTransform.concat():this.gradientTransform};return c.util.populateWithProperties(this,n,a),n},toSVG:function(a,E){var f=p(this.coords,!0),_,h,E=E||{},w,A,D=p(this.colorStops,!0),z=f.r1>f.r2,B=this.gradientTransform?this.gradientTransform.concat():c.iMatrix.concat(),Y=-this.offsetX,H=-this.offsetY,V=!!E.additionalTransform,lt=this.gradientUnits==="pixels"?"userSpaceOnUse":"objectBoundingBox";if(D.sort(function(G,Ut){return G.offset-Ut.offset}),lt==="objectBoundingBox"?(Y/=a.width,H/=a.height):(Y+=a.width/2,H+=a.height/2),a.type==="path"&&this.gradientUnits!=="percentage"&&(Y-=a.pathOffset.x,H-=a.pathOffset.y),B[4]-=Y,B[5]-=H,A='id="SVGID_'+this.id+'" gradientUnits="'+lt+'"',A+=' gradientTransform="'+(V?E.additionalTransform+" ":"")+c.util.matrixToSVG(B)+'" ',this.type==="linear"?w=["<linearGradient ",A,' x1="',f.x1,'" y1="',f.y1,'" x2="',f.x2,'" y2="',f.y2,`">
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
<image x="0" y="0" width="`+m.width+'" height="'+m.height+'" xlink:href="'+f+`"></image></pattern>`},setOptions:function(r){for(var m in r)this[m]=r[m]},toLive:function(r){var m=this.source;return!m||typeof m.src!="undefined"&&(!m.complete||m.naturalWidth===0||m.naturalHeight===0)?"":r.createPattern(m,this.repeat)}})}(),function(b){"use strict";var r=b.fabric||(b.fabric={}),m=r.util.toFixed;if(r.Shadow){r.warn("fabric.Shadow is already defined.");return}r.Shadow=r.util.createClass({color:"rgb(0,0,0)",blur:0,offsetX:0,offsetY:0,affectStroke:!1,includeDefaultValues:!0,nonScaling:!1,initialize:function(p){typeof p=="string"&&(p=this._parseShadow(p));for(var i in p)this[i]=p[i];this.id=r.Object.__uid++},_parseShadow:function(p){var i=p.trim(),a=r.Shadow.reOffsetsAndBlur.exec(i)||[],n=i.replace(r.Shadow.reOffsetsAndBlur,"")||"rgb(0,0,0)";return{color:n.trim(),offsetX:parseFloat(a[1],10)||0,offsetY:parseFloat(a[2],10)||0,blur:parseFloat(a[3],10)||0}},toString:function(){return[this.offsetX,this.offsetY,this.blur,this.color].join("px ")},toSVG:function(p){var i=40,a=40,n=r.Object.NUM_FRACTION_DIGITS,f=r.util.rotateVector({x:this.offsetX,y:this.offsetY},r.util.degreesToRadians(-p.angle)),_=20,h=new r.Color(this.color);return p.width&&p.height&&(i=m((Math.abs(f.x)+this.blur)/p.width,n)*100+_,a=m((Math.abs(f.y)+this.blur)/p.height,n)*100+_),p.flipX&&(f.x*=-1),p.flipY&&(f.y*=-1),'<filter id="SVGID_'+this.id+'" y="-'+a+'%" height="'+(100+2*a)+'%" x="-'+i+'%" width="'+(100+2*i)+`%" > <feGaussianBlur in="SourceAlpha" stdDeviation="`+m(this.blur?this.blur/2:0,n)+`"></feGaussianBlur> <feOffset dx="`+m(f.x,n)+'" dy="'+m(f.y,n)+`" result="oBlur" ></feOffset> <feFlood flood-color="`+h.toRgb()+'" flood-opacity="'+h.getAlpha()+`"/> <feComposite in2="oBlur" operator="in" /> <feMerge> <feMergeNode></feMergeNode> <feMergeNode in="SourceGraphic"></feMergeNode> </feMerge></filter>`},toObject:function(){if(this.includeDefaultValues)return{color:this.color,blur:this.blur,offsetX:this.offsetX,offsetY:this.offsetY,affectStroke:this.affectStroke,nonScaling:this.nonScaling};var p={},i=r.Shadow.prototype;return["color","blur","offsetX","offsetY","affectStroke","nonScaling"].forEach(function(a){this[a]!==i[a]&&(p[a]=this[a])},this),p}}),r.Shadow.reOffsetsAndBlur=/(?:\s|^)(-?\d+(?:\.\d*)?(?:px)?(?:\s?|$))?(-?\d+(?:\.\d*)?(?:px)?(?:\s?|$))?(\d+(?:\.\d*)?(?:px)?)?(?:\s?|$)(?:$|\s)/}(I),function(){"use strict";if(c.StaticCanvas){c.warn("fabric.StaticCanvas is already defined.");return}var b=c.util.object.extend,r=c.util.getElementOffset,m=c.util.removeFromArray,p=c.util.toFixed,i=c.util.transformPoint,a=c.util.invertTransform,n=c.util.getNodeCanvas,f=c.util.createCanvasElement,_=new Error("Could not initialize `canvas` element");c.StaticCanvas=c.util.createClass(c.CommonMethods,{initialize:function(h,E){E||(E={}),this.renderAndResetBound=this.renderAndReset.bind(this),this.requestRenderAllBound=this.requestRenderAll.bind(this),this._initStatic(h,E)},backgroundColor:"",backgroundImage:null,overlayColor:"",overlayImage:null,includeDefaultValues:!0,stateful:!1,renderOnAddRemove:!0,controlsAboveOverlay:!1,allowTouchScrolling:!1,imageSmoothingEnabled:!0,viewportTransform:c.iMatrix.concat(),backgroundVpt:!0,overlayVpt:!0,enableRetinaScaling:!0,vptCoords:{},skipOffscreen:!0,clipPath:void 0,_initStatic:function(h,E){var w=this.requestRenderAllBound;this._objects=[],this._createLowerCanvas(h),this._initOptions(E),this.interactive||this._initRetinaScaling(),E.overlayImage&&this.setOverlayImage(E.overlayImage,w),E.backgroundImage&&this.setBackgroundImage(E.backgroundImage,w),E.backgroundColor&&this.setBackgroundColor(E.backgroundColor,w),E.overlayColor&&this.setOverlayColor(E.overlayColor,w),this.calcOffset()},_isRetinaScaling:function(){return c.devicePixelRatio!==1&&this.enableRetinaScaling},getRetinaScaling:function(){return this._isRetinaScaling()?c.devicePixelRatio:1},_initRetinaScaling:function(){if(this._isRetinaScaling()){var h=c.devicePixelRatio;this.__initRetinaScaling(h,this.lowerCanvasEl,this.contextContainer),this.upperCanvasEl&&this.__initRetinaScaling(h,this.upperCanvasEl,this.contextTop)}},__initRetinaScaling:function(h,E,w){E.setAttribute("width",this.width*h),E.setAttribute("height",this.height*h),w.scale(h,h)},calcOffset:function(){return this._offset=r(this.lowerCanvasEl),this},setOverlayImage:function(h,E,w){return this.__setBgOverlayImage("overlayImage",h,E,w)},setBackgroundImage:function(h,E,w){return this.__setBgOverlayImage("backgroundImage",h,E,w)},setOverlayColor:function(h,E){return this.__setBgOverlayColor("overlayColor",h,E)},setBackgroundColor:function(h,E){return this.__setBgOverlayColor("backgroundColor",h,E)},__setBgOverlayImage:function(h,E,w,A){return typeof E=="string"?c.util.loadImage(E,function(D,z){if(D){var B=new c.Image(D,A);this[h]=B,B.canvas=this}w&&w(D,z)},this,A&&A.crossOrigin):(A&&E.setOptions(A),this[h]=E,E&&(E.canvas=this),w&&w(E,!1)),this},__setBgOverlayColor:function(h,E,w){return this[h]=E,this._initGradient(E,h),this._initPattern(E,h,w),this},_createCanvasElement:function(){var h=f();if(!h||(h.style||(h.style={}),typeof h.getContext=="undefined"))throw _;return h},_initOptions:function(h){var E=this.lowerCanvasEl;this._setOptions(h),this.width=this.width||parseInt(E.width,10)||0,this.height=this.height||parseInt(E.height,10)||0,this.lowerCanvasEl.style&&(E.width=this.width,E.height=this.height,E.style.width=this.width+"px",E.style.height=this.height+"px",this.viewportTransform=this.viewportTransform.slice())},_createLowerCanvas:function(h){h&&h.getContext?this.lowerCanvasEl=h:this.lowerCanvasEl=c.util.getById(h)||this._createCanvasElement(),c.util.addClass(this.lowerCanvasEl,"lower-canvas"),this._originalCanvasStyle=this.lowerCanvasEl.style,this.interactive&&this._applyCanvasStyle(this.lowerCanvasEl),this.contextContainer=this.lowerCanvasEl.getContext("2d")},getWidth:function(){return this.width},getHeight:function(){return this.height},setWidth:function(h,E){return this.setDimensions({width:h},E)},setHeight:function(h,E){return this.setDimensions({height:h},E)},setDimensions:function(h,E){var w;E=E||{};for(var A in h)w=h[A],E.cssOnly||(this._setBackstoreDimension(A,h[A]),w+="px",this.hasLostContext=!0),E.backstoreOnly||this._setCssDimension(A,w);return this._isCurrentlyDrawing&&this.freeDrawingBrush&&this.freeDrawingBrush._setBrushStyles(),this._initRetinaScaling(),this.calcOffset(),E.cssOnly||this.requestRenderAll(),this},_setBackstoreDimension:function(h,E){return this.lowerCanvasEl[h]=E,this.upperCanvasEl&&(this.upperCanvasEl[h]=E),this.cacheCanvasEl&&(this.cacheCanvasEl[h]=E),this[h]=E,this},_setCssDimension:function(h,E){return this.lowerCanvasEl.style[h]=E,this.upperCanvasEl&&(this.upperCanvasEl.style[h]=E),this.wrapperEl&&(this.wrapperEl.style[h]=E),this},getZoom:function(){return this.viewportTransform[0]},setViewportTransform:function(h){var E=this._activeObject,w=this.backgroundImage,A=this.overlayImage,D,z,B;for(this.viewportTransform=h,z=0,B=this._objects.length;z<B;z++)D=this._objects[z],D.group||D.setCoords(!0);return E&&E.setCoords(),w&&w.setCoords(!0),A&&A.setCoords(!0),this.calcViewportBoundaries(),this.renderOnAddRemove&&this.requestRenderAll(),this},zoomToPoint:function(h,E){var w=h,A=this.viewportTransform.slice(0);h=i(h,a(this.viewportTransform)),A[0]=E,A[3]=E;var D=i(h,A);return A[4]+=w.x-D.x,A[5]+=w.y-D.y,this.setViewportTransform(A)},setZoom:function(h){return this.zoomToPoint(new c.Point(0,0),h),this},absolutePan:function(h){var E=this.viewportTransform.slice(0);return E[4]=-h.x,E[5]=-h.y,this.setViewportTransform(E)},relativePan:function(h){return this.absolutePan(new c.Point(-h.x-this.viewportTransform[4],-h.y-this.viewportTransform[5]))},getElement:function(){return this.lowerCanvasEl},_onObjectAdded:function(h){this.stateful&&h.setupState(),h._set("canvas",this),h.setCoords(),this.fire("object:added",{target:h}),h.fire("added")},_onObjectRemoved:function(h){this.fire("object:removed",{target:h}),h.fire("removed"),delete h.canvas},clearContext:function(h){return h.clearRect(0,0,this.width,this.height),this},getContext:function(){return this.contextContainer},clear:function(){return this.remove.apply(this,this.getObjects()),this.backgroundImage=null,this.overlayImage=null,this.backgroundColor="",this.overlayColor="",this._hasITextHandlers&&(this.off("mouse:up",this._mouseUpITextHandler),this._iTextInstances=null,this._hasITextHandlers=!1),this.clearContext(this.contextContainer),this.fire("canvas:cleared"),this.renderOnAddRemove&&this.requestRenderAll(),this},renderAll:function(){var h=this.contextContainer;return this.renderCanvas(h,this._objects),this},renderAndReset:function(){this.isRendering=0,this.renderAll()},requestRenderAll:function(){return this.isRendering||(this.isRendering=c.util.requestAnimFrame(this.renderAndResetBound)),this},calcViewportBoundaries:function(){var h={},E=this.width,w=this.height,A=a(this.viewportTransform);return h.tl=i({x:0,y:0},A),h.br=i({x:E,y:w},A),h.tr=new c.Point(h.br.x,h.tl.y),h.bl=new c.Point(h.tl.x,h.br.y),this.vptCoords=h,h},cancelRequestedRender:function(){this.isRendering&&(c.util.cancelAnimFrame(this.isRendering),this.isRendering=0)},renderCanvas:function(h,E){var w=this.viewportTransform,A=this.clipPath;this.cancelRequestedRender(),this.calcViewportBoundaries(),this.clearContext(h),c.util.setImageSmoothing(h,this.imageSmoothingEnabled),this.fire("before:render",{ctx:h}),this._renderBackground(h),h.save(),h.transform(w[0],w[1],w[2],w[3],w[4],w[5]),this._renderObjects(h,E),h.restore(),!this.controlsAboveOverlay&&this.interactive&&this.drawControls(h),A&&(A.canvas=this,A.shouldCache(),A._transformDone=!0,A.renderCache({forClipping:!0}),this.drawClipPathOnCanvas(h)),this._renderOverlay(h),this.controlsAboveOverlay&&this.interactive&&this.drawControls(h),this.fire("after:render",{ctx:h})},drawClipPathOnCanvas:function(h){var E=this.viewportTransform,w=this.clipPath;h.save(),h.transform(E[0],E[1],E[2],E[3],E[4],E[5]),h.globalCompositeOperation="destination-in",w.transform(h),h.scale(1/w.zoomX,1/w.zoomY),h.drawImage(w._cacheCanvas,-w.cacheTranslationX,-w.cacheTranslationY),h.restore()},_renderObjects:function(h,E){var w,A;for(w=0,A=E.length;w<A;++w)E[w]&&E[w].render(h)},_renderBackgroundOrOverlay:function(h,E){var w=this[E+"Color"],A=this[E+"Image"],D=this.viewportTransform,z=this[E+"Vpt"];if(!(!w&&!A)){if(w){h.save(),h.beginPath(),h.moveTo(0,0),h.lineTo(this.width,0),h.lineTo(this.width,this.height),h.lineTo(0,this.height),h.closePath(),h.fillStyle=w.toLive?w.toLive(h,this):w,z&&h.transform(D[0],D[1],D[2],D[3],D[4],D[5]),h.transform(1,0,0,1,w.offsetX||0,w.offsetY||0);var B=w.gradientTransform||w.patternTransform;B&&h.transform(B[0],B[1],B[2],B[3],B[4],B[5]),h.fill(),h.restore()}A&&(h.save(),z&&h.transform(D[0],D[1],D[2],D[3],D[4],D[5]),A.render(h),h.restore())}},_renderBackground:function(h){this._renderBackgroundOrOverlay(h,"background")},_renderOverlay:function(h){this._renderBackgroundOrOverlay(h,"overlay")},getCenter:function(){return{top:this.height/2,left:this.width/2}},centerObjectH:function(h){return this._centerObject(h,new c.Point(this.getCenter().left,h.getCenterPoint().y))},centerObjectV:function(h){return this._centerObject(h,new c.Point(h.getCenterPoint().x,this.getCenter().top))},centerObject:function(h){var E=this.getCenter();return this._centerObject(h,new c.Point(E.left,E.top))},viewportCenterObject:function(h){var E=this.getVpCenter();return this._centerObject(h,E)},viewportCenterObjectH:function(h){var E=this.getVpCenter();return this._centerObject(h,new c.Point(E.x,h.getCenterPoint().y)),this},viewportCenterObjectV:function(h){var E=this.getVpCenter();return this._centerObject(h,new c.Point(h.getCenterPoint().x,E.y))},getVpCenter:function(){var h=this.getCenter(),E=a(this.viewportTransform);return i({x:h.left,y:h.top},E)},_centerObject:function(h,E){return h.setPositionByOrigin(E,"center","center"),h.setCoords(),this.renderOnAddRemove&&this.requestRenderAll(),this},toDatalessJSON:function(h){return this.toDatalessObject(h)},toObject:function(h){return this._toObjectMethod("toObject",h)},toDatalessObject:function(h){return this._toObjectMethod("toDatalessObject",h)},_toObjectMethod:function(h,E){var w=this.clipPath,A={version:c.version,objects:this._toObjects(h,E)};return w&&!w.excludeFromExport&&(A.clipPath=this._toObject(this.clipPath,h,E)),b(A,this.__serializeBgOverlay(h,E)),c.util.populateWithProperties(this,A,E),A},_toObjects:function(h,E){return this._objects.filter(function(w){return!w.excludeFromExport}).map(function(w){return this._toObject(w,h,E)},this)},_toObject:function(h,E,w){var A;this.includeDefaultValues||(A=h.includeDefaultValues,h.includeDefaultValues=!1);var D=h[E](w);return this.includeDefaultValues||(h.includeDefaultValues=A),D},__serializeBgOverlay:function(h,E){var w={},A=this.backgroundImage,D=this.overlayImage,z=this.backgroundColor,B=this.overlayColor;return z&&z.toObject?z.excludeFromExport||(w.background=z.toObject(E)):z&&(w.background=z),B&&B.toObject?B.excludeFromExport||(w.overlay=B.toObject(E)):B&&(w.overlay=B),A&&!A.excludeFromExport&&(w.backgroundImage=this._toObject(A,h,E)),D&&!D.excludeFromExport&&(w.overlayImage=this._toObject(D,h,E)),w},svgViewportTransformation:!0,toSVG:function(h,E){h||(h={}),h.reviver=E;var w=[];return this._setSVGPreamble(w,h),this._setSVGHeader(w,h),this.clipPath&&w.push('<g clip-path="url(#'+this.clipPath.clipPathId+`)" > `),this._setSVGBgOverlayColor(w,"background"),this._setSVGBgOverlayImage(w,"backgroundImage",E),this._setSVGObjects(w,E),this.clipPath&&w.push(`</g>`),this._setSVGBgOverlayColor(w,"overlay"),this._setSVGBgOverlayImage(w,"overlayImage",E),w.push("</svg>"),w.join("")},_setSVGPreamble:function(h,E){E.suppressPreamble||h.push('<?xml version="1.0" encoding="',E.encoding||"UTF-8",`" standalone="no" ?>
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
`].join("");return h&&(h=[' <style type="text/css">',`<![CDATA[ `,h,"]]>",`</style>`].join("")),h},_setSVGObjects:function(h,E){var w,A,D,z=this._objects;for(A=0,D=z.length;A<D;A++)w=z[A],!w.excludeFromExport&&this._setSVGObject(h,w,E)},_setSVGObject:function(h,E,w){h.push(E.toSVG(w))},_setSVGBgOverlayImage:function(h,E,w){this[E]&&!this[E].excludeFromExport&&this[E].toSVG&&h.push(this[E].toSVG(w))},_setSVGBgOverlayColor:function(h,E){var w=this[E+"Color"],A=this.viewportTransform,D=this.width,z=this.height;if(w)if(w.toLive){var B=w.repeat,Y=c.util.invertTransform(A),H=this[E+"Vpt"],V=H?c.util.matrixToSVG(Y):"";h.push('<rect transform="'+V+" translate(",D/2,",",z/2,')"',' x="',w.offsetX-D/2,'" y="',w.offsetY-z/2,'" ','width="',B==="repeat-y"||B==="no-repeat"?w.source.width:D,'" height="',B==="repeat-x"||B==="no-repeat"?w.source.height:z,'" fill="url(#SVGID_'+w.id+')"',`></rect>`)}else h.push('<rect x="0" y="0" width="100%" height="100%" ','fill="',w,'"',`></rect>`)},sendToBack:function(h){if(!h)return this;var E=this._activeObject,w,A,D;if(h===E&&h.type==="activeSelection")for(D=E._objects,w=D.length;w--;)A=D[w],m(this._objects,A),this._objects.unshift(A);else m(this._objects,h),this._objects.unshift(h);return this.renderOnAddRemove&&this.requestRenderAll(),this},bringToFront:function(h){if(!h)return this;var E=this._activeObject,w,A,D;if(h===E&&h.type==="activeSelection")for(D=E._objects,w=0;w<D.length;w++)A=D[w],m(this._objects,A),this._objects.push(A);else m(this._objects,h),this._objects.push(h);return this.renderOnAddRemove&&this.requestRenderAll(),this},sendBackwards:function(h,E){if(!h)return this;var w=this._activeObject,A,D,z,B,Y,H=0;if(h===w&&h.type==="activeSelection")for(Y=w._objects,A=0;A<Y.length;A++)D=Y[A],z=this._objects.indexOf(D),z>0+H&&(B=z-1,m(this._objects,D),this._objects.splice(B,0,D)),H++;else z=this._objects.indexOf(h),z!==0&&(B=this._findNewLowerIndex(h,z,E),m(this._objects,h),this._objects.splice(B,0,h));return this.renderOnAddRemove&&this.requestRenderAll(),this},_findNewLowerIndex:function(h,E,w){var A,D;if(w)for(A=E,D=E-1;D>=0;--D){var z=h.intersectsWithObject(this._objects[D])||h.isContainedWithinObject(this._objects[D])||this._objects[D].isContainedWithinObject(h);if(z){A=D;break}}else A=E-1;return A},bringForward:function(h,E){if(!h)return this;var w=this._activeObject,A,D,z,B,Y,H=0;if(h===w&&h.type==="activeSelection")for(Y=w._objects,A=Y.length;A--;)D=Y[A],z=this._objects.indexOf(D),z<this._objects.length-1-H&&(B=z+1,m(this._objects,D),this._objects.splice(B,0,D)),H++;else z=this._objects.indexOf(h),z!==this._objects.length-1&&(B=this._findNewUpperIndex(h,z,E),m(this._objects,h),this._objects.splice(B,0,h));return this.renderOnAddRemove&&this.requestRenderAll(),this},_findNewUpperIndex:function(h,E,w){var A,D,z;if(w)for(A=E,D=E+1,z=this._objects.length;D<z;++D){var B=h.intersectsWithObject(this._objects[D])||h.isContainedWithinObject(this._objects[D])||this._objects[D].isContainedWithinObject(h);if(B){A=D;break}}else A=E+1;return A},moveTo:function(h,E){return m(this._objects,h),this._objects.splice(E,0,h),this.renderOnAddRemove&&this.requestRenderAll()},dispose:function(){return this.isRendering&&(c.util.cancelAnimFrame(this.isRendering),this.isRendering=0),this.forEachObject(function(h){h.dispose&&h.dispose()}),this._objects=[],this.backgroundImage&&this.backgroundImage.dispose&&this.backgroundImage.dispose(),this.backgroundImage=null,this.overlayImage&&this.overlayImage.dispose&&this.overlayImage.dispose(),this.overlayImage=null,this._iTextInstances=null,this.contextContainer=null,this.lowerCanvasEl.classList.remove("lower-canvas"),this.lowerCanvasEl.style=this._originalCanvasStyle,delete this._originalCanvasStyle,this.lowerCanvasEl.setAttribute("width",this.width),this.lowerCanvasEl.setAttribute("height",this.height),c.util.cleanUpJsdomNode(this.lowerCanvasEl),this.lowerCanvasEl=void 0,this},toString:function(){return"#<fabric.Canvas ("+this.complexity()+"): { objects: "+this._objects.length+" }>"}}),b(c.StaticCanvas.prototype,c.Observable),b(c.StaticCanvas.prototype,c.Collection),b(c.StaticCanvas.prototype,c.DataURLExporter),b(c.StaticCanvas,{EMPTY_JSON:'{"objects": [], "background": "white"}',supports:function(h){var E=f();if(!E||!E.getContext)return null;var w=E.getContext("2d");if(!w)return null;switch(h){case"setLineDash":return typeof w.setLineDash!="undefined";default:return null}}}),c.StaticCanvas.prototype.toJSON=c.StaticCanvas.prototype.toObject,c.isLikelyNode&&(c.StaticCanvas.prototype.createPNGStream=function(){var h=n(this.lowerCanvasEl);return h&&h.createPNGStream()},c.StaticCanvas.prototype.createJPEGStream=function(h){var E=n(this.lowerCanvasEl);return E&&E.createJPEGStream(h)})}(),c.BaseBrush=c.util.createClass({color:"rgb(0, 0, 0)",width:1,shadow:null,strokeLineCap:"round",strokeLineJoin:"round",strokeMiterLimit:10,strokeDashArray:null,limitedToCanvasSize:!1,_setBrushStyles:function(){var b=this.canvas.contextTop;b.strokeStyle=this.color,b.lineWidth=this.width,b.lineCap=this.strokeLineCap,b.miterLimit=this.strokeMiterLimit,b.lineJoin=this.strokeLineJoin,b.setLineDash(this.strokeDashArray||[])},_saveAndTransform:function(b){var r=this.canvas.viewportTransform;b.save(),b.transform(r[0],r[1],r[2],r[3],r[4],r[5])},_setShadow:function(){if(this.shadow){var b=this.canvas,r=this.shadow,m=b.contextTop,p=b.getZoom();b&&b._isRetinaScaling()&&(p*=c.devicePixelRatio),m.shadowColor=r.color,m.shadowBlur=r.blur*p,m.shadowOffsetX=r.offsetX*p,m.shadowOffsetY=r.offsetY*p}},needsFullRender:function(){var b=new c.Color(this.color);return b.getAlpha()<1||!!this.shadow},_resetShadow:function(){var b=this.canvas.contextTop;b.shadowColor="",b.shadowBlur=b.shadowOffsetX=b.shadowOffsetY=0},_isOutSideCanvas:function(b){return b.x<0||b.x>this.canvas.getWidth()||b.y<0||b.y>this.canvas.getHeight()}}),function(){c.PencilBrush=c.util.createClass(c.BaseBrush,{decimate:.4,initialize:function(b){this.canvas=b,this._points=[]},_drawSegment:function(b,r,m){var p=r.midPointFrom(m);return b.quadraticCurveTo(r.x,r.y,p.x,p.y),p},onMouseDown:function(b,r){this.canvas._isMainEvent(r.e)&&(this._prepareForDrawing(b),this._captureDrawingPath(b),this._render())},onMouseMove:function(b,r){if(this.canvas._isMainEvent(r.e)&&!(this.limitedToCanvasSize===!0&&this._isOutSideCanvas(b))&&this._captureDrawingPath(b)&&this._points.length>1)if(this.needsFullRender())this.canvas.clearContext(this.canvas.contextTop),this._render();else{var m=this._points,p=m.length,i=this.canvas.contextTop;this._saveAndTransform(i),this.oldEnd&&(i.beginPath(),i.moveTo(this.oldEnd.x,this.oldEnd.y)),this.oldEnd=this._drawSegment(i,m[p-2],m[p-1],!0),i.stroke(),i.restore()}},onMouseUp:function(b){return this.canvas._isMainEvent(b.e)?(this.oldEnd=void 0,this._finalizeAndAddPath(),!1):!0},_prepareForDrawing:function(b){var r=new c.Point(b.x,b.y);this._reset(),this._addPoint(r),this.canvas.contextTop.moveTo(r.x,r.y)},_addPoint:function(b){return this._points.length>1&&b.eq(this._points[this._points.length-1])?!1:(this._points.push(b),!0)},_reset:function(){this._points=[],this._setBrushStyles(),this._setShadow()},_captureDrawingPath:function(b){var r=new c.Point(b.x,b.y);return this._addPoint(r)},_render:function(){var b=this.canvas.contextTop,r,m,p=this._points[0],i=this._points[1];if(this._saveAndTransform(b),b.beginPath(),this._points.length===2&&p.x===i.x&&p.y===i.y){var a=this.width/1e3;p=new c.Point(p.x,p.y),i=new c.Point(i.x,i.y),p.x-=a,i.x+=a}for(b.moveTo(p.x,p.y),r=1,m=this._points.length;r<m;r++)this._drawSegment(b,p,i),p=this._points[r],i=this._points[r+1];b.lineTo(p.x,p.y),b.stroke(),b.restore()},convertPointsToSVGPath:function(b){var r=this.width/1e3;return c.util.getSmoothPathFromPoints(b,r)},_isEmptySVGPath:function(b){var r=c.util.joinPath(b);return r==="M 0 0 Q 0 0 0 0 L 0 0"},createPath:function(b){var r=new c.Path(b,{fill:null,stroke:this.color,strokeWidth:this.width,strokeLineCap:this.strokeLineCap,strokeMiterLimit:this.strokeMiterLimit,strokeLineJoin:this.strokeLineJoin,strokeDashArray:this.strokeDashArray});return this.shadow&&(this.shadow.affectStroke=!0,r.shadow=new c.Shadow(this.shadow)),r},decimatePoints:function(b,r){if(b.length<=2)return b;var m=this.canvas.getZoom(),p=Math.pow(r/m,2),i,a=b.length-1,n=b[0],f=[n],_;for(i=1;i<a-1;i++)_=Math.pow(n.x-b[i].x,2)+Math.pow(n.y-b[i].y,2),_>=p&&(n=b[i],f.push(n));return f.push(b[a]),f},_finalizeAndAddPath:function(){var b=this.canvas.contextTop;b.closePath(),this.decimate&&(this._points=this.decimatePoints(this._points,this.decimate));var r=this.convertPointsToSVGPath(this._points);if(this._isEmptySVGPath(r)){this.canvas.requestRenderAll();return}var m=this.createPath(r);this.canvas.clearContext(this.canvas.contextTop),this.canvas.fire("before:path:created",{path:m}),this.canvas.add(m),this.canvas.requestRenderAll(),m.setCoords(),this._resetShadow(),this.canvas.fire("path:created",{path:m})}})}(),c.CircleBrush=c.util.createClass(c.BaseBrush,{width:10,initialize:function(b){this.canvas=b,this.points=[]},drawDot:function(b){var r=this.addPoint(b),m=this.canvas.contextTop;this._saveAndTransform(m),this.dot(m,r),m.restore()},dot:function(b,r){b.fillStyle=r.fill,b.beginPath(),b.arc(r.x,r.y,r.radius,0,Math.PI*2,!1),b.closePath(),b.fill()},onMouseDown:function(b){this.points.length=0,this.canvas.clearContext(this.canvas.contextTop),this._setShadow(),this.drawDot(b)},_render:function(){var b=this.canvas.contextTop,r,m,p=this.points;for(this._saveAndTransform(b),r=0,m=p.length;r<m;r++)this.dot(b,p[r]);b.restore()},onMouseMove:function(b){this.limitedToCanvasSize===!0&&this._isOutSideCanvas(b)||(this.needsFullRender()?(this.canvas.clearContext(this.canvas.contextTop),this.addPoint(b),this._render()):this.drawDot(b))},onMouseUp:function(){var b=this.canvas.renderOnAddRemove,r,m;this.canvas.renderOnAddRemove=!1;var p=[];for(r=0,m=this.points.length;r<m;r++){var i=this.points[r],a=new c.Circle({radius:i.radius,left:i.x,top:i.y,originX:"center",originY:"center",fill:i.fill});this.shadow&&(a.shadow=new c.Shadow(this.shadow)),p.push(a)}var n=new c.Group(p);n.canvas=this.canvas,this.canvas.fire("before:path:created",{path:n}),this.canvas.add(n),this.canvas.fire("path:created",{path:n}),this.canvas.clearContext(this.canvas.contextTop),this._resetShadow(),this.canvas.renderOnAddRemove=b,this.canvas.requestRenderAll()},addPoint:function(b){var r=new c.Point(b.x,b.y),m=c.util.getRandomInt(Math.max(0,this.width-20),this.width+20)/2,p=new c.Color(this.color).setAlpha(c.util.getRandomInt(0,100)/100).toRgba();return r.radius=m,r.fill=p,this.points.push(r),r}}),c.SprayBrush=c.util.createClass(c.BaseBrush,{width:10,density:20,dotWidth:1,dotWidthVariance:1,randomOpacity:!1,optimizeOverlapping:!0,initialize:function(b){this.canvas=b,this.sprayChunks=[]},onMouseDown:function(b){this.sprayChunks.length=0,this.canvas.clearContext(this.canvas.contextTop),this._setShadow(),this.addSprayChunk(b),this.render(this.sprayChunkPoints)},onMouseMove:function(b){this.limitedToCanvasSize===!0&&this._isOutSideCanvas(b)||(this.addSprayChunk(b),this.render(this.sprayChunkPoints))},onMouseUp:function(){var b=this.canvas.renderOnAddRemove;this.canvas.renderOnAddRemove=!1;for(var r=[],m=0,p=this.sprayChunks.length;m<p;m++)for(var i=this.sprayChunks[m],a=0,n=i.length;a<n;a++){var f=new c.Rect({width:i[a].width,height:i[a].width,left:i[a].x+1,top:i[a].y+1,originX:"center",originY:"center",fill:this.color});r.push(f)}this.optimizeOverlapping&&(r=this._getOptimizedRects(r));var _=new c.Group(r);this.shadow&&_.set("shadow",new c.Shadow(this.shadow)),this.canvas.fire("before:path:created",{path:_}),this.canvas.add(_),this.canvas.fire("path:created",{path:_}),this.canvas.clearContext(this.canvas.contextTop),this._resetShadow(),this.canvas.renderOnAddRemove=b,this.canvas.requestRenderAll()},_getOptimizedRects:function(b){var r={},m,p,i;for(p=0,i=b.length;p<i;p++)m=b[p].left+""+b[p].top,r[m]||(r[m]=b[p]);var a=[];for(m in r)a.push(r[m]);return a},render:function(b){var r=this.canvas.contextTop,m,p;for(r.fillStyle=this.color,this._saveAndTransform(r),m=0,p=b.length;m<p;m++){var i=b[m];typeof i.opacity!="undefined"&&(r.globalAlpha=i.opacity),r.fillRect(i.x,i.y,i.width,i.width)}r.restore()},_render:function(){var b=this.canvas.contextTop,r,m;for(b.fillStyle=this.color,this._saveAndTransform(b),r=0,m=this.sprayChunks.length;r<m;r++)this.render(this.sprayChunks[r]);b.restore()},addSprayChunk:function(b){this.sprayChunkPoints=[];var r,m,p,i=this.width/2,a;for(a=0;a<this.density;a++){r=c.util.getRandomInt(b.x-i,b.x+i),m=c.util.getRandomInt(b.y-i,b.y+i),this.dotWidthVariance?p=c.util.getRandomInt(Math.max(1,this.dotWidth-this.dotWidthVariance),this.dotWidth+this.dotWidthVariance):p=this.dotWidth;var n=new c.Point(r,m);n.width=p,this.randomOpacity&&(n.opacity=c.util.getRandomInt(0,100)/100),this.sprayChunkPoints.push(n)}this.sprayChunks.push(this.sprayChunkPoints)}}),c.PatternBrush=c.util.createClass(c.PencilBrush,{getPatternSrc:function(){var b=20,r=5,m=c.util.createCanvasElement(),p=m.getContext("2d");return m.width=m.height=b+r,p.fillStyle=this.color,p.beginPath(),p.arc(b/2,b/2,b/2,0,Math.PI*2,!1),p.closePath(),p.fill(),m},getPatternSrcFunction:function(){return String(this.getPatternSrc).replace("this.color",'"'+this.color+'"')},getPattern:function(){return this.canvas.contextTop.createPattern(this.source||this.getPatternSrc(),"repeat")},_setBrushStyles:function(){this.callSuper("_setBrushStyles"),this.canvas.contextTop.strokeStyle=this.getPattern()},createPath:function(b){var r=this.callSuper("createPath",b),m=r._getLeftTopCoords().scalarAdd(r.strokeWidth/2);return r.stroke=new c.Pattern({source:this.source||this.getPatternSrcFunction(),offsetX:-m.x,offsetY:-m.y}),r}}),function(){var b=c.util.getPointer,r=c.util.degreesToRadians,m=c.util.isTouchEvent;c.Canvas=c.util.createClass(c.StaticCanvas,{initialize:function(i,a){a||(a={}),this.renderAndResetBound=this.renderAndReset.bind(this),this.requestRenderAllBound=this.requestRenderAll.bind(this),this._initStatic(i,a),this._initInteractive(),this._createCacheCanvas()},uniformScaling:!0,uniScaleKey:"shiftKey",centeredScaling:!1,centeredRotation:!1,centeredKey:"altKey",altActionKey:"shiftKey",interactive:!0,selection:!0,selectionKey:"shiftKey",altSelectionKey:null,selectionColor:"rgba(100, 100, 255, 0.3)",selectionDashArray:[],selectionBorderColor:"rgba(255, 255, 255, 0.3)",selectionLineWidth:1,selectionFullyContained:!1,hoverCursor:"move",moveCursor:"move",defaultCursor:"default",freeDrawingCursor:"crosshair",rotationCursor:"crosshair",notAllowedCursor:"not-allowed",containerClass:"canvas-container",perPixelTargetFind:!1,targetFindTolerance:0,skipTargetFind:!1,isDrawingMode:!1,preserveObjectStacking:!1,snapAngle:0,snapThreshold:null,stopContextMenu:!1,fireRightClick:!1,fireMiddleClick:!1,targets:[],_hoveredTarget:null,_hoveredTargets:[],_initInteractive:function(){this._currentTransform=null,this._groupSelector=null,this._initWrapperElement(),this._createUpperCanvas(),this._initEventListeners(),this._initRetinaScaling(),this.freeDrawingBrush=c.PencilBrush&&new c.PencilBrush(this),this.calcOffset()},_chooseObjectsToRender:function(){var i=this.getActiveObjects(),a,n,f;if(i.length>0&&!this.preserveObjectStacking){n=[],f=[];for(var _=0,h=this._objects.length;_<h;_++)a=this._objects[_],i.indexOf(a)===-1?n.push(a):f.push(a);i.length>1&&(this._activeObject._objects=f),n.push.apply(n,f)}else n=this._objects;return n},renderAll:function(){this.contextTopDirty&&!this._groupSelector&&!this.isDrawingMode&&(this.clearContext(this.contextTop),this.contextTopDirty=!1),this.hasLostContext&&this.renderTopLayer(this.contextTop);var i=this.contextContainer;return this.renderCanvas(i,this._chooseObjectsToRender()),this},renderTopLayer:function(i){i.save(),this.isDrawingMode&&this._isCurrentlyDrawing&&(this.freeDrawingBrush&&this.freeDrawingBrush._render(),this.contextTopDirty=!0),this.selection&&this._groupSelector&&(this._drawSelection(i),this.contextTopDirty=!0),i.restore()},renderTop:function(){var i=this.contextTop;return this.clearContext(i),this.renderTopLayer(i),this.fire("after:render"),this},_normalizePointer:function(i,a){var n=i.calcTransformMatrix(),f=c.util.invertTransform(n),_=this.restorePointerVpt(a);return c.util.transformPoint(_,f)},isTargetTransparent:function(i,a,n){if(i.shouldCache()&&i._cacheCanvas&&i!==this._activeObject){var f=this._normalizePointer(i,{x:a,y:n}),_=Math.max(i.cacheTranslationX+f.x*i.zoomX,0),h=Math.max(i.cacheTranslationY+f.y*i.zoomY,0),D=c.util.isTransparent(i._cacheContext,Math.round(_),Math.round(h),this.targetFindTolerance);return D}var E=this.contextCache,w=i.selectionBackgroundColor,A=this.viewportTransform;i.selectionBackgroundColor="",this.clearContext(E),E.save(),E.transform(A[0],A[1],A[2],A[3],A[4],A[5]),i.render(E),E.restore(),i.selectionBackgroundColor=w;var D=c.util.isTransparent(E,a,n,this.targetFindTolerance);return D},_isSelectionKeyPressed:function(i){var a=!1;return Object.prototype.toString.call(this.selectionKey)==="[object Array]"?a=!!this.selectionKey.find(function(n){return i[n]===!0}):a=i[this.selectionKey],a},_shouldClearSelection:function(i,a){var n=this.getActiveObjects(),f=this._activeObject;return!a||a&&f&&n.length>1&&n.indexOf(a)===-1&&f!==a&&!this._isSelectionKeyPressed(i)||a&&!a.evented||a&&!a.selectable&&f&&f!==a},_shouldCenterTransform:function(i,a,n){if(i){var f;return a==="scale"||a==="scaleX"||a==="scaleY"||a==="resizing"?f=this.centeredScaling||i.centeredScaling:a==="rotate"&&(f=this.centeredRotation||i.centeredRotation),f?!n:n}},_getOriginFromCorner:function(i,a){var n={x:i.originX,y:i.originY};return a==="ml"||a==="tl"||a==="bl"?n.x="right":(a==="mr"||a==="tr"||a==="br")&&(n.x="left"),a==="tl"||a==="mt"||a==="tr"?n.y="bottom":(a==="bl"||a==="mb"||a==="br")&&(n.y="top"),n},_getActionFromCorner:function(i,a,n,f){if(!a||!i)return"drag";var _=f.controls[a];return _.getActionName(n,_,f)},_setupCurrentTransform:function(i,a,n){if(a){var f=this.getPointer(i),_=a.__corner,h=a.controls[_],E=n&&_?h.getActionHandler(i,a,h):c.controlsUtils.dragHandler,w=this._getActionFromCorner(n,_,i,a),A=this._getOriginFromCorner(a,_),D=i[this.centeredKey],z={target:a,action:w,actionHandler:E,corner:_,scaleX:a.scaleX,scaleY:a.scaleY,skewX:a.skewX,skewY:a.skewY,offsetX:f.x-a.left,offsetY:f.y-a.top,originX:A.x,originY:A.y,ex:f.x,ey:f.y,lastX:f.x,lastY:f.y,theta:r(a.angle),width:a.width*a.scaleX,shiftKey:i.shiftKey,altKey:D,original:c.util.saveObjectTransform(a)};this._shouldCenterTransform(a,w,D)&&(z.originX="center",z.originY="center"),z.original.originX=A.x,z.original.originY=A.y,this._currentTransform=z,this._beforeTransform(i)}},setCursor:function(i){this.upperCanvasEl.style.cursor=i},_drawSelection:function(i){var a=this._groupSelector,n=new c.Point(a.ex,a.ey),f=c.util.transformPoint(n,this.viewportTransform),_=new c.Point(a.ex+a.left,a.ey+a.top),h=c.util.transformPoint(_,this.viewportTransform),E=Math.min(f.x,h.x),w=Math.min(f.y,h.y),A=Math.max(f.x,h.x),D=Math.max(f.y,h.y),z=this.selectionLineWidth/2;this.selectionColor&&(i.fillStyle=this.selectionColor,i.fillRect(E,w,A-E,D-w)),!(!this.selectionLineWidth||!this.selectionBorderColor)&&(i.lineWidth=this.selectionLineWidth,i.strokeStyle=this.selectionBorderColor,E+=z,w+=z,A-=z,D-=z,c.Object.prototype._setLineDash.call(this,i,this.selectionDashArray),i.strokeRect(E,w,A-E,D-w))},findTarget:function(i,a){if(!this.skipTargetFind){var n=!0,f=this.getPointer(i,n),_=this._activeObject,h=this.getActiveObjects(),E,w,A=m(i),D=h.length>1&&!a||h.length===1;if(this.targets=[],D&&_._findTargetCorner(f,A)||h.length>1&&!a&&_===this._searchPossibleTargets([_],f))return _;if(h.length===1&&_===this._searchPossibleTargets([_],f))if(this.preserveObjectStacking)E=_,w=this.targets,this.targets=[];else return _;var z=this._searchPossibleTargets(this._objects,f);return i[this.altSelectionKey]&&z&&E&&z!==E&&(z=E,this.targets=w),z}},_checkTarget:function(i,a,n){if(a&&a.visible&&a.evented&&a.containsPoint(i))if((this.perPixelTargetFind||a.perPixelTargetFind)&&!a.isEditing){var f=this.isTargetTransparent(a,n.x,n.y);if(!f)return!0}else return!0},_searchPossibleTargets:function(i,a){for(var n,f=i.length,_;f--;){var h=i[f],E=h.group?this._normalizePointer(h.group,a):a;if(this._checkTarget(E,h,a)){n=i[f],n.subTargetCheck&&n instanceof c.Group&&(_=this._searchPossibleTargets(n._objects,a),_&&this.targets.push(_));break}}return n},restorePointerVpt:function(i){return c.util.transformPoint(i,c.util.invertTransform(this.viewportTransform))},getPointer:function(i,a){if(this._absolutePointer&&!a)return this._absolutePointer;if(this._pointer&&a)return this._pointer;var n=b(i),f=this.upperCanvasEl,_=f.getBoundingClientRect(),h=_.width||0,E=_.height||0,w;(!h||!E)&&("top"in _&&"bottom"in _&&(E=Math.abs(_.top-_.bottom)),"right"in _&&"left"in _&&(h=Math.abs(_.right-_.left))),this.calcOffset(),n.x=n.x-this._offset.left,n.y=n.y-this._offset.top,a||(n=this.restorePointerVpt(n));var A=this.getRetinaScaling();return A!==1&&(n.x/=A,n.y/=A),h===0||E===0?w={width:1,height:1}:w={width:f.width/h,height:f.height/E},{x:n.x*w.width,y:n.y*w.height}},_createUpperCanvas:function(){var i=this.lowerCanvasEl.className.replace(/\s*lower-canvas\s*/,""),a=this.lowerCanvasEl,n=this.upperCanvasEl;n?n.className="":(n=this._createCanvasElement(),this.upperCanvasEl=n),c.util.addClass(n,"upper-canvas "+i),this.wrapperEl.appendChild(n),this._copyCanvasStyle(a,n),this._applyCanvasStyle(n),this.contextTop=n.getContext("2d")},_createCacheCanvas:function(){this.cacheCanvasEl=this._createCanvasElement(),this.cacheCanvasEl.setAttribute("width",this.width),this.cacheCanvasEl.setAttribute("height",this.height),this.contextCache=this.cacheCanvasEl.getContext("2d")},_initWrapperElement:function(){this.wrapperEl=c.util.wrapElement(this.lowerCanvasEl,"div",{class:this.containerClass}),c.util.setStyle(this.wrapperEl,{width:this.width+"px",height:this.height+"px",position:"relative"}),c.util.makeElementUnselectable(this.wrapperEl)},_applyCanvasStyle:function(i){var a=this.width||i.width,n=this.height||i.height;c.util.setStyle(i,{position:"absolute",width:a+"px",height:n+"px",left:0,top:0,"touch-action":this.allowTouchScrolling?"manipulation":"none","-ms-touch-action":this.allowTouchScrolling?"manipulation":"none"}),i.width=a,i.height=n,c.util.makeElementUnselectable(i)},_copyCanvasStyle:function(i,a){a.style.cssText=i.style.cssText},getSelectionContext:function(){return this.contextTop},getSelectionElement:function(){return this.upperCanvasEl},getActiveObject:function(){return this._activeObject},getActiveObjects:function(){var i=this._activeObject;return i?i.type==="activeSelection"&&i._objects?i._objects.slice(0):[i]:[]},_onObjectRemoved:function(i){i===this._activeObject&&(this.fire("before:selection:cleared",{target:i}),this._discardActiveObject(),this.fire("selection:cleared",{target:i}),i.fire("deselected")),i===this._hoveredTarget&&(this._hoveredTarget=null,this._hoveredTargets=[]),this.callSuper("_onObjectRemoved",i)},_fireSelectionEvents:function(i,a){var n=!1,f=this.getActiveObjects(),_=[],h=[];i.forEach(function(E){f.indexOf(E)===-1&&(n=!0,E.fire("deselected",{e:a,target:E}),h.push(E))}),f.forEach(function(E){i.indexOf(E)===-1&&(n=!0,E.fire("selected",{e:a,target:E}),_.push(E))}),i.length>0&&f.length>0?n&&this.fire("selection:updated",{e:a,selected:_,deselected:h,updated:_[0]||h[0],target:this._activeObject}):f.length>0?this.fire("selection:created",{e:a,selected:_,target:this._activeObject}):i.length>0&&this.fire("selection:cleared",{e:a,deselected:h})},setActiveObject:function(i,a){var n=this.getActiveObjects();return this._setActiveObject(i,a),this._fireSelectionEvents(n,a),this},_setActiveObject:function(i,a){return this._activeObject===i||!this._discardActiveObject(a,i)||i.onSelect({e:a})?!1:(this._activeObject=i,!0)},_discardActiveObject:function(i,a){var n=this._activeObject;if(n){if(n.onDeselect({e:i,object:a}))return!1;this._activeObject=null}return!0},discardActiveObject:function(i){var a=this.getActiveObjects(),n=this.getActiveObject();return a.length&&this.fire("before:selection:cleared",{target:n,e:i}),this._discardActiveObject(i),this._fireSelectionEvents(a,i),this},dispose:function(){var i=this.wrapperEl;return this.removeListeners(),i.removeChild(this.upperCanvasEl),i.removeChild(this.lowerCanvasEl),this.contextCache=null,this.contextTop=null,["upperCanvasEl","cacheCanvasEl"].forEach(function(a){c.util.cleanUpJsdomNode(this[a]),this[a]=void 0}.bind(this)),i.parentNode&&i.parentNode.replaceChild(this.lowerCanvasEl,this.wrapperEl),delete this.wrapperEl,c.StaticCanvas.prototype.dispose.call(this),this},clear:function(){return this.discardActiveObject(),this.clearContext(this.contextTop),this.callSuper("clear")},drawControls:function(i){var a=this._activeObject;a&&a._renderControls(i)},_toObject:function(i,a,n){var f=this._realizeGroupTransformOnObject(i),_=this.callSuper("_toObject",i,a,n);return this._unwindGroupTransformOnObject(i,f),_},_realizeGroupTransformOnObject:function(i){if(i.group&&i.group.type==="activeSelection"&&this._activeObject===i.group){var a=["angle","flipX","flipY","left","scaleX","scaleY","skewX","skewY","top"],n={};return a.forEach(function(f){n[f]=i[f]}),c.util.addTransformToObject(i,this._activeObject.calcOwnMatrix()),n}else return null},_unwindGroupTransformOnObject:function(i,a){a&&i.set(a)},_setSVGObject:function(i,a,n){var f=this._realizeGroupTransformOnObject(a);this.callSuper("_setSVGObject",i,a,n),this._unwindGroupTransformOnObject(a,f)},setViewportTransform:function(i){this.renderOnAddRemove&&this._activeObject&&this._activeObject.isEditing&&this._activeObject.clearContextTop(),c.StaticCanvas.prototype.setViewportTransform.call(this,i)}});for(var p in c.StaticCanvas)p!=="prototype"&&(c.Canvas[p]=c.StaticCanvas[p])}(),function(){var b=c.util.addListener,r=c.util.removeListener,m=3,p=2,i=1,a={passive:!1};function n(f,_){return f.button&&f.button===_-1}e(n,"checkClick"),c.util.object.extend(c.Canvas.prototype,{mainTouchId:null,_initEventListeners:function(){this.removeListeners(),this._bindEvents(),this.addOrRemove(b,"add")},_getEventPrefix:function(){return this.enablePointerEvents?"pointer":"mouse"},addOrRemove:function(f,_){var h=this.upperCanvasEl,E=this._getEventPrefix();f(c.window,"resize",this._onResize),f(h,E+"down",this._onMouseDown),f(h,E+"move",this._onMouseMove,a),f(h,E+"out",this._onMouseOut),f(h,E+"enter",this._onMouseEnter),f(h,"wheel",this._onMouseWheel),f(h,"contextmenu",this._onContextMenu),f(h,"dblclick",this._onDoubleClick),f(h,"dragover",this._onDragOver),f(h,"dragenter",this._onDragEnter),f(h,"dragleave",this._onDragLeave),f(h,"drop",this._onDrop),this.enablePointerEvents||f(h,"touchstart",this._onTouchStart,a),typeof eventjs!="undefined"&&_ in eventjs&&(eventjs[_](h,"gesture",this._onGesture),eventjs[_](h,"drag",this._onDrag),eventjs[_](h,"orientation",this._onOrientationChange),eventjs[_](h,"shake",this._onShake),eventjs[_](h,"longpress",this._onLongPress))},removeListeners:function(){this.addOrRemove(r,"remove");var f=this._getEventPrefix();r(c.document,f+"up",this._onMouseUp),r(c.document,"touchend",this._onTouchEnd,a),r(c.document,f+"move",this._onMouseMove,a),r(c.document,"touchmove",this._onMouseMove,a)},_bindEvents:function(){this.eventsBound||(this._onMouseDown=this._onMouseDown.bind(this),this._onTouchStart=this._onTouchStart.bind(this),this._onMouseMove=this._onMouseMove.bind(this),this._onMouseUp=this._onMouseUp.bind(this),this._onTouchEnd=this._onTouchEnd.bind(this),this._onResize=this._onResize.bind(this),this._onGesture=this._onGesture.bind(this),this._onDrag=this._onDrag.bind(this),this._onShake=this._onShake.bind(this),this._onLongPress=this._onLongPress.bind(this),this._onOrientationChange=this._onOrientationChange.bind(this),this._onMouseWheel=this._onMouseWheel.bind(this),this._onMouseOut=this._onMouseOut.bind(this),this._onMouseEnter=this._onMouseEnter.bind(this),this._onContextMenu=this._onContextMenu.bind(this),this._onDoubleClick=this._onDoubleClick.bind(this),this._onDragOver=this._onDragOver.bind(this),this._onDragEnter=this._simpleEventHandler.bind(this,"dragenter"),this._onDragLeave=this._simpleEventHandler.bind(this,"dragleave"),this._onDrop=this._simpleEventHandler.bind(this,"drop"),this.eventsBound=!0)},_onGesture:function(f,_){this.__onTransformGesture&&this.__onTransformGesture(f,_)},_onDrag:function(f,_){this.__onDrag&&this.__onDrag(f,_)},_onMouseWheel:function(f){this.__onMouseWheel(f)},_onMouseOut:function(f){var _=this._hoveredTarget;this.fire("mouse:out",{target:_,e:f}),this._hoveredTarget=null,_&&_.fire("mouseout",{e:f});var h=this;this._hoveredTargets.forEach(function(E){h.fire("mouse:out",{target:_,e:f}),E&&_.fire("mouseout",{e:f})}),this._hoveredTargets=[],this._iTextInstances&&this._iTextInstances.forEach(function(E){E.isEditing&&E.hiddenTextarea.focus()})},_onMouseEnter:function(f){!this._currentTransform&&!this.findTarget(f)&&(this.fire("mouse:over",{target:null,e:f}),this._hoveredTarget=null,this._hoveredTargets=[])},_onOrientationChange:function(f,_){this.__onOrientationChange&&this.__onOrientationChange(f,_)},_onShake:function(f,_){this.__onShake&&this.__onShake(f,_)},_onLongPress:function(f,_){this.__onLongPress&&this.__onLongPress(f,_)},_onDragOver:function(f){f.preventDefault();var _=this._simpleEventHandler("dragover",f);this._fireEnterLeaveEvents(_,f)},_onContextMenu:function(f){return this.stopContextMenu&&(f.stopPropagation(),f.preventDefault()),!1},_onDoubleClick:function(f){this._cacheTransformEventData(f),this._handleEvent(f,"dblclick"),this._resetTransformEventData(f)},getPointerId:function(f){var _=f.changedTouches;return _?_[0]&&_[0].identifier:this.enablePointerEvents?f.pointerId:-1},_isMainEvent:function(f){return f.isPrimary===!0?!0:f.isPrimary===!1?!1:f.type==="touchend"&&f.touches.length===0?!0:f.changedTouches?f.changedTouches[0].identifier===this.mainTouchId:!0},_onTouchStart:function(f){f.preventDefault(),this.mainTouchId===null&&(this.mainTouchId=this.getPointerId(f)),this.__onMouseDown(f),this._resetTransformEventData();var _=this.upperCanvasEl,h=this._getEventPrefix();b(c.document,"touchend",this._onTouchEnd,a),b(c.document,"touchmove",this._onMouseMove,a),r(_,h+"down",this._onMouseDown)},_onMouseDown:function(f){this.__onMouseDown(f),this._resetTransformEventData();var _=this.upperCanvasEl,h=this._getEventPrefix();r(_,h+"move",this._onMouseMove,a),b(c.document,h+"up",this._onMouseUp),b(c.document,h+"move",this._onMouseMove,a)},_onTouchEnd:function(f){if(!(f.touches.length>0)){this.__onMouseUp(f),this._resetTransformEventData(),this.mainTouchId=null;var _=this._getEventPrefix();r(c.document,"touchend",this._onTouchEnd,a),r(c.document,"touchmove",this._onMouseMove,a);var h=this;this._willAddMouseDown&&clearTimeout(this._willAddMouseDown),this._willAddMouseDown=setTimeout(function(){b(h.upperCanvasEl,_+"down",h._onMouseDown),h._willAddMouseDown=0},400)}},_onMouseUp:function(f){this.__onMouseUp(f),this._resetTransformEventData();var _=this.upperCanvasEl,h=this._getEventPrefix();this._isMainEvent(f)&&(r(c.document,h+"up",this._onMouseUp),r(c.document,h+"move",this._onMouseMove,a),b(_,h+"move",this._onMouseMove,a))},_onMouseMove:function(f){!this.allowTouchScrolling&&f.preventDefault&&f.preventDefault(),this.__onMouseMove(f)},_onResize:function(){this.calcOffset()},_shouldRender:function(f){var _=this._activeObject;return!!_!=!!f||_&&f&&_!==f?!0:(_&&_.isEditing,!1)},__onMouseUp:function(f){var _,h=this._currentTransform,E=this._groupSelector,w=!1,A=!E||E.left===0&&E.top===0;if(this._cacheTransformEventData(f),_=this._target,this._handleEvent(f,"up:before"),n(f,m)){this.fireRightClick&&this._handleEvent(f,"up",m,A);return}if(n(f,p)){this.fireMiddleClick&&this._handleEvent(f,"up",p,A),this._resetTransformEventData();return}if(this.isDrawingMode&&this._isCurrentlyDrawing){this._onMouseUpInDrawingMode(f);return}if(this._isMainEvent(f)){if(h&&(this._finalizeCurrentTransform(f),w=h.actionPerformed),!A){var D=_===this._activeObject;this._maybeGroupObjects(f),w||(w=this._shouldRender(_)||!D&&_===this._activeObject)}if(_){if(_.selectable&&_!==this._activeObject&&_.activeOn==="up")this.setActiveObject(_,f),w=!0;else{var z=_._findTargetCorner(this.getPointer(f,!0),c.util.isTouchEvent(f)),B=_.controls[z],Y=B&&B.getMouseUpHandler(f,_,B);if(Y){var H=this.getPointer(f);Y(f,h,H.x,H.y)}}_.isMoving=!1}this._setCursorFromEvent(f,_),this._handleEvent(f,"up",i,A),this._groupSelector=null,this._currentTransform=null,_&&(_.__corner=0),w?this.requestRenderAll():A||this.renderTop()}},_simpleEventHandler:function(f,_){var h=this.findTarget(_),E=this.targets,w={e:_,target:h,subTargets:E};if(this.fire(f,w),h&&h.fire(f,w),!E)return h;for(var A=0;A<E.length;A++)E[A].fire(f,w);return h},_handleEvent:function(f,_,h,E){var w=this._target,A=this.targets||[],D={e:f,target:w,subTargets:A,button:h||i,isClick:E||!1,pointer:this._pointer,absolutePointer:this._absolutePointer,transform:this._currentTransform};_==="up"&&(D.currentTarget=this.findTarget(f),D.currentSubTargets=this.targets),this.fire("mouse:"+_,D),w&&w.fire("mouse"+_,D);for(var z=0;z<A.length;z++)A[z].fire("mouse"+_,D)},_finalizeCurrentTransform:function(f){var _=this._currentTransform,h=_.target,E,w={e:f,target:h,transform:_,action:_.action};h._scaling&&(h._scaling=!1),h.setCoords(),(_.actionPerformed||this.stateful&&h.hasStateChanged())&&(_.actionPerformed&&(E=this._addEventOptions(w,_),this._fire(E,w)),this._fire("modified",w))},_addEventOptions:function(f,_){var h,E;switch(_.action){case"scaleX":h="scaled",E="x";break;case"scaleY":h="scaled",E="y";break;case"skewX":h="skewed",E="x";break;case"skewY":h="skewed",E="y";break;case"scale":h="scaled",E="equally";break;case"rotate":h="rotated";break;case"drag":h="moved";break}return f.by=E,h},_onMouseDownInDrawingMode:function(f){this._isCurrentlyDrawing=!0,this.getActiveObject()&&this.discardActiveObject(f).requestRenderAll();var _=this.getPointer(f);this.freeDrawingBrush.onMouseDown(_,{e:f,pointer:_}),this._handleEvent(f,"down")},_onMouseMoveInDrawingMode:function(f){if(this._isCurrentlyDrawing){var _=this.getPointer(f);this.freeDrawingBrush.onMouseMove(_,{e:f,pointer:_})}this.setCursor(this.freeDrawingCursor),this._handleEvent(f,"move")},_onMouseUpInDrawingMode:function(f){var _=this.getPointer(f);this._isCurrentlyDrawing=this.freeDrawingBrush.onMouseUp({e:f,pointer:_}),this._handleEvent(f,"up")},__onMouseDown:function(f){this._cacheTransformEventData(f),this._handleEvent(f,"down:before");var _=this._target;if(n(f,m)){this.fireRightClick&&this._handleEvent(f,"down",m);return}if(n(f,p)){this.fireMiddleClick&&this._handleEvent(f,"down",p);return}if(this.isDrawingMode){this._onMouseDownInDrawingMode(f);return}if(this._isMainEvent(f)&&!this._currentTransform){var h=this._pointer;this._previousPointer=h;var E=this._shouldRender(_),w=this._shouldGroup(f,_);if(this._shouldClearSelection(f,_)?this.discardActiveObject(f):w&&(this._handleGrouping(f,_),_=this._activeObject),this.selection&&(!_||!_.selectable&&!_.isEditing&&_!==this._activeObject)&&(this._groupSelector={ex:this._absolutePointer.x,ey:this._absolutePointer.y,top:0,left:0}),_){var A=_===this._activeObject;_.selectable&&_.activeOn==="down"&&this.setActiveObject(_,f);var D=_._findTargetCorner(this.getPointer(f,!0),c.util.isTouchEvent(f));if(_.__corner=D,_===this._activeObject&&(D||!w)){this._setupCurrentTransform(f,_,A);var z=_.controls[D],h=this.getPointer(f),B=z&&z.getMouseDownHandler(f,_,z);B&&B(f,this._currentTransform,h.x,h.y)}}this._handleEvent(f,"down"),(E||w)&&this.requestRenderAll()}},_resetTransformEventData:function(){this._target=null,this._pointer=null,this._absolutePointer=null},_cacheTransformEventData:function(f){this._resetTransformEventData(),this._pointer=this.getPointer(f,!0),this._absolutePointer=this.restorePointerVpt(this._pointer),this._target=this._currentTransform?this._currentTransform.target:this.findTarget(f)||null},_beforeTransform:function(f){var _=this._currentTransform;this.stateful&&_.target.saveState(),this.fire("before:transform",{e:f,transform:_})},__onMouseMove:function(f){this._handleEvent(f,"move:before"),this._cacheTransformEventData(f);var _,h;if(this.isDrawingMode){this._onMouseMoveInDrawingMode(f);return}if(this._isMainEvent(f)){var E=this._groupSelector;E?(h=this._absolutePointer,E.left=h.x-E.ex,E.top=h.y-E.ey,this.renderTop()):this._currentTransform?this._transformObject(f):(_=this.findTarget(f)||null,this._setCursorFromEvent(f,_),this._fireOverOutEvents(_,f)),this._handleEvent(f,"move"),this._resetTransformEventData()}},_fireOverOutEvents:function(f,_){var h=this._hoveredTarget,E=this._hoveredTargets,w=this.targets,A=Math.max(E.length,w.length);this.fireSyntheticInOutEvents(f,_,{oldTarget:h,evtOut:"mouseout",canvasEvtOut:"mouse:out",evtIn:"mouseover",canvasEvtIn:"mouse:over"});for(var D=0;D<A;D++)this.fireSyntheticInOutEvents(w[D],_,{oldTarget:E[D],evtOut:"mouseout",evtIn:"mouseover"});this._hoveredTarget=f,this._hoveredTargets=this.targets.concat()},_fireEnterLeaveEvents:function(f,_){var h=this._draggedoverTarget,E=this._hoveredTargets,w=this.targets,A=Math.max(E.length,w.length);this.fireSyntheticInOutEvents(f,_,{oldTarget:h,evtOut:"dragleave",evtIn:"dragenter"});for(var D=0;D<A;D++)this.fireSyntheticInOutEvents(w[D],_,{oldTarget:E[D],evtOut:"dragleave",evtIn:"dragenter"});this._draggedoverTarget=f},fireSyntheticInOutEvents:function(f,_,h){var E,w,A=h.oldTarget,D,z,B=A!==f,Y=h.canvasEvtIn,H=h.canvasEvtOut;B&&(E={e:_,target:f,previousTarget:A},w={e:_,target:A,nextTarget:f}),z=f&&B,D=A&&B,D&&(H&&this.fire(H,w),A.fire(h.evtOut,w)),z&&(Y&&this.fire(Y,E),f.fire(h.evtIn,E))},__onMouseWheel:function(f){this._cacheTransformEventData(f),this._handleEvent(f,"wheel"),this._resetTransformEventData()},_transformObject:function(f){var _=this.getPointer(f),h=this._currentTransform;h.reset=!1,h.shiftKey=f.shiftKey,h.altKey=f[this.centeredKey],this._performTransformAction(f,h,_),h.actionPerformed&&this.requestRenderAll()},_performTransformAction:function(f,_,h){var E=h.x,w=h.y,A=_.action,D=!1,z=_.actionHandler;z&&(D=z(f,_,E,w)),A==="drag"&&D&&(_.target.isMoving=!0,this.setCursor(_.target.moveCursor||this.moveCursor)),_.actionPerformed=_.actionPerformed||D},_fire:c.controlsUtils.fireEvent,_setCursorFromEvent:function(f,_){if(!_)return this.setCursor(this.defaultCursor),!1;var h=_.hoverCursor||this.hoverCursor,E=this._activeObject&&this._activeObject.type==="activeSelection"?this._activeObject:null,w=(!E||!E.contains(_))&&_._findTargetCorner(this.getPointer(f,!0));w?this.setCursor(this.getCornerCursor(w,_,f)):(_.subTargetCheck&&this.targets.concat().reverse().map(function(A){h=A.hoverCursor||h}),this.setCursor(h))},getCornerCursor:function(f,_,h){var E=_.controls[f];return E.cursorStyleHandler(h,E,_)}})}(),function(){var b=Math.min,r=Math.max;c.util.object.extend(c.Canvas.prototype,{_shouldGroup:function(m,p){var i=this._activeObject;return i&&this._isSelectionKeyPressed(m)&&p&&p.selectable&&this.selection&&(i!==p||i.type==="activeSelection")&&!p.onSelect({e:m})},_handleGrouping:function(m,p){var i=this._activeObject;i.__corner||p===i&&(p=this.findTarget(m,!0),!p||!p.selectable)||(i&&i.type==="activeSelection"?this._updateActiveSelection(p,m):this._createActiveSelection(p,m))},_updateActiveSelection:function(m,p){var i=this._activeObject,a=i._objects.slice(0);i.contains(m)?(i.removeWithUpdate(m),this._hoveredTarget=m,this._hoveredTargets=this.targets.concat(),i.size()===1&&this._setActiveObject(i.item(0),p)):(i.addWithUpdate(m),this._hoveredTarget=i,this._hoveredTargets=this.targets.concat()),this._fireSelectionEvents(a,p)},_createActiveSelection:function(m,p){var i=this.getActiveObjects(),a=this._createGroup(m);this._hoveredTarget=a,this._setActiveObject(a,p),this._fireSelectionEvents(i,p)},_createGroup:function(m){var p=this._objects,i=p.indexOf(this._activeObject)<p.indexOf(m),a=i?[this._activeObject,m]:[m,this._activeObject];return this._activeObject.isEditing&&this._activeObject.exitEditing(),new c.ActiveSelection(a,{canvas:this})},_groupSelectedObjects:function(m){var p=this._collectObjects(m),i;p.length===1?this.setActiveObject(p[0],m):p.length>1&&(i=new c.ActiveSelection(p.reverse(),{canvas:this}),this.setActiveObject(i,m))},_collectObjects:function(m){for(var p=[],i,a=this._groupSelector.ex,n=this._groupSelector.ey,f=a+this._groupSelector.left,_=n+this._groupSelector.top,h=new c.Point(b(a,f),b(n,_)),E=new c.Point(r(a,f),r(n,_)),w=!this.selectionFullyContained,A=a===f&&n===_,D=this._objects.length;D--&&(i=this._objects[D],!(!(!i||!i.selectable||!i.visible)&&(w&&i.intersectsWithRect(h,E,!0)||i.isContainedWithinRect(h,E,!0)||w&&i.containsPoint(h,null,!0)||w&&i.containsPoint(E,null,!0))&&(p.push(i),A))););return p.length>1&&(p=p.filter(function(z){return!z.onSelect({e:m})})),p},_maybeGroupObjects:function(m){this.selection&&this._groupSelector&&this._groupSelectedObjects(m),this.setCursor(this.defaultCursor),this._groupSelector=null}})}(),function(){c.util.object.extend(c.StaticCanvas.prototype,{toDataURL:function(b){b||(b={});var r=b.format||"png",m=b.quality||1,p=(b.multiplier||1)*(b.enableRetinaScaling?this.getRetinaScaling():1),i=this.toCanvasElement(p,b);return c.util.toDataURL(i,r,m)},toCanvasElement:function(b,r){b=b||1,r=r||{};var m=(r.width||this.width)*b,p=(r.height||this.height)*b,i=this.getZoom(),a=this.width,n=this.height,f=i*b,_=this.viewportTransform,h=(_[4]-(r.left||0))*b,E=(_[5]-(r.top||0))*b,w=this.interactive,A=[f,0,0,f,h,E],D=this.enableRetinaScaling,z=c.util.createCanvasElement(),B=this.contextTop;return z.width=m,z.height=p,this.contextTop=null,this.enableRetinaScaling=!1,this.interactive=!1,this.viewportTransform=A,this.width=m,this.height=p,this.calcViewportBoundaries(),this.renderCanvas(z.getContext("2d"),this._objects),this.viewportTransform=_,this.width=a,this.height=n,this.calcViewportBoundaries(),this.interactive=w,this.enableRetinaScaling=D,this.contextTop=B,z}})}(),c.util.object.extend(c.StaticCanvas.prototype,{loadFromJSON:function(b,r,m){if(b){var p=typeof b=="string"?JSON.parse(b):c.util.object.clone(b),i=this,a=p.clipPath,n=this.renderOnAddRemove;return this.renderOnAddRemove=!1,delete p.clipPath,this._enlivenObjects(p.objects,function(f){i.clear(),i._setBgOverlay(p,function(){a?i._enlivenObjects([a],function(_){i.clipPath=_[0],i.__setupCanvas.call(i,p,f,n,r)}):i.__setupCanvas.call(i,p,f,n,r)})},m),this}},__setupCanvas:function(b,r,m,p){var i=this;r.forEach(function(a,n){i.insertAt(a,n)}),this.renderOnAddRemove=m,delete b.objects,delete b.backgroundImage,delete b.overlayImage,delete b.background,delete b.overlay,this._setOptions(b),this.renderAll(),p&&p()},_setBgOverlay:function(b,r){var m={backgroundColor:!1,overlayColor:!1,backgroundImage:!1,overlayImage:!1};if(!b.backgroundImage&&!b.overlayImage&&!b.background&&!b.overlay){r&&r();return}var p=e(function(){m.backgroundImage&&m.overlayImage&&m.backgroundColor&&m.overlayColor&&r&&r()},"cbIfLoaded");this.__setBgOverlay("backgroundImage",b.backgroundImage,m,p),this.__setBgOverlay("overlayImage",b.overlayImage,m,p),this.__setBgOverlay("backgroundColor",b.background,m,p),this.__setBgOverlay("overlayColor",b.overlay,m,p)},__setBgOverlay:function(b,r,m,p){var i=this;if(!r){m[b]=!0,p&&p();return}b==="backgroundImage"||b==="overlayImage"?c.util.enlivenObjects([r],function(a){i[b]=a[0],m[b]=!0,p&&p()}):this["set"+c.util.string.capitalize(b,!0)](r,function(){m[b]=!0,p&&p()})},_enlivenObjects:function(b,r,m){if(!b||b.length===0){r&&r([]);return}c.util.enlivenObjects(b,function(p){r&&r(p)},null,m)},_toDataURL:function(b,r){this.clone(function(m){r(m.toDataURL(b))})},_toDataURLWithMultiplier:function(b,r,m){this.clone(function(p){m(p.toDataURLWithMultiplier(b,r))})},clone:function(b,r){var m=JSON.stringify(this.toJSON(r));this.cloneWithoutData(function(p){p.loadFromJSON(m,function(){b&&b(p)})})},cloneWithoutData:function(b){var r=c.util.createCanvasElement();r.width=this.width,r.height=this.height;var m=new c.Canvas(r);this.backgroundImage?(m.setBackgroundImage(this.backgroundImage.src,function(){m.renderAll(),b&&b(m)}),m.backgroundImageOpacity=this.backgroundImageOpacity,m.backgroundImageStretch=this.backgroundImageStretch):b&&b(m)}}),function(b){"use strict";var r=b.fabric||(b.fabric={}),m=r.util.object.extend,p=r.util.object.clone,i=r.util.toFixed,a=r.util.string.capitalize,n=r.util.degreesToRadians,f=!r.isLikelyNode,_=2;r.Object||(r.Object=r.util.createClass(r.CommonMethods,{type:"object",originX:"left",originY:"top",top:0,left:0,width:0,height:0,scaleX:1,scaleY:1,flipX:!1,flipY:!1,opacity:1,angle:0,skewX:0,skewY:0,cornerSize:13,touchCornerSize:24,transparentCorners:!0,hoverCursor:null,moveCursor:null,padding:0,borderColor:"rgb(178,204,255)",borderDashArray:null,cornerColor:"rgb(178,204,255)",cornerStrokeColor:null,cornerStyle:"rect",cornerDashArray:null,centeredScaling:!1,centeredRotation:!0,fill:"rgb(0,0,0)",fillRule:"nonzero",globalCompositeOperation:"source-over",backgroundColor:"",selectionBackgroundColor:"",stroke:null,strokeWidth:1,strokeDashArray:null,strokeDashOffset:0,strokeLineCap:"butt",strokeLineJoin:"miter",strokeMiterLimit:4,shadow:null,borderOpacityWhenMoving:.4,borderScaleFactor:1,minScaleLimit:0,selectable:!0,evented:!0,visible:!0,hasControls:!0,hasBorders:!0,perPixelTargetFind:!1,includeDefaultValues:!0,lockMovementX:!1,lockMovementY:!1,lockRotation:!1,lockScalingX:!1,lockScalingY:!1,lockSkewingX:!1,lockSkewingY:!1,lockScalingFlip:!1,excludeFromExport:!1,objectCaching:f,statefullCache:!1,noScaleCache:!0,strokeUniform:!1,dirty:!0,__corner:0,paintFirst:"fill",activeOn:"down",stateProperties:"top left width height scaleX scaleY flipX flipY originX originY transformMatrix stroke strokeWidth strokeDashArray strokeLineCap strokeDashOffset strokeLineJoin strokeMiterLimit angle opacity fill globalCompositeOperation shadow visible backgroundColor skewX skewY fillRule paintFirst clipPath strokeUniform".split(" "),cacheProperties:"fill stroke strokeWidth strokeDashArray width height paintFirst strokeUniform strokeLineCap strokeDashOffset strokeLineJoin strokeMiterLimit backgroundColor clipPath".split(" "),colorProperties:"fill stroke backgroundColor".split(" "),clipPath:void 0,inverted:!1,absolutePositioned:!1,initialize:function(h){h&&this.setOptions(h)},_createCacheCanvas:function(){this._cacheProperties={},this._cacheCanvas=r.util.createCanvasElement(),this._cacheContext=this._cacheCanvas.getContext("2d"),this._updateCacheCanvas(),this.dirty=!0},_limitCacheSize:function(h){var E=r.perfLimitSizeTotal,w=h.width,A=h.height,D=r.maxCacheSideLimit,z=r.minCacheSideLimit;if(w<=D&&A<=D&&w*A<=E)return w<z&&(h.width=z),A<z&&(h.height=z),h;var B=w/A,Y=r.util.limitDimsByArea(B,E),H=r.util.capValue,V=H(z,Y.x,D),lt=H(z,Y.y,D);return w>V&&(h.zoomX/=w/V,h.width=V,h.capped=!0),A>lt&&(h.zoomY/=A/lt,h.height=lt,h.capped=!0),h},_getCacheCanvasDimensions:function(){var h=this.getTotalObjectScaling(),E=this._getTransformedDimensions(0,0),w=E.x*h.scaleX/this.scaleX,A=E.y*h.scaleY/this.scaleY;return{width:w+_,height:A+_,zoomX:h.scaleX,zoomY:h.scaleY,x:w,y:A}},_updateCacheCanvas:function(){var h=this.canvas;if(this.noScaleCache&&h&&h._currentTransform){var E=h._currentTransform.target,w=h._currentTransform.action;if(this===E&&w.slice&&w.slice(0,5)==="scale")return!1}var A=this._cacheCanvas,D=this._limitCacheSize(this._getCacheCanvasDimensions()),z=r.minCacheSideLimit,B=D.width,Y=D.height,H,V,lt=D.zoomX,rt=D.zoomY,St=B!==this.cacheWidth||Y!==this.cacheHeight,q=this.zoomX!==lt||this.zoomY!==rt,_t=St||q,G=0,Ut=0,xt=!1;if(St){var Ht=this._cacheCanvas.width,it=this._cacheCanvas.height,ut=B>Ht||Y>it,tt=(B<Ht*.9||Y<it*.9)&&Ht>z&&it>z;xt=ut||tt,ut&&!D.capped&&(B>z||Y>z)&&(G=B*.1,Ut=Y*.1)}return this instanceof r.Text&&this.path&&(_t=!0,xt=!0,G+=this.getHeightOfLine(0)*this.zoomX,Ut+=this.getHeightOfLine(0)*this.zoomY),_t?(xt?(A.width=Math.ceil(B+G),A.height=Math.ceil(Y+Ut)):(this._cacheContext.setTransform(1,0,0,1,0,0),this._cacheContext.clearRect(0,0,A.width,A.height)),H=D.x/2,V=D.y/2,this.cacheTranslationX=Math.round(A.width/2-H)+H,this.cacheTranslationY=Math.round(A.height/2-V)+V,this.cacheWidth=B,this.cacheHeight=Y,this._cacheContext.translate(this.cacheTranslationX,this.cacheTranslationY),this._cacheContext.scale(lt,rt),this.zoomX=lt,this.zoomY=rt,!0):!1},setOptions:function(h){this._setOptions(h),this._initGradient(h.fill,"fill"),this._initGradient(h.stroke,"stroke"),this._initPattern(h.fill,"fill"),this._initPattern(h.stroke,"stroke")},transform:function(h){var E=this.group&&!this.group._transformDone||this.group&&this.canvas&&h===this.canvas.contextTop,w=this.calcTransformMatrix(!E);h.transform(w[0],w[1],w[2],w[3],w[4],w[5])},toObject:function(h){var E=r.Object.NUM_FRACTION_DIGITS,w={type:this.type,version:r.version,originX:this.originX,originY:this.originY,left:i(this.left,E),top:i(this.top,E),width:i(this.width,E),height:i(this.height,E),fill:this.fill&&this.fill.toObject?this.fill.toObject():this.fill,stroke:this.stroke&&this.stroke.toObject?this.stroke.toObject():this.stroke,strokeWidth:i(this.strokeWidth,E),strokeDashArray:this.strokeDashArray?this.strokeDashArray.concat():this.strokeDashArray,strokeLineCap:this.strokeLineCap,strokeDashOffset:this.strokeDashOffset,strokeLineJoin:this.strokeLineJoin,strokeUniform:this.strokeUniform,strokeMiterLimit:i(this.strokeMiterLimit,E),scaleX:i(this.scaleX,E),scaleY:i(this.scaleY,E),angle:i(this.angle,E),flipX:this.flipX,flipY:this.flipY,opacity:i(this.opacity,E),shadow:this.shadow&&this.shadow.toObject?this.shadow.toObject():this.shadow,visible:this.visible,backgroundColor:this.backgroundColor,fillRule:this.fillRule,paintFirst:this.paintFirst,globalCompositeOperation:this.globalCompositeOperation,skewX:i(this.skewX,E),skewY:i(this.skewY,E)};return this.clipPath&&!this.clipPath.excludeFromExport&&(w.clipPath=this.clipPath.toObject(h),w.clipPath.inverted=this.clipPath.inverted,w.clipPath.absolutePositioned=this.clipPath.absolutePositioned),r.util.populateWithProperties(this,w,h),this.includeDefaultValues||(w=this._removeDefaultValues(w)),w},toDatalessObject:function(h){return this.toObject(h)},_removeDefaultValues:function(h){var E=r.util.getKlass(h.type).prototype,w=E.stateProperties;return w.forEach(function(A){if(!(A==="left"||A==="top")){h[A]===E[A]&&delete h[A];var D=Object.prototype.toString.call(h[A])==="[object Array]"&&Object.prototype.toString.call(E[A])==="[object Array]";D&&h[A].length===0&&E[A].length===0&&delete h[A]}}),h},toString:function(){return"#<fabric."+a(this.type)+">"},getObjectScaling:function(){if(!this.group)return{scaleX:this.scaleX,scaleY:this.scaleY};var h=r.util.qrDecompose(this.calcTransformMatrix());return{scaleX:Math.abs(h.scaleX),scaleY:Math.abs(h.scaleY)}},getTotalObjectScaling:function(){var h=this.getObjectScaling(),E=h.scaleX,w=h.scaleY;if(this.canvas){var A=this.canvas.getZoom(),D=this.canvas.getRetinaScaling();E*=A*D,w*=A*D}return{scaleX:E,scaleY:w}},getObjectOpacity:function(){var h=this.opacity;return this.group&&(h*=this.group.getObjectOpacity()),h},_set:function(h,E){var w=h==="scaleX"||h==="scaleY",A=this[h]!==E,D=!1;return w&&(E=this._constrainScale(E)),h==="scaleX"&&E<0?(this.flipX=!this.flipX,E*=-1):h==="scaleY"&&E<0?(this.flipY=!this.flipY,E*=-1):h==="shadow"&&E&&!(E instanceof r.Shadow)?E=new r.Shadow(E):h==="dirty"&&this.group&&this.group.set("dirty",E),this[h]=E,A&&(D=this.group&&this.group.isOnACache(),this.cacheProperties.indexOf(h)>-1?(this.dirty=!0,D&&this.group.set("dirty",!0)):D&&this.stateProperties.indexOf(h)>-1&&this.group.set("dirty",!0)),this},setOnGroup:function(){},getViewportTransform:function(){return this.canvas&&this.canvas.viewportTransform?this.canvas.viewportTransform:r.iMatrix.concat()},isNotVisible:function(){return this.opacity===0||!this.width&&!this.height&&this.strokeWidth===0||!this.visible},render:function(h){this.isNotVisible()||this.canvas&&this.canvas.skipOffscreen&&!this.group&&!this.isOnScreen()||(h.save(),this._setupCompositeOperation(h),this.drawSelectionBackground(h),this.transform(h),this._setOpacity(h),this._setShadow(h,this),this.shouldCache()?(this.renderCache(),this.drawCacheOnCanvas(h)):(this._removeCacheCanvas(),this.dirty=!1,this.drawObject(h),this.objectCaching&&this.statefullCache&&this.saveState({propertySet:"cacheProperties"})),h.restore())},renderCache:function(h){h=h||{},this._cacheCanvas||this._createCacheCanvas(),this.isCacheDirty()&&(this.statefullCache&&this.saveState({propertySet:"cacheProperties"}),this.drawObject(this._cacheContext,h.forClipping),this.dirty=!1)},_removeCacheCanvas:function(){this._cacheCanvas=null,this.cacheWidth=0,this.cacheHeight=0},hasStroke:function(){return this.stroke&&this.stroke!=="transparent"&&this.strokeWidth!==0},hasFill:function(){return this.fill&&this.fill!=="transparent"},needsItsOwnCache:function(){return!!(this.paintFirst==="stroke"&&this.hasFill()&&this.hasStroke()&&typeof this.shadow=="object"||this.clipPath)},shouldCache:function(){return this.ownCaching=this.needsItsOwnCache()||this.objectCaching&&(!this.group||!this.group.isOnACache()),this.ownCaching},willDrawShadow:function(){return!!this.shadow&&(this.shadow.offsetX!==0||this.shadow.offsetY!==0)},drawClipPathOnCache:function(h){var E=this.clipPath;if(h.save(),E.inverted?h.globalCompositeOperation="destination-out":h.globalCompositeOperation="destination-in",E.absolutePositioned){var w=r.util.invertTransform(this.calcTransformMatrix());h.transform(w[0],w[1],w[2],w[3],w[4],w[5])}E.transform(h),h.scale(1/E.zoomX,1/E.zoomY),h.drawImage(E._cacheCanvas,-E.cacheTranslationX,-E.cacheTranslationY),h.restore()},drawObject:function(h,E){var w=this.fill,A=this.stroke;E?(this.fill="black",this.stroke="",this._setClippingProperties(h)):this._renderBackground(h),this._render(h),this._drawClipPath(h),this.fill=w,this.stroke=A},_drawClipPath:function(h){var E=this.clipPath;E&&(E.canvas=this.canvas,E.shouldCache(),E._transformDone=!0,E.renderCache({forClipping:!0}),this.drawClipPathOnCache(h))},drawCacheOnCanvas:function(h){h.scale(1/this.zoomX,1/this.zoomY),h.drawImage(this._cacheCanvas,-this.cacheTranslationX,-this.cacheTranslationY)},isCacheDirty:function(h){if(this.isNotVisible())return!1;if(this._cacheCanvas&&!h&&this._updateCacheCanvas())return!0;if(this.dirty||this.clipPath&&this.clipPath.absolutePositioned||this.statefullCache&&this.hasStateChanged("cacheProperties")){if(this._cacheCanvas&&!h){var E=this.cacheWidth/this.zoomX,w=this.cacheHeight/this.zoomY;this._cacheContext.clearRect(-E/2,-w/2,E,w)}return!0}return!1},_renderBackground:function(h){if(this.backgroundColor){var E=this._getNonTransformedDimensions();h.fillStyle=this.backgroundColor,h.fillRect(-E.x/2,-E.y/2,E.x,E.y),this._removeShadow(h)}},_setOpacity:function(h){this.group&&!this.group._transformDone?h.globalAlpha=this.getObjectOpacity():h.globalAlpha*=this.opacity},_setStrokeStyles:function(h,E){var w=E.stroke;w&&(h.lineWidth=E.strokeWidth,h.lineCap=E.strokeLineCap,h.lineDashOffset=E.strokeDashOffset,h.lineJoin=E.strokeLineJoin,h.miterLimit=E.strokeMiterLimit,w.toLive?w.gradientUnits==="percentage"||w.gradientTransform||w.patternTransform?this._applyPatternForTransformedGradient(h,w):(h.strokeStyle=w.toLive(h,this),this._applyPatternGradientTransform(h,w)):h.strokeStyle=E.stroke)},_setFillStyles:function(h,E){var w=E.fill;w&&(w.toLive?(h.fillStyle=w.toLive(h,this),this._applyPatternGradientTransform(h,E.fill)):h.fillStyle=w)},_setClippingProperties:function(h){h.globalAlpha=1,h.strokeStyle="transparent",h.fillStyle="#000000"},_setLineDash:function(h,E){!E||E.length===0||(1&E.length&&E.push.apply(E,E),h.setLineDash(E))},_renderControls:function(h,E){var w=this.getViewportTransform(),A=this.calcTransformMatrix(),D,z,B;E=E||{},z=typeof E.hasBorders!="undefined"?E.hasBorders:this.hasBorders,B=typeof E.hasControls!="undefined"?E.hasControls:this.hasControls,A=r.util.multiplyTransformMatrices(w,A),D=r.util.qrDecompose(A),h.save(),h.translate(D.translateX,D.translateY),h.lineWidth=1*this.borderScaleFactor,this.group||(h.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1),h.rotate(n(D.angle)),E.forActiveSelection||this.group?z&&this.drawBordersInGroup(h,D,E):z&&this.drawBorders(h,E),B&&this.drawControls(h,E),h.restore()},_setShadow:function(h){if(this.shadow){var E=this.shadow,w=this.canvas,A,D=w&&w.viewportTransform[0]||1,z=w&&w.viewportTransform[3]||1;E.nonScaling?A={scaleX:1,scaleY:1}:A=this.getObjectScaling(),w&&w._isRetinaScaling()&&(D*=r.devicePixelRatio,z*=r.devicePixelRatio),h.shadowColor=E.color,h.shadowBlur=E.blur*r.browserShadowBlurConstant*(D+z)*(A.scaleX+A.scaleY)/4,h.shadowOffsetX=E.offsetX*D*A.scaleX,h.shadowOffsetY=E.offsetY*z*A.scaleY}},_removeShadow:function(h){this.shadow&&(h.shadowColor="",h.shadowBlur=h.shadowOffsetX=h.shadowOffsetY=0)},_applyPatternGradientTransform:function(h,E){if(!E||!E.toLive)return{offsetX:0,offsetY:0};var w=E.gradientTransform||E.patternTransform,A=-this.width/2+E.offsetX||0,D=-this.height/2+E.offsetY||0;return E.gradientUnits==="percentage"?h.transform(this.width,0,0,this.height,A,D):h.transform(1,0,0,1,A,D),w&&h.transform(w[0],w[1],w[2],w[3],w[4],w[5]),{offsetX:A,offsetY:D}},_renderPaintInOrder:function(h){this.paintFirst==="stroke"?(this._renderStroke(h),this._renderFill(h)):(this._renderFill(h),this._renderStroke(h))},_render:function(){},_renderFill:function(h){this.fill&&(h.save(),this._setFillStyles(h,this),this.fillRule==="evenodd"?h.fill("evenodd"):h.fill(),h.restore())},_renderStroke:function(h){if(!(!this.stroke||this.strokeWidth===0)){if(this.shadow&&!this.shadow.affectStroke&&this._removeShadow(h),h.save(),this.strokeUniform&&this.group){var E=this.getObjectScaling();h.scale(1/E.scaleX,1/E.scaleY)}else this.strokeUniform&&h.scale(1/this.scaleX,1/this.scaleY);this._setLineDash(h,this.strokeDashArray),this._setStrokeStyles(h,this),h.stroke(),h.restore()}},_applyPatternForTransformedGradient:function(h,E){var w=this._limitCacheSize(this._getCacheCanvasDimensions()),A=r.util.createCanvasElement(),D,z=this.canvas.getRetinaScaling(),B=w.x/this.scaleX/z,Y=w.y/this.scaleY/z;A.width=B,A.height=Y,D=A.getContext("2d"),D.beginPath(),D.moveTo(0,0),D.lineTo(B,0),D.lineTo(B,Y),D.lineTo(0,Y),D.closePath(),D.translate(B/2,Y/2),D.scale(w.zoomX/this.scaleX/z,w.zoomY/this.scaleY/z),this._applyPatternGradientTransform(D,E),D.fillStyle=E.toLive(h),D.fill(),h.translate(-this.width/2-this.strokeWidth/2,-this.height/2-this.strokeWidth/2),h.scale(z*this.scaleX/w.zoomX,z*this.scaleY/w.zoomY),h.strokeStyle=D.createPattern(A,"no-repeat")},_findCenterFromElement:function(){return{x:this.left+this.width/2,y:this.top+this.height/2}},_assignTransformMatrixProps:function(){if(this.transformMatrix){var h=r.util.qrDecompose(this.transformMatrix);this.flipX=!1,this.flipY=!1,this.set("scaleX",h.scaleX),this.set("scaleY",h.scaleY),this.angle=h.angle,this.skewX=h.skewX,this.skewY=0}},_removeTransformMatrix:function(h){var E=this._findCenterFromElement();this.transformMatrix&&(this._assignTransformMatrixProps(),E=r.util.transformPoint(E,this.transformMatrix)),this.transformMatrix=null,h&&(this.scaleX*=h.scaleX,this.scaleY*=h.scaleY,this.cropX=h.cropX,this.cropY=h.cropY,E.x+=h.offsetLeft,E.y+=h.offsetTop,this.width=h.width,this.height=h.height),this.setPositionByOrigin(E,"center","center")},clone:function(h,E){var w=this.toObject(E);this.constructor.fromObject?this.constructor.fromObject(w,h):r.Object._fromObject("Object",w,h)},cloneAsImage:function(h,E){var w=this.toCanvasElement(E);return h&&h(new r.Image(w)),this},toCanvasElement:function(h){h||(h={});var E=r.util,w=E.saveObjectTransform(this),A=this.group,D=this.shadow,z=Math.abs,B=(h.multiplier||1)*(h.enableRetinaScaling?r.devicePixelRatio:1);delete this.group,h.withoutTransform&&E.resetObjectTransform(this),h.withoutShadow&&(this.shadow=null);var Y=r.util.createCanvasElement(),H=this.getBoundingRect(!0,!0),V=this.shadow,lt,rt={x:0,y:0},St,q,_t;V&&(St=V.blur,V.nonScaling?lt={scaleX:1,scaleY:1}:lt=this.getObjectScaling(),rt.x=2*Math.round(z(V.offsetX)+St)*z(lt.scaleX),rt.y=2*Math.round(z(V.offsetY)+St)*z(lt.scaleY)),q=H.width+rt.x,_t=H.height+rt.y,Y.width=Math.ceil(q),Y.height=Math.ceil(_t);var G=new r.StaticCanvas(Y,{enableRetinaScaling:!1,renderOnAddRemove:!1,skipOffscreen:!1});h.format==="jpeg"&&(G.backgroundColor="#fff"),this.setPositionByOrigin(new r.Point(G.width/2,G.height/2),"center","center");var Ut=this.canvas;G.add(this);var xt=G.toCanvasElement(B||1,h);return this.shadow=D,this.set("canvas",Ut),A&&(this.group=A),this.set(w).setCoords(),G._objects=[],G.dispose(),G=null,xt},toDataURL:function(h){return h||(h={}),r.util.toDataURL(this.toCanvasElement(h),h.format||"png",h.quality||1)},isType:function(h){return this.type===h},complexity:function(){return 1},toJSON:function(h){return this.toObject(h)},rotate:function(h){var E=(this.originX!=="center"||this.originY!=="center")&&this.centeredRotation;return E&&this._setOriginToCenter(),this.set("angle",h),E&&this._resetOrigin(),this},centerH:function(){return this.canvas&&this.canvas.centerObjectH(this),this},viewportCenterH:function(){return this.canvas&&this.canvas.viewportCenterObjectH(this),this},centerV:function(){return this.canvas&&this.canvas.centerObjectV(this),this},viewportCenterV:function(){return this.canvas&&this.canvas.viewportCenterObjectV(this),this},center:function(){return this.canvas&&this.canvas.centerObject(this),this},viewportCenter:function(){return this.canvas&&this.canvas.viewportCenterObject(this),this},getLocalPointer:function(h,E){E=E||this.canvas.getPointer(h);var w=new r.Point(E.x,E.y),A=this._getLeftTopCoords();return this.angle&&(w=r.util.rotatePoint(w,A,n(-this.angle))),{x:w.x-A.x,y:w.y-A.y}},_setupCompositeOperation:function(h){this.globalCompositeOperation&&(h.globalCompositeOperation=this.globalCompositeOperation)}}),r.util.createAccessors&&r.util.createAccessors(r.Object),m(r.Object.prototype,r.Observable),r.Object.NUM_FRACTION_DIGITS=2,r.Object._fromObject=function(h,E,w,A){var D=r[h];E=p(E,!0),r.util.enlivenPatterns([E.fill,E.stroke],function(z){typeof z[0]!="undefined"&&(E.fill=z[0]),typeof z[1]!="undefined"&&(E.stroke=z[1]),r.util.enlivenObjects([E.clipPath],function(B){E.clipPath=B[0];var Y=A?new D(E[A],E):new D(E);w&&w(Y)})})},r.Object.__uid=0)}(I),function(){var b=c.util.degreesToRadians,r={left:-.5,center:0,right:.5},m={top:-.5,center:0,bottom:.5};c.util.object.extend(c.Object.prototype,{translateToGivenOrigin:function(p,i,a,n,f){var _=p.x,h=p.y,E,w,A;return typeof i=="string"?i=r[i]:i-=.5,typeof n=="string"?n=r[n]:n-=.5,E=n-i,typeof a=="string"?a=m[a]:a-=.5,typeof f=="string"?f=m[f]:f-=.5,w=f-a,(E||w)&&(A=this._getTransformedDimensions(),_=p.x+E*A.x,h=p.y+w*A.y),new c.Point(_,h)},translateToCenterPoint:function(p,i,a){var n=this.translateToGivenOrigin(p,i,a,"center","center");return this.angle?c.util.rotatePoint(n,p,b(this.angle)):n},translateToOriginPoint:function(p,i,a){var n=this.translateToGivenOrigin(p,"center","center",i,a);return this.angle?c.util.rotatePoint(n,p,b(this.angle)):n},getCenterPoint:function(){var p=new c.Point(this.left,this.top);return this.translateToCenterPoint(p,this.originX,this.originY)},getPointByOrigin:function(p,i){var a=this.getCenterPoint();return this.translateToOriginPoint(a,p,i)},toLocalPoint:function(p,i,a){var n=this.getCenterPoint(),f,_;return typeof i!="undefined"&&typeof a!="undefined"?f=this.translateToGivenOrigin(n,"center","center",i,a):f=new c.Point(this.left,this.top),_=new c.Point(p.x,p.y),this.angle&&(_=c.util.rotatePoint(_,n,-b(this.angle))),_.subtractEquals(f)},setPositionByOrigin:function(p,i,a){var n=this.translateToCenterPoint(p,i,a),f=this.translateToOriginPoint(n,this.originX,this.originY);this.set("left",f.x),this.set("top",f.y)},adjustPosition:function(p){var i=b(this.angle),a=this.getScaledWidth(),n=c.util.cos(i)*a,f=c.util.sin(i)*a,_,h;typeof this.originX=="string"?_=r[this.originX]:_=this.originX-.5,typeof p=="string"?h=r[p]:h=p-.5,this.left+=n*(h-_),this.top+=f*(h-_),this.setCoords(),this.originX=p},_setOriginToCenter:function(){this._originalOriginX=this.originX,this._originalOriginY=this.originY;var p=this.getCenterPoint();this.originX="center",this.originY="center",this.left=p.x,this.top=p.y},_resetOrigin:function(){var p=this.translateToOriginPoint(this.getCenterPoint(),this._originalOriginX,this._originalOriginY);this.originX=this._originalOriginX,this.originY=this._originalOriginY,this.left=p.x,this.top=p.y,this._originalOriginX=null,this._originalOriginY=null},_getLeftTopCoords:function(){return this.translateToOriginPoint(this.getCenterPoint(),"left","top")}})}(),function(){function b(a){return[new c.Point(a.tl.x,a.tl.y),new c.Point(a.tr.x,a.tr.y),new c.Point(a.br.x,a.br.y),new c.Point(a.bl.x,a.bl.y)]}e(b,"arrayFromCoords");var r=c.util,m=r.degreesToRadians,p=r.multiplyTransformMatrices,i=r.transformPoint;r.object.extend(c.Object.prototype,{oCoords:null,aCoords:null,lineCoords:null,ownMatrixCache:null,matrixCache:null,controls:{},_getCoords:function(a,n){return n?a?this.calcACoords():this.calcLineCoords():((!this.aCoords||!this.lineCoords)&&this.setCoords(!0),a?this.aCoords:this.lineCoords)},getCoords:function(a,n){return b(this._getCoords(a,n))},intersectsWithRect:function(a,n,f,_){var h=this.getCoords(f,_),E=c.Intersection.intersectPolygonRectangle(h,a,n);return E.status==="Intersection"},intersectsWithObject:function(a,n,f){var _=c.Intersection.intersectPolygonPolygon(this.getCoords(n,f),a.getCoords(n,f));return _.status==="Intersection"||a.isContainedWithinObject(this,n,f)||this.isContainedWithinObject(a,n,f)},isContainedWithinObject:function(a,n,f){for(var _=this.getCoords(n,f),h=n?a.aCoords:a.lineCoords,E=0,w=a._getImageLines(h);E<4;E++)if(!a.containsPoint(_[E],w))return!1;return!0},isContainedWithinRect:function(a,n,f,_){var h=this.getBoundingRect(f,_);return h.left>=a.x&&h.left+h.width<=n.x&&h.top>=a.y&&h.top+h.height<=n.y},containsPoint:function(a,E,f,_){var h=this._getCoords(f,_),E=E||this._getImageLines(h),w=this._findCrossPoints(a,E);return w!==0&&w%2===1},isOnScreen:function(a){if(!this.canvas)return!1;var n=this.canvas.vptCoords.tl,f=this.canvas.vptCoords.br,_=this.getCoords(!0,a);return _.some(function(h){return h.x<=f.x&&h.x>=n.x&&h.y<=f.y&&h.y>=n.y})||this.intersectsWithRect(n,f,!0,a)?!0:this._containsCenterOfCanvas(n,f,a)},_containsCenterOfCanvas:function(a,n,f){var _={x:(a.x+n.x)/2,y:(a.y+n.y)/2};return!!this.containsPoint(_,null,!0,f)},isPartiallyOnScreen:function(a){if(!this.canvas)return!1;var n=this.canvas.vptCoords.tl,f=this.canvas.vptCoords.br;if(this.intersectsWithRect(n,f,!0,a))return!0;var _=this.getCoords(!0,a).every(function(h){return(h.x>=f.x||h.x<=n.x)&&(h.y>=f.y||h.y<=n.y)});return _&&this._containsCenterOfCanvas(n,f,a)},_getImageLines:function(a){var n={topline:{o:a.tl,d:a.tr},rightline:{o:a.tr,d:a.br},bottomline:{o:a.br,d:a.bl},leftline:{o:a.bl,d:a.tl}};return n},_findCrossPoints:function(a,n){var f,_,h,E,w,A=0,D;for(var z in n)if(D=n[z],!(D.o.y<a.y&&D.d.y<a.y)&&!(D.o.y>=a.y&&D.d.y>=a.y)&&(D.o.x===D.d.x&&D.o.x>=a.x?w=D.o.x:(f=0,_=(D.d.y-D.o.y)/(D.d.x-D.o.x),h=a.y-f*a.x,E=D.o.y-_*D.o.x,w=-(h-E)/(f-_)),w>=a.x&&(A+=1),A===2))break;return A},getBoundingRect:function(a,n){var f=this.getCoords(a,n);return r.makeBoundingBoxFromPoints(f)},getScaledWidth:function(){return this._getTransformedDimensions().x},getScaledHeight:function(){return this._getTransformedDimensions().y},_constrainScale:function(a){return Math.abs(a)<this.minScaleLimit?a<0?-this.minScaleLimit:this.minScaleLimit:a===0?1e-4:a},scale:function(a){return this._set("scaleX",a),this._set("scaleY",a),this.setCoords()},scaleToWidth:function(a,n){var f=this.getBoundingRect(n).width/this.getScaledWidth();return this.scale(a/this.width/f)},scaleToHeight:function(a,n){var f=this.getBoundingRect(n).height/this.getScaledHeight();return this.scale(a/this.height/f)},calcCoords:function(a){return a?this.calcACoords():this.calcOCoords()},calcLineCoords:function(){var a=this.getViewportTransform(),n=this.padding,f=m(this.angle),_=r.cos(f),h=r.sin(f),E=_*n,w=h*n,A=E+w,D=E-w,z=this.calcACoords(),B={tl:i(z.tl,a),tr:i(z.tr,a),bl:i(z.bl,a),br:i(z.br,a)};return n&&(B.tl.x-=D,B.tl.y-=A,B.tr.x+=A,B.tr.y-=D,B.bl.x-=A,B.bl.y+=D,B.br.x+=D,B.br.y+=A),B},calcOCoords:function(){var a=this._calcRotateMatrix(),n=this._calcTranslateMatrix(),f=this.getViewportTransform(),_=p(f,n),h=p(_,a),h=p(h,[1/f[0],0,0,1/f[3],0,0]),E=this._calculateCurrentDimensions(),w={};return this.forEachControl(function(A,D,z){w[D]=A.positionHandler(E,h,z)}),w},calcACoords:function(){var a=this._calcRotateMatrix(),n=this._calcTranslateMatrix(),f=p(n,a),_=this._getTransformedDimensions(),h=_.x/2,E=_.y/2;return{tl:i({x:-h,y:-E},f),tr:i({x:h,y:-E},f),bl:i({x:-h,y:E},f),br:i({x:h,y:E},f)}},setCoords:function(a){return this.aCoords=this.calcACoords(),this.lineCoords=this.group?this.aCoords:this.calcLineCoords(),a?this:(this.oCoords=this.calcOCoords(),this._setCornerCoords&&this._setCornerCoords(),this)},_calcRotateMatrix:function(){return r.calcRotateMatrix(this)},_calcTranslateMatrix:function(){var a=this.getCenterPoint();return[1,0,0,1,a.x,a.y]},transformMatrixKey:function(a){var n="_",f="";return!a&&this.group&&(f=this.group.transformMatrixKey(a)+n),f+this.top+n+this.left+n+this.scaleX+n+this.scaleY+n+this.skewX+n+this.skewY+n+this.angle+n+this.originX+n+this.originY+n+this.width+n+this.height+n+this.strokeWidth+this.flipX+this.flipY},calcTransformMatrix:function(a){var n=this.calcOwnMatrix();if(a||!this.group)return n;var f=this.transformMatrixKey(a),_=this.matrixCache||(this.matrixCache={});return _.key===f?_.value:(this.group&&(n=p(this.group.calcTransformMatrix(!1),n)),_.key=f,_.value=n,n)},calcOwnMatrix:function(){var a=this.transformMatrixKey(!0),n=this.ownMatrixCache||(this.ownMatrixCache={});if(n.key===a)return n.value;var f=this._calcTranslateMatrix(),_={angle:this.angle,translateX:f[4],translateY:f[5],scaleX:this.scaleX,scaleY:this.scaleY,skewX:this.skewX,skewY:this.skewY,flipX:this.flipX,flipY:this.flipY};return n.key=a,n.value=r.composeMatrix(_),n.value},_calcDimensionsTransformMatrix:function(a,n,f){return r.calcDimensionsMatrix({skewX:a,skewY:n,scaleX:this.scaleX*(f&&this.flipX?-1:1),scaleY:this.scaleY*(f&&this.flipY?-1:1)})},_getNonTransformedDimensions:function(){var a=this.strokeWidth,n=this.width+a,f=this.height+a;return{x:n,y:f}},_getTransformedDimensions:function(a,n){typeof a=="undefined"&&(a=this.skewX),typeof n=="undefined"&&(n=this.skewY);var f,_,h,E=a===0&&n===0;if(this.strokeUniform?(_=this.width,h=this.height):(f=this._getNonTransformedDimensions(),_=f.x,h=f.y),E)return this._finalizeDimensions(_*this.scaleX,h*this.scaleY);var w=r.sizeAfterTransform(_,h,{scaleX:this.scaleX,scaleY:this.scaleY,skewX:a,skewY:n});return this._finalizeDimensions(w.x,w.y)},_finalizeDimensions:function(a,n){return this.strokeUniform?{x:a+this.strokeWidth,y:n+this.strokeWidth}:{x:a,y:n}},_calculateCurrentDimensions:function(){var a=this.getViewportTransform(),n=this._getTransformedDimensions(),f=i(n,a,!0);return f.scalarAdd(2*this.padding)}})}(),c.util.object.extend(c.Object.prototype,{sendToBack:function(){return this.group?c.StaticCanvas.prototype.sendToBack.call(this.group,this):this.canvas&&this.canvas.sendToBack(this),this},bringToFront:function(){return this.group?c.StaticCanvas.prototype.bringToFront.call(this.group,this):this.canvas&&this.canvas.bringToFront(this),this},sendBackwards:function(b){return this.group?c.StaticCanvas.prototype.sendBackwards.call(this.group,this,b):this.canvas&&this.canvas.sendBackwards(this,b),this},bringForward:function(b){return this.group?c.StaticCanvas.prototype.bringForward.call(this.group,this,b):this.canvas&&this.canvas.bringForward(this,b),this},moveTo:function(b){return this.group&&this.group.type!=="activeSelection"?c.StaticCanvas.prototype.moveTo.call(this.group,this,b):this.canvas&&this.canvas.moveTo(this,b),this}}),function(){function b(m,p){if(p){if(p.toLive)return m+": url(#SVGID_"+p.id+"); ";var i=new c.Color(p),a=m+": "+i.toRgb()+"; ",n=i.getAlpha();return n!==1&&(a+=m+"-opacity: "+n.toString()+"; "),a}else return m+": none; "}e(b,"getSvgColorString");var r=c.util.toFixed;c.util.object.extend(c.Object.prototype,{getSvgStyles:function(m){var p=this.fillRule?this.fillRule:"nonzero",i=this.strokeWidth?this.strokeWidth:"0",a=this.strokeDashArray?this.strokeDashArray.join(" "):"none",n=this.strokeDashOffset?this.strokeDashOffset:"0",f=this.strokeLineCap?this.strokeLineCap:"butt",_=this.strokeLineJoin?this.strokeLineJoin:"miter",h=this.strokeMiterLimit?this.strokeMiterLimit:"4",E=typeof this.opacity!="undefined"?this.opacity:"1",w=this.visible?"":" visibility: hidden;",A=m?"":this.getSvgFilter(),D=b("fill",this.fill),z=b("stroke",this.stroke);return[z,"stroke-width: ",i,"; ","stroke-dasharray: ",a,"; ","stroke-linecap: ",f,"; ","stroke-dashoffset: ",n,"; ","stroke-linejoin: ",_,"; ","stroke-miterlimit: ",h,"; ",D,"fill-rule: ",p,"; ","opacity: ",E,";",A,w].join("")},getSvgSpanStyles:function(m,p){var i="; ",n=m.fontFamily?"font-family: "+(m.fontFamily.indexOf("'")===-1&&m.fontFamily.indexOf('"')===-1?"'"+m.fontFamily+"'":m.fontFamily)+i:"",a=m.strokeWidth?"stroke-width: "+m.strokeWidth+i:"",n=n,f=m.fontSize?"font-size: "+m.fontSize+"px"+i:"",_=m.fontStyle?"font-style: "+m.fontStyle+i:"",h=m.fontWeight?"font-weight: "+m.fontWeight+i:"",E=m.fill?b("fill",m.fill):"",w=m.stroke?b("stroke",m.stroke):"",A=this.getSvgTextDecoration(m),D=m.deltaY?"baseline-shift: "+-m.deltaY+"; ":"";return A&&(A="text-decoration: "+A+i),[w,a,n,f,_,h,A,E,D,p?"white-space: pre; ":""].join("")},getSvgTextDecoration:function(m){return["overline","underline","line-through"].filter(function(p){return m[p.replace("-","")]}).join(" ")},getSvgFilter:function(){return this.shadow?"filter: url(#SVGID_"+this.shadow.id+");":""},getSvgCommons:function(){return[this.id?'id="'+this.id+'" ':"",this.clipPath?'clip-path="url(#'+this.clipPath.clipPathId+')" ':""].join("")},getSvgTransform:function(m,p){var i=m?this.calcTransformMatrix():this.calcOwnMatrix(),a='transform="'+c.util.matrixToSVG(i);return a+(p||"")+'" '},_setSVGBg:function(m){if(this.backgroundColor){var p=c.Object.NUM_FRACTION_DIGITS;m.push(" <rect ",this._getFillAttributes(this.backgroundColor),' x="',r(-this.width/2,p),'" y="',r(-this.height/2,p),'" width="',r(this.width,p),'" height="',r(this.height,p),`"></rect>`)}},toSVG:function(m){return this._createBaseSVGMarkup(this._toSVG(m),{reviver:m})},toClipPathSVG:function(m){return" "+this._createBaseClipPathSVGMarkup(this._toSVG(m),{reviver:m})},_createBaseClipPathSVGMarkup:function(m,p){p=p||{};var i=p.reviver,a=p.additionalTransform||"",n=[this.getSvgTransform(!0,a),this.getSvgCommons()].join(""),f=m.indexOf("COMMON_PARTS");return m[f]=n,i?i(m.join("")):m.join("")},_createBaseSVGMarkup:function(m,p){p=p||{};var i=p.noStyle,a=p.reviver,n=i?"":'style="'+this.getSvgStyles()+'" ',f=p.withShadow?'style="'+this.getSvgFilter()+'" ':"",_=this.clipPath,h=this.strokeUniform?'vector-effect="non-scaling-stroke" ':"",E=_&&_.absolutePositioned,w=this.stroke,A=this.fill,D=this.shadow,z,B=[],Y,H=m.indexOf("COMMON_PARTS"),V=p.additionalTransform;return _&&(_.clipPathId="CLIPPATH_"+c.Object.__uid++,Y='<clipPath id="'+_.clipPathId+`" > `+_.toClipPathSVG(a)+`</clipPath>`),E&&B.push("<g ",f,this.getSvgCommons(),` > `),B.push("<g ",this.getSvgTransform(!1),E?"":f+this.getSvgCommons(),` > `),z=[n,h,i?"":this.addPaintOrder()," ",V?'transform="'+V+'" ':""].join(""),m[H]=z,A&&A.toLive&&B.push(A.toSVG(this)),w&&w.toLive&&B.push(w.toSVG(this)),D&&B.push(D.toSVG(this)),_&&B.push(Y),B.push(m.join("")),B.push(`</g>`),E&&B.push(`</g>`),a?a(B.join("")):B.join("")},addPaintOrder:function(){return this.paintFirst!=="fill"?' paint-order="'+this.paintFirst+'" ':""}})}(),function(){var b=c.util.object.extend,r="stateProperties";function m(i,a,n){var f={},_=!0;n.forEach(function(h){f[h]=i[h]}),b(i[a],f,_)}e(m,"saveProps");function p(i,a,n){if(i===a)return!0;if(Array.isArray(i)){if(!Array.isArray(a)||i.length!==a.length)return!1;for(var f=0,_=i.length;f<_;f++)if(!p(i[f],a[f]))return!1;return!0}else if(i&&typeof i=="object"){var h=Object.keys(i),E;if(!a||typeof a!="object"||!n&&h.length!==Object.keys(a).length)return!1;for(var f=0,_=h.length;f<_;f++)if(E=h[f],!(E==="canvas"||E==="group")&&!p(i[E],a[E]))return!1;return!0}}e(p,"_isEqual"),c.util.object.extend(c.Object.prototype,{hasStateChanged:function(i){i=i||r;var a="_"+i;return Object.keys(this[a]).length<this[i].length?!0:!p(this[a],this,!0)},saveState:function(i){var a=i&&i.propertySet||r,n="_"+a;return this[n]?(m(this,n,this[a]),i&&i.stateProperties&&m(this,n,i.stateProperties),this):this.setupState(i)},setupState:function(i){i=i||{};var a=i.propertySet||r;return i.propertySet=a,this["_"+a]={},this.saveState(i),this}})}(),function(){var b=c.util.degreesToRadians;c.util.object.extend(c.Object.prototype,{_findTargetCorner:function(r,m){if(!this.hasControls||this.group||!this.canvas||this.canvas._activeObject!==this)return!1;var p=r.x,i=r.y,a,n,f=Object.keys(this.oCoords),_=f.length-1,h;for(this.__corner=0;_>=0;_--)if(h=f[_],!!this.isControlVisible(h)&&(n=this._getImageLines(m?this.oCoords[h].touchCorner:this.oCoords[h].corner),a=this._findCrossPoints({x:p,y:i},n),a!==0&&a%2===1))return this.__corner=h,h;return!1},forEachControl:function(r){for(var m in this.controls)r(this.controls[m],m,this)},_setCornerCoords:function(){var r=this.oCoords;for(var m in r){var p=this.controls[m];r[m].corner=p.calcCornerCoords(this.angle,this.cornerSize,r[m].x,r[m].y,!1),r[m].touchCorner=p.calcCornerCoords(this.angle,this.touchCornerSize,r[m].x,r[m].y,!0)}},drawSelectionBackground:function(r){if(!this.selectionBackgroundColor||this.canvas&&!this.canvas.interactive||this.canvas&&this.canvas._activeObject!==this)return this;r.save();var m=this.getCenterPoint(),p=this._calculateCurrentDimensions(),i=this.canvas.viewportTransform;return r.translate(m.x,m.y),r.scale(1/i[0],1/i[3]),r.rotate(b(this.angle)),r.fillStyle=this.selectionBackgroundColor,r.fillRect(-p.x/2,-p.y/2,p.x,p.y),r.restore(),this},drawBorders:function(r,m){m=m||{};var p=this._calculateCurrentDimensions(),i=this.borderScaleFactor,a=p.x+i,n=p.y+i,f=typeof m.hasControls!="undefined"?m.hasControls:this.hasControls,_=!1;return r.save(),r.strokeStyle=m.borderColor||this.borderColor,this._setLineDash(r,m.borderDashArray||this.borderDashArray),r.strokeRect(-a/2,-n/2,a,n),f&&(r.beginPath(),this.forEachControl(function(h,E,w){h.withConnection&&h.getVisibility(w,E)&&(_=!0,r.moveTo(h.x*a,h.y*n),r.lineTo(h.x*a+h.offsetX,h.y*n+h.offsetY))}),_&&r.stroke()),r.restore(),this},drawBordersInGroup:function(r,m,p){p=p||{};var i=c.util.sizeAfterTransform(this.width,this.height,m),a=this.strokeWidth,n=this.strokeUniform,f=this.borderScaleFactor,_=i.x+a*(n?this.canvas.getZoom():m.scaleX)+f,h=i.y+a*(n?this.canvas.getZoom():m.scaleY)+f;return r.save(),this._setLineDash(r,p.borderDashArray||this.borderDashArray),r.strokeStyle=p.borderColor||this.borderColor,r.strokeRect(-_/2,-h/2,_,h),r.restore(),this},drawControls:function(r,m){m=m||{},r.save();var p=this.canvas.getRetinaScaling(),i,a;return r.setTransform(p,0,0,p,0,0),r.strokeStyle=r.fillStyle=m.cornerColor||this.cornerColor,this.transparentCorners||(r.strokeStyle=m.cornerStrokeColor||this.cornerStrokeColor),this._setLineDash(r,m.cornerDashArray||this.cornerDashArray),this.setCoords(),this.group&&(i=this.group.calcTransformMatrix()),this.forEachControl(function(n,f,_){a=_.oCoords[f],n.getVisibility(_,f)&&(i&&(a=c.util.transformPoint(a,i)),n.render(r,a.x,a.y,m,_))}),r.restore(),this},isControlVisible:function(r){return this.controls[r]&&this.controls[r].getVisibility(this,r)},setControlVisible:function(r,m){return this._controlsVisibility||(this._controlsVisibility={}),this._controlsVisibility[r]=m,this},setControlsVisibility:function(r){r||(r={});for(var m in r)this.setControlVisible(m,r[m]);return this},onDeselect:function(){},onSelect:function(){}})}(),c.util.object.extend(c.StaticCanvas.prototype,{FX_DURATION:500,fxCenterObjectH:function(b,r){r=r||{};var m=e(function(){},"empty"),p=r.onComplete||m,i=r.onChange||m,a=this;return c.util.animate({startValue:b.left,endValue:this.getCenter().left,duration:this.FX_DURATION,onChange:function(n){b.set("left",n),a.requestRenderAll(),i()},onComplete:function(){b.setCoords(),p()}}),this},fxCenterObjectV:function(b,r){r=r||{};var m=e(function(){},"empty"),p=r.onComplete||m,i=r.onChange||m,a=this;return c.util.animate({startValue:b.top,endValue:this.getCenter().top,duration:this.FX_DURATION,onChange:function(n){b.set("top",n),a.requestRenderAll(),i()},onComplete:function(){b.setCoords(),p()}}),this},fxRemove:function(b,r){r=r||{};var m=e(function(){},"empty"),p=r.onComplete||m,i=r.onChange||m,a=this;return c.util.animate({startValue:b.opacity,endValue:0,duration:this.FX_DURATION,onChange:function(n){b.set("opacity",n),a.requestRenderAll(),i()},onComplete:function(){a.remove(b),p()}}),this}}),c.util.object.extend(c.Object.prototype,{animate:function(){if(arguments[0]&&typeof arguments[0]=="object"){var b=[],r,m;for(r in arguments[0])b.push(r);for(var p=0,i=b.length;p<i;p++)r=b[p],m=p!==i-1,this._animate(r,arguments[0][r],arguments[1],m)}else this._animate.apply(this,arguments);return this},_animate:function(b,r,m,p){var i=this,a;r=r.toString(),m?m=c.util.object.clone(m):m={},~b.indexOf(".")&&(a=b.split("."));var n=i.colorProperties.indexOf(b)>-1||a&&i.colorProperties.indexOf(a[1])>-1,f=a?this.get(a[0])[a[1]]:this.get(b);"from"in m||(m.from=f),n||(~r.indexOf("=")?r=f+parseFloat(r.replace("=","")):r=parseFloat(r));var _={startValue:m.from,endValue:r,byValue:m.by,easing:m.easing,duration:m.duration,abort:m.abort&&function(h,E,w){return m.abort.call(i,h,E,w)},onChange:function(h,E,w){a?i[a[0]][a[1]]=h:i.set(b,h),!p&&m.onChange&&m.onChange(h,E,w)},onComplete:function(h,E,w){p||(i.setCoords(),m.onComplete&&m.onComplete(h,E,w))}};return n?c.util.animateColor(_.startValue,_.endValue,_.duration,_):c.util.animate(_)}}),function(b){"use strict";var r=b.fabric||(b.fabric={}),m=r.util.object.extend,p=r.util.object.clone,i={x1:1,x2:1,y1:1,y2:1};if(r.Line){r.warn("fabric.Line is already defined");return}r.Line=r.util.createClass(r.Object,{type:"line",x1:0,y1:0,x2:0,y2:0,cacheProperties:r.Object.prototype.cacheProperties.concat("x1","x2","y1","y2"),initialize:function(n,f){n||(n=[0,0,0,0]),this.callSuper("initialize",f),this.set("x1",n[0]),this.set("y1",n[1]),this.set("x2",n[2]),this.set("y2",n[3]),this._setWidthHeight(f)},_setWidthHeight:function(n){n||(n={}),this.width=Math.abs(this.x2-this.x1),this.height=Math.abs(this.y2-this.y1),this.left="left"in n?n.left:this._getLeftToOriginX(),this.top="top"in n?n.top:this._getTopToOriginY()},_set:function(n,f){return this.callSuper("_set",n,f),typeof i[n]!="undefined"&&this._setWidthHeight(),this},_getLeftToOriginX:a({origin:"originX",axis1:"x1",axis2:"x2",dimension:"width"},{nearest:"left",center:"center",farthest:"right"}),_getTopToOriginY:a({origin:"originY",axis1:"y1",axis2:"y2",dimension:"height"},{nearest:"top",center:"center",farthest:"bottom"}),_render:function(n){n.beginPath();var f=this.calcLinePoints();n.moveTo(f.x1,f.y1),n.lineTo(f.x2,f.y2),n.lineWidth=this.strokeWidth;var _=n.strokeStyle;n.strokeStyle=this.stroke||n.fillStyle,this.stroke&&this._renderStroke(n),n.strokeStyle=_},_findCenterFromElement:function(){return{x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2}},toObject:function(n){return m(this.callSuper("toObject",n),this.calcLinePoints())},_getNonTransformedDimensions:function(){var n=this.callSuper("_getNonTransformedDimensions");return this.strokeLineCap==="butt"&&(this.width===0&&(n.y-=this.strokeWidth),this.height===0&&(n.x-=this.strokeWidth)),n},calcLinePoints:function(){var n=this.x1<=this.x2?-1:1,f=this.y1<=this.y2?-1:1,_=n*this.width*.5,h=f*this.height*.5,E=n*this.width*-.5,w=f*this.height*-.5;return{x1:_,x2:E,y1:h,y2:w}},_toSVG:function(){var n=this.calcLinePoints();return["<line ","COMMON_PARTS",'x1="',n.x1,'" y1="',n.y1,'" x2="',n.x2,'" y2="',n.y2,`" /> `]}}),r.Line.ATTRIBUTE_NAMES=r.SHARED_ATTRIBUTES.concat("x1 y1 x2 y2".split(" ")),r.Line.fromElement=function(n,f,_){_=_||{};var h=r.parseAttributes(n,r.Line.ATTRIBUTE_NAMES),E=[h.x1||0,h.y1||0,h.x2||0,h.y2||0];f(new r.Line(E,m(h,_)))},r.Line.fromObject=function(n,f){function _(E){delete E.points,f&&f(E)}e(_,"_callback");var h=p(n,!0);h.points=[n.x1,n.y1,n.x2,n.y2],r.Object._fromObject("Line",h,_,"points")};function a(n,f){var _=n.origin,h=n.axis1,E=n.axis2,w=n.dimension,A=f.nearest,D=f.center,z=f.farthest;return function(){switch(this.get(_)){case A:return Math.min(this.get(h),this.get(E));case D:return Math.min(this.get(h),this.get(E))+.5*this.get(w);case z:return Math.max(this.get(h),this.get(E))}}}e(a,"makeEdgeToOriginGetter")}(I),function(b){"use strict";var r=b.fabric||(b.fabric={}),m=Math.PI;if(r.Circle){r.warn("fabric.Circle is already defined.");return}r.Circle=r.util.createClass(r.Object,{type:"circle",radius:0,startAngle:0,endAngle:m*2,cacheProperties:r.Object.prototype.cacheProperties.concat("radius","startAngle","endAngle"),_set:function(i,a){return this.callSuper("_set",i,a),i==="radius"&&this.setRadius(a),this},toObject:function(i){return this.callSuper("toObject",["radius","startAngle","endAngle"].concat(i))},_toSVG:function(){var i,a=0,n=0,f=(this.endAngle-this.startAngle)%(2*m);if(f===0)i=["<circle ","COMMON_PARTS",'cx="'+a+'" cy="'+n+'" ','r="',this.radius,`" />
|
|
11
|
-
`];else{var _=r.util.cos(this.startAngle)*this.radius,h=r.util.sin(this.startAngle)*this.radius,E=r.util.cos(this.endAngle)*this.radius,w=r.util.sin(this.endAngle)*this.radius,A=f>m?"1":"0";i=['<path d="M '+_+" "+h," A "+this.radius+" "+this.radius," 0 ",+A+" 1"," "+E+" "+w,'" ',"COMMON_PARTS",` /> `]}return i},_render:function(i){i.beginPath(),i.arc(0,0,this.radius,this.startAngle,this.endAngle,!1),this._renderPaintInOrder(i)},getRadiusX:function(){return this.get("radius")*this.get("scaleX")},getRadiusY:function(){return this.get("radius")*this.get("scaleY")},setRadius:function(i){return this.radius=i,this.set("width",i*2).set("height",i*2)}}),r.Circle.ATTRIBUTE_NAMES=r.SHARED_ATTRIBUTES.concat("cx cy r".split(" ")),r.Circle.fromElement=function(i,a){var n=r.parseAttributes(i,r.Circle.ATTRIBUTE_NAMES);if(!p(n))throw new Error("value of `r`attribute is required and can not be negative");n.left=(n.left||0)-n.radius,n.top=(n.top||0)-n.radius,a(new r.Circle(n))};function p(i){return"radius"in i&&i.radius>=0}e(p,"isValidRadius"),r.Circle.fromObject=function(i,a){r.Object._fromObject("Circle",i,a)}}(I),function(b){"use strict";var r=b.fabric||(b.fabric={});if(r.Triangle){r.warn("fabric.Triangle is already defined");return}r.Triangle=r.util.createClass(r.Object,{type:"triangle",width:100,height:100,_render:function(m){var p=this.width/2,i=this.height/2;m.beginPath(),m.moveTo(-p,i),m.lineTo(0,-i),m.lineTo(p,i),m.closePath(),this._renderPaintInOrder(m)},_toSVG:function(){var m=this.width/2,p=this.height/2,i=[-m+" "+p,"0 "+-p,m+" "+p].join(",");return["<polygon ","COMMON_PARTS",'points="',i,'" />']}}),r.Triangle.fromObject=function(m,p){return r.Object._fromObject("Triangle",m,p)}}(I),function(b){"use strict";var r=b.fabric||(b.fabric={}),m=Math.PI*2;if(r.Ellipse){r.warn("fabric.Ellipse is already defined.");return}r.Ellipse=r.util.createClass(r.Object,{type:"ellipse",rx:0,ry:0,cacheProperties:r.Object.prototype.cacheProperties.concat("rx","ry"),initialize:function(p){this.callSuper("initialize",p),this.set("rx",p&&p.rx||0),this.set("ry",p&&p.ry||0)},_set:function(p,i){switch(this.callSuper("_set",p,i),p){case"rx":this.rx=i,this.set("width",i*2);break;case"ry":this.ry=i,this.set("height",i*2);break}return this},getRx:function(){return this.get("rx")*this.get("scaleX")},getRy:function(){return this.get("ry")*this.get("scaleY")},toObject:function(p){return this.callSuper("toObject",["rx","ry"].concat(p))},_toSVG:function(){return["<ellipse ","COMMON_PARTS",'cx="0" cy="0" ','rx="',this.rx,'" ry="',this.ry,`" /> `]},_render:function(p){p.beginPath(),p.save(),p.transform(1,0,0,this.ry/this.rx,0,0),p.arc(0,0,this.rx,0,m,!1),p.restore(),this._renderPaintInOrder(p)}}),r.Ellipse.ATTRIBUTE_NAMES=r.SHARED_ATTRIBUTES.concat("cx cy rx ry".split(" ")),r.Ellipse.fromElement=function(p,i){var a=r.parseAttributes(p,r.Ellipse.ATTRIBUTE_NAMES);a.left=(a.left||0)-a.rx,a.top=(a.top||0)-a.ry,i(new r.Ellipse(a))},r.Ellipse.fromObject=function(p,i){r.Object._fromObject("Ellipse",p,i)}}(I),function(b){"use strict";var r=b.fabric||(b.fabric={}),m=r.util.object.extend;if(r.Rect){r.warn("fabric.Rect is already defined");return}r.Rect=r.util.createClass(r.Object,{stateProperties:r.Object.prototype.stateProperties.concat("rx","ry"),type:"rect",rx:0,ry:0,cacheProperties:r.Object.prototype.cacheProperties.concat("rx","ry"),initialize:function(p){this.callSuper("initialize",p),this._initRxRy()},_initRxRy:function(){this.rx&&!this.ry?this.ry=this.rx:this.ry&&!this.rx&&(this.rx=this.ry)},_render:function(p){var i=this.rx?Math.min(this.rx,this.width/2):0,a=this.ry?Math.min(this.ry,this.height/2):0,n=this.width,f=this.height,_=-this.width/2,h=-this.height/2,E=i!==0||a!==0,w=1-.5522847498;p.beginPath(),p.moveTo(_+i,h),p.lineTo(_+n-i,h),E&&p.bezierCurveTo(_+n-w*i,h,_+n,h+w*a,_+n,h+a),p.lineTo(_+n,h+f-a),E&&p.bezierCurveTo(_+n,h+f-w*a,_+n-w*i,h+f,_+n-i,h+f),p.lineTo(_+i,h+f),E&&p.bezierCurveTo(_+w*i,h+f,_,h+f-w*a,_,h+f-a),p.lineTo(_,h+a),E&&p.bezierCurveTo(_,h+w*a,_+w*i,h,_+i,h),p.closePath(),this._renderPaintInOrder(p)},toObject:function(p){return this.callSuper("toObject",["rx","ry"].concat(p))},_toSVG:function(){var p=-this.width/2,i=-this.height/2;return["<rect ","COMMON_PARTS",'x="',p,'" y="',i,'" rx="',this.rx,'" ry="',this.ry,'" width="',this.width,'" height="',this.height,`" /> `]}}),r.Rect.ATTRIBUTE_NAMES=r.SHARED_ATTRIBUTES.concat("x y rx ry width height".split(" ")),r.Rect.fromElement=function(p,i,a){if(!p)return i(null);a=a||{};var n=r.parseAttributes(p,r.Rect.ATTRIBUTE_NAMES);n.left=n.left||0,n.top=n.top||0,n.height=n.height||0,n.width=n.width||0;var f=new r.Rect(m(a?r.util.object.clone(a):{},n));f.visible=f.visible&&f.width>0&&f.height>0,i(f)},r.Rect.fromObject=function(p,i){return r.Object._fromObject("Rect",p,i)}}(I),function(b){"use strict";var r=b.fabric||(b.fabric={}),m=r.util.object.extend,p=r.util.array.min,i=r.util.array.max,a=r.util.toFixed;if(r.Polyline){r.warn("fabric.Polyline is already defined");return}r.Polyline=r.util.createClass(r.Object,{type:"polyline",points:null,cacheProperties:r.Object.prototype.cacheProperties.concat("points"),initialize:function(n,f){f=f||{},this.points=n||[],this.callSuper("initialize",f),this._setPositionDimensions(f)},_setPositionDimensions:function(n){var f=this._calcDimensions(n),_;this.width=f.width,this.height=f.height,n.fromSVG||(_=this.translateToGivenOrigin({x:f.left-this.strokeWidth/2,y:f.top-this.strokeWidth/2},"left","top",this.originX,this.originY)),typeof n.left=="undefined"&&(this.left=n.fromSVG?f.left:_.x),typeof n.top=="undefined"&&(this.top=n.fromSVG?f.top:_.y),this.pathOffset={x:f.left+this.width/2,y:f.top+this.height/2}},_calcDimensions:function(){var n=this.points,f=p(n,"x")||0,_=p(n,"y")||0,h=i(n,"x")||0,E=i(n,"y")||0,w=h-f,A=E-_;return{left:f,top:_,width:w,height:A}},toObject:function(n){return m(this.callSuper("toObject",n),{points:this.points.concat()})},_toSVG:function(){for(var n=[],f=this.pathOffset.x,_=this.pathOffset.y,h=r.Object.NUM_FRACTION_DIGITS,E=0,w=this.points.length;E<w;E++)n.push(a(this.points[E].x-f,h),",",a(this.points[E].y-_,h)," ");return["<"+this.type+" ","COMMON_PARTS",'points="',n.join(""),`" /> `]},commonRender:function(n){var f,_=this.points.length,h=this.pathOffset.x,E=this.pathOffset.y;if(!_||isNaN(this.points[_-1].y))return!1;n.beginPath(),n.moveTo(this.points[0].x-h,this.points[0].y-E);for(var w=0;w<_;w++)f=this.points[w],n.lineTo(f.x-h,f.y-E);return!0},_render:function(n){this.commonRender(n)&&this._renderPaintInOrder(n)},complexity:function(){return this.get("points").length}}),r.Polyline.ATTRIBUTE_NAMES=r.SHARED_ATTRIBUTES.concat(),r.Polyline.fromElementGenerator=function(n){return function(f,_,h){if(!f)return _(null);h||(h={});var E=r.parsePointsAttribute(f.getAttribute("points")),w=r.parseAttributes(f,r[n].ATTRIBUTE_NAMES);w.fromSVG=!0,_(new r[n](E,m(w,h)))}},r.Polyline.fromElement=r.Polyline.fromElementGenerator("Polyline"),r.Polyline.fromObject=function(n,f){return r.Object._fromObject("Polyline",n,f,"points")}}(I),function(b){"use strict";var r=b.fabric||(b.fabric={});if(r.Polygon){r.warn("fabric.Polygon is already defined");return}r.Polygon=r.util.createClass(r.Polyline,{type:"polygon",_render:function(m){this.commonRender(m)&&(m.closePath(),this._renderPaintInOrder(m))}}),r.Polygon.ATTRIBUTE_NAMES=r.SHARED_ATTRIBUTES.concat(),r.Polygon.fromElement=r.Polyline.fromElementGenerator("Polygon"),r.Polygon.fromObject=function(m,p){r.Object._fromObject("Polygon",m,p,"points")}}(I),function(b){"use strict";var r=b.fabric||(b.fabric={}),m=r.util.array.min,p=r.util.array.max,i=r.util.object.extend,a=Object.prototype.toString,n=r.util.toFixed;if(r.Path){r.warn("fabric.Path is already defined");return}r.Path=r.util.createClass(r.Object,{type:"path",path:null,cacheProperties:r.Object.prototype.cacheProperties.concat("path","fillRule"),stateProperties:r.Object.prototype.stateProperties.concat("path"),initialize:function(f,_){_=_||{},this.callSuper("initialize",_),f||(f=[]);var h=a.call(f)==="[object Array]";this.path=r.util.makePathSimpler(h?f:r.util.parsePath(f)),this.path&&r.Polyline.prototype._setPositionDimensions.call(this,_)},_renderPathCommands:function(f){var _,h=0,E=0,w=0,A=0,D=0,z=0,B=-this.pathOffset.x,Y=-this.pathOffset.y;f.beginPath();for(var H=0,V=this.path.length;H<V;++H)switch(_=this.path[H],_[0]){case"L":w=_[1],A=_[2],f.lineTo(w+B,A+Y);break;case"M":w=_[1],A=_[2],h=w,E=A,f.moveTo(w+B,A+Y);break;case"C":w=_[5],A=_[6],D=_[3],z=_[4],f.bezierCurveTo(_[1]+B,_[2]+Y,D+B,z+Y,w+B,A+Y);break;case"Q":f.quadraticCurveTo(_[1]+B,_[2]+Y,_[3]+B,_[4]+Y),w=_[3],A=_[4],D=_[1],z=_[2];break;case"z":case"Z":w=h,A=E,f.closePath();break}},_render:function(f){this._renderPathCommands(f),this._renderPaintInOrder(f)},toString:function(){return"#<fabric.Path ("+this.complexity()+'): { "top": '+this.top+', "left": '+this.left+" }>"},toObject:function(f){return i(this.callSuper("toObject",f),{path:this.path.map(function(_){return _.slice()})})},toDatalessObject:function(f){var _=this.toObject(["sourcePath"].concat(f));return _.sourcePath&&delete _.path,_},_toSVG:function(){var f=r.util.joinPath(this.path);return["<path ","COMMON_PARTS",'d="',f,'" stroke-linecap="round" ',`/> `]},_getOffsetTransform:function(){var f=r.Object.NUM_FRACTION_DIGITS;return" translate("+n(-this.pathOffset.x,f)+", "+n(-this.pathOffset.y,f)+")"},toClipPathSVG:function(f){var _=this._getOffsetTransform();return" "+this._createBaseClipPathSVGMarkup(this._toSVG(),{reviver:f,additionalTransform:_})},toSVG:function(f){var _=this._getOffsetTransform();return this._createBaseSVGMarkup(this._toSVG(),{reviver:f,additionalTransform:_})},complexity:function(){return this.path.length},_calcDimensions:function(){for(var f=[],_=[],h,E=0,w=0,A=0,D=0,z,B=0,Y=this.path.length;B<Y;++B){switch(h=this.path[B],h[0]){case"L":A=h[1],D=h[2],z=[];break;case"M":A=h[1],D=h[2],E=A,w=D,z=[];break;case"C":z=r.util.getBoundsOfCurve(A,D,h[1],h[2],h[3],h[4],h[5],h[6]),A=h[5],D=h[6];break;case"Q":z=r.util.getBoundsOfCurve(A,D,h[1],h[2],h[1],h[2],h[3],h[4]),A=h[3],D=h[4];break;case"z":case"Z":A=E,D=w;break}z.forEach(function(_t){f.push(_t.x),_.push(_t.y)}),f.push(A),_.push(D)}var H=m(f)||0,V=m(_)||0,lt=p(f)||0,rt=p(_)||0,St=lt-H,q=rt-V;return{left:H,top:V,width:St,height:q}}}),r.Path.fromObject=function(f,_){if(typeof f.sourcePath=="string"){var h=f.sourcePath;r.loadSVGFromURL(h,function(E){var w=E[0];w.setOptions(f),_&&_(w)})}else r.Object._fromObject("Path",f,_,"path")},r.Path.ATTRIBUTE_NAMES=r.SHARED_ATTRIBUTES.concat(["d"]),r.Path.fromElement=function(f,_,h){var E=r.parseAttributes(f,r.Path.ATTRIBUTE_NAMES);E.fromSVG=!0,_(new r.Path(E.d,i(E,h)))}}(I),function(b){"use strict";var r=b.fabric||(b.fabric={}),m=r.util.array.min,p=r.util.array.max;r.Group||(r.Group=r.util.createClass(r.Object,r.Collection,{type:"group",strokeWidth:0,subTargetCheck:!1,cacheProperties:[],useSetOnGroup:!1,initialize:function(i,a,n){a=a||{},this._objects=[],n&&this.callSuper("initialize",a),this._objects=i||[];for(var f=this._objects.length;f--;)this._objects[f].group=this;if(n)this._updateObjectsACoords();else{var _=a&&a.centerPoint;a.originX!==void 0&&(this.originX=a.originX),a.originY!==void 0&&(this.originY=a.originY),_||this._calcBounds(),this._updateObjectsCoords(_),delete a.centerPoint,this.callSuper("initialize",a)}this.setCoords()},_updateObjectsACoords:function(){for(var i=!0,a=this._objects.length;a--;)this._objects[a].setCoords(i)},_updateObjectsCoords:function(a){for(var a=a||this.getCenterPoint(),n=this._objects.length;n--;)this._updateObjectCoords(this._objects[n],a)},_updateObjectCoords:function(i,a){var n=i.left,f=i.top,_=!0;i.set({left:n-a.x,top:f-a.y}),i.group=this,i.setCoords(_)},toString:function(){return"#<fabric.Group: ("+this.complexity()+")>"},addWithUpdate:function(i){var a=!!this.group;return this._restoreObjectsState(),r.util.resetObjectTransform(this),i&&(a&&r.util.removeTransformFromObject(i,this.group.calcTransformMatrix()),this._objects.push(i),i.group=this,i._set("canvas",this.canvas)),this._calcBounds(),this._updateObjectsCoords(),this.dirty=!0,a?this.group.addWithUpdate():this.setCoords(),this},removeWithUpdate:function(i){return this._restoreObjectsState(),r.util.resetObjectTransform(this),this.remove(i),this._calcBounds(),this._updateObjectsCoords(),this.setCoords(),this.dirty=!0,this},_onObjectAdded:function(i){this.dirty=!0,i.group=this,i._set("canvas",this.canvas)},_onObjectRemoved:function(i){this.dirty=!0,delete i.group},_set:function(i,a){var n=this._objects.length;if(this.useSetOnGroup)for(;n--;)this._objects[n].setOnGroup(i,a);if(i==="canvas")for(;n--;)this._objects[n]._set(i,a);r.Object.prototype._set.call(this,i,a)},toObject:function(i){var a=this.includeDefaultValues,n=this._objects.filter(function(_){return!_.excludeFromExport}).map(function(_){var h=_.includeDefaultValues;_.includeDefaultValues=a;var E=_.toObject(i);return _.includeDefaultValues=h,E}),f=r.Object.prototype.toObject.call(this,i);return f.objects=n,f},toDatalessObject:function(i){var a,n=this.sourcePath;if(n)a=n;else{var f=this.includeDefaultValues;a=this._objects.map(function(h){var E=h.includeDefaultValues;h.includeDefaultValues=f;var w=h.toDatalessObject(i);return h.includeDefaultValues=E,w})}var _=r.Object.prototype.toDatalessObject.call(this,i);return _.objects=a,_},render:function(i){this._transformDone=!0,this.callSuper("render",i),this._transformDone=!1},shouldCache:function(){var i=r.Object.prototype.shouldCache.call(this);if(i){for(var a=0,n=this._objects.length;a<n;a++)if(this._objects[a].willDrawShadow())return this.ownCaching=!1,!1}return i},willDrawShadow:function(){if(r.Object.prototype.willDrawShadow.call(this))return!0;for(var i=0,a=this._objects.length;i<a;i++)if(this._objects[i].willDrawShadow())return!0;return!1},isOnACache:function(){return this.ownCaching||this.group&&this.group.isOnACache()},drawObject:function(i){for(var a=0,n=this._objects.length;a<n;a++)this._objects[a].render(i);this._drawClipPath(i)},isCacheDirty:function(i){if(this.callSuper("isCacheDirty",i))return!0;if(!this.statefullCache)return!1;for(var a=0,n=this._objects.length;a<n;a++)if(this._objects[a].isCacheDirty(!0)){if(this._cacheCanvas){var f=this.cacheWidth/this.zoomX,_=this.cacheHeight/this.zoomY;this._cacheContext.clearRect(-f/2,-_/2,f,_)}return!0}return!1},_restoreObjectsState:function(){var i=this.calcOwnMatrix();return this._objects.forEach(function(a){r.util.addTransformToObject(a,i),delete a.group,a.setCoords()}),this},realizeTransform:function(i,a){return r.util.addTransformToObject(i,a),i},destroy:function(){return this._objects.forEach(function(i){i.set("dirty",!0)}),this._restoreObjectsState()},toActiveSelection:function(){if(this.canvas){var i=this._objects,a=this.canvas;this._objects=[];var n=this.toObject();delete n.objects;var f=new r.ActiveSelection([]);return f.set(n),f.type="activeSelection",a.remove(this),i.forEach(function(_){_.group=f,_.dirty=!0,a.add(_)}),f.canvas=a,f._objects=i,a._activeObject=f,f.setCoords(),f}},ungroupOnCanvas:function(){return this._restoreObjectsState()},setObjectsCoords:function(){var i=!0;return this.forEachObject(function(a){a.setCoords(i)}),this},_calcBounds:function(i){for(var a=[],n=[],f,_,h,E=["tr","br","bl","tl"],w=0,A=this._objects.length,D,z=E.length;w<A;++w){for(f=this._objects[w],h=f.calcACoords(),D=0;D<z;D++)_=E[D],a.push(h[_].x),n.push(h[_].y);f.aCoords=h}this._getBounds(a,n,i)},_getBounds:function(i,a,n){var f=new r.Point(m(i),m(a)),_=new r.Point(p(i),p(a)),h=f.y||0,E=f.x||0,w=_.x-f.x||0,A=_.y-f.y||0;this.width=w,this.height=A,n||this.setPositionByOrigin({x:E,y:h},"left","top")},_toSVG:function(i){for(var a=["<g ","COMMON_PARTS",` > `],n=0,f=this._objects.length;n<f;n++)a.push(" ",this._objects[n].toSVG(i));return a.push(`</g>`),a},getSvgStyles:function(){var i=typeof this.opacity!="undefined"&&this.opacity!==1?"opacity: "+this.opacity+";":"",a=this.visible?"":" visibility: hidden;";return[i,this.getSvgFilter(),a].join("")},toClipPathSVG:function(i){for(var a=[],n=0,f=this._objects.length;n<f;n++)a.push(" ",this._objects[n].toClipPathSVG(i));return this._createBaseClipPathSVGMarkup(a,{reviver:i})}}),r.Group.fromObject=function(i,a){var n=i.objects,f=r.util.object.clone(i,!0);if(delete f.objects,typeof n=="string"){r.loadSVGFromURL(n,function(_){var h=r.util.groupSVGElements(_,i,n);h.set(f),a&&a(h)});return}r.util.enlivenObjects(n,function(_){r.util.enlivenObjects([i.clipPath],function(h){var E=r.util.object.clone(i,!0);E.clipPath=h[0],delete E.objects,a&&a(new r.Group(_,E,!0))})})})}(I),function(b){"use strict";var r=b.fabric||(b.fabric={});r.ActiveSelection||(r.ActiveSelection=r.util.createClass(r.Group,{type:"activeSelection",initialize:function(m,p){p=p||{},this._objects=m||[];for(var i=this._objects.length;i--;)this._objects[i].group=this;p.originX&&(this.originX=p.originX),p.originY&&(this.originY=p.originY),this._calcBounds(),this._updateObjectsCoords(),r.Object.prototype.initialize.call(this,p),this.setCoords()},toGroup:function(){var m=this._objects.concat();this._objects=[];var p=r.Object.prototype.toObject.call(this),i=new r.Group([]);if(delete p.type,i.set(p),m.forEach(function(n){n.canvas.remove(n),n.group=i}),i._objects=m,!this.canvas)return i;var a=this.canvas;return a.add(i),a._activeObject=i,i.setCoords(),i},onDeselect:function(){return this.destroy(),!1},toString:function(){return"#<fabric.ActiveSelection: ("+this.complexity()+")>"},shouldCache:function(){return!1},isOnACache:function(){return!1},_renderControls:function(m,p,i){m.save(),m.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1,this.callSuper("_renderControls",m,p),i=i||{},typeof i.hasControls=="undefined"&&(i.hasControls=!1),i.forActiveSelection=!0;for(var a=0,n=this._objects.length;a<n;a++)this._objects[a]._renderControls(m,i);m.restore()}}),r.ActiveSelection.fromObject=function(m,p){r.util.enlivenObjects(m.objects,function(i){delete m.objects,p&&p(new r.ActiveSelection(i,m,!0))})})}(I),function(b){"use strict";var r=c.util.object.extend;if(b.fabric||(b.fabric={}),b.fabric.Image){c.warn("fabric.Image is already defined.");return}c.Image=c.util.createClass(c.Object,{type:"image",strokeWidth:0,srcFromAttribute:!1,_lastScaleX:1,_lastScaleY:1,_filterScalingX:1,_filterScalingY:1,minimumScaleTrigger:.5,stateProperties:c.Object.prototype.stateProperties.concat("cropX","cropY"),cacheProperties:c.Object.prototype.cacheProperties.concat("cropX","cropY"),cacheKey:"",cropX:0,cropY:0,imageSmoothing:!0,initialize:function(m,p){p||(p={}),this.filters=[],this.cacheKey="texture"+c.Object.__uid++,this.callSuper("initialize",p),this._initElement(m,p)},getElement:function(){return this._element||{}},setElement:function(m,p){return this.removeTexture(this.cacheKey),this.removeTexture(this.cacheKey+"_filtered"),this._element=m,this._originalElement=m,this._initConfig(p),this.filters.length!==0&&this.applyFilters(),this.resizeFilter&&this.applyResizeFilters(),this},removeTexture:function(m){var p=c.filterBackend;p&&p.evictCachesForKey&&p.evictCachesForKey(m)},dispose:function(){this.removeTexture(this.cacheKey),this.removeTexture(this.cacheKey+"_filtered"),this._cacheContext=void 0,["_originalElement","_element","_filteredEl","_cacheCanvas"].forEach(function(m){c.util.cleanUpJsdomNode(this[m]),this[m]=void 0}.bind(this))},getCrossOrigin:function(){return this._originalElement&&(this._originalElement.crossOrigin||null)},getOriginalSize:function(){var m=this.getElement();return{width:m.naturalWidth||m.width,height:m.naturalHeight||m.height}},_stroke:function(m){if(!(!this.stroke||this.strokeWidth===0)){var p=this.width/2,i=this.height/2;m.beginPath(),m.moveTo(-p,-i),m.lineTo(p,-i),m.lineTo(p,i),m.lineTo(-p,i),m.lineTo(-p,-i),m.closePath()}},toObject:function(m){var p=[];this.filters.forEach(function(a){a&&p.push(a.toObject())});var i=r(this.callSuper("toObject",["cropX","cropY"].concat(m)),{src:this.getSrc(),crossOrigin:this.getCrossOrigin(),filters:p});return this.resizeFilter&&(i.resizeFilter=this.resizeFilter.toObject()),i},hasCrop:function(){return this.cropX||this.cropY||this.width<this._element.width||this.height<this._element.height},_toSVG:function(){var m=[],p=[],i,a=this._element,n=-this.width/2,f=-this.height/2,_="",h="";if(!a)return[];if(this.hasCrop()){var E=c.Object.__uid++;m.push('<clipPath id="imageCrop_'+E+`">
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
uniform vec4 uConstants;
|
|
29
|
-
void main() {
|
|
30
|
-
vec4 color = texture2D(uTexture, vTexCoord);
|
|
31
|
-
color *= uColorMatrix;
|
|
32
|
-
color += uConstants;
|
|
33
|
-
gl_FragColor = color;
|
|
34
|
-
}`,matrix:[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],mainParameter:"matrix",colorsOnly:!0,initialize:function(i){this.callSuper("initialize",i),this.matrix=this.matrix.slice(0)},applyTo2d:function(i){var a=i.imageData,n=a.data,f=n.length,_=this.matrix,h,E,w,A,D,z=this.colorsOnly;for(D=0;D<f;D+=4)h=n[D],E=n[D+1],w=n[D+2],z?(n[D]=h*_[0]+E*_[1]+w*_[2]+_[4]*255,n[D+1]=h*_[5]+E*_[6]+w*_[7]+_[9]*255,n[D+2]=h*_[10]+E*_[11]+w*_[12]+_[14]*255):(A=n[D+3],n[D]=h*_[0]+E*_[1]+w*_[2]+A*_[3]+_[4]*255,n[D+1]=h*_[5]+E*_[6]+w*_[7]+A*_[8]+_[9]*255,n[D+2]=h*_[10]+E*_[11]+w*_[12]+A*_[13]+_[14]*255,n[D+3]=h*_[15]+E*_[16]+w*_[17]+A*_[18]+_[19]*255)},getUniformLocations:function(i,a){return{uColorMatrix:i.getUniformLocation(a,"uColorMatrix"),uConstants:i.getUniformLocation(a,"uConstants")}},sendUniformData:function(i,a){var n=this.matrix,f=[n[0],n[1],n[2],n[3],n[5],n[6],n[7],n[8],n[10],n[11],n[12],n[13],n[15],n[16],n[17],n[18]],_=[n[4],n[9],n[14],n[19]];i.uniformMatrix4fv(a.uColorMatrix,!1,f),i.uniform4fv(a.uConstants,_)}}),r.Image.filters.ColorMatrix.fromObject=r.Image.filters.BaseFilter.fromObject}(I),function(b){"use strict";var r=b.fabric||(b.fabric={}),m=r.Image.filters,p=r.util.createClass;m.Brightness=p(m.BaseFilter,{type:"Brightness",fragmentSource:`precision highp float;
|
|
35
|
-
uniform sampler2D uTexture;
|
|
36
|
-
uniform float uBrightness;
|
|
37
|
-
varying vec2 vTexCoord;
|
|
38
|
-
void main() {
|
|
39
|
-
vec4 color = texture2D(uTexture, vTexCoord);
|
|
40
|
-
color.rgb += uBrightness;
|
|
41
|
-
gl_FragColor = color;
|
|
42
|
-
}`,brightness:0,mainParameter:"brightness",applyTo2d:function(i){if(this.brightness!==0){var a=i.imageData,n=a.data,f,_=n.length,h=Math.round(this.brightness*255);for(f=0;f<_;f+=4)n[f]=n[f]+h,n[f+1]=n[f+1]+h,n[f+2]=n[f+2]+h}},getUniformLocations:function(i,a){return{uBrightness:i.getUniformLocation(a,"uBrightness")}},sendUniformData:function(i,a){i.uniform1f(a.uBrightness,this.brightness)}}),r.Image.filters.Brightness.fromObject=r.Image.filters.BaseFilter.fromObject}(I),function(b){"use strict";var r=b.fabric||(b.fabric={}),m=r.util.object.extend,p=r.Image.filters,i=r.util.createClass;p.Convolute=i(p.BaseFilter,{type:"Convolute",opaque:!1,matrix:[0,0,0,0,1,0,0,0,0],fragmentSource:{Convolute_3_1:`precision highp float;
|
|
43
|
-
uniform sampler2D uTexture;
|
|
44
|
-
uniform float uMatrix[9];
|
|
45
|
-
uniform float uStepW;
|
|
46
|
-
uniform float uStepH;
|
|
47
|
-
varying vec2 vTexCoord;
|
|
48
|
-
void main() {
|
|
49
|
-
vec4 color = vec4(0, 0, 0, 0);
|
|
50
|
-
for (float h = 0.0; h < 3.0; h+=1.0) {
|
|
51
|
-
for (float w = 0.0; w < 3.0; w+=1.0) {
|
|
52
|
-
vec2 matrixPos = vec2(uStepW * (w - 1), uStepH * (h - 1));
|
|
53
|
-
color += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 3.0 + w)];
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
gl_FragColor = color;
|
|
57
|
-
}`,Convolute_3_0:`precision highp float;
|
|
58
|
-
uniform sampler2D uTexture;
|
|
59
|
-
uniform float uMatrix[9];
|
|
60
|
-
uniform float uStepW;
|
|
61
|
-
uniform float uStepH;
|
|
62
|
-
varying vec2 vTexCoord;
|
|
63
|
-
void main() {
|
|
64
|
-
vec4 color = vec4(0, 0, 0, 1);
|
|
65
|
-
for (float h = 0.0; h < 3.0; h+=1.0) {
|
|
66
|
-
for (float w = 0.0; w < 3.0; w+=1.0) {
|
|
67
|
-
vec2 matrixPos = vec2(uStepW * (w - 1.0), uStepH * (h - 1.0));
|
|
68
|
-
color.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 3.0 + w)];
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
float alpha = texture2D(uTexture, vTexCoord).a;
|
|
72
|
-
gl_FragColor = color;
|
|
73
|
-
gl_FragColor.a = alpha;
|
|
74
|
-
}`,Convolute_5_1:`precision highp float;
|
|
75
|
-
uniform sampler2D uTexture;
|
|
76
|
-
uniform float uMatrix[25];
|
|
77
|
-
uniform float uStepW;
|
|
78
|
-
uniform float uStepH;
|
|
79
|
-
varying vec2 vTexCoord;
|
|
80
|
-
void main() {
|
|
81
|
-
vec4 color = vec4(0, 0, 0, 0);
|
|
82
|
-
for (float h = 0.0; h < 5.0; h+=1.0) {
|
|
83
|
-
for (float w = 0.0; w < 5.0; w+=1.0) {
|
|
84
|
-
vec2 matrixPos = vec2(uStepW * (w - 2.0), uStepH * (h - 2.0));
|
|
85
|
-
color += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 5.0 + w)];
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
gl_FragColor = color;
|
|
89
|
-
}`,Convolute_5_0:`precision highp float;
|
|
90
|
-
uniform sampler2D uTexture;
|
|
91
|
-
uniform float uMatrix[25];
|
|
92
|
-
uniform float uStepW;
|
|
93
|
-
uniform float uStepH;
|
|
94
|
-
varying vec2 vTexCoord;
|
|
95
|
-
void main() {
|
|
96
|
-
vec4 color = vec4(0, 0, 0, 1);
|
|
97
|
-
for (float h = 0.0; h < 5.0; h+=1.0) {
|
|
98
|
-
for (float w = 0.0; w < 5.0; w+=1.0) {
|
|
99
|
-
vec2 matrixPos = vec2(uStepW * (w - 2.0), uStepH * (h - 2.0));
|
|
100
|
-
color.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 5.0 + w)];
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
float alpha = texture2D(uTexture, vTexCoord).a;
|
|
104
|
-
gl_FragColor = color;
|
|
105
|
-
gl_FragColor.a = alpha;
|
|
106
|
-
}`,Convolute_7_1:`precision highp float;
|
|
107
|
-
uniform sampler2D uTexture;
|
|
108
|
-
uniform float uMatrix[49];
|
|
109
|
-
uniform float uStepW;
|
|
110
|
-
uniform float uStepH;
|
|
111
|
-
varying vec2 vTexCoord;
|
|
112
|
-
void main() {
|
|
113
|
-
vec4 color = vec4(0, 0, 0, 0);
|
|
114
|
-
for (float h = 0.0; h < 7.0; h+=1.0) {
|
|
115
|
-
for (float w = 0.0; w < 7.0; w+=1.0) {
|
|
116
|
-
vec2 matrixPos = vec2(uStepW * (w - 3.0), uStepH * (h - 3.0));
|
|
117
|
-
color += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 7.0 + w)];
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
gl_FragColor = color;
|
|
121
|
-
}`,Convolute_7_0:`precision highp float;
|
|
122
|
-
uniform sampler2D uTexture;
|
|
123
|
-
uniform float uMatrix[49];
|
|
124
|
-
uniform float uStepW;
|
|
125
|
-
uniform float uStepH;
|
|
126
|
-
varying vec2 vTexCoord;
|
|
127
|
-
void main() {
|
|
128
|
-
vec4 color = vec4(0, 0, 0, 1);
|
|
129
|
-
for (float h = 0.0; h < 7.0; h+=1.0) {
|
|
130
|
-
for (float w = 0.0; w < 7.0; w+=1.0) {
|
|
131
|
-
vec2 matrixPos = vec2(uStepW * (w - 3.0), uStepH * (h - 3.0));
|
|
132
|
-
color.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 7.0 + w)];
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
float alpha = texture2D(uTexture, vTexCoord).a;
|
|
136
|
-
gl_FragColor = color;
|
|
137
|
-
gl_FragColor.a = alpha;
|
|
138
|
-
}`,Convolute_9_1:`precision highp float;
|
|
139
|
-
uniform sampler2D uTexture;
|
|
140
|
-
uniform float uMatrix[81];
|
|
141
|
-
uniform float uStepW;
|
|
142
|
-
uniform float uStepH;
|
|
143
|
-
varying vec2 vTexCoord;
|
|
144
|
-
void main() {
|
|
145
|
-
vec4 color = vec4(0, 0, 0, 0);
|
|
146
|
-
for (float h = 0.0; h < 9.0; h+=1.0) {
|
|
147
|
-
for (float w = 0.0; w < 9.0; w+=1.0) {
|
|
148
|
-
vec2 matrixPos = vec2(uStepW * (w - 4.0), uStepH * (h - 4.0));
|
|
149
|
-
color += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 9.0 + w)];
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
gl_FragColor = color;
|
|
153
|
-
}`,Convolute_9_0:`precision highp float;
|
|
154
|
-
uniform sampler2D uTexture;
|
|
155
|
-
uniform float uMatrix[81];
|
|
156
|
-
uniform float uStepW;
|
|
157
|
-
uniform float uStepH;
|
|
158
|
-
varying vec2 vTexCoord;
|
|
159
|
-
void main() {
|
|
160
|
-
vec4 color = vec4(0, 0, 0, 1);
|
|
161
|
-
for (float h = 0.0; h < 9.0; h+=1.0) {
|
|
162
|
-
for (float w = 0.0; w < 9.0; w+=1.0) {
|
|
163
|
-
vec2 matrixPos = vec2(uStepW * (w - 4.0), uStepH * (h - 4.0));
|
|
164
|
-
color.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 9.0 + w)];
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
float alpha = texture2D(uTexture, vTexCoord).a;
|
|
168
|
-
gl_FragColor = color;
|
|
169
|
-
gl_FragColor.a = alpha;
|
|
170
|
-
}`},retrieveShader:function(a){var n=Math.sqrt(this.matrix.length),f=this.type+"_"+n+"_"+(this.opaque?1:0),_=this.fragmentSource[f];return a.programCache.hasOwnProperty(f)||(a.programCache[f]=this.createProgram(a.context,_)),a.programCache[f]},applyTo2d:function(a){var n=a.imageData,f=n.data,_=this.matrix,h=Math.round(Math.sqrt(_.length)),E=Math.floor(h/2),w=n.width,A=n.height,D=a.ctx.createImageData(w,A),z=D.data,B=this.opaque?1:0,Y,H,V,lt,rt,St,q,_t,G,Ut,xt,Ht,it;for(xt=0;xt<A;xt++)for(Ut=0;Ut<w;Ut++){for(rt=(xt*w+Ut)*4,Y=0,H=0,V=0,lt=0,it=0;it<h;it++)for(Ht=0;Ht<h;Ht++)q=xt+it-E,St=Ut+Ht-E,!(q<0||q>=A||St<0||St>=w)&&(_t=(q*w+St)*4,G=_[it*h+Ht],Y+=f[_t]*G,H+=f[_t+1]*G,V+=f[_t+2]*G,B||(lt+=f[_t+3]*G));z[rt]=Y,z[rt+1]=H,z[rt+2]=V,B?z[rt+3]=f[rt+3]:z[rt+3]=lt}a.imageData=D},getUniformLocations:function(a,n){return{uMatrix:a.getUniformLocation(n,"uMatrix"),uOpaque:a.getUniformLocation(n,"uOpaque"),uHalfSize:a.getUniformLocation(n,"uHalfSize"),uSize:a.getUniformLocation(n,"uSize")}},sendUniformData:function(a,n){a.uniform1fv(n.uMatrix,this.matrix)},toObject:function(){return m(this.callSuper("toObject"),{opaque:this.opaque,matrix:this.matrix})}}),r.Image.filters.Convolute.fromObject=r.Image.filters.BaseFilter.fromObject}(I),function(b){"use strict";var r=b.fabric||(b.fabric={}),m=r.Image.filters,p=r.util.createClass;m.Grayscale=p(m.BaseFilter,{type:"Grayscale",fragmentSource:{average:`precision highp float;
|
|
171
|
-
uniform sampler2D uTexture;
|
|
172
|
-
varying vec2 vTexCoord;
|
|
173
|
-
void main() {
|
|
174
|
-
vec4 color = texture2D(uTexture, vTexCoord);
|
|
175
|
-
float average = (color.r + color.b + color.g) / 3.0;
|
|
176
|
-
gl_FragColor = vec4(average, average, average, color.a);
|
|
177
|
-
}`,lightness:`precision highp float;
|
|
178
|
-
uniform sampler2D uTexture;
|
|
179
|
-
uniform int uMode;
|
|
180
|
-
varying vec2 vTexCoord;
|
|
181
|
-
void main() {
|
|
182
|
-
vec4 col = texture2D(uTexture, vTexCoord);
|
|
183
|
-
float average = (max(max(col.r, col.g),col.b) + min(min(col.r, col.g),col.b)) / 2.0;
|
|
184
|
-
gl_FragColor = vec4(average, average, average, col.a);
|
|
185
|
-
}`,luminosity:`precision highp float;
|
|
186
|
-
uniform sampler2D uTexture;
|
|
187
|
-
uniform int uMode;
|
|
188
|
-
varying vec2 vTexCoord;
|
|
189
|
-
void main() {
|
|
190
|
-
vec4 col = texture2D(uTexture, vTexCoord);
|
|
191
|
-
float average = 0.21 * col.r + 0.72 * col.g + 0.07 * col.b;
|
|
192
|
-
gl_FragColor = vec4(average, average, average, col.a);
|
|
193
|
-
}`},mode:"average",mainParameter:"mode",applyTo2d:function(i){var a=i.imageData,n=a.data,f,_=n.length,h,E=this.mode;for(f=0;f<_;f+=4)E==="average"?h=(n[f]+n[f+1]+n[f+2])/3:E==="lightness"?h=(Math.min(n[f],n[f+1],n[f+2])+Math.max(n[f],n[f+1],n[f+2]))/2:E==="luminosity"&&(h=.21*n[f]+.72*n[f+1]+.07*n[f+2]),n[f]=h,n[f+1]=h,n[f+2]=h},retrieveShader:function(i){var a=this.type+"_"+this.mode;if(!i.programCache.hasOwnProperty(a)){var n=this.fragmentSource[this.mode];i.programCache[a]=this.createProgram(i.context,n)}return i.programCache[a]},getUniformLocations:function(i,a){return{uMode:i.getUniformLocation(a,"uMode")}},sendUniformData:function(i,a){var n=1;i.uniform1i(a.uMode,n)},isNeutralState:function(){return!1}}),r.Image.filters.Grayscale.fromObject=r.Image.filters.BaseFilter.fromObject}(I),function(b){"use strict";var r=b.fabric||(b.fabric={}),m=r.Image.filters,p=r.util.createClass;m.Invert=p(m.BaseFilter,{type:"Invert",fragmentSource:`precision highp float;
|
|
194
|
-
uniform sampler2D uTexture;
|
|
195
|
-
uniform int uInvert;
|
|
196
|
-
varying vec2 vTexCoord;
|
|
197
|
-
void main() {
|
|
198
|
-
vec4 color = texture2D(uTexture, vTexCoord);
|
|
199
|
-
if (uInvert == 1) {
|
|
200
|
-
gl_FragColor = vec4(1.0 - color.r,1.0 -color.g,1.0 -color.b,color.a);
|
|
201
|
-
} else {
|
|
202
|
-
gl_FragColor = color;
|
|
203
|
-
}
|
|
204
|
-
}`,invert:!0,mainParameter:"invert",applyTo2d:function(i){var a=i.imageData,n=a.data,f,_=n.length;for(f=0;f<_;f+=4)n[f]=255-n[f],n[f+1]=255-n[f+1],n[f+2]=255-n[f+2]},isNeutralState:function(){return!this.invert},getUniformLocations:function(i,a){return{uInvert:i.getUniformLocation(a,"uInvert")}},sendUniformData:function(i,a){i.uniform1i(a.uInvert,this.invert)}}),r.Image.filters.Invert.fromObject=r.Image.filters.BaseFilter.fromObject}(I),function(b){"use strict";var r=b.fabric||(b.fabric={}),m=r.util.object.extend,p=r.Image.filters,i=r.util.createClass;p.Noise=i(p.BaseFilter,{type:"Noise",fragmentSource:`precision highp float;
|
|
205
|
-
uniform sampler2D uTexture;
|
|
206
|
-
uniform float uStepH;
|
|
207
|
-
uniform float uNoise;
|
|
208
|
-
uniform float uSeed;
|
|
209
|
-
varying vec2 vTexCoord;
|
|
210
|
-
float rand(vec2 co, float seed, float vScale) {
|
|
211
|
-
return fract(sin(dot(co.xy * vScale ,vec2(12.9898 , 78.233))) * 43758.5453 * (seed + 0.01) / 2.0);
|
|
212
|
-
}
|
|
213
|
-
void main() {
|
|
214
|
-
vec4 color = texture2D(uTexture, vTexCoord);
|
|
215
|
-
color.rgb += (0.5 - rand(vTexCoord, uSeed, 0.1 / uStepH)) * uNoise;
|
|
216
|
-
gl_FragColor = color;
|
|
217
|
-
}`,mainParameter:"noise",noise:0,applyTo2d:function(a){if(this.noise!==0){var n=a.imageData,f=n.data,_,h=f.length,E=this.noise,w;for(_=0,h=f.length;_<h;_+=4)w=(.5-Math.random())*E,f[_]+=w,f[_+1]+=w,f[_+2]+=w}},getUniformLocations:function(a,n){return{uNoise:a.getUniformLocation(n,"uNoise"),uSeed:a.getUniformLocation(n,"uSeed")}},sendUniformData:function(a,n){a.uniform1f(n.uNoise,this.noise/255),a.uniform1f(n.uSeed,Math.random())},toObject:function(){return m(this.callSuper("toObject"),{noise:this.noise})}}),r.Image.filters.Noise.fromObject=r.Image.filters.BaseFilter.fromObject}(I),function(b){"use strict";var r=b.fabric||(b.fabric={}),m=r.Image.filters,p=r.util.createClass;m.Pixelate=p(m.BaseFilter,{type:"Pixelate",blocksize:4,mainParameter:"blocksize",fragmentSource:`precision highp float;
|
|
218
|
-
uniform sampler2D uTexture;
|
|
219
|
-
uniform float uBlocksize;
|
|
220
|
-
uniform float uStepW;
|
|
221
|
-
uniform float uStepH;
|
|
222
|
-
varying vec2 vTexCoord;
|
|
223
|
-
void main() {
|
|
224
|
-
float blockW = uBlocksize * uStepW;
|
|
225
|
-
float blockH = uBlocksize * uStepW;
|
|
226
|
-
int posX = int(vTexCoord.x / blockW);
|
|
227
|
-
int posY = int(vTexCoord.y / blockH);
|
|
228
|
-
float fposX = float(posX);
|
|
229
|
-
float fposY = float(posY);
|
|
230
|
-
vec2 squareCoords = vec2(fposX * blockW, fposY * blockH);
|
|
231
|
-
vec4 color = texture2D(uTexture, squareCoords);
|
|
232
|
-
gl_FragColor = color;
|
|
233
|
-
}`,applyTo2d:function(i){var a=i.imageData,n=a.data,f=a.height,_=a.width,h,E,w,A,D,z,B,Y,H,V,lt;for(E=0;E<f;E+=this.blocksize)for(w=0;w<_;w+=this.blocksize)for(h=E*4*_+w*4,A=n[h],D=n[h+1],z=n[h+2],B=n[h+3],V=Math.min(E+this.blocksize,f),lt=Math.min(w+this.blocksize,_),Y=E;Y<V;Y++)for(H=w;H<lt;H++)h=Y*4*_+H*4,n[h]=A,n[h+1]=D,n[h+2]=z,n[h+3]=B},isNeutralState:function(){return this.blocksize===1},getUniformLocations:function(i,a){return{uBlocksize:i.getUniformLocation(a,"uBlocksize"),uStepW:i.getUniformLocation(a,"uStepW"),uStepH:i.getUniformLocation(a,"uStepH")}},sendUniformData:function(i,a){i.uniform1f(a.uBlocksize,this.blocksize)}}),r.Image.filters.Pixelate.fromObject=r.Image.filters.BaseFilter.fromObject}(I),function(b){"use strict";var r=b.fabric||(b.fabric={}),m=r.util.object.extend,p=r.Image.filters,i=r.util.createClass;p.RemoveColor=i(p.BaseFilter,{type:"RemoveColor",color:"#FFFFFF",fragmentSource:`precision highp float;
|
|
234
|
-
uniform sampler2D uTexture;
|
|
235
|
-
uniform vec4 uLow;
|
|
236
|
-
uniform vec4 uHigh;
|
|
237
|
-
varying vec2 vTexCoord;
|
|
238
|
-
void main() {
|
|
239
|
-
gl_FragColor = texture2D(uTexture, vTexCoord);
|
|
240
|
-
if(all(greaterThan(gl_FragColor.rgb,uLow.rgb)) && all(greaterThan(uHigh.rgb,gl_FragColor.rgb))) {
|
|
241
|
-
gl_FragColor.a = 0.0;
|
|
242
|
-
}
|
|
243
|
-
}`,distance:.02,useAlpha:!1,applyTo2d:function(a){var n=a.imageData,f=n.data,_,h=this.distance*255,E,w,A,D=new r.Color(this.color).getSource(),z=[D[0]-h,D[1]-h,D[2]-h],B=[D[0]+h,D[1]+h,D[2]+h];for(_=0;_<f.length;_+=4)E=f[_],w=f[_+1],A=f[_+2],E>z[0]&&w>z[1]&&A>z[2]&&E<B[0]&&w<B[1]&&A<B[2]&&(f[_+3]=0)},getUniformLocations:function(a,n){return{uLow:a.getUniformLocation(n,"uLow"),uHigh:a.getUniformLocation(n,"uHigh")}},sendUniformData:function(a,n){var f=new r.Color(this.color).getSource(),_=parseFloat(this.distance),h=[0+f[0]/255-_,0+f[1]/255-_,0+f[2]/255-_,1],E=[f[0]/255+_,f[1]/255+_,f[2]/255+_,1];a.uniform4fv(n.uLow,h),a.uniform4fv(n.uHigh,E)},toObject:function(){return m(this.callSuper("toObject"),{color:this.color,distance:this.distance})}}),r.Image.filters.RemoveColor.fromObject=r.Image.filters.BaseFilter.fromObject}(I),function(b){"use strict";var r=b.fabric||(b.fabric={}),m=r.Image.filters,p=r.util.createClass,i={Brownie:[.5997,.34553,-.27082,0,.186,-.0377,.86095,.15059,0,-.1449,.24113,-.07441,.44972,0,-.02965,0,0,0,1,0],Vintage:[.62793,.32021,-.03965,0,.03784,.02578,.64411,.03259,0,.02926,.0466,-.08512,.52416,0,.02023,0,0,0,1,0],Kodachrome:[1.12855,-.39673,-.03992,0,.24991,-.16404,1.08352,-.05498,0,.09698,-.16786,-.56034,1.60148,0,.13972,0,0,0,1,0],Technicolor:[1.91252,-.85453,-.09155,0,.04624,-.30878,1.76589,-.10601,0,-.27589,-.2311,-.75018,1.84759,0,.12137,0,0,0,1,0],Polaroid:[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],Sepia:[.393,.769,.189,0,0,.349,.686,.168,0,0,.272,.534,.131,0,0,0,0,0,1,0],BlackWhite:[1.5,1.5,1.5,0,-1,1.5,1.5,1.5,0,-1,1.5,1.5,1.5,0,-1,0,0,0,1,0]};for(var a in i)m[a]=p(m.ColorMatrix,{type:a,matrix:i[a],mainParameter:!1,colorsOnly:!0}),r.Image.filters[a].fromObject=r.Image.filters.BaseFilter.fromObject}(I),function(b){"use strict";var r=b.fabric,m=r.Image.filters,p=r.util.createClass;m.BlendColor=p(m.BaseFilter,{type:"BlendColor",color:"#F95C63",mode:"multiply",alpha:1,fragmentSource:{multiply:`gl_FragColor.rgb *= uColor.rgb;
|
|
244
|
-
`,screen:`gl_FragColor.rgb = 1.0 - (1.0 - gl_FragColor.rgb) * (1.0 - uColor.rgb);
|
|
245
|
-
`,add:`gl_FragColor.rgb += uColor.rgb;
|
|
246
|
-
`,diff:`gl_FragColor.rgb = abs(gl_FragColor.rgb - uColor.rgb);
|
|
247
|
-
`,subtract:`gl_FragColor.rgb -= uColor.rgb;
|
|
248
|
-
`,lighten:`gl_FragColor.rgb = max(gl_FragColor.rgb, uColor.rgb);
|
|
249
|
-
`,darken:`gl_FragColor.rgb = min(gl_FragColor.rgb, uColor.rgb);
|
|
250
|
-
`,exclusion:`gl_FragColor.rgb += uColor.rgb - 2.0 * (uColor.rgb * gl_FragColor.rgb);
|
|
251
|
-
`,overlay:`if (uColor.r < 0.5) {
|
|
252
|
-
gl_FragColor.r *= 2.0 * uColor.r;
|
|
253
|
-
} else {
|
|
254
|
-
gl_FragColor.r = 1.0 - 2.0 * (1.0 - gl_FragColor.r) * (1.0 - uColor.r);
|
|
255
|
-
}
|
|
256
|
-
if (uColor.g < 0.5) {
|
|
257
|
-
gl_FragColor.g *= 2.0 * uColor.g;
|
|
258
|
-
} else {
|
|
259
|
-
gl_FragColor.g = 1.0 - 2.0 * (1.0 - gl_FragColor.g) * (1.0 - uColor.g);
|
|
260
|
-
}
|
|
261
|
-
if (uColor.b < 0.5) {
|
|
262
|
-
gl_FragColor.b *= 2.0 * uColor.b;
|
|
263
|
-
} else {
|
|
264
|
-
gl_FragColor.b = 1.0 - 2.0 * (1.0 - gl_FragColor.b) * (1.0 - uColor.b);
|
|
265
|
-
}
|
|
266
|
-
`,tint:`gl_FragColor.rgb *= (1.0 - uColor.a);
|
|
267
|
-
gl_FragColor.rgb += uColor.rgb;
|
|
268
|
-
`},buildSource:function(i){return`precision highp float;
|
|
269
|
-
uniform sampler2D uTexture;
|
|
270
|
-
uniform vec4 uColor;
|
|
271
|
-
varying vec2 vTexCoord;
|
|
272
|
-
void main() {
|
|
273
|
-
vec4 color = texture2D(uTexture, vTexCoord);
|
|
274
|
-
gl_FragColor = color;
|
|
275
|
-
if (color.a > 0.0) {
|
|
276
|
-
`+this.fragmentSource[i]+`}
|
|
277
|
-
}`},retrieveShader:function(i){var a=this.type+"_"+this.mode,n;return i.programCache.hasOwnProperty(a)||(n=this.buildSource(this.mode),i.programCache[a]=this.createProgram(i.context,n)),i.programCache[a]},applyTo2d:function(i){var a=i.imageData,n=a.data,f=n.length,_,h,E,w,A,D,z,B=1-this.alpha;z=new r.Color(this.color).getSource(),_=z[0]*this.alpha,h=z[1]*this.alpha,E=z[2]*this.alpha;for(var Y=0;Y<f;Y+=4)switch(w=n[Y],A=n[Y+1],D=n[Y+2],this.mode){case"multiply":n[Y]=w*_/255,n[Y+1]=A*h/255,n[Y+2]=D*E/255;break;case"screen":n[Y]=255-(255-w)*(255-_)/255,n[Y+1]=255-(255-A)*(255-h)/255,n[Y+2]=255-(255-D)*(255-E)/255;break;case"add":n[Y]=w+_,n[Y+1]=A+h,n[Y+2]=D+E;break;case"diff":case"difference":n[Y]=Math.abs(w-_),n[Y+1]=Math.abs(A-h),n[Y+2]=Math.abs(D-E);break;case"subtract":n[Y]=w-_,n[Y+1]=A-h,n[Y+2]=D-E;break;case"darken":n[Y]=Math.min(w,_),n[Y+1]=Math.min(A,h),n[Y+2]=Math.min(D,E);break;case"lighten":n[Y]=Math.max(w,_),n[Y+1]=Math.max(A,h),n[Y+2]=Math.max(D,E);break;case"overlay":n[Y]=_<128?2*w*_/255:255-2*(255-w)*(255-_)/255,n[Y+1]=h<128?2*A*h/255:255-2*(255-A)*(255-h)/255,n[Y+2]=E<128?2*D*E/255:255-2*(255-D)*(255-E)/255;break;case"exclusion":n[Y]=_+w-2*_*w/255,n[Y+1]=h+A-2*h*A/255,n[Y+2]=E+D-2*E*D/255;break;case"tint":n[Y]=_+w*B,n[Y+1]=h+A*B,n[Y+2]=E+D*B}},getUniformLocations:function(i,a){return{uColor:i.getUniformLocation(a,"uColor")}},sendUniformData:function(i,a){var n=new r.Color(this.color).getSource();n[0]=this.alpha*n[0]/255,n[1]=this.alpha*n[1]/255,n[2]=this.alpha*n[2]/255,n[3]=this.alpha,i.uniform4fv(a.uColor,n)},toObject:function(){return{type:this.type,color:this.color,mode:this.mode,alpha:this.alpha}}}),r.Image.filters.BlendColor.fromObject=r.Image.filters.BaseFilter.fromObject}(I),function(b){"use strict";var r=b.fabric,m=r.Image.filters,p=r.util.createClass;m.BlendImage=p(m.BaseFilter,{type:"BlendImage",image:null,mode:"multiply",alpha:1,vertexSource:`attribute vec2 aPosition;
|
|
278
|
-
varying vec2 vTexCoord;
|
|
279
|
-
varying vec2 vTexCoord2;
|
|
280
|
-
uniform mat3 uTransformMatrix;
|
|
281
|
-
void main() {
|
|
282
|
-
vTexCoord = aPosition;
|
|
283
|
-
vTexCoord2 = (uTransformMatrix * vec3(aPosition, 1.0)).xy;
|
|
284
|
-
gl_Position = vec4(aPosition * 2.0 - 1.0, 0.0, 1.0);
|
|
285
|
-
}`,fragmentSource:{multiply:`precision highp float;
|
|
286
|
-
uniform sampler2D uTexture;
|
|
287
|
-
uniform sampler2D uImage;
|
|
288
|
-
uniform vec4 uColor;
|
|
289
|
-
varying vec2 vTexCoord;
|
|
290
|
-
varying vec2 vTexCoord2;
|
|
291
|
-
void main() {
|
|
292
|
-
vec4 color = texture2D(uTexture, vTexCoord);
|
|
293
|
-
vec4 color2 = texture2D(uImage, vTexCoord2);
|
|
294
|
-
color.rgba *= color2.rgba;
|
|
295
|
-
gl_FragColor = color;
|
|
296
|
-
}`,mask:`precision highp float;
|
|
297
|
-
uniform sampler2D uTexture;
|
|
298
|
-
uniform sampler2D uImage;
|
|
299
|
-
uniform vec4 uColor;
|
|
300
|
-
varying vec2 vTexCoord;
|
|
301
|
-
varying vec2 vTexCoord2;
|
|
302
|
-
void main() {
|
|
303
|
-
vec4 color = texture2D(uTexture, vTexCoord);
|
|
304
|
-
vec4 color2 = texture2D(uImage, vTexCoord2);
|
|
305
|
-
color.a = color2.a;
|
|
306
|
-
gl_FragColor = color;
|
|
307
|
-
}`},retrieveShader:function(i){var a=this.type+"_"+this.mode,n=this.fragmentSource[this.mode];return i.programCache.hasOwnProperty(a)||(i.programCache[a]=this.createProgram(i.context,n)),i.programCache[a]},applyToWebGL:function(i){var a=i.context,n=this.createTexture(i.filterBackend,this.image);this.bindAdditionalTexture(a,n,a.TEXTURE1),this.callSuper("applyToWebGL",i),this.unbindAdditionalTexture(a,a.TEXTURE1)},createTexture:function(i,a){return i.getCachedTexture(a.cacheKey,a._element)},calculateMatrix:function(){var i=this.image,a=i._element.width,n=i._element.height;return[1/i.scaleX,0,0,0,1/i.scaleY,0,-i.left/a,-i.top/n,1]},applyTo2d:function(i){var a=i.imageData,n=i.filterBackend.resources,f=a.data,_=f.length,h=a.width,E=a.height,w,A,D,z,B,Y,H,V,lt,rt,St=this.image,q;n.blendImage||(n.blendImage=r.util.createCanvasElement()),lt=n.blendImage,rt=lt.getContext("2d"),lt.width!==h||lt.height!==E?(lt.width=h,lt.height=E):rt.clearRect(0,0,h,E),rt.setTransform(St.scaleX,0,0,St.scaleY,St.left,St.top),rt.drawImage(St._element,0,0,h,E),q=rt.getImageData(0,0,h,E).data;for(var _t=0;_t<_;_t+=4)switch(B=f[_t],Y=f[_t+1],H=f[_t+2],V=f[_t+3],w=q[_t],A=q[_t+1],D=q[_t+2],z=q[_t+3],this.mode){case"multiply":f[_t]=B*w/255,f[_t+1]=Y*A/255,f[_t+2]=H*D/255,f[_t+3]=V*z/255;break;case"mask":f[_t+3]=z;break}},getUniformLocations:function(i,a){return{uTransformMatrix:i.getUniformLocation(a,"uTransformMatrix"),uImage:i.getUniformLocation(a,"uImage")}},sendUniformData:function(i,a){var n=this.calculateMatrix();i.uniform1i(a.uImage,1),i.uniformMatrix3fv(a.uTransformMatrix,!1,n)},toObject:function(){return{type:this.type,image:this.image&&this.image.toObject(),mode:this.mode,alpha:this.alpha}}}),r.Image.filters.BlendImage.fromObject=function(i,a){r.Image.fromObject(i.image,function(n){var f=r.util.object.clone(i);f.image=n,a(new r.Image.filters.BlendImage(f))})}}(I),function(b){"use strict";var r=b.fabric||(b.fabric={}),m=Math.pow,p=Math.floor,i=Math.sqrt,a=Math.abs,n=Math.round,f=Math.sin,_=Math.ceil,h=r.Image.filters,E=r.util.createClass;h.Resize=E(h.BaseFilter,{type:"Resize",resizeType:"hermite",scaleX:1,scaleY:1,lanczosLobes:3,getUniformLocations:function(w,A){return{uDelta:w.getUniformLocation(A,"uDelta"),uTaps:w.getUniformLocation(A,"uTaps")}},sendUniformData:function(w,A){w.uniform2fv(A.uDelta,this.horizontal?[1/this.width,0]:[0,1/this.height]),w.uniform1fv(A.uTaps,this.taps)},retrieveShader:function(w){var A=this.getFilterWindow(),D=this.type+"_"+A;if(!w.programCache.hasOwnProperty(D)){var z=this.generateShader(A);w.programCache[D]=this.createProgram(w.context,z)}return w.programCache[D]},getFilterWindow:function(){var w=this.tempScale;return Math.ceil(this.lanczosLobes/w)},getTaps:function(){for(var w=this.lanczosCreate(this.lanczosLobes),A=this.tempScale,D=this.getFilterWindow(),z=new Array(D),B=1;B<=D;B++)z[B-1]=w(B*A);return z},generateShader:function(z){for(var A=new Array(z),D=this.fragmentSourceTOP,z,B=1;B<=z;B++)A[B-1]=B+".0 * uDelta";return D+="uniform float uTaps["+z+`];
|
|
308
|
-
`,D+=`void main() {
|
|
309
|
-
`,D+=` vec4 color = texture2D(uTexture, vTexCoord);
|
|
310
|
-
`,D+=` float sum = 1.0;
|
|
311
|
-
`,A.forEach(function(Y,H){D+=" color += texture2D(uTexture, vTexCoord + "+Y+") * uTaps["+H+`];
|
|
312
|
-
`,D+=" color += texture2D(uTexture, vTexCoord - "+Y+") * uTaps["+H+`];
|
|
313
|
-
`,D+=" sum += 2.0 * uTaps["+H+`];
|
|
314
|
-
`}),D+=` gl_FragColor = color / sum;
|
|
315
|
-
`,D+="}",D},fragmentSourceTOP:`precision highp float;
|
|
316
|
-
uniform sampler2D uTexture;
|
|
317
|
-
uniform vec2 uDelta;
|
|
318
|
-
varying vec2 vTexCoord;
|
|
319
|
-
`,applyTo:function(w){w.webgl?(w.passes++,this.width=w.sourceWidth,this.horizontal=!0,this.dW=Math.round(this.width*this.scaleX),this.dH=w.sourceHeight,this.tempScale=this.dW/this.width,this.taps=this.getTaps(),w.destinationWidth=this.dW,this._setupFrameBuffer(w),this.applyToWebGL(w),this._swapTextures(w),w.sourceWidth=w.destinationWidth,this.height=w.sourceHeight,this.horizontal=!1,this.dH=Math.round(this.height*this.scaleY),this.tempScale=this.dH/this.height,this.taps=this.getTaps(),w.destinationHeight=this.dH,this._setupFrameBuffer(w),this.applyToWebGL(w),this._swapTextures(w),w.sourceHeight=w.destinationHeight):this.applyTo2d(w)},isNeutralState:function(){return this.scaleX===1&&this.scaleY===1},lanczosCreate:function(w){return function(A){if(A>=w||A<=-w)return 0;if(A<11920929e-14&&A>-11920929e-14)return 1;A*=Math.PI;var D=A/w;return f(A)/A*f(D)/D}},applyTo2d:function(w){var A=w.imageData,D=this.scaleX,z=this.scaleY;this.rcpScaleX=1/D,this.rcpScaleY=1/z;var B=A.width,Y=A.height,H=n(B*D),V=n(Y*z),lt;this.resizeType==="sliceHack"?lt=this.sliceByTwo(w,B,Y,H,V):this.resizeType==="hermite"?lt=this.hermiteFastResize(w,B,Y,H,V):this.resizeType==="bilinear"?lt=this.bilinearFiltering(w,B,Y,H,V):this.resizeType==="lanczos"&&(lt=this.lanczosResize(w,B,Y,H,V)),w.imageData=lt},sliceByTwo:function(w,A,D,z,B){var Y=w.imageData,H=.5,V=!1,lt=!1,rt=A*H,St=D*H,q=r.filterBackend.resources,_t,G,Ut=0,xt=0,Ht=A,it=0;for(q.sliceByTwo||(q.sliceByTwo=document.createElement("canvas")),_t=q.sliceByTwo,(_t.width<A*1.5||_t.height<D)&&(_t.width=A*1.5,_t.height=D),G=_t.getContext("2d"),G.clearRect(0,0,A*1.5,D),G.putImageData(Y,0,0),z=p(z),B=p(B);!V||!lt;)A=rt,D=St,z<p(rt*H)?rt=p(rt*H):(rt=z,V=!0),B<p(St*H)?St=p(St*H):(St=B,lt=!0),G.drawImage(_t,Ut,xt,A,D,Ht,it,rt,St),Ut=Ht,xt=it,it+=St;return G.getImageData(Ut,xt,z,B)},lanczosResize:function(w,A,D,z,B){function Y(tt){var Z,dt,X,$,K,Q,yt,vt,It,wt,Et;for(it.x=(tt+.5)*St,ut.x=p(it.x),Z=0;Z<B;Z++){for(it.y=(Z+.5)*q,ut.y=p(it.y),K=0,Q=0,yt=0,vt=0,It=0,dt=ut.x-Ut;dt<=ut.x+Ut;dt++)if(!(dt<0||dt>=A)){wt=p(1e3*a(dt-it.x)),Ht[wt]||(Ht[wt]={});for(var ct=ut.y-xt;ct<=ut.y+xt;ct++)ct<0||ct>=D||(Et=p(1e3*a(ct-it.y)),Ht[wt][Et]||(Ht[wt][Et]=rt(i(m(wt*_t,2)+m(Et*G,2))/1e3)),X=Ht[wt][Et],X>0&&($=(ct*A+dt)*4,K+=X,Q+=X*H[$],yt+=X*H[$+1],vt+=X*H[$+2],It+=X*H[$+3]))}$=(Z*z+tt)*4,lt[$]=Q/K,lt[$+1]=yt/K,lt[$+2]=vt/K,lt[$+3]=It/K}return++tt<z?Y(tt):V}e(Y,"process");var H=w.imageData.data,V=w.ctx.createImageData(z,B),lt=V.data,rt=this.lanczosCreate(this.lanczosLobes),St=this.rcpScaleX,q=this.rcpScaleY,_t=2/this.rcpScaleX,G=2/this.rcpScaleY,Ut=_(St*this.lanczosLobes/2),xt=_(q*this.lanczosLobes/2),Ht={},it={},ut={};return Y(0)},bilinearFiltering:function(w,A,D,z,B){var Y,H,V,lt,rt,St,q,_t,G,Ut,xt,Ht,it=0,ut,tt=this.rcpScaleX,Z=this.rcpScaleY,dt=4*(A-1),X=w.imageData,$=X.data,K=w.ctx.createImageData(z,B),Q=K.data;for(q=0;q<B;q++)for(_t=0;_t<z;_t++)for(rt=p(tt*_t),St=p(Z*q),G=tt*_t-rt,Ut=Z*q-St,ut=4*(St*A+rt),xt=0;xt<4;xt++)Y=$[ut+xt],H=$[ut+4+xt],V=$[ut+dt+xt],lt=$[ut+dt+4+xt],Ht=Y*(1-G)*(1-Ut)+H*G*(1-Ut)+V*Ut*(1-G)+lt*G*Ut,Q[it++]=Ht;return K},hermiteFastResize:function(w,A,D,z,B){for(var Y=this.rcpScaleX,H=this.rcpScaleY,V=_(Y/2),lt=_(H/2),rt=w.imageData,St=rt.data,q=w.ctx.createImageData(z,B),_t=q.data,G=0;G<B;G++)for(var Ut=0;Ut<z;Ut++){for(var xt=(Ut+G*z)*4,Ht=0,it=0,ut=0,tt=0,Z=0,dt=0,X=0,$=(G+.5)*H,K=p(G*H);K<(G+1)*H;K++)for(var Q=a($-(K+.5))/lt,yt=(Ut+.5)*Y,vt=Q*Q,It=p(Ut*Y);It<(Ut+1)*Y;It++){var wt=a(yt-(It+.5))/V,Et=i(vt+wt*wt);Et>1&&Et<-1||(Ht=2*Et*Et*Et-3*Et*Et+1,Ht>0&&(wt=4*(It+K*A),X+=Ht*St[wt+3],ut+=Ht,St[wt+3]<255&&(Ht=Ht*St[wt+3]/250),tt+=Ht*St[wt],Z+=Ht*St[wt+1],dt+=Ht*St[wt+2],it+=Ht))}_t[xt]=tt/it,_t[xt+1]=Z/it,_t[xt+2]=dt/it,_t[xt+3]=X/ut}return q},toObject:function(){return{type:this.type,scaleX:this.scaleX,scaleY:this.scaleY,resizeType:this.resizeType,lanczosLobes:this.lanczosLobes}}}),r.Image.filters.Resize.fromObject=r.Image.filters.BaseFilter.fromObject}(I),function(b){"use strict";var r=b.fabric||(b.fabric={}),m=r.Image.filters,p=r.util.createClass;m.Contrast=p(m.BaseFilter,{type:"Contrast",fragmentSource:`precision highp float;
|
|
320
|
-
uniform sampler2D uTexture;
|
|
321
|
-
uniform float uContrast;
|
|
322
|
-
varying vec2 vTexCoord;
|
|
323
|
-
void main() {
|
|
324
|
-
vec4 color = texture2D(uTexture, vTexCoord);
|
|
325
|
-
float contrastF = 1.015 * (uContrast + 1.0) / (1.0 * (1.015 - uContrast));
|
|
326
|
-
color.rgb = contrastF * (color.rgb - 0.5) + 0.5;
|
|
327
|
-
gl_FragColor = color;
|
|
328
|
-
}`,contrast:0,mainParameter:"contrast",applyTo2d:function(i){if(this.contrast!==0){var a=i.imageData,n,_,f=a.data,_=f.length,h=Math.floor(this.contrast*255),E=259*(h+255)/(255*(259-h));for(n=0;n<_;n+=4)f[n]=E*(f[n]-128)+128,f[n+1]=E*(f[n+1]-128)+128,f[n+2]=E*(f[n+2]-128)+128}},getUniformLocations:function(i,a){return{uContrast:i.getUniformLocation(a,"uContrast")}},sendUniformData:function(i,a){i.uniform1f(a.uContrast,this.contrast)}}),r.Image.filters.Contrast.fromObject=r.Image.filters.BaseFilter.fromObject}(I),function(b){"use strict";var r=b.fabric||(b.fabric={}),m=r.Image.filters,p=r.util.createClass;m.Saturation=p(m.BaseFilter,{type:"Saturation",fragmentSource:`precision highp float;
|
|
329
|
-
uniform sampler2D uTexture;
|
|
330
|
-
uniform float uSaturation;
|
|
331
|
-
varying vec2 vTexCoord;
|
|
332
|
-
void main() {
|
|
333
|
-
vec4 color = texture2D(uTexture, vTexCoord);
|
|
334
|
-
float rgMax = max(color.r, color.g);
|
|
335
|
-
float rgbMax = max(rgMax, color.b);
|
|
336
|
-
color.r += rgbMax != color.r ? (rgbMax - color.r) * uSaturation : 0.00;
|
|
337
|
-
color.g += rgbMax != color.g ? (rgbMax - color.g) * uSaturation : 0.00;
|
|
338
|
-
color.b += rgbMax != color.b ? (rgbMax - color.b) * uSaturation : 0.00;
|
|
339
|
-
gl_FragColor = color;
|
|
340
|
-
}`,saturation:0,mainParameter:"saturation",applyTo2d:function(i){if(this.saturation!==0){var a=i.imageData,n=a.data,f=n.length,_=-this.saturation,h,E;for(h=0;h<f;h+=4)E=Math.max(n[h],n[h+1],n[h+2]),n[h]+=E!==n[h]?(E-n[h])*_:0,n[h+1]+=E!==n[h+1]?(E-n[h+1])*_:0,n[h+2]+=E!==n[h+2]?(E-n[h+2])*_:0}},getUniformLocations:function(i,a){return{uSaturation:i.getUniformLocation(a,"uSaturation")}},sendUniformData:function(i,a){i.uniform1f(a.uSaturation,-this.saturation)}}),r.Image.filters.Saturation.fromObject=r.Image.filters.BaseFilter.fromObject}(I),function(b){"use strict";var r=b.fabric||(b.fabric={}),m=r.Image.filters,p=r.util.createClass;m.Vibrance=p(m.BaseFilter,{type:"Vibrance",fragmentSource:`precision highp float;
|
|
341
|
-
uniform sampler2D uTexture;
|
|
342
|
-
uniform float uVibrance;
|
|
343
|
-
varying vec2 vTexCoord;
|
|
344
|
-
void main() {
|
|
345
|
-
vec4 color = texture2D(uTexture, vTexCoord);
|
|
346
|
-
float max = max(color.r, max(color.g, color.b));
|
|
347
|
-
float avg = (color.r + color.g + color.b) / 3.0;
|
|
348
|
-
float amt = (abs(max - avg) * 2.0) * uVibrance;
|
|
349
|
-
color.r += max != color.r ? (max - color.r) * amt : 0.00;
|
|
350
|
-
color.g += max != color.g ? (max - color.g) * amt : 0.00;
|
|
351
|
-
color.b += max != color.b ? (max - color.b) * amt : 0.00;
|
|
352
|
-
gl_FragColor = color;
|
|
353
|
-
}`,vibrance:0,mainParameter:"vibrance",applyTo2d:function(i){if(this.vibrance!==0){var a=i.imageData,n=a.data,f=n.length,_=-this.vibrance,h,E,w,A;for(h=0;h<f;h+=4)E=Math.max(n[h],n[h+1],n[h+2]),w=(n[h]+n[h+1]+n[h+2])/3,A=Math.abs(E-w)*2/255*_,n[h]+=E!==n[h]?(E-n[h])*A:0,n[h+1]+=E!==n[h+1]?(E-n[h+1])*A:0,n[h+2]+=E!==n[h+2]?(E-n[h+2])*A:0}},getUniformLocations:function(i,a){return{uVibrance:i.getUniformLocation(a,"uVibrance")}},sendUniformData:function(i,a){i.uniform1f(a.uVibrance,-this.vibrance)}}),r.Image.filters.Vibrance.fromObject=r.Image.filters.BaseFilter.fromObject}(I),function(b){"use strict";var r=b.fabric||(b.fabric={}),m=r.Image.filters,p=r.util.createClass;m.Blur=p(m.BaseFilter,{type:"Blur",fragmentSource:`precision highp float;
|
|
354
|
-
uniform sampler2D uTexture;
|
|
355
|
-
uniform vec2 uDelta;
|
|
356
|
-
varying vec2 vTexCoord;
|
|
357
|
-
const float nSamples = 15.0;
|
|
358
|
-
vec3 v3offset = vec3(12.9898, 78.233, 151.7182);
|
|
359
|
-
float random(vec3 scale) {
|
|
360
|
-
return fract(sin(dot(gl_FragCoord.xyz, scale)) * 43758.5453);
|
|
361
|
-
}
|
|
362
|
-
void main() {
|
|
363
|
-
vec4 color = vec4(0.0);
|
|
364
|
-
float total = 0.0;
|
|
365
|
-
float offset = random(v3offset);
|
|
366
|
-
for (float t = -nSamples; t <= nSamples; t++) {
|
|
367
|
-
float percent = (t + offset - 0.5) / nSamples;
|
|
368
|
-
float weight = 1.0 - abs(percent);
|
|
369
|
-
color += texture2D(uTexture, vTexCoord + uDelta * percent) * weight;
|
|
370
|
-
total += weight;
|
|
371
|
-
}
|
|
372
|
-
gl_FragColor = color / total;
|
|
373
|
-
}`,blur:0,mainParameter:"blur",applyTo:function(i){i.webgl?(this.aspectRatio=i.sourceWidth/i.sourceHeight,i.passes++,this._setupFrameBuffer(i),this.horizontal=!0,this.applyToWebGL(i),this._swapTextures(i),this._setupFrameBuffer(i),this.horizontal=!1,this.applyToWebGL(i),this._swapTextures(i)):this.applyTo2d(i)},applyTo2d:function(i){i.imageData=this.simpleBlur(i)},simpleBlur:function(i){var a=i.filterBackend.resources,n,f,_=i.imageData.width,h=i.imageData.height;a.blurLayer1||(a.blurLayer1=r.util.createCanvasElement(),a.blurLayer2=r.util.createCanvasElement()),n=a.blurLayer1,f=a.blurLayer2,(n.width!==_||n.height!==h)&&(f.width=n.width=_,f.height=n.height=h);var E=n.getContext("2d"),w=f.getContext("2d"),A=15,D,z,B,Y,H=this.blur*.06*.5;for(E.putImageData(i.imageData,0,0),w.clearRect(0,0,_,h),Y=-A;Y<=A;Y++)D=(Math.random()-.5)/4,z=Y/A,B=H*z*_+D,w.globalAlpha=1-Math.abs(z),w.drawImage(n,B,D),E.drawImage(f,0,0),w.globalAlpha=1,w.clearRect(0,0,f.width,f.height);for(Y=-A;Y<=A;Y++)D=(Math.random()-.5)/4,z=Y/A,B=H*z*h+D,w.globalAlpha=1-Math.abs(z),w.drawImage(n,D,B),E.drawImage(f,0,0),w.globalAlpha=1,w.clearRect(0,0,f.width,f.height);i.ctx.drawImage(n,0,0);var V=i.ctx.getImageData(0,0,n.width,n.height);return E.globalAlpha=1,E.clearRect(0,0,n.width,n.height),V},getUniformLocations:function(i,a){return{delta:i.getUniformLocation(a,"uDelta")}},sendUniformData:function(i,a){var n=this.chooseRightDelta();i.uniform2fv(a.delta,n)},chooseRightDelta:function(){var i=1,a=[0,0],n;return this.horizontal?this.aspectRatio>1&&(i=1/this.aspectRatio):this.aspectRatio<1&&(i=this.aspectRatio),n=i*this.blur*.12,this.horizontal?a[0]=n:a[1]=n,a}}),m.Blur.fromObject=r.Image.filters.BaseFilter.fromObject}(I),function(b){"use strict";var r=b.fabric||(b.fabric={}),m=r.Image.filters,p=r.util.createClass;m.Gamma=p(m.BaseFilter,{type:"Gamma",fragmentSource:`precision highp float;
|
|
374
|
-
uniform sampler2D uTexture;
|
|
375
|
-
uniform vec3 uGamma;
|
|
376
|
-
varying vec2 vTexCoord;
|
|
377
|
-
void main() {
|
|
378
|
-
vec4 color = texture2D(uTexture, vTexCoord);
|
|
379
|
-
vec3 correction = (1.0 / uGamma);
|
|
380
|
-
color.r = pow(color.r, correction.r);
|
|
381
|
-
color.g = pow(color.g, correction.g);
|
|
382
|
-
color.b = pow(color.b, correction.b);
|
|
383
|
-
gl_FragColor = color;
|
|
384
|
-
gl_FragColor.rgb *= color.a;
|
|
385
|
-
}`,gamma:[1,1,1],mainParameter:"gamma",initialize:function(i){this.gamma=[1,1,1],m.BaseFilter.prototype.initialize.call(this,i)},applyTo2d:function(i){var a=i.imageData,n=a.data,f=this.gamma,_=n.length,h=1/f[0],E=1/f[1],w=1/f[2],A;for(this.rVals||(this.rVals=new Uint8Array(256),this.gVals=new Uint8Array(256),this.bVals=new Uint8Array(256)),A=0,_=256;A<_;A++)this.rVals[A]=Math.pow(A/255,h)*255,this.gVals[A]=Math.pow(A/255,E)*255,this.bVals[A]=Math.pow(A/255,w)*255;for(A=0,_=n.length;A<_;A+=4)n[A]=this.rVals[n[A]],n[A+1]=this.gVals[n[A+1]],n[A+2]=this.bVals[n[A+2]]},getUniformLocations:function(i,a){return{uGamma:i.getUniformLocation(a,"uGamma")}},sendUniformData:function(i,a){i.uniform3fv(a.uGamma,this.gamma)}}),r.Image.filters.Gamma.fromObject=r.Image.filters.BaseFilter.fromObject}(I),function(b){"use strict";var r=b.fabric||(b.fabric={}),m=r.Image.filters,p=r.util.createClass;m.Composed=p(m.BaseFilter,{type:"Composed",subFilters:[],initialize:function(i){this.callSuper("initialize",i),this.subFilters=this.subFilters.slice(0)},applyTo:function(i){i.passes+=this.subFilters.length-1,this.subFilters.forEach(function(a){a.applyTo(i)})},toObject:function(){return r.util.object.extend(this.callSuper("toObject"),{subFilters:this.subFilters.map(function(i){return i.toObject()})})},isNeutralState:function(){return!this.subFilters.some(function(i){return!i.isNeutralState()})}}),r.Image.filters.Composed.fromObject=function(i,a){var n=i.subFilters||[],f=n.map(function(h){return new r.Image.filters[h.type](h)}),_=new r.Image.filters.Composed({subFilters:f});return a&&a(_),_}}(I),function(b){"use strict";var r=b.fabric||(b.fabric={}),m=r.Image.filters,p=r.util.createClass;m.HueRotation=p(m.ColorMatrix,{type:"HueRotation",rotation:0,mainParameter:"rotation",calculateMatrix:function(){var i=this.rotation*Math.PI,a=r.util.cos(i),n=r.util.sin(i),f=1/3,_=Math.sqrt(f)*n,h=1-a;this.matrix=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],this.matrix[0]=a+h/3,this.matrix[1]=f*h-_,this.matrix[2]=f*h+_,this.matrix[5]=f*h+_,this.matrix[6]=a+f*h,this.matrix[7]=f*h-_,this.matrix[10]=f*h-_,this.matrix[11]=f*h+_,this.matrix[12]=a+f*h},isNeutralState:function(i){return this.calculateMatrix(),m.BaseFilter.prototype.isNeutralState.call(this,i)},applyTo:function(i){this.calculateMatrix(),m.BaseFilter.prototype.applyTo.call(this,i)}}),r.Image.filters.HueRotation.fromObject=r.Image.filters.BaseFilter.fromObject}(I),function(b){"use strict";var r=b.fabric||(b.fabric={}),m=r.util.object.clone;if(r.Text){r.warn("fabric.Text is already defined");return}var p="fontFamily fontWeight fontSize text underline overline linethrough textAlign fontStyle lineHeight textBackgroundColor charSpacing styles direction path pathStartOffset pathSide".split(" ");r.Text=r.util.createClass(r.Object,{_dimensionAffectingProps:["fontSize","fontWeight","fontFamily","fontStyle","lineHeight","text","charSpacing","textAlign","styles","path","pathStartOffset","pathSide"],_reNewline:/\r?\n/,_reSpacesAndTabs:/[ \t\r]/g,_reSpaceAndTab:/[ \t\r]/,_reWords:/\S+/g,type:"text",fontSize:40,fontWeight:"normal",fontFamily:"Times New Roman",underline:!1,overline:!1,linethrough:!1,textAlign:"left",fontStyle:"normal",lineHeight:1.16,superscript:{size:.6,baseline:-.35},subscript:{size:.6,baseline:.11},textBackgroundColor:"",stateProperties:r.Object.prototype.stateProperties.concat(p),cacheProperties:r.Object.prototype.cacheProperties.concat(p),stroke:null,shadow:null,path:null,pathStartOffset:0,pathSide:"left",_fontSizeFraction:.222,offsets:{underline:.1,linethrough:-.315,overline:-.88},_fontSizeMult:1.13,charSpacing:0,styles:null,_measuringContext:null,deltaY:0,direction:"ltr",_styleProperties:["stroke","strokeWidth","fill","fontFamily","fontSize","fontWeight","fontStyle","underline","overline","linethrough","deltaY","textBackgroundColor"],__charBounds:[],CACHE_FONT_SIZE:400,MIN_TEXT_WIDTH:2,initialize:function(i,a){this.styles=a?a.styles||{}:{},this.text=i,this.__skipDimension=!0,this.callSuper("initialize",a),this.path&&this.setPathInfo(),this.__skipDimension=!1,this.initDimensions(),this.setCoords(),this.setupState({propertySet:"_dimensionAffectingProps"})},setPathInfo:function(){var i=this.path;i&&(i.segmentsInfo=r.util.getPathSegmentsInfo(i.path))},getMeasuringContext:function(){return r._measuringContext||(r._measuringContext=this.canvas&&this.canvas.contextCache||r.util.createCanvasElement().getContext("2d")),r._measuringContext},_splitText:function(){var i=this._splitTextIntoLines(this.text);return this.textLines=i.lines,this._textLines=i.graphemeLines,this._unwrappedTextLines=i._unwrappedLines,this._text=i.graphemeText,i},initDimensions:function(){this.__skipDimension||(this._splitText(),this._clearCache(),this.path?(this.width=this.path.width,this.height=this.path.height):(this.width=this.calcTextWidth()||this.cursorWidth||this.MIN_TEXT_WIDTH,this.height=this.calcTextHeight()),this.textAlign.indexOf("justify")!==-1&&this.enlargeSpaces(),this.saveState({propertySet:"_dimensionAffectingProps"}))},enlargeSpaces:function(){for(var i,a,n,f,_,h,E,w=0,A=this._textLines.length;w<A;w++)if(!(this.textAlign!=="justify"&&(w===A-1||this.isEndOfWrapping(w)))&&(f=0,_=this._textLines[w],a=this.getLineWidth(w),a<this.width&&(E=this.textLines[w].match(this._reSpacesAndTabs)))){n=E.length,i=(this.width-a)/n;for(var D=0,z=_.length;D<=z;D++)h=this.__charBounds[w][D],this._reSpaceAndTab.test(_[D])?(h.width+=i,h.kernedWidth+=i,h.left+=f,f+=i):h.left+=f}},isEndOfWrapping:function(i){return i===this._textLines.length-1},missingNewlineOffset:function(){return 1},toString:function(){return"#<fabric.Text ("+this.complexity()+'): { "text": "'+this.text+'", "fontFamily": "'+this.fontFamily+'" }>'},_getCacheCanvasDimensions:function(){var i=this.callSuper("_getCacheCanvasDimensions"),a=this.fontSize;return i.width+=a*i.zoomX,i.height+=a*i.zoomY,i},_render:function(i){var a=this.path;a&&!a.isNotVisible()&&a._render(i),this._setTextStyles(i),this._renderTextLinesBackground(i),this._renderTextDecoration(i,"underline"),this._renderText(i),this._renderTextDecoration(i,"overline"),this._renderTextDecoration(i,"linethrough")},_renderText:function(i){this.paintFirst==="stroke"?(this._renderTextStroke(i),this._renderTextFill(i)):(this._renderTextFill(i),this._renderTextStroke(i))},_setTextStyles:function(i,a,n){i.textBaseline="alphabetic",i.font=this._getFontDeclaration(a,n)},calcTextWidth:function(){for(var i=this.getLineWidth(0),a=1,n=this._textLines.length;a<n;a++){var f=this.getLineWidth(a);f>i&&(i=f)}return i},_renderTextLine:function(i,a,n,f,_,h){this._renderChars(i,a,n,f,_,h)},_renderTextLinesBackground:function(i){if(!(!this.textBackgroundColor&&!this.styleHas("textBackgroundColor"))){for(var a,n,f=i.fillStyle,_,h,E=this._getLeftOffset(),w=this._getTopOffset(),A=0,D=0,z,B,Y=this.path,H,V=0,lt=this._textLines.length;V<lt;V++){if(a=this.getHeightOfLine(V),!this.textBackgroundColor&&!this.styleHas("textBackgroundColor",V)){w+=a;continue}_=this._textLines[V],n=this._getLineLeftOffset(V),D=0,A=0,h=this.getValueOfPropertyAt(V,0,"textBackgroundColor");for(var rt=0,St=_.length;rt<St;rt++)z=this.__charBounds[V][rt],B=this.getValueOfPropertyAt(V,rt,"textBackgroundColor"),Y?(i.save(),i.translate(z.renderLeft,z.renderTop),i.rotate(z.angle),i.fillStyle=B,B&&i.fillRect(-z.width/2,-a/this.lineHeight*(1-this._fontSizeFraction),z.width,a/this.lineHeight),i.restore()):B!==h?(H=E+n+A,this.direction==="rtl"&&(H=this.width-H-D),i.fillStyle=h,h&&i.fillRect(H,w,D,a/this.lineHeight),A=z.left,D=z.width,h=B):D+=z.kernedWidth;B&&!Y&&(H=E+n+A,this.direction==="rtl"&&(H=this.width-H-D),i.fillStyle=B,i.fillRect(H,w,D,a/this.lineHeight)),w+=a}i.fillStyle=f,this._removeShadow(i)}},getFontCache:function(i){var a=i.fontFamily.toLowerCase();r.charWidthsCache[a]||(r.charWidthsCache[a]={});var n=r.charWidthsCache[a],f=i.fontStyle.toLowerCase()+"_"+(i.fontWeight+"").toLowerCase();return n[f]||(n[f]={}),n[f]},_measureChar:function(i,a,n,f){var _=this.getFontCache(a),h=this._getFontDeclaration(a),E=this._getFontDeclaration(f),w=n+i,A=h===E,D,z,B,Y=a.fontSize/this.CACHE_FONT_SIZE,H;if(n&&_[n]!==void 0&&(B=_[n]),_[i]!==void 0&&(H=D=_[i]),A&&_[w]!==void 0&&(z=_[w],H=z-B),D===void 0||B===void 0||z===void 0){var V=this.getMeasuringContext();this._setTextStyles(V,a,!0)}return D===void 0&&(H=D=V.measureText(i).width,_[i]=D),B===void 0&&A&&n&&(B=V.measureText(n).width,_[n]=B),A&&z===void 0&&(z=V.measureText(w).width,_[w]=z,H=z-B),{width:D*Y,kernedWidth:H*Y}},getHeightOfChar:function(i,a){return this.getValueOfPropertyAt(i,a,"fontSize")},measureLine:function(i){var a=this._measureLine(i);return this.charSpacing!==0&&(a.width-=this._getWidthOfCharSpacing()),a.width<0&&(a.width=0),a},_measureLine:function(i){var a=0,n,f,_=this._textLines[i],h,E,w=0,A=new Array(_.length),D=0,z,B,Y=this.path,H=this.pathSide==="right";for(this.__charBounds[i]=A,n=0;n<_.length;n++)f=_[n],E=this._getGraphemeBox(f,i,n,h),A[n]=E,a+=E.kernedWidth,h=f;if(A[n]={left:E?E.left+E.width:0,width:0,kernedWidth:0,height:this.fontSize},Y){switch(B=Y.segmentsInfo[Y.segmentsInfo.length-1].length,z=r.util.getPointOnPath(Y.path,0,Y.segmentsInfo),z.x+=Y.pathOffset.x,z.y+=Y.pathOffset.y,this.textAlign){case"left":D=H?B-a:0;break;case"center":D=(B-a)/2;break;case"right":D=H?0:B-a;break}for(D+=this.pathStartOffset*(H?-1:1),n=H?_.length-1:0;H?n>=0:n<_.length;H?n--:n++)E=A[n],D>B?D%=B:D<0&&(D+=B),this._setGraphemeOnPath(D,E,z),D+=E.kernedWidth}return{width:a,numOfSpaces:w}},_setGraphemeOnPath:function(i,a,n){var f=i+a.kernedWidth/2,_=this.path,h=r.util.getPointOnPath(_.path,f,_.segmentsInfo);a.renderLeft=h.x-n.x,a.renderTop=h.y-n.y,a.angle=h.angle+(this.pathSide==="right"?Math.PI:0)},_getGraphemeBox:function(i,a,n,f,_){var h=this.getCompleteStyleDeclaration(a,n),E=f?this.getCompleteStyleDeclaration(a,n-1):{},w=this._measureChar(i,h,f,E),A=w.kernedWidth,D=w.width,z;this.charSpacing!==0&&(z=this._getWidthOfCharSpacing(),D+=z,A+=z);var B={width:D,left:0,height:h.fontSize,kernedWidth:A,deltaY:h.deltaY};if(n>0&&!_){var Y=this.__charBounds[a][n-1];B.left=Y.left+Y.width+w.kernedWidth-w.width}return B},getHeightOfLine:function(i){if(this.__lineHeights[i])return this.__lineHeights[i];for(var a=this._textLines[i],n=this.getHeightOfChar(i,0),f=1,_=a.length;f<_;f++)n=Math.max(this.getHeightOfChar(i,f),n);return this.__lineHeights[i]=n*this.lineHeight*this._fontSizeMult},calcTextHeight:function(){for(var i,a=0,n=0,f=this._textLines.length;n<f;n++)i=this.getHeightOfLine(n),a+=n===f-1?i/this.lineHeight:i;return a},_getLeftOffset:function(){return this.direction==="ltr"?-this.width/2:this.width/2},_getTopOffset:function(){return-this.height/2},_renderTextCommon:function(i,a){i.save();for(var n=0,f=this._getLeftOffset(),_=this._getTopOffset(),h=0,E=this._textLines.length;h<E;h++){var w=this.getHeightOfLine(h),A=w/this.lineHeight,D=this._getLineLeftOffset(h);this._renderTextLine(a,i,this._textLines[h],f+D,_+n+A,h),n+=w}i.restore()},_renderTextFill:function(i){!this.fill&&!this.styleHas("fill")||this._renderTextCommon(i,"fillText")},_renderTextStroke:function(i){(!this.stroke||this.strokeWidth===0)&&this.isEmptyStyles()||(this.shadow&&!this.shadow.affectStroke&&this._removeShadow(i),i.save(),this._setLineDash(i,this.strokeDashArray),i.beginPath(),this._renderTextCommon(i,"strokeText"),i.closePath(),i.restore())},_renderChars:function(i,a,n,f,_,h){var E=this.getHeightOfLine(h),w=this.textAlign.indexOf("justify")!==-1,A,D,z="",B,Y=0,H,V=this.path,lt=!w&&this.charSpacing===0&&this.isEmptyStyles(h)&&!V,rt=this.direction==="ltr",St=this.direction==="ltr"?1:-1,q;if(a.save(),_-=E*this._fontSizeFraction/this.lineHeight,lt){a.canvas.setAttribute("dir",rt?"ltr":"rtl"),a.direction=rt?"ltr":"rtl",a.textAlign=rt?"left":"right",this._renderChar(i,a,h,0,n.join(""),f,_,E),a.restore();return}for(var _t=0,G=n.length-1;_t<=G;_t++)H=_t===G||this.charSpacing||V,z+=n[_t],B=this.__charBounds[h][_t],Y===0?(f+=St*(B.kernedWidth-B.width),Y+=B.width):Y+=B.kernedWidth,w&&!H&&this._reSpaceAndTab.test(n[_t])&&(H=!0),H||(A=A||this.getCompleteStyleDeclaration(h,_t),D=this.getCompleteStyleDeclaration(h,_t+1),H=this._hasStyleChanged(A,D)),H&&(V?(a.save(),a.translate(B.renderLeft,B.renderTop),a.rotate(B.angle),this._renderChar(i,a,h,_t,z,-Y/2,0,E),a.restore()):(q=f,a.canvas.setAttribute("dir",rt?"ltr":"rtl"),a.direction=rt?"ltr":"rtl",a.textAlign=rt?"left":"right",this._renderChar(i,a,h,_t,z,q,_,E)),z="",A=D,f+=St*Y,Y=0);a.restore()},_applyPatternGradientTransformText:function(i){var a=r.util.createCanvasElement(),n,f=this.width+this.strokeWidth,_=this.height+this.strokeWidth;return a.width=f,a.height=_,n=a.getContext("2d"),n.beginPath(),n.moveTo(0,0),n.lineTo(f,0),n.lineTo(f,_),n.lineTo(0,_),n.closePath(),n.translate(f/2,_/2),n.fillStyle=i.toLive(n),this._applyPatternGradientTransform(n,i),n.fill(),n.createPattern(a,"no-repeat")},handleFiller:function(i,a,n){var f,_;return n.toLive?n.gradientUnits==="percentage"||n.gradientTransform||n.patternTransform?(f=-this.width/2,_=-this.height/2,i.translate(f,_),i[a]=this._applyPatternGradientTransformText(n),{offsetX:f,offsetY:_}):(i[a]=n.toLive(i,this),this._applyPatternGradientTransform(i,n)):(i[a]=n,{offsetX:0,offsetY:0})},_setStrokeStyles:function(i,a){return i.lineWidth=a.strokeWidth,i.lineCap=this.strokeLineCap,i.lineDashOffset=this.strokeDashOffset,i.lineJoin=this.strokeLineJoin,i.miterLimit=this.strokeMiterLimit,this.handleFiller(i,"strokeStyle",a.stroke)},_setFillStyles:function(i,a){return this.handleFiller(i,"fillStyle",a.fill)},_renderChar:function(i,a,n,f,_,h,E){var w=this._getStyleDeclaration(n,f),A=this.getCompleteStyleDeclaration(n,f),D=i==="fillText"&&A.fill,z=i==="strokeText"&&A.stroke&&A.strokeWidth,B,Y;!z&&!D||(a.save(),D&&(B=this._setFillStyles(a,A)),z&&(Y=this._setStrokeStyles(a,A)),a.font=this._getFontDeclaration(A),w&&w.textBackgroundColor&&this._removeShadow(a),w&&w.deltaY&&(E+=w.deltaY),D&&a.fillText(_,h-B.offsetX,E-B.offsetY),z&&a.strokeText(_,h-Y.offsetX,E-Y.offsetY),a.restore())},setSuperscript:function(i,a){return this._setScript(i,a,this.superscript)},setSubscript:function(i,a){return this._setScript(i,a,this.subscript)},_setScript:function(i,a,n){var f=this.get2DCursorLocation(i,!0),_=this.getValueOfPropertyAt(f.lineIndex,f.charIndex,"fontSize"),h=this.getValueOfPropertyAt(f.lineIndex,f.charIndex,"deltaY"),E={fontSize:_*n.size,deltaY:h+_*n.baseline};return this.setSelectionStyles(E,i,a),this},_hasStyleChanged:function(i,a){return i.fill!==a.fill||i.stroke!==a.stroke||i.strokeWidth!==a.strokeWidth||i.fontSize!==a.fontSize||i.fontFamily!==a.fontFamily||i.fontWeight!==a.fontWeight||i.fontStyle!==a.fontStyle||i.deltaY!==a.deltaY},_hasStyleChangedForSvg:function(i,a){return this._hasStyleChanged(i,a)||i.overline!==a.overline||i.underline!==a.underline||i.linethrough!==a.linethrough},_getLineLeftOffset:function(i){var a=this.getLineWidth(i),n=this.width-a,f=this.textAlign,_=this.direction,E,h=0,E=this.isEndOfWrapping(i);return f==="justify"||f==="justify-center"&&!E||f==="justify-right"&&!E||f==="justify-left"&&!E?0:(f==="center"&&(h=n/2),f==="right"&&(h=n),f==="justify-center"&&(h=n/2),f==="justify-right"&&(h=n),_==="rtl"&&(h-=n),h)},_clearCache:function(){this.__lineWidths=[],this.__lineHeights=[],this.__charBounds=[]},_shouldClearDimensionCache:function(){var i=this._forceClearCache;return i||(i=this.hasStateChanged("_dimensionAffectingProps")),i&&(this.dirty=!0,this._forceClearCache=!1),i},getLineWidth:function(i){if(this.__lineWidths[i])return this.__lineWidths[i];var a,n=this._textLines[i],f;return n===""?a=0:(f=this.measureLine(i),a=f.width),this.__lineWidths[i]=a,a},_getWidthOfCharSpacing:function(){return this.charSpacing!==0?this.fontSize*this.charSpacing/1e3:0},getValueOfPropertyAt:function(i,a,n){var f=this._getStyleDeclaration(i,a);return f&&typeof f[n]!="undefined"?f[n]:this[n]},_renderTextDecoration:function(i,a){if(!(!this[a]&&!this.styleHas(a))){for(var n,f,_,h,E,w,A,D,z=this._getLeftOffset(),B=this._getTopOffset(),Y,H,V,lt,rt,St,q,_t,G=this.path,Ut=this._getWidthOfCharSpacing(),xt=this.offsets[a],Ht=0,it=this._textLines.length;Ht<it;Ht++){if(n=this.getHeightOfLine(Ht),!this[a]&&!this.styleHas(a,Ht)){B+=n;continue}A=this._textLines[Ht],St=n/this.lineHeight,h=this._getLineLeftOffset(Ht),H=0,V=0,D=this.getValueOfPropertyAt(Ht,0,a),_t=this.getValueOfPropertyAt(Ht,0,"fill"),Y=B+St*(1-this._fontSizeFraction),f=this.getHeightOfChar(Ht,0),E=this.getValueOfPropertyAt(Ht,0,"deltaY");for(var ut=0,tt=A.length;ut<tt;ut++)if(lt=this.__charBounds[Ht][ut],rt=this.getValueOfPropertyAt(Ht,ut,a),q=this.getValueOfPropertyAt(Ht,ut,"fill"),_=this.getHeightOfChar(Ht,ut),w=this.getValueOfPropertyAt(Ht,ut,"deltaY"),G&&rt&&q)i.save(),i.fillStyle=_t,i.translate(lt.renderLeft,lt.renderTop),i.rotate(lt.angle),i.fillRect(-lt.kernedWidth/2,xt*_+w,lt.kernedWidth,this.fontSize/15),i.restore();else if((rt!==D||q!==_t||_!==f||w!==E)&&V>0){var Z=z+h+H;this.direction==="rtl"&&(Z=this.width-Z-V),D&&_t&&(i.fillStyle=_t,i.fillRect(Z,Y+xt*f+E,V,this.fontSize/15)),H=lt.left,V=lt.width,D=rt,_t=q,f=_,E=w}else V+=lt.kernedWidth;var Z=z+h+H;this.direction==="rtl"&&(Z=this.width-Z-V),i.fillStyle=q,rt&&q&&i.fillRect(Z,Y+xt*f+E,V-Ut,this.fontSize/15),B+=n}this._removeShadow(i)}},_getFontDeclaration:function(i,a){var n=i||this,f=this.fontFamily,_=r.Text.genericFonts.indexOf(f.toLowerCase())>-1,h=f===void 0||f.indexOf("'")>-1||f.indexOf(",")>-1||f.indexOf('"')>-1||_?n.fontFamily:'"'+n.fontFamily+'"';return[r.isLikelyNode?n.fontWeight:n.fontStyle,r.isLikelyNode?n.fontStyle:n.fontWeight,a?this.CACHE_FONT_SIZE+"px":n.fontSize+"px",h].join(" ")},render:function(i){this.visible&&(this.canvas&&this.canvas.skipOffscreen&&!this.group&&!this.isOnScreen()||(this._shouldClearDimensionCache()&&this.initDimensions(),this.callSuper("render",i)))},_splitTextIntoLines:function(i){for(var a=i.split(this._reNewline),n=new Array(a.length),f=[`
|
|
386
|
-
`],_=[],h=0;h<a.length;h++)n[h]=r.util.string.graphemeSplit(a[h]),_=_.concat(n[h],f);return _.pop(),{_unwrappedLines:n,lines:a,graphemeText:_,graphemeLines:n}},toObject:function(i){var a=p.concat(i),n=this.callSuper("toObject",a);return n.styles=m(this.styles,!0),n.path&&(n.path=this.path.toObject()),n},set:function(i,a){this.callSuper("set",i,a);var n=!1,f=!1;if(typeof i=="object")for(var _ in i)_==="path"&&this.setPathInfo(),n=n||this._dimensionAffectingProps.indexOf(_)!==-1,f=f||_==="path";else n=this._dimensionAffectingProps.indexOf(i)!==-1,f=i==="path";return f&&this.setPathInfo(),n&&(this.initDimensions(),this.setCoords()),this},complexity:function(){return 1}}),r.Text.ATTRIBUTE_NAMES=r.SHARED_ATTRIBUTES.concat("x y dx dy font-family font-style font-weight font-size letter-spacing text-decoration text-anchor".split(" ")),r.Text.DEFAULT_SVG_FONT_SIZE=16,r.Text.fromElement=function(i,a,n){if(!i)return a(null);var f=r.parseAttributes(i,r.Text.ATTRIBUTE_NAMES),_=f.textAnchor||"left";if(n=r.util.object.extend(n?m(n):{},f),n.top=n.top||0,n.left=n.left||0,f.textDecoration){var h=f.textDecoration;h.indexOf("underline")!==-1&&(n.underline=!0),h.indexOf("overline")!==-1&&(n.overline=!0),h.indexOf("line-through")!==-1&&(n.linethrough=!0),delete n.textDecoration}"dx"in f&&(n.left+=f.dx),"dy"in f&&(n.top+=f.dy),"fontSize"in n||(n.fontSize=r.Text.DEFAULT_SVG_FONT_SIZE);var E="";"textContent"in i?E=i.textContent:"firstChild"in i&&i.firstChild!==null&&"data"in i.firstChild&&i.firstChild.data!==null&&(E=i.firstChild.data),E=E.replace(/^\s+|\s+$|\n+/g,"").replace(/\s+/g," ");var w=n.strokeWidth;n.strokeWidth=0;var A=new r.Text(E,n),D=A.getScaledHeight()/A.height,z=(A.height+A.strokeWidth)*A.lineHeight-A.height,B=z*D,Y=A.getScaledHeight()+B,H=0;_==="center"&&(H=A.getScaledWidth()/2),_==="right"&&(H=A.getScaledWidth()),A.set({left:A.left-H,top:A.top-(Y-A.fontSize*(.07+A._fontSizeFraction))/A.lineHeight,strokeWidth:typeof w!="undefined"?w:1}),a(A)},r.Text.fromObject=function(i,a){var n=m(i),f=i.path;return delete n.path,r.Object._fromObject("Text",n,function(_){f?r.Object._fromObject("Path",f,function(h){_.set("path",h),a(_)},"path"):a(_)},"text")},r.Text.genericFonts=["sans-serif","serif","cursive","fantasy","monospace"],r.util.createAccessors&&r.util.createAccessors(r.Text)}(I),function(){c.util.object.extend(c.Text.prototype,{isEmptyStyles:function(b){if(!this.styles||typeof b!="undefined"&&!this.styles[b])return!0;var r=typeof b=="undefined"?this.styles:{line:this.styles[b]};for(var m in r)for(var p in r[m])for(var i in r[m][p])return!1;return!0},styleHas:function(b,r){if(!this.styles||!b||b===""||typeof r!="undefined"&&!this.styles[r])return!1;var m=typeof r=="undefined"?this.styles:{0:this.styles[r]};for(var p in m)for(var i in m[p])if(typeof m[p][i][b]!="undefined")return!0;return!1},cleanStyle:function(b){if(!this.styles||!b||b==="")return!1;var r=this.styles,m=0,p,i,a=!0,n=0,f;for(var _ in r){p=0;for(var h in r[_]){var f=r[_][h],E=f.hasOwnProperty(b);m++,E?(i?f[b]!==i&&(a=!1):i=f[b],f[b]===this[b]&&delete f[b]):a=!1,Object.keys(f).length!==0?p++:delete r[_][h]}p===0&&delete r[_]}for(var w=0;w<this._textLines.length;w++)n+=this._textLines[w].length;a&&m===n&&(this[b]=i,this.removeStyle(b))},removeStyle:function(b){if(!(!this.styles||!b||b==="")){var r=this.styles,m,p,i;for(p in r){m=r[p];for(i in m)delete m[i][b],Object.keys(m[i]).length===0&&delete m[i];Object.keys(m).length===0&&delete r[p]}}},_extendStyles:function(b,r){var m=this.get2DCursorLocation(b);this._getLineStyle(m.lineIndex)||this._setLineStyle(m.lineIndex),this._getStyleDeclaration(m.lineIndex,m.charIndex)||this._setStyleDeclaration(m.lineIndex,m.charIndex,{}),c.util.object.extend(this._getStyleDeclaration(m.lineIndex,m.charIndex),r)},get2DCursorLocation:function(b,r){typeof b=="undefined"&&(b=this.selectionStart);for(var m=r?this._unwrappedTextLines:this._textLines,p=m.length,i=0;i<p;i++){if(b<=m[i].length)return{lineIndex:i,charIndex:b};b-=m[i].length+this.missingNewlineOffset(i)}return{lineIndex:i-1,charIndex:m[i-1].length<b?m[i-1].length:b}},getSelectionStyles:function(b,r,m){typeof b=="undefined"&&(b=this.selectionStart||0),typeof r=="undefined"&&(r=this.selectionEnd||b);for(var p=[],i=b;i<r;i++)p.push(this.getStyleAtPosition(i,m));return p},getStyleAtPosition:function(b,r){var m=this.get2DCursorLocation(b),p=r?this.getCompleteStyleDeclaration(m.lineIndex,m.charIndex):this._getStyleDeclaration(m.lineIndex,m.charIndex);return p||{}},setSelectionStyles:function(b,r,m){typeof r=="undefined"&&(r=this.selectionStart||0),typeof m=="undefined"&&(m=this.selectionEnd||r);for(var p=r;p<m;p++)this._extendStyles(p,b);return this._forceClearCache=!0,this},_getStyleDeclaration:function(b,r){var m=this.styles&&this.styles[b];return m?m[r]:null},getCompleteStyleDeclaration:function(b,r){for(var m=this._getStyleDeclaration(b,r)||{},p={},i,a=0;a<this._styleProperties.length;a++)i=this._styleProperties[a],p[i]=typeof m[i]=="undefined"?this[i]:m[i];return p},_setStyleDeclaration:function(b,r,m){this.styles[b][r]=m},_deleteStyleDeclaration:function(b,r){delete this.styles[b][r]},_getLineStyle:function(b){return!!this.styles[b]},_setLineStyle:function(b){this.styles[b]={}},_deleteLineStyle:function(b){delete this.styles[b]}})}(),function(){function b(r){r.textDecoration&&(r.textDecoration.indexOf("underline")>-1&&(r.underline=!0),r.textDecoration.indexOf("line-through")>-1&&(r.linethrough=!0),r.textDecoration.indexOf("overline")>-1&&(r.overline=!0),delete r.textDecoration)}e(b,"parseDecoration"),c.IText=c.util.createClass(c.Text,c.Observable,{type:"i-text",selectionStart:0,selectionEnd:0,selectionColor:"rgba(17,119,255,0.3)",isEditing:!1,editable:!0,editingBorderColor:"rgba(102,153,255,0.25)",cursorWidth:2,cursorColor:"",cursorDelay:1e3,cursorDuration:600,caching:!0,hiddenTextareaContainer:null,_reSpace:/\s|\n/,_currentCursorOpacity:0,_selectionDirection:null,_abortCursorAnimation:!1,__widthOfSpace:[],inCompositionMode:!1,initialize:function(r,m){this.callSuper("initialize",r,m),this.initBehavior()},setSelectionStart:function(r){r=Math.max(r,0),this._updateAndFire("selectionStart",r)},setSelectionEnd:function(r){r=Math.min(r,this.text.length),this._updateAndFire("selectionEnd",r)},_updateAndFire:function(r,m){this[r]!==m&&(this._fireSelectionChanged(),this[r]=m),this._updateTextarea()},_fireSelectionChanged:function(){this.fire("selection:changed"),this.canvas&&this.canvas.fire("text:selection:changed",{target:this})},initDimensions:function(){this.isEditing&&this.initDelayedCursor(),this.clearContextTop(),this.callSuper("initDimensions")},render:function(r){this.clearContextTop(),this.callSuper("render",r),this.cursorOffsetCache={},this.renderCursorOrSelection()},_render:function(r){this.callSuper("_render",r)},clearContextTop:function(r){if(!(!this.isEditing||!this.canvas||!this.canvas.contextTop)){var m=this.canvas.contextTop,p=this.canvas.viewportTransform;m.save(),m.transform(p[0],p[1],p[2],p[3],p[4],p[5]),this.transform(m),this._clearTextArea(m),r||m.restore()}},renderCursorOrSelection:function(){if(!(!this.isEditing||!this.canvas||!this.canvas.contextTop)){var r=this._getCursorBoundaries(),m=this.canvas.contextTop;this.clearContextTop(!0),this.selectionStart===this.selectionEnd?this.renderCursor(r,m):this.renderSelection(r,m),m.restore()}},_clearTextArea:function(r){var m=this.width+4,p=this.height+4;r.clearRect(-m/2,-p/2,m,p)},_getCursorBoundaries:function(r){typeof r=="undefined"&&(r=this.selectionStart);var m=this._getLeftOffset(),p=this._getTopOffset(),i=this._getCursorBoundariesOffsets(r);return{left:m,top:p,leftOffset:i.left,topOffset:i.top}},_getCursorBoundariesOffsets:function(r){if(this.cursorOffsetCache&&"top"in this.cursorOffsetCache)return this.cursorOffsetCache;var m,p,i,a=0,n=0,f,_=this.get2DCursorLocation(r);i=_.charIndex,p=_.lineIndex;for(var h=0;h<p;h++)a+=this.getHeightOfLine(h);m=this._getLineLeftOffset(p);var E=this.__charBounds[p][i];return E&&(n=E.left),this.charSpacing!==0&&i===this._textLines[p].length&&(n-=this._getWidthOfCharSpacing()),f={top:a,left:m+(n>0?n:0)},this.direction==="rtl"&&(f.left*=-1),this.cursorOffsetCache=f,this.cursorOffsetCache},renderCursor:function(r,m){var p=this.get2DCursorLocation(),i=p.lineIndex,a=p.charIndex>0?p.charIndex-1:0,n=this.getValueOfPropertyAt(i,a,"fontSize"),f=this.scaleX*this.canvas.getZoom(),_=this.cursorWidth/f,h=r.topOffset,E=this.getValueOfPropertyAt(i,a,"deltaY");h+=(1-this._fontSizeFraction)*this.getHeightOfLine(i)/this.lineHeight-n*(1-this._fontSizeFraction),this.inCompositionMode&&this.renderSelection(r,m),m.fillStyle=this.cursorColor||this.getValueOfPropertyAt(i,a,"fill"),m.globalAlpha=this.__isMousedown?1:this._currentCursorOpacity,m.fillRect(r.left+r.leftOffset-_/2,h+r.top+E,_,n)},renderSelection:function(r,m){for(var p=this.inCompositionMode?this.hiddenTextarea.selectionStart:this.selectionStart,i=this.inCompositionMode?this.hiddenTextarea.selectionEnd:this.selectionEnd,a=this.textAlign.indexOf("justify")!==-1,n=this.get2DCursorLocation(p),f=this.get2DCursorLocation(i),_=n.lineIndex,h=f.lineIndex,E=n.charIndex<0?0:n.charIndex,w=f.charIndex<0?0:f.charIndex,A=_;A<=h;A++){var D=this._getLineLeftOffset(A)||0,z=this.getHeightOfLine(A),B=0,Y=0,H=0;if(A===_&&(Y=this.__charBounds[_][E].left),A>=_&&A<h)H=a&&!this.isEndOfWrapping(A)?this.width:this.getLineWidth(A)||5;else if(A===h)if(w===0)H=this.__charBounds[h][w].left;else{var V=this._getWidthOfCharSpacing();H=this.__charBounds[h][w-1].left+this.__charBounds[h][w-1].width-V}B=z,(this.lineHeight<1||A===h&&this.lineHeight>1)&&(z/=this.lineHeight);var lt=r.left+D+Y,rt=H-Y,St=z,q=0;this.inCompositionMode?(m.fillStyle=this.compositionColor||"black",St=1,q=z):m.fillStyle=this.selectionColor,this.direction==="rtl"&&(lt=this.width-lt-rt),m.fillRect(lt,r.top+r.topOffset+q,rt,St),r.topOffset+=B}},getCurrentCharFontSize:function(){var r=this._getCurrentCharIndex();return this.getValueOfPropertyAt(r.l,r.c,"fontSize")},getCurrentCharColor:function(){var r=this._getCurrentCharIndex();return this.getValueOfPropertyAt(r.l,r.c,"fill")},_getCurrentCharIndex:function(){var r=this.get2DCursorLocation(this.selectionStart,!0),m=r.charIndex>0?r.charIndex-1:0;return{l:r.lineIndex,c:m}}}),c.IText.fromObject=function(r,m){if(b(r),r.styles)for(var p in r.styles)for(var i in r.styles[p])b(r.styles[p][i]);c.Object._fromObject("IText",r,m,"text")}}(),function(){var b=c.util.object.clone;c.util.object.extend(c.IText.prototype,{initBehavior:function(){this.initAddedHandler(),this.initRemovedHandler(),this.initCursorSelectionHandlers(),this.initDoubleClickSimulation(),this.mouseMoveHandler=this.mouseMoveHandler.bind(this)},onDeselect:function(){this.isEditing&&this.exitEditing(),this.selected=!1},initAddedHandler:function(){var r=this;this.on("added",function(){var m=r.canvas;m&&(m._hasITextHandlers||(m._hasITextHandlers=!0,r._initCanvasHandlers(m)),m._iTextInstances=m._iTextInstances||[],m._iTextInstances.push(r))})},initRemovedHandler:function(){var r=this;this.on("removed",function(){var m=r.canvas;m&&(m._iTextInstances=m._iTextInstances||[],c.util.removeFromArray(m._iTextInstances,r),m._iTextInstances.length===0&&(m._hasITextHandlers=!1,r._removeCanvasHandlers(m)))})},_initCanvasHandlers:function(r){r._mouseUpITextHandler=function(){r._iTextInstances&&r._iTextInstances.forEach(function(m){m.__isMousedown=!1})},r.on("mouse:up",r._mouseUpITextHandler)},_removeCanvasHandlers:function(r){r.off("mouse:up",r._mouseUpITextHandler)},_tick:function(){this._currentTickState=this._animateCursor(this,1,this.cursorDuration,"_onTickComplete")},_animateCursor:function(r,m,p,i){var a;return a={isAborted:!1,abort:function(){this.isAborted=!0}},r.animate("_currentCursorOpacity",m,{duration:p,onComplete:function(){a.isAborted||r[i]()},onChange:function(){r.canvas&&r.selectionStart===r.selectionEnd&&r.renderCursorOrSelection()},abort:function(){return a.isAborted}}),a},_onTickComplete:function(){var r=this;this._cursorTimeout1&&clearTimeout(this._cursorTimeout1),this._cursorTimeout1=setTimeout(function(){r._currentTickCompleteState=r._animateCursor(r,0,this.cursorDuration/2,"_tick")},100)},initDelayedCursor:function(r){var m=this,p=r?0:this.cursorDelay;this.abortCursorAnimation(),this._currentCursorOpacity=1,this._cursorTimeout2=setTimeout(function(){m._tick()},p)},abortCursorAnimation:function(){var r=this._currentTickState||this._currentTickCompleteState,m=this.canvas;this._currentTickState&&this._currentTickState.abort(),this._currentTickCompleteState&&this._currentTickCompleteState.abort(),clearTimeout(this._cursorTimeout1),clearTimeout(this._cursorTimeout2),this._currentCursorOpacity=0,r&&m&&m.clearContext(m.contextTop||m.contextContainer)},selectAll:function(){return this.selectionStart=0,this.selectionEnd=this._text.length,this._fireSelectionChanged(),this._updateTextarea(),this},getSelectedText:function(){return this._text.slice(this.selectionStart,this.selectionEnd).join("")},findWordBoundaryLeft:function(r){var m=0,p=r-1;if(this._reSpace.test(this._text[p]))for(;this._reSpace.test(this._text[p]);)m++,p--;for(;/\S/.test(this._text[p])&&p>-1;)m++,p--;return r-m},findWordBoundaryRight:function(r){var m=0,p=r;if(this._reSpace.test(this._text[p]))for(;this._reSpace.test(this._text[p]);)m++,p++;for(;/\S/.test(this._text[p])&&p<this._text.length;)m++,p++;return r+m},findLineBoundaryLeft:function(r){for(var m=0,p=r-1;!/\n/.test(this._text[p])&&p>-1;)m++,p--;return r-m},findLineBoundaryRight:function(r){for(var m=0,p=r;!/\n/.test(this._text[p])&&p<this._text.length;)m++,p++;return r+m},searchWordBoundary:function(r,m){for(var p=this._text,i=this._reSpace.test(p[r])?r-1:r,a=p[i],n=c.reNonWord;!n.test(a)&&i>0&&i<p.length;)i+=m,a=p[i];return n.test(a)&&(i+=m===1?0:1),i},selectWord:function(r){r=r||this.selectionStart;var m=this.searchWordBoundary(r,-1),p=this.searchWordBoundary(r,1);this.selectionStart=m,this.selectionEnd=p,this._fireSelectionChanged(),this._updateTextarea(),this.renderCursorOrSelection()},selectLine:function(r){r=r||this.selectionStart;var m=this.findLineBoundaryLeft(r),p=this.findLineBoundaryRight(r);return this.selectionStart=m,this.selectionEnd=p,this._fireSelectionChanged(),this._updateTextarea(),this},enterEditing:function(r){if(!(this.isEditing||!this.editable))return this.canvas&&(this.canvas.calcOffset(),this.exitEditingOnOthers(this.canvas)),this.isEditing=!0,this.initHiddenTextarea(r),this.hiddenTextarea.focus(),this.hiddenTextarea.value=this.text,this._updateTextarea(),this._saveEditingProps(),this._setEditingProps(),this._textBeforeEdit=this.text,this._tick(),this.fire("editing:entered"),this._fireSelectionChanged(),this.canvas?(this.canvas.fire("text:editing:entered",{target:this}),this.initMouseMoveHandler(),this.canvas.requestRenderAll(),this):this},exitEditingOnOthers:function(r){r._iTextInstances&&r._iTextInstances.forEach(function(m){m.selected=!1,m.isEditing&&m.exitEditing()})},initMouseMoveHandler:function(){this.canvas.on("mouse:move",this.mouseMoveHandler)},mouseMoveHandler:function(r){if(!(!this.__isMousedown||!this.isEditing)){var m=this.getSelectionStartFromPointer(r.e),p=this.selectionStart,i=this.selectionEnd;(m!==this.__selectionStartOnMouseDown||p===i)&&(p===m||i===m)||(m>this.__selectionStartOnMouseDown?(this.selectionStart=this.__selectionStartOnMouseDown,this.selectionEnd=m):(this.selectionStart=m,this.selectionEnd=this.__selectionStartOnMouseDown),(this.selectionStart!==p||this.selectionEnd!==i)&&(this.restartCursorIfNeeded(),this._fireSelectionChanged(),this._updateTextarea(),this.renderCursorOrSelection()))}},_setEditingProps:function(){this.hoverCursor="text",this.canvas&&(this.canvas.defaultCursor=this.canvas.moveCursor="text"),this.borderColor=this.editingBorderColor,this.hasControls=this.selectable=!1,this.lockMovementX=this.lockMovementY=!0},fromStringToGraphemeSelection:function(r,m,p){var i=p.slice(0,r),a=c.util.string.graphemeSplit(i).length;if(r===m)return{selectionStart:a,selectionEnd:a};var n=p.slice(r,m),f=c.util.string.graphemeSplit(n).length;return{selectionStart:a,selectionEnd:a+f}},fromGraphemeToStringSelection:function(r,m,p){var i=p.slice(0,r),a=i.join("").length;if(r===m)return{selectionStart:a,selectionEnd:a};var n=p.slice(r,m),f=n.join("").length;return{selectionStart:a,selectionEnd:a+f}},_updateTextarea:function(){if(this.cursorOffsetCache={},!!this.hiddenTextarea){if(!this.inCompositionMode){var r=this.fromGraphemeToStringSelection(this.selectionStart,this.selectionEnd,this._text);this.hiddenTextarea.selectionStart=r.selectionStart,this.hiddenTextarea.selectionEnd=r.selectionEnd}this.updateTextareaPosition()}},updateFromTextArea:function(){if(this.hiddenTextarea){this.cursorOffsetCache={},this.text=this.hiddenTextarea.value,this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords());var r=this.fromStringToGraphemeSelection(this.hiddenTextarea.selectionStart,this.hiddenTextarea.selectionEnd,this.hiddenTextarea.value);this.selectionEnd=this.selectionStart=r.selectionEnd,this.inCompositionMode||(this.selectionStart=r.selectionStart),this.updateTextareaPosition()}},updateTextareaPosition:function(){if(this.selectionStart===this.selectionEnd){var r=this._calcTextareaPosition();this.hiddenTextarea.style.left=r.left,this.hiddenTextarea.style.top=r.top}},_calcTextareaPosition:function(){if(!this.canvas)return{x:1,y:1};var r=this.inCompositionMode?this.compositionStart:this.selectionStart,m=this._getCursorBoundaries(r),p=this.get2DCursorLocation(r),i=p.lineIndex,a=p.charIndex,n=this.getValueOfPropertyAt(i,a,"fontSize")*this.lineHeight,f=m.leftOffset,_=this.calcTransformMatrix(),h={x:m.left+f,y:m.top+m.topOffset+n},E=this.canvas.getRetinaScaling(),w=this.canvas.upperCanvasEl,A=w.width/E,D=w.height/E,z=A-n,B=D-n,Y=w.clientWidth/A,H=w.clientHeight/D;return h=c.util.transformPoint(h,_),h=c.util.transformPoint(h,this.canvas.viewportTransform),h.x*=Y,h.y*=H,h.x<0&&(h.x=0),h.x>z&&(h.x=z),h.y<0&&(h.y=0),h.y>B&&(h.y=B),h.x+=this.canvas._offset.left,h.y+=this.canvas._offset.top,{left:h.x+"px",top:h.y+"px",fontSize:n+"px",charHeight:n}},_saveEditingProps:function(){this._savedProps={hasControls:this.hasControls,borderColor:this.borderColor,lockMovementX:this.lockMovementX,lockMovementY:this.lockMovementY,hoverCursor:this.hoverCursor,selectable:this.selectable,defaultCursor:this.canvas&&this.canvas.defaultCursor,moveCursor:this.canvas&&this.canvas.moveCursor}},_restoreEditingProps:function(){this._savedProps&&(this.hoverCursor=this._savedProps.hoverCursor,this.hasControls=this._savedProps.hasControls,this.borderColor=this._savedProps.borderColor,this.selectable=this._savedProps.selectable,this.lockMovementX=this._savedProps.lockMovementX,this.lockMovementY=this._savedProps.lockMovementY,this.canvas&&(this.canvas.defaultCursor=this._savedProps.defaultCursor,this.canvas.moveCursor=this._savedProps.moveCursor))},exitEditing:function(){var r=this._textBeforeEdit!==this.text,m=this.hiddenTextarea;return this.selected=!1,this.isEditing=!1,this.selectionEnd=this.selectionStart,m&&(m.blur&&m.blur(),m.parentNode&&m.parentNode.removeChild(m)),this.hiddenTextarea=null,this.abortCursorAnimation(),this._restoreEditingProps(),this._currentCursorOpacity=0,this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this.fire("editing:exited"),r&&this.fire("modified"),this.canvas&&(this.canvas.off("mouse:move",this.mouseMoveHandler),this.canvas.fire("text:editing:exited",{target:this}),r&&this.canvas.fire("object:modified",{target:this})),this},_removeExtraneousStyles:function(){for(var r in this.styles)this._textLines[r]||delete this.styles[r]},removeStyleFromTo:function(r,m){var p=this.get2DCursorLocation(r,!0),i=this.get2DCursorLocation(m,!0),a=p.lineIndex,n=p.charIndex,f=i.lineIndex,_=i.charIndex,h,E;if(a!==f){if(this.styles[a])for(h=n;h<this._unwrappedTextLines[a].length;h++)delete this.styles[a][h];if(this.styles[f])for(h=_;h<this._unwrappedTextLines[f].length;h++)E=this.styles[f][h],E&&(this.styles[a]||(this.styles[a]={}),this.styles[a][n+h-_]=E);for(h=a+1;h<=f;h++)delete this.styles[h];this.shiftLineStyles(f,a-f)}else if(this.styles[a]){E=this.styles[a];var w=_-n,A,D;for(h=n;h<_;h++)delete E[h];for(D in this.styles[a])A=parseInt(D,10),A>=_&&(E[A-w]=E[D],delete E[D])}},shiftLineStyles:function(r,m){var p=b(this.styles);for(var i in this.styles){var a=parseInt(i,10);a>r&&(this.styles[a+m]=p[a],p[a-m]||delete this.styles[a])}},restartCursorIfNeeded:function(){(!this._currentTickState||this._currentTickState.isAborted||!this._currentTickCompleteState||this._currentTickCompleteState.isAborted)&&this.initDelayedCursor()},insertNewlineStyleObject:function(r,m,p,i){var a,n={},f=!1,_=this._unwrappedTextLines[r].length===m;p||(p=1),this.shiftLineStyles(r,p),this.styles[r]&&(a=this.styles[r][m===0?m:m-1]);for(var h in this.styles[r]){var E=parseInt(h,10);E>=m&&(f=!0,n[E-m]=this.styles[r][h],_&&m===0||delete this.styles[r][h])}var w=!1;for(f&&!_&&(this.styles[r+p]=n,w=!0),w&&p--;p>0;)i&&i[p-1]?this.styles[r+p]={0:b(i[p-1])}:a?this.styles[r+p]={0:b(a)}:delete this.styles[r+p],p--;this._forceClearCache=!0},insertCharStyleObject:function(r,m,p,i){this.styles||(this.styles={});var a=this.styles[r],n=a?b(a):{};p||(p=1);for(var f in n){var _=parseInt(f,10);_>=m&&(a[_+p]=n[_],n[_-p]||delete a[_])}if(this._forceClearCache=!0,i){for(;p--;)Object.keys(i[p]).length&&(this.styles[r]||(this.styles[r]={}),this.styles[r][m+p]=b(i[p]));return}if(a)for(var h=a[m?m-1:1];h&&p--;)this.styles[r][m+p]=b(h)},insertNewStyleBlock:function(r,m,p){for(var i=this.get2DCursorLocation(m,!0),a=[0],n=0,f=0;f<r.length;f++)r[f]===`
|
|
387
|
-
`?(n++,a[n]=0):a[n]++;a[0]>0&&(this.insertCharStyleObject(i.lineIndex,i.charIndex,a[0],p),p=p&&p.slice(a[0]+1)),n&&this.insertNewlineStyleObject(i.lineIndex,i.charIndex+a[0],n);for(var f=1;f<n;f++)a[f]>0?this.insertCharStyleObject(i.lineIndex+f,0,a[f],p):p&&(this.styles[i.lineIndex+f][0]=p[0]),p=p&&p.slice(a[f]+1);a[f]>0&&this.insertCharStyleObject(i.lineIndex+f,0,a[f],p)},setSelectionStartEndWithShift:function(r,m,p){p<=r?(m===r?this._selectionDirection="left":this._selectionDirection==="right"&&(this._selectionDirection="left",this.selectionEnd=r),this.selectionStart=p):p>r&&p<m?this._selectionDirection==="right"?this.selectionEnd=p:this.selectionStart=p:(m===r?this._selectionDirection="right":this._selectionDirection==="left"&&(this._selectionDirection="right",this.selectionStart=m),this.selectionEnd=p)},setSelectionInBoundaries:function(){var r=this.text.length;this.selectionStart>r?this.selectionStart=r:this.selectionStart<0&&(this.selectionStart=0),this.selectionEnd>r?this.selectionEnd=r:this.selectionEnd<0&&(this.selectionEnd=0)}})}(),c.util.object.extend(c.IText.prototype,{initDoubleClickSimulation:function(){this.__lastClickTime=+new Date,this.__lastLastClickTime=+new Date,this.__lastPointer={},this.on("mousedown",this.onMouseDown)},onMouseDown:function(b){if(this.canvas){this.__newClickTime=+new Date;var r=b.pointer;this.isTripleClick(r)&&(this.fire("tripleclick",b),this._stopEvent(b.e)),this.__lastLastClickTime=this.__lastClickTime,this.__lastClickTime=this.__newClickTime,this.__lastPointer=r,this.__lastIsEditing=this.isEditing,this.__lastSelected=this.selected}},isTripleClick:function(b){return this.__newClickTime-this.__lastClickTime<500&&this.__lastClickTime-this.__lastLastClickTime<500&&this.__lastPointer.x===b.x&&this.__lastPointer.y===b.y},_stopEvent:function(b){b.preventDefault&&b.preventDefault(),b.stopPropagation&&b.stopPropagation()},initCursorSelectionHandlers:function(){this.initMousedownHandler(),this.initMouseupHandler(),this.initClicks()},doubleClickHandler:function(b){this.isEditing&&this.selectWord(this.getSelectionStartFromPointer(b.e))},tripleClickHandler:function(b){this.isEditing&&this.selectLine(this.getSelectionStartFromPointer(b.e))},initClicks:function(){this.on("mousedblclick",this.doubleClickHandler),this.on("tripleclick",this.tripleClickHandler)},_mouseDownHandler:function(b){!this.canvas||!this.editable||b.e.button&&b.e.button!==1||(this.__isMousedown=!0,this.selected&&(this.inCompositionMode=!1,this.setCursorByClick(b.e)),this.isEditing&&(this.__selectionStartOnMouseDown=this.selectionStart,this.selectionStart===this.selectionEnd&&this.abortCursorAnimation(),this.renderCursorOrSelection()))},_mouseDownHandlerBefore:function(b){!this.canvas||!this.editable||b.e.button&&b.e.button!==1||(this.selected=this===this.canvas._activeObject)},initMousedownHandler:function(){this.on("mousedown",this._mouseDownHandler),this.on("mousedown:before",this._mouseDownHandlerBefore)},initMouseupHandler:function(){this.on("mouseup",this.mouseUpHandler)},mouseUpHandler:function(b){if(this.__isMousedown=!1,!(!this.editable||this.group||b.transform&&b.transform.actionPerformed||b.e.button&&b.e.button!==1)){if(this.canvas){var r=this.canvas._activeObject;if(r&&r!==this)return}this.__lastSelected&&!this.__corner?(this.selected=!1,this.__lastSelected=!1,this.enterEditing(b.e),this.selectionStart===this.selectionEnd?this.initDelayedCursor(!0):this.renderCursorOrSelection()):this.selected=!0}},setCursorByClick:function(b){var r=this.getSelectionStartFromPointer(b),m=this.selectionStart,p=this.selectionEnd;b.shiftKey?this.setSelectionStartEndWithShift(m,p,r):(this.selectionStart=r,this.selectionEnd=r),this.isEditing&&(this._fireSelectionChanged(),this._updateTextarea())},getSelectionStartFromPointer:function(b){for(var r=this.getLocalPointer(b),m=0,p=0,i=0,a=0,n=0,f,_,h=0,E=this._textLines.length;h<E&&i<=r.y;h++)i+=this.getHeightOfLine(h)*this.scaleY,n=h,h>0&&(a+=this._textLines[h-1].length+this.missingNewlineOffset(h-1));f=this._getLineLeftOffset(n),p=f*this.scaleX,_=this._textLines[n],this.direction==="rtl"&&(r.x=this.width*this.scaleX-r.x+p);for(var w=0,A=_.length;w<A&&(m=p,p+=this.__charBounds[n][w].kernedWidth*this.scaleX,p<=r.x);w++)a++;return this._getNewSelectionStartFromOffset(r,m,p,a,A)},_getNewSelectionStartFromOffset:function(b,r,m,p,i){var a=b.x-r,n=m-b.x,f=n>a||n<0?0:1,_=p+f;return this.flipX&&(_=i-_),_>this._text.length&&(_=this._text.length),_}}),c.util.object.extend(c.IText.prototype,{initHiddenTextarea:function(){this.hiddenTextarea=c.document.createElement("textarea"),this.hiddenTextarea.setAttribute("autocapitalize","off"),this.hiddenTextarea.setAttribute("autocorrect","off"),this.hiddenTextarea.setAttribute("autocomplete","off"),this.hiddenTextarea.setAttribute("spellcheck","false"),this.hiddenTextarea.setAttribute("data-fabric-hiddentextarea",""),this.hiddenTextarea.setAttribute("wrap","off");var b=this._calcTextareaPosition();this.hiddenTextarea.style.cssText="position: absolute; top: "+b.top+"; left: "+b.left+"; z-index: -999; opacity: 0; width: 1px; height: 1px; font-size: 1px; padding\uFF70top: "+b.fontSize+";",this.hiddenTextareaContainer?this.hiddenTextareaContainer.appendChild(this.hiddenTextarea):c.document.body.appendChild(this.hiddenTextarea),c.util.addListener(this.hiddenTextarea,"keydown",this.onKeyDown.bind(this)),c.util.addListener(this.hiddenTextarea,"keyup",this.onKeyUp.bind(this)),c.util.addListener(this.hiddenTextarea,"input",this.onInput.bind(this)),c.util.addListener(this.hiddenTextarea,"copy",this.copy.bind(this)),c.util.addListener(this.hiddenTextarea,"cut",this.copy.bind(this)),c.util.addListener(this.hiddenTextarea,"paste",this.paste.bind(this)),c.util.addListener(this.hiddenTextarea,"compositionstart",this.onCompositionStart.bind(this)),c.util.addListener(this.hiddenTextarea,"compositionupdate",this.onCompositionUpdate.bind(this)),c.util.addListener(this.hiddenTextarea,"compositionend",this.onCompositionEnd.bind(this)),!this._clickHandlerInitialized&&this.canvas&&(c.util.addListener(this.canvas.upperCanvasEl,"click",this.onClick.bind(this)),this._clickHandlerInitialized=!0)},keysMap:{9:"exitEditing",27:"exitEditing",33:"moveCursorUp",34:"moveCursorDown",35:"moveCursorRight",36:"moveCursorLeft",37:"moveCursorLeft",38:"moveCursorUp",39:"moveCursorRight",40:"moveCursorDown"},keysMapRtl:{9:"exitEditing",27:"exitEditing",33:"moveCursorUp",34:"moveCursorDown",35:"moveCursorLeft",36:"moveCursorRight",37:"moveCursorRight",38:"moveCursorUp",39:"moveCursorLeft",40:"moveCursorDown"},ctrlKeysMapUp:{67:"copy",88:"cut"},ctrlKeysMapDown:{65:"selectAll"},onClick:function(){this.hiddenTextarea&&this.hiddenTextarea.focus()},onKeyDown:function(b){if(this.isEditing){var r=this.direction==="rtl"?this.keysMapRtl:this.keysMap;if(b.keyCode in r)this[r[b.keyCode]](b);else if(b.keyCode in this.ctrlKeysMapDown&&(b.ctrlKey||b.metaKey))this[this.ctrlKeysMapDown[b.keyCode]](b);else return;b.stopImmediatePropagation(),b.preventDefault(),b.keyCode>=33&&b.keyCode<=40?(this.inCompositionMode=!1,this.clearContextTop(),this.renderCursorOrSelection()):this.canvas&&this.canvas.requestRenderAll()}},onKeyUp:function(b){if(!this.isEditing||this._copyDone||this.inCompositionMode){this._copyDone=!1;return}if(b.keyCode in this.ctrlKeysMapUp&&(b.ctrlKey||b.metaKey))this[this.ctrlKeysMapUp[b.keyCode]](b);else return;b.stopImmediatePropagation(),b.preventDefault(),this.canvas&&this.canvas.requestRenderAll()},onInput:function(b){var r=this.fromPaste;if(this.fromPaste=!1,b&&b.stopPropagation(),!!this.isEditing){var m=this._splitTextIntoLines(this.hiddenTextarea.value).graphemeText,p=this._text.length,i=m.length,a,n,f=i-p,_=this.selectionStart,h=this.selectionEnd,E=_!==h,w,A,D;if(this.hiddenTextarea.value===""){this.styles={},this.updateFromTextArea(),this.fire("changed"),this.canvas&&(this.canvas.fire("text:changed",{target:this}),this.canvas.requestRenderAll());return}var z=this.fromStringToGraphemeSelection(this.hiddenTextarea.selectionStart,this.hiddenTextarea.selectionEnd,this.hiddenTextarea.value),B=_>z.selectionStart;E?(a=this._text.slice(_,h),f+=h-_):i<p&&(B?a=this._text.slice(h+f,h):a=this._text.slice(_,_-f)),n=m.slice(z.selectionEnd-f,z.selectionEnd),a&&a.length&&(n.length&&(w=this.getSelectionStyles(_,_+1,!1),w=n.map(function(){return w[0]})),E?(A=_,D=h):B?(A=h-a.length,D=h):(A=h,D=h+a.length),this.removeStyleFromTo(A,D)),n.length&&(r&&n.join("")===c.copiedText&&!c.disableStyleCopyPaste&&(w=c.copiedTextStyle),this.insertNewStyleBlock(n,_,w)),this.updateFromTextArea(),this.fire("changed"),this.canvas&&(this.canvas.fire("text:changed",{target:this}),this.canvas.requestRenderAll())}},onCompositionStart:function(){this.inCompositionMode=!0},onCompositionEnd:function(){this.inCompositionMode=!1},onCompositionUpdate:function(b){this.compositionStart=b.target.selectionStart,this.compositionEnd=b.target.selectionEnd,this.updateTextareaPosition()},copy:function(){this.selectionStart!==this.selectionEnd&&(c.copiedText=this.getSelectedText(),c.disableStyleCopyPaste?c.copiedTextStyle=null:c.copiedTextStyle=this.getSelectionStyles(this.selectionStart,this.selectionEnd,!0),this._copyDone=!0)},paste:function(){this.fromPaste=!0},_getClipboardData:function(b){return b&&b.clipboardData||c.window.clipboardData},_getWidthBeforeCursor:function(b,r){var m=this._getLineLeftOffset(b),p;return r>0&&(p=this.__charBounds[b][r-1],m+=p.left+p.width),m},getDownCursorOffset:function(b,r){var m=this._getSelectionForOffset(b,r),p=this.get2DCursorLocation(m),i=p.lineIndex;if(i===this._textLines.length-1||b.metaKey||b.keyCode===34)return this._text.length-m;var a=p.charIndex,n=this._getWidthBeforeCursor(i,a),f=this._getIndexOnLine(i+1,n),_=this._textLines[i].slice(a);return _.length+f+1+this.missingNewlineOffset(i)},_getSelectionForOffset:function(b,r){return b.shiftKey&&this.selectionStart!==this.selectionEnd&&r?this.selectionEnd:this.selectionStart},getUpCursorOffset:function(b,r){var m=this._getSelectionForOffset(b,r),p=this.get2DCursorLocation(m),i=p.lineIndex;if(i===0||b.metaKey||b.keyCode===33)return-m;var a=p.charIndex,n=this._getWidthBeforeCursor(i,a),f=this._getIndexOnLine(i-1,n),_=this._textLines[i].slice(0,a),h=this.missingNewlineOffset(i-1);return-this._textLines[i-1].length+f-_.length+(1-h)},_getIndexOnLine:function(b,r){for(var m=this._textLines[b],p=this._getLineLeftOffset(b),i=p,a=0,n,f,_=0,h=m.length;_<h;_++)if(n=this.__charBounds[b][_].width,i+=n,i>r){f=!0;var E=i-n,w=i,A=Math.abs(E-r),D=Math.abs(w-r);a=D<A?_:_-1;break}return f||(a=m.length-1),a},moveCursorDown:function(b){this.selectionStart>=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorUpOrDown("Down",b)},moveCursorUp:function(b){this.selectionStart===0&&this.selectionEnd===0||this._moveCursorUpOrDown("Up",b)},_moveCursorUpOrDown:function(b,r){var m="get"+b+"CursorOffset",p=this[m](r,this._selectionDirection==="right");r.shiftKey?this.moveCursorWithShift(p):this.moveCursorWithoutShift(p),p!==0&&(this.setSelectionInBoundaries(),this.abortCursorAnimation(),this._currentCursorOpacity=1,this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea())},moveCursorWithShift:function(b){var r=this._selectionDirection==="left"?this.selectionStart+b:this.selectionEnd+b;return this.setSelectionStartEndWithShift(this.selectionStart,this.selectionEnd,r),b!==0},moveCursorWithoutShift:function(b){return b<0?(this.selectionStart+=b,this.selectionEnd=this.selectionStart):(this.selectionEnd+=b,this.selectionStart=this.selectionEnd),b!==0},moveCursorLeft:function(b){this.selectionStart===0&&this.selectionEnd===0||this._moveCursorLeftOrRight("Left",b)},_move:function(b,r,m){var p;if(b.altKey)p=this["findWordBoundary"+m](this[r]);else if(b.metaKey||b.keyCode===35||b.keyCode===36)p=this["findLineBoundary"+m](this[r]);else return this[r]+=m==="Left"?-1:1,!0;if(typeof p!==void 0&&this[r]!==p)return this[r]=p,!0},_moveLeft:function(b,r){return this._move(b,r,"Left")},_moveRight:function(b,r){return this._move(b,r,"Right")},moveCursorLeftWithoutShift:function(b){var r=!0;return this._selectionDirection="left",this.selectionEnd===this.selectionStart&&this.selectionStart!==0&&(r=this._moveLeft(b,"selectionStart")),this.selectionEnd=this.selectionStart,r},moveCursorLeftWithShift:function(b){if(this._selectionDirection==="right"&&this.selectionStart!==this.selectionEnd)return this._moveLeft(b,"selectionEnd");if(this.selectionStart!==0)return this._selectionDirection="left",this._moveLeft(b,"selectionStart")},moveCursorRight:function(b){this.selectionStart>=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorLeftOrRight("Right",b)},_moveCursorLeftOrRight:function(b,r){var m="moveCursor"+b+"With";this._currentCursorOpacity=1,r.shiftKey?m+="Shift":m+="outShift",this[m](r)&&(this.abortCursorAnimation(),this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea())},moveCursorRightWithShift:function(b){if(this._selectionDirection==="left"&&this.selectionStart!==this.selectionEnd)return this._moveRight(b,"selectionStart");if(this.selectionEnd!==this._text.length)return this._selectionDirection="right",this._moveRight(b,"selectionEnd")},moveCursorRightWithoutShift:function(b){var r=!0;return this._selectionDirection="right",this.selectionStart===this.selectionEnd?(r=this._moveRight(b,"selectionStart"),this.selectionEnd=this.selectionStart):this.selectionStart=this.selectionEnd,r},removeChars:function(b,r){typeof r=="undefined"&&(r=b+1),this.removeStyleFromTo(b,r),this._text.splice(b,r-b),this.text=this._text.join(""),this.set("dirty",!0),this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this._removeExtraneousStyles()},insertChars:function(b,r,m,p){typeof p=="undefined"&&(p=m),p>m&&this.removeStyleFromTo(m,p);var i=c.util.string.graphemeSplit(b);this.insertNewStyleBlock(i,m,r),this._text=[].concat(this._text.slice(0,m),i,this._text.slice(p)),this.text=this._text.join(""),this.set("dirty",!0),this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this._removeExtraneousStyles()}}),function(){var b=c.util.toFixed,r=/ +/g;c.util.object.extend(c.Text.prototype,{_toSVG:function(){var m=this._getSVGLeftTopOffsets(),p=this._getSVGTextAndBg(m.textTop,m.textLeft);return this._wrapSVGTextAndBg(p)},toSVG:function(m){return this._createBaseSVGMarkup(this._toSVG(),{reviver:m,noStyle:!0,withShadow:!0})},_getSVGLeftTopOffsets:function(){return{textLeft:-this.width/2,textTop:-this.height/2,lineTop:this.getHeightOfLine(0)}},_wrapSVGTextAndBg:function(m){var p=!0,i=this.getSvgTextDecoration(this);return[m.textBgRects.join(""),' <text xml:space="preserve" ',this.fontFamily?'font-family="'+this.fontFamily.replace(/"/g,"'")+'" ':"",this.fontSize?'font-size="'+this.fontSize+'" ':"",this.fontStyle?'font-style="'+this.fontStyle+'" ':"",this.fontWeight?'font-weight="'+this.fontWeight+'" ':"",i?'text-decoration="'+i+'" ':"",'style="',this.getSvgStyles(p),'"',this.addPaintOrder()," >",m.textSpans.join(""),`</text>`]},_getSVGTextAndBg:function(m,p){var i=[],a=[],n=m,f;this._setSVGBg(a);for(var _=0,h=this._textLines.length;_<h;_++)f=this._getLineLeftOffset(_),(this.textBackgroundColor||this.styleHas("textBackgroundColor",_))&&this._setSVGTextLineBg(a,_,p+f,n),this._setSVGTextLineText(i,_,p+f,n),n+=this.getHeightOfLine(_);return{textSpans:i,textBgRects:a}},_createTextCharSpan:function(m,p,i,a){var n=m!==m.trim()||m.match(r),f=this.getSvgSpanStyles(p,n),_=f?'style="'+f+'"':"",h=p.deltaY,E="",w=c.Object.NUM_FRACTION_DIGITS;return h&&(E=' dy="'+b(h,w)+'" '),['<tspan x="',b(i,w),'" y="',b(a,w),'" ',E,_,">",c.util.string.escapeXml(m),"</tspan>"].join("")},_setSVGTextLineText:function(m,p,i,a){var n=this.getHeightOfLine(p),f=this.textAlign.indexOf("justify")!==-1,_,h,E="",w,A,D=0,z=this._textLines[p],B;a+=n*(1-this._fontSizeFraction)/this.lineHeight;for(var Y=0,H=z.length-1;Y<=H;Y++)B=Y===H||this.charSpacing,E+=z[Y],w=this.__charBounds[p][Y],D===0?(i+=w.kernedWidth-w.width,D+=w.width):D+=w.kernedWidth,f&&!B&&this._reSpaceAndTab.test(z[Y])&&(B=!0),B||(_=_||this.getCompleteStyleDeclaration(p,Y),h=this.getCompleteStyleDeclaration(p,Y+1),B=this._hasStyleChangedForSvg(_,h)),B&&(A=this._getStyleDeclaration(p,Y)||{},m.push(this._createTextCharSpan(E,A,i,a)),E="",_=h,i+=D,D=0)},_pushTextBgRect:function(m,p,i,a,n,f){var _=c.Object.NUM_FRACTION_DIGITS;m.push(" <rect ",this._getFillAttributes(p),' x="',b(i,_),'" y="',b(a,_),'" width="',b(n,_),'" height="',b(f,_),`"></rect>`)},_setSVGTextLineBg:function(m,p,i,a){for(var n=this._textLines[p],f=this.getHeightOfLine(p)/this.lineHeight,_=0,h=0,E,w,A=this.getValueOfPropertyAt(p,0,"textBackgroundColor"),D=0,z=n.length;D<z;D++)E=this.__charBounds[p][D],w=this.getValueOfPropertyAt(p,D,"textBackgroundColor"),w!==A?(A&&this._pushTextBgRect(m,A,i+h,a,_,f),h=E.left,_=E.width,A=w):_+=E.kernedWidth;w&&this._pushTextBgRect(m,w,i+h,a,_,f)},_getFillAttributes:function(m){var p=m&&typeof m=="string"?new c.Color(m):"";return!p||!p.getSource()||p.getAlpha()===1?'fill="'+m+'"':'opacity="'+p.getAlpha()+'" fill="'+p.setAlpha(1).toRgb()+'"'},_getSVGLineTopOffset:function(m){for(var p=0,i=0,a=0;a<m;a++)p+=this.getHeightOfLine(a);return i=this.getHeightOfLine(a),{lineTop:p,offset:(this._fontSizeMult-this._fontSizeFraction)*i/(this.lineHeight*this._fontSizeMult)}},getSvgStyles:function(m){var p=c.Object.prototype.getSvgStyles.call(this,m);return p+" white-space: pre;"}})}(),function(b){"use strict";var r=b.fabric||(b.fabric={});r.Textbox=r.util.createClass(r.IText,r.Observable,{type:"textbox",minWidth:20,dynamicMinWidth:2,__cachedLines:null,lockScalingFlip:!0,noScaleCache:!1,_dimensionAffectingProps:r.Text.prototype._dimensionAffectingProps.concat("width"),_wordJoiners:/[ \t\r]/,splitByGrapheme:!1,initDimensions:function(){this.__skipDimension||(this.isEditing&&this.initDelayedCursor(),this.clearContextTop(),this._clearCache(),this.dynamicMinWidth=0,this._styleMap=this._generateStyleMap(this._splitText()),this.dynamicMinWidth>this.width&&this._set("width",this.dynamicMinWidth),this.textAlign.indexOf("justify")!==-1&&this.enlargeSpaces(),this.height=this.calcTextHeight(),this.saveState({propertySet:"_dimensionAffectingProps"}))},_generateStyleMap:function(m){for(var p=0,i=0,a=0,n={},f=0;f<m.graphemeLines.length;f++)m.graphemeText[a]===`
|
|
388
|
-
`&&f>0?(i=0,a++,p++):!this.splitByGrapheme&&this._reSpaceAndTab.test(m.graphemeText[a])&&f>0&&(i++,a++),n[f]={line:p,offset:i},a+=m.graphemeLines[f].length,i+=m.graphemeLines[f].length;return n},styleHas:function(m,p){if(this._styleMap&&!this.isWrapping){var i=this._styleMap[p];i&&(p=i.line)}return r.Text.prototype.styleHas.call(this,m,p)},isEmptyStyles:function(m){if(!this.styles)return!0;var p=0,i=m+1,a,n,f=!1,_=this._styleMap[m],h=this._styleMap[m+1];_&&(m=_.line,p=_.offset),h&&(i=h.line,f=i===m,a=h.offset),n=typeof m=="undefined"?this.styles:{line:this.styles[m]};for(var E in n)for(var w in n[E])if(w>=p&&(!f||w<a))for(var A in n[E][w])return!1;return!0},_getStyleDeclaration:function(m,p){if(this._styleMap&&!this.isWrapping){var i=this._styleMap[m];if(!i)return null;m=i.line,p=i.offset+p}return this.callSuper("_getStyleDeclaration",m,p)},_setStyleDeclaration:function(m,p,i){var a=this._styleMap[m];m=a.line,p=a.offset+p,this.styles[m][p]=i},_deleteStyleDeclaration:function(m,p){var i=this._styleMap[m];m=i.line,p=i.offset+p,delete this.styles[m][p]},_getLineStyle:function(m){var p=this._styleMap[m];return!!this.styles[p.line]},_setLineStyle:function(m){var p=this._styleMap[m];this.styles[p.line]={}},_wrapText:function(m,p){var i=[],a;for(this.isWrapping=!0,a=0;a<m.length;a++)i=i.concat(this._wrapLine(m[a],a,p));return this.isWrapping=!1,i},_measureWord:function(m,p,i){var a=0,n,f=!0;i=i||0;for(var _=0,h=m.length;_<h;_++){var E=this._getGraphemeBox(m[_],p,_+i,n,f);a+=E.kernedWidth,n=m[_]}return a},_wrapLine:function(m,p,i,lt){var n=0,f=this.splitByGrapheme,_=[],h=[],E=f?r.util.string.graphemeSplit(m):m.split(this._wordJoiners),w="",A=0,D=f?"":" ",z=0,B=0,Y=0,H=!0,V=this._getWidthOfCharSpacing(),lt=lt||0;E.length===0&&E.push([]),i-=lt;for(var rt=0;rt<E.length;rt++)w=f?E[rt]:r.util.string.graphemeSplit(E[rt]),z=this._measureWord(w,p,A),A+=w.length,n+=B+z-V,n>i&&!H?(_.push(h),h=[],n=z,H=!0):n+=V,!H&&!f&&h.push(D),h=h.concat(w),B=f?0:this._measureWord([D],p,A),A++,H=!1,z>Y&&(Y=z);return rt&&_.push(h),Y+lt>this.dynamicMinWidth&&(this.dynamicMinWidth=Y-V+lt),_},isEndOfWrapping:function(m){return!this._styleMap[m+1]||this._styleMap[m+1].line!==this._styleMap[m].line},missingNewlineOffset:function(m){return this.splitByGrapheme?this.isEndOfWrapping(m)?1:0:1},_splitTextIntoLines:function(m){for(var p=r.Text.prototype._splitTextIntoLines.call(this,m),i=this._wrapText(p.lines,this.width),a=new Array(i.length),n=0;n<i.length;n++)a[n]=i[n].join("");return p.lines=a,p.graphemeLines=i,p},getMinWidth:function(){return Math.max(this.minWidth,this.dynamicMinWidth)},_removeExtraneousStyles:function(){var m={};for(var p in this._styleMap)this._textLines[p]&&(m[this._styleMap[p].line]=1);for(var p in this.styles)m[p]||delete this.styles[p]},toObject:function(m){return this.callSuper("toObject",["minWidth","splitByGrapheme"].concat(m))}}),r.Textbox.fromObject=function(m,p){return r.Object._fromObject("Textbox",m,p,"text")}}(I),function(){var b=c.controlsUtils,r=b.scaleSkewCursorStyleHandler,m=b.scaleCursorStyleHandler,p=b.scalingEqually,i=b.scalingYOrSkewingX,a=b.scalingXOrSkewingY,n=b.scaleOrSkewActionName,f=c.Object.prototype.controls;if(f.ml=new c.Control({x:-.5,y:0,cursorStyleHandler:r,actionHandler:a,getActionName:n}),f.mr=new c.Control({x:.5,y:0,cursorStyleHandler:r,actionHandler:a,getActionName:n}),f.mb=new c.Control({x:0,y:.5,cursorStyleHandler:r,actionHandler:i,getActionName:n}),f.mt=new c.Control({x:0,y:-.5,cursorStyleHandler:r,actionHandler:i,getActionName:n}),f.tl=new c.Control({x:-.5,y:-.5,cursorStyleHandler:m,actionHandler:p}),f.tr=new c.Control({x:.5,y:-.5,cursorStyleHandler:m,actionHandler:p}),f.bl=new c.Control({x:-.5,y:.5,cursorStyleHandler:m,actionHandler:p}),f.br=new c.Control({x:.5,y:.5,cursorStyleHandler:m,actionHandler:p}),f.mtr=new c.Control({x:0,y:-.5,actionHandler:b.rotationWithSnapping,cursorStyleHandler:b.rotationStyleHandler,offsetY:-40,withConnection:!0,actionName:"rotate"}),c.Textbox){var _=c.Textbox.prototype.controls={};_.mtr=f.mtr,_.tr=f.tr,_.br=f.br,_.tl=f.tl,_.bl=f.bl,_.mt=f.mt,_.mb=f.mb,_.mr=new c.Control({x:.5,y:0,actionHandler:b.changeWidth,cursorStyleHandler:r,actionName:"resizing"}),_.ml=new c.Control({x:-.5,y:0,actionHandler:b.changeWidth,cursorStyleHandler:r,actionName:"resizing"})}}()},3053:function(y,I,l){"use strict";var c=l(602);function T(P,L,N){var j,b;if(N=N||0,!c(L))return-1;if(Array.prototype.indexOf)return Array.prototype.indexOf.call(L,P,N);for(b=L.length,j=N;N>=0&&j<b;j+=1)if(L[j]===P)return j;return-1}e(T,"inArray"),y.exports=T},8592:function(y,I,l){"use strict";var c=l(602),T=l(6092),P=l(5573);function L(N,j,b){c(N)?T(N,j,b):P(N,j,b)}e(L,"forEach"),y.exports=L},6092:function(y){"use strict";function I(l,c,T){var P=0,L=l.length;for(T=T||null;P<L&&c.call(T,l[P],P,l)!==!1;P+=1);}e(I,"forEachArray"),y.exports=I},5573:function(y){"use strict";function I(l,c,T){var P;T=T||null;for(P in l)if(l.hasOwnProperty(P)&&c.call(T,l[P],P,l)===!1)break}e(I,"forEachOwnProperties"),y.exports=I},9052:function(y,I,l){"use strict";var c=l(961),T=l(9886),P=l(2560),L=l(5393),N=l(602),j=l(5183),b=l(8592),r=/\s+/g;function m(){this.events=null,this.contexts=null}e(m,"CustomEvents"),m.mixin=function(p){c(p.prototype,m.prototype)},m.prototype._getHandlerItem=function(p,i){var a={handler:p};return i&&(a.context=i),a},m.prototype._safeEvent=function(p){var i=this.events,a;return i||(i=this.events={}),p&&(a=i[p],a||(a=[],i[p]=a),i=a),i},m.prototype._safeContext=function(){var p=this.contexts;return p||(p=this.contexts=[]),p},m.prototype._indexOfContext=function(p){for(var i=this._safeContext(),a=0;i[a];){if(p===i[a][0])return a;a+=1}return-1},m.prototype._memorizeContext=function(p){var i,a;T(p)&&(i=this._safeContext(),a=this._indexOfContext(p),a>-1?i[a][1]+=1:i.push([p,1]))},m.prototype._forgetContext=function(p){var i,a;T(p)&&(i=this._safeContext(),a=this._indexOfContext(p),a>-1&&(i[a][1]-=1,i[a][1]<=0&&i.splice(a,1)))},m.prototype._bindEvent=function(p,i,a){var n=this._safeEvent(p);this._memorizeContext(a),n.push(this._getHandlerItem(i,a))},m.prototype.on=function(p,i,a){var n=this;P(p)?(p=p.split(r),b(p,function(f){n._bindEvent(f,i,a)})):L(p)&&(a=i,b(p,function(f,_){n.on(_,f,a)}))},m.prototype.once=function(p,i,a){var n=this;if(L(p)){a=i,b(p,function(_,h){n.once(h,_,a)});return}function f(){i.apply(a,arguments),n.off(p,f,a)}e(f,"onceHandler"),this.on(p,f,a)},m.prototype._spliceMatches=function(p,i){var a=0,n;if(N(p))for(n=p.length;a<n;a+=1)i(p[a])===!0&&(p.splice(a,1),n-=1,a-=1)},m.prototype._matchHandler=function(p){var i=this;return function(a){var n=p===a.handler;return n&&i._forgetContext(a.context),n}},m.prototype._matchContext=function(p){var i=this;return function(a){var n=p===a.context;return n&&i._forgetContext(a.context),n}},m.prototype._matchHandlerAndContext=function(p,i){var a=this;return function(n){var f=p===n.handler,_=i===n.context,h=f&&_;return h&&a._forgetContext(n.context),h}},m.prototype._offByEventName=function(p,i){var a=this,n=j(i),f=a._matchHandler(i);p=p.split(r),b(p,function(_){var h=a._safeEvent(_);n?a._spliceMatches(h,f):(b(h,function(E){a._forgetContext(E.context)}),a.events[_]=[])})},m.prototype._offByHandler=function(p){var i=this,a=this._matchHandler(p);b(this._safeEvent(),function(n){i._spliceMatches(n,a)})},m.prototype._offByObject=function(p,i){var a=this,n;this._indexOfContext(p)<0?b(p,function(f,_){a.off(_,f)}):P(i)?(n=this._matchContext(p),a._spliceMatches(this._safeEvent(i),n)):j(i)?(n=this._matchHandlerAndContext(i,p),b(this._safeEvent(),function(f){a._spliceMatches(f,n)})):(n=this._matchContext(p),b(this._safeEvent(),function(f){a._spliceMatches(f,n)}))},m.prototype.off=function(p,i){P(p)?this._offByEventName(p,i):arguments.length?j(p)?this._offByHandler(p):L(p)&&this._offByObject(p,i):(this.events={},this.contexts=[])},m.prototype.fire=function(p){this.invoke.apply(this,arguments)},m.prototype.invoke=function(p){var i,a,n,f;if(!this.hasListener(p))return!0;for(i=this._safeEvent(p),a=Array.prototype.slice.call(arguments,1),n=0;i[n];){if(f=i[n],f.handler.apply(f.context,a)===!1)return!1;n+=1}return!0},m.prototype.hasListener=function(p){return this.getListenerLength(p)>0},m.prototype.getListenerLength=function(p){var i=this._safeEvent(p);return i.length},y.exports=m},961:function(y){"use strict";function I(l,c){var T=Object.prototype.hasOwnProperty,P,L,N,j;for(N=1,j=arguments.length;N<j;N+=1){P=arguments[N];for(L in P)T.call(P,L)&&(l[L]=P[L])}return l}e(I,"extend"),y.exports=I},1610:function(y,I,l){"use strict";var c=l(5695),T=l(3778);function P(L,N){for(var j=arguments,b=j[0],r=1,m=j.length;r<m;r+=1){if(c(b)||T(b))return;b=b[j[r]]}return b}e(P,"pick"),y.exports=P},4564:function(y,I,l){"use strict";var c=l(5573);function T(P,L){var N=document.createElement("img"),j="";return c(L,function(b,r){j+="&"+r+"="+b}),j=j.substring(1),N.src=P+"?"+j,N.style.display="none",document.body.appendChild(N),document.body.removeChild(N),N}e(T,"imagePing"),y.exports=T},4729:function(y,I,l){"use strict";var c=l(5695),T=l(4564),P=7*24*60*60*1e3;function L(j){var b=new Date().getTime();return b-j>P}e(L,"isExpired");function N(j,b){var r="https://www.google-analytics.com/collect",m=location.hostname,p="event",i="use",a="TOAST UI "+j+" for "+m+": Statistics",n=window.localStorage.getItem(a);!c(window.tui)&&window.tui.usageStatistics===!1||n&&!L(n)||(window.localStorage.setItem(a,new Date().getTime()),setTimeout(function(){(document.readyState==="interactive"||document.readyState==="complete")&&T(r,{v:1,t:p,tid:b,cid:m,dp:m,dh:j,el:j,ec:i})},1e3))}e(N,"sendHostname"),y.exports=N},602:function(y){"use strict";function I(l){return l instanceof Array}e(I,"isArray"),y.exports=I},9886:function(y,I,l){"use strict";var c=l(5695),T=l(3778);function P(L){return!c(L)&&!T(L)}e(P,"isExisty"),y.exports=P},5183:function(y){"use strict";function I(l){return l instanceof Function}e(I,"isFunction"),y.exports=I},3778:function(y){"use strict";function I(l){return l===null}e(I,"isNull"),y.exports=I},5393:function(y){"use strict";function I(l){return l===Object(l)}e(I,"isObject"),y.exports=I},2560:function(y){"use strict";function I(l){return typeof l=="string"||l instanceof String}e(I,"isString"),y.exports=I},5695:function(y){"use strict";function I(l){return l===void 0}e(I,"isUndefined"),y.exports=I},4426:function(y,I,l){y.exports=l(4486)},9406:function(y,I,l){y.exports=l(4877)},789:function(y,I,l){y.exports=l(7178)},381:function(y,I,l){y.exports=l(5603)},7636:function(y,I,l){y.exports=l(1206)},1899:function(y,I,l){y.exports=l(6174)},899:function(y,I,l){y.exports=l(57)},8005:function(y,I,l){y.exports=l(4741)},6562:function(y,I,l){y.exports=l(8368)},9131:function(y,I,l){y.exports=l(3739)},4383:function(y,I,l){y.exports=l(172)},6065:function(y,I,l){y.exports=l(4963)},1734:function(y,I,l){y.exports=l(7820)},2461:function(y,I,l){y.exports=l(5636)},5214:function(y,I,l){y.exports=l(5059)},6397:function(y,I,l){y.exports=l(3969)},8189:function(y,I,l){y.exports=l(6618)},9146:function(y,I,l){y.exports=l(5279)},4496:function(y,I,l){y.exports=l(9562)},3972:function(y,I,l){y.exports=l(652)},7172:function(y,I,l){y.exports=l(2813)},1845:function(y,I,l){y.exports=l(8664)},662:function(y,I,l){y.exports=l(1457)},711:function(y,I,l){y.exports=l(2937)},6623:function(y,I,l){y.exports=l(9297)},7077:function(y,I,l){y.exports=l(8026)},9856:function(y,I,l){y.exports=l(2044)},4230:function(y,I,l){y.exports=l(2214)},184:function(y,I,l){y.exports=l(9256)},3742:function(y,I,l){y.exports=l(5659)},1801:function(y){var I={rect:1,circle:2,triangle:1},l={rect:{w:"width",h:"height"},circle:{w:"rx",h:"ry"},triangle:{w:"width",h:"height"}};function c(r){var m=r.originX,p=r.originY,i=m.substring(0,1)+p.substring(0,1);r.startPoint=r.origins[i]}e(c,"setStartPoint");function T(r,m,p){var i=r.x,a=r.y,n=m.x,f=m.y,_=p*Math.PI/180,h=(n-i)*Math.cos(_)-(f-a)*Math.sin(_)+i,E=(n-i)*Math.sin(_)+(f-a)*Math.cos(_)+a;return{originX:i>h?"right":"left",originY:a>E?"bottom":"top"}}e(T,"getPositionsOfRotatedOrigin");function P(r){return r.originX==="center"&&r.originY==="center"}e(P,"hasCenterOrigin");function L(r,m){var p=m.getPointByOrigin("center","center"),i=-m.angle,a=T(p,r,i),n=a.originX,f=a.originY,_=m.getPointByOrigin(n,f),h=m.left-(p.x-_.x),E=m.top-(p.y-_.y);m.set({originX:n,originY:f,left:h,top:E}),m.setCoords()}e(L,"adjustOriginByStartPoint");function N(r,m){var p=m.startPoint,i=-m.angle,a=T(p,r,i),n=a.originX,f=a.originY;m.setPositionByOrigin(p,n,f),m.setCoords()}e(N,"adjustOriginByMovingPointer");function j(r){var m=r.type,p=r.scaleX,i=r.scaleY,a=l[m],n=r[a.w]*p,f=r[a.h]*i;if(r.isRegular){var _=Math.max(p,i);n=r[a.w]*_,f=r[a.h]*_}var h={hasControls:!1,hasBorders:!1,scaleX:1,scaleY:1};h[a.w]=n,h[a.h]=f,r.set(h)}e(j,"adjustDimensionOnScaling");function b(r,m){var p=m.type,i=m.strokeWidth,a=m.startPoint,n=I[p],f=l[p],_=m.type==="triangle",h={},E=Math.abs(a.x-r.x)/n,w=Math.abs(a.y-r.y)/n;E>i&&(E-=i/n),w>i&&(w-=i/n),m.isRegular&&(E=w=Math.max(E,w),_&&(w=Math.sqrt(3)/2*E)),h[f.w]=E,h[f.h]=w,m.set(h)}e(b,"adjustDimensionOnMouseMove"),y.exports={setOrigins:e(function(m){var p=m.getPointByOrigin("left","top"),i=m.getPointByOrigin("right","top"),a=m.getPointByOrigin("right","bottom"),n=m.getPointByOrigin("left","bottom");m.origins={lt:p,rt:i,rb:a,lb:n}},"setOrigins"),resize:e(function(m,p,i){P(m)&&(L(p,m),c(m)),i?j(m,p):b(p,m),N(p,m)},"resize"),adjustOriginToCenter:e(function(m){var p=m.getPointByOrigin("center","center"),i=m.originX,a=m.originY,n=m.getPointByOrigin(i,a),f=m.left+(p.x-n.x),_=m.top+(p.y-n.y);m.set({hasControls:!0,hasBorders:!0,originX:"center",originY:"center",left:f,top:_}),m.setCoords()},"adjustOriginToCenter")}},2221:function(y,I,l){l(5454),l(9173);var c=l(7545);y.exports=c.Array.from},5078:function(y,I,l){l(8118);var c=l(7545);y.exports=c.Array.isArray},6135:function(y,I,l){l(9106);var c=l(5607);y.exports=c("Array").concat},9510:function(y,I,l){l(1710);var c=l(5607);y.exports=c("Array").fill},3971:function(y,I,l){l(3436);var c=l(5607);y.exports=c("Array").filter},98:function(y,I,l){l(9823);var c=l(5607);y.exports=c("Array").forEach},2089:function(y,I,l){l(2276);var c=l(5607);y.exports=c("Array").indexOf},6209:function(y,I,l){l(3838);var c=l(5607);y.exports=c("Array").map},2671:function(y,I,l){l(5818);var c=l(5607);y.exports=c("Array").slice},1375:function(y,I,l){l(2178);var c=l(5607);y.exports=c("Array").splice},3528:function(y,I,l){l(665);var c=l(5607);y.exports=c("Function").bind},5739:function(y,I,l){l(8939),l(5454);var c=l(8703);y.exports=c},278:function(y,I,l){var c=l(3528),T=Function.prototype;y.exports=function(P){var L=P.bind;return P===T||P instanceof Function&&L===T.bind?c:L}},1484:function(y,I,l){var c=l(6135),T=Array.prototype;y.exports=function(P){var L=P.concat;return P===T||P instanceof Array&&L===T.concat?c:L}},7731:function(y,I,l){var c=l(9510),T=Array.prototype;y.exports=function(P){var L=P.fill;return P===T||P instanceof Array&&L===T.fill?c:L}},3669:function(y,I,l){var c=l(3971),T=Array.prototype;y.exports=function(P){var L=P.filter;return P===T||P instanceof Array&&L===T.filter?c:L}},2604:function(y,I,l){var c=l(2089),T=Array.prototype;y.exports=function(P){var L=P.indexOf;return P===T||P instanceof Array&&L===T.indexOf?c:L}},263:function(y,I,l){var c=l(6209),T=Array.prototype;y.exports=function(P){var L=P.map;return P===T||P instanceof Array&&L===T.map?c:L}},7663:function(y,I,l){var c=l(2671),T=Array.prototype;y.exports=function(P){var L=P.slice;return P===T||P instanceof Array&&L===T.slice?c:L}},5063:function(y,I,l){var c=l(1375),T=Array.prototype;y.exports=function(P){var L=P.splice;return P===T||P instanceof Array&&L===T.splice?c:L}},6813:function(y,I,l){var c=l(3842),T=String.prototype;y.exports=function(P){var L=P.trim;return typeof P=="string"||P===T||P instanceof String&&L===T.trim?c:L}},6285:function(y,I,l){l(2666);var c=l(7545);y.exports=c.Number.parseInt},3213:function(y,I,l){l(3113);var c=l(7545),T=c.Object;y.exports=e(function(L,N){return T.create(L,N)},"create")},3512:function(y,I,l){l(297);var c=l(7545),T=c.Object,P=y.exports=e(function(N,j,b){return T.defineProperty(N,j,b)},"defineProperty");T.defineProperty.sham&&(P.sham=!0)},8168:function(y,I,l){l(9234);var c=l(7545);y.exports=c.Object.getPrototypeOf},8651:function(y,I,l){l(2647);var c=l(7545);y.exports=c.Object.keys},3083:function(y,I,l){l(3222);var c=l(7545);y.exports=c.Object.setPrototypeOf},2987:function(y,I,l){l(4859);var c=l(7545);y.exports=c.parseFloat},2239:function(y,I,l){l(5706);var c=l(7545);y.exports=c.parseInt},3154:function(y,I,l){l(4242),l(8939),l(6663),l(9021),l(7884),l(8885),l(1868),l(5454);var c=l(7545);y.exports=c.Promise},6577:function(y,I,l){l(5397);var c=l(7545);y.exports=c.Reflect.construct},3842:function(y,I,l){l(957);var c=l(5607);y.exports=c("String").trim},5008:function(y,I,l){l(9106),l(6663),l(6187),l(9781),l(492),l(6681),l(9594),l(3665),l(9017),l(1250),l(9786),l(503),l(6565),l(9322),l(3610),l(6886),l(3514),l(8671),l(8556),l(1367);var c=l(7545);y.exports=c.Symbol},994:function(y,I,l){l(8939),l(6663),l(5454),l(3665);var c=l(9207);y.exports=c.f("iterator")},2813:function(y,I,l){var c=l(3822);y.exports=c},8664:function(y,I,l){var c=l(1434);y.exports=c},1457:function(y,I,l){var c=l(7710);y.exports=c},2937:function(y,I,l){var c=l(4741);y.exports=c},9297:function(y,I,l){var c=l(4963);y.exports=c},8026:function(y,I,l){var c=l(7820);y.exports=c},2044:function(y,I,l){var c=l(8980);y.exports=c},2214:function(y,I,l){var c=l(6672);y.exports=c},9256:function(y,I,l){var c=l(2285);l(177),l(9031),l(6658),l(1875),l(8658),l(4592),l(6680),y.exports=c},5659:function(y,I,l){var c=l(8535);y.exports=c},6235:function(y,I,l){var c=l(6447),T=l(9288);y.exports=function(P){if(c(P))return P;throw TypeError(T(P)+" is not a function")}},1404:function(y,I,l){var c=l(2091),T=l(9288);y.exports=function(P){if(c(P))return P;throw TypeError(T(P)+" is not a constructor")}},7757:function(y,I,l){var c=l(6447);y.exports=function(T){if(typeof T=="object"||c(T))return T;throw TypeError("Can't set "+String(T)+" as a prototype")}},7423:function(y){y.exports=function(){}},6961:function(y){y.exports=function(I,l,c){if(I instanceof l)return I;throw TypeError("Incorrect "+(c?c+" ":"")+"invocation")}},1138:function(y,I,l){var c=l(5744);y.exports=function(T){if(c(T))return T;throw TypeError(String(T)+" is not an object")}},2724:function(y,I,l){"use strict";var c=l(1795),T=l(7739),P=l(4104);y.exports=e(function(N){for(var j=c(this),b=P(j),r=arguments.length,m=T(r>1?arguments[1]:void 0,b),p=r>2?arguments[2]:void 0,i=p===void 0?b:T(p,b);i>m;)j[m++]=N;return j},"fill")},7397:function(y,I,l){"use strict";var c=l(454).forEach,T=l(424),P=T("forEach");y.exports=P?[].forEach:e(function(N){return c(this,N,arguments.length>1?arguments[1]:void 0)},"forEach")},841:function(y,I,l){"use strict";var c=l(8043),T=l(1795),P=l(1635),L=l(6109),N=l(2091),j=l(4104),b=l(9361),r=l(1669),m=l(8703);y.exports=e(function(i){var a=T(i),n=N(this),f=arguments.length,_=f>1?arguments[1]:void 0,h=_!==void 0;h&&(_=c(_,f>2?arguments[2]:void 0,2));var E=m(a),w=0,A,D,z,B,Y,H;if(E&&!(this==Array&&L(E)))for(B=r(a,E),Y=B.next,D=n?new this:[];!(z=Y.call(B)).done;w++)H=h?P(B,_,[z.value,w],!0):z.value,b(D,w,H);else for(A=j(a),D=n?new this(A):Array(A);A>w;w++)H=h?_(a[w],w):a[w],b(D,w,H);return D.length=w,D},"from")},8180:function(y,I,l){var c=l(101),T=l(7739),P=l(4104),L=e(function(N){return function(j,b,r){var m=c(j),p=P(m),i=T(r,p),a;if(N&&b!=b){for(;p>i;)if(a=m[i++],a!=a)return!0}else for(;p>i;i++)if((N||i in m)&&m[i]===b)return N||i||0;return!N&&-1}},"createMethod");y.exports={includes:L(!0),indexOf:L(!1)}},454:function(y,I,l){var c=l(8043),T=l(2202),P=l(1795),L=l(4104),N=l(1321),j=[].push,b=e(function(r){var m=r==1,p=r==2,i=r==3,a=r==4,n=r==6,f=r==7,_=r==5||n;return function(h,E,w,A){for(var D=P(h),z=T(D),B=c(E,w,3),Y=L(z),H=0,V=A||N,lt=m?V(h,Y):p||f?V(h,0):void 0,rt,St;Y>H;H++)if((_||H in z)&&(rt=z[H],St=B(rt,H,D),r))if(m)lt[H]=St;else if(St)switch(r){case 3:return!0;case 5:return rt;case 6:return H;case 2:j.call(lt,rt)}else switch(r){case 4:return!1;case 7:j.call(lt,rt)}return n?-1:i||a?a:lt}},"createMethod");y.exports={forEach:b(0),map:b(1),filter:b(2),some:b(3),every:b(4),find:b(5),findIndex:b(6),filterReject:b(7)}},242:function(y,I,l){var c=l(6192),T=l(8182),P=l(4218),L=T("species");y.exports=function(N){return P>=51||!c(function(){var j=[],b=j.constructor={};return b[L]=function(){return{foo:1}},j[N](Boolean).foo!==1})}},424:function(y,I,l){"use strict";var c=l(6192);y.exports=function(T,P){var L=[][T];return!!L&&c(function(){L.call(null,P||function(){throw 1},1)})}},3712:function(y,I,l){var c=l(4770),T=l(2091),P=l(5744),L=l(8182),N=L("species");y.exports=function(j){var b;return c(j)&&(b=j.constructor,T(b)&&(b===Array||c(b.prototype))?b=void 0:P(b)&&(b=b[N],b===null&&(b=void 0))),b===void 0?Array:b}},1321:function(y,I,l){var c=l(3712);y.exports=function(T,P){return new(c(T))(P===0?0:P)}},1635:function(y,I,l){var c=l(1138),T=l(6639);y.exports=function(P,L,N,j){try{return j?L(c(N)[0],N[1]):L(N)}catch(b){T(P,"throw",b)}}},9770:function(y,I,l){var c=l(8182),T=c("iterator"),P=!1;try{var L=0,N={next:function(){return{done:!!L++}},return:function(){P=!0}};N[T]=function(){return this},Array.from(N,function(){throw 2})}catch{}y.exports=function(j,b){if(!b&&!P)return!1;var r=!1;try{var m={};m[T]=function(){return{next:function(){return{done:r=!0}}}},j(m)}catch{}return r}},9272:function(y){var I={}.toString;y.exports=function(l){return I.call(l).slice(8,-1)}},4696:function(y,I,l){var c=l(3471),T=l(6447),P=l(9272),L=l(8182),N=L("toStringTag"),j=P(function(){return arguments}())=="Arguments",b=e(function(r,m){try{return r[m]}catch{}},"tryGet");y.exports=c?P:function(r){var m,p,i;return r===void 0?"Undefined":r===null?"Null":typeof(p=b(m=Object(r),N))=="string"?p:j?P(m):(i=P(m))=="Object"&&T(m.callee)?"Arguments":i}},4635:function(y,I,l){var c=l(6192);y.exports=!c(function(){function T(){}return e(T,"F"),T.prototype.constructor=null,Object.getPrototypeOf(new T)!==T.prototype})},5148:function(y,I,l){"use strict";var c=l(4413).IteratorPrototype,T=l(2853),P=l(774),L=l(1284),N=l(7771),j=e(function(){return this},"returnThis");y.exports=function(b,r,m){var p=r+" Iterator";return b.prototype=T(c,{next:P(1,m)}),L(b,p,!1,!0),N[p]=j,b}},8711:function(y,I,l){var c=l(69),T=l(2760),P=l(774);y.exports=c?function(L,N,j){return T.f(L,N,P(1,j))}:function(L,N,j){return L[N]=j,L}},774:function(y){y.exports=function(I,l){return{enumerable:!(I&1),configurable:!(I&2),writable:!(I&4),value:l}}},9361:function(y,I,l){"use strict";var c=l(77),T=l(2760),P=l(774);y.exports=function(L,N,j){var b=c(N);b in L?T.f(L,b,P(0,j)):L[b]=j}},7218:function(y,I,l){"use strict";var c=l(3085),T=l(5546),P=l(2282),L=l(6447),N=l(5148),j=l(9341),b=l(4469),r=l(1284),m=l(8711),p=l(9482),i=l(8182),a=l(7771),n=l(4413),f=P.PROPER,_=P.CONFIGURABLE,h=n.IteratorPrototype,E=n.BUGGY_SAFARI_ITERATORS,w=i("iterator"),A="keys",D="values",z="entries",B=e(function(){return this},"returnThis");y.exports=function(Y,H,V,lt,rt,St,q){N(V,H,lt);var _t=e(function(X){if(X===rt&&it)return it;if(!E&&X in xt)return xt[X];switch(X){case A:return e(function(){return new V(this,X)},"keys");case D:return e(function(){return new V(this,X)},"values");case z:return e(function(){return new V(this,X)},"entries")}return function(){return new V(this)}},"getIterationMethod"),G=H+" Iterator",Ut=!1,xt=Y.prototype,Ht=xt[w]||xt["@@iterator"]||rt&&xt[rt],it=!E&&Ht||_t(rt),ut=H=="Array"&&xt.entries||Ht,tt,Z,dt;if(ut&&(tt=j(ut.call(new Y)),tt!==Object.prototype&&tt.next&&(!T&&j(tt)!==h&&(b?b(tt,h):L(tt[w])||p(tt,w,B)),r(tt,G,!0,!0),T&&(a[G]=B))),f&&rt==D&&Ht&&Ht.name!==D&&(!T&&_?m(xt,"name",D):(Ut=!0,it=e(function(){return Ht.call(this)},"values"))),rt)if(Z={values:_t(D),keys:St?it:_t(A),entries:_t(z)},q)for(dt in Z)(E||Ut||!(dt in xt))&&p(xt,dt,Z[dt]);else c({target:H,proto:!0,forced:E||Ut},Z);return(!T||q)&&xt[w]!==it&&p(xt,w,it,{name:rt}),a[H]=it,Z}},1488:function(y,I,l){var c=l(7545),T=l(4500),P=l(9207),L=l(2760).f;y.exports=function(N){var j=c.Symbol||(c.Symbol={});T(j,N)||L(j,N,{value:P.f(N)})}},69:function(y,I,l){var c=l(6192);y.exports=!c(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7})},7449:function(y,I,l){var c=l(8576),T=l(5744),P=c.document,L=T(P)&&T(P.createElement);y.exports=function(N){return L?P.createElement(N):{}}},7365:function(y){y.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},2957:function(y){y.exports=typeof window=="object"},9347:function(y,I,l){var c=l(8989),T=l(8576);y.exports=/ipad|iphone|ipod/i.test(c)&&T.Pebble!==void 0},9536:function(y,I,l){var c=l(8989);y.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(c)},224:function(y,I,l){var c=l(9272),T=l(8576);y.exports=c(T.process)=="process"},5914:function(y,I,l){var c=l(8989);y.exports=/web0s(?!.*chrome)/i.test(c)},8989:function(y,I,l){var c=l(150);y.exports=c("navigator","userAgent")||""},4218:function(y,I,l){var c=l(8576),T=l(8989),P=c.process,L=c.Deno,N=P&&P.versions||L&&L.version,j=N&&N.v8,b,r;j?(b=j.split("."),r=b[0]<4?1:b[0]+b[1]):T&&(b=T.match(/Edge\/(\d+)/),(!b||b[1]>=74)&&(b=T.match(/Chrome\/(\d+)/),b&&(r=b[1]))),y.exports=r&&+r},5607:function(y,I,l){var c=l(7545);y.exports=function(T){return c[T+"Prototype"]}},2952:function(y){y.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},3085:function(y,I,l){"use strict";var c=l(8576),T=l(6447),P=l(5141).f,L=l(9245),N=l(7545),j=l(8043),b=l(8711),r=l(4500),m=e(function(p){var i=e(function(a,n,f){if(this instanceof p){switch(arguments.length){case 0:return new p;case 1:return new p(a);case 2:return new p(a,n)}return new p(a,n,f)}return p.apply(this,arguments)},"Wrapper");return i.prototype=p.prototype,i},"wrapConstructor");y.exports=function(p,i){var a=p.target,n=p.global,f=p.stat,_=p.proto,h=n?c:f?c[a]:(c[a]||{}).prototype,E=n?N:N[a]||b(N,a,{})[a],w=E.prototype,A,D,z,B,Y,H,V,lt,rt;for(B in i)A=L(n?B:a+(f?".":"#")+B,p.forced),D=!A&&h&&r(h,B),H=E[B],D&&(p.noTargetGet?(rt=P(h,B),V=rt&&rt.value):V=h[B]),Y=D&&V?V:i[B],!(D&&typeof H==typeof Y)&&(p.bind&&D?lt=j(Y,c):p.wrap&&D?lt=m(Y):_&&T(Y)?lt=j(Function.call,Y):lt=Y,(p.sham||Y&&Y.sham||H&&H.sham)&&b(lt,"sham",!0),b(E,B,lt),_&&(z=a+"Prototype",r(N,z)||b(N,z,{}),b(N[z],B,Y),p.real&&w&&!w[B]&&b(w,B,Y)))}},6192:function(y){y.exports=function(I){try{return!!I()}catch{return!0}}},8043:function(y,I,l){var c=l(6235);y.exports=function(T,P,L){if(c(T),P===void 0)return T;switch(L){case 0:return function(){return T.call(P)};case 1:return function(N){return T.call(P,N)};case 2:return function(N,j){return T.call(P,N,j)};case 3:return function(N,j,b){return T.call(P,N,j,b)}}return function(){return T.apply(P,arguments)}}},6782:function(y,I,l){"use strict";var c=l(6235),T=l(5744),P=[].slice,L={},N=e(function(j,b,r){if(!(b in L)){for(var m=[],p=0;p<b;p++)m[p]="a["+p+"]";L[b]=Function("C,a","return new C("+m.join(",")+")")}return L[b](j,r)},"construct");y.exports=Function.bind||e(function(b){var r=c(this),m=P.call(arguments,1),p=e(function(){var a=m.concat(P.call(arguments));return this instanceof p?N(r,a.length,a):r.apply(b,a)},"bound");return T(r.prototype)&&(p.prototype=r.prototype),p},"bind")},2282:function(y,I,l){var c=l(69),T=l(4500),P=Function.prototype,L=c&&Object.getOwnPropertyDescriptor,N=T(P,"name"),j=N&&e(function(){},"something").name==="something",b=N&&(!c||c&&L(P,"name").configurable);y.exports={EXISTS:N,PROPER:j,CONFIGURABLE:b}},150:function(y,I,l){var c=l(7545),T=l(8576),P=l(6447),L=e(function(N){return P(N)?N:void 0},"aFunction");y.exports=function(N,j){return arguments.length<2?L(c[N])||L(T[N]):c[N]&&c[N][j]||T[N]&&T[N][j]}},8703:function(y,I,l){var c=l(4696),T=l(5037),P=l(7771),L=l(8182),N=L("iterator");y.exports=function(j){if(j!=null)return T(j,N)||T(j,"@@iterator")||P[c(j)]}},1669:function(y,I,l){var c=l(6235),T=l(1138),P=l(8703);y.exports=function(L,N){var j=arguments.length<2?P(L):N;if(c(j))return T(j.call(L));throw TypeError(String(L)+" is not iterable")}},5037:function(y,I,l){var c=l(6235);y.exports=function(T,P){var L=T[P];return L==null?void 0:c(L)}},8576:function(y,I,l){var c=e(function(T){return T&&T.Math==Math&&T},"check");y.exports=c(typeof globalThis=="object"&&globalThis)||c(typeof window=="object"&&window)||c(typeof self=="object"&&self)||c(typeof l.g=="object"&&l.g)||function(){return this}()||Function("return this")()},4500:function(y,I,l){var c=l(1795),T={}.hasOwnProperty;y.exports=Object.hasOwn||e(function(L,N){return T.call(c(L),N)},"hasOwn")},4535:function(y){y.exports={}},3681:function(y,I,l){var c=l(8576);y.exports=function(T,P){var L=c.console;L&&L.error&&(arguments.length===1?L.error(T):L.error(T,P))}},7403:function(y,I,l){var c=l(150);y.exports=c("document","documentElement")},188:function(y,I,l){var c=l(69),T=l(6192),P=l(7449);y.exports=!c&&!T(function(){return Object.defineProperty(P("div"),"a",{get:function(){return 7}}).a!=7})},2202:function(y,I,l){var c=l(6192),T=l(9272),P="".split;y.exports=c(function(){return!Object("z").propertyIsEnumerable(0)})?function(L){return T(L)=="String"?P.call(L,""):Object(L)}:Object},9516:function(y,I,l){var c=l(6447),T=l(6434),P=Function.toString;c(T.inspectSource)||(T.inspectSource=function(L){return P.call(L)}),y.exports=T.inspectSource},273:function(y,I,l){var c=l(5744),T=l(8711);y.exports=function(P,L){c(L)&&"cause"in L&&T(P,"cause",P.cause)}},3326:function(y,I,l){var c=l(8921),T=l(8576),P=l(5744),L=l(8711),N=l(4500),j=l(6434),b=l(9766),r=l(4535),m="Object already initialized",p=T.WeakMap,i,a,n,f=e(function(z){return n(z)?a(z):i(z,{})},"enforce"),_=e(function(z){return function(B){var Y;if(!P(B)||(Y=a(B)).type!==z)throw TypeError("Incompatible receiver, "+z+" required");return Y}},"getterFor");if(c||j.state){var h=j.state||(j.state=new p),E=h.get,w=h.has,A=h.set;i=e(function(z,B){if(w.call(h,z))throw new TypeError(m);return B.facade=z,A.call(h,z,B),B},"set"),a=e(function(z){return E.call(h,z)||{}},"get"),n=e(function(z){return w.call(h,z)},"has")}else{var D=b("state");r[D]=!0,i=e(function(z,B){if(N(z,D))throw new TypeError(m);return B.facade=z,L(z,D,B),B},"set"),a=e(function(z){return N(z,D)?z[D]:{}},"get"),n=e(function(z){return N(z,D)},"has")}y.exports={set:i,get:a,has:n,enforce:f,getterFor:_}},6109:function(y,I,l){var c=l(8182),T=l(7771),P=c("iterator"),L=Array.prototype;y.exports=function(N){return N!==void 0&&(T.Array===N||L[P]===N)}},4770:function(y,I,l){var c=l(9272);y.exports=Array.isArray||e(function(P){return c(P)=="Array"},"isArray")},6447:function(y){y.exports=function(I){return typeof I=="function"}},2091:function(y,I,l){var c=l(6192),T=l(6447),P=l(4696),L=l(150),N=l(9516),j=[],b=L("Reflect","construct"),r=/^\s*(?:class|function)\b/,m=r.exec,p=!r.exec(function(){}),i=e(function(n){if(!T(n))return!1;try{return b(Object,j,n),!0}catch{return!1}},"isConstructorModern"),a=e(function(n){if(!T(n))return!1;switch(P(n)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}return p||!!m.call(r,N(n))},"isConstructorLegacy");y.exports=!b||c(function(){var n;return i(i.call)||!i(Object)||!i(function(){n=!0})||n})?a:i},9245:function(y,I,l){var c=l(6192),T=l(6447),P=/#|\.prototype\./,L=e(function(m,p){var i=j[N(m)];return i==r?!0:i==b?!1:T(p)?c(p):!!p},"isForced"),N=L.normalize=function(m){return String(m).replace(P,".").toLowerCase()},j=L.data={},b=L.NATIVE="N",r=L.POLYFILL="P";y.exports=L},5744:function(y,I,l){var c=l(6447);y.exports=function(T){return typeof T=="object"?T!==null:c(T)}},5546:function(y){y.exports=!0},3236:function(y,I,l){var c=l(6447),T=l(150),P=l(615);y.exports=P?function(L){return typeof L=="symbol"}:function(L){var N=T("Symbol");return c(N)&&Object(L)instanceof N}},3442:function(y,I,l){var c=l(1138),T=l(6109),P=l(4104),L=l(8043),N=l(1669),j=l(8703),b=l(6639),r=e(function(m,p){this.stopped=m,this.result=p},"Result");y.exports=function(m,p,i){var a=i&&i.that,n=!!(i&&i.AS_ENTRIES),f=!!(i&&i.IS_ITERATOR),_=!!(i&&i.INTERRUPTED),h=L(p,a,1+n+_),E,w,A,D,z,B,Y,H=e(function(lt){return E&&b(E,"normal",lt),new r(!0,lt)},"stop"),V=e(function(lt){return n?(c(lt),_?h(lt[0],lt[1],H):h(lt[0],lt[1])):_?h(lt,H):h(lt)},"callFn");if(f)E=m;else{if(w=j(m),!w)throw TypeError(String(m)+" is not iterable");if(T(w)){for(A=0,D=P(m);D>A;A++)if(z=V(m[A]),z&&z instanceof r)return z;return new r(!1)}E=N(m,w)}for(B=E.next;!(Y=B.call(E)).done;){try{z=V(Y.value)}catch(lt){b(E,"throw",lt)}if(typeof z=="object"&&z&&z instanceof r)return z}return new r(!1)}},6639:function(y,I,l){var c=l(1138),T=l(5037);y.exports=function(P,L,N){var j,b;c(P);try{if(j=T(P,"return"),!j){if(L==="throw")throw N;return N}j=j.call(P)}catch(r){b=!0,j=r}if(L==="throw")throw N;if(b)throw j;return c(j),N}},4413:function(y,I,l){"use strict";var c=l(6192),T=l(6447),P=l(2853),L=l(9341),N=l(9482),j=l(8182),b=l(5546),r=j("iterator"),m=!1,p,i,a;[].keys&&(a=[].keys(),"next"in a?(i=L(L(a)),i!==Object.prototype&&(p=i)):m=!0);var n=p==null||c(function(){var f={};return p[r].call(f)!==f});n?p={}:b&&(p=P(p)),T(p[r])||N(p,r,function(){return this}),y.exports={IteratorPrototype:p,BUGGY_SAFARI_ITERATORS:m}},7771:function(y){y.exports={}},4104:function(y,I,l){var c=l(8445);y.exports=function(T){return c(T.length)}},2950:function(y,I,l){var c=l(8576),T=l(5141).f,P=l(7160).set,L=l(9536),N=l(9347),j=l(5914),b=l(224),r=c.MutationObserver||c.WebKitMutationObserver,m=c.document,p=c.process,i=c.Promise,a=T(c,"queueMicrotask"),n=a&&a.value,f,_,h,E,w,A,D,z;n||(f=e(function(){var B,Y;for(b&&(B=p.domain)&&B.exit();_;){Y=_.fn,_=_.next;try{Y()}catch(H){throw _?E():h=void 0,H}}h=void 0,B&&B.enter()},"flush"),!L&&!b&&!j&&r&&m?(w=!0,A=m.createTextNode(""),new r(f).observe(A,{characterData:!0}),E=e(function(){A.data=w=!w},"notify")):!N&&i&&i.resolve?(D=i.resolve(void 0),D.constructor=i,z=D.then,E=e(function(){z.call(D,f)},"notify")):b?E=e(function(){p.nextTick(f)},"notify"):E=e(function(){P.call(c,f)},"notify")),y.exports=n||function(B){var Y={fn:B,next:void 0};h&&(h.next=Y),_||(_=Y,E()),h=Y}},4471:function(y,I,l){var c=l(8576);y.exports=c.Promise},3045:function(y,I,l){var c=l(4218),T=l(6192);y.exports=!!Object.getOwnPropertySymbols&&!T(function(){var P=Symbol();return!String(P)||!(Object(P)instanceof Symbol)||!Symbol.sham&&c&&c<41})},4551:function(y,I,l){var c=l(6192),T=l(8182),P=l(5546),L=T("iterator");y.exports=!c(function(){var N=new URL("b?a=1&b=2&c=3","http://a"),j=N.searchParams,b="";return N.pathname="c%20d",j.forEach(function(r,m){j.delete("b"),b+=m+r}),P&&!N.toJSON||!j.sort||N.href!=="http://a/c%20d?a=1&c=3"||j.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!j[L]||new URL("https://a@b").username!=="a"||new URLSearchParams(new URLSearchParams("a=b")).get("a")!=="b"||new URL("http://\u0442\u0435\u0441\u0442").host!=="xn--e1aybc"||new URL("http://a#\u0431").hash!=="#%D0%B1"||b!=="a1c3"||new URL("http://x",void 0).host!=="x"})},8921:function(y,I,l){var c=l(8576),T=l(6447),P=l(9516),L=c.WeakMap;y.exports=T(L)&&/native code/.test(P(L))},9438:function(y,I,l){"use strict";var c=l(6235),T=e(function(P){var L,N;this.promise=new P(function(j,b){if(L!==void 0||N!==void 0)throw TypeError("Bad Promise constructor");L=j,N=b}),this.resolve=c(L),this.reject=c(N)},"PromiseCapability");y.exports.f=function(P){return new T(P)}},15:function(y,I,l){var c=l(8576),T=l(6192),P=l(4845),L=l(4277).trim,N=l(1450),j=c.parseFloat,b=c.Symbol,r=b&&b.iterator,m=1/j(N+"-0")!==-1/0||r&&!T(function(){j(Object(r))});y.exports=m?e(function(i){var a=L(P(i)),n=j(a);return n===0&&a.charAt(0)=="-"?-0:n},"parseFloat"):j},2558:function(y,I,l){var c=l(8576),T=l(6192),P=l(4845),L=l(4277).trim,N=l(1450),j=c.parseInt,b=c.Symbol,r=b&&b.iterator,m=/^[+-]?0[Xx]/,p=j(N+"08")!==8||j(N+"0x16")!==22||r&&!T(function(){j(Object(r))});y.exports=p?e(function(a,n){var f=L(P(a));return j(f,n>>>0||(m.test(f)?16:10))},"parseInt"):j},2503:function(y,I,l){"use strict";var c=l(69),T=l(6192),P=l(7653),L=l(4750),N=l(6007),j=l(1795),b=l(2202),r=Object.assign,m=Object.defineProperty;y.exports=!r||T(function(){if(c&&r({b:1},r(m({},"a",{enumerable:!0,get:function(){m(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var p={},i={},a=Symbol(),n="abcdefghijklmnopqrst";return p[a]=7,n.split("").forEach(function(f){i[f]=f}),r({},p)[a]!=7||P(r({},i)).join("")!=n})?e(function(i,a){for(var n=j(i),f=arguments.length,_=1,h=L.f,E=N.f;f>_;)for(var w=b(arguments[_++]),A=h?P(w).concat(h(w)):P(w),D=A.length,z=0,B;D>z;)B=A[z++],(!c||E.call(w,B))&&(n[B]=w[B]);return n},"assign"):r},2853:function(y,I,l){var c=l(1138),T=l(1187),P=l(2952),L=l(4535),N=l(7403),j=l(7449),b=l(9766),r=">",m="<",p="prototype",i="script",a=b("IE_PROTO"),n=e(function(){},"EmptyConstructor"),f=e(function(A){return m+i+r+A+m+"/"+i+r},"scriptTag"),_=e(function(A){A.write(f("")),A.close();var D=A.parentWindow.Object;return A=null,D},"NullProtoObjectViaActiveX"),h=e(function(){var A=j("iframe"),D="java"+i+":",z;return A.style.display="none",N.appendChild(A),A.src=String(D),z=A.contentWindow.document,z.open(),z.write(f("document.F=Object")),z.close(),z.F},"NullProtoObjectViaIFrame"),E,w=e(function(){try{E=new ActiveXObject("htmlfile")}catch{}w=typeof document!="undefined"?document.domain&&E?_(E):h():_(E);for(var A=P.length;A--;)delete w[p][P[A]];return w()},"NullProtoObject");L[a]=!0,y.exports=Object.create||e(function(D,z){var B;return D!==null?(n[p]=c(D),B=new n,n[p]=null,B[a]=D):B=w(),z===void 0?B:T(B,z)},"create")},1187:function(y,I,l){var c=l(69),T=l(2760),P=l(1138),L=l(7653);y.exports=c?Object.defineProperties:e(function(j,b){P(j);for(var r=L(b),m=r.length,p=0,i;m>p;)T.f(j,i=r[p++],b[i]);return j},"defineProperties")},2760:function(y,I,l){var c=l(69),T=l(188),P=l(1138),L=l(77),N=Object.defineProperty;I.f=c?N:e(function(b,r,m){if(P(b),r=L(r),P(m),T)try{return N(b,r,m)}catch{}if("get"in m||"set"in m)throw TypeError("Accessors not supported");return"value"in m&&(b[r]=m.value),b},"defineProperty")},5141:function(y,I,l){var c=l(69),T=l(6007),P=l(774),L=l(101),N=l(77),j=l(4500),b=l(188),r=Object.getOwnPropertyDescriptor;I.f=c?r:e(function(p,i){if(p=L(p),i=N(i),b)try{return r(p,i)}catch{}if(j(p,i))return P(!T.f.call(p,i),p[i])},"getOwnPropertyDescriptor")},4052:function(y,I,l){var c=l(101),T=l(2092).f,P={}.toString,L=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],N=e(function(j){try{return T(j)}catch{return L.slice()}},"getWindowNames");y.exports.f=e(function(b){return L&&P.call(b)=="[object Window]"?N(b):T(c(b))},"getOwnPropertyNames")},2092:function(y,I,l){var c=l(7934),T=l(2952),P=T.concat("length","prototype");I.f=Object.getOwnPropertyNames||e(function(N){return c(N,P)},"getOwnPropertyNames")},4750:function(y,I){I.f=Object.getOwnPropertySymbols},9341:function(y,I,l){var c=l(4500),T=l(6447),P=l(1795),L=l(9766),N=l(4635),j=L("IE_PROTO"),b=Object.prototype;y.exports=N?Object.getPrototypeOf:function(r){var m=P(r);if(c(m,j))return m[j];var p=m.constructor;return T(p)&&m instanceof p?p.prototype:m instanceof Object?b:null}},7934:function(y,I,l){var c=l(4500),T=l(101),P=l(8180).indexOf,L=l(4535);y.exports=function(N,j){var b=T(N),r=0,m=[],p;for(p in b)!c(L,p)&&c(b,p)&&m.push(p);for(;j.length>r;)c(b,p=j[r++])&&(~P(m,p)||m.push(p));return m}},7653:function(y,I,l){var c=l(7934),T=l(2952);y.exports=Object.keys||e(function(L){return c(L,T)},"keys")},6007:function(y,I){"use strict";var l={}.propertyIsEnumerable,c=Object.getOwnPropertyDescriptor,T=c&&!l.call({1:2},1);I.f=T?e(function(L){var N=c(this,L);return!!N&&N.enumerable},"propertyIsEnumerable"):l},4469:function(y,I,l){var c=l(1138),T=l(7757);y.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var P=!1,L={},N;try{N=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set,N.call(L,[]),P=L instanceof Array}catch{}return e(function(b,r){return c(b),T(r),P?N.call(b,r):b.__proto__=r,b},"setPrototypeOf")}():void 0)},158:function(y,I,l){"use strict";var c=l(3471),T=l(4696);y.exports=c?{}.toString:e(function(){return"[object "+T(this)+"]"},"toString")},380:function(y,I,l){var c=l(6447),T=l(5744);y.exports=function(P,L){var N,j;if(L==="string"&&c(N=P.toString)&&!T(j=N.call(P))||c(N=P.valueOf)&&!T(j=N.call(P))||L!=="string"&&c(N=P.toString)&&!T(j=N.call(P)))return j;throw TypeError("Can't convert object to primitive value")}},7545:function(y){y.exports={}},892:function(y){y.exports=function(I){try{return{error:!1,value:I()}}catch(l){return{error:!0,value:l}}}},9126:function(y,I,l){var c=l(1138),T=l(5744),P=l(9438);y.exports=function(L,N){if(c(L),T(N)&&N.constructor===L)return N;var j=P.f(L),b=j.resolve;return b(N),j.promise}},533:function(y,I,l){var c=l(9482);y.exports=function(T,P,L){for(var N in P)L&&L.unsafe&&T[N]?T[N]=P[N]:c(T,N,P[N],L);return T}},9482:function(y,I,l){var c=l(8711);y.exports=function(T,P,L,N){N&&N.enumerable?T[P]=L:c(T,P,L)}},3209:function(y){y.exports=function(I){if(I==null)throw TypeError("Can't call method on "+I);return I}},7613:function(y,I,l){var c=l(8576);y.exports=function(T,P){try{Object.defineProperty(c,T,{value:P,configurable:!0,writable:!0})}catch{c[T]=P}return P}},3656:function(y,I,l){"use strict";var c=l(150),T=l(2760),P=l(8182),L=l(69),N=P("species");y.exports=function(j){var b=c(j),r=T.f;L&&b&&!b[N]&&r(b,N,{configurable:!0,get:function(){return this}})}},1284:function(y,I,l){var c=l(3471),T=l(2760).f,P=l(8711),L=l(4500),N=l(158),j=l(8182),b=j("toStringTag");y.exports=function(r,m,p,i){if(r){var a=p?r:r.prototype;L(a,b)||T(a,b,{configurable:!0,value:m}),i&&!c&&P(a,"toString",N)}}},9766:function(y,I,l){var c=l(8717),T=l(2759),P=c("keys");y.exports=function(L){return P[L]||(P[L]=T(L))}},6434:function(y,I,l){var c=l(8576),T=l(7613),P="__core-js_shared__",L=c[P]||T(P,{});y.exports=L},8717:function(y,I,l){var c=l(5546),T=l(6434);(y.exports=function(P,L){return T[P]||(T[P]=L!==void 0?L:{})})("versions",[]).push({version:"3.18.2",mode:c?"pure":"global",copyright:"\xA9 2021 Denis Pushkarev (zloirock.ru)"})},4743:function(y,I,l){var c=l(1138),T=l(1404),P=l(8182),L=P("species");y.exports=function(N,j){var b=c(N).constructor,r;return b===void 0||(r=c(b)[L])==null?j:T(r)}},863:function(y,I,l){var c=l(1941),T=l(4845),P=l(3209),L=e(function(N){return function(j,b){var r=T(P(j)),m=c(b),p=r.length,i,a;return m<0||m>=p?N?"":void 0:(i=r.charCodeAt(m),i<55296||i>56319||m+1===p||(a=r.charCodeAt(m+1))<56320||a>57343?N?r.charAt(m):i:N?r.slice(m,m+2):(i-55296<<10)+(a-56320)+65536)}},"createMethod");y.exports={codeAt:L(!1),charAt:L(!0)}},7977:function(y){"use strict";var I=2147483647,l=36,c=1,T=26,P=38,L=700,N=72,j=128,b="-",r=/[^\0-\u007E]/,m=/[.\u3002\uFF0E\uFF61]/g,p="Overflow: input needs wider integers to process",i=l-c,a=Math.floor,n=String.fromCharCode,f=e(function(w){for(var A=[],D=0,z=w.length;D<z;){var B=w.charCodeAt(D++);if(B>=55296&&B<=56319&&D<z){var Y=w.charCodeAt(D++);(Y&64512)==56320?A.push(((B&1023)<<10)+(Y&1023)+65536):(A.push(B),D--)}else A.push(B)}return A},"ucs2decode"),_=e(function(w){return w+22+75*(w<26)},"digitToBasic"),h=e(function(w,A,D){var z=0;for(w=D?a(w/L):w>>1,w+=a(w/A);w>i*T>>1;z+=l)w=a(w/i);return a(z+(i+1)*w/(w+P))},"adapt"),E=e(function(w){var A=[];w=f(w);var D=w.length,z=j,B=0,Y=N,H,V;for(H=0;H<w.length;H++)V=w[H],V<128&&A.push(n(V));var lt=A.length,rt=lt;for(lt&&A.push(b);rt<D;){var St=I;for(H=0;H<w.length;H++)V=w[H],V>=z&&V<St&&(St=V);var q=rt+1;if(St-z>a((I-B)/q))throw RangeError(p);for(B+=(St-z)*q,z=St,H=0;H<w.length;H++){if(V=w[H],V<z&&++B>I)throw RangeError(p);if(V==z){for(var _t=B,G=l;;G+=l){var Ut=G<=Y?c:G>=Y+T?T:G-Y;if(_t<Ut)break;var xt=_t-Ut,Ht=l-Ut;A.push(n(_(Ut+xt%Ht))),_t=a(xt/Ht)}A.push(n(_(_t))),Y=h(B,q,rt==lt),B=0,++rt}}++B,++z}return A.join("")},"encode");y.exports=function(w){var A=[],D=w.toLowerCase().replace(m,".").split("."),z,B;for(z=0;z<D.length;z++)B=D[z],A.push(r.test(B)?"xn--"+E(B):B);return A.join(".")}},6815:function(y,I,l){var c=l(2282).PROPER,T=l(6192),P=l(1450),L="\u200B\x85\u180E";y.exports=function(N){return T(function(){return!!P[N]()||L[N]()!==L||c&&P[N].name!==N})}},4277:function(y,I,l){var c=l(3209),T=l(4845),P=l(1450),L="["+P+"]",N=RegExp("^"+L+L+"*"),j=RegExp(L+L+"*$"),b=e(function(r){return function(m){var p=T(c(m));return r&1&&(p=p.replace(N,"")),r&2&&(p=p.replace(j,"")),p}},"createMethod");y.exports={start:b(1),end:b(2),trim:b(3)}},7160:function(y,I,l){var c=l(8576),T=l(6447),P=l(6192),L=l(8043),N=l(7403),j=l(7449),b=l(9536),r=l(224),m=c.setImmediate,p=c.clearImmediate,i=c.process,a=c.MessageChannel,n=c.Dispatch,f=0,_={},h="onreadystatechange",E,w,A,D;try{E=c.location}catch{}var z=e(function(V){if(_.hasOwnProperty(V)){var lt=_[V];delete _[V],lt()}},"run"),B=e(function(V){return function(){z(V)}},"runner"),Y=e(function(V){z(V.data)},"listener"),H=e(function(V){c.postMessage(String(V),E.protocol+"//"+E.host)},"post");(!m||!p)&&(m=e(function(lt){for(var rt=[],St=arguments.length,q=1;St>q;)rt.push(arguments[q++]);return _[++f]=function(){(T(lt)?lt:Function(lt)).apply(void 0,rt)},w(f),f},"setImmediate"),p=e(function(lt){delete _[lt]},"clearImmediate"),r?w=e(function(V){i.nextTick(B(V))},"defer"):n&&n.now?w=e(function(V){n.now(B(V))},"defer"):a&&!b?(A=new a,D=A.port2,A.port1.onmessage=Y,w=L(D.postMessage,D,1)):c.addEventListener&&T(c.postMessage)&&!c.importScripts&&E&&E.protocol!=="file:"&&!P(H)?(w=H,c.addEventListener("message",Y,!1)):h in j("script")?w=e(function(V){N.appendChild(j("script"))[h]=function(){N.removeChild(this),z(V)}},"defer"):w=e(function(V){setTimeout(B(V),0)},"defer")),y.exports={set:m,clear:p}},7739:function(y,I,l){var c=l(1941),T=Math.max,P=Math.min;y.exports=function(L,N){var j=c(L);return j<0?T(j+N,0):P(j,N)}},101:function(y,I,l){var c=l(2202),T=l(3209);y.exports=function(P){return c(T(P))}},1941:function(y){var I=Math.ceil,l=Math.floor;y.exports=function(c){var T=+c;return T!==T||T===0?0:(T>0?l:I)(T)}},8445:function(y,I,l){var c=l(1941),T=Math.min;y.exports=function(P){return P>0?T(c(P),9007199254740991):0}},1795:function(y,I,l){var c=l(3209);y.exports=function(T){return Object(c(T))}},7888:function(y,I,l){var c=l(5744),T=l(3236),P=l(5037),L=l(380),N=l(8182),j=N("toPrimitive");y.exports=function(b,r){if(!c(b)||T(b))return b;var m=P(b,j),p;if(m){if(r===void 0&&(r="default"),p=m.call(b,r),!c(p)||T(p))return p;throw TypeError("Can't convert object to primitive value")}return r===void 0&&(r="number"),L(b,r)}},77:function(y,I,l){var c=l(7888),T=l(3236);y.exports=function(P){var L=c(P,"string");return T(L)?L:String(L)}},3471:function(y,I,l){var c=l(8182),T=c("toStringTag"),P={};P[T]="z",y.exports=String(P)==="[object z]"},4845:function(y,I,l){var c=l(4696);y.exports=function(T){if(c(T)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return String(T)}},9288:function(y){y.exports=function(I){try{return String(I)}catch{return"Object"}}},2759:function(y){var I=0,l=Math.random();y.exports=function(c){return"Symbol("+String(c===void 0?"":c)+")_"+(++I+l).toString(36)}},615:function(y,I,l){var c=l(3045);y.exports=c&&!Symbol.sham&&typeof Symbol.iterator=="symbol"},9207:function(y,I,l){var c=l(8182);I.f=c},8182:function(y,I,l){var c=l(8576),T=l(8717),P=l(4500),L=l(2759),N=l(3045),j=l(615),b=T("wks"),r=c.Symbol,m=j?r:r&&r.withoutSetter||L;y.exports=function(p){return(!P(b,p)||!(N||typeof b[p]=="string"))&&(N&&P(r,p)?b[p]=r[p]:b[p]=m("Symbol."+p)),b[p]}},1450:function(y){y.exports=`
|
|
389
|
-
\v\f\r \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF`},4242:function(y,I,l){"use strict";var c=l(3085),T=l(9341),P=l(4469),L=l(2853),N=l(8711),j=l(774),b=l(273),r=l(3442),m=l(4845),p=e(function(a,n){var f=this,_=arguments.length>2?arguments[2]:void 0;if(!(f instanceof p))return new p(a,n,_);P&&(f=P(new Error(void 0),T(f))),n!==void 0&&N(f,"message",m(n)),b(f,_);var h=[];return r(a,h.push,{that:h}),N(f,"errors",h),f},"AggregateError");p.prototype=L(Error.prototype,{constructor:j(5,p),message:j(5,""),name:j(5,"AggregateError")}),c({global:!0},{AggregateError:p})},9106:function(y,I,l){"use strict";var c=l(3085),T=l(6192),P=l(4770),L=l(5744),N=l(1795),j=l(4104),b=l(9361),r=l(1321),m=l(242),p=l(8182),i=l(4218),a=p("isConcatSpreadable"),n=9007199254740991,f="Maximum allowed index exceeded",_=i>=51||!T(function(){var A=[];return A[a]=!1,A.concat()[0]!==A}),h=m("concat"),E=e(function(A){if(!L(A))return!1;var D=A[a];return D!==void 0?!!D:P(A)},"isConcatSpreadable"),w=!_||!h;c({target:"Array",proto:!0,forced:w},{concat:e(function(D){var z=N(this),B=r(z,0),Y=0,H,V,lt,rt,St;for(H=-1,lt=arguments.length;H<lt;H++)if(St=H===-1?z:arguments[H],E(St)){if(rt=j(St),Y+rt>n)throw TypeError(f);for(V=0;V<rt;V++,Y++)V in St&&b(B,Y,St[V])}else{if(Y>=n)throw TypeError(f);b(B,Y++,St)}return B.length=Y,B},"concat")})},1710:function(y,I,l){var c=l(3085),T=l(2724),P=l(7423);c({target:"Array",proto:!0},{fill:T}),P("fill")},3436:function(y,I,l){"use strict";var c=l(3085),T=l(454).filter,P=l(242),L=P("filter");c({target:"Array",proto:!0,forced:!L},{filter:e(function(j){return T(this,j,arguments.length>1?arguments[1]:void 0)},"filter")})},9823:function(y,I,l){"use strict";var c=l(3085),T=l(7397);c({target:"Array",proto:!0,forced:[].forEach!=T},{forEach:T})},9173:function(y,I,l){var c=l(3085),T=l(841),P=l(9770),L=!P(function(N){Array.from(N)});c({target:"Array",stat:!0,forced:L},{from:T})},2276:function(y,I,l){"use strict";var c=l(3085),T=l(8180).indexOf,P=l(424),L=[].indexOf,N=!!L&&1/[1].indexOf(1,-0)<0,j=P("indexOf");c({target:"Array",proto:!0,forced:N||!j},{indexOf:e(function(r){return N?L.apply(this,arguments)||0:T(this,r,arguments.length>1?arguments[1]:void 0)},"indexOf")})},8118:function(y,I,l){var c=l(3085),T=l(4770);c({target:"Array",stat:!0},{isArray:T})},8939:function(y,I,l){"use strict";var c=l(101),T=l(7423),P=l(7771),L=l(3326),N=l(7218),j="Array Iterator",b=L.set,r=L.getterFor(j);y.exports=N(Array,"Array",function(m,p){b(this,{type:j,target:c(m),index:0,kind:p})},function(){var m=r(this),p=m.target,i=m.kind,a=m.index++;return!p||a>=p.length?(m.target=void 0,{value:void 0,done:!0}):i=="keys"?{value:a,done:!1}:i=="values"?{value:p[a],done:!1}:{value:[a,p[a]],done:!1}},"values"),P.Arguments=P.Array,T("keys"),T("values"),T("entries")},3838:function(y,I,l){"use strict";var c=l(3085),T=l(454).map,P=l(242),L=P("map");c({target:"Array",proto:!0,forced:!L},{map:e(function(j){return T(this,j,arguments.length>1?arguments[1]:void 0)},"map")})},5818:function(y,I,l){"use strict";var c=l(3085),T=l(4770),P=l(2091),L=l(5744),N=l(7739),j=l(4104),b=l(101),r=l(9361),m=l(8182),p=l(242),i=p("slice"),a=m("species"),n=[].slice,f=Math.max;c({target:"Array",proto:!0,forced:!i},{slice:e(function(h,E){var w=b(this),A=j(w),D=N(h,A),z=N(E===void 0?A:E,A),B,Y,H;if(T(w)&&(B=w.constructor,P(B)&&(B===Array||T(B.prototype))?B=void 0:L(B)&&(B=B[a],B===null&&(B=void 0)),B===Array||B===void 0))return n.call(w,D,z);for(Y=new(B===void 0?Array:B)(f(z-D,0)),H=0;D<z;D++,H++)D in w&&r(Y,H,w[D]);return Y.length=H,Y},"slice")})},2178:function(y,I,l){"use strict";var c=l(3085),T=l(7739),P=l(1941),L=l(4104),N=l(1795),j=l(1321),b=l(9361),r=l(242),m=r("splice"),p=Math.max,i=Math.min,a=9007199254740991,n="Maximum allowed length exceeded";c({target:"Array",proto:!0,forced:!m},{splice:e(function(_,h){var E=N(this),w=L(E),A=T(_,w),D=arguments.length,z,B,Y,H,V,lt;if(D===0?z=B=0:D===1?(z=0,B=w-A):(z=D-2,B=i(p(P(h),0),w-A)),w+z-B>a)throw TypeError(n);for(Y=j(E,B),H=0;H<B;H++)V=A+H,V in E&&b(Y,H,E[V]);if(Y.length=B,z<B){for(H=A;H<w-B;H++)V=H+B,lt=H+z,V in E?E[lt]=E[V]:delete E[lt];for(H=w;H>w-B+z;H--)delete E[H-1]}else if(z>B)for(H=w-B;H>A;H--)V=H+B-1,lt=H+z-1,V in E?E[lt]=E[V]:delete E[lt];for(H=0;H<z;H++)E[H+A]=arguments[H+2];return E.length=w-B+z,Y},"splice")})},665:function(y,I,l){var c=l(3085),T=l(6782);c({target:"Function",proto:!0},{bind:T})},8671:function(y,I,l){var c=l(8576),T=l(1284);T(c.JSON,"JSON",!0)},8556:function(){},2666:function(y,I,l){var c=l(3085),T=l(2558);c({target:"Number",stat:!0,forced:Number.parseInt!=T},{parseInt:T})},3113:function(y,I,l){var c=l(3085),T=l(69),P=l(2853);c({target:"Object",stat:!0,sham:!T},{create:P})},297:function(y,I,l){var c=l(3085),T=l(69),P=l(2760);c({target:"Object",stat:!0,forced:!T,sham:!T},{defineProperty:P.f})},9234:function(y,I,l){var c=l(3085),T=l(6192),P=l(1795),L=l(9341),N=l(4635),j=T(function(){L(1)});c({target:"Object",stat:!0,forced:j,sham:!N},{getPrototypeOf:e(function(r){return L(P(r))},"getPrototypeOf")})},2647:function(y,I,l){var c=l(3085),T=l(1795),P=l(7653),L=l(6192),N=L(function(){P(1)});c({target:"Object",stat:!0,forced:N},{keys:e(function(b){return P(T(b))},"keys")})},3222:function(y,I,l){var c=l(3085),T=l(4469);c({target:"Object",stat:!0},{setPrototypeOf:T})},6663:function(){},4859:function(y,I,l){var c=l(3085),T=l(15);c({global:!0,forced:parseFloat!=T},{parseFloat:T})},5706:function(y,I,l){var c=l(3085),T=l(2558);c({global:!0,forced:parseInt!=T},{parseInt:T})},7884:function(y,I,l){"use strict";var c=l(3085),T=l(6235),P=l(9438),L=l(892),N=l(3442);c({target:"Promise",stat:!0},{allSettled:e(function(b){var r=this,m=P.f(r),p=m.resolve,i=m.reject,a=L(function(){var n=T(r.resolve),f=[],_=0,h=1;N(b,function(E){var w=_++,A=!1;f.push(void 0),h++,n.call(r,E).then(function(D){A||(A=!0,f[w]={status:"fulfilled",value:D},--h||p(f))},function(D){A||(A=!0,f[w]={status:"rejected",reason:D},--h||p(f))})}),--h||p(f)});return a.error&&i(a.value),m.promise},"allSettled")})},8885:function(y,I,l){"use strict";var c=l(3085),T=l(6235),P=l(150),L=l(9438),N=l(892),j=l(3442),b="No one promise resolved";c({target:"Promise",stat:!0},{any:e(function(m){var p=this,i=L.f(p),a=i.resolve,n=i.reject,f=N(function(){var _=T(p.resolve),h=[],E=0,w=1,A=!1;j(m,function(D){var z=E++,B=!1;h.push(void 0),w++,_.call(p,D).then(function(Y){B||A||(A=!0,a(Y))},function(Y){B||A||(B=!0,h[z]=Y,--w||n(new(P("AggregateError"))(h,b)))})}),--w||n(new(P("AggregateError"))(h,b))});return f.error&&n(f.value),i.promise},"any")})},1868:function(y,I,l){"use strict";var c=l(3085),T=l(5546),P=l(4471),L=l(6192),N=l(150),j=l(6447),b=l(4743),r=l(9126),m=l(9482),p=!!P&&L(function(){P.prototype.finally.call({then:function(){}},function(){})});if(c({target:"Promise",proto:!0,real:!0,forced:p},{finally:function(a){var n=b(this,N("Promise")),f=j(a);return this.then(f?function(_){return r(n,a()).then(function(){return _})}:a,f?function(_){return r(n,a()).then(function(){throw _})}:a)}}),!T&&j(P)){var i=N("Promise").prototype.finally;P.prototype.finally!==i&&m(P.prototype,"finally",i,{unsafe:!0})}},9021:function(y,I,l){"use strict";var c=l(3085),T=l(5546),P=l(8576),L=l(150),N=l(4471),j=l(9482),b=l(533),r=l(4469),m=l(1284),p=l(3656),i=l(6235),a=l(6447),n=l(5744),f=l(6961),_=l(9516),h=l(3442),E=l(9770),w=l(4743),A=l(7160).set,D=l(2950),z=l(9126),B=l(3681),Y=l(9438),H=l(892),V=l(3326),lt=l(9245),rt=l(8182),St=l(2957),q=l(224),_t=l(4218),G=rt("species"),Ut="Promise",xt=V.get,Ht=V.set,it=V.getterFor(Ut),ut=N&&N.prototype,tt=N,Z=ut,dt=P.TypeError,X=P.document,$=P.process,K=Y.f,Q=K,yt=!!(X&&X.createEvent&&P.dispatchEvent),vt=a(P.PromiseRejectionEvent),It="unhandledrejection",wt="rejectionhandled",Et=0,ct=1,et=2,nt=1,ht=2,gt=!1,bt,Lt,Gt,Wt,Ct=lt(Ut,function(){var Ot=_(tt),kt=Ot!==String(tt);if(!kt&&_t===66||T&&!Z.finally)return!0;if(_t>=51&&/native code/.test(Ot))return!1;var Bt=new tt(function(jt){jt(1)}),Yt=e(function(jt){jt(function(){},function(){})},"FakePromise"),$t=Bt.constructor={};return $t[G]=Yt,gt=Bt.then(function(){})instanceof Yt,gt?!kt&&St&&!vt:!0}),Xt=Ct||!E(function(Ot){tt.all(Ot).catch(function(){})}),Zt=e(function(Ot){var kt;return n(Ot)&&a(kt=Ot.then)?kt:!1},"isThenable"),ie=e(function(Ot,kt){if(!Ot.notified){Ot.notified=!0;var Bt=Ot.reactions;D(function(){for(var Yt=Ot.value,$t=Ot.state==ct,jt=0;Bt.length>jt;){var Oe=Bt[jt++],Pe=$t?Oe.ok:Oe.fail,Vt=Oe.resolve,Mt=Oe.reject,xe=Oe.domain,ue,ge,Ye;try{Pe?($t||(Ot.rejection===ht&&ae(Ot),Ot.rejection=nt),Pe===!0?ue=Yt:(xe&&xe.enter(),ue=Pe(Yt),xe&&(xe.exit(),Ye=!0)),ue===Oe.promise?Mt(dt("Promise-chain cycle")):(ge=Zt(ue))?ge.call(ue,Vt,Mt):Vt(ue)):Mt(Yt)}catch(We){xe&&!Ye&&xe.exit(),Mt(We)}}Ot.reactions=[],Ot.notified=!1,kt&&!Ot.rejection&&de(Ot)})}},"notify"),Ie=e(function(Ot,kt,Bt){var Yt,$t;yt?(Yt=X.createEvent("Event"),Yt.promise=kt,Yt.reason=Bt,Yt.initEvent(Ot,!1,!0),P.dispatchEvent(Yt)):Yt={promise:kt,reason:Bt},!vt&&($t=P["on"+Ot])?$t(Yt):Ot===It&&B("Unhandled promise rejection",Bt)},"dispatchEvent"),de=e(function(Ot){A.call(P,function(){var kt=Ot.facade,Bt=Ot.value,Yt=me(Ot),$t;if(Yt&&($t=H(function(){q?$.emit("unhandledRejection",Bt,kt):Ie(It,kt,Bt)}),Ot.rejection=q||me(Ot)?ht:nt,$t.error))throw $t.value})},"onUnhandled"),me=e(function(Ot){return Ot.rejection!==nt&&!Ot.parent},"isUnhandled"),ae=e(function(Ot){A.call(P,function(){var kt=Ot.facade;q?$.emit("rejectionHandled",kt):Ie(wt,kt,Ot.value)})},"onHandleUnhandled"),ye=e(function(Ot,kt,Bt){return function(Yt){Ot(kt,Yt,Bt)}},"bind"),Ae=e(function(Ot,kt,Bt){Ot.done||(Ot.done=!0,Bt&&(Ot=Bt),Ot.value=kt,Ot.state=et,ie(Ot,!0))},"internalReject"),Fe=e(function(Ot,kt,Bt){if(!Ot.done){Ot.done=!0,Bt&&(Ot=Bt);try{if(Ot.facade===kt)throw dt("Promise can't be resolved itself");var Yt=Zt(kt);Yt?D(function(){var $t={done:!1};try{Yt.call(kt,ye(Fe,$t,Ot),ye(Ae,$t,Ot))}catch(jt){Ae($t,jt,Ot)}}):(Ot.value=kt,Ot.state=ct,ie(Ot,!1))}catch($t){Ae({done:!1},$t,Ot)}}},"internalResolve");if(Ct&&(tt=e(function(kt){f(this,tt,Ut),i(kt),bt.call(this);var Bt=xt(this);try{kt(ye(Fe,Bt),ye(Ae,Bt))}catch(Yt){Ae(Bt,Yt)}},"Promise"),Z=tt.prototype,bt=e(function(kt){Ht(this,{type:Ut,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:Et,value:void 0})},"Promise"),bt.prototype=b(Z,{then:e(function(kt,Bt){var Yt=it(this),$t=K(w(this,tt));return $t.ok=a(kt)?kt:!0,$t.fail=a(Bt)&&Bt,$t.domain=q?$.domain:void 0,Yt.parent=!0,Yt.reactions.push($t),Yt.state!=Et&&ie(Yt,!1),$t.promise},"then"),catch:function(Ot){return this.then(void 0,Ot)}}),Lt=e(function(){var Ot=new bt,kt=xt(Ot);this.promise=Ot,this.resolve=ye(Fe,kt),this.reject=ye(Ae,kt)},"OwnPromiseCapability"),Y.f=K=e(function(Ot){return Ot===tt||Ot===Gt?new Lt(Ot):Q(Ot)},"newPromiseCapability"),!T&&a(N)&&ut!==Object.prototype)){Wt=ut.then,gt||(j(ut,"then",e(function(kt,Bt){var Yt=this;return new tt(function($t,jt){Wt.call(Yt,$t,jt)}).then(kt,Bt)},"then"),{unsafe:!0}),j(ut,"catch",Z.catch,{unsafe:!0}));try{delete ut.constructor}catch{}r&&r(ut,Z)}c({global:!0,wrap:!0,forced:Ct},{Promise:tt}),m(tt,Ut,!1,!0),p(Ut),Gt=L(Ut),c({target:Ut,stat:!0,forced:Ct},{reject:e(function(kt){var Bt=K(this);return Bt.reject.call(void 0,kt),Bt.promise},"reject")}),c({target:Ut,stat:!0,forced:T||Ct},{resolve:e(function(kt){return z(T&&this===Gt?tt:this,kt)},"resolve")}),c({target:Ut,stat:!0,forced:Xt},{all:e(function(kt){var Bt=this,Yt=K(Bt),$t=Yt.resolve,jt=Yt.reject,Oe=H(function(){var Pe=i(Bt.resolve),Vt=[],Mt=0,xe=1;h(kt,function(ue){var ge=Mt++,Ye=!1;Vt.push(void 0),xe++,Pe.call(Bt,ue).then(function(We){Ye||(Ye=!0,Vt[ge]=We,--xe||$t(Vt))},jt)}),--xe||$t(Vt)});return Oe.error&&jt(Oe.value),Yt.promise},"all"),race:e(function(kt){var Bt=this,Yt=K(Bt),$t=Yt.reject,jt=H(function(){var Oe=i(Bt.resolve);h(kt,function(Pe){Oe.call(Bt,Pe).then(Yt.resolve,$t)})});return jt.error&&$t(jt.value),Yt.promise},"race")})},5397:function(y,I,l){var c=l(3085),T=l(150),P=l(1404),L=l(1138),N=l(5744),j=l(2853),b=l(6782),r=l(6192),m=T("Reflect","construct"),p=r(function(){function n(){}return e(n,"F"),!(m(function(){},[],n)instanceof n)}),i=!r(function(){m(function(){})}),a=p||i;c({target:"Reflect",stat:!0,forced:a,sham:a},{construct:e(function(f,_){P(f),L(_);var h=arguments.length<3?f:P(arguments[2]);if(i&&!p)return m(f,_,h);if(f==h){switch(_.length){case 0:return new f;case 1:return new f(_[0]);case 2:return new f(_[0],_[1]);case 3:return new f(_[0],_[1],_[2]);case 4:return new f(_[0],_[1],_[2],_[3])}var E=[null];return E.push.apply(E,_),new(b.apply(f,E))}var w=h.prototype,A=j(N(w)?w:Object.prototype),D=Function.apply.call(f,A,_);return N(D)?D:A},"construct")})},1367:function(){},5454:function(y,I,l){"use strict";var c=l(863).charAt,T=l(4845),P=l(3326),L=l(7218),N="String Iterator",j=P.set,b=P.getterFor(N);L(String,"String",function(r){j(this,{type:N,string:T(r),index:0})},e(function(){var m=b(this),p=m.string,i=m.index,a;return i>=p.length?{value:void 0,done:!0}:(a=c(p,i),m.index+=a.length,{value:a,done:!1})},"next"))},957:function(y,I,l){"use strict";var c=l(3085),T=l(4277).trim,P=l(6815);c({target:"String",proto:!0,forced:P("trim")},{trim:e(function(){return T(this)},"trim")})},9781:function(y,I,l){var c=l(1488);c("asyncIterator")},492:function(){},6681:function(y,I,l){var c=l(1488);c("hasInstance")},9594:function(y,I,l){var c=l(1488);c("isConcatSpreadable")},3665:function(y,I,l){var c=l(1488);c("iterator")},6187:function(y,I,l){"use strict";var c=l(3085),T=l(8576),P=l(150),L=l(5546),N=l(69),j=l(3045),b=l(6192),r=l(4500),m=l(4770),p=l(6447),i=l(5744),a=l(3236),n=l(1138),f=l(1795),_=l(101),h=l(77),E=l(4845),w=l(774),A=l(2853),D=l(7653),z=l(2092),B=l(4052),Y=l(4750),H=l(5141),V=l(2760),lt=l(6007),rt=l(9482),St=l(8717),q=l(9766),_t=l(4535),G=l(2759),Ut=l(8182),xt=l(9207),Ht=l(1488),it=l(1284),ut=l(3326),tt=l(454).forEach,Z=q("hidden"),dt="Symbol",X="prototype",$=Ut("toPrimitive"),K=ut.set,Q=ut.getterFor(dt),yt=Object[X],vt=T.Symbol,It=P("JSON","stringify"),wt=H.f,Et=V.f,ct=B.f,et=lt.f,nt=St("symbols"),ht=St("op-symbols"),gt=St("string-to-symbol-registry"),bt=St("symbol-to-string-registry"),Lt=St("wks"),Gt=T.QObject,Wt=!Gt||!Gt[X]||!Gt[X].findChild,Ct=N&&b(function(){return A(Et({},"a",{get:function(){return Et(this,"a",{value:7}).a}})).a!=7})?function(Ot,kt,Bt){var Yt=wt(yt,kt);Yt&&delete yt[kt],Et(Ot,kt,Bt),Yt&&Ot!==yt&&Et(yt,kt,Yt)}:Et,Xt=e(function(Ot,kt){var Bt=nt[Ot]=A(vt[X]);return K(Bt,{type:dt,tag:Ot,description:kt}),N||(Bt.description=kt),Bt},"wrap"),Zt=e(function(kt,Bt,Yt){kt===yt&&Zt(ht,Bt,Yt),n(kt);var $t=h(Bt);return n(Yt),r(nt,$t)?(Yt.enumerable?(r(kt,Z)&&kt[Z][$t]&&(kt[Z][$t]=!1),Yt=A(Yt,{enumerable:w(0,!1)})):(r(kt,Z)||Et(kt,Z,w(1,{})),kt[Z][$t]=!0),Ct(kt,$t,Yt)):Et(kt,$t,Yt)},"defineProperty"),ie=e(function(kt,Bt){n(kt);var Yt=_(Bt),$t=D(Yt).concat(ye(Yt));return tt($t,function(jt){(!N||de.call(Yt,jt))&&Zt(kt,jt,Yt[jt])}),kt},"defineProperties"),Ie=e(function(kt,Bt){return Bt===void 0?A(kt):ie(A(kt),Bt)},"create"),de=e(function(kt){var Bt=h(kt),Yt=et.call(this,Bt);return this===yt&&r(nt,Bt)&&!r(ht,Bt)?!1:Yt||!r(this,Bt)||!r(nt,Bt)||r(this,Z)&&this[Z][Bt]?Yt:!0},"propertyIsEnumerable"),me=e(function(kt,Bt){var Yt=_(kt),$t=h(Bt);if(!(Yt===yt&&r(nt,$t)&&!r(ht,$t))){var jt=wt(Yt,$t);return jt&&r(nt,$t)&&!(r(Yt,Z)&&Yt[Z][$t])&&(jt.enumerable=!0),jt}},"getOwnPropertyDescriptor"),ae=e(function(kt){var Bt=ct(_(kt)),Yt=[];return tt(Bt,function($t){!r(nt,$t)&&!r(_t,$t)&&Yt.push($t)}),Yt},"getOwnPropertyNames"),ye=e(function(kt){var Bt=kt===yt,Yt=ct(Bt?ht:_(kt)),$t=[];return tt(Yt,function(jt){r(nt,jt)&&(!Bt||r(yt,jt))&&$t.push(nt[jt])}),$t},"getOwnPropertySymbols");if(j||(vt=e(function(){if(this instanceof vt)throw TypeError("Symbol is not a constructor");var kt=!arguments.length||arguments[0]===void 0?void 0:E(arguments[0]),Bt=G(kt),Yt=e(function($t){this===yt&&Yt.call(ht,$t),r(this,Z)&&r(this[Z],Bt)&&(this[Z][Bt]=!1),Ct(this,Bt,w(1,$t))},"setter");return N&&Wt&&Ct(yt,Bt,{configurable:!0,set:Yt}),Xt(Bt,kt)},"Symbol"),rt(vt[X],"toString",e(function(){return Q(this).tag},"toString")),rt(vt,"withoutSetter",function(Ot){return Xt(G(Ot),Ot)}),lt.f=de,V.f=Zt,H.f=me,z.f=B.f=ae,Y.f=ye,xt.f=function(Ot){return Xt(Ut(Ot),Ot)},N&&(Et(vt[X],"description",{configurable:!0,get:e(function(){return Q(this).description},"description")}),L||rt(yt,"propertyIsEnumerable",de,{unsafe:!0}))),c({global:!0,wrap:!0,forced:!j,sham:!j},{Symbol:vt}),tt(D(Lt),function(Ot){Ht(Ot)}),c({target:dt,stat:!0,forced:!j},{for:function(Ot){var kt=E(Ot);if(r(gt,kt))return gt[kt];var Bt=vt(kt);return gt[kt]=Bt,bt[Bt]=kt,Bt},keyFor:e(function(kt){if(!a(kt))throw TypeError(kt+" is not a symbol");if(r(bt,kt))return bt[kt]},"keyFor"),useSetter:function(){Wt=!0},useSimple:function(){Wt=!1}}),c({target:"Object",stat:!0,forced:!j,sham:!N},{create:Ie,defineProperty:Zt,defineProperties:ie,getOwnPropertyDescriptor:me}),c({target:"Object",stat:!0,forced:!j},{getOwnPropertyNames:ae,getOwnPropertySymbols:ye}),c({target:"Object",stat:!0,forced:b(function(){Y.f(1)})},{getOwnPropertySymbols:e(function(kt){return Y.f(f(kt))},"getOwnPropertySymbols")}),It){var Ae=!j||b(function(){var Ot=vt();return It([Ot])!="[null]"||It({a:Ot})!="{}"||It(Object(Ot))!="{}"});c({target:"JSON",stat:!0,forced:Ae},{stringify:e(function(kt,Bt,Yt){for(var $t=[kt],jt=1,Oe;arguments.length>jt;)$t.push(arguments[jt++]);if(Oe=Bt,!(!i(Bt)&&kt===void 0||a(kt)))return m(Bt)||(Bt=e(function(Pe,Vt){if(p(Oe)&&(Vt=Oe.call(this,Pe,Vt)),!a(Vt))return Vt},"replacer")),$t[1]=Bt,It.apply(null,$t)},"stringify")})}if(!vt[X][$]){var Fe=vt[X].valueOf;rt(vt[X],$,function(){return Fe.apply(this,arguments)})}it(vt,dt),_t[Z]=!0},1250:function(y,I,l){var c=l(1488);c("matchAll")},9017:function(y,I,l){var c=l(1488);c("match")},9786:function(y,I,l){var c=l(1488);c("replace")},503:function(y,I,l){var c=l(1488);c("search")},6565:function(y,I,l){var c=l(1488);c("species")},9322:function(y,I,l){var c=l(1488);c("split")},3610:function(y,I,l){var c=l(1488);c("toPrimitive")},6886:function(y,I,l){var c=l(1488);c("toStringTag")},3514:function(y,I,l){var c=l(1488);c("unscopables")},177:function(y,I,l){var c=l(1488);c("asyncDispose")},9031:function(y,I,l){var c=l(1488);c("dispose")},6658:function(y,I,l){var c=l(1488);c("matcher")},1875:function(y,I,l){var c=l(1488);c("metadata")},8658:function(y,I,l){var c=l(1488);c("observable")},4592:function(y,I,l){var c=l(1488);c("patternMatch")},6680:function(y,I,l){var c=l(1488);c("replaceAll")},162:function(y,I,l){l(8939);var c=l(7365),T=l(8576),P=l(4696),L=l(8711),N=l(7771),j=l(8182),b=j("toStringTag");for(var r in c){var m=T[r],p=m&&m.prototype;p&&P(p)!==b&&L(p,b,r),N[r]=N.Array}},2906:function(y,I,l){var c=l(3085),T=l(8576),P=l(6447),L=l(8989),N=[].slice,j=/MSIE .\./.test(L),b=e(function(r){return function(m,p){var i=arguments.length>2,a=i?N.call(arguments,2):void 0;return r(i?function(){(P(m)?m:Function(m)).apply(this,a)}:m,p)}},"wrap");c({global:!0,bind:!0,forced:j},{setTimeout:b(T.setTimeout),setInterval:b(T.setInterval)})},9336:function(y,I,l){"use strict";l(8939);var c=l(3085),T=l(150),P=l(4551),L=l(9482),N=l(533),j=l(1284),b=l(5148),r=l(3326),m=l(6961),p=l(6447),i=l(4500),a=l(8043),n=l(4696),f=l(1138),_=l(5744),h=l(4845),E=l(2853),w=l(774),A=l(1669),D=l(8703),z=l(8182),B=T("fetch"),Y=T("Request"),H=Y&&Y.prototype,V=T("Headers"),lt=z("iterator"),rt="URLSearchParams",St=rt+"Iterator",q=r.set,_t=r.getterFor(rt),G=r.getterFor(St),Ut=/\+/g,xt=Array(4),Ht=e(function(ct){return xt[ct-1]||(xt[ct-1]=RegExp("((?:%[\\da-f]{2}){"+ct+"})","gi"))},"percentSequence"),it=e(function(ct){try{return decodeURIComponent(ct)}catch{return ct}},"percentDecode"),ut=e(function(ct){var et=ct.replace(Ut," "),nt=4;try{return decodeURIComponent(et)}catch{for(;nt;)et=et.replace(Ht(nt--),it);return et}},"deserialize"),tt=/[!'()~]|%20/g,Z={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},dt=e(function(ct){return Z[ct]},"replacer"),X=e(function(ct){return encodeURIComponent(ct).replace(tt,dt)},"serialize"),$=e(function(ct,et){if(et)for(var nt=et.split("&"),ht=0,gt,bt;ht<nt.length;)gt=nt[ht++],gt.length&&(bt=gt.split("="),ct.push({key:ut(bt.shift()),value:ut(bt.join("="))}))},"parseSearchParams"),K=e(function(ct){this.entries.length=0,$(this.entries,ct)},"updateSearchParams"),Q=e(function(ct,et){if(ct<et)throw TypeError("Not enough arguments")},"validateArgumentsLength"),yt=b(e(function(et,nt){q(this,{type:St,iterator:A(_t(et).entries),kind:nt})},"Iterator"),"Iterator",e(function(){var et=G(this),nt=et.kind,ht=et.iterator.next(),gt=ht.value;return ht.done||(ht.value=nt==="keys"?gt.key:nt==="values"?gt.value:[gt.key,gt.value]),ht},"next")),vt=e(function(){m(this,vt,rt);var et=arguments.length>0?arguments[0]:void 0,nt=this,ht=[],gt,bt,Lt,Gt,Wt,Ct,Xt,Zt,ie;if(q(nt,{type:rt,entries:ht,updateURL:function(){},updateSearchParams:K}),et!==void 0)if(_(et))if(gt=D(et),gt)for(bt=A(et,gt),Lt=bt.next;!(Gt=Lt.call(bt)).done;){if(Wt=A(f(Gt.value)),Ct=Wt.next,(Xt=Ct.call(Wt)).done||(Zt=Ct.call(Wt)).done||!Ct.call(Wt).done)throw TypeError("Expected sequence with length 2");ht.push({key:h(Xt.value),value:h(Zt.value)})}else for(ie in et)i(et,ie)&&ht.push({key:ie,value:h(et[ie])});else $(ht,typeof et=="string"?et.charAt(0)==="?"?et.slice(1):et:h(et))},"URLSearchParams"),It=vt.prototype;if(N(It,{append:e(function(et,nt){Q(arguments.length,2);var ht=_t(this);ht.entries.push({key:h(et),value:h(nt)}),ht.updateURL()},"append"),delete:function(ct){Q(arguments.length,1);for(var et=_t(this),nt=et.entries,ht=h(ct),gt=0;gt<nt.length;)nt[gt].key===ht?nt.splice(gt,1):gt++;et.updateURL()},get:e(function(et){Q(arguments.length,1);for(var nt=_t(this).entries,ht=h(et),gt=0;gt<nt.length;gt++)if(nt[gt].key===ht)return nt[gt].value;return null},"get"),getAll:e(function(et){Q(arguments.length,1);for(var nt=_t(this).entries,ht=h(et),gt=[],bt=0;bt<nt.length;bt++)nt[bt].key===ht&>.push(nt[bt].value);return gt},"getAll"),has:e(function(et){Q(arguments.length,1);for(var nt=_t(this).entries,ht=h(et),gt=0;gt<nt.length;)if(nt[gt++].key===ht)return!0;return!1},"has"),set:e(function(et,nt){Q(arguments.length,1);for(var ht=_t(this),gt=ht.entries,bt=!1,Lt=h(et),Gt=h(nt),Wt=0,Ct;Wt<gt.length;Wt++)Ct=gt[Wt],Ct.key===Lt&&(bt?gt.splice(Wt--,1):(bt=!0,Ct.value=Gt));bt||gt.push({key:Lt,value:Gt}),ht.updateURL()},"set"),sort:e(function(){var et=_t(this),nt=et.entries,ht=nt.slice(),gt,bt,Lt;for(nt.length=0,Lt=0;Lt<ht.length;Lt++){for(gt=ht[Lt],bt=0;bt<Lt;bt++)if(nt[bt].key>gt.key){nt.splice(bt,0,gt);break}bt===Lt&&nt.push(gt)}et.updateURL()},"sort"),forEach:e(function(et){for(var nt=_t(this).entries,ht=a(et,arguments.length>1?arguments[1]:void 0,3),gt=0,bt;gt<nt.length;)bt=nt[gt++],ht(bt.value,bt.key,this)},"forEach"),keys:e(function(){return new yt(this,"keys")},"keys"),values:e(function(){return new yt(this,"values")},"values"),entries:e(function(){return new yt(this,"entries")},"entries")},{enumerable:!0}),L(It,lt,It.entries,{name:"entries"}),L(It,"toString",e(function(){for(var et=_t(this).entries,nt=[],ht=0,gt;ht<et.length;)gt=et[ht++],nt.push(X(gt.key)+"="+X(gt.value));return nt.join("&")},"toString"),{enumerable:!0}),j(vt,rt),c({global:!0,forced:!P},{URLSearchParams:vt}),!P&&p(V)){var wt=e(function(ct){if(_(ct)){var et=ct.body,nt;if(n(et)===rt)return nt=ct.headers?new V(ct.headers):new V,nt.has("content-type")||nt.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),E(ct,{body:w(0,String(et)),headers:w(0,nt)})}return ct},"wrapRequestOptions");if(p(B)&&c({global:!0,enumerable:!0,forced:!0},{fetch:e(function(et){return B(et,arguments.length>1?wt(arguments[1]):{})},"fetch")}),p(Y)){var Et=e(function(et){return m(this,Et,"Request"),new Y(et,arguments.length>1?wt(arguments[1]):{})},"Request");H.constructor=Et,Et.prototype=H,c({global:!0,forced:!0},{Request:Et})}}y.exports={URLSearchParams:vt,getState:_t}},4948:function(y,I,l){"use strict";l(5454);var c=l(3085),T=l(69),P=l(4551),L=l(8576),N=l(1187),j=l(9482),b=l(6961),r=l(4500),m=l(2503),p=l(841),i=l(863).codeAt,a=l(7977),n=l(4845),f=l(1284),_=l(9336),h=l(3326),E=L.URL,w=_.URLSearchParams,A=_.getState,D=h.set,z=h.getterFor("URL"),B=Math.floor,Y=Math.pow,H="Invalid authority",V="Invalid scheme",lt="Invalid host",rt="Invalid port",St=/[A-Za-z]/,q=/[\d+-.A-Za-z]/,_t=/\d/,G=/^0x/i,Ut=/^[0-7]+$/,xt=/^\d+$/,Ht=/^[\dA-Fa-f]+$/,it=/[\0\t\n\r #%/:<>?@[\\\]^|]/,ut=/[\0\t\n\r #/:<>?@[\\\]^|]/,tt=/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,Z=/[\t\n\r]/g,dt,X=e(function(J,Dt){var Tt,Rt,zt;if(Dt.charAt(0)=="["){if(Dt.charAt(Dt.length-1)!="]"||(Tt=K(Dt.slice(1,-1)),!Tt))return lt;J.host=Tt}else if(nt(J)){if(Dt=a(Dt),it.test(Dt)||(Tt=$(Dt),Tt===null))return lt;J.host=Tt}else{if(ut.test(Dt))return lt;for(Tt="",Rt=p(Dt),zt=0;zt<Rt.length;zt++)Tt+=ct(Rt[zt],vt);J.host=Tt}},"parseHost"),$=e(function(J){var Dt=J.split("."),Tt,Rt,zt,se,Jt,re,Ee;if(Dt.length&&Dt[Dt.length-1]==""&&Dt.pop(),Tt=Dt.length,Tt>4)return J;for(Rt=[],zt=0;zt<Tt;zt++){if(se=Dt[zt],se=="")return J;if(Jt=10,se.length>1&&se.charAt(0)=="0"&&(Jt=G.test(se)?16:8,se=se.slice(Jt==8?1:2)),se==="")re=0;else{if(!(Jt==10?xt:Jt==8?Ut:Ht).test(se))return J;re=parseInt(se,Jt)}Rt.push(re)}for(zt=0;zt<Tt;zt++)if(re=Rt[zt],zt==Tt-1){if(re>=Y(256,5-Tt))return null}else if(re>255)return null;for(Ee=Rt.pop(),zt=0;zt<Rt.length;zt++)Ee+=Rt[zt]*Y(256,3-zt);return Ee},"parseIPv4"),K=e(function(J){var Dt=[0,0,0,0,0,0,0,0],Tt=0,Rt=null,zt=0,se,Jt,re,Ee,Re,Ge,Nt,je=e(function(){return J.charAt(zt)},"chr");if(je()==":"){if(J.charAt(1)!=":")return;zt+=2,Tt++,Rt=Tt}for(;je();){if(Tt==8)return;if(je()==":"){if(Rt!==null)return;zt++,Tt++,Rt=Tt;continue}for(se=Jt=0;Jt<4&&Ht.test(je());)se=se*16+parseInt(je(),16),zt++,Jt++;if(je()=="."){if(Jt==0||(zt-=Jt,Tt>6))return;for(re=0;je();){if(Ee=null,re>0)if(je()=="."&&re<4)zt++;else return;if(!_t.test(je()))return;for(;_t.test(je());){if(Re=parseInt(je(),10),Ee===null)Ee=Re;else{if(Ee==0)return;Ee=Ee*10+Re}if(Ee>255)return;zt++}Dt[Tt]=Dt[Tt]*256+Ee,re++,(re==2||re==4)&&Tt++}if(re!=4)return;break}else if(je()==":"){if(zt++,!je())return}else if(je())return;Dt[Tt++]=se}if(Rt!==null)for(Ge=Tt-Rt,Tt=7;Tt!=0&&Ge>0;)Nt=Dt[Tt],Dt[Tt--]=Dt[Rt+Ge-1],Dt[Rt+--Ge]=Nt;else if(Tt!=8)return;return Dt},"parseIPv6"),Q=e(function(J){for(var Dt=null,Tt=1,Rt=null,zt=0,se=0;se<8;se++)J[se]!==0?(zt>Tt&&(Dt=Rt,Tt=zt),Rt=null,zt=0):(Rt===null&&(Rt=se),++zt);return zt>Tt&&(Dt=Rt,Tt=zt),Dt},"findLongestZeroSequence"),yt=e(function(J){var Dt,Tt,Rt,zt;if(typeof J=="number"){for(Dt=[],Tt=0;Tt<4;Tt++)Dt.unshift(J%256),J=B(J/256);return Dt.join(".")}else if(typeof J=="object"){for(Dt="",Rt=Q(J),Tt=0;Tt<8;Tt++)zt&&J[Tt]===0||(zt&&(zt=!1),Rt===Tt?(Dt+=Tt?":":"::",zt=!0):(Dt+=J[Tt].toString(16),Tt<7&&(Dt+=":")));return"["+Dt+"]"}return J},"serializeHost"),vt={},It=m({},vt,{" ":1,'"':1,"<":1,">":1,"`":1}),wt=m({},It,{"#":1,"?":1,"{":1,"}":1}),Et=m({},wt,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),ct=e(function(J,Dt){var Tt=i(J,0);return Tt>32&&Tt<127&&!r(Dt,J)?J:encodeURIComponent(J)},"percentEncode"),et={ftp:21,file:null,http:80,https:443,ws:80,wss:443},nt=e(function(J){return r(et,J.scheme)},"isSpecial"),ht=e(function(J){return J.username!=""||J.password!=""},"includesCredentials"),gt=e(function(J){return!J.host||J.cannotBeABaseURL||J.scheme=="file"},"cannotHaveUsernamePasswordPort"),bt=e(function(J,Dt){var Tt;return J.length==2&&St.test(J.charAt(0))&&((Tt=J.charAt(1))==":"||!Dt&&Tt=="|")},"isWindowsDriveLetter"),Lt=e(function(J){var Dt;return J.length>1&&bt(J.slice(0,2))&&(J.length==2||(Dt=J.charAt(2))==="/"||Dt==="\\"||Dt==="?"||Dt==="#")},"startsWithWindowsDriveLetter"),Gt=e(function(J){var Dt=J.path,Tt=Dt.length;Tt&&(J.scheme!="file"||Tt!=1||!bt(Dt[0],!0))&&Dt.pop()},"shortenURLsPath"),Wt=e(function(J){return J==="."||J.toLowerCase()==="%2e"},"isSingleDot"),Ct=e(function(J){return J=J.toLowerCase(),J===".."||J==="%2e."||J===".%2e"||J==="%2e%2e"},"isDoubleDot"),Xt={},Zt={},ie={},Ie={},de={},me={},ae={},ye={},Ae={},Fe={},Ot={},kt={},Bt={},Yt={},$t={},jt={},Oe={},Pe={},Vt={},Mt={},xe={},ue=e(function(J,Dt,Tt,Rt){var zt=Tt||Xt,se=0,Jt="",re=!1,Ee=!1,Re=!1,Ge,Nt,je,Ke;for(Tt||(J.scheme="",J.username="",J.password="",J.host=null,J.port=null,J.path=[],J.query=null,J.fragment=null,J.cannotBeABaseURL=!1,Dt=Dt.replace(tt,"")),Dt=Dt.replace(Z,""),Ge=p(Dt);se<=Ge.length;){switch(Nt=Ge[se],zt){case Xt:if(Nt&&St.test(Nt))Jt+=Nt.toLowerCase(),zt=Zt;else{if(Tt)return V;zt=ie;continue}break;case Zt:if(Nt&&(q.test(Nt)||Nt=="+"||Nt=="-"||Nt=="."))Jt+=Nt.toLowerCase();else if(Nt==":"){if(Tt&&(nt(J)!=r(et,Jt)||Jt=="file"&&(ht(J)||J.port!==null)||J.scheme=="file"&&!J.host))return;if(J.scheme=Jt,Tt){nt(J)&&et[J.scheme]==J.port&&(J.port=null);return}Jt="",J.scheme=="file"?zt=Yt:nt(J)&&Rt&&Rt.scheme==J.scheme?zt=Ie:nt(J)?zt=ye:Ge[se+1]=="/"?(zt=de,se++):(J.cannotBeABaseURL=!0,J.path.push(""),zt=Vt)}else{if(Tt)return V;Jt="",zt=ie,se=0;continue}break;case ie:if(!Rt||Rt.cannotBeABaseURL&&Nt!="#")return V;if(Rt.cannotBeABaseURL&&Nt=="#"){J.scheme=Rt.scheme,J.path=Rt.path.slice(),J.query=Rt.query,J.fragment="",J.cannotBeABaseURL=!0,zt=xe;break}zt=Rt.scheme=="file"?Yt:me;continue;case Ie:if(Nt=="/"&&Ge[se+1]=="/")zt=Ae,se++;else{zt=me;continue}break;case de:if(Nt=="/"){zt=Fe;break}else{zt=Pe;continue}case me:if(J.scheme=Rt.scheme,Nt==dt)J.username=Rt.username,J.password=Rt.password,J.host=Rt.host,J.port=Rt.port,J.path=Rt.path.slice(),J.query=Rt.query;else if(Nt=="/"||Nt=="\\"&&nt(J))zt=ae;else if(Nt=="?")J.username=Rt.username,J.password=Rt.password,J.host=Rt.host,J.port=Rt.port,J.path=Rt.path.slice(),J.query="",zt=Mt;else if(Nt=="#")J.username=Rt.username,J.password=Rt.password,J.host=Rt.host,J.port=Rt.port,J.path=Rt.path.slice(),J.query=Rt.query,J.fragment="",zt=xe;else{J.username=Rt.username,J.password=Rt.password,J.host=Rt.host,J.port=Rt.port,J.path=Rt.path.slice(),J.path.pop(),zt=Pe;continue}break;case ae:if(nt(J)&&(Nt=="/"||Nt=="\\"))zt=Ae;else if(Nt=="/")zt=Fe;else{J.username=Rt.username,J.password=Rt.password,J.host=Rt.host,J.port=Rt.port,zt=Pe;continue}break;case ye:if(zt=Ae,Nt!="/"||Jt.charAt(se+1)!="/")continue;se++;break;case Ae:if(Nt!="/"&&Nt!="\\"){zt=Fe;continue}break;case Fe:if(Nt=="@"){re&&(Jt="%40"+Jt),re=!0,je=p(Jt);for(var Hr=0;Hr<je.length;Hr++){var Xn=je[Hr];if(Xn==":"&&!Re){Re=!0;continue}var Vn=ct(Xn,Et);Re?J.password+=Vn:J.username+=Vn}Jt=""}else if(Nt==dt||Nt=="/"||Nt=="?"||Nt=="#"||Nt=="\\"&&nt(J)){if(re&&Jt=="")return H;se-=p(Jt).length+1,Jt="",zt=Ot}else Jt+=Nt;break;case Ot:case kt:if(Tt&&J.scheme=="file"){zt=jt;continue}else if(Nt==":"&&!Ee){if(Jt=="")return lt;if(Ke=X(J,Jt),Ke)return Ke;if(Jt="",zt=Bt,Tt==kt)return}else if(Nt==dt||Nt=="/"||Nt=="?"||Nt=="#"||Nt=="\\"&&nt(J)){if(nt(J)&&Jt=="")return lt;if(Tt&&Jt==""&&(ht(J)||J.port!==null))return;if(Ke=X(J,Jt),Ke)return Ke;if(Jt="",zt=Oe,Tt)return;continue}else Nt=="["?Ee=!0:Nt=="]"&&(Ee=!1),Jt+=Nt;break;case Bt:if(_t.test(Nt))Jt+=Nt;else if(Nt==dt||Nt=="/"||Nt=="?"||Nt=="#"||Nt=="\\"&&nt(J)||Tt){if(Jt!=""){var Wr=parseInt(Jt,10);if(Wr>65535)return rt;J.port=nt(J)&&Wr===et[J.scheme]?null:Wr,Jt=""}if(Tt)return;zt=Oe;continue}else return rt;break;case Yt:if(J.scheme="file",Nt=="/"||Nt=="\\")zt=$t;else if(Rt&&Rt.scheme=="file")if(Nt==dt)J.host=Rt.host,J.path=Rt.path.slice(),J.query=Rt.query;else if(Nt=="?")J.host=Rt.host,J.path=Rt.path.slice(),J.query="",zt=Mt;else if(Nt=="#")J.host=Rt.host,J.path=Rt.path.slice(),J.query=Rt.query,J.fragment="",zt=xe;else{Lt(Ge.slice(se).join(""))||(J.host=Rt.host,J.path=Rt.path.slice(),Gt(J)),zt=Pe;continue}else{zt=Pe;continue}break;case $t:if(Nt=="/"||Nt=="\\"){zt=jt;break}Rt&&Rt.scheme=="file"&&!Lt(Ge.slice(se).join(""))&&(bt(Rt.path[0],!0)?J.path.push(Rt.path[0]):J.host=Rt.host),zt=Pe;continue;case jt:if(Nt==dt||Nt=="/"||Nt=="\\"||Nt=="?"||Nt=="#"){if(!Tt&&bt(Jt))zt=Pe;else if(Jt==""){if(J.host="",Tt)return;zt=Oe}else{if(Ke=X(J,Jt),Ke)return Ke;if(J.host=="localhost"&&(J.host=""),Tt)return;Jt="",zt=Oe}continue}else Jt+=Nt;break;case Oe:if(nt(J)){if(zt=Pe,Nt!="/"&&Nt!="\\")continue}else if(!Tt&&Nt=="?")J.query="",zt=Mt;else if(!Tt&&Nt=="#")J.fragment="",zt=xe;else if(Nt!=dt&&(zt=Pe,Nt!="/"))continue;break;case Pe:if(Nt==dt||Nt=="/"||Nt=="\\"&&nt(J)||!Tt&&(Nt=="?"||Nt=="#")){if(Ct(Jt)?(Gt(J),Nt!="/"&&!(Nt=="\\"&&nt(J))&&J.path.push("")):Wt(Jt)?Nt!="/"&&!(Nt=="\\"&&nt(J))&&J.path.push(""):(J.scheme=="file"&&!J.path.length&&bt(Jt)&&(J.host&&(J.host=""),Jt=Jt.charAt(0)+":"),J.path.push(Jt)),Jt="",J.scheme=="file"&&(Nt==dt||Nt=="?"||Nt=="#"))for(;J.path.length>1&&J.path[0]==="";)J.path.shift();Nt=="?"?(J.query="",zt=Mt):Nt=="#"&&(J.fragment="",zt=xe)}else Jt+=ct(Nt,wt);break;case Vt:Nt=="?"?(J.query="",zt=Mt):Nt=="#"?(J.fragment="",zt=xe):Nt!=dt&&(J.path[0]+=ct(Nt,vt));break;case Mt:!Tt&&Nt=="#"?(J.fragment="",zt=xe):Nt!=dt&&(Nt=="'"&&nt(J)?J.query+="%27":Nt=="#"?J.query+="%23":J.query+=ct(Nt,vt));break;case xe:Nt!=dt&&(J.fragment+=ct(Nt,It));break}se++}},"parseURL"),ge=e(function(Dt){var Tt=b(this,ge,"URL"),Rt=arguments.length>1?arguments[1]:void 0,zt=n(Dt),se=D(Tt,{type:"URL"}),Jt,re;if(Rt!==void 0){if(Rt instanceof ge)Jt=z(Rt);else if(re=ue(Jt={},n(Rt)),re)throw TypeError(re)}if(re=ue(se,zt,null,Jt),re)throw TypeError(re);var Ee=se.searchParams=new w,Re=A(Ee);Re.updateSearchParams(se.query),Re.updateURL=function(){se.query=String(Ee)||null},T||(Tt.href=We.call(Tt),Tt.origin=we.call(Tt),Tt.protocol=ui.call(Tt),Tt.username=be.call(Tt),Tt.password=Un.call(Tt),Tt.host=Hn.call(Tt),Tt.hostname=Wn.call(Tt),Tt.port=Br.call(Tt),Tt.pathname=Yn.call(Tt),Tt.search=vi.call(Tt),Tt.searchParams=Zi.call(Tt),Tt.hash=wi.call(Tt))},"URL"),Ye=ge.prototype,We=e(function(){var J=z(this),Dt=J.scheme,Tt=J.username,Rt=J.password,zt=J.host,se=J.port,Jt=J.path,re=J.query,Ee=J.fragment,Re=Dt+":";return zt!==null?(Re+="//",ht(J)&&(Re+=Tt+(Rt?":"+Rt:"")+"@"),Re+=yt(zt),se!==null&&(Re+=":"+se)):Dt=="file"&&(Re+="//"),Re+=J.cannotBeABaseURL?Jt[0]:Jt.length?"/"+Jt.join("/"):"",re!==null&&(Re+="?"+re),Ee!==null&&(Re+="#"+Ee),Re},"serializeURL"),we=e(function(){var J=z(this),Dt=J.scheme,Tt=J.port;if(Dt=="blob")try{return new ge(Dt.path[0]).origin}catch{return"null"}return Dt=="file"||!nt(J)?"null":Dt+"://"+yt(J.host)+(Tt!==null?":"+Tt:"")},"getOrigin"),ui=e(function(){return z(this).scheme+":"},"getProtocol"),be=e(function(){return z(this).username},"getUsername"),Un=e(function(){return z(this).password},"getPassword"),Hn=e(function(){var J=z(this),Dt=J.host,Tt=J.port;return Dt===null?"":Tt===null?yt(Dt):yt(Dt)+":"+Tt},"getHost"),Wn=e(function(){var J=z(this).host;return J===null?"":yt(J)},"getHostname"),Br=e(function(){var J=z(this).port;return J===null?"":String(J)},"getPort"),Yn=e(function(){var J=z(this),Dt=J.path;return J.cannotBeABaseURL?Dt[0]:Dt.length?"/"+Dt.join("/"):""},"getPathname"),vi=e(function(){var J=z(this).query;return J?"?"+J:""},"getSearch"),Zi=e(function(){return z(this).searchParams},"getSearchParams"),wi=e(function(){var J=z(this).fragment;return J?"#"+J:""},"getHash"),Je=e(function(J,Dt){return{get:J,set:Dt,configurable:!0,enumerable:!0}},"accessorDescriptor");if(T&&N(Ye,{href:Je(We,function(J){var Dt=z(this),Tt=n(J),Rt=ue(Dt,Tt);if(Rt)throw TypeError(Rt);A(Dt.searchParams).updateSearchParams(Dt.query)}),origin:Je(we),protocol:Je(ui,function(J){var Dt=z(this);ue(Dt,n(J)+":",Xt)}),username:Je(be,function(J){var Dt=z(this),Tt=p(n(J));if(!gt(Dt)){Dt.username="";for(var Rt=0;Rt<Tt.length;Rt++)Dt.username+=ct(Tt[Rt],Et)}}),password:Je(Un,function(J){var Dt=z(this),Tt=p(n(J));if(!gt(Dt)){Dt.password="";for(var Rt=0;Rt<Tt.length;Rt++)Dt.password+=ct(Tt[Rt],Et)}}),host:Je(Hn,function(J){var Dt=z(this);Dt.cannotBeABaseURL||ue(Dt,n(J),Ot)}),hostname:Je(Wn,function(J){var Dt=z(this);Dt.cannotBeABaseURL||ue(Dt,n(J),kt)}),port:Je(Br,function(J){var Dt=z(this);gt(Dt)||(J=n(J),J==""?Dt.port=null:ue(Dt,J,Bt))}),pathname:Je(Yn,function(J){var Dt=z(this);Dt.cannotBeABaseURL||(Dt.path=[],ue(Dt,n(J),Oe))}),search:Je(vi,function(J){var Dt=z(this);J=n(J),J==""?Dt.query=null:(J.charAt(0)=="?"&&(J=J.slice(1)),Dt.query="",ue(Dt,J,Mt)),A(Dt.searchParams).updateSearchParams(Dt.query)}),searchParams:Je(Zi),hash:Je(wi,function(J){var Dt=z(this);if(J=n(J),J==""){Dt.fragment=null;return}J.charAt(0)=="#"&&(J=J.slice(1)),Dt.fragment="",ue(Dt,J,xe)})}),j(Ye,"toJSON",e(function(){return We.call(this)},"toJSON"),{enumerable:!0}),j(Ye,"toString",e(function(){return We.call(this)},"toString"),{enumerable:!0}),E){var Ur=E.createObjectURL,Gn=E.revokeObjectURL;Ur&&j(ge,"createObjectURL",e(function(Dt){return Ur.apply(E,arguments)},"createObjectURL")),Gn&&j(ge,"revokeObjectURL",e(function(Dt){return Gn.apply(E,arguments)},"revokeObjectURL"))}f(ge,"URL"),c({global:!0,forced:!P,sham:!T},{URL:ge})},9801:function(){},3822:function(y,I,l){var c=l(2221);y.exports=c},1434:function(y,I,l){var c=l(5078);y.exports=c},6899:function(y,I,l){var c=l(98);y.exports=c},7710:function(y,I,l){var c=l(5739);l(162),y.exports=c},4486:function(y,I,l){var c=l(278);y.exports=c},4877:function(y,I,l){var c=l(1484);y.exports=c},7178:function(y,I,l){var c=l(7731);y.exports=c},5603:function(y,I,l){var c=l(3669);y.exports=c},1206:function(y,I,l){l(162);var c=l(6899),T=l(4696),P=Array.prototype,L={DOMTokenList:!0,NodeList:!0};y.exports=function(N){var j=N.forEach;return N===P||N instanceof Array&&j===P.forEach||L.hasOwnProperty(T(N))?c:j}},6174:function(y,I,l){var c=l(2604);y.exports=c},57:function(y,I,l){var c=l(263);y.exports=c},4741:function(y,I,l){var c=l(7663);y.exports=c},8368:function(y,I,l){var c=l(5063);y.exports=c},3739:function(y,I,l){var c=l(6813);y.exports=c},172:function(y,I,l){var c=l(6285);y.exports=c},4963:function(y,I,l){var c=l(3213);y.exports=c},7820:function(y,I,l){var c=l(3512);y.exports=c},8980:function(y,I,l){var c=l(8168);y.exports=c},5636:function(y,I,l){var c=l(8651);y.exports=c},6672:function(y,I,l){var c=l(3083);y.exports=c},5059:function(y,I,l){var c=l(2987);y.exports=c},3969:function(y,I,l){var c=l(2239);y.exports=c},6618:function(y,I,l){var c=l(3154);l(162),y.exports=c},5279:function(y,I,l){var c=l(6577);y.exports=c},9562:function(y,I,l){l(2906);var c=l(7545);y.exports=c.setTimeout},2285:function(y,I,l){var c=l(5008);l(162),y.exports=c},8535:function(y,I,l){var c=l(994);l(162),y.exports=c},652:function(y,I,l){var c=l(5668);y.exports=c},5668:function(y,I,l){l(4948),l(9801),l(9336);var c=l(7545);y.exports=c.URL},2534:function(y){"use strict";y.exports="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4KPHN2ZyBkaXNwbGF5PSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj4KPGRlZnMgaWQ9InR1aS1pbWFnZS1lZGl0b3Itc3ZnLWRlZmF1bHQtaWNvbnMiPgo8c3ltYm9sIGlkPSJpYy1hcHBseSIgdmlld0JveD0iMCAwIDI0IDI0Ij4KICAgIDxwYXRoIGQ9Ik0wIDBoMjR2MjRIMHoiIHN0cm9rZT0ibm9uZSIgZmlsbD0ibm9uZSIvPgogICAgPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSJpbmhlcml0IiBkPSJNNCAxMi4wMTFsNSA1TDIwLjAxMSA2Ii8+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy1jYW5jZWwiIHZpZXdCb3g9IjAgMCAyNCAyNCI+CiAgICA8cGF0aCBkPSJNMCAwaDI0djI0SDB6IiBmaWxsPSJub25lIiBzdHJva2U9Im5vbmUiLz4KICAgIDxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iaW5oZXJpdCIgZD0iTTYgNmwxMiAxMk0xOCA2TDYgMTgiLz4KPC9zeW1ib2w+CjxzeW1ib2wgaWQ9ImljLWNyb3AiIHZpZXdCb3g9IjAgMCAyNCAyNCI+CiAgICA8cGF0aCBkPSJNMCAwaDI0djI0SDB6IiBzdHJva2U9Im5vbmUiIGZpbGw9Im5vbmUiIC8+CiAgICA8cGF0aCBzdHJva2U9Im5vbmUiIGZpbGw9ImluaGVyaXQiIGQ9Ik00IDBoMXYyMGExIDEgMCAwIDEtMS0xVjB6TTIwIDE3aC0xVjVoMXYxMnptMCAydjVoLTF2LTVoMXoiLz4KICAgIDxwYXRoIHN0cm9rZT0ibm9uZSIgZmlsbD0iaW5oZXJpdCIgZD0iTTUgMTloMTl2MUg1ek00Ljc2MiA0djFIMFY0aDQuNzYyek03IDRoMTJhMSAxIDAgMCAxIDEgMUg3VjR6Ii8+Cjwvc3ltYm9sPgo8IS0tIFRoaXMgaWNvbiBtYWRlIGJ5IFBpeGVsIHBlcmZlY3QgZnJvbSB3d3cuZmxhdGljb24uY29tIC0tPgo8c3ltYm9sIGlkPSJpYy1yZXNpemUiIHZpZXdCb3g9IjAgMCAyNCAyNCI+CiAgPHBhdGggZD0iTTAgMGgyNHYyNEgweiIgc3Ryb2tlPSJub25lIiBmaWxsPSJub25lIi8+CiAgPHBhdGggc3Ryb2tlPSJub25lIiBmaWxsPSJpbmhlcml0IiBkPSJNIDE4Ljk4ODI4MSAzLjAxMTcxOSBDIDE4LjgwMDc4MSAyLjgyNDIxOSAxOC41IDIuODI0MjE5IDE4LjMxMjUgMy4wMTE3MTkgTCAxMS42MjEwOTQgOS43MDcwMzEgQyAxMS40Mjk2ODggOS44OTQ1MzEgMTEuNDI5Njg4IDEwLjE5NTMxMiAxMS42MjEwOTQgMTAuMzc4OTA2IEMgMTEuNzEwOTM4IDEwLjQ3MjY1NiAxMS44MzU5MzggMTAuNTE5NTMxIDExLjk1NzAzMSAxMC41MTk1MzEgQyAxMi4wNzgxMjUgMTAuNTE5NTMxIDEyLjIwMzEyNSAxMC40NzI2NTYgMTIuMjkyOTY5IDEwLjM3ODkwNiBMIDE4Ljk4ODI4MSAzLjY4NzUgQyAxOS4xNzU3ODEgMy41IDE5LjE3NTc4MSAzLjE5OTIxOSAxOC45ODgyODEgMy4wMTE3MTkgWiBNIDE4Ljk4ODI4MSAzLjAxMTcxOSAiLz4KICA8cGF0aCBzdHJva2U9Im5vbmUiIGZpbGw9ImluaGVyaXQiIGQ9Ik0gMTguNjUyMzQ0IDIuODY3MTg4IEMgMTguMzg2NzE5IDIuODY3MTg4IDE4LjE3MTg3NSAzLjA4MjAzMSAxOC4xNzE4NzUgMy4zNDc2NTYgTCAxOC4xNzE4NzUgOS4wODU5MzggQyAxOC4xNzE4NzUgOS4zNDc2NTYgMTguMzg2NzE5IDkuNTYyNSAxOC42NTIzNDQgOS41NjI1IEMgMTguOTE3OTY5IDkuNTYyNSAxOS4xMzI4MTIgOS4zNDc2NTYgMTkuMTMyODEyIDkuMDg1OTM4IEwgMTkuMTMyODEyIDMuMzQ3NjU2IEMgMTkuMTMyODEyIDMuMDgyMDMxIDE4LjkxNzk2OSAyLjg2NzE4OCAxOC42NTIzNDQgMi44NjcxODggWiBNIDE4LjY1MjM0NCAyLjg2NzE4OCAiLz4KICA8cGF0aCBzdHJva2U9Im5vbmUiIGZpbGw9ImluaGVyaXQiIGQ9Ik0gMTguNjUyMzQ0IDIuODY3MTg4IEwgMTIuOTE0MDYyIDIuODY3MTg4IEMgMTIuNjUyMzQ0IDIuODY3MTg4IDEyLjQzNzUgMy4wODIwMzEgMTIuNDM3NSAzLjM0NzY1NiBDIDEyLjQzNzUgMy42MTMyODEgMTIuNjUyMzQ0IDMuODI4MTI1IDEyLjkxNDA2MiAzLjgyODEyNSBMIDE4LjY1MjM0NCAzLjgyODEyNSBDIDE4LjkxNzk2OSAzLjgyODEyNSAxOS4xMzI4MTIgMy42MTMyODEgMTkuMTMyODEyIDMuMzQ3NjU2IEMgMTkuMTMyODEyIDMuMDgyMDMxIDE4LjkxNzk2OSAyLjg2NzE4OCAxOC42NTIzNDQgMi44NjcxODggWiBNIDE4LjY1MjM0NCAyLjg2NzE4OCAiLz4KICA8cGF0aCBzdHJva2U9Im5vbmUiIGZpbGw9ImluaGVyaXQiIGQ9Ik0gMTAuMzc4OTA2IDExLjYyMTA5NCBDIDEwLjE5NTMxMiAxMS40MzM1OTQgOS44OTA2MjUgMTEuNDMzNTk0IDkuNzAzMTI1IDExLjYyMTA5NCBMIDMuMDA3ODEyIDE4LjMxNjQwNiBDIDIuODIwMzEyIDE4LjUgMi44MjAzMTIgMTguODA0Njg4IDMuMDA3ODEyIDE4Ljk5MjE4OCBDIDMuMTA1NDY5IDE5LjA4NTkzOCAzLjIyNjU2MiAxOS4xMzI4MTIgMy4zNDc2NTYgMTkuMTMyODEyIEMgMy40Njg3NSAxOS4xMzI4MTIgMy41ODk4NDQgMTkuMDg1OTM4IDMuNjgzNTk0IDE4Ljk5MjE4OCBMIDEwLjM3ODkwNiAxMi4yOTY4NzUgQyAxMC41NjY0MDYgMTIuMTA5Mzc1IDEwLjU2NjQwNiAxMS44MDQ2ODggMTAuMzc4OTA2IDExLjYyMTA5NCBaIE0gMTAuMzc4OTA2IDExLjYyMTA5NCAiLz4KICA8cGF0aCBzdHJva2U9Im5vbmUiIGZpbGw9ImluaGVyaXQiIGQ9Ik0gMy4zNDc2NTYgMTIuNDM3NSBDIDMuMDgyMDMxIDEyLjQzNzUgMi44NjcxODggMTIuNjUyMzQ0IDIuODY3MTg4IDEyLjkxNDA2MiBMIDIuODY3MTg4IDE4LjY1MjM0NCBDIDIuODY3MTg4IDE4LjkxNzk2OSAzLjA4MjAzMSAxOS4xMzI4MTIgMy4zNDc2NTYgMTkuMTMyODEyIEMgMy42MTMyODEgMTkuMTMyODEyIDMuODI4MTI1IDE4LjkxNzk2OSAzLjgyODEyNSAxOC42NTIzNDQgTCAzLjgyODEyNSAxMi45MTQwNjIgQyAzLjgyODEyNSAxMi42NTIzNDQgMy42MTMyODEgMTIuNDM3NSAzLjM0NzY1NiAxMi40Mzc1IFogTSAzLjM0NzY1NiAxMi40Mzc1ICIvPgogIDxwYXRoIHN0cm9rZT0ibm9uZSIgZmlsbD0iaW5oZXJpdCIgZD0iTSA5LjA4NTkzOCAxOC4xNzE4NzUgTCAzLjM0NzY1NiAxOC4xNzE4NzUgQyAzLjA4MjAzMSAxOC4xNzE4NzUgMi44NjcxODggMTguMzg2NzE5IDIuODY3MTg4IDE4LjY1MjM0NCBDIDIuODY3MTg4IDE4LjkxNzk2OSAzLjA4MjAzMSAxOS4xMzI4MTIgMy4zNDc2NTYgMTkuMTMyODEyIEwgOS4wODU5MzggMTkuMTMyODEyIEMgOS4zNDc2NTYgMTkuMTMyODEyIDkuNTYyNSAxOC45MTc5NjkgOS41NjI1IDE4LjY1MjM0NCBDIDkuNTYyNSAxOC4zODY3MTkgOS4zNDc2NTYgMTguMTcxODc1IDkuMDg1OTM4IDE4LjE3MTg3NSBaIE0gOS4wODU5MzggMTguMTcxODc1ICIvPgogIDxwYXRoIHN0cm9rZT0ibm9uZSIgZmlsbD0iaW5oZXJpdCIgZD0iTSAyMC41NjI1IDAgTCAxLjQzNzUgMCBDIDAuNjQ0NTMxIDAgMCAwLjY0NDUzMSAwIDEuNDM3NSBMIDAgMjAuNTYyNSBDIDAgMjEuMzU1NDY5IDAuNjQ0NTMxIDIyIDEuNDM3NSAyMiBMIDIwLjU2MjUgMjIgQyAyMS4zNTU0NjkgMjIgMjIgMjEuMzU1NDY5IDIyIDIwLjU2MjUgTCAyMiAxLjQzNzUgQyAyMiAwLjY0NDUzMSAyMS4zNTU0NjkgMCAyMC41NjI1IDAgWiBNIDIxLjA0Mjk2OSAyMC41NjI1IEMgMjEuMDQyOTY5IDIwLjgyODEyNSAyMC44MjgxMjUgMjEuMDQyOTY5IDIwLjU2MjUgMjEuMDQyOTY5IEwgMS40Mzc1IDIxLjA0Mjk2OSBDIDEuMTcxODc1IDIxLjA0Mjk2OSAwLjk1NzAzMSAyMC44MjgxMjUgMC45NTcwMzEgMjAuNTYyNSBMIDAuOTU3MDMxIDEuNDM3NSBDIDAuOTU3MDMxIDEuMTcxODc1IDEuMTcxODc1IDAuOTU3MDMxIDEuNDM3NSAwLjk1NzAzMSBMIDIwLjU2MjUgMC45NTcwMzEgQyAyMC44MjgxMjUgMC45NTcwMzEgMjEuMDQyOTY5IDEuMTcxODc1IDIxLjA0Mjk2OSAxLjQzNzUgWiBNIDIxLjA0Mjk2OSAyMC41NjI1ICIvPgo8L3N5bWJvbD4KPCEtLSAgLS0+CjxzeW1ib2wgaWQ9ImljLWRlbGV0ZS1hbGwiIHZpZXdCb3g9IjAgMCAyNCAyNCI+CiAgICA8cGF0aCBzdHJva2U9Im5vbmUiIGZpbGw9ImluaGVyaXQiIGQ9Ik01IDIzSDNhMSAxIDAgMCAxLTEtMVY2aDF2MTZoMnYxem0xNi0xMGgtMVY2aDF2N3pNOSAxM0g4di0zaDF2M3ptMyAwaC0xdi0zaDF2M3ptMyAwaC0xdi0zaDF2M3pNMTQuNzk0IDMuNzk0TDEzIDJoLTNMOC4yMDYgMy43OTRBLjk2My45NjMgMCAwIDEgOCAyLjVsLjcwMy0xLjA1NUExIDEgMCAwIDEgOS41MzUgMWgzLjkzYTEgMSAwIDAgMSAuODMyLjQ0NUwxNSAyLjVhLjk2NS45NjUgMCAwIDEtLjIwNiAxLjI5NHpNMTQuMTk3IDRIOC44MDNoNS4zOTR6Ii8+CiAgICA8cGF0aCBzdHJva2U9Im5vbmUiIGZpbGw9ImluaGVyaXQiIGQ9Ik0wIDNoMjN2MUgwek0xMS4yODYgMjFIOC43MTRMOCAyM0g3bDEtMi44VjIwaC4wNzFMOS41IDE2aDFsMS40MjkgNEgxMnYuMmwxIDIuOGgtMWwtLjcxNC0yem0tLjM1Ny0xTDEwIDE3LjQgOS4wNzEgMjBoMS44NTh6TTIwIDIyaDN2MWgtNHYtN2gxdjZ6bS01IDBoM3YxaC00di03aDF2NnoiLz4KPC9zeW1ib2w+CjxzeW1ib2wgaWQ9ImljLWRlbGV0ZSIgdmlld0JveD0iMCAwIDI0IDI0Ij4KICAgIDxwYXRoIHN0cm9rZT0ibm9uZSIgZmlsbD0iaW5oZXJpdCIgZD0iTTMgNnYxNmgxN1Y2aDF2MTZhMSAxIDAgMCAxLTEgMUgzYTEgMSAwIDAgMS0xLTFWNmgxek0xNC43OTQgMy43OTRMMTMgMmgtM0w4LjIwNiAzLjc5NEEuOTYzLjk2MyAwIDAgMSA4IDIuNWwuNzAzLTEuMDU1QTEgMSAwIDAgMSA5LjUzNSAxaDMuOTNhMSAxIDAgMCAxIC44MzIuNDQ1TDE1IDIuNWEuOTY1Ljk2NSAwIDAgMS0uMjA2IDEuMjk0ek0xNC4xOTcgNEg4LjgwM2g1LjM5NHoiLz4KICAgIDxwYXRoIHN0cm9rZT0ibm9uZSIgZmlsbD0iaW5oZXJpdCIgZD0iTTAgM2gyM3YxSDB6TTggMTBoMXY2SDh2LTZ6bTMgMGgxdjZoLTF2LTZ6bTMgMGgxdjZoLTF2LTZ6Ii8+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy1kcmF3LWZyZWUiIHZpZXdCb3g9IjAgMCAzMiAzMiI+CiAgICA8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9ImluaGVyaXQiIGQ9Ik0yLjUgMjAuOTI5QzIuNTk0IDEwLjk3NiA0LjMyMyA2IDcuNjg2IDZjNS44NzIgMCAyLjUyNCAxOSA3LjY5NyAxOXMxLjg5LTE0LjkyOSA2LjQxNC0xNC45MjkgMS4zNTcgMTAuODU4IDUuMTMgMTAuODU4YzEuODAyIDAgMi42NTctMi4yNjIgMi41NjYtNi43ODYiLz4KPC9zeW1ib2w+CjxzeW1ib2wgaWQ9ImljLWRyYXctbGluZSIgdmlld0JveD0iMCAwIDMyIDMyIj4KICAgIDxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iaW5oZXJpdCIgZD0iTTIgMTUuNWgyOCIvPgo8L3N5bWJvbD4KPHN5bWJvbCBpZD0iaWMtZHJhdyIgdmlld0JveD0iMCAwIDI0IDI0Ij4KICAgIDxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iaW5oZXJpdCIgZD0iTTIuNSAyMS41SDVjLjI0NSAwIC40OC0uMDU4LjY5MS0uMTY4bC4xMjQtLjA2NS4xNC4wMWMuNDI5LjAyOC44NS0uMTI3IDEuMTYtLjQzN0wyMi41NSA1LjQwNWEuNS41IDAgMCAwIDAtLjcwN2wtMy4yNDYtMy4yNDVhLjUuNSAwIDAgMC0uNzA3IDBMMy4xNjIgMTYuODg4YTEuNDk1IDEuNDk1IDAgMCAwLS40MzcgMS4xNTVsLjAxLjE0LS4wNjUuMTIzYy0uMTExLjIxMi0uMTcuNDQ4LS4xNy42OTR2Mi41eiIvPgogICAgPHBhdGggc3Ryb2tlPSJub25lIiBmaWxsPSJpbmhlcml0IiBkPSJNMTYuNDE0IDMuNzA3bDMuODkgMy44OS0uNzA4LjcwNi0zLjg4OS0zLjg4OXoiLz4KPC9zeW1ib2w+CjxzeW1ib2wgaWQ9ImljLWZpbHRlciIgdmlld0JveD0iMCAwIDI0IDI0Ij4KICAgIDxwYXRoIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiIHN0cm9rZT0ibm9uZSIgLz4KICAgIDxwYXRoIHN0cm9rZT0ibm9uZSIgZmlsbD0iaW5oZXJpdCIgZD0iTTEyIDd2MUgyVjdoMTB6bTYgMGg0djFoLTRWN3pNMTIgMTZ2MWgxMHYtMUgxMnptLTYgMEgydjFoNHYtMXoiLz4KICAgIDxwYXRoIHN0cm9rZT0ibm9uZSIgZmlsbD0iaW5oZXJpdCIgZD0iTTguNSAyMGEzLjUgMy41IDAgMSAxIDAtNyAzLjUgMy41IDAgMCAxIDAgN3ptMC0xYTIuNSAyLjUgMCAxIDAgMC01IDIuNSAyLjUgMCAwIDAgMCA1ek0xNS41IDExYTMuNSAzLjUgMCAxIDEgMC03IDMuNSAzLjUgMCAwIDEgMCA3em0wLTFhMi41IDIuNSAwIDEgMCAwLTUgMi41IDIuNSAwIDAgMCAwIDV6Ii8+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy1mbGlwLXJlc2V0IiB2aWV3Qm94PSIwIDAgMzEgMzIiPgogICAgPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSJub25lIiBkPSJNMzEgMEgwdjMyaDMxeiIvPgogICAgPHBhdGggc3Ryb2tlPSJub25lIiBmaWxsPSJpbmhlcml0IiBkPSJNMjggMTZhOCA4IDAgMCAxLTggOEgzdi0xaDF2LTdIM2E4IDggMCAwIDEgOC04aDE3djFoLTF2N2gxek0xMSA5YTcgNyAwIDAgMC03IDd2N2gxNmE3IDcgMCAwIDAgNy03VjlIMTF6Ii8+CiAgICA8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9ImluaGVyaXQiIHN0cm9rZS1saW5lY2FwPSJzcXVhcmUiIGQ9Ik0yNCA1bDMuNSAzLjVMMjQgMTJNNyAyMGwtMy41IDMuNUw3IDI3Ii8+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy1mbGlwLXgiIHZpZXdCb3g9IjAgMCAzMiAzMiI+CiAgICA8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9Im5vbmUiIGQ9Ik0zMiAzMkgwVjBoMzJ6Ii8+CiAgICA8cGF0aCBzdHJva2U9Im5vbmUiIGZpbGw9ImluaGVyaXQiIGQ9Ik0xNyAzMmgtMVYwaDF6TTI3LjE2NyAxMWwuNSAzaC0xLjAzbC0uNTQ2LTNoMS4wNzZ6bS0uNS0zaC0xLjEyMkwyNSA1aC01VjRoNS4xNTNhMSAxIDAgMCAxIC45ODYuODM2TDI2LjY2NyA4em0xLjUgOWwuNSAzaC0uOTRsLS41NDUtM2guOTg1em0xIDZsLjYzOSAzLjgzNkExIDEgMCAwIDEgMjguODE5IDI4SDI2di0xaDNsLS43MjYtNGguODk0ek0yMyAyOGgtM3YtMWgzdjF6TTEzIDR2MUg3TDMgMjdoMTB2MUgzLjE4YTEgMSAwIDAgMS0uOTg2LTEuMTY0bDMuNjY2LTIyQTEgMSAwIDAgMSA2Ljg0NyA0SDEzeiIvPgo8L3N5bWJvbD4KPHN5bWJvbCBpZD0iaWMtZmxpcC15IiB2aWV3Qm94PSIwIDAgMzIgMzIiPgogICAgPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSJub25lIiBkPSJNMCAwdjMyaDMyVjB6Ii8+CiAgICA8cGF0aCBzdHJva2U9Im5vbmUiIGZpbGw9ImluaGVyaXQiIGQ9Ik0wIDE2djFoMzJ2LTF6TTExIDI3LjE2N2wzIC41di0xLjAzbC0zLS41NDZ2MS4wNzZ6bS0zLS41di0xLjEyMkw1IDI1di01SDR2NS4xNTNhMSAxIDAgMCAwIC44MzYuOTg2TDggMjYuNjY3em05IDEuNWwzIC41di0uOTRsLTMtLjU0NXYuOTg1em02IDFsMy44MzYuNjM5QTEgMSAwIDAgMCAyOCAyOC44MlYyNmgtMXYzbC00LS43Mjd2Ljg5NHpNMjggMjN2LTNoLTF2M2gxek00IDEzaDFWN2wyMi00djEwaDFWMy4xOGExIDEgMCAwIDAtMS4xNjQtLjk4NmwtMjIgMy42NjdBMSAxIDAgMCAwIDQgNi44NDdWMTN6Ii8+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy1mbGlwIiB2aWV3Qm94PSIwIDAgMjQgMjQiPgogICAgPHBhdGggZD0iTTAgMGgyNHYyNEgweiIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJub25lIiAvPgogICAgPHBhdGggZmlsbD0iaW5oZXJpdCIgc3Ryb2tlPSJub25lIiBkPSJNMTEgMGgxdjI0aC0xek0xOSAyMXYtMWgydi0yaDF2MmExIDEgMCAwIDEtMSAxaC0yem0tMiAwaC0zdi0xaDN2MXptNS01aC0xdi0zaDF2M3ptMC01aC0xVjhoMXYzem0wLTVoLTFWNGgtMlYzaDJhMSAxIDAgMCAxIDEgMXYyem0tNS0zdjFoLTNWM2gzek05IDN2MUgydjE2aDd2MUgyYTEgMSAwIDAgMS0xLTFWNGExIDEgMCAwIDEgMS0xaDd6Ii8+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy1oaXN0b3J5IiB2aWV3Qm94PSIwIDAgMjQgMjQiPgogICAgPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSJub25lIiBkPSJNMCAwSDI0VjI0SDB6IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtNzQwIC0xNikgdHJhbnNsYXRlKDU0NyA4KSB0cmFuc2xhdGUoMTkzIDgpIi8+CiAgICA8cGF0aCBmaWxsPSJpbmhlcml0IiBzdHJva2U9Im5vbmUiIGQ9Ik0xMi41IDFDMTguMjk5IDEgMjMgNS43MDEgMjMgMTEuNVMxOC4yOTkgMjIgMTIuNSAyMmMtNS4yOSAwLTkuNjY1LTMuOTExLTEwLjM5NC04Ljk5OWgxLjAxMkMzLjgzOCAxNy41MzQgNy43NjQgMjEgMTIuNSAyMWM1LjI0NyAwIDkuNS00LjI1MyA5LjUtOS41UzE3Ljc0NyAyIDEyLjUgMkM4LjQ5IDIgNS4wNiA0LjQ4NSAzLjY2NiA4SDNoNHYxSDJWNGgxdjMuMDIyQzQuNjggMy40NjIgOC4zMDMgMSAxMi41IDF6bS41IDVsLS4wMDEgNS4yOTEgMi41MzcgMi41MzctLjcwOC43MDhMMTIuMjkyIDEySDEyVjZoMXoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC03NDAgLTE2KSB0cmFuc2xhdGUoNTQ3IDgpIHRyYW5zbGF0ZSgxOTMgOCkiLz4KPC9zeW1ib2w+CjxzeW1ib2wgaWQ9ImljLWhpc3RvcnktY2hlY2siIHZpZXdCb3g9IjAgMCAyNCAyNCI+CiAgICA8ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiID4KICAgICAgICA8cGF0aCBzdHJva2U9IiM1NTU1NTUiIGQ9Ik00LjUgLTFMMS41IDIgNi41IDciIHRyYW5zZm9ybT0idHJhbnNsYXRlKC02MCAtODA0KSB0cmFuc2xhdGUoNjAgODA0KSB0cmFuc2xhdGUoMiAzKSByb3RhdGUoLTkwIDQgMykiIC8+CiAgICA8L2c+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy1oaXN0b3J5LWNyb3AiIHZpZXdCb3g9IjAgMCAyNCAyNCI+CiAgICA8ZyBmaWxsPSJub25lIiBzdHJva2U9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCIgPgogICAgICAgIDxwYXRoIGQ9Ik0wIDBIMTJWMTJIMHoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC04NCAtODA0KSB0cmFuc2xhdGUoODQgODA0KSIvPgogICAgICAgIDxwYXRoIGZpbGw9IiM0MzQzNDMiIGQ9Ik0yIDBoMXYxMGMtLjU1MiAwLTEtLjQ0OC0xLTFWMHpNMTAgOXYzSDlWOWgxek05IDJoMXY2SDlWMnoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC04NCAtODA0KSB0cmFuc2xhdGUoODQgODA0KSIvPgogICAgICAgIDxwYXRoIGZpbGw9IiM0MzQzNDMiIGQ9Ik0yIDlIMTJWMTBIMnpNOSAyYy41MTMgMCAuOTM2LjM4Ni45OTMuODgzTDEwIDNIM1YyaDZ6TTIgM0gwVjJoMnYxeiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTg0IC04MDQpIHRyYW5zbGF0ZSg4NCA4MDQpIi8+CiAgICA8L2c+Cjwvc3ltYm9sPgo8IS0tIFRoaXMgaWNvbiBtYWRlIGJ5IFBpeGVsIHBlcmZlY3QgZnJvbSB3d3cuZmxhdGljb24uY29tIC0tPgo8c3ltYm9sIGlkPSJpYy1oaXN0b3J5LXJlc2l6ZSIgdmlld0JveD0iMCAwIDI0IDI0Ij4KICA8ZyBmaWxsPSJub25lIiBzdHJva2U9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCIgPgogICAgPHBhdGggZmlsbD0iIzQzNDM0MyIgZD0iTSA5LjQ5MjE4OCAxLjUwNzgxMiBDIDkuMzk4NDM4IDEuNDE0MDYyIDkuMjUgMS40MTQwNjIgOS4xNTYyNSAxLjUwNzgxMiBMIDUuODEyNSA0Ljg1MTU2MiBDIDUuNzE0ODQ0IDQuOTQ1MzEyIDUuNzE0ODQ0IDUuMDk3NjU2IDUuODEyNSA1LjE4NzUgQyA1Ljg1NTQ2OSA1LjIzNDM3NSA1LjkxNzk2OSA1LjI1NzgxMiA1Ljk3NjU2MiA1LjI1NzgxMiBDIDYuMDM5MDYyIDUuMjU3ODEyIDYuMTAxNTYyIDUuMjM0Mzc1IDYuMTQ4NDM4IDUuMTg3NSBMIDkuNDkyMTg4IDEuODQzNzUgQyA5LjU4NTkzOCAxLjc1IDkuNTg1OTM4IDEuNjAxNTYyIDkuNDkyMTg4IDEuNTA3ODEyIFogTSA5LjQ5MjE4OCAxLjUwNzgxMiAiLz4KICAgIDxwYXRoIGZpbGw9IiM0MzQzNDMiIGQ9Ik0gOS4zMjgxMjUgMS40MzM1OTQgQyA5LjE5NTMxMiAxLjQzMzU5NCA5LjA4NTkzOCAxLjUzOTA2MiA5LjA4NTkzOCAxLjY3MTg3NSBMIDkuMDg1OTM4IDQuNTQyOTY5IEMgOS4wODU5MzggNC42NzE4NzUgOS4xOTUzMTIgNC43ODEyNSA5LjMyODEyNSA0Ljc4MTI1IEMgOS40NjA5MzggNC43ODEyNSA5LjU2NjQwNiA0LjY3MTg3NSA5LjU2NjQwNiA0LjU0Mjk2OSBMIDkuNTY2NDA2IDEuNjcxODc1IEMgOS41NjY0MDYgMS41MzkwNjIgOS40NjA5MzggMS40MzM1OTQgOS4zMjgxMjUgMS40MzM1OTQgWiBNIDkuMzI4MTI1IDEuNDMzNTk0ICIvPgogICAgPHBhdGggZmlsbD0iIzQzNDM0MyIgZD0iTSA5LjMyODEyNSAxLjQzMzU5NCBMIDYuNDU3MDMxIDEuNDMzNTk0IEMgNi4zMjgxMjUgMS40MzM1OTQgNi4yMTg3NSAxLjUzOTA2MiA2LjIxODc1IDEuNjcxODc1IEMgNi4yMTg3NSAxLjgwNDY4OCA2LjMyODEyNSAxLjkxNDA2MiA2LjQ1NzAzMSAxLjkxNDA2MiBMIDkuMzI4MTI1IDEuOTE0MDYyIEMgOS40NjA5MzggMS45MTQwNjIgOS41NjY0MDYgMS44MDQ2ODggOS41NjY0MDYgMS42NzE4NzUgQyA5LjU2NjQwNiAxLjUzOTA2MiA5LjQ2MDkzOCAxLjQzMzU5NCA5LjMyODEyNSAxLjQzMzU5NCBaIE0gOS4zMjgxMjUgMS40MzM1OTQgIi8+CiAgICA8cGF0aCBmaWxsPSIjNDM0MzQzIiBkPSJNIDUuMTg3NSA1LjgxMjUgQyA1LjA5NzY1NiA1LjcxODc1IDQuOTQ1MzEyIDUuNzE4NzUgNC44NTE1NjIgNS44MTI1IEwgMS41MDM5MDYgOS4xNTYyNSBDIDEuNDEwMTU2IDkuMjUgMS40MTAxNTYgOS40MDIzNDQgMS41MDM5MDYgOS40OTYwOTQgQyAxLjU1NDY4OCA5LjU0Mjk2OSAxLjYxMzI4MSA5LjU2NjQwNiAxLjY3MTg3NSA5LjU2NjQwNiBDIDEuNzM0Mzc1IDkuNTY2NDA2IDEuNzk2ODc1IDkuNTQyOTY5IDEuODQzNzUgOS40OTYwOTQgTCA1LjE4NzUgNi4xNDg0MzggQyA1LjI4MTI1IDYuMDU0Njg4IDUuMjgxMjUgNS45MDIzNDQgNS4xODc1IDUuODEyNSBaIE0gNS4xODc1IDUuODEyNSAiLz4KICAgIDxwYXRoIGZpbGw9IiM0MzQzNDMiIGQ9Ik0gMS42NzE4NzUgNi4yMTg3NSBDIDEuNTM5MDYyIDYuMjE4NzUgMS40MzM1OTQgNi4zMjgxMjUgMS40MzM1OTQgNi40NTcwMzEgTCAxLjQzMzU5NCA5LjMyODEyNSBDIDEuNDMzNTk0IDkuNDYwOTM4IDEuNTM5MDYyIDkuNTY2NDA2IDEuNjcxODc1IDkuNTY2NDA2IEMgMS44MDQ2ODggOS41NjY0MDYgMS45MTQwNjIgOS40NjA5MzggMS45MTQwNjIgOS4zMjgxMjUgTCAxLjkxNDA2MiA2LjQ1NzAzMSBDIDEuOTE0MDYyIDYuMzI4MTI1IDEuODA0Njg4IDYuMjE4NzUgMS42NzE4NzUgNi4yMTg3NSBaIE0gMS42NzE4NzUgNi4yMTg3NSAiLz4KICAgIDxwYXRoIGZpbGw9IiM0MzQzNDMiIGQ9Ik0gNC41NDI5NjkgOS4wODU5MzggTCAxLjY3MTg3NSA5LjA4NTkzOCBDIDEuNTM5MDYyIDkuMDg1OTM4IDEuNDMzNTk0IDkuMTk1MzEyIDEuNDMzNTk0IDkuMzI4MTI1IEMgMS40MzM1OTQgOS40NjA5MzggMS41MzkwNjIgOS41NjY0MDYgMS42NzE4NzUgOS41NjY0MDYgTCA0LjU0Mjk2OSA5LjU2NjQwNiBDIDQuNjcxODc1IDkuNTY2NDA2IDQuNzgxMjUgOS40NjA5MzggNC43ODEyNSA5LjMyODEyNSBDIDQuNzgxMjUgOS4xOTUzMTIgNC42NzE4NzUgOS4wODU5MzggNC41NDI5NjkgOS4wODU5MzggWiBNIDQuNTQyOTY5IDkuMDg1OTM4ICIvPgogICAgPHBhdGggZmlsbD0iIzQzNDM0MyIgZD0iTSAxMC4yODEyNSAwIEwgMC43MTg3NSAwIEMgMC4zMjAzMTIgMCAwIDAuMzIwMzEyIDAgMC43MTg3NSBMIDAgMTAuMjgxMjUgQyAwIDEwLjY3OTY4OCAwLjMyMDMxMiAxMSAwLjcxODc1IDExIEwgMTAuMjgxMjUgMTEgQyAxMC42Nzk2ODggMTEgMTEgMTAuNjc5Njg4IDExIDEwLjI4MTI1IEwgMTEgMC43MTg3NSBDIDExIDAuMzIwMzEyIDEwLjY3OTY4OCAwIDEwLjI4MTI1IDAgWiBNIDEwLjUyMzQzOCAxMC4yODEyNSBDIDEwLjUyMzQzOCAxMC40MTQwNjIgMTAuNDE0MDYyIDEwLjUyMzQzOCAxMC4yODEyNSAxMC41MjM0MzggTCAwLjcxODc1IDEwLjUyMzQzOCBDIDAuNTg1OTM4IDEwLjUyMzQzOCAwLjQ3NjU2MiAxMC40MTQwNjIgMC40NzY1NjIgMTAuMjgxMjUgTCAwLjQ3NjU2MiAwLjcxODc1IEMgMC40NzY1NjIgMC41ODU5MzggMC41ODU5MzggMC40NzY1NjIgMC43MTg3NSAwLjQ3NjU2MiBMIDEwLjI4MTI1IDAuNDc2NTYyIEMgMTAuNDE0MDYyIDAuNDc2NTYyIDEwLjUyMzQzOCAwLjU4NTkzOCAxMC41MjM0MzggMC43MTg3NSBaIE0gMTAuNTIzNDM4IDEwLjI4MTI1ICIvPgogIDwvZz4KPC9zeW1ib2w+CjwhLS0gIC0tPgo8c3ltYm9sIGlkPSJpYy1oaXN0b3J5LWRyYXciIHZpZXdCb3g9IjAgMCAyNCAyNCI+CiAgICA8ZyBmaWxsPSJub25lIiBzdHJva2U9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCIgPgogICAgICAgIDxwYXRoIGQ9Ik0wIDFIMTJWMTNIMHoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0xNTYgLTgwNCkgdHJhbnNsYXRlKDE1NiA4MDMpIi8+CiAgICAgICAgPHBhdGggc3Ryb2tlPSIjNDM0MzQzIiBkPSJNOS42MjIgMS41ODRsMS44MzUgMS42NTgtOC4zMSA4LjQwN0wuNSAxMi41VjExbDkuMTIyLTkuNDE2eiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTE1NiAtODA0KSB0cmFuc2xhdGUoMTU2IDgwMykiLz4KICAgICAgICA8cGF0aCBmaWxsPSIjNDM0MzQzIiBkPSJNNy42MjggMy43NTNMMTAuMzc4IDMuNzUzIDEwLjM3OCA0LjI1MyA3LjYyOCA0LjI1M3oiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0xNTYgLTgwNCkgdHJhbnNsYXRlKDE1NiA4MDMpIHJvdGF0ZSg0NSA5LjAwMyA0LjAwMykiLz4KICAgIDwvZz4KPC9zeW1ib2w+CjxzeW1ib2wgaWQ9ImljLWhpc3RvcnktZmlsdGVyIiB2aWV3Qm94PSIwIDAgMjQgMjQiPgogICAgPGcgZmlsbD0ibm9uZSIgc3Ryb2tlPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiID4KICAgICAgICA8cGF0aCBkPSJNMCAwSDEyVjEySDB6IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMjc2IC04MDQpIHRyYW5zbGF0ZSgyNzYgODA0KSIvPgogICAgICAgIDxwYXRoIGZpbGw9IiM0MzQzNDMiIGQ9Ik0xMiAzdjFIOVYzaDN6TTcgNEgwVjNoN3YxeiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTI3NiAtODA0KSB0cmFuc2xhdGUoMjc2IDgwNCkiLz4KICAgICAgICA8cGF0aCBmaWxsPSIjNDM0MzQzIiBkPSJNMTIgOHYxSDlWOGgzek03IDlIMFY4aDd2MXoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yNzYgLTgwNCkgdHJhbnNsYXRlKDI3NiA4MDQpIG1hdHJpeCgtMSAwIDAgMSAxMiAwKSIvPgogICAgICAgIDxwYXRoIGZpbGw9IiM0MzQzNDMiIGQ9Ik04IDFjMS4xMDUgMCAyIC44OTUgMiAycy0uODk1IDItMiAyLTItLjg5NS0yLTIgLjg5NS0yIDItMnptMCAxYy0uNTUyIDAtMSAuNDQ4LTEgMXMuNDQ4IDEgMSAxIDEtLjQ0OCAxLTEtLjQ0OC0xLTEtMXpNNCA3YzEuMTA1IDAgMiAuODk1IDIgMnMtLjg5NSAyLTIgMi0yLS44OTUtMi0yIC44OTUtMiAyLTJ6bTAgMWMtLjU1MiAwLTEgLjQ0OC0xIDFzLjQ0OCAxIDEgMSAxLS40NDggMS0xLS40NDgtMS0xLTF6IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMjc2IC04MDQpIHRyYW5zbGF0ZSgyNzYgODA0KSIvPgogICAgPC9nPgo8L3N5bWJvbD4KPHN5bWJvbCBpZD0iaWMtaGlzdG9yeS1mbGlwIiB2aWV3Qm94PSIwIDAgMjQgMjQiPgogICAgPGcgZmlsbD0ibm9uZSIgc3Ryb2tlPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiID4KICAgICAgICA8cGF0aCBkPSJNMCAwSDEyVjEySDB6IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTA4IC04MDQpIHRyYW5zbGF0ZSgxMDggODA0KSIvPgogICAgICAgIDxwYXRoIGZpbGw9IiM0MzQzNDMiIGQ9Ik02IDBMNyAwIDcgMTIgNiAxMnpNMTEgMTBWOWgxdjEuNWMwIC4yNzYtLjIyNC41LS41LjVIMTB2LTFoMXpNNSAxdjFIMXY4aDR2MUguNWMtLjI3NiAwLS41LS4yMjQtLjUtLjV2LTljMC0uMjc2LjIyNC0uNS41LS41SDV6bTcgNXYyaC0xVjZoMXptMC0zdjJoLTFWM2gxek05IDF2MUg3VjFoMnptMi41IDBjLjI3NiAwIC41LjIyNC41LjVWMmgtMlYxaDEuNXpNOSAxMUg3di0xaDJ2MXoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0xMDggLTgwNCkgdHJhbnNsYXRlKDEwOCA4MDQpIi8+CiAgICA8L2c+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy1oaXN0b3J5LWljb24iIHZpZXdCb3g9IjAgMCAyNCAyNCI+CiAgICA8ZyBmaWxsPSJub25lIiBzdHJva2U9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCIgPgogICAgICAgIDxwYXRoIGQ9Ik0wIDBIMTJWMTJIMHoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMDQgLTgwNCkgdHJhbnNsYXRlKDIwNCA4MDQpIi8+CiAgICAgICAgPHBhdGggc3Ryb2tlPSIjNDM0MzQzIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS13aWR0aD0iMS4xIiBkPSJNNiA5LjU2OEwyLjYwMSAxMSAyLjk3NSA3LjQ2NyAwLjUgNC44MiA0LjEzIDQuMDY4IDYgMSA3Ljg3IDQuMDY4IDExLjUgNC44MiA5LjAyNSA3LjQ2NyA5LjM5OSAxMXoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMDQgLTgwNCkgdHJhbnNsYXRlKDIwNCA4MDQpIi8+CiAgICA8L2c+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy1oaXN0b3J5LW1hc2siIHZpZXdCb3g9IjAgMCAyNCAyNCI+CiAgICA8ZyBmaWxsPSJub25lIiBzdHJva2U9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCIgPgogICAgICAgIDxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yNTIgLTgwNCkgdHJhbnNsYXRlKDI1MiA4MDQpIj4KICAgICAgICAgICAgPHBhdGggZD0iTTAgMEgxMlYxMkgweiIvPgogICAgICAgICAgICA8Y2lyY2xlIGN4PSI2IiBjeT0iNiIgcj0iMi41IiBzdHJva2U9IiM0NDQiLz4KICAgICAgICAgICAgPHBhdGggZmlsbD0iIzQzNDM0MyIgZD0iTTExLjUgMGMuMjc2IDAgLjUuMjI0LjUuNXYxMWMwIC4yNzYtLjIyNC41LS41LjVILjVjLS4yNzYgMC0uNS0uMjI0LS41LS41Vi41QzAgLjIyNC4yMjQgMCAuNSAwaDExek0xMSAxSDF2MTBoMTBWMXoiLz4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy1oaXN0b3J5LXJvdGF0ZSIgdmlld0JveD0iMCAwIDI0IDI0Ij4KICAgIDxkZWZzPgogICAgICAgIDxwYXRoIGlkPSJyZm40cnlsZmZhIiBkPSJNNyAxMmMtLjMzNSAwLS42NjMtLjAyNS0uOTgzLS4wNzRDMy4xNzEgMTEuNDkyIDEgOS4yMDUgMSA2LjQ0NGMwLTEuMzYzLjUzNC0yLjYxMyAxLjQxNS0zLjU4Ii8+CiAgICAgICAgPG1hc2sgaWQ9IjZmOWduMmR5c2IiIHdpZHRoPSI2IiBoZWlnaHQ9IjkuMTM2IiB4PSIwIiB5PSIwIiBtYXNrVW5pdHM9Im9iamVjdEJvdW5kaW5nQm94Ij4KICAgICAgICAgICAgPHVzZSB4bGluazpocmVmPSIjcmZuNHJ5bGZmYSIgc3Ryb2tlPSI0MzQzNDMiLz4KICAgICAgICA8L21hc2s+CiAgICA8L2RlZnM+CiAgICA8ZyBmaWxsPSJub25lIiBzdHJva2U9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCIgPgogICAgICAgIDxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0xMzIgLTgwNCkgdHJhbnNsYXRlKDEzMiA4MDQpIj4KICAgICAgICAgICAgPHBhdGggZD0iTTAgMC41SDEyVjEyLjVIMHoiLz4KICAgICAgICAgICAgPHBhdGggZmlsbD0iIzQzNDM0MyIgZD0iTTYuNSAxQzkuNTM4IDEgMTIgMy40NjIgMTIgNi41YzAgMi4zNy0xLjUgNC4zOS0zLjYgNS4xNjNsLS40MDctLjkxNkM5Ljc0NCAxMC4xMyAxMSA4LjQ2MiAxMSA2LjUgMTEgNC4wMTUgOC45ODUgMiA2LjUgMmMtLjc3NyAwLTEuNTA5LjE5Ny0yLjE0Ny41NDRMNCAxLjc1bC0uMjA1LS4wNEM0LjU5NCAxLjI1OCA1LjUxNyAxIDYuNSAxeiIvPgogICAgICAgICAgICA8dXNlIHN0cm9rZT0iIzQzNDM0MyIgc3Ryb2tlLWRhc2hhcnJheT0iMiAxLjI1IiBzdHJva2Utd2lkdGg9IjEiIG1hc2s9InVybCgjNmY5Z24yZHlzYikiIHhsaW5rOmhyZWY9IiNyZm40cnlsZmZhIi8+CiAgICAgICAgICAgIDxwYXRoIGZpbGw9IiM0MzQzNDMiIGQ9Ik00LjI3OSAwTDYgMS43NSA0LjI1IDMuNTcxIDMuNTQzIDIuODY0IDQuNTg2IDEuNzUgMy41NzIgMC43MDd6IiB0cmFuc2Zvcm09Im1hdHJpeCgtMSAwIDAgMSA5LjU0MyAwKSIvPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zeW1ib2w+CjxzeW1ib2wgaWQ9ImljLWhpc3Rvcnktc2hhcGUiIHZpZXdCb3g9IjAgMCAyNCAyNCI+CiAgICA8ZyBmaWxsPSJub25lIiBzdHJva2U9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCIgPgogICAgICAgIDxwYXRoIGQ9Ik0wIDBIMTJWMTJIMHoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0xODAgLTgwNCkgdHJhbnNsYXRlKDE4MCA4MDQpIi8+CiAgICAgICAgPHBhdGggZmlsbD0iIzQzNDM0MyIgZD0iTTExLjUgNGMuMjc2IDAgLjUuMjI0LjUuNXY3YzAgLjI3Ni0uMjI0LjUtLjUuNWgtN2MtLjI3NiAwLS41LS4yMjQtLjUtLjVWOC44aDFWMTFoNlY1SDguMzQxbC0uNTY4LTFIMTEuNXoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0xODAgLTgwNCkgdHJhbnNsYXRlKDE4MCA4MDQpIi8+CiAgICAgICAgPHBhdGggc3Ryb2tlPSIjNDM0MzQzIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGQ9Ik00LjUgMC41TDguNSA3LjYxMSAwLjUgNy42MTF6IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTgwIC04MDQpIHRyYW5zbGF0ZSgxODAgODA0KSIvPgogICAgPC9nPgo8L3N5bWJvbD4KPHN5bWJvbCBpZD0iaWMtaGlzdG9yeS10ZXh0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPgogICAgPGcgZmlsbD0ibm9uZSIgc3Ryb2tlPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiID4KICAgICAgICA8cGF0aCBkPSJNMCAwSDEyVjEySDB6IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMjI4IC04MDQpIHRyYW5zbGF0ZSgyMjggODA0KSIvPgogICAgICAgIDxwYXRoIGZpbGw9IiM0MzQzNDMiIGQ9Ik0yIDFoOGMuNTUyIDAgMSAuNDQ4IDEgMUgxYzAtLjU1Mi40NDgtMSAxLTF6IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMjI4IC04MDQpIHRyYW5zbGF0ZSgyMjggODA0KSIvPgogICAgICAgIDxwYXRoIGZpbGw9IiM0MzQzNDMiIGQ9Ik0xIDFIMlYzSDF6TTEwIDFIMTFWM0gxMHpNNS41IDFMNi41IDEgNi41IDExIDUuNSAxMXoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMjggLTgwNCkgdHJhbnNsYXRlKDIyOCA4MDQpIi8+CiAgICAgICAgPHBhdGggZmlsbD0iIzQzNDM0MyIgZD0iTTQgMTBIOFYxMUg0eiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTIyOCAtODA0KSB0cmFuc2xhdGUoMjI4IDgwNCkiLz4KICAgIDwvZz4KPC9zeW1ib2w+CjxzeW1ib2wgaWQ9ImljLWhpc3RvcnktbG9hZCIgdmlld0JveD0iMCAwIDI0IDI0Ij4KICAgIDxnIGZpbGw9Im5vbmUiIHN0cm9rZT0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8cGF0aCBkPSJNMCAwSDEyVjEySDB6IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMzI0IC04MDUpIHRyYW5zbGF0ZSgzMjQgODA1KSIvPgogICAgICAgIDxwYXRoIGZpbGw9IiM0MzQzNDMiIGQ9Ik01IDBjLjU1MiAwIDEgLjQ0OCAxIDF2MWg1LjVjLjI3NiAwIC41LjIyNC41LjV2OGMwIC4yNzYtLjIyNC41LS41LjVILjVjLS4yNzYgMC0uNS0uMjI0LS41LS41VjFjMC0uNTUyLjQ0OC0xIDEtMWg0em0wIDFIMXY5aDEwVjNINVYxeiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTMyNCAtODA1KSB0cmFuc2xhdGUoMzI0IDgwNSkiLz4KICAgICAgICA8cGF0aCBmaWxsPSIjNDM0MzQzIiBkPSJNMSAyTDUgMiA1IDMgMSAzeiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTMyNCAtODA1KSB0cmFuc2xhdGUoMzI0IDgwNSkiLz4KICAgIDwvZz4KPC9zeW1ib2w+CjxzeW1ib2wgaWQ9ImljLWhpc3RvcnktZGVsZXRlIiB2aWV3Qm94PSIwIDAgMjQgMjQiPgogICAgPGcgZmlsbD0ibm9uZSIgc3Ryb2tlPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxnIGZpbGw9IiM0MzQzNDMiPgogICAgICAgICAgICA8cGF0aCBkPSJNMiA5aDhWMWgxdjguNWMwIC4yNzYtLjIyNC41LS41LjVoLTljLS4yNzYgMC0uNS0uMjI0LS41LS41VjFoMXY4ek0wIDBIMTJWMUgweiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTMwMCAtODA0KSB0cmFuc2xhdGUoMzAwIDgwNCkgdHJhbnNsYXRlKDAgMikiLz4KICAgICAgICAgICAgPHBhdGggZD0iTTQgM0g1VjdINHpNNyAzSDhWN0g3eiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTMwMCAtODA0KSB0cmFuc2xhdGUoMzAwIDgwNCkgdHJhbnNsYXRlKDAgMikiLz4KICAgICAgICAgICAgPHBhdGggZD0iTTQgMWg0VjBoMXYxLjVjMCAuMjc2LS4yMjQuNS0uNS41aC01Yy0uMjc2IDAtLjUtLjIyNC0uNS0uNVYwaDF2MXoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0zMDAgLTgwNCkgdHJhbnNsYXRlKDMwMCA4MDQpIG1hdHJpeCgxIDAgMCAtMSAwIDIpIi8+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N5bWJvbD4KPHN5bWJvbCBpZD0iaWMtaGlzdG9yeS1ncm91cCIgdmlld0JveD0iMCAwIDI0IDI0Ij4KICAgIDxnIGZpbGw9Im5vbmUiIHN0cm9rZT0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMzQ4IC04MDQpIHRyYW5zbGF0ZSgzNDggODA0KSI+CiAgICAgICAgICAgIDxwYXRoIGQ9Ik0wIDBIMTJWMTJIMHoiLz4KICAgICAgICAgICAgPHBhdGggZmlsbD0iIzQzNDM0MyIgZD0iTTEgOXYyaDF2MUguNWMtLjI3NiAwLS41LS4yMjQtLjUtLjVWOWgxem0xMSAxdjEuNWMwIC4yNzYtLjIyNC41LS41LjVIOXYtMWgydi0xaDF6bS00IDF2MUg2di0xaDJ6bS0zIDB2MUgzdi0xaDJ6bTctNHYyaC0xVjdoMXpNMSA2djJIMFY2aDF6bTExLTJ2MmgtMVY0aDF6TTEgM3YySDBWM2gxem0xMC41LTNjLjI3NiAwIC41LjIyNC41LjVWM2gtMVYxaC0xVjBoMS41ek02IDB2MUg0VjBoMnptMyAwdjFIN1YwaDJ6TTAgLjVDMCAuMjI0LjIyNCAwIC41IDBIM3YxSDF2MUgwVi41ek05LjUgNGMuMjc2IDAgLjUuMjI0LjUuNXY1YzAgLjI3Ni0uMjI0LjUtLjUuNWgtNWMtLjI3NiAwLS41LS4yMjQtLjUtLjVWOC4zNTVjLjMxNy4wOTQuNjUyLjE0NSAxIC4xNDVWOWg0VjVoLS41YzAtLjM0OC0uMDUtLjY4My0uMTQ1LTFIOS41eiIvPgogICAgICAgICAgICA8Y2lyY2xlIGN4PSI1IiBjeT0iNSIgcj0iMi41IiBzdHJva2U9IiM0MzQzNDMiLz4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy1pY29uLWFycm93LTIiIHZpZXdCb3g9IjAgMCAzMiAzMiI+CiAgICA8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9ImluaGVyaXQiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgZD0iTTIxLjc5MyAxOC41SDIuNXYtNWgxOC45MzVsLTcuNi04aDUuODcybDEwLjUgMTAuNS0xMC41IDEwLjVoLTUuOTE0bDgtOHoiLz4KPC9zeW1ib2w+CjxzeW1ib2wgaWQ9ImljLWljb24tYXJyb3ctMyIgdmlld0JveD0iMCAwIDMyIDMyIj4KICAgIDxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iaW5oZXJpdCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBkPSJNMjUuMjg4IDE2LjQyTDE0LjIwOCAyNy41SDYuNzkybDExLjI5MS0xMS4yOTFMNi44MjYgNC41aDcuMzgxbDExLjY2MSAxMS42NjEtLjU4LjI1OHoiLz4KPC9zeW1ib2w+CjxzeW1ib2wgaWQ9ImljLWljb24tYXJyb3ciIHZpZXdCb3g9IjAgMCAzMiAzMiI+CiAgICA8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9ImluaGVyaXQiIGQ9Ik0yLjUgMTEuNXY5aDE4djUuMjkzTDMwLjI5MyAxNiAyMC41IDYuMjA3VjExLjVoLTE4eiIvPgo8L3N5bWJvbD4KPHN5bWJvbCBpZD0iaWMtaWNvbi1idWJibGUiIHZpZXdCb3g9IjAgMCAzMiAzMiI+CiAgICA8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9ImluaGVyaXQiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgZD0iTTIyLjIwNyAyNC41TDE2LjUgMzAuMjA3VjI0LjVIOEE2LjUgNi41IDAgMCAxIDEuNSAxOFY5QTYuNSA2LjUgMCAwIDEgOCAyLjVoMTZBNi41IDYuNSAwIDAgMSAzMC41IDl2OWE2LjUgNi41IDAgMCAxLTYuNSA2LjVoLTEuNzkzeiIvPgo8L3N5bWJvbD4KPHN5bWJvbCBpZD0iaWMtaWNvbi1oZWFydCIgdmlld0JveD0iMCAwIDMyIDMyIj4KICAgIDxwYXRoIGZpbGwtcnVsZT0ibm9uemVybyIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJpbmhlcml0IiBkPSJNMTUuOTk2IDMwLjY3NWwxLjk4MS0xLjc5YzcuODk4LTcuMTc3IDEwLjM2NS05LjcxOCAxMi4xMzUtMTMuMDEyLjkyMi0xLjcxNiAxLjM3Ny0zLjM3IDEuMzc3LTUuMDc2IDAtNC42NS0zLjY0Ny04LjI5Ny04LjI5Ny04LjI5Ny0yLjMzIDAtNC44NiAxLjUyNy02LjgxNyAzLjgyNGwtLjM4LjQ0Ny0uMzgxLS40NDdDMTMuNjU4IDQuMDI3IDExLjEyNiAyLjUgOC43OTcgMi41IDQuMTQ3IDIuNS41IDYuMTQ3LjUgMTAuNzk3YzAgMS43MTQuNDYgMy4zNzUgMS4zODkgNS4wOTggMS43NzUgMy4yODggNC4yNiA1Ljg0MyAxMi4xMjMgMTIuOTc0bDEuOTg0IDEuODA2eiIvPgo8L3N5bWJvbD4KPHN5bWJvbCBpZD0iaWMtaWNvbi1sb2FkIiB2aWV3Qm94PSIwIDAgMzIgMzIiPgogICAgPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSJpbmhlcml0IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGQ9Ik0xNy4zMTQgMTguODY3bDEuOTUxLTIuNTMgNCA1LjE4NGgtMTdsNi41LTguODQgNC41NDkgNi4xODZ6Ii8+CiAgICA8cGF0aCBzdHJva2U9Im5vbmUiIGZpbGw9ImluaGVyaXQiIGQ9Ik0xOC4wMSA0YTExLjc5OCAxMS43OTggMCAwIDAgMCAxSDN2MjRoMjRWMTQuOTg2YTguNzM4IDguNzM4IDAgMCAwIDEgMFYyOWExIDEgMCAwIDEtMSAxSDNhMSAxIDAgMCAxLTEtMVY1YTEgMSAwIDAgMSAxLTFoMTUuMDF6Ii8+CiAgICA8cGF0aCBzdHJva2U9Im5vbmUiIGZpbGw9ImluaGVyaXQiIGQ9Ik0yNSAzaDF2OWgtMXoiLz4KICAgIDxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iaW5oZXJpdCIgZD0iTTIyIDZsMy41LTMuNUwyOSA2Ii8+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy1pY29uLWxvY2F0aW9uIiB2aWV3Qm94PSIwIDAgMzIgMzIiPgogICAgPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSJpbmhlcml0IiBkPSJNMTYgMzEuMjhDMjMuNjc1IDIzLjMwMiAyNy41IDE3LjE4MSAyNy41IDEzYzAtNi4zNTEtNS4xNDktMTEuNS0xMS41LTExLjVTNC41IDYuNjQ5IDQuNSAxM2MwIDQuMTgxIDMuODI1IDEwLjMwMiAxMS41IDE4LjI4eiIvPgogICAgPGNpcmNsZSBmaWxsPSJub25lIiBzdHJva2U9ImluaGVyaXQiIGN4PSIxNiIgY3k9IjEzIiByPSI0LjUiLz4KPC9zeW1ib2w+CjxzeW1ib2wgaWQ9ImljLWljb24tcG9seWdvbiIgdmlld0JveD0iMCAwIDMyIDMyIj4KICAgIDxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iaW5oZXJpdCIgZD0iTS41NzYgMTZMOC4yOSAyOS41aDE1LjQyTDMxLjQyNCAxNiAyMy43MSAyLjVIOC4yOUwuNTc2IDE2eiIvPgo8L3N5bWJvbD4KPHN5bWJvbCBpZD0iaWMtaWNvbi1zdGFyLTIiIHZpZXdCb3g9IjAgMCAzMiAzMiI+CiAgICA8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9ImluaGVyaXQiIGQ9Ik0xOS40NDYgMzEuNTkybDIuMjY1LTMuMjcyIDMuOTQ2LjI1LjYzNi0zLjk0IDMuNjY1LTEuNTA1LTEuMTItMy44MzIgMi42NTUtMi45NjItMi42NTYtMi45NjIgMS4xMi0zLjgzMi0zLjY2NC0xLjUwNS0uNjM2LTMuOTQxLTMuOTQ2LjI1LTIuMjY1LTMuMjcxTDE2IDMuMDI0IDEyLjU1NCAxLjA3IDEwLjI4OSA0LjM0bC0zLjk0Ni0uMjUtLjYzNiAzLjk0MS0zLjY2NSAxLjUwNSAxLjEyIDMuODMyTC41MDggMTYuMzNsMi42NTYgMi45NjItMS4xMiAzLjgzMiAzLjY2NCAxLjUwNC42MzYgMy45NDIgMy45NDYtLjI1IDIuMjY1IDMuMjdMMTYgMjkuNjM4bDMuNDQ2IDEuOTU1eiIvPgo8L3N5bWJvbD4KPHN5bWJvbCBpZD0iaWMtaWNvbi1zdGFyIiB2aWV3Qm94PSIwIDAgMzIgMzIiPgogICAgPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSJpbmhlcml0IiBkPSJNMjUuMjkyIDI5Ljg3OGwtMS43NzUtMTAuMzQ2IDcuNTE3LTcuMzI3LTEwLjM4OC0xLjUxTDE2IDEuMjgybC00LjY0NiA5LjQxMy0xMC4zODggMS41MSA3LjUxNyA3LjMyNy0xLjc3NSAxMC4zNDZMMTYgMjQuOTkzbDkuMjkyIDQuODg1eiIvPgo8L3N5bWJvbD4KPHN5bWJvbCBpZD0iaWMtaWNvbiIgdmlld0JveD0iMCAwIDI0IDI0Ij4KICAgIDxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iaW5oZXJpdCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBkPSJNMTEuOTIzIDE5LjEzNkw1LjQyNCAyMmwuNzE1LTcuMDY1LTQuNzMxLTUuMjk2IDYuOTQtMS41MDNMMTEuOTIzIDJsMy41NzQgNi4xMzYgNi45NCAxLjUwMy00LjczMSA1LjI5NkwxOC40MiAyMnoiLz4KPC9zeW1ib2w+CjxzeW1ib2wgaWQ9ImljLW1hc2stbG9hZCIgdmlld0JveD0iMCAwIDMyIDMyIj4KICAgIDxwYXRoIHN0cm9rZT0ibm9uZSIgZmlsbD0ibm9uZSIgZD0iTTAgMGgzMnYzMkgweiIvPgogICAgPHBhdGggc3Ryb2tlPSJub25lIiBmaWxsPSJpbmhlcml0IiBkPSJNMTguMDEgNGExMS43OTggMTEuNzk4IDAgMCAwIDAgMUgzdjI0aDI0VjE0Ljk4NmE4LjczOCA4LjczOCAwIDAgMCAxIDBWMjlhMSAxIDAgMCAxLTEgMUgzYTEgMSAwIDAgMS0xLTFWNWExIDEgMCAwIDEgMS0xaDE1LjAxek0xNSAyM2E2IDYgMCAxIDEgMC0xMiA2IDYgMCAwIDEgMCAxMnptMC0xYTUgNSAwIDEgMCAwLTEwIDUgNSAwIDAgMCAwIDEweiIvPgogICAgPHBhdGggc3Ryb2tlPSJub25lIiBmaWxsPSJpbmhlcml0IiBkPSJNMjUgM2gxdjloLTF6Ii8+CiAgICA8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9ImluaGVyaXQiIGQ9Ik0yMiA2bDMuNS0zLjVMMjkgNiIvPgo8L3N5bWJvbD4KPHN5bWJvbCBpZD0iaWMtbWFzayIgdmlld0JveD0iMCAwIDI0IDI0Ij4KICAgIDxjaXJjbGUgY3g9IjEyIiBjeT0iMTIiIHI9IjQuNSIgc3Ryb2tlPSJpbmhlcml0IiBmaWxsPSJub25lIi8+CiAgICA8cGF0aCBzdHJva2U9Im5vbmUiIGZpbGw9ImluaGVyaXQiIGQ9Ik0yIDFoMjBhMSAxIDAgMCAxIDEgMXYyMGExIDEgMCAwIDEtMSAxSDJhMSAxIDAgMCAxLTEtMVYyYTEgMSAwIDAgMSAxLTF6bTAgMXYyMGgyMFYySDJ6Ii8+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy1yZWRvIiB2aWV3Qm94PSIwIDAgMjQgMjQiPgogICAgPHBhdGggZD0iTTAgMGgyNHYyNEgweiIgb3BhY2l0eT0iLjUiIGZpbGw9Im5vbmUiIHN0cm9rZT0ibm9uZSIgLz4KICAgIDxwYXRoIHN0cm9rZT0ibm9uZSIgZmlsbD0iaW5oZXJpdCIgZD0iTTIxIDZIOWE2IDYgMCAxIDAgMCAxMmgxMnYxSDlBNyA3IDAgMCAxIDkgNWgxMnYxeiIvPgogICAgPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSJpbmhlcml0IiBzdHJva2UtbGluZWNhcD0ic3F1YXJlIiBkPSJNMTkgM2wyLjUgMi41TDE5IDgiLz4KPC9zeW1ib2w+CjxzeW1ib2wgaWQ9ImljLXJlc2V0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPgogICAgPHBhdGggZD0iTTAgMGgyNHYyNEgweiIgb3BhY2l0eT0iLjUiIHN0cm9rZT0ibm9uZSIgZmlsbD0ibm9uZSIvPgogICAgPHBhdGggc3Ryb2tlPSJub25lIiBmaWxsPSJpbmhlcml0IiBkPSJNMiAxM3YtMWE3IDcgMCAwIDEgNy03aDEzdjFoLTF2NWgxdjFhNyA3IDAgMCAxLTcgN0gydi0xaDF2LTVIMnptNy03YTYgNiAwIDAgMC02IDZ2NmgxMmE2IDYgMCAwIDAgNi02VjZIOXoiLz4KICAgIDxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iaW5oZXJpdCIgc3Ryb2tlLWxpbmVjYXA9InNxdWFyZSIgZD0iTTE5IDNsMi41IDIuNUwxOSA4TTUgMTZsLTIuNSAyLjVMNSAyMSIvPgo8L3N5bWJvbD4KPHN5bWJvbCBpZD0iaWMtcm90YXRlLWNsb2Nrd2lzZSIgdmlld0JveD0iMCAwIDMyIDMyIj4KICAgIDxwYXRoIHN0cm9rZT0ibm9uZSIgZmlsbD0iaW5oZXJpdCIgZD0iTTI5IDE3aC0uOTI0YzAgNi42MjctNS4zNzMgMTItMTIgMTItNi42MjggMC0xMi01LjM3My0xMi0xMkM0LjA3NiAxMC4zOTggOS40MDcgNS4wNDEgMTYgNVY0QzguODIgNCAzIDkuODIgMyAxN3M1LjgyIDEzIDEzIDEzIDEzLTUuODIgMTMtMTN6Ii8+CiAgICA8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9ImluaGVyaXQiIHN0cm9rZS1saW5lY2FwPSJzcXVhcmUiIGQ9Ik0xNiAxLjVsNCAzLTQgMyIvPgogICAgPHBhdGggc3Ryb2tlPSJub25lIiBmaWxsPSJpbmhlcml0IiBmaWxsLXJ1bGU9Im5vbnplcm8iIGQ9Ik0xNiA0aDR2MWgtNHoiLz4KPC9zeW1ib2w+CjxzeW1ib2wgaWQ9ImljLXJvdGF0ZS1jb3VudGVyY2xvY2t3aXNlIiB2aWV3Qm94PSIwIDAgMzIgMzIiPgogICAgPHBhdGggc3Ryb2tlPSJub25lIiBkPSJNMyAxN2guOTI0YzAgNi42MjcgNS4zNzMgMTIgMTIgMTIgNi42MjggMCAxMi01LjM3MyAxMi0xMiAwLTYuNjAyLTUuMzMxLTExLjk2LTExLjkyNC0xMlY0YzcuMTggMCAxMyA1LjgyIDEzIDEzcy01LjgyIDEzLTEzIDEzUzMgMjQuMTggMyAxN3oiLz4KICAgIDxwYXRoIHN0cm9rZT0ibm9uZSIgZmlsbD0iaW5oZXJpdCIgZmlsbC1ydWxlPSJub256ZXJvIiBkPSJNMTIgNGg0djFoLTR6Ii8+CiAgICA8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9ImluaGVyaXQiIHN0cm9rZS1saW5lY2FwPSJzcXVhcmUiIGQ9Ik0xNiAxLjVsLTQgMyA0IDMiLz4KPC9zeW1ib2w+CjxzeW1ib2wgaWQ9ImljLXJvdGF0ZSIgdmlld0JveD0iMCAwIDI0IDI0Ij4KICAgIDxwYXRoIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiIHN0cm9rZT0ibm9uZSIgLz4KICAgIDxwYXRoIGZpbGw9ImluaGVyaXQiIHN0cm9rZT0ibm9uZSIgZD0iTTguMzQ5IDIyLjI1NGExMC4wMDIgMTAuMDAyIDAgMCAxLTIuNzc4LTEuNzE5bC42NS0uNzZhOS4wMDIgOS4wMDIgMCAwIDAgMi40OTUgMS41NDhsLS4zNjcuOTMxem0yLjg3My43MDRsLjA3OC0uOTk3YTkgOSAwIDEgMC0uNTU3LTE3Ljg1MmwtLjE0LS45OUExMC4wNzYgMTAuMDc2IDAgMCAxIDEyLjE0NSAzYzUuNTIzIDAgMTAgNC40NzcgMTAgMTBzLTQuNDc3IDEwLTEwIDEwYy0uMzEyIDAtLjYyLS4wMTQtLjkyNC0uMDQyem0tNy41NTYtNC42NTVhOS45NDIgOS45NDIgMCAwIDEtMS4yNTMtMi45OTZsLjk3My0uMjM0YTguOTQ4IDguOTQ4IDAgMCAwIDEuMTI0IDIuNjkzbC0uODQ0LjUzN3ptLTEuNTAyLTUuOTFBOS45NDkgOS45NDkgMCAwIDEgMi44OCA5LjIzbC45MjUuMzgyYTguOTU0IDguOTU0IDAgMCAwLS42NDQgMi44NDRsLS45OTgtLjA2MnptMi4yMS01LjY4NmMuNjg3LS44NDggMS41MS0xLjU4IDIuNDM2LTIuMTY2bC41MjMuODUyYTkuMDQ4IDkuMDQ4IDAgMCAwLTIuMTg4IDEuOTVsLS43NzEtLjYzNnoiLz4KICAgIDxwYXRoIHN0cm9rZT0iaW5oZXJpdCIgZmlsbD0ibm9uZSIgc3Ryb2tlLWxpbmVjYXA9InNxdWFyZSIgZD0iTTEzIDFsLTIuNSAyLjVMMTMgNiIvPgo8L3N5bWJvbD4KPHN5bWJvbCBpZD0iaWMtc2hhcGUtY2lyY2xlIiB2aWV3Qm94PSIwIDAgMzIgMzIiPgogICAgPGNpcmNsZSBjeD0iMTYiIGN5PSIxNiIgcj0iMTQuNSIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJpbmhlcml0Ii8+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy1zaGFwZS1yZWN0YW5nbGUiIHZpZXdCb3g9IjAgMCAzMiAzMiI+CiAgICA8cmVjdCB3aWR0aD0iMjciIGhlaWdodD0iMjciIHg9IjIuNSIgeT0iMi41IiBmaWxsPSJub25lIiBzdHJva2U9ImluaGVyaXQiIHJ4PSIxIi8+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy1zaGFwZS10cmlhbmdsZSIgdmlld0JveD0iMCAwIDMyIDMyIj4KICAgIDxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgZD0iTTE2IDIuNWwxNS41IDI3SC41eiIvPgo8L3N5bWJvbD4KPHN5bWJvbCBpZD0iaWMtc2hhcGUiIHZpZXdCb3g9IjAgMCAyNCAyNCI+CiAgICA8cGF0aCBzdHJva2U9Im5vbmUiIGZpbGw9ImluaGVyaXQiIGQ9Ik0xNC43MDYgOEgyMWExIDEgMCAwIDEgMSAxdjEyYTEgMSAwIDAgMS0xIDFIOWExIDEgMCAwIDEtMS0xdi00aDF2NGgxMlY5aC01LjcwNmwtLjU4OC0xeiIvPgogICAgPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSJpbmhlcml0IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGQ9Ik04LjUgMS41bDcuNSAxM0gxeiIvPgo8L3N5bWJvbD4KPHN5bWJvbCBpZD0iaWMtdGV4dC1hbGlnbi1jZW50ZXIiIHZpZXdCb3g9IjAgMCAzMiAzMiI+CiAgICA8cGF0aCBzdHJva2U9Im5vbmUiIGZpbGw9Im5vbmUiIGQ9Ik0wIDBoMzJ2MzJIMHoiLz4KICAgIDxwYXRoIHN0cm9rZT0ibm9uZSIgZmlsbD0iaW5oZXJpdCIgZD0iTTIgNWgyOHYxSDJ6TTggMTJoMTZ2MUg4ek0yIDE5aDI4djFIMnpNOCAyNmgxNnYxSDh6Ii8+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy10ZXh0LWFsaWduLWxlZnQiIHZpZXdCb3g9IjAgMCAzMiAzMiI+CiAgICA8cGF0aCBzdHJva2U9Im5vbmUiIGZpbGw9Im5vbmUiIGQ9Ik0wIDBoMzJ2MzJIMHoiLz4KICAgIDxwYXRoIHN0cm9rZT0ibm9uZSIgZmlsbD0iaW5oZXJpdCIgZD0iTTIgNWgyOHYxSDJ6TTIgMTJoMTZ2MUgyek0yIDE5aDI4djFIMnpNMiAyNmgxNnYxSDJ6Ii8+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy10ZXh0LWFsaWduLXJpZ2h0IiB2aWV3Qm94PSIwIDAgMzIgMzIiPgogICAgPHBhdGggc3Ryb2tlPSJub25lIiBmaWxsPSJub25lIiBkPSJNMCAwaDMydjMySDB6Ii8+CiAgICA8cGF0aCBzdHJva2U9Im5vbmUiIGZpbGw9ImluaGVyaXQiIGQ9Ik0yIDVoMjh2MUgyek0xNCAxMmgxNnYxSDE0ek0yIDE5aDI4djFIMnpNMTQgMjZoMTZ2MUgxNHoiLz4KPC9zeW1ib2w+CjxzeW1ib2wgaWQ9ImljLXRleHQtYm9sZCIgdmlld0JveD0iMCAwIDMyIDMyIj4KICAgIDxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0ibm9uZSIgZD0iTTAgMGgzMnYzMkgweiIvPgogICAgPHBhdGggc3Ryb2tlPSJub25lIiBmaWxsPSJpbmhlcml0IiBkPSJNNyAyaDJ2Mkg3ek03IDI4aDJ2Mkg3eiIvPgogICAgPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSJpbmhlcml0IiBzdHJva2Utd2lkdGg9IjIiIGQ9Ik05IDN2MTJoOWE2IDYgMCAxIDAgMC0xMkg5ek05IDE1djE0aDEwYTcgNyAwIDAgMCAwLTE0SDl6Ii8+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy10ZXh0LWl0YWxpYyIgdmlld0JveD0iMCAwIDMyIDMyIj4KICAgIDxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0ibm9uZSIgZD0iTTAgMGgzMnYzMkgweiIvPgogICAgPHBhdGggc3Ryb2tlPSJub25lIiBmaWxsPSJpbmhlcml0IiBkPSJNMTUgMmg1djFoLTV6TTExIDI5aDV2MWgtNXpNMTcgM2gxbC00IDI2aC0xeiIvPgo8L3N5bWJvbD4KPHN5bWJvbCBpZD0iaWMtdGV4dC11bmRlcmxpbmUiIHZpZXdCb3g9IjAgMCAzMiAzMiI+CiAgICA8cGF0aCBzdHJva2U9Im5vbmUiIGZpbGw9Im5vbmUiIGQ9Ik0wIDBoMzJ2MzJIMHoiLz4KICAgIDxwYXRoIHN0cm9rZT0ibm9uZSIgZmlsbD0iaW5oZXJpdCIgZD0iTTggMnYxNGE4IDggMCAxIDAgMTYgMFYyaDF2MTRhOSA5IDAgMCAxLTE4IDBWMmgxek0zIDI5aDI2djFIM3oiLz4KICAgIDxwYXRoIHN0cm9rZT0ibm9uZSIgZmlsbD0iaW5oZXJpdCIgZD0iTTUgMmg1djFINXpNMjIgMmg1djFoLTV6Ii8+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy10ZXh0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPgogICAgPHBhdGggc3Ryb2tlPSJub25lIiBmaWxsPSJpbmhlcml0IiBkPSJNNCAzaDE1YTEgMSAwIDAgMSAxIDFIM2ExIDEgMCAwIDEgMS0xek0zIDRoMXYxSDN6TTE5IDRoMXYxaC0xeiIvPgogICAgPHBhdGggc3Ryb2tlPSJub25lIiBmaWxsPSJpbmhlcml0IiBkPSJNMTEgM2gxdjE4aC0xeiIvPgogICAgPHBhdGggc3Ryb2tlPSJub25lIiBmaWxsPSJpbmhlcml0IiBkPSJNMTAgMjBoM3YxaC0zeiIvPgo8L3N5bWJvbD4KPHN5bWJvbCBpZD0iaWMtdW5kbyIgdmlld0JveD0iMCAwIDI0IDI0Ij4KICAgIDxwYXRoIGQ9Ik0yNCAwSDB2MjRoMjR6IiBvcGFjaXR5PSIuNSIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJub25lIiAvPgogICAgPHBhdGggc3Ryb2tlPSJub25lIiBmaWxsPSJpbmhlcml0IiBkPSJNMyA2aDEyYTYgNiAwIDEgMSAwIDEySDN2MWgxMmE3IDcgMCAwIDAgMC0xNEgzdjF6Ii8+CiAgICA8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9ImluaGVyaXQiIHN0cm9rZS1saW5lY2FwPSJzcXVhcmUiIGQ9Ik01IDNMMi41IDUuNSA1IDgiLz4KPC9zeW1ib2w+CjxzeW1ib2wgaWQ9ImljLXpvb20taW4iIHZpZXdCb3g9IjAgMCAyNCAyNCI+CiAgICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMjI5IC0yOTApIHRyYW5zbGF0ZSgyMjkgMjkwKSI+CiAgICAgICAgPGNpcmNsZSBjeD0iMTAuNSIgY3k9IjEwLjUiIHI9IjkiIHN0cm9rZT0iaW5oZXJpdCIgZmlsbD0ibm9uZSIvPgogICAgICAgIDxwYXRoIGZpbGw9ImluaGVyaXQiIGQ9Ik0xOC44MjggMTUuODI4SDE5LjgyOFYyMi44MjhIMTguODI4eiIgdHJhbnNmb3JtPSJyb3RhdGUoLTQ1IDE5LjMyOCAxOS4zMjgpIi8+CiAgICAgICAgPHBhdGggZmlsbD0iaW5oZXJpdCIgZD0iTTcgMTBIMTRWMTFIN3oiLz4KICAgICAgICA8cGF0aCBmaWxsPSJpbmhlcml0IiBkPSJNMTAgN0gxMVYxNEgxMHoiLz4KICAgIDwvZz4KPC9zeW1ib2w+CjxzeW1ib2wgaWQ9ImljLXpvb20tb3V0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPgogICAgPGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTI2MyAtMjkwKSB0cmFuc2xhdGUoMjYzIDI5MCkiPgogICAgICAgIDxjaXJjbGUgY3g9IjEwLjUiIGN5PSIxMC41IiByPSI5IiBzdHJva2U9ImluaGVyaXQiIGZpbGw9Im5vbmUiLz4KICAgICAgICA8cGF0aCBmaWxsPSJpbmhlcml0IiBkPSJNMTguODI4IDE1LjgyOEgxOS44MjhWMjIuODI4SDE4LjgyOHoiIHRyYW5zZm9ybT0icm90YXRlKC00NSAxOS4zMjggMTkuMzI4KSIvPgogICAgICAgIDxwYXRoIGZpbGw9ImluaGVyaXQiIGQ9Ik03IDEwSDE0VjExSDd6Ii8+CiAgICA8L2c+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy1oYW5kIiB2aWV3Qm94PSIwIDAgMjQgMjQiPgogICAgPGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj4KICAgICAgICA8cGF0aCBmaWxsPSJpbmhlcml0IiBmaWxsLXJ1bGU9Im5vbnplcm8iIGQ9Ik04LjY3MiAzLjM2YzEuMzI4IDAgMi4xMTQuNzggMi4yOSAxLjg2OWwuMDE0LjEwMS4wMjMuMDA2djEuMDQybC0uNjM4LS4xODVjLS4xODctLjA1NS0uMzIzLS4yMTEtLjM1NC0uMzk5TDEwIDUuNzEzYzAtLjgyNS0uNDItMS4zNTMtMS4zMjgtMS4zNTNDNy42OTUgNC4zNiA3IDUuMDQxIDcgNS43MTN2Ny45NDFjMCAuNDM5LS41MjQuNjY1LS44NDMuMzY0bC0xLjg2OC0xLjc2MWMtLjU5NS0uNTI4LTEuMzE2LS42MTctMS45MTgtLjIxNi0uNTIyLjM0OC0uNTYyIDEuMjAzLS4xOCAxLjhMNy43MzggMjJoMTEuMDEzbC4yODUtLjUxOGMxLjI0Ny0yLjMyNiAxLjg5Ny00LjI1OSAxLjk2LTUuNzg1bC4wMDQtLjIzOVY4LjAzNWMwLS42NTYtLjUtMS4xNy0xLTEuMTctLjUwMyAwLTEgLjQ1Ni0xIDEuMTcgMCAuMzMzLS4zMi41NzMtLjY0LjQ4TDE4IDguNDFWNy4zNjhsLjA4Ni4wMjYuMDQyLS4xMzZjLjI3OS0uODA1Ljk3OC0xLjMzMiAxLjczOC0xLjM4OEwyMCA1Ljg2NWMxLjA1NyAwIDIgLjk2NyAyIDIuMTd2Ny40MjNjMCAxLjkyOS0uODQ1IDQuMzUyLTIuNTIxIDcuMjktLjA5LjE1Ni0uMjU1LjI1Mi0uNDM1LjI1Mkg3LjQ3NGMtLjE2NiAwLS4zMjEtLjA4Mi0uNDE0LS4yMTlsLTUuNzA0LTguMzljLS42NTMtMS4wMTktLjU4NC0yLjQ4Ni40Ni0zLjE4MiAxLS42NjYgMi4yMTYtLjUxNiAzLjE0OC4zMUw2IDEyLjQ5NVY1LjcxM2MwLTEuMTggMS4wNTgtMi4yNjMgMi40OS0yLjM0OHoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yOTcgLTI5MCkgdHJhbnNsYXRlKDI5NyAyOTApIi8+CiAgICAgICAgPHBhdGggZmlsbD0iaW5oZXJpdCIgZmlsbC1ydWxlPSJub256ZXJvIiBkPSJNMTIuNSAxLjVjMS4zMjUgMCAyLjQxIDEuMDMyIDIuNDk1IDIuMzM2TDE1IDR2Ny4yMmgtMVY0YzAtLjgyOC0uNjcyLTEuNS0xLjUtMS41LS43OCAwLTEuNDIuNTk1LTEuNDkzIDEuMzU2TDExIDR2Ny4yMmgtMVY0YzAtMS4zOCAxLjEyLTIuNSAyLjUtMi41eiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTI5NyAtMjkwKSB0cmFuc2xhdGUoMjk3IDI5MCkiLz4KICAgICAgICA8cGF0aCBmaWxsPSJpbmhlcml0IiBmaWxsLXJ1bGU9Im5vbnplcm8iIGQ9Ik0xNi41IDMuNWMxLjMyNSAwIDIuNDEgMS4wMzIgMi40OTUgMi4zMzZMMTkgNnY2LjNoLTFWNmMwLS44MjgtLjY3Mi0xLjUtMS41LTEuNS0uNzggMC0xLjQyLjU5NS0xLjQ5MyAxLjM1NkwxNSA2djIuNDRoLTFWNmMwLTEuMzggMS4xMi0yLjUgMi41LTIuNXoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yOTcgLTI5MCkgdHJhbnNsYXRlKDI5NyAyOTApIi8+CiAgICA8L2c+Cjwvc3ltYm9sPgo8L2RlZnM+Cjwvc3ZnPgo="},4858:function(y){"use strict";y.exports=S},4960:function(){},6759:function(){},6272:function(){}},t={};function u(y){var I=t[y];if(I!==void 0)return I.exports;var l=t[y]={exports:{}};return v[y](l,l.exports,u),l.exports}e(u,"__webpack_require__"),function(){u.n=function(y){var I=y&&y.__esModule?function(){return y.default}:function(){return y};return u.d(I,{a:I}),I}}(),function(){u.d=function(y,I){for(var l in I)u.o(I,l)&&!u.o(y,l)&&Object.defineProperty(y,l,{enumerable:!0,get:I[l]})}}(),function(){u.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}()}(),function(){u.o=function(y,I){return Object.prototype.hasOwnProperty.call(y,I)}}();var x={};return function(){"use strict";u.d(x,{default:function(){return xm}});var y=u(9131),I=u.n(y),l=u(1899),c=u.n(l),T=u(6562),P=u.n(T),L=u(1734),N=u.n(L),j=u(8005),b=u.n(j),r=u(6065),m=u.n(r),p=u(4496),i=u.n(p);Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(k){var C=this;do{if(Element.prototype.matches.call(C,k))return C;C=C.parentElement||C.parentNode}while(C!==null&&C.nodeType===1);return null});"document"in self&&((!("classList"in document.createElement("_"))||document.createElementNS&&!("classList"in document.createElementNS("http://www.w3.org/2000/svg","g")))&&function(k){"use strict";if("Element"in k){var C="classList",o="prototype",d=k.Element[o],s=Object,g=I()(String[o])||function(){return this.replace(/^\s+|\s+$/g,"")},M=c()(Array[o])||function(ot){for(var mt=0,ft=this.length;mt<ft;mt++)if(mt in this&&this[mt]===ot)return mt;return-1},O=e(function(mt,ft){this.name=mt,this.code=DOMException[mt],this.message=ft},"DOMEx"),F=e(function(mt,ft){if(ft==="")throw new O("SYNTAX_ERR","The token must not be empty.");if(/\s/.test(ft))throw new O("INVALID_CHARACTER_ERR","The token must not contain space characters.");return M.call(mt,ft)},"checkTokenAndGetIndex"),R=e(function(mt){for(var ft=g.call(mt.getAttribute("class")||""),pt=ft?ft.split(/\s+/):[],Pt=0,Qt=pt.length;Pt<Qt;Pt++)this.push(pt[Pt]);this._updateClassName=function(){mt.setAttribute("class",this.toString())}},"ClassList"),U=R[o]=[],W=e(function(){return new R(this)},"classListGetter");if(O[o]=Error[o],U.item=function(ot){return this[ot]||null},U.contains=function(ot){return~F(this,ot+"")},U.add=function(){var ot=arguments,mt=0,ft=ot.length,pt,Pt=!1;do pt=ot[mt]+"",~F(this,pt)||(this.push(pt),Pt=!0);while(++mt<ft);Pt&&this._updateClassName()},U.remove=function(){var ot=arguments,mt=0,ft=ot.length,pt,Pt=!1,Qt;do for(pt=ot[mt]+"",Qt=F(this,pt);~Qt;){var qt;P()(qt=this).call(qt,Qt,1),Pt=!0,Qt=F(this,pt)}while(++mt<ft);Pt&&this._updateClassName()},U.toggle=function(ot,mt){var ft=this.contains(ot),pt=ft?mt!==!0&&"remove":mt!==!1&&"add";return pt&&this[pt](ot),mt===!0||mt===!1?mt:!ft},U.replace=function(ot,mt){var ft=F(ot+"");if(~ft){var pt;P()(pt=this).call(pt,ft,1,mt),this._updateClassName()}},U.toString=function(){return this.join(" ")},N()){var at={get:W,enumerable:!0,configurable:!0};try{N()(d,C,at)}catch(ot){(ot.number===void 0||ot.number===-2146823252)&&(at.enumerable=!1,N()(d,C,at))}}else s[o].__defineGetter__&&d.__defineGetter__(C,W)}}(self),function(){"use strict";var k=document.createElement("_");if(k.classList.add("c1","c2"),!k.classList.contains("c2")){var C=e(function(s){var g=DOMTokenList.prototype[s];DOMTokenList.prototype[s]=function(M){var O,F=arguments.length;for(O=0;O<F;O++)M=arguments[O],g.call(this,M)}},"createMethod");C("add"),C("remove")}if(k.classList.toggle("c3",!1),k.classList.contains("c3")){var o=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(d,s){return 1 in arguments&&!this.contains(d)==!s?s:o.call(this,d)}}"replace"in document.createElement("_").classList||(DOMTokenList.prototype.replace=function(d,s){var g=this.toString().split(" "),M=c()(g).call(g,d+"");~M&&(g=b()(g).call(g,M),this.remove.apply(this,g),this.add(s),this.add.apply(this,b()(g).call(g,1)))}),k=null}());(function(){"use strict";if(typeof window!="undefined"&&window.addEventListener){var k=m()(null),C,o,d=e(function(){clearTimeout(o),o=i()(C,100)},"debouncedCheck"),s=e(function(){},"unobserveChanges"),g=e(function(){var U;window.addEventListener("resize",d,!1),window.addEventListener("orientationchange",d,!1),window.MutationObserver?(U=new MutationObserver(d),U.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0}),s=e(function(){try{U.disconnect(),window.removeEventListener("resize",d,!1),window.removeEventListener("orientationchange",d,!1)}catch{}},"unobserveChanges")):(document.documentElement.addEventListener("DOMSubtreeModified",d,!1),s=e(function(){document.documentElement.removeEventListener("DOMSubtreeModified",d,!1),window.removeEventListener("resize",d,!1),window.removeEventListener("orientationchange",d,!1)},"unobserveChanges"))},"observeChanges"),M=e(function(U){function W(ft){var pt;return ft.protocol!==void 0?pt=ft:(pt=document.createElement("a"),pt.href=ft),pt.protocol.replace(/:/g,"")+pt.host}e(W,"getOrigin");var at,ot,mt;return window.XMLHttpRequest&&(at=new XMLHttpRequest,ot=W(location),mt=W(U),at.withCredentials===void 0&&mt!==""&&mt!==ot?at=XDomainRequest||void 0:at=XMLHttpRequest),at},"createRequest"),O="http://www.w3.org/1999/xlink";C=e(function(){var U,W,at="",ot,mt,ft,pt=0,Pt,Qt,qt,ee,Ft;function ve(){pt-=1,pt===0&&(s(),g())}e(ve,"observeIfDone");function Be(Le){return function(){k[Le.base]!==!0&&(Le.useEl.setAttributeNS(O,"xlink:href","#"+Le.hash),Le.useEl.hasAttribute("href")&&Le.useEl.setAttribute("href","#"+Le.hash))}}e(Be,"attrUpdateFunc");function ri(Le){return function(){var Fi=document.body,zi=document.createElement("x"),Qe;Le.onload=null,zi.innerHTML=Le.responseText,Qe=zi.getElementsByTagName("svg")[0],Qe&&(Qe.setAttribute("aria-hidden","true"),Qe.style.position="absolute",Qe.style.width=0,Qe.style.height=0,Qe.style.overflow="hidden",Fi.insertBefore(Qe,Fi.firstChild)),ve()}}e(ri,"onloadFunc");function hi(Le){return function(){Le.onerror=null,Le.ontimeout=null,ve()}}for(e(hi,"onErrorTimeout"),s(),ee=document.getElementsByTagName("use"),ft=0;ft<ee.length;ft+=1){try{W=ee[ft].getBoundingClientRect()}catch{W=!1}mt=ee[ft].getAttribute("href")||ee[ft].getAttributeNS(O,"href")||ee[ft].getAttribute("xlink:href"),mt&&mt.split?qt=mt.split("#"):qt=["",""],U=qt[0],ot=qt[1],Pt=W&&W.left===0&&W.right===0&&W.top===0&&W.bottom===0,W&&W.width===0&&W.height===0&&!Pt?(at&&!U.length&&ot&&!document.getElementById(ot)&&(U=at),ee[ft].hasAttribute("href")&&ee[ft].setAttributeNS(O,"xlink:href",mt),U.length&&(Ft=k[U],Ft!==!0&&i()(Be({useEl:ee[ft],base:U,hash:ot}),0),Ft===void 0&&(Qt=M(U),Qt!==void 0&&(Ft=new Qt,k[U]=Ft,Ft.onload=ri(Ft),Ft.onerror=hi(Ft),Ft.ontimeout=hi(Ft),Ft.open("GET",U),Ft.send(),pt+=1)))):Pt?U.length&&k[U]&&i()(Be({useEl:ee[ft],base:U,hash:ot}),0):k[U]===void 0?k[U]=!0:k[U].onload&&(k[U].abort(),delete k[U].onload,k[U]=!0)}ee="",pt+=1,ve()},"checkUseElems");var F;F=e(function(){window.removeEventListener("load",F,!1),o=i()(C,0)},"winLoad"),document.readyState!=="complete"?window.addEventListener("load",F,!1):F()}})();var a=u(1845);function n(k,C){(C==null||C>k.length)&&(C=k.length);for(var o=0,d=new Array(C);o<C;o++)d[o]=k[o];return d}e(n,"_arrayLikeToArray");function f(k){if(a(k))return n(k)}e(f,"_arrayWithoutHoles");var _=u(184),h=u(662),E=u(7172);function w(k){if(typeof _!="undefined"&&h(k)!=null||k["@@iterator"]!=null)return E(k)}e(w,"_iterableToArray");var A=u(711);function D(k,C){var o;if(k){if(typeof k=="string")return n(k,C);var d=A(o=Object.prototype.toString.call(k)).call(o,8,-1);if(d==="Object"&&k.constructor&&(d=k.constructor.name),d==="Map"||d==="Set")return E(k);if(d==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d))return n(k,C)}}e(D,"_unsupportedIterableToArray");function z(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}e(z,"_nonIterableSpread");function B(k){return f(k)||w(k)||D(k)||z()}e(B,"_toConsumableArray");var Y=u(7077);function H(k,C,o){return C in k?Y(k,C,{value:o,enumerable:!0,configurable:!0,writable:!0}):k[C]=o,k}e(H,"_defineProperty");function V(k,C){if(!(k instanceof C))throw new TypeError("Cannot call a class as a function")}e(V,"_classCallCheck");function lt(k,C){for(var o=0;o<C.length;o++){var d=C[o];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Y(k,d.key,d)}}e(lt,"_defineProperties");function rt(k,C,o){return C&<(k.prototype,C),o&<(k,o),k}e(rt,"_createClass");var St=u(4426),q=u.n(St),_t=u(9406),G=u.n(_t),Ut=u(8189),xt=u.n(Ut),Ht=u(3972),it=u.n(Ht),ut=u(2777),tt=u(961),Z=u.n(tt),dt=u(5695),X=u.n(dt),$=u(8592),K=u.n($),Q=u(9052),yt=u.n(Q),vt=u(2560),It=u.n(vt),wt=u(2461),Et=u.n(wt);function ct(k){if(a(k))return k}e(ct,"_arrayWithHoles");function et(k,C){var o=k==null?null:typeof _!="undefined"&&h(k)||k["@@iterator"];if(o!=null){var d=[],s=!0,g=!1,M,O;try{for(o=o.call(k);!(s=(M=o.next()).done)&&(d.push(M.value),!(C&&d.length===C));s=!0);}catch(F){g=!0,O=F}finally{try{!s&&o.return!=null&&o.return()}finally{if(g)throw O}}return d}}e(et,"_iterableToArrayLimit");function nt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}e(nt,"_nonIterableRest");function ht(k,C){return ct(k)||et(k,C)||D(k,C)||nt()}e(ht,"_slicedToArray");var gt=u(6397),bt=u.n(gt),Lt=u(7636),Gt=u.n(Lt),Wt=u(789),Ct=u.n(Wt),Xt=u(4729),Zt=u.n(Xt),ie=u(1610),Ie=u.n(ie),de=u(3053),me=u.n(de),ae,ye=["zoomIn","zoomOut","hand"],Ae=["history","undo","redo","reset"],Fe=["delete","deleteAll"],Ot=G()(ae=[]).call(ae,ye,Ae,Fe),kt={FILTER:"filter",COLOR:"color"},Bt=["rect","circle","triangle"],Yt={CROPZONE:"cropzone"},$t={VINTAGE:"vintage",SEPIA2:"sepia2",REMOVE_COLOR:"removeColor",COLOR_FILTER:"colorFilter",REMOVE_WHITE:"removeWhite",BLEND_COLOR:"blendColor",BLEND:"blend"},jt=Ee("IMAGE_LOADER","CROPPER","FLIP","ROTATION","FREE_DRAWING","LINE","TEXT","ICON","FILTER","SHAPE","ZOOM","RESIZE"),Oe={lockSkewingX:!0,lockSkewingY:!0,bringForward:!0,isRegular:!1},Pe={hasRotatingPoint:!1,hasBorders:!1,lockScalingFlip:!0,lockRotation:!0,lockSkewingX:!0,lockSkewingY:!0},Vt={CLEAR_OBJECTS:"clearObjects",LOAD_IMAGE:"loadImage",FLIP_IMAGE:"flip",ROTATE_IMAGE:"rotate",ADD_OBJECT:"addObject",REMOVE_OBJECT:"removeObject",APPLY_FILTER:"applyFilter",REMOVE_FILTER:"removeFilter",ADD_ICON:"addIcon",CHANGE_ICON_COLOR:"changeIconColor",ADD_SHAPE:"addShape",CHANGE_SHAPE:"changeShape",ADD_TEXT:"addText",CHANGE_TEXT:"changeText",CHANGE_TEXT_STYLE:"changeTextStyle",ADD_IMAGE_OBJECT:"addImageObject",RESIZE_CANVAS_DIMENSION:"resizeCanvasDimension",SET_OBJECT_PROPERTIES:"setObjectProperties",SET_OBJECT_POSITION:"setObjectPosition",CHANGE_SELECTION:"changeSelection",RESIZE_IMAGE:"resize"},Mt={OBJECT_ACTIVATED:"objectActivated",OBJECT_MOVED:"objectMoved",OBJECT_SCALED:"objectScaled",OBJECT_CREATED:"objectCreated",OBJECT_ROTATED:"objectRotated",OBJECT_ADDED:"objectAdded",OBJECT_MODIFIED:"objectModified",TEXT_EDITING:"textEditing",TEXT_CHANGED:"textChanged",ICON_CREATE_RESIZE:"iconCreateResize",ICON_CREATE_END:"iconCreateEnd",ADD_TEXT:"addText",ADD_OBJECT:"addObject",ADD_OBJECT_AFTER:"addObjectAfter",MOUSE_DOWN:"mousedown",MOUSE_UP:"mouseup",MOUSE_MOVE:"mousemove",REDO_STACK_CHANGED:"redoStackChanged",UNDO_STACK_CHANGED:"undoStackChanged",SELECTION_CLEARED:"selectionCleared",SELECTION_CREATED:"selectionCreated",EXECUTE_COMMAND:"executeCommand",AFTER_UNDO:"afterUndo",AFTER_REDO:"afterRedo",ZOOM_CHANGED:"zoomChanged",HAND_STARTED:"handStarted",HAND_STOPPED:"handStopped",KEY_DOWN:"keydown",KEY_UP:"keyup",INPUT_BOX_EDITING_STARTED:"inputBoxEditingStarted",INPUT_BOX_EDITING_STOPPED:"inputBoxEditingStopped",FOCUS:"focus",BLUR:"blur",IMAGE_RESIZED:"imageResized"},xe={COLOR_PICKER_INPUT_BOX:".tui-colorpicker-palette-hex"},ue={LOAD_IMAGE:"Load",LOAD_MASK_IMAGE:"Mask",ADD_MASK_IMAGE:"Mask",ADD_IMAGE_OBJECT:"Mask",CROP:"Crop",RESIZE:"Resize",APPLY_FILTER:"Filter",REMOVE_FILTER:"Filter",CHANGE_SHAPE:"Shape",CHANGE_ICON_COLOR:"Icon",ADD_TEXT:"Text",CHANGE_TEXT_STYLE:"Text",REMOVE_OBJECT:"Delete",CLEAR_OBJECTS:"Delete"},ge=Ee("NORMAL","CROPPER","FREE_DRAWING","LINE_DRAWING","TEXT","SHAPE","ICON","ZOOM","RESIZE"),Ye={TEXT:"text",CROP:"crop",RESIZE:"resize",SHAPE:"shape",ZOOM:"zoom"},We={DEFAULT:"normal",ZOOM:"zoom",HAND:"hand"},we={Z:90,Y:89,C:67,V:86,SHIFT:16,BACKSPACE:8,DEL:46,ARROW_DOWN:40,ARROW_UP:38,SPACE:32,DIGIT_0:48,DIGIT_9:57},ui={SELECTION_STYLE:{borderColor:"red",cornerColor:"green",cornerSize:10,originX:"center",originY:"center",transparentCorners:!1}},be={addedObject:"The object is already added.",flip:"The flipX and flipY setting values are not changed.",invalidDrawingMode:"This operation is not supported in the drawing mode.",invalidParameters:"Invalid parameters.",isLock:"The executing command state is locked.",loadImage:"The background image is empty.",loadingImageFailed:"Invalid image loaded.",noActiveObject:"There is no active object.",noObject:"The object is not in canvas.",redo:"The promise of redo command is reject.",rotation:"The current angle is same the old angle.",undo:"The promise of undo command is reject.",unsupportedOperation:"Unsupported operation.",unsupportedType:"Unsupported object type."},Un={"icon-arrow":"M40 12V0l24 24-24 24V36H0V12h40z","icon-arrow-2":"M49,32 H3 V22 h46 l-18,-18 h12 l23,23 L43,50 h-12 l18,-18 z ","icon-arrow-3":"M43.349998,27 L17.354,53 H1.949999 l25.996,-26 L1.949999,1 h15.404 L43.349998,27 z ","icon-star":"M35,54.557999 l-19.912001,10.468 l3.804,-22.172001 l-16.108,-15.7 l22.26,-3.236 L35,3.746 l9.956,20.172001 l22.26,3.236 l-16.108,15.7 l3.804,22.172001 z ","icon-star-2":"M17,31.212 l-7.194,4.08 l-4.728,-6.83 l-8.234,0.524 l-1.328,-8.226 l-7.644,-3.14 l2.338,-7.992 l-5.54,-6.18 l5.54,-6.176 l-2.338,-7.994 l7.644,-3.138 l1.328,-8.226 l8.234,0.522 l4.728,-6.83 L17,-24.312 l7.194,-4.08 l4.728,6.83 l8.234,-0.522 l1.328,8.226 l7.644,3.14 l-2.338,7.992 l5.54,6.178 l-5.54,6.178 l2.338,7.992 l-7.644,3.14 l-1.328,8.226 l-8.234,-0.524 l-4.728,6.83 z ","icon-polygon":"M3,31 L19,3 h32 l16,28 l-16,28 H19 z ","icon-location":"M24 62C8 45.503 0 32.837 0 24 0 10.745 10.745 0 24 0s24 10.745 24 24c0 8.837-8 21.503-24 38zm0-28c5.523 0 10-4.477 10-10s-4.477-10-10-10-10 4.477-10 10 4.477 10 10 10z","icon-heart":"M49.994999,91.349998 l-6.96,-6.333 C18.324001,62.606995 2.01,47.829002 2.01,29.690998 C2.01,14.912998 13.619999,3.299999 28.401001,3.299999 c8.349,0 16.362,5.859 21.594,12 c5.229,-6.141 13.242001,-12 21.591,-12 c14.778,0 26.390999,11.61 26.390999,26.390999 c0,18.138 -16.314001,32.916 -41.025002,55.374001 l-6.96,6.285 z ","icon-bubble":"M44 48L34 58V48H12C5.373 48 0 42.627 0 36V12C0 5.373 5.373 0 12 0h40c6.627 0 12 5.373 12 12v24c0 6.627-5.373 12-12 12h-8z"},Hn={realTimeEvent:!0,min:-360,max:360,value:0},Wn={min:5,max:30,value:12},Br={realTimeEvent:!0,min:2,max:300,value:3},Yn={realTimeEvent:!0,min:10,max:100,value:50},vi={tintOpacityRange:{realTimeEvent:!0,min:0,max:1,value:.7,useDecimal:!0},removewhiteDistanceRange:{realTimeEvent:!0,min:0,max:1,value:.2,useDecimal:!0},brightnessRange:{realTimeEvent:!0,min:-1,max:1,value:0,useDecimal:!0},noiseRange:{realTimeEvent:!0,min:0,max:1e3,value:100},pixelateRange:{realTimeEvent:!0,min:2,max:20,value:4},colorfilterThresholdRange:{realTimeEvent:!0,min:0,max:1,value:.2,useDecimal:!0},blurFilterRange:{value:.1}},Zi={LEFT:0,TOP:0,WIDTH:.5,HEIGHT:.5},wi={realTimeEvent:!0,min:32,max:4088,value:800},Je=2,Ur="tui-image-editor-",Gn=Math.min,J=Math.max,Dt=!1,Tt=0;function Rt(k){return k.__fe_id||(Tt+=1,k.__fe_id=Tt),k.__fe_id}e(Rt,"stamp");function zt(k){return!se(k==null?void 0:k.__fe_id)}e(zt,"hasStamp");function se(k){return isUndefined(k)||k===null}e(se,"isNil");function Jt(k){return typeof k=="function"}e(Jt,"isFunction");function re(k,C,o){if(C>o){var d=[o,C];C=d[0],o=d[1]}return J(C,Gn(k,o))}e(re,"clamp");function Ee(){for(var k={},C=arguments.length,o=new Array(C),d=0;d<C;d++)o[d]=arguments[d];return K()(o,function(s){k[s]=s}),k}e(Ee,"keyMirror");function Re(k){var C="";return forEach(k,function(o,d){var s;C+=_concatInstanceProperty(s="".concat(d,": ")).call(s,o,";")}),C}e(Re,"makeStyleText");function Ge(k,C){var o={},d=C.length,s=0,g;for(s=0;s<d;s+=1)g=C[s],o[g]=k[g];return o}e(Ge,"getProperties");function Nt(k){return bt()(k,10)}e(Nt,"toInteger");function je(k){return k.replace(/-([a-z])/g,function(C,o){return o.toUpperCase()})}e(je,"toCamelCase");function Ke(){return!!(window.File&&window.FileList&&window.FileReader)}e(Ke,"isSupportFileApi");function Hr(k,C){var o,d,s;if(k.length===4){var g;k=G()(g="".concat(k)).call(g,b()(k).call(k,1,4))}var M=bt()(b()(k).call(k,1,3),16),O=bt()(b()(k).call(k,3,5),16),F=bt()(b()(k).call(k,5,7),16),R=C||1;return G()(o=G()(d=G()(s="rgba(".concat(M,", ")).call(s,O,", ")).call(d,F,", ")).call(o,R,")")}e(Hr,"getRgb");function Xn(){Dt||(Dt=!0,Zt()("image-editor","UA-129999381-1"))}e(Xn,"sendHostName");function Vn(k,C){var o=document.getElementsByTagName("head"),d=ht(o,1),s=d[0],g=document.createElement("link"),M=encodeURIComponent(k);C&&(g.id=C),g.setAttribute("rel","stylesheet"),g.setAttribute("type","text/css"),g.setAttribute("href","data:text/css;charset=UTF-8,".concat(M)),s.appendChild(g)}e(Vn,"styleLoad");function Wr(k){return function(C){return k.querySelector(C)}}e(Wr,"getSelector");function Qh(k){var C=/data:(image\/.+);base64,/,o="",d,s,g;d=k.replace(C,function(O,F){return o=F,""}),d=atob(d);var M=d.length;for(s=new Uint8Array(M),g=0;g<M;g+=1)s[g]=d.charCodeAt(g);return new Blob([s],{type:o})}e(Qh,"base64ToBlob");function qh(k){return Number(k.toFixed(Je))}e(qh,"fixFloatingPoint");function si(k){K()(k,function(C,o){k[o]=null})}e(si,"assignmentForDestroy");function $n(){var k,C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(C.charAt(0)==="."){var d;return G()(d=".".concat(Ur).concat(o)).call(d,b()(C).call(C,1))}return G()(k="".concat(Ur).concat(o)).call(k,C)}e($n,"cls");function tf(k,C){var o=C.originX,d=C.originY,s=k.getPointByOrigin(o,d),g=s.x,M=s.y;k.set({left:g,top:M,originX:o,originY:d}),k.setCoords()}e(tf,"changeOrigin");function ef(k){var C,o={};return Gt()(C=Et()(k)).call(C,function(d){o[k[d]]=d}),o}e(ef,"flipObject");function Ea(k,C){k.customProps=k.customProps||{},Z()(k.customProps,C)}e(Ea,"setCustomProperty");function Yr(k,C){var o={};return It()(C)&&(C=[C]),K()(C,function(d){o[d]=k.customProps[d]}),o}e(Yr,"getCustomProperty");function rf(k){return k.charAt(0).toUpperCase()+b()(k).call(k,1)}e(rf,"capitalizeString");function Zn(k,C){return c()(k).call(k,C)>=0}e(Zn,"includes");function Ml(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Ie()(k,"type")||kt.COLOR}e(Ml,"getFillTypeFromOption");function wa(k){var C=Ct()(k),o=C===void 0?{}:C;return o.source?kt.FILTER:kt.COLOR}e(wa,"getFillTypeFromObject");function Tl(k){return me()(k.get("type"),Bt)>=0}e(Tl,"isShape");function Ma(k){if(Zn(Bt,k))return"Shape";switch(k){case"i-text":return"Text";case"path":case"line":return"Draw";case"activeSelection":return"Group";default:return Al(k)}}e(Ma,"getObjectType");function nf(k){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=C.useAlpha,d=o===void 0?!0:o,s=C.mode,g=$t.VINTAGE,M=$t.REMOVE_COLOR,O=$t.BLEND_COLOR,F=$t.SEPIA2,R=$t.COLOR_FILTER,U=$t.REMOVE_WHITE,W=$t.BLEND,at;switch(k){case g:at=F;break;case M:at=d?R:U;break;case O:at=s==="add"?W:s;break;default:at=k}return Al(at)}e(nf,"getFilterType");function sf(k){var C=Vt.LOAD_IMAGE;return typeof k=="string"?C===k:C===k.name}e(sf,"isSilentCommand");function af(k){var C,o,d=Vt.FLIP_IMAGE,s=Vt.ROTATE_IMAGE,g=Vt.ADD_TEXT,M=Vt.APPLY_FILTER,O=Vt.REMOVE_FILTER,F=Vt.CHANGE_SHAPE,R=Vt.CHANGE_ICON_COLOR,U=Vt.CHANGE_TEXT_STYLE,W=Vt.CLEAR_OBJECTS,at=Vt.ADD_IMAGE_OBJECT,ot=Vt.REMOVE_OBJECT,mt=Vt.RESIZE_IMAGE,ft=k.name,pt=k.args,Pt;switch(ft){case d:Pt={name:ft,detail:pt[1]==="reset"?pt[1]:b()(C=pt[1]).call(C,4)};break;case s:Pt={name:ft,detail:pt[2]};break;case M:Pt={name:ue.APPLY_FILTER,detail:nf(pt[1],pt[2])};break;case O:Pt={name:ue.REMOVE_FILTER,detail:"Remove"};break;case F:Pt={name:ue.CHANGE_SHAPE,detail:"Change"};break;case R:Pt={name:ue.CHANGE_ICON_COLOR,detail:"Change"};break;case U:Pt={name:ue.CHANGE_TEXT_STYLE,detail:"Change"};break;case ot:Pt={name:ue.REMOVE_OBJECT,detail:pt[2]};break;case W:Pt={name:ue.CLEAR_OBJECTS,detail:"All"};break;case at:Pt={name:ue.ADD_IMAGE_OBJECT,detail:"Add"};break;case g:Pt={name:ue.ADD_TEXT};break;case mt:Pt={name:ue.RESIZE,detail:G()(o="".concat(~~pt[1].width,"x")).call(o,~~pt[1].height)};break;default:Pt={name:ft};break}return pt[1]==="mask"&&(Pt={name:ue.LOAD_MASK_IMAGE,detail:"Apply"}),Pt}e(af,"getHistoryTitle");function of(k){return k==="top"?"bottom":k==="left"?"right":k==="right"?"left":"top"}e(of,"getHelpMenuBarPosition");function Al(k){return k.replace(/[a-z]/,function(C){return C.toUpperCase()})}e(Al,"toStartOfCapital");function lf(k){var C=k.left,o=k.top,d=k.width,s=k.height,g=Zi.LEFT,M=Zi.TOP,O=Zi.WIDTH,F=Zi.HEIGHT;return C===g&&o===M&&d===O&&s===F}e(lf,"isEmptyCropzone");var cf=Ee("UN_IMPLEMENTATION","NO_COMPONENT_NAME"),Ol={UN_IMPLEMENTATION:"Should implement a method: ",NO_COMPONENT_NAME:"Should set a component name"},uf={UN_IMPLEMENTATION:e(function(C){return Ol.UN_IMPLEMENTATION+C},"UN_IMPLEMENTATION"),NO_COMPONENT_NAME:e(function(){return Ol.NO_COMPONENT_NAME},"NO_COMPONENT_NAME")},Jn={types:Z()({},cf),create:e(function(C){C=C.toLowerCase();for(var o=uf[C],d=arguments.length,s=new Array(d>1?d-1:0),g=1;g<d;g++)s[g-1]=arguments[g];return o.apply(void 0,s)},"create")},Dl=Jn.create,kl=Jn.types,hf=function(){function k(C,o){V(this,k),this.name=C.name,this.args=o,this.execute=C.execute,this.undo=C.undo,this.executeCallback=C.executeCallback||null,this.undoCallback=C.undoCallback||null,this.undoData={}}return e(k,"Command"),rt(k,[{key:"execute",value:e(function(){throw new Error(Dl(kl.UN_IMPLEMENTATION,"execute"))},"execute")},{key:"undo",value:e(function(){throw new Error(Dl(kl.UN_IMPLEMENTATION,"undo"))},"undo")},{key:"isRedo",get:e(function(){return Et()(this.undoData).length>0},"get")},{key:"setUndoData",value:e(function(o,d,s){return d&&(o=d),s?d||(d=o):(Z()(this.undoData,o),d=null),d},"setUndoData")},{key:"setExecuteCallback",value:e(function(o){return this.executeCallback=o,this},"setExecuteCallback")},{key:"setUndoCallback",value:e(function(o){return this.undoCallback=o,this},"setUndoCallback")}]),k}(),ff=hf,Pl={};function df(k){var C=Pl[k];if(C){for(var o=arguments.length,d=new Array(o>1?o-1:0),s=1;s<o;s++)d[s-1]=arguments[s];return new ff(C,d)}return null}e(df,"command_create");function gf(k){Pl[k.name]=k}e(gf,"register");var Me={create:df,register:gf},Ll=function(){function k(){V(this,k),this._undoStack=[],this._redoStack=[],this._isLocked=!1,this._isSilent=!1}return e(k,"Invoker"),rt(k,[{key:"_invokeExecution",value:e(function(o){var d=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;this.lock();var g=o.args;return g||(g=[]),o.execute.apply(o,B(g)).then(function(M){return d._isSilent||(d.pushUndoStack(o),d.fire(s?Mt.AFTER_REDO:Mt.EXECUTE_COMMAND,o)),d.unlock(),Jt(o.executeCallback)&&o.executeCallback(M),M}).catch(function(M){return d.unlock(),xt().reject(M)})},"_invokeExecution")},{key:"_invokeUndo",value:e(function(o){var d=this;this.lock();var s=o.args;return s||(s=[]),o.undo.apply(o,B(s)).then(function(g){return d.pushRedoStack(o),d.fire(Mt.AFTER_UNDO,o),d.unlock(),Jt(o.undoCallback)&&o.undoCallback(g),g}).catch(function(g){return d.unlock(),xt().reject(g)})},"_invokeUndo")},{key:"_fireRedoStackChanged",value:e(function(){this.fire(Mt.REDO_STACK_CHANGED,this._redoStack.length)},"_fireRedoStackChanged")},{key:"_fireUndoStackChanged",value:e(function(){this.fire(Mt.UNDO_STACK_CHANGED,this._undoStack.length)},"_fireUndoStackChanged")},{key:"lock",value:e(function(){this._isLocked=!0},"lock")},{key:"unlock",value:e(function(){this._isLocked=!1},"unlock")},{key:"executeSilent",value:e(function(){var o=this;this._isSilent=!0;for(var d=arguments.length,s=new Array(d),g=0;g<d;g++)s[g]=arguments[g];return this.execute.apply(this,G()(s).call(s,[this._isSilent])).then(function(){o._isSilent=!1})},"executeSilent")},{key:"execute",value:e(function(){var o=this;if(this._isLocked)return xt().reject(be.isLock);for(var d=arguments.length,s=new Array(d),g=0;g<d;g++)s[g]=arguments[g];var M=s[0];return It()(M)&&(M=Me.create.apply(Me,s)),this._invokeExecution(M).then(function(O){return o.clearRedoStack(),O})},"execute")},{key:"undo",value:e(function(){var o=this._undoStack.pop(),d,s="";if(o&&this._isLocked&&(this.pushUndoStack(o,!0),o=null),o)this.isEmptyUndoStack()&&this._fireUndoStackChanged(),d=this._invokeUndo(o);else{if(s=be.undo,this._isLocked){var g;s=G()(g="".concat(s," Because ")).call(g,be.isLock)}d=xt().reject(s)}return d},"undo")},{key:"redo",value:e(function(){var o=this._redoStack.pop(),d,s="";if(o&&this._isLocked&&(this.pushRedoStack(o,!0),o=null),o)this.isEmptyRedoStack()&&this._fireRedoStackChanged(),d=this._invokeExecution(o,!0);else{if(s=be.redo,this._isLocked){var g;s=G()(g="".concat(s," Because ")).call(g,be.isLock)}d=xt().reject(s)}return d},"redo")},{key:"pushUndoStack",value:e(function(o,d){this._undoStack.push(o),d||this._fireUndoStackChanged()},"pushUndoStack")},{key:"pushRedoStack",value:e(function(o,d){this._redoStack.push(o),d||this._fireRedoStackChanged()},"pushRedoStack")},{key:"isEmptyRedoStack",value:e(function(){return this._redoStack.length===0},"isEmptyRedoStack")},{key:"isEmptyUndoStack",value:e(function(){return this._undoStack.length===0},"isEmptyUndoStack")},{key:"clearUndoStack",value:e(function(){this.isEmptyUndoStack()||(this._undoStack=[],this._fireUndoStackChanged())},"clearUndoStack")},{key:"clearRedoStack",value:e(function(){this.isEmptyRedoStack()||(this._redoStack=[],this._fireRedoStackChanged())},"clearRedoStack")}]),k}();yt().mixin(Ll);var vf=Ll,pf=u(5214),Ni=u.n(pf),mf=e(function(k){var C,o,d,s,g,M,O,F=k.locale,R=k.biImage,U=k.commonStyle,W=k.headerStyle,at=k.loadButtonStyle,ot=k.downloadButtonStyle,mt=k.submenuStyle;return G()(C=G()(o=G()(d=G()(s=G()(g=G()(M=G()(O=` <div class="tui-image-editor-main-container" style="`.concat(U,`"><div class="tui-image-editor-header" style="`)).call(O,W,`"><div class="tui-image-editor-header-logo"><img src="`)).call(M,R,`" /></div><div class="tui-image-editor-header-buttons"><div style="`)).call(g,at,`"> `)).call(s,F.localize("Load"),`<input type="file" class="tui-image-editor-load-btn" /></div><button class="tui-image-editor-download-btn" style="`)).call(d,ot,`"> `)).call(o,F.localize("Download"),`</button></div></div><div class="tui-image-editor-main"><div class="tui-image-editor-submenu"><div class="tui-image-editor-submenu-style" style="`)).call(C,mt,`"></div></div><div class="tui-image-editor-wrap"><div class="tui-image-editor-size-wrap"><div class="tui-image-editor-align-wrap"><div class="tui-image-editor"></div></div></div></div></div></div>`)},"mainContainer"),yf=e(function(k){var C,o,d,s,g,M=k.locale,O=k.biImage,F=k.loadButtonStyle,R=k.downloadButtonStyle,U=k.menuBarPosition;return G()(C=G()(o=G()(d=G()(s=G()(g=` <ul class="tui-image-editor-help-menu `.concat(of(U),`"></ul><div class="tui-image-editor-controls"><div class="tui-image-editor-controls-logo"><img src="`)).call(g,O,`" /></div><ul class="tui-image-editor-menu"></ul><div class="tui-image-editor-controls-buttons"><div style="`)).call(s,F,`"> `)).call(d,M.localize("Load"),`<input type="file" class="tui-image-editor-load-btn" /></div><button class="tui-image-editor-download-btn" style="`)).call(o,R,`"> `)).call(C,M.localize("Download"),`</button></div></div>`)},"controls"),bf=u(899),pi=u.n(bf),Cf=e(function(k){var C,o,d,s,g,M,O,F,R,U,W,at,ot,mt,ft,pt,Pt,Qt,qt,ee,Ft,ve,Be,ri,hi,Le,Fi,zi,Qe,ns=k.subMenuLabelActive,ss=k.subMenuLabelNormal,as=k.subMenuRangeTitle,os=k.submenuPartitionVertical,ls=k.submenuPartitionHorizontal,cs=k.submenuCheckbox,us=k.submenuRangePointer,hs=k.submenuRangeValue,fs=k.submenuColorpickerTitle,ds=k.submenuColorpickerButton,gs=k.submenuRangeBar,vs=k.submenuRangeSubbar,ps=k.submenuDisabledRangePointer,ms=k.submenuDisabledRangeBar,ys=k.submenuDisabledRangeSubbar,bs=k.submenuIconSize,Cs=k.menuIconSize,_s=k.biSize,fi=k.menuIconStyle,Ji=k.submenuIconStyle;return G()(C=G()(o=G()(d=G()(s=G()(g=G()(M=G()(O=G()(F=G()(R=G()(U=G()(W=G()(at=G()(ot=G()(mt=G()(ft=G()(pt=G()(Pt=G()(Qt=G()(qt=G()(ee=G()(Ft=G()(ve=G()(Be=G()(ri=G()(hi=G()(Le=G()(Fi=G()(zi=G()(Qe=` .tie-icon-add-button.icon-bubble .tui-image-editor-button[data-icontype="icon-bubble"] label, .tie-icon-add-button.icon-heart .tui-image-editor-button[data-icontype="icon-heart"] label, .tie-icon-add-button.icon-location .tui-image-editor-button[data-icontype="icon-location"] label, .tie-icon-add-button.icon-polygon .tui-image-editor-button[data-icontype="icon-polygon"] label, .tie-icon-add-button.icon-star .tui-image-editor-button[data-icontype="icon-star"] label, .tie-icon-add-button.icon-star-2 .tui-image-editor-button[data-icontype="icon-star-2"] label, .tie-icon-add-button.icon-arrow-3 .tui-image-editor-button[data-icontype="icon-arrow-3"] label, .tie-icon-add-button.icon-arrow-2 .tui-image-editor-button[data-icontype="icon-arrow-2"] label, .tie-icon-add-button.icon-arrow .tui-image-editor-button[data-icontype="icon-arrow"] label, .tie-icon-add-button.icon-bubble .tui-image-editor-button[data-icontype="icon-bubble"] label, .tie-draw-line-select-button.line .tui-image-editor-button.line label, .tie-draw-line-select-button.free .tui-image-editor-button.free label, .tie-flip-button.flipX .tui-image-editor-button.flipX label, .tie-flip-button.flipY .tui-image-editor-button.flipY label, .tie-flip-button.resetFlip .tui-image-editor-button.resetFlip label, .tie-crop-button .tui-image-editor-button.apply.active label, .tie-crop-preset-button .tui-image-editor-button.preset.active label, .tie-resize-button .tui-image-editor-button.apply.active label, .tie-resize-preset-button .tui-image-editor-button.preset.active label, .tie-shape-button.rect .tui-image-editor-button.rect label, .tie-shape-button.circle .tui-image-editor-button.circle label, .tie-shape-button.triangle .tui-image-editor-button.triangle label, .tie-text-effect-button .tui-image-editor-button.active label, .tie-text-align-button.tie-text-align-left .tui-image-editor-button.left label, .tie-text-align-button.tie-text-align-center .tui-image-editor-button.center label, .tie-text-align-button.tie-text-align-right .tui-image-editor-button.right label, .tie-mask-apply.apply.active .tui-image-editor-button.apply label, .tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-button:hover > label, .tui-image-editor-container .tui-image-editor-checkbox label > span { `.concat(ns,` } .tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-button > label, .tui-image-editor-container .tui-image-editor-range-wrap.tui-image-editor-newline.short label, .tui-image-editor-container .tui-image-editor-range-wrap.tui-image-editor-newline.short label > span { `)).call(Qe,ss,` } .tui-image-editor-container .tui-image-editor-range-wrap label > span { `)).call(zi,as,` } .tui-image-editor-container .tui-image-editor-partition > div { `)).call(Fi,os,` } .tui-image-editor-container.left .tui-image-editor-submenu .tui-image-editor-partition > div, .tui-image-editor-container.right .tui-image-editor-submenu .tui-image-editor-partition > div { `)).call(Le,ls,` } .tui-image-editor-container .tui-image-editor-checkbox label > span:before { `)).call(hi,cs,` } .tui-image-editor-container .tui-image-editor-checkbox label > input:checked + span:before { border: 0; } .tui-image-editor-container .tui-image-editor-virtual-range-pointer { `)).call(ri,us,` } .tui-image-editor-container .tui-image-editor-virtual-range-bar { `)).call(Be,gs,` } .tui-image-editor-container .tui-image-editor-virtual-range-subbar { `)).call(ve,vs,` } .tui-image-editor-container .tui-image-editor-disabled .tui-image-editor-virtual-range-pointer { `)).call(Ft,ps,` } .tui-image-editor-container .tui-image-editor-disabled .tui-image-editor-virtual-range-subbar { `)).call(ee,ys,` } .tui-image-editor-container .tui-image-editor-disabled .tui-image-editor-virtual-range-bar { `)).call(qt,ms,` } .tui-image-editor-container .tui-image-editor-range-value { `)).call(Qt,hs,` } .tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-button .color-picker-value + label { `)).call(Pt,fs,` } .tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-button .color-picker-value { `)).call(pt,ds,` } .tui-image-editor-container .svg_ic-menu { `)).call(ft,Cs,` } .tui-image-editor-container .svg_ic-submenu { `)).call(mt,bs,` } .tui-image-editor-container .tui-image-editor-controls-logo > img, .tui-image-editor-container .tui-image-editor-header-logo > img { `)).call(ot,_s,` } .tui-image-editor-menu use.normal.use-default, .tui-image-editor-help-menu use.normal.use-default { fill-rule: evenodd; fill: `)).call(at,fi.normal.color,`; stroke: `)).call(W,fi.normal.color,`; } .tui-image-editor-menu use.active.use-default, .tui-image-editor-help-menu use.active.use-default { fill-rule: evenodd; fill: `)).call(U,fi.active.color,`; stroke: `)).call(R,fi.active.color,`; } .tui-image-editor-menu use.hover.use-default, .tui-image-editor-help-menu use.hover.use-default { fill-rule: evenodd; fill: `)).call(F,fi.hover.color,`; stroke: `)).call(O,fi.hover.color,`; } .tui-image-editor-menu use.disabled.use-default, .tui-image-editor-help-menu use.disabled.use-default { fill-rule: evenodd; fill: `)).call(M,fi.disabled.color,`; stroke: `)).call(g,fi.disabled.color,`; } .tui-image-editor-submenu use.normal.use-default { fill-rule: evenodd; fill: `)).call(s,Ji.normal.color,`; stroke: `)).call(d,Ji.normal.color,`; } .tui-image-editor-submenu use.active.use-default { fill-rule: evenodd; fill: `)).call(o,Ji.active.color,`; stroke: `)).call(C,Ji.active.color,`; } `)},"style"),_f={"common.bi.image":"https://uicdn.toast.com/toastui/img/tui-image-editor-bi.png","common.bisize.width":"251px","common.bisize.height":"21px","common.backgroundImage":"none","common.backgroundColor":"#1e1e1e","common.border":"0px","header.backgroundImage":"none","header.backgroundColor":"transparent","header.border":"0px","loadButton.backgroundColor":"#fff","loadButton.border":"1px solid #ddd","loadButton.color":"#222","loadButton.fontFamily":"'Noto Sans', sans-serif","loadButton.fontSize":"12px","downloadButton.backgroundColor":"#fdba3b","downloadButton.border":"1px solid #fdba3b","downloadButton.color":"#fff","downloadButton.fontFamily":"'Noto Sans', sans-serif","downloadButton.fontSize":"12px","menu.normalIcon.color":"#8a8a8a","menu.activeIcon.color":"#555555","menu.disabledIcon.color":"#434343","menu.hoverIcon.color":"#e9e9e9","submenu.normalIcon.color":"#8a8a8a","submenu.activeIcon.color":"#e9e9e9","menu.iconSize.width":"24px","menu.iconSize.height":"24px","submenu.iconSize.width":"32px","submenu.iconSize.height":"32px","submenu.backgroundColor":"#1e1e1e","submenu.partition.color":"#3c3c3c","submenu.normalLabel.color":"#8a8a8a","submenu.normalLabel.fontWeight":"lighter","submenu.activeLabel.color":"#fff","submenu.activeLabel.fontWeight":"lighter","checkbox.border":"0px","checkbox.backgroundColor":"#fff","range.pointer.color":"#fff","range.bar.color":"#666","range.subbar.color":"#d1d1d1","range.disabledPointer.color":"#414141","range.disabledBar.color":"#282828","range.disabledSubbar.color":"#414141","range.value.color":"#fff","range.value.fontWeight":"lighter","range.value.fontSize":"11px","range.value.border":"1px solid #353535","range.value.backgroundColor":"#151515","range.title.color":"#fff","range.title.fontWeight":"lighter","colorpicker.button.border":"1px solid #1e1e1e","colorpicker.title.color":"#fff"},xf=u(2534),Sf=function(){function k(C){V(this,k),this.styles=this._changeToObject(Z()({},_f,C)),Vn(this._styleMaker()),this._loadDefaultSvgIcon()}return e(k,"Theme"),rt(k,[{key:"getStyle",value:e(function(o){var d=null,s=o.replace(/\..+$/,""),g=this.styles[o];switch(o){case"common.bi":d=this.styles[o].image;break;case"menu.icon":d={active:this.styles["".concat(s,".activeIcon")],normal:this.styles["".concat(s,".normalIcon")],hover:this.styles["".concat(s,".hoverIcon")],disabled:this.styles["".concat(s,".disabledIcon")]};break;case"submenu.icon":d={active:this.styles["".concat(s,".activeIcon")],normal:this.styles["".concat(s,".normalIcon")]};break;case"submenu.label":d={active:this._makeCssText(this.styles["".concat(s,".activeLabel")]),normal:this._makeCssText(this.styles["".concat(s,".normalLabel")])};break;case"submenu.partition":d={vertical:this._makeCssText(Z()({},g,{borderLeft:"1px solid ".concat(g.color)})),horizontal:this._makeCssText(Z()({},g,{borderBottom:"1px solid ".concat(g.color)}))};break;case"range.disabledPointer":case"range.disabledBar":case"range.disabledSubbar":case"range.pointer":case"range.bar":case"range.subbar":g.backgroundColor=g.color,d=this._makeCssText(g);break;default:d=this._makeCssText(g);break}return d},"getStyle")},{key:"_styleMaker",value:e(function(){var o=this.getStyle("submenu.label"),d=this.getStyle("submenu.partition");return Cf({subMenuLabelActive:o.active,subMenuLabelNormal:o.normal,submenuPartitionVertical:d.vertical,submenuPartitionHorizontal:d.horizontal,biSize:this.getStyle("common.bisize"),subMenuRangeTitle:this.getStyle("range.title"),submenuRangePointer:this.getStyle("range.pointer"),submenuRangeBar:this.getStyle("range.bar"),submenuRangeSubbar:this.getStyle("range.subbar"),submenuDisabledRangePointer:this.getStyle("range.disabledPointer"),submenuDisabledRangeBar:this.getStyle("range.disabledBar"),submenuDisabledRangeSubbar:this.getStyle("range.disabledSubbar"),submenuRangeValue:this.getStyle("range.value"),submenuColorpickerTitle:this.getStyle("colorpicker.title"),submenuColorpickerButton:this.getStyle("colorpicker.button"),submenuCheckbox:this.getStyle("checkbox"),menuIconSize:this.getStyle("menu.iconSize"),submenuIconSize:this.getStyle("submenu.iconSize"),menuIconStyle:this.getStyle("menu.icon"),submenuIconStyle:this.getStyle("submenu.icon")})},"_styleMaker")},{key:"_changeToObject",value:e(function(o){var d={};return K()(o,function(s,g){var M=g.match(/^(.+)\.([a-z]+)$/i),O=ht(M,3),F=O[1],R=O[2];d[F]||(d[F]={}),d[F][R]=s}),d},"_changeToObject")},{key:"_makeCssText",value:e(function(o){var d=this,s=[];return K()(o,function(g,M){var O,F;c()(O=["backgroundImage"]).call(O,M)>-1&&g!=="none"&&(g="url(".concat(g,")")),s.push(G()(F="".concat(d._toUnderScore(M),": ")).call(F,g))}),s.join(";")},"_makeCssText")},{key:"_toUnderScore",value:e(function(o){return o.replace(/([A-Z])/g,function(d,s){return"-".concat(s.toLowerCase())})},"_toUnderScore")},{key:"_loadDefaultSvgIcon",value:e(function(){if(!document.getElementById("tui-image-editor-svg-default-icons")){var o=new DOMParser,d=xf.replace(/data:image\/svg\+xml;base64,/,""),s=o.parseFromString(atob(d),"text/xml");document.body.appendChild(s.documentElement)}},"_loadDefaultSvgIcon")},{key:"_makeIconClassName",value:e(function(o,d){var s=d?this.getStyle("submenu.icon"):this.getStyle("menu.icon"),g=s[o],M=g.path,O=g.name;return M&&O?o:"".concat(o," use-default")},"_makeIconClassName")},{key:"_makeSvgIconPrefix",value:e(function(o,d){var s,g=d?this.getStyle("submenu.icon"):this.getStyle("menu.icon"),M=g[o],O=M.path,F=M.name;return O&&F?G()(s="".concat(O,"#")).call(s,F,"-"):"#"},"_makeSvgIconPrefix")},{key:"_makeSvgItem",value:e(function(o,d,s){var g=this;return pi()(o).call(o,function(M){var O,F,R=g._makeSvgIconPrefix(M,s),U=g._toUnderScore(d),W=g._makeIconClassName(M,s);return G()(O=G()(F='<use xlink:href="'.concat(R,"ic-")).call(F,U,'" class="')).call(O,W,'"/>')}).join("")},"_makeSvgItem")},{key:"makeMenSvgIconSet",value:e(function(o,d){var s,g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return G()(s='<svg class="svg_ic-'.concat(g?"submenu":"menu",'">')).call(s,this._makeSvgItem(o,d,g),"</svg>")},"makeMenSvgIconSet")}]),k}(),If=Sf,Ef=u(9146),At=u.n(Ef),wf=u(6623),Nl=u(4230);function Ta(k,C){return Ta=Nl||e(function(d,s){return d.__proto__=s,d},"_setPrototypeOf"),Ta(k,C)}e(Ta,"_setPrototypeOf");function Ce(k,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function");k.prototype=wf(C&&C.prototype,{constructor:{value:k,writable:!0,configurable:!0}}),C&&Ta(k,C)}e(Ce,"_inherits");var Mf=u(3742);function Kn(k){"@babel/helpers - typeof";return typeof _=="function"&&typeof Mf=="symbol"?Kn=e(function(o){return typeof o},"_typeof"):Kn=e(function(o){return o&&typeof _=="function"&&o.constructor===_&&o!==_.prototype?"symbol":typeof o},"_typeof"),Kn(k)}e(Kn,"_typeof");function he(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}e(he,"_assertThisInitialized");function _e(k,C){if(C&&(Kn(C)==="object"||typeof C=="function"))return C;if(C!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return he(k)}e(_e,"_possibleConstructorReturn");var Rl=u(9856);function Kt(k){return Kt=Nl?Rl:e(function(o){return o.__proto__||Rl(o)},"_getPrototypeOf"),Kt(k)}e(Kt,"_getPrototypeOf");var Tf=u(6092),Gr=u.n(Tf),Af=u(4858),Of=u.n(Af),Df=["#000000","#2a2a2a","#545454","#7e7e7e","#a8a8a8","#d2d2d2","#ffffff","","#ff4040","#ff6518","#ffbb3b","#03bd9e","#00a9ff","#515ce6","#9e5fff","#ff5583"],jl=function(){function k(C,o){var d=o.defaultColor,s=d===void 0?"#7e7e7e":d,g=o.toggleDirection,M=g===void 0?"up":g,O=o.usageStatistics;V(this,k),this.colorpickerElement=C,this.usageStatistics=O,this._show=!1,this._colorpickerElement=C,this._toggleDirection=M,this._makePickerButtonElement(s),this._makePickerLayerElement(C,C.getAttribute("title")),this._color=s,this.picker=Of().create({container:this.pickerElement,preset:Df,color:s,usageStatistics:this.usageStatistics}),this._addEvent()}return e(k,"Colorpicker"),rt(k,[{key:"destroy",value:e(function(){var o=this;this._removeEvent(),this.picker.destroy(),this.colorpickerElement.innerHTML="",K()(this,function(d,s){o[s]=null})},"destroy")},{key:"color",get:e(function(){return this._color},"get"),set:e(function(o){this._color=o,this._changeColorElement(o)},"set")},{key:"_changeColorElement",value:e(function(o){o?(this.colorElement.classList.remove("transparent"),this.colorElement.style.backgroundColor=o):(this.colorElement.style.backgroundColor="#fff",this.colorElement.classList.add("transparent"))},"_changeColorElement")},{key:"_makePickerButtonElement",value:e(function(o){this.colorpickerElement.classList.add("tui-image-editor-button"),this.colorElement=document.createElement("div"),this.colorElement.className="color-picker-value",o?this.colorElement.style.backgroundColor=o:this.colorElement.classList.add("transparent")},"_makePickerButtonElement")},{key:"_makePickerLayerElement",value:e(function(o,d){var s=document.createElement("label"),g=document.createElement("div");this.pickerControl=document.createElement("div"),this.pickerControl.className="color-picker-control",this.pickerElement=document.createElement("div"),this.pickerElement.className="color-picker",s.innerHTML=d,g.className="triangle",this.pickerControl.appendChild(this.pickerElement),this.pickerControl.appendChild(g),o.appendChild(this.pickerControl),o.appendChild(this.colorElement),o.appendChild(s)},"_makePickerLayerElement")},{key:"_addEvent",value:e(function(){var o=this,d;this.picker.on("selectColor",function(s){o._changeColorElement(s.color),o._color=s.color,o.fire("change",s.color)}),this.eventHandler={pickerToggle:q()(d=this._pickerToggleEventHandler).call(d,this),pickerHide:e(function(){return o.hide()},"pickerHide")},this.colorpickerElement.addEventListener("click",this.eventHandler.pickerToggle),document.body.addEventListener("click",this.eventHandler.pickerHide)},"_addEvent")},{key:"_removeEvent",value:e(function(){this.colorpickerElement.removeEventListener("click",this.eventHandler.pickerToggle),document.body.removeEventListener("click",this.eventHandler.pickerHide),this.picker.off()},"_removeEvent")},{key:"_pickerToggleEventHandler",value:e(function(o){var d=o.target,s=d&&this._isElementInColorPickerControl(d);(!s||s&&this._isPaletteButton(d))&&(this._show=!this._show,this.pickerControl.style.display=this._show?"block":"none",this._setPickerControlPosition(),this.fire("changeShow",this)),o.stopPropagation()},"_pickerToggleEventHandler")},{key:"_isPaletteButton",value:e(function(o){return o.className==="tui-colorpicker-palette-button"},"_isPaletteButton")},{key:"_isElementInColorPickerControl",value:e(function(o){for(var d=o;d!==document.body&&d;){if(d===this.pickerControl)return!0;d=d.parentNode}return!1},"_isElementInColorPickerControl")},{key:"hide",value:e(function(){this._show=!1,this.pickerControl.style.display="none"},"hide")},{key:"_setPickerControlPosition",value:e(function(){var o=this.pickerControl.style,d=this._colorpickerElement.clientWidth/2+2,s=this.pickerControl.offsetWidth/2-d,g=(this.pickerControl.offsetHeight+10)*-1;this._toggleDirection==="down"&&(g=30),o.top="".concat(g,"px"),o.left="-".concat(s,"px")},"_setPickerControlPosition")}]),k}();yt().mixin(jl);var Ri=jl,kf=/(-?)([0-9]*)[^0-9]*([0-9]*)/g,Fl=function(){function k(C){var o,d,s,g,M,O,F,R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};V(this,k),this._value=R.value||0,this.rangeElement=C.slider,this.rangeInputElement=C.input,this._drawRangeElement(),this.rangeWidth=this._getRangeWidth(),this._min=R.min||0,this._max=R.max||100,this._useDecimal=R.useDecimal,this._absMax=this._min*-1+this._max,this.realTimeEvent=R.realTimeEvent||!1,this._userInputTimer=null,this.eventHandler={startChangingSlide:q()(o=this._startChangingSlide).call(o,this),stopChangingSlide:q()(d=this._stopChangingSlide).call(d,this),changeSlide:q()(s=this._changeSlide).call(s,this),changeSlideFinally:q()(g=this._changeSlideFinally).call(g,this),changeInput:q()(M=this._changeInput).call(M,this),changeInputFinally:q()(O=this._changeValueWithInput).call(O,this,!0),changeInputWithArrow:q()(F=this._changeValueWithInputKeyEvent).call(F,this)},this._addClickEvent(),this._addDragEvent(),this._addInputEvent(),this.value=R.value,this.trigger("change")}return e(k,"Range"),rt(k,[{key:"destroy",value:e(function(){var o=this;this._removeClickEvent(),this._removeDragEvent(),this._removeInputEvent(),this.rangeElement.innerHTML="",K()(this,function(d,s){o[s]=null})},"destroy")},{key:"max",get:e(function(){return this._max},"get"),set:e(function(o){this._max=o,this._absMax=this._min*-1+this._max,this.value=this._value},"set")},{key:"min",get:e(function(){return this._min},"get"),set:e(function(o){this._min=o,this.max=this._max},"set")},{key:"value",get:e(function(){return this._value},"get"),set:e(function(o){o=this._useDecimal?o:Nt(o);var d=o-this._min,s=d*this.rangeWidth/this._absMax;this.rangeWidth<s&&(s=this.rangeWidth),this.pointer.style.left="".concat(s,"px"),this.subbar.style.right="".concat(this.rangeWidth-s,"px"),this._value=o,this.rangeInputElement&&(this.rangeInputElement.value=o)},"set")},{key:"trigger",value:e(function(o){this.fire(o,this._value)},"trigger")},{key:"_getRangeWidth",value:e(function(){var o=e(function(s){return Nt(window.getComputedStyle(s,null).width)},"getElementWidth");return o(this.rangeElement)-o(this.pointer)},"_getRangeWidth")},{key:"_drawRangeElement",value:e(function(){this.rangeElement.classList.add("tui-image-editor-range"),this.bar=document.createElement("div"),this.bar.className="tui-image-editor-virtual-range-bar",this.subbar=document.createElement("div"),this.subbar.className="tui-image-editor-virtual-range-subbar",this.pointer=document.createElement("div"),this.pointer.className="tui-image-editor-virtual-range-pointer",this.bar.appendChild(this.subbar),this.bar.appendChild(this.pointer),this.rangeElement.appendChild(this.bar)},"_drawRangeElement")},{key:"_addInputEvent",value:e(function(){this.rangeInputElement&&(this.rangeInputElement.addEventListener("keydown",this.eventHandler.changeInputWithArrow),this.rangeInputElement.addEventListener("keydown",this.eventHandler.changeInput),this.rangeInputElement.addEventListener("blur",this.eventHandler.changeInputFinally))},"_addInputEvent")},{key:"_removeInputEvent",value:e(function(){this.rangeInputElement&&(this.rangeInputElement.removeEventListener("keydown",this.eventHandler.changeInputWithArrow),this.rangeInputElement.removeEventListener("keydown",this.eventHandler.changeInput),this.rangeInputElement.removeEventListener("blur",this.eventHandler.changeInputFinally))},"_removeInputEvent")},{key:"_changeValueWithInputKeyEvent",value:e(function(o){var d,s=o.keyCode,g=o.target;if(!(c()(d=[we.ARROW_UP,we.ARROW_DOWN]).call(d,s)<0)){var M=Number(g.value);M=this._valueUpDownForKeyEvent(M,s);var O=M<this._min||M>this._max;if(!O){var F=re(M,this._min,this.max);this.value=F,this.fire("change",F,!1)}}},"_changeValueWithInputKeyEvent")},{key:"_valueUpDownForKeyEvent",value:e(function(o,d){var s=this._useDecimal?.1:1;return d===we.ARROW_UP?o+=s:d===we.ARROW_DOWN&&(o-=s),o},"_valueUpDownForKeyEvent")},{key:"_changeInput",value:e(function(o){var d=this;clearTimeout(this._userInputTimer);var s=o.keyCode;if(s<we.DIGIT_0||s>we.DIGIT_9){o.preventDefault();return}this._userInputTimer=i()(function(){d._inputSetValue(o.target.value)},350)},"_changeInput")},{key:"_inputSetValue",value:e(function(o){var d=this._useDecimal?Number(o):Nt(o);d=re(d,this._min,this.max),this.value=d,this.fire("change",d,!0)},"_inputSetValue")},{key:"_changeValueWithInput",value:e(function(o,d){var s,g=d.keyCode,M=d.target;if(!(c()(s=[we.ARROW_UP,we.ARROW_DOWN]).call(s,g)>=0)){var O=this._filterForInputText(M.value),F=!O||isNaN(O);M.value=O,F||this._inputSetValue(O)}},"_changeValueWithInput")},{key:"_addClickEvent",value:e(function(){this.rangeElement.addEventListener("click",this.eventHandler.changeSlideFinally)},"_addClickEvent")},{key:"_removeClickEvent",value:e(function(){this.rangeElement.removeEventListener("click",this.eventHandler.changeSlideFinally)},"_removeClickEvent")},{key:"_addDragEvent",value:e(function(){this.pointer.addEventListener("mousedown",this.eventHandler.startChangingSlide)},"_addDragEvent")},{key:"_removeDragEvent",value:e(function(){this.pointer.removeEventListener("mousedown",this.eventHandler.startChangingSlide)},"_removeDragEvent")},{key:"_changeSlide",value:e(function(o){var d=o.screenX,s=d-this.firstPosition,g=this.firstLeft+s;g=g>this.rangeWidth?this.rangeWidth:g,g=g<0?0:g,this.pointer.style.left="".concat(g,"px"),this.subbar.style.right="".concat(this.rangeWidth-g,"px");var M=g/this.rangeWidth,O=this._absMax*M+this._min,F=this._useDecimal?O:Nt(O),R=this.value!==F;R&&(this.value=F,this.realTimeEvent&&this.fire("change",this._value,!1))},"_changeSlide")},{key:"_changeSlideFinally",value:e(function(o){if(o.stopPropagation(),o.target.className==="tui-image-editor-range"){var d=o.offsetX,s=d/this.rangeWidth,g=this._absMax*s+this._min;this.pointer.style.left="".concat(s*this.rangeWidth,"px"),this.subbar.style.right="".concat((1-s)*this.rangeWidth,"px"),this.value=g,this.fire("change",g,!0)}},"_changeSlideFinally")},{key:"_startChangingSlide",value:e(function(o){this.firstPosition=o.screenX,this.firstLeft=Nt(this.pointer.style.left)||0,document.addEventListener("mousemove",this.eventHandler.changeSlide),document.addEventListener("mouseup",this.eventHandler.stopChangingSlide)},"_startChangingSlide")},{key:"_stopChangingSlide",value:e(function(){this.fire("change",this._value,!0),document.removeEventListener("mousemove",this.eventHandler.changeSlide),document.removeEventListener("mouseup",this.eventHandler.stopChangingSlide)},"_stopChangingSlide")},{key:"_filterForInputText",value:e(function(o){return o.replace(kf,"$1$2$3")},"_filterForInputText")}]),k}();yt().mixin(Fl);var ai=Fl,zl=function(){function k(C,o){var d=o.locale,s=o.name,g=o.makeSvgIcon,M=o.menuBarPosition,O=o.templateHtml,F=o.usageStatistics;V(this,k),this.subMenuElement=C,this.menuBarPosition=M,this.toggleDirection=M==="top"?"down":"up",this.colorPickerControls=[],this.usageStatistics=F,this.eventHandler={},this._makeSubMenuElement({locale:d,name:s,makeSvgIcon:g,templateHtml:O})}return e(k,"Submenu"),rt(k,[{key:"selector",value:e(function(o){return this.subMenuElement.querySelector(o)},"selector")},{key:"colorPickerChangeShow",value:e(function(o){var d;Gt()(d=this.colorPickerControls).call(d,function(s){o!==s&&s.hide()})},"colorPickerChangeShow")},{key:"getButtonType",value:e(function(o,d){return o.className.match(RegExp("(".concat(d.join("|"),")")))[0]},"getButtonType")},{key:"changeClass",value:e(function(o,d,s){o.classList.remove(d),o.classList.add(s)},"changeClass")},{key:"changeStandbyMode",value:e(function(){},"changeStandbyMode")},{key:"changeStartMode",value:e(function(){},"changeStartMode")},{key:"_makeSubMenuElement",value:e(function(o){var d=o.locale,s=o.name,g=o.iconStyle,M=o.makeSvgIcon,O=o.templateHtml,F=document.createElement("div");F.className="tui-image-editor-menu-".concat(s),F.innerHTML=O({locale:d,iconStyle:g,makeSvgIcon:M}),this.subMenuElement.appendChild(F)},"_makeSubMenuElement")},{key:"_onStartEditingInputBox",value:e(function(){this.fire(Mt.INPUT_BOX_EDITING_STARTED)},"_onStartEditingInputBox")},{key:"_onStopEditingInputBox",value:e(function(){this.fire(Mt.INPUT_BOX_EDITING_STOPPED)},"_onStopEditingInputBox")}]),k}();yt().mixin(zl);var mi=zl,Pf=e(function(k){var C,o,d,s,g,M,O,F,R=k.locale,U=k.makeSvgIcon;return G()(C=G()(o=G()(d=G()(s=G()(g=G()(M=G()(O=G()(F=` <ul class="tui-image-editor-submenu-item"><li class="tie-shape-button"><div class="tui-image-editor-button rect"><div> `.concat(U(["normal","active"],"shape-rectangle",!0),`</div><label>`)).call(F,R.localize("Rectangle"),`</label></div><div class="tui-image-editor-button circle"><div>`)).call(O,U(["normal","active"],"shape-circle",!0),`</div><label>`)).call(M,R.localize("Circle"),`</label></div><div class="tui-image-editor-button triangle"><div>`)).call(g,U(["normal","active"],"shape-triangle",!0),`</div><label>`)).call(s,R.localize("Triangle"),`</label></div></li><li class="tui-image-editor-partition"><div></div></li><li class="tie-shape-color-button"><div class="tie-color-fill" title="`)).call(d,R.localize("Fill"),`"></div><div class="tie-color-stroke" title="`)).call(o,R.localize("Stroke"),`"></div></li><li class="tui-image-editor-partition only-left-right"><div></div></li><li class="tui-image-editor-newline tui-image-editor-range-wrap"><label class="range">`)).call(C,R.localize("Stroke"),`</label><div class="tie-stroke-range"></div><input class="tie-stroke-range-value tui-image-editor-range-value" value="0" /></li></ul>`)},"shape");function Lf(k){var C=Nf();return e(function(){var d=Kt(k),s;if(C){var g=Kt(this).constructor;s=At()(d,arguments,g)}else s=d.apply(this,arguments);return _e(this,s)},"_createSuperInternal")}e(Lf,"_createSuper");function Nf(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch{return!1}}e(Nf,"_isNativeReflectConstruct");var Rf={stroke:"#ffbb3b",fill:"",strokeWidth:3},jf=function(k){Ce(o,k);var C=Lf(o);function o(d,s){var g,M=s.locale,O=s.makeSvgIcon,F=s.menuBarPosition,R=s.usageStatistics;return V(this,o),g=C.call(this,d,{locale:M,name:"shape",makeSvgIcon:O,menuBarPosition:F,templateHtml:Pf,usageStatistics:R}),g.type=null,g.options=Rf,g._els={shapeSelectButton:g.selector(".tie-shape-button"),shapeColorButton:g.selector(".tie-shape-color-button"),strokeRange:new ai({slider:g.selector(".tie-stroke-range"),input:g.selector(".tie-stroke-range-value")},Br),fillColorpicker:new Ri(g.selector(".tie-color-fill"),{defaultColor:"",toggleDirection:g.toggleDirection,usageStatistics:g.usageStatistics}),strokeColorpicker:new Ri(g.selector(".tie-color-stroke"),{defaultColor:"#ffbb3b",toggleDirection:g.toggleDirection,usageStatistics:g.usageStatistics})},g.colorPickerControls.push(g._els.fillColorpicker),g.colorPickerControls.push(g._els.strokeColorpicker),g.colorPickerInputBoxes=[],g.colorPickerInputBoxes.push(g._els.fillColorpicker.colorpickerElement.querySelector(xe.COLOR_PICKER_INPUT_BOX)),g.colorPickerInputBoxes.push(g._els.strokeColorpicker.colorpickerElement.querySelector(xe.COLOR_PICKER_INPUT_BOX)),g}return e(o,"Shape"),rt(o,[{key:"destroy",value:e(function(){this._removeEvent(),this._els.strokeRange.destroy(),this._els.fillColorpicker.destroy(),this._els.strokeColorpicker.destroy(),si(this)},"destroy")},{key:"addEvent",value:e(function(s){var g,M,O,F,R,U,W=this;this.eventHandler.shapeTypeSelected=q()(g=this._changeShapeHandler).call(g,this),this.actions=s,this._els.shapeSelectButton.addEventListener("click",this.eventHandler.shapeTypeSelected),this._els.strokeRange.on("change",q()(M=this._changeStrokeRangeHandler).call(M,this)),this._els.fillColorpicker.on("change",q()(O=this._changeFillColorHandler).call(O,this)),this._els.strokeColorpicker.on("change",q()(F=this._changeStrokeColorHandler).call(F,this)),this._els.fillColorpicker.on("changeShow",q()(R=this.colorPickerChangeShow).call(R,this)),this._els.strokeColorpicker.on("changeShow",q()(U=this.colorPickerChangeShow).call(U,this)),Gr()(this.colorPickerInputBoxes,function(at){var ot,mt;at.addEventListener(Mt.FOCUS,q()(ot=W._onStartEditingInputBox).call(ot,W)),at.addEventListener(Mt.BLUR,q()(mt=W._onStopEditingInputBox).call(mt,W))},this)},"addEvent")},{key:"_removeEvent",value:e(function(){var s=this;this._els.shapeSelectButton.removeEventListener("click",this.eventHandler.shapeTypeSelected),this._els.strokeRange.off(),this._els.fillColorpicker.off(),this._els.strokeColorpicker.off(),Gr()(this.colorPickerInputBoxes,function(g){var M,O;g.removeEventListener(Mt.FOCUS,q()(M=s._onStartEditingInputBox).call(M,s)),g.removeEventListener(Mt.BLUR,q()(O=s._onStopEditingInputBox).call(O,s))},this)},"_removeEvent")},{key:"setShapeStatus",value:e(function(s){var g=s.strokeWidth,M=s.strokeColor,O=s.fillColor;this._els.strokeRange.value=g,this._els.strokeColorpicker.color=M,this._els.fillColorpicker.color=O,this.options.stroke=M,this.options.fill=O,this.options.strokeWidth=g,this.actions.setDrawingShape(this.type,{strokeWidth:g})},"setShapeStatus")},{key:"changeStartMode",value:e(function(){this.actions.stopDrawingMode()},"changeStartMode")},{key:"changeStandbyMode",value:e(function(){this.type=null,this.actions.changeSelectableAll(!0),this._els.shapeSelectButton.classList.remove("circle"),this._els.shapeSelectButton.classList.remove("triangle"),this._els.shapeSelectButton.classList.remove("rect")},"changeStandbyMode")},{key:"setMaxStrokeValue",value:e(function(s){var g=s;g<=0&&(g=Br.max),this._els.strokeRange.max=g},"setMaxStrokeValue")},{key:"setStrokeValue",value:e(function(s){this._els.strokeRange.value=s,this._els.strokeRange.trigger("change")},"setStrokeValue")},{key:"getStrokeValue",value:e(function(){return this._els.strokeRange.value},"getStrokeValue")},{key:"_changeShapeHandler",value:e(function(s){var g=s.target.closest(".tui-image-editor-button");if(g){this.actions.stopDrawingMode(),this.actions.discardSelection();var M=this.getButtonType(g,["circle","triangle","rect"]);if(this.type===M){this.changeStandbyMode();return}this.changeStandbyMode(),this.type=M,s.currentTarget.classList.add(M),this.actions.changeSelectableAll(!1),this.actions.modeChange("shape")}},"_changeShapeHandler")},{key:"_changeStrokeRangeHandler",value:e(function(s,g){this.options.strokeWidth=Nt(s),this.actions.changeShape({strokeWidth:s},!g),this.actions.setDrawingShape(this.type,this.options)},"_changeStrokeRangeHandler")},{key:"_changeFillColorHandler",value:e(function(s){s=s||"transparent",this.options.fill=s,this.actions.changeShape({fill:s})},"_changeFillColorHandler")},{key:"_changeStrokeColorHandler",value:e(function(s){s=s||"transparent",this.options.stroke=s,this.actions.changeShape({stroke:s})},"_changeStrokeColorHandler")}]),o}(mi),Ff=jf,zf=e(function(k){var C,o,d,s,g,M,O,F,R,U,W,at,ot,mt,ft,pt,Pt,Qt=k.locale,qt=k.makeSvgIcon;return G()(C=G()(o=G()(d=G()(s=G()(g=G()(M=G()(O=G()(F=G()(R=G()(U=G()(W=G()(at=G()(ot=G()(mt=G()(ft=G()(pt=G()(Pt=` <ul class="tui-image-editor-submenu-item"><li class="tie-crop-preset-button"><div class="tui-image-editor-button preset preset-none active"><div> `.concat(qt(["normal","active"],"shape-rectangle",!0),`</div><label>`)).call(Pt,Qt.localize("Custom"),`</label></div><div class="tui-image-editor-button preset preset-square"><div>`)).call(pt,qt(["normal","active"],"crop",!0),`</div><label>`)).call(ft,Qt.localize("Square"),`</label></div><div class="tui-image-editor-button preset preset-3-2"><div>`)).call(mt,qt(["normal","active"],"crop",!0),`</div><label>`)).call(ot,Qt.localize("3:2"),`</label></div><div class="tui-image-editor-button preset preset-4-3"><div>`)).call(at,qt(["normal","active"],"crop",!0),`</div><label>`)).call(W,Qt.localize("4:3"),`</label></div><div class="tui-image-editor-button preset preset-5-4"><div>`)).call(U,qt(["normal","active"],"crop",!0),`</div><label>`)).call(R,Qt.localize("5:4"),`</label></div><div class="tui-image-editor-button preset preset-7-5"><div>`)).call(F,qt(["normal","active"],"crop",!0),`</div><label>`)).call(O,Qt.localize("7:5"),`</label></div><div class="tui-image-editor-button preset preset-16-9"><div>`)).call(M,qt(["normal","active"],"crop",!0),`</div><label>`)).call(g,Qt.localize("16:9"),`</label></div></li><li class="tui-image-editor-partition tui-image-editor-newline"></li><li class="tui-image-editor-partition only-left-right"><div></div></li><li class="tie-crop-button action"><div class="tui-image-editor-button apply">`)).call(s,qt(["normal","active"],"apply"),` <label> `)).call(d,Qt.localize("Apply"),`</label></div><div class="tui-image-editor-button cancel">`)).call(o,qt(["normal","active"],"cancel"),` <label> `)).call(C,Qt.localize("Cancel"),`</label></div></li></ul>`)},"crop");function Bf(k){var C=Uf();return e(function(){var d=Kt(k),s;if(C){var g=Kt(this).constructor;s=At()(d,arguments,g)}else s=d.apply(this,arguments);return _e(this,s)},"_createSuperInternal")}e(Bf,"crop_createSuper");function Uf(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch{return!1}}e(Uf,"crop_isNativeReflectConstruct");var Hf=function(k){Ce(o,k);var C=Bf(o);function o(d,s){var g,M=s.locale,O=s.makeSvgIcon,F=s.menuBarPosition,R=s.usageStatistics;return V(this,o),g=C.call(this,d,{locale:M,name:"crop",makeSvgIcon:O,menuBarPosition:F,templateHtml:zf,usageStatistics:R}),g.status="active",g._els={apply:g.selector(".tie-crop-button .apply"),cancel:g.selector(".tie-crop-button .cancel"),preset:g.selector(".tie-crop-preset-button")},g.defaultPresetButton=g._els.preset.querySelector(".preset-none"),g}return e(o,"Crop"),rt(o,[{key:"destroy",value:e(function(){this._removeEvent(),si(this)},"destroy")},{key:"addEvent",value:e(function(s){var g,M,O,F=q()(g=this._applyEventHandler).call(g,this),R=q()(M=this._cancelEventHandler).call(M,this),U=q()(O=this._cropzonePresetEventHandler).call(O,this);this.eventHandler={apply:F,cancel:R,cropzonePreset:U},this.actions=s,this._els.apply.addEventListener("click",F),this._els.cancel.addEventListener("click",R),this._els.preset.addEventListener("click",U)},"addEvent")},{key:"_removeEvent",value:e(function(){this._els.apply.removeEventListener("click",this.eventHandler.apply),this._els.cancel.removeEventListener("click",this.eventHandler.cancel),this._els.preset.removeEventListener("click",this.eventHandler.cropzonePreset)},"_removeEvent")},{key:"_applyEventHandler",value:e(function(){this.actions.crop(),this._els.apply.classList.remove("active")},"_applyEventHandler")},{key:"_cancelEventHandler",value:e(function(){this.actions.cancel(),this._els.apply.classList.remove("active")},"_cancelEventHandler")},{key:"_cropzonePresetEventHandler",value:e(function(s){var g=s.target.closest(".tui-image-editor-button.preset");if(g){var M=g.className.match(/preset-[^\s]+/),O=ht(M,1),F=O[0];this._setPresetButtonActive(g),this.actions.preset(F)}},"_cropzonePresetEventHandler")},{key:"changeStartMode",value:e(function(){this.actions.modeChange("crop")},"changeStartMode")},{key:"changeStandbyMode",value:e(function(){this.actions.stopDrawingMode(),this._setPresetButtonActive()},"changeStandbyMode")},{key:"changeApplyButtonStatus",value:e(function(s){s?this._els.apply.classList.add("active"):this._els.apply.classList.remove("active")},"changeApplyButtonStatus")},{key:"_setPresetButtonActive",value:e(function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.defaultPresetButton;K()(this._els.preset.querySelectorAll(".preset"),function(g){g.classList.remove("active")}),s&&s.classList.add("active")},"_setPresetButtonActive")}]),o}(mi),Wf=Hf,Yf=e(function(k){var C,o,d,s,g,M,O=k.locale,F=k.makeSvgIcon;return G()(C=G()(o=G()(d=G()(s=G()(g=G()(M=` <ul class="tui-image-editor-submenu-item"><li class="tui-image-editor-submenu-align"><div class="tui-image-editor-range-wrap tui-image-editor-newline"><label class="range">`.concat(O.localize("Width"),` </label><div class="tie-width-range"></div><input class="tie-width-range-value tui-image-editor-range-value" value="0" /><label>px</label><div class="tui-image-editor-partition tui-image-editor-newline"></div><label class="range">`)).call(M,O.localize("Height"),`</label><div class="tie-height-range"></div><input class="tie-height-range-value tui-image-editor-range-value" value="0" /><label>px</label></div></li><li class="tui-image-editor-partition tui-image-editor-newline"></li><li class="tui-image-editor-partition only-left-right"><div></div></li><li class="tui-image-editor-submenu-align"><div class="tui-image-editor-checkbox-wrap"><div class="tui-image-editor-checkbox"><label><input type="checkbox" class="tie-lock-aspect-ratio"><span>`)).call(g,O.localize("Lock Aspect Ratio"),`</span></label></div></div></li><li class="tui-image-editor-partition tui-image-editor-newline"></li><li class="tui-image-editor-partition only-left-right"><div></div></li><li class="tui-image-editor-partition tui-image-editor-newline"></li><li class="tie-resize-button action"><div class="tui-image-editor-button apply">`)).call(s,F(["normal","active"],"apply"),` <label> `)).call(d,O.localize("Apply"),`</label></div><div class="tui-image-editor-button cancel">`)).call(o,F(["normal","active"],"cancel"),` <label> `)).call(C,O.localize("Cancel"),`</label></div></li></ul>`)},"resize");function Gf(k){var C=Xf();return e(function(){var d=Kt(k),s;if(C){var g=Kt(this).constructor;s=At()(d,arguments,g)}else s=d.apply(this,arguments);return _e(this,s)},"_createSuperInternal")}e(Gf,"resize_createSuper");function Xf(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch{return!1}}e(Xf,"resize_isNativeReflectConstruct");var Vf=function(k){Ce(o,k);var C=Gf(o);function o(d,s){var g,M=s.locale,O=s.makeSvgIcon,F=s.menuBarPosition,R=s.usageStatistics;return V(this,o),g=C.call(this,d,{locale:M,name:"resize",makeSvgIcon:O,menuBarPosition:F,templateHtml:Yf,usageStatistics:R}),g.status="active",g._lockState=!1,g._originalDimensions=null,g._els={widthRange:new ai({slider:g.selector(".tie-width-range"),input:g.selector(".tie-width-range-value")},wi),heightRange:new ai({slider:g.selector(".tie-height-range"),input:g.selector(".tie-height-range-value")},wi),lockAspectRatio:g.selector(".tie-lock-aspect-ratio"),apply:g.selector(".tie-resize-button .apply"),cancel:g.selector(".tie-resize-button .cancel")},g}return e(o,"Resize"),rt(o,[{key:"changeStartMode",value:e(function(){this.actions.modeChange("resize");var s=this.actions.getCurrentDimensions();this._originalDimensions=s,this.setWidthValue(s.width),this.setHeightValue(s.height)},"changeStartMode")},{key:"changeStandbyMode",value:e(function(){this.actions.stopDrawingMode(),this.actions.reset(!0)},"changeStandbyMode")},{key:"setLimit",value:e(function(s){this._els.widthRange.min=this.calcMinValue(s.minWidth),this._els.heightRange.min=this.calcMinValue(s.minHeight),this._els.widthRange.max=this.calcMaxValue(s.maxWidth),this._els.heightRange.max=this.calcMaxValue(s.maxHeight)},"setLimit")},{key:"calcMaxValue",value:e(function(s){return s<=0&&(s=wi.max),s},"calcMaxValue")},{key:"calcMinValue",value:e(function(s){return s<=0&&(s=wi.min),s},"calcMinValue")},{key:"setWidthValue",value:e(function(s){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;this._els.widthRange.value=s,g&&this._els.widthRange.trigger("change")},"setWidthValue")},{key:"setHeightValue",value:e(function(s){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;this._els.heightRange.value=s,g&&this._els.heightRange.trigger("change")},"setHeightValue")},{key:"destroy",value:e(function(){this._removeEvent(),si(this)},"destroy")},{key:"addEvent",value:e(function(s){var g,M,O,F,R;this._els.widthRange.on("change",q()(g=this._changeWidthRangeHandler).call(g,this)),this._els.heightRange.on("change",q()(M=this._changeHeightRangeHandler).call(M,this)),this._els.lockAspectRatio.addEventListener("change",q()(O=this._changeLockAspectRatio).call(O,this));var U=q()(F=this._applyEventHandler).call(F,this),W=q()(R=this._cancelEventHandler).call(R,this);this.eventHandler={apply:U,cancel:W},this.actions=s,this._els.apply.addEventListener("click",U),this._els.cancel.addEventListener("click",W)},"addEvent")},{key:"_changeWidthRangeHandler",value:e(function(s){this.actions.preview("width",Nt(s),this._lockState)},"_changeWidthRangeHandler")},{key:"_changeHeightRangeHandler",value:e(function(s){this.actions.preview("height",Nt(s),this._lockState)},"_changeHeightRangeHandler")},{key:"_changeLockAspectRatio",value:e(function(s){this._lockState=s.target.checked,this.actions.lockAspectRatio(this._lockState,wi.min,wi.max)},"_changeLockAspectRatio")},{key:"_removeEvent",value:e(function(){this._els.apply.removeEventListener("click",this.eventHandler.apply),this._els.cancel.removeEventListener("click",this.eventHandler.cancel)},"_removeEvent")},{key:"_applyEventHandler",value:e(function(){this.actions.resize(),this._els.apply.classList.remove("active")},"_applyEventHandler")},{key:"_cancelEventHandler",value:e(function(){this.actions.reset(),this._els.cancel.classList.remove("active")},"_cancelEventHandler")},{key:"changeApplyButtonStatus",value:e(function(s){s?this._els.apply.classList.add("active"):this._els.apply.classList.remove("active")},"changeApplyButtonStatus")}]),o}(mi),$f=Vf,Zf=e(function(k){var C,o,d,s,g,M=k.locale,O=k.makeSvgIcon;return G()(C=G()(o=G()(d=G()(s=G()(g=` <ul class="tie-flip-button tui-image-editor-submenu-item"><li><div class="tui-image-editor-button flipX"><div> `.concat(O(["normal","active"],"flip-x",!0),`</div><label>`)).call(g,M.localize("Flip X"),`</label></div><div class="tui-image-editor-button flipY"><div>`)).call(s,O(["normal","active"],"flip-y",!0),`</div><label>`)).call(d,M.localize("Flip Y"),`</label></div></li><li class="tui-image-editor-partition"><div></div></li><li><div class="tui-image-editor-button resetFlip"><div>`)).call(o,O(["normal","active"],"flip-reset",!0),`</div><label>`)).call(C,M.localize("Reset"),`</label></div></li></ul>`)},"flip");function Jf(k){var C=Kf();return e(function(){var d=Kt(k),s;if(C){var g=Kt(this).constructor;s=At()(d,arguments,g)}else s=d.apply(this,arguments);return _e(this,s)},"_createSuperInternal")}e(Jf,"flip_createSuper");function Kf(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch{return!1}}e(Kf,"flip_isNativeReflectConstruct");var Qf=function(k){Ce(o,k);var C=Jf(o);function o(d,s){var g,M=s.locale,O=s.makeSvgIcon,F=s.menuBarPosition,R=s.usageStatistics;return V(this,o),g=C.call(this,d,{locale:M,name:"flip",makeSvgIcon:O,menuBarPosition:F,templateHtml:Zf,usageStatistics:R}),g.flipStatus=!1,g._els={flipButton:g.selector(".tie-flip-button")},g}return e(o,"Flip"),rt(o,[{key:"destroy",value:e(function(){this._removeEvent(),si(this)},"destroy")},{key:"addEvent",value:e(function(s){var g;this.eventHandler.changeFlip=q()(g=this._changeFlip).call(g,this),this._actions=s,this._els.flipButton.addEventListener("click",this.eventHandler.changeFlip)},"addEvent")},{key:"_removeEvent",value:e(function(){this._els.flipButton.removeEventListener("click",this.eventHandler.changeFlip)},"_removeEvent")},{key:"_changeFlip",value:e(function(s){var g=this,M=s.target.closest(".tui-image-editor-button");if(M){var O=this.getButtonType(M,["flipX","flipY","resetFlip"]);if(!this.flipStatus&&O==="resetFlip")return;this._actions.flip(O).then(function(F){var R=g._els.flipButton.classList;g.flipStatus=!1,R.remove("resetFlip"),K()(["flipX","flipY"],function(U){R.remove(U),F[U]&&(R.add(U),R.add("resetFlip"),g.flipStatus=!0)})})}},"_changeFlip")}]),o}(mi),qf=Qf,td=e(function(k){var C,o,d=k.locale,s=k.makeSvgIcon;return G()(C=G()(o=` <ul class="tui-image-editor-submenu-item"><li class="tie-rotate-button"><div class="tui-image-editor-button clockwise"><div> `.concat(s(["normal","active"],"rotate-clockwise",!0),`</div><label> 30 </label></div><div class="tui-image-editor-button counterclockwise"><div>`)).call(o,s(["normal","active"],"rotate-counterclockwise",!0),`</div><label> -30 </label></div></li><li class="tui-image-editor-partition only-left-right"><div></div></li><li class="tui-image-editor-newline tui-image-editor-range-wrap"><label class="range">`)).call(C,d.localize("Range"),`</label><div class="tie-rotate-range"></div><input class="tie-rotate-range-value tui-image-editor-range-value" value="0" /></li></ul>`)},"rotate");function ed(k){var C=id();return e(function(){var d=Kt(k),s;if(C){var g=Kt(this).constructor;s=At()(d,arguments,g)}else s=d.apply(this,arguments);return _e(this,s)},"_createSuperInternal")}e(ed,"rotate_createSuper");function id(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch{return!1}}e(id,"rotate_isNativeReflectConstruct");var rd=30,nd=-30,sd=function(k){Ce(o,k);var C=ed(o);function o(d,s){var g,M=s.locale,O=s.makeSvgIcon,F=s.menuBarPosition,R=s.usageStatistics;return V(this,o),g=C.call(this,d,{locale:M,name:"rotate",makeSvgIcon:O,menuBarPosition:F,templateHtml:td,usageStatistics:R}),g._value=0,g._els={rotateButton:g.selector(".tie-rotate-button"),rotateRange:new ai({slider:g.selector(".tie-rotate-range"),input:g.selector(".tie-rotate-range-value")},Hn)},g}return e(o,"Rotate"),rt(o,[{key:"destroy",value:e(function(){this._removeEvent(),this._els.rotateRange.destroy(),si(this)},"destroy")},{key:"setRangeBarAngle",value:e(function(s,g){var M=g;s==="rotate"&&(M=bt()(this._els.rotateRange.value,10)+g),this._setRangeBarRatio(M)},"setRangeBarAngle")},{key:"_setRangeBarRatio",value:e(function(s){this._els.rotateRange.value=s},"_setRangeBarRatio")},{key:"addEvent",value:e(function(s){var g,M;this.eventHandler.rotationAngleChanged=q()(g=this._changeRotateForButton).call(g,this),this.actions=s,this._els.rotateButton.addEventListener("click",this.eventHandler.rotationAngleChanged),this._els.rotateRange.on("change",q()(M=this._changeRotateForRange).call(M,this))},"addEvent")},{key:"_removeEvent",value:e(function(){this._els.rotateButton.removeEventListener("click",this.eventHandler.rotationAngleChanged),this._els.rotateRange.off()},"_removeEvent")},{key:"_changeRotateForRange",value:e(function(s,g){var M=Nt(s);this.actions.setAngle(M,!g),this._value=M},"_changeRotateForRange")},{key:"_changeRotateForButton",value:e(function(s){var g=s.target.closest(".tui-image-editor-button"),M=this._els.rotateRange.value;if(g){var O=this.getButtonType(g,["counterclockwise","clockwise"]),F={clockwise:rd,counterclockwise:nd}[O],R=bt()(M,10)+F,U=R>=-360&&R<=360;U&&this.actions.rotate(F)}},"_changeRotateForButton")}]),o}(mi),ad=sd,od=e(function(k){var C,o,d,s,g,M,O,F,R,U,W,at,ot,mt=k.locale,ft=k.makeSvgIcon;return G()(C=G()(o=G()(d=G()(s=G()(g=G()(M=G()(O=G()(F=G()(R=G()(U=G()(W=G()(at=G()(ot=` <ul class="tui-image-editor-submenu-item"><li class="tie-text-effect-button"><div class="tui-image-editor-button bold"><div> `.concat(ft(["normal","active"],"text-bold",!0),`</div><label>`)).call(ot,mt.localize("Bold"),`</label></div><div class="tui-image-editor-button italic"><div>`)).call(at,ft(["normal","active"],"text-italic",!0),`</div><label>`)).call(W,mt.localize("Italic"),`</label></div><div class="tui-image-editor-button underline"><div>`)).call(U,ft(["normal","active"],"text-underline",!0),`</div><label>`)).call(R,mt.localize("Underline"),`</label></div></li><li class="tui-image-editor-partition"><div></div></li><li class="tie-text-align-button"><div class="tui-image-editor-button left"><div>`)).call(F,ft(["normal","active"],"text-align-left",!0),`</div><label>`)).call(O,mt.localize("Left"),`</label></div><div class="tui-image-editor-button center"><div>`)).call(M,ft(["normal","active"],"text-align-center",!0),`</div><label>`)).call(g,mt.localize("Center"),`</label></div><div class="tui-image-editor-button right"><div>`)).call(s,ft(["normal","active"],"text-align-right",!0),`</div><label>`)).call(d,mt.localize("Right"),`</label></div></li><li class="tui-image-editor-partition"><div></div></li><li><div class="tie-text-color" title="`)).call(o,mt.localize("Color"),`"></div></li><li class="tui-image-editor-partition only-left-right"><div></div></li><li class="tui-image-editor-newline tui-image-editor-range-wrap"><label class="range">`)).call(C,mt.localize("Text size"),`</label><div class="tie-text-range"></div><input class="tie-text-range-value tui-image-editor-range-value" value="0" /></li></ul>`)},"submenu_text");function ld(k){var C=cd();return e(function(){var d=Kt(k),s;if(C){var g=Kt(this).constructor;s=At()(d,arguments,g)}else s=d.apply(this,arguments);return _e(this,s)},"_createSuperInternal")}e(ld,"text_createSuper");function cd(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch{return!1}}e(cd,"text_isNativeReflectConstruct");var ud=function(k){Ce(o,k);var C=ld(o);function o(d,s){var g,M=s.locale,O=s.makeSvgIcon,F=s.menuBarPosition,R=s.usageStatistics;return V(this,o),g=C.call(this,d,{locale:M,name:"text",makeSvgIcon:O,menuBarPosition:F,templateHtml:od,usageStatistics:R}),g.effect={bold:!1,italic:!1,underline:!1},g.align="tie-text-align-left",g._els={textEffectButton:g.selector(".tie-text-effect-button"),textAlignButton:g.selector(".tie-text-align-button"),textColorpicker:new Ri(g.selector(".tie-text-color"),{defaultColor:"#ffbb3b",toggleDirection:g.toggleDirection,usageStatistics:g.usageStatistics}),textRange:new ai({slider:g.selector(".tie-text-range"),input:g.selector(".tie-text-range-value")},Yn)},g.colorPickerInputBox=g._els.textColorpicker.colorpickerElement.querySelector(xe.COLOR_PICKER_INPUT_BOX),g}return e(o,"Text"),rt(o,[{key:"destroy",value:e(function(){this._removeEvent(),this._els.textColorpicker.destroy(),this._els.textRange.destroy(),si(this)},"destroy")},{key:"addEvent",value:e(function(s){var g,M,O,F,R,U,W=q()(g=this._setTextEffectHandler).call(g,this),at=q()(M=this._setTextAlignHandler).call(M,this);this.eventHandler={setTextEffect:W,setTextAlign:at},this.actions=s,this._els.textEffectButton.addEventListener("click",W),this._els.textAlignButton.addEventListener("click",at),this._els.textRange.on("change",q()(O=this._changeTextRnageHandler).call(O,this)),this._els.textColorpicker.on("change",q()(F=this._changeColorHandler).call(F,this)),this.colorPickerInputBox.addEventListener(Mt.FOCUS,q()(R=this._onStartEditingInputBox).call(R,this)),this.colorPickerInputBox.addEventListener(Mt.BLUR,q()(U=this._onStopEditingInputBox).call(U,this))},"addEvent")},{key:"_removeEvent",value:e(function(){var s,g,M=this.eventHandler,O=M.setTextEffect,F=M.setTextAlign;this._els.textEffectButton.removeEventListener("click",O),this._els.textAlignButton.removeEventListener("click",F),this._els.textRange.off(),this._els.textColorpicker.off(),this.colorPickerInputBox.removeEventListener(Mt.FOCUS,q()(s=this._onStartEditingInputBox).call(s,this)),this.colorPickerInputBox.removeEventListener(Mt.BLUR,q()(g=this._onStopEditingInputBox).call(g,this))},"_removeEvent")},{key:"changeStandbyMode",value:e(function(){this.actions.stopDrawingMode()},"changeStandbyMode")},{key:"changeStartMode",value:e(function(){this.actions.modeChange("text")},"changeStartMode")},{key:"textColor",get:e(function(){return this._els.textColorpicker.color},"get"),set:e(function(s){this._els.textColorpicker.color=s},"set")},{key:"fontSize",get:e(function(){return this._els.textRange.value},"get"),set:e(function(s){this._els.textRange.value=s},"set")},{key:"fontStyle",get:e(function(){return this.effect.italic?"italic":"normal"},"get")},{key:"fontWeight",get:e(function(){return this.effect.bold?"bold":"normal"},"get")},{key:"underline",get:e(function(){return this.effect.underline},"get")},{key:"setTextStyleStateOnAction",value:e(function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},g=Ct()(s),M=s.fontSize,O=s.fontStyle,F=s.fontWeight,R=s.textDecoration,U=s.textAlign;this.textColor=g,this.fontSize=M,this.setEffectState("italic",O),this.setEffectState("bold",F),this.setEffectState("underline",R),this.setAlignState("tie-text-align-".concat(U))},"setTextStyleStateOnAction")},{key:"setEffectState",value:e(function(s,g){var M=g==="italic"||g==="bold"||g==="underline",O=this._els.textEffectButton.querySelector(".tui-image-editor-button.".concat(s));this.effect[s]=M,O.classList[M?"add":"remove"]("active")},"setEffectState")},{key:"setAlignState",value:e(function(s){var g=this._els.textAlignButton;g.classList.remove(this.align),g.classList.add(s),this.align=s},"setAlignState")},{key:"_setTextEffectHandler",value:e(function(s){var g=s.target.closest(".tui-image-editor-button");if(g){var M=g.className.match(/(bold|italic|underline)/),O=ht(M,1),F=O[0],R={bold:{fontWeight:"bold"},italic:{fontStyle:"italic"},underline:{textDecoration:"underline"}}[F];this.effect[F]=!this.effect[F],g.classList.toggle("active"),this.actions.changeTextStyle(R)}},"_setTextEffectHandler")},{key:"_setTextAlignHandler",value:e(function(s){var g=s.target.closest(".tui-image-editor-button");if(g){var M=this.getButtonType(g,["left","center","right"]),O="tie-text-align-".concat(M);s.currentTarget.classList.remove(this.align),this.align!==O&&s.currentTarget.classList.add(O),this.actions.changeTextStyle({textAlign:M}),this.align=O}},"_setTextAlignHandler")},{key:"_changeTextRnageHandler",value:e(function(s,g){this.actions.changeTextStyle({fontSize:s},!g)},"_changeTextRnageHandler")},{key:"_changeColorHandler",value:e(function(s){s=s||"transparent",this.actions.changeTextStyle({fill:s})},"_changeColorHandler")}]),o}(mi),hd=ud,fd=e(function(k){var C,o,d,s=k.locale,g=k.makeSvgIcon;return G()(C=G()(o=G()(d=` <ul class="tui-image-editor-submenu-item"><li><div class="tui-image-editor-button"><div><input type="file" accept="image/*" class="tie-mask-image-file"> `.concat(g(["normal","active"],"mask-load",!0),`</div><label>`)).call(d,s.localize("Load Mask Image"),`</label></div></li><li class="tui-image-editor-partition only-left-right"><div></div></li><li class="tie-mask-apply tui-image-editor-newline apply" style="margin-top: 22px;margin-bottom: 5px"><div class="tui-image-editor-button apply">`)).call(o,g(["normal","active"],"apply"),` <label> `)).call(C,s.localize("Apply"),`</label></div></li></ul>`)},"mask");function dd(k){var C=gd();return e(function(){var d=Kt(k),s;if(C){var g=Kt(this).constructor;s=At()(d,arguments,g)}else s=d.apply(this,arguments);return _e(this,s)},"_createSuperInternal")}e(dd,"mask_createSuper");function gd(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch{return!1}}e(gd,"mask_isNativeReflectConstruct");var vd=function(k){Ce(o,k);var C=dd(o);function o(d,s){var g,M=s.locale,O=s.makeSvgIcon,F=s.menuBarPosition,R=s.usageStatistics;return V(this,o),g=C.call(this,d,{locale:M,name:"mask",makeSvgIcon:O,menuBarPosition:F,templateHtml:fd,usageStatistics:R}),g._els={applyButton:g.selector(".tie-mask-apply"),maskImageButton:g.selector(".tie-mask-image-file")},g}return e(o,"Mask"),rt(o,[{key:"destroy",value:e(function(){this._removeEvent(),si(this)},"destroy")},{key:"addEvent",value:e(function(s){var g,M,O=q()(g=this._loadMaskFile).call(g,this),F=q()(M=this._applyMask).call(M,this);this.eventHandler={loadMaskFile:O,applyMask:F},this.actions=s,this._els.maskImageButton.addEventListener("change",O),this._els.applyButton.addEventListener("click",F)},"addEvent")},{key:"_removeEvent",value:e(function(){this._els.maskImageButton.removeEventListener("change",this.eventHandler.loadMaskFile),this._els.applyButton.removeEventListener("click",this.eventHandler.applyMask)},"_removeEvent")},{key:"_applyMask",value:e(function(){this.actions.applyFilter(),this._els.applyButton.classList.remove("active")},"_applyMask")},{key:"_loadMaskFile",value:e(function(s){var g;Ke()||alert("This browser does not support file-api");var M=ht(s.target.files,1),O=M[0];O&&(g=it().createObjectURL(O),this.actions.loadImageFromURL(g,O),this._els.applyButton.classList.add("active"))},"_loadMaskFile")}]),o}(mi),pd=vd,md=e(function(k){var C,o,d,s,g,M,O,F,R,U,W,at,ot,mt,ft,pt,Pt,Qt,qt,ee,Ft=k.locale,ve=k.makeSvgIcon;return G()(C=G()(o=G()(d=G()(s=G()(g=G()(M=G()(O=G()(F=G()(R=G()(U=G()(W=G()(at=G()(ot=G()(mt=G()(ft=G()(pt=G()(Pt=G()(Qt=G()(qt=G()(ee=` <ul class="tui-image-editor-submenu-item"><li class="tie-icon-add-button"><div class="tui-image-editor-button" data-icontype="icon-arrow"><div> `.concat(ve(["normal","active"],"icon-arrow",!0),`</div><label>`)).call(ee,Ft.localize("Arrow"),`</label></div><div class="tui-image-editor-button" data-icontype="icon-arrow-2"><div>`)).call(qt,ve(["normal","active"],"icon-arrow-2",!0),`</div><label>`)).call(Qt,Ft.localize("Arrow-2"),`</label></div><div class="tui-image-editor-button" data-icontype="icon-arrow-3"><div>`)).call(Pt,ve(["normal","active"],"icon-arrow-3",!0),`</div><label>`)).call(pt,Ft.localize("Arrow-3"),`</label></div><div class="tui-image-editor-button" data-icontype="icon-star"><div>`)).call(ft,ve(["normal","active"],"icon-star",!0),`</div><label>`)).call(mt,Ft.localize("Star-1"),`</label></div><div class="tui-image-editor-button" data-icontype="icon-star-2"><div>`)).call(ot,ve(["normal","active"],"icon-star-2",!0),`</div><label>`)).call(at,Ft.localize("Star-2"),`</label></div><div class="tui-image-editor-button" data-icontype="icon-polygon"><div>`)).call(W,ve(["normal","active"],"icon-polygon",!0),`</div><label>`)).call(U,Ft.localize("Polygon"),`</label></div><div class="tui-image-editor-button" data-icontype="icon-location"><div>`)).call(R,ve(["normal","active"],"icon-location",!0),`</div><label>`)).call(F,Ft.localize("Location"),`</label></div><div class="tui-image-editor-button" data-icontype="icon-heart"><div>`)).call(O,ve(["normal","active"],"icon-heart",!0),`</div><label>`)).call(M,Ft.localize("Heart"),`</label></div><div class="tui-image-editor-button" data-icontype="icon-bubble"><div>`)).call(g,ve(["normal","active"],"icon-bubble",!0),`</div><label>`)).call(s,Ft.localize("Bubble"),`</label></div></li><li class="tui-image-editor-partition"><div></div></li><li class="tie-icon-add-button"><div class="tui-image-editor-button" style="margin:0"><div><input type="file" accept="image/*" class="tie-icon-image-file">`)).call(d,ve(["normal","active"],"icon-load",!0),`</div><label>`)).call(o,Ft.localize("Custom icon"),`</label></div></li><li class="tui-image-editor-partition"><div></div></li><li><div class="tie-icon-color" title="`)).call(C,Ft.localize("Color"),`"></div></li></ul>`)},"icon");function yd(k){var C=bd();return e(function(){var d=Kt(k),s;if(C){var g=Kt(this).constructor;s=At()(d,arguments,g)}else s=d.apply(this,arguments);return _e(this,s)},"_createSuperInternal")}e(yd,"icon_createSuper");function bd(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch{return!1}}e(bd,"icon_isNativeReflectConstruct");var Cd=function(k){Ce(o,k);var C=yd(o);function o(d,s){var g,M=s.locale,O=s.makeSvgIcon,F=s.menuBarPosition,R=s.usageStatistics;return V(this,o),g=C.call(this,d,{locale:M,name:"icon",makeSvgIcon:O,menuBarPosition:F,templateHtml:md,usageStatistics:R}),g.iconType=null,g._iconMap={},g._els={registerIconButton:g.selector(".tie-icon-image-file"),addIconButton:g.selector(".tie-icon-add-button"),iconColorpicker:new Ri(g.selector(".tie-icon-color"),{defaultColor:"#ffbb3b",toggleDirection:g.toggleDirection,usageStatistics:g.usageStatistics})},g.colorPickerInputBox=g._els.iconColorpicker.colorpickerElement.querySelector(xe.COLOR_PICKER_INPUT_BOX),g}return e(o,"Icon"),rt(o,[{key:"destroy",value:e(function(){this._removeEvent(),this._els.iconColorpicker.destroy(),si(this)},"destroy")},{key:"addEvent",value:e(function(s){var g,M,O,F,R,U=q()(g=this._registerIconHandler).call(g,this),W=q()(M=this._addIconHandler).call(M,this);this.eventHandler={registerIcon:U,addIcon:W},this.actions=s,this._els.iconColorpicker.on("change",q()(O=this._changeColorHandler).call(O,this)),this._els.registerIconButton.addEventListener("change",U),this._els.addIconButton.addEventListener("click",W),this.colorPickerInputBox.addEventListener(Mt.FOCUS,q()(F=this._onStartEditingInputBox).call(F,this)),this.colorPickerInputBox.addEventListener(Mt.BLUR,q()(R=this._onStopEditingInputBox).call(R,this))},"addEvent")},{key:"_removeEvent",value:e(function(){var s,g;this._els.iconColorpicker.off(),this._els.registerIconButton.removeEventListener("change",this.eventHandler.registerIcon),this._els.addIconButton.removeEventListener("click",this.eventHandler.addIcon),this.colorPickerInputBox.removeEventListener(Mt.FOCUS,q()(s=this._onStartEditingInputBox).call(s,this)),this.colorPickerInputBox.removeEventListener(Mt.BLUR,q()(g=this._onStopEditingInputBox).call(g,this))},"_removeEvent")},{key:"clearIconType",value:e(function(){this._els.addIconButton.classList.remove(this.iconType),this.iconType=null},"clearIconType")},{key:"registerDefaultIcon",value:e(function(){var s=this;K()(Un,function(g,M){s.actions.registerDefaultIcons(M,g)})},"registerDefaultIcon")},{key:"setIconPickerColor",value:e(function(s){this._els.iconColorpicker.color=s},"setIconPickerColor")},{key:"changeStandbyMode",value:e(function(){this.clearIconType(),this.actions.cancelAddIcon()},"changeStandbyMode")},{key:"_changeColorHandler",value:e(function(s){s=s||"transparent",this.actions.changeColor(s)},"_changeColorHandler")},{key:"_addIconHandler",value:e(function(s){var g=s.target.closest(".tui-image-editor-button");if(g){var M=g.getAttribute("data-icontype"),O=this._els.iconColorpicker.color;this.actions.discardSelection(),this.actions.changeSelectableAll(!1),this._els.addIconButton.classList.remove(this.iconType),this._els.addIconButton.classList.add(M),this.iconType===M?this.changeStandbyMode():(this.actions.addIcon(M,O),this.iconType=M)}},"_addIconHandler")},{key:"_registerIconHandler",value:e(function(s){var g;Ke||alert("This browser does not support file-api");var M=ht(s.target.files,1),O=M[0];O&&(g=it().createObjectURL(O),this.actions.registerCustomIcon(g,O))},"_registerIconHandler")}]),o}(mi),_d=Cd,xd=e(function(k){var C,o,d,s,g,M=k.locale,O=k.makeSvgIcon;return G()(C=G()(o=G()(d=G()(s=G()(g=` <ul class="tui-image-editor-submenu-item"><li class="tie-draw-line-select-button"><div class="tui-image-editor-button free"><div> `.concat(O(["normal","active"],"draw-free",!0),`</div><label>`)).call(g,M.localize("Free"),`</label></div><div class="tui-image-editor-button line"><div>`)).call(s,O(["normal","active"],"draw-line",!0),`</div><label>`)).call(d,M.localize("Straight"),`</label></div></li><li class="tui-image-editor-partition"><div></div></li><li><div class="tie-draw-color" title="`)).call(o,M.localize("Color"),`"></div></li><li class="tui-image-editor-partition only-left-right"><div></div></li><li class="tui-image-editor-newline tui-image-editor-range-wrap"><label class="range">`)).call(C,M.localize("Range"),`</label><div class="tie-draw-range"></div><input class="tie-draw-range-value tui-image-editor-range-value" value="0" /></li></ul>`)},"draw");function Sd(k){var C=Id();return e(function(){var d=Kt(k),s;if(C){var g=Kt(this).constructor;s=At()(d,arguments,g)}else s=d.apply(this,arguments);return _e(this,s)},"_createSuperInternal")}e(Sd,"draw_createSuper");function Id(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch{return!1}}e(Id,"draw_isNativeReflectConstruct");var Ed=.7,wd=function(k){Ce(o,k);var C=Sd(o);function o(d,s){var g,M=s.locale,O=s.makeSvgIcon,F=s.menuBarPosition,R=s.usageStatistics;return V(this,o),g=C.call(this,d,{locale:M,name:"draw",makeSvgIcon:O,menuBarPosition:F,templateHtml:xd,usageStatistics:R}),g._els={lineSelectButton:g.selector(".tie-draw-line-select-button"),drawColorPicker:new Ri(g.selector(".tie-draw-color"),{defaultColor:"#00a9ff",toggleDirection:g.toggleDirection,usageStatistics:g.usageStatistics}),drawRange:new ai({slider:g.selector(".tie-draw-range"),input:g.selector(".tie-draw-range-value")},Wn)},g.type=null,g.color=g._els.drawColorPicker.color,g.width=g._els.drawRange.value,g.colorPickerInputBox=g._els.drawColorPicker.colorpickerElement.querySelector(xe.COLOR_PICKER_INPUT_BOX),g}return e(o,"Draw"),rt(o,[{key:"destroy",value:e(function(){this._removeEvent(),this._els.drawColorPicker.destroy(),this._els.drawRange.destroy(),si(this)},"destroy")},{key:"addEvent",value:e(function(s){var g,M,O,F,R;this.eventHandler.changeDrawType=q()(g=this._changeDrawType).call(g,this),this.actions=s,this._els.lineSelectButton.addEventListener("click",this.eventHandler.changeDrawType),this._els.drawColorPicker.on("change",q()(M=this._changeDrawColor).call(M,this)),this._els.drawRange.on("change",q()(O=this._changeDrawRange).call(O,this)),this.colorPickerInputBox.addEventListener(Mt.FOCUS,q()(F=this._onStartEditingInputBox).call(F,this)),this.colorPickerInputBox.addEventListener(Mt.BLUR,q()(R=this._onStopEditingInputBox).call(R,this))},"addEvent")},{key:"_removeEvent",value:e(function(){var s,g;this._els.lineSelectButton.removeEventListener("click",this.eventHandler.changeDrawType),this._els.drawColorPicker.off(),this._els.drawRange.off(),this.colorPickerInputBox.removeEventListener(Mt.FOCUS,q()(s=this._onStartEditingInputBox).call(s,this)),this.colorPickerInputBox.removeEventListener(Mt.BLUR,q()(g=this._onStopEditingInputBox).call(g,this))},"_removeEvent")},{key:"setDrawMode",value:e(function(){this.actions.setDrawMode(this.type,{width:this.width,color:Hr(this.color,Ed)})},"setDrawMode")},{key:"changeStandbyMode",value:e(function(){this.type=null,this.actions.stopDrawingMode(),this.actions.changeSelectableAll(!0),this._els.lineSelectButton.classList.remove("free"),this._els.lineSelectButton.classList.remove("line")},"changeStandbyMode")},{key:"changeStartMode",value:e(function(){this.type="free",this._els.lineSelectButton.classList.add("free"),this.setDrawMode()},"changeStartMode")},{key:"_changeDrawType",value:e(function(s){var g=s.target.closest(".tui-image-editor-button");if(g){var M=this.getButtonType(g,["free","line"]);if(this.actions.discardSelection(),this.type===M){this.changeStandbyMode();return}this.changeStandbyMode(),this.type=M,this._els.lineSelectButton.classList.add(M),this.setDrawMode()}},"_changeDrawType")},{key:"_changeDrawColor",value:e(function(s){this.color=s||"transparent",this.type?this.setDrawMode():this.changeStartMode()},"_changeDrawColor")},{key:"_changeDrawRange",value:e(function(s){this.width=s,this.type?this.setDrawMode():this.changeStartMode()},"_changeDrawRange")}]),o}(mi),Md=wd,Td=u(9886),Bl=u.n(Td),Ad=e(function(k){var C,o,d,s,g,M,O,F,R,U,W,at,ot,mt,ft,pt,Pt=k.locale;return G()(C=G()(o=G()(d=G()(s=G()(g=G()(M=G()(O=G()(F=G()(R=G()(U=G()(W=G()(at=G()(ot=G()(mt=G()(ft=G()(pt=` <ul class="tui-image-editor-submenu-item"><li class="tui-image-editor-submenu-align"><div class="tui-image-editor-checkbox-wrap fixed-width"><div class="tui-image-editor-checkbox"><label><input type="checkbox" class="tie-grayscale"><span>`.concat(Pt.localize("Grayscale"),`</span></label></div><div class="tui-image-editor-checkbox"><label><input type="checkbox" class="tie-invert"><span>`)).call(pt,Pt.localize("Invert"),`</span></label></div><div class="tui-image-editor-checkbox"><label><input type="checkbox" class="tie-sepia"><span>`)).call(ft,Pt.localize("Sepia"),`</span></label></div><div class="tui-image-editor-checkbox"><label><input type="checkbox" class="tie-vintage"><span>`)).call(mt,Pt.localize("Sepia2"),`</span></label></div><div class="tui-image-editor-checkbox"><label><input type="checkbox" class="tie-blur"><span>`)).call(ot,Pt.localize("Blur"),`</span></label></div><div class="tui-image-editor-checkbox"><label><input type="checkbox" class="tie-sharpen"><span>`)).call(at,Pt.localize("Sharpen"),`</span></label></div><div class="tui-image-editor-checkbox"><label><input type="checkbox" class="tie-emboss"><span>`)).call(W,Pt.localize("Emboss"),`</span></label></div></div></li><li class="tui-image-editor-partition"><div></div></li><li class="tui-image-editor-submenu-align"><div class="tui-image-editor-checkbox-group tui-image-editor-disabled" style="margin-bottom: 7px;"><div class="tui-image-editor-checkbox-wrap"><div class="tui-image-editor-checkbox"><label><input type="checkbox" class="tie-remove-white"><span>`)).call(U,Pt.localize("Remove White"),`</span></label></div></div><div class="tui-image-editor-newline tui-image-editor-range-wrap short"><label>`)).call(R,Pt.localize("Distance"),`</label><div class="tie-removewhite-distance-range"></div></div></div><div class="tui-image-editor-checkbox-group tui-image-editor-disabled"><div class="tui-image-editor-checkbox"><label><input type="checkbox" class="tie-brightness"><span>`)).call(F,Pt.localize("Brightness"),`</span></label></div><div class="tui-image-editor-range-wrap short"><div class="tie-brightness-range"></div></div></div><div class="tui-image-editor-checkbox-group tui-image-editor-disabled"><div class="tui-image-editor-checkbox"><label><input type="checkbox" class="tie-noise"><span>`)).call(O,Pt.localize("Noise"),`</span></label></div><div class="tui-image-editor-range-wrap short"><div class="tie-noise-range"></div></div></div></li><li class="tui-image-editor-partition only-left-right"><div></div></li><li class="tui-image-editor-submenu-align"><div class="tui-image-editor-checkbox-group tui-image-editor-disabled"><div class="tui-image-editor-checkbox"><label><input type="checkbox" class="tie-pixelate"><span>`)).call(M,Pt.localize("Pixelate"),`</span></label></div><div class="tui-image-editor-range-wrap short"><div class="tie-pixelate-range"></div></div></div><div class="tui-image-editor-checkbox-group tui-image-editor-disabled"><div class="tui-image-editor-newline tui-image-editor-checkbox-wrap"><div class="tui-image-editor-checkbox"><label><input type="checkbox" class="tie-color-filter"><span>`)).call(g,Pt.localize("Color Filter"),`</span></label></div></div><div class="tui-image-editor-newline tui-image-editor-range-wrap short"><label>`)).call(s,Pt.localize("Threshold"),`</label><div class="tie-colorfilter-threshold-range"></div></div></div></li><li class="tui-image-editor-partition"><div></div></li><li><div class="filter-color-item"><div class="tie-filter-tint-color" title="`)).call(d,Pt.localize("Tint"),`"></div><div class="tui-image-editor-checkbox"><label><input type="checkbox" class="tie-tint"><span></span></label></div></div><div class="filter-color-item"><div class="tie-filter-multiply-color" title="`)).call(o,Pt.localize("Multiply"),`"></div><div class="tui-image-editor-checkbox"><label><input type="checkbox" class="tie-multiply"><span></span></label></div></div><div class="filter-color-item"><div class="tie-filter-blend-color" title="`)).call(C,Pt.localize("Blend"),`"></div><div class="tui-image-editor-checkbox"><label><input type="checkbox" class="tie-blend"><span></span></label></div></div></li></ul>`)},"filter");function Od(k){var C=Dd();return e(function(){var d=Kt(k),s;if(C){var g=Kt(this).constructor;s=At()(d,arguments,g)}else s=d.apply(this,arguments);return _e(this,s)},"_createSuperInternal")}e(Od,"filter_createSuper");function Dd(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch{return!1}}e(Dd,"filter_isNativeReflectConstruct");var Ul="130px",kd=["add","diff","subtract","multiply","screen","lighten","darken"],Hl=["grayscale","invert","sepia","vintage","blur","sharpen","emboss","remove-white","brightness","noise","pixelate","color-filter","tint","multiply","blend"],Pd={grayscale:"grayscale",invert:"invert",sepia:"sepia",blur:"blur",sharpen:"sharpen",emboss:"emboss",removeWhite:"removeColor",brightness:"brightness",contrast:"contrast",saturation:"saturation",vintage:"vintage",polaroid:"polaroid",noise:"noise",pixelate:"pixelate",colorFilter:"removeColor",tint:"blendColor",multiply:"blendColor",blend:"blendColor",hue:"hue",gamma:"gamma"},Wl=["removewhiteDistanceRange","colorfilterThresholdRange","pixelateRange","noiseRange","brightnessRange","tintOpacity"],Yl=["filterBlendColor","filterMultiplyColor","filterTintColor"],Ld=function(k){Ce(o,k);var C=Od(o);function o(d,s){var g,M=s.locale,O=s.menuBarPosition,F=s.usageStatistics;return V(this,o),g=C.call(this,d,{locale:M,name:"filter",menuBarPosition:O,templateHtml:Ad,usageStatistics:F}),g.selectBoxShow=!1,g.checkedMap={},g._makeControlElement(),g}return e(o,"Filter"),rt(o,[{key:"destroy",value:e(function(){this._removeEvent(),this._destroyToolInstance(),si(this)},"destroy")},{key:"_removeEvent",value:e(function(){var s=this,g;K()(Hl,function(M){var O=s.selector(".tie-".concat(M)),F=je(M);O.removeEventListener("change",s.eventHandler[F])}),K()(G()(g=[]).call(g,Wl,Yl),function(M){s._els[M].off()}),this._els.blendType.removeEventListener("change",this.eventHandler.changeBlendFilter),this._els.blendType.removeEventListener("click",this.eventHandler.changeBlendFilter),Gr()(this.colorPickerInputBoxes,function(M){var O,F;M.removeEventListener(Mt.FOCUS,q()(O=s._onStartEditingInputBox).call(O,s)),M.removeEventListener(Mt.BLUR,q()(F=s._onStopEditingInputBox).call(F,s))},this)},"_removeEvent")},{key:"_destroyToolInstance",value:e(function(){var s,g=this;K()(G()(s=[]).call(s,Wl,Yl),function(M){g._els[M].destroy()})},"_destroyToolInstance")},{key:"addEvent",value:e(function(s){var g=this,M,O,F,R=s.applyFilter,U=e(function(ot){var mt;return q()(mt=g._changeFilterState).call(mt,g,R,ot)},"changeFilterState"),W=e(function(ot){return function(mt,ft){return g._changeFilterState(R,ot,ft)}},"changeFilterStateForRange");this.eventHandler={changeBlendFilter:U("blend"),blandTypeClick:e(function(ot){return ot.stopPropagation()},"blandTypeClick")},K()(Hl,function(at){var ot=g.selector(".tie-".concat(at)),mt=je(at);g.checkedMap[mt]=ot,g.eventHandler[mt]=U(mt),ot.addEventListener("change",g.eventHandler[mt])}),this._els.removewhiteDistanceRange.on("change",W("removeWhite")),this._els.colorfilterThresholdRange.on("change",W("colorFilter")),this._els.pixelateRange.on("change",W("pixelate")),this._els.noiseRange.on("change",W("noise")),this._els.brightnessRange.on("change",W("brightness")),this._els.filterBlendColor.on("change",this.eventHandler.changeBlendFilter),this._els.filterMultiplyColor.on("change",U("multiply")),this._els.filterTintColor.on("change",U("tint")),this._els.tintOpacity.on("change",W("tint")),this._els.filterMultiplyColor.on("changeShow",q()(M=this.colorPickerChangeShow).call(M,this)),this._els.filterTintColor.on("changeShow",q()(O=this.colorPickerChangeShow).call(O,this)),this._els.filterBlendColor.on("changeShow",q()(F=this.colorPickerChangeShow).call(F,this)),this._els.blendType.addEventListener("change",this.eventHandler.changeBlendFilter),this._els.blendType.addEventListener("click",this.eventHandler.blandTypeClick),Gr()(this.colorPickerInputBoxes,function(at){var ot,mt;at.addEventListener(Mt.FOCUS,q()(ot=g._onStartEditingInputBox).call(ot,g)),at.addEventListener(Mt.BLUR,q()(mt=g._onStopEditingInputBox).call(mt,g))},this)},"addEvent")},{key:"setFilterState",value:e(function(s){var g=s.type,M=s.options,O=s.action,F=this._getFilterNameFromOptions(g,M),R=O==="remove";R||this._setFilterState(F,M),this.checkedMap[F].checked=!R},"setFilterState")},{key:"initFilterCheckBoxState",value:e(function(){K()(this.checkedMap,function(s){s.checked=!1},this)},"initFilterCheckBoxState")},{key:"_setFilterState",value:e(function(s,g){s==="colorFilter"?this._els.colorfilterThresholdRange.value=g.distance:s==="removeWhite"?this._els.removewhiteDistanceRange.value=g.distance:s==="pixelate"?this._els.pixelateRange.value=g.blocksize:s==="brightness"?this._els.brightnessRange.value=g.brightness:s==="noise"?this._els.noiseRange.value=g.noise:s==="tint"?(this._els.tintOpacity.value=g.alpha,this._els.filterTintColor.color=g.color):s==="blend"?this._els.filterBlendColor.color=g.color:s==="multiply"&&(this._els.filterMultiplyColor.color=g.color)},"_setFilterState")},{key:"_getFilterNameFromOptions",value:e(function(s,g){var M=s;return s==="removeColor"?M=Bl()(g.useAlpha)?"removeWhite":"colorFilter":s==="blendColor"&&(M={add:"blend",multiply:"multiply",tint:"tint"}[g.mode]),M},"_getFilterNameFromOptions")},{key:"_changeFilterState",value:e(function(s,g){var M=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,O=this.checkedMap[g].checked,F=Pd[g],R=this.checkedMap[g].closest(".tui-image-editor-checkbox-group");R&&(O?R.classList.remove("tui-image-editor-disabled"):R.classList.add("tui-image-editor-disabled")),s(O,F,this._getFilterOption(g),!M)},"_changeFilterState")},{key:"_getFilterOption",value:e(function(s){var g={};switch(s){case"removeWhite":g.color="#FFFFFF",g.useAlpha=!1,g.distance=Ni()(this._els.removewhiteDistanceRange.value);break;case"colorFilter":g.color="#FFFFFF",g.distance=Ni()(this._els.colorfilterThresholdRange.value);break;case"pixelate":g.blocksize=Nt(this._els.pixelateRange.value);break;case"noise":g.noise=Nt(this._els.noiseRange.value);break;case"brightness":g.brightness=Ni()(this._els.brightnessRange.value);break;case"blend":g.mode="add",g.color=this._els.filterBlendColor.color,g.mode=this._els.blendType.value;break;case"multiply":g.mode="multiply",g.color=this._els.filterMultiplyColor.color;break;case"tint":g.mode="tint",g.color=this._els.filterTintColor.color,g.alpha=this._els.tintOpacity.value;break;case"blur":g.blur=this._els.blurRange.value;break;default:break}return g},"_getFilterOption")},{key:"_makeControlElement",value:e(function(){this._els={removewhiteDistanceRange:new ai({slider:this.selector(".tie-removewhite-distance-range")},vi.removewhiteDistanceRange),brightnessRange:new ai({slider:this.selector(".tie-brightness-range")},vi.brightnessRange),noiseRange:new ai({slider:this.selector(".tie-noise-range")},vi.noiseRange),pixelateRange:new ai({slider:this.selector(".tie-pixelate-range")},vi.pixelateRange),colorfilterThresholdRange:new ai({slider:this.selector(".tie-colorfilter-threshold-range")},vi.colorfilterThresholdRange),filterTintColor:new Ri(this.selector(".tie-filter-tint-color"),{defaultColor:"#03bd9e",toggleDirection:this.toggleDirection,usageStatistics:this.usageStatistics}),filterMultiplyColor:new Ri(this.selector(".tie-filter-multiply-color"),{defaultColor:"#515ce6",toggleDirection:this.toggleDirection,usageStatistics:this.usageStatistics}),filterBlendColor:new Ri(this.selector(".tie-filter-blend-color"),{defaultColor:"#ffbb3b",toggleDirection:this.toggleDirection,usageStatistics:this.usageStatistics}),blurRange:vi.blurFilterRange},this._els.tintOpacity=this._pickerWithRange(this._els.filterTintColor.pickerControl),this._els.blendType=this._pickerWithSelectbox(this._els.filterBlendColor.pickerControl),this.colorPickerControls.push(this._els.filterTintColor),this.colorPickerControls.push(this._els.filterMultiplyColor),this.colorPickerControls.push(this._els.filterBlendColor),this.colorPickerInputBoxes=[],this.colorPickerInputBoxes.push(this._els.filterTintColor.colorpickerElement.querySelector(xe.COLOR_PICKER_INPUT_BOX)),this.colorPickerInputBoxes.push(this._els.filterMultiplyColor.colorpickerElement.querySelector(xe.COLOR_PICKER_INPUT_BOX)),this.colorPickerInputBoxes.push(this._els.filterBlendColor.colorpickerElement.querySelector(xe.COLOR_PICKER_INPUT_BOX))},"_makeControlElement")},{key:"_pickerWithRange",value:e(function(s){var g=document.createElement("div"),M=document.createElement("label"),O=document.createElement("div");return O.id="tie-filter-tint-opacity",M.innerHTML="Opacity",g.appendChild(M),g.appendChild(O),s.appendChild(g),s.style.height=Ul,new ai({slider:O},vi.tintOpacityRange)},"_pickerWithRange")},{key:"_pickerWithSelectbox",value:e(function(s){var g=document.createElement("div"),M=document.createElement("select"),O=document.createElement("ul");return g.className="tui-image-editor-selectlist-wrap",O.className="tui-image-editor-selectlist",g.appendChild(M),g.appendChild(O),this._makeSelectOptionList(M),s.appendChild(g),s.style.height=Ul,this._drawSelectOptionList(M,O),this._pickerWithSelectboxForAddEvent(M,O),M},"_pickerWithSelectbox")},{key:"_drawSelectOptionList",value:e(function(s,g){var M=s.querySelectorAll("option");K()(M,function(O){var F=document.createElement("li");F.innerHTML=O.innerHTML,F.setAttribute("data-item",O.value),g.appendChild(F)})},"_drawSelectOptionList")},{key:"_pickerWithSelectboxForAddEvent",value:e(function(s,g){var M=this;g.addEventListener("click",function(O){var F=O.target.getAttribute("data-item"),R=document.createEvent("HTMLEvents");s.querySelector('[value="'.concat(F,'"]')).selected=!0,R.initEvent("change",!0,!0),s.dispatchEvent(R),M.selectBoxShow=!1,g.style.display="none"}),s.addEventListener("mousedown",function(O){O.preventDefault(),M.selectBoxShow=!M.selectBoxShow,g.style.display=M.selectBoxShow?"block":"none",g.setAttribute("data-selectitem",s.value),g.querySelector("[data-item='".concat(s.value,"']")).classList.add("active")})},"_pickerWithSelectboxForAddEvent")},{key:"_makeSelectOptionList",value:e(function(s){K()(kd,function(g){var M=document.createElement("option");M.setAttribute("value",g),M.innerHTML=g.replace(/^[a-z]/,function(O){return O.toUpperCase()}),s.appendChild(M)})},"_makeSelectOptionList")}]),o}(mi),Nd=Ld,Rd=u(4383),jd=u.n(Rd),Fd=function(){function k(C,o){var d=o.name;V(this,k),this.name=d,this.items=[],this.panelElement=this._makePanelElement(),this.listElement=this._makeListElement(),this.panelElement.appendChild(this.listElement),C.appendChild(this.panelElement)}return e(k,"Panel"),rt(k,[{key:"_makePanelElement",value:e(function(){var o=document.createElement("div");return o.className="tie-panel-".concat(this.name),o},"_makePanelElement")},{key:"_makeListElement",value:e(function(){var o=document.createElement("ol");return o.className="".concat(this.name,"-list"),o},"_makeListElement")},{key:"makeListItemElement",value:e(function(o){var d=document.createElement("li");return d.innerHTML=o,d.className="".concat(this.name,"-item"),d.setAttribute("data-index",this.items.length),d},"makeListItemElement")},{key:"pushListItemElement",value:e(function(o){this.listElement.appendChild(o),this.listElement.scrollTop+=o.offsetHeight,this.items.push(o)},"pushListItemElement")},{key:"deleteListItemElement",value:e(function(o,d){for(var s=this.items,g=o;g<d;g+=1)this.listElement.removeChild(s[g]);P()(s).call(s,o,d-o+1)},"deleteListItemElement")},{key:"getListLength",value:e(function(){return this.items.length},"getListLength")},{key:"addClass",value:e(function(o,d){this.items[o]&&this.items[o].classList.add(d)},"addClass")},{key:"removeClass",value:e(function(o,d){this.items[o]&&this.items[o].classList.remove(d)},"removeClass")},{key:"toggleClass",value:e(function(o,d){this.items[o]&&this.items[o].classList.toggle(d)},"toggleClass")}]),k}(),zd=Fd,Bd=e(function(k){var C,o,d,s=k.locale,g=k.makeSvgIcon,M=k.name,O=k.detail;return G()(C=G()(o=G()(d=` <div class="tui-image-editor-history-item history"><div class="history-item-icon"> `.concat(g(["normal","active"],"history-".concat(M.toLowerCase()),!0),`</div><span>`)).call(d,s.localize(M),` `)).call(o,O?"(".concat(s.localize(O),")"):"",`</span><div class="history-item-checkbox">`)).call(C,g(["normal"],"history-check",!0),`</div></div>`)},"submenu_history");function Ud(k){var C=Hd();return e(function(){var d=Kt(k),s;if(C){var g=Kt(this).constructor;s=At()(d,arguments,g)}else s=d.apply(this,arguments);return _e(this,s)},"_createSuperInternal")}e(Ud,"history_createSuper");function Hd(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch{return!1}}e(Hd,"history_isNativeReflectConstruct");var Wd="history-item",Gl="selected-item",Xl="disabled-item",Yd=function(k){Ce(o,k);var C=Ud(o);function o(d,s){var g,M=s.locale,O=s.makeSvgIcon;return V(this,o),g=C.call(this,d,{name:"history"}),d.classList.add("enabled"),g.locale=M,g.makeSvgIcon=O,g._eventHandler={},g._historyIndex=g.getListLength(),g}return e(o,"History"),rt(o,[{key:"add",value:e(function(s){var g=s.name,M=s.detail;this._hasDisabledItem()&&this.deleteListItemElement(this._historyIndex+1,this.getListLength());var O=Bd({locale:this.locale,makeSvgIcon:this.makeSvgIcon,name:g,detail:M}),F=this.makeListItemElement(O);this.pushListItemElement(F),this._historyIndex=this.getListLength()-1,this._selectItem(this._historyIndex)},"add")},{key:"init",value:e(function(){this.deleteListItemElement(1,this.getListLength()),this._historyIndex=0,this._selectItem(this._historyIndex)},"init")},{key:"clear",value:e(function(){this.deleteListItemElement(0,this.getListLength()),this._historyIndex=-1},"clear")},{key:"prev",value:e(function(){this._historyIndex-=1,this._selectItem(this._historyIndex)},"prev")},{key:"next",value:e(function(){this._historyIndex+=1,this._selectItem(this._historyIndex)},"next")},{key:"_hasDisabledItem",value:e(function(){return this.getListLength()-1>this._historyIndex},"_hasDisabledItem")},{key:"_addHistoryEventListener",value:e(function(){var s=this;this._eventHandler.history=function(g){return s._clickHistoryItem(g)},this.listElement.addEventListener("click",this._eventHandler.history)},"_addHistoryEventListener")},{key:"_removeHistoryEventListener",value:e(function(){this.listElement.removeEventListener("click",this._eventHandler.history)},"_removeHistoryEventListener")},{key:"_clickHistoryItem",value:e(function(s){var g=s.target,M=g.closest(".".concat(Wd));if(M){var O=jd()(M.getAttribute("data-index"),10);if(O!==this._historyIndex){var F=Math.abs(O-this._historyIndex);O<this._historyIndex?this._actions.undo(F):this._actions.redo(F)}}},"_clickHistoryItem")},{key:"_selectItem",value:e(function(s){for(var g=0;g<this.getListLength();g+=1)this.removeClass(g,Gl),this.removeClass(g,Xl),g>s&&this.addClass(g,Xl);this.addClass(s,Gl)},"_selectItem")},{key:"destroy",value:e(function(){this.removeEvent(),si(this)},"destroy")},{key:"addEvent",value:e(function(s){this._actions=s,this._addHistoryEventListener()},"addEvent")},{key:"removeEvent",value:e(function(){this._removeHistoryEventListener()},"removeEvent")}]),o}(zd),Gd=Yd,Xd=function(){function k(C){V(this,k),this._locale=C}return e(k,"Locale"),rt(k,[{key:"localize",value:e(function(o){return this._locale[o]||o},"localize")}]),k}(),Vd=Xd,$d={Shape:Ff,Crop:Wf,Resize:$f,Flip:qf,Rotate:ad,Text:hd,Mask:pd,Icon:_d,Draw:Md,Filter:Nd},Zd="1300",Vl="history",Jd="tie-panel-history",Xr="on",Vr={ZOOM_IN:"zoomIn",HAND:"hand"},$l=function(){function k(C,o,d){V(this,k),this.options=this._initializeOption(o),this._actions=d,this.submenu=!1,this.imageSize={},this.uiSize={},this._locale=new Vd(this.options.locale),this.theme=new If(this.options.theme),this.eventHandler={},this._submenuChangeTransection=!1,this._selectedElement=null,this._mainElement=null,this._editorElementWrap=null,this._editorElement=null,this._menuBarElement=null,this._subMenuElement=null,this._makeUiElement(C),this._setUiSize(),this._initMenuEvent=!1,this._makeSubMenu(),this._attachHistoryEvent(),this._attachZoomEvent()}return e(k,"Ui"),rt(k,[{key:"destroy",value:e(function(){this._removeUiEvent(),this._destroyAllMenu(),this._selectedElement.innerHTML="",si(this)},"destroy")},{key:"setUiDefaultSelectionStyle",value:e(function(o){return Z()({applyCropSelectionStyle:!0,applyGroupSelectionStyle:!0,selectionStyle:{cornerStyle:"circle",cornerSize:16,cornerColor:"#fff",cornerStrokeColor:"#fff",transparentCorners:!1,lineWidth:2,borderColor:"#fff"}},o)},"setUiDefaultSelectionStyle")},{key:"resizeEditor",value:e(function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},d=o.uiSize,s=o.imageSize,g=s===void 0?this.imageSize:s;g!==this.imageSize&&(this.imageSize=g),d&&this._setUiSize(d);var M=this._getCanvasMaxDimension(),O=M.width,F=M.height,R=this._editorElement.style,U=this.options.menuBarPosition;R.height="".concat(F,"px"),R.width="".concat(O,"px"),this._setEditorPosition(U),this._editorElementWrap.style.bottom="0px",this._editorElementWrap.style.top="0px",this._editorElementWrap.style.left="0px",this._editorElementWrap.style.width="100%";var W=this._selectedElement.classList;U==="top"&&this._selectedElement.offsetWidth<Zd?W.add("tui-image-editor-top-optimization"):W.remove("tui-image-editor-top-optimization")},"resizeEditor")},{key:"toggleZoomButtonStatus",value:e(function(o){var d=this._buttonElements[o].classList;d.toggle(Xr),o===Vr.ZOOM_IN?this._buttonElements[Vr.HAND].classList.remove(Xr):this._buttonElements[Vr.ZOOM_IN].classList.remove(Xr)},"toggleZoomButtonStatus")},{key:"offZoomInButtonStatus",value:e(function(){var o=this._buttonElements[Vr.ZOOM_IN].classList;o.remove(Xr)},"offZoomInButtonStatus")},{key:"changeHandButtonStatus",value:e(function(o){var d=this._buttonElements[Vr.HAND].classList;d[o?"add":"remove"](Xr)},"changeHandButtonStatus")},{key:"changeHelpButtonEnabled",value:e(function(o,d){var s=this._buttonElements[o].classList;s[d?"add":"remove"]("enabled")},"changeHelpButtonEnabled")},{key:"_initializeOption",value:e(function(o){return Z()({loadImage:{path:"",name:""},locale:{},menuIconPath:"",menu:["resize","crop","flip","rotate","draw","shape","icon","text","mask","filter"],initMenu:"",uiSize:{width:"100%",height:"100%"},menuBarPosition:"bottom"},o)},"_initializeOption")},{key:"_setUiSize",value:e(function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.uiSize,d=this._selectedElement.style;d.width=o.width,d.height=o.height},"_setUiSize")},{key:"_makeSubMenu",value:e(function(){var o=this;K()(this.options.menu,function(d){var s,g=$d[d.replace(/^[a-z]/,function(M){return M.toUpperCase()})];o._makeMenuElement(d),o._buttonElements[d]=o._menuBarElement.querySelector(".tie-btn-".concat(d)),o[d]=new g(o._subMenuElement,{locale:o._locale,makeSvgIcon:q()(s=o.theme.makeMenSvgIconSet).call(s,o.theme),menuBarPosition:o.options.menuBarPosition,usageStatistics:o.options.usageStatistics})})},"_makeSubMenu")},{key:"_attachHistoryEvent",value:e(function(){var o,d,s;this.on(Mt.EXECUTE_COMMAND,q()(o=this._addHistory).call(o,this)),this.on(Mt.AFTER_UNDO,q()(d=this._selectPrevHistory).call(d,this)),this.on(Mt.AFTER_REDO,q()(s=this._selectNextHistory).call(s,this))},"_attachHistoryEvent")},{key:"_attachZoomEvent",value:e(function(){var o=this;this.on(Mt.HAND_STARTED,function(){o.offZoomInButtonStatus(),o.changeHandButtonStatus(!0)}),this.on(Mt.HAND_STOPPED,function(){return o.changeHandButtonStatus(!1)})},"_attachZoomEvent")},{key:"_makeUiElement",value:e(function(o){var d,s;o.nodeType?s=o:s=document.querySelector(o);var g=Wr(s);s.classList.add("tui-image-editor-container"),s.innerHTML=yf({locale:this._locale,biImage:this.theme.getStyle("common.bi"),loadButtonStyle:this.theme.getStyle("loadButton"),downloadButtonStyle:this.theme.getStyle("downloadButton"),menuBarPosition:this.options.menuBarPosition})+mf({locale:this._locale,biImage:this.theme.getStyle("common.bi"),commonStyle:this.theme.getStyle("common"),headerStyle:this.theme.getStyle("header"),loadButtonStyle:this.theme.getStyle("loadButton"),downloadButtonStyle:this.theme.getStyle("downloadButton"),submenuStyle:this.theme.getStyle("submenu")}),this._selectedElement=s,this._selectedElement.classList.add(this.options.menuBarPosition),this._mainElement=g(".tui-image-editor-main"),this._editorElementWrap=g(".tui-image-editor-wrap"),this._editorElement=g(".tui-image-editor"),this._helpMenuBarElement=g(".tui-image-editor-help-menu"),this._menuBarElement=g(".tui-image-editor-menu"),this._subMenuElement=g(".tui-image-editor-submenu"),this._buttonElements={download:this._selectedElement.querySelectorAll(".tui-image-editor-download-btn"),load:this._selectedElement.querySelectorAll(".tui-image-editor-load-btn")},this._addHelpMenus(),this._historyMenu=new Gd(this._buttonElements[Vl],{locale:this._locale,makeSvgIcon:q()(d=this.theme.makeMenSvgIconSet).call(d,this.theme)}),this._activateZoomMenus()},"_makeUiElement")},{key:"_activateZoomMenus",value:e(function(){var o=this;K()(ye,function(d){o.changeHelpButtonEnabled(d,!0)})},"_activateZoomMenus")},{key:"_makeHelpMenuWithPartition",value:e(function(){var o;return G()(o=[]).call(o,B(ye),[""],B(Ae),[""],B(Fe))},"_makeHelpMenuWithPartition")},{key:"_addHelpMenus",value:e(function(){var o=this,d=this._makeHelpMenuWithPartition();K()(d,function(s){s?(o._makeMenuElement(s,["normal","disabled","hover"],"help"),o._buttonElements[s]=o._helpMenuBarElement.querySelector(".tie-btn-".concat(s))):o._makeMenuPartitionElement()})},"_addHelpMenus")},{key:"_makeMenuPartitionElement",value:e(function(){var o=document.createElement("li"),d=document.createElement("div");o.className=$n("item"),d.className=$n("icpartition"),o.appendChild(d),this._helpMenuBarElement.appendChild(o)},"_makeMenuPartitionElement")},{key:"_makeMenuElement",value:e(function(o){var d,s,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["normal","active","hover"],M=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"normal",O=document.createElement("li"),F=this.theme.makeMenSvgIconSet(g,o);this._addTooltipAttribute(O,o),O.className=G()(d=G()(s="tie-btn-".concat(o," ")).call(s,$n("item")," ")).call(d,M),O.innerHTML=F,M==="normal"?this._menuBarElement.appendChild(O):this._helpMenuBarElement.appendChild(O)},"_makeMenuElement")},{key:"_addHelpActionEvent",value:e(function(){var o=this;K()(Ot,function(d){o.eventHandler[d]=function(s){return o._actions.main[d](s)},o._buttonElements[d].addEventListener("click",o.eventHandler[d])})},"_addHelpActionEvent")},{key:"_removeHelpActionEvent",value:e(function(){var o=this;K()(Ot,function(d){o._buttonElements[d].removeEventListener("click",o.eventHandler[d])})},"_removeHelpActionEvent")},{key:"_addHistory",value:e(function(o){if(!sf(o)){var d=typeof o=="string"?{name:o}:af(o);this._historyMenu.add(d)}},"_addHistory")},{key:"initHistory",value:e(function(){this._historyMenu.init()},"initHistory")},{key:"clearHistory",value:e(function(){this._historyMenu.clear()},"clearHistory")},{key:"_selectPrevHistory",value:e(function(){this._historyMenu.prev()},"_selectPrevHistory")},{key:"_selectNextHistory",value:e(function(){this._historyMenu.next()},"_selectNextHistory")},{key:"toggleHistoryMenu",value:e(function(o){var d=o.target,s=d.closest(".".concat(Jd));if(!s){var g=this._buttonElements[Vl].classList;g.toggle("opened")}},"toggleHistoryMenu")},{key:"_addTooltipAttribute",value:e(function(o,d){o.setAttribute("tooltip-content",this._locale.localize(d.replace(/^[a-z]/g,function(s){return s.toUpperCase()})))},"_addTooltipAttribute")},{key:"_addDownloadEvent",value:e(function(){var o=this;this.eventHandler.download=function(){return o._actions.main.download()},K()(this._buttonElements.download,function(d){d.addEventListener("click",o.eventHandler.download)})},"_addDownloadEvent")},{key:"_removeDownloadEvent",value:e(function(){var o=this;K()(this._buttonElements.download,function(d){d.removeEventListener("click",o.eventHandler.download)})},"_removeDownloadEvent")},{key:"_addLoadEvent",value:e(function(){var o=this;this.eventHandler.loadImage=function(d){return o._actions.main.load(d.target.files[0])},K()(this._buttonElements.load,function(d){d.addEventListener("change",o.eventHandler.loadImage)})},"_addLoadEvent")},{key:"_removeLoadEvent",value:e(function(){var o=this;K()(this._buttonElements.load,function(d){d.removeEventListener("change",o.eventHandler.loadImage)})},"_removeLoadEvent")},{key:"_addMainMenuEvent",value:e(function(o){var d=this;this.eventHandler[o]=function(){return d.changeMenu(o)},this._buttonElements[o].addEventListener("click",this.eventHandler[o])},"_addMainMenuEvent")},{key:"_addSubMenuEvent",value:e(function(o){var d=this;this[o].addEvent(this._actions[o]),this[o].on(Mt.INPUT_BOX_EDITING_STARTED,function(){return d.fire(Mt.INPUT_BOX_EDITING_STARTED)}),this[o].on(Mt.INPUT_BOX_EDITING_STOPPED,function(){return d.fire(Mt.INPUT_BOX_EDITING_STOPPED)})},"_addSubMenuEvent")},{key:"_addMenuEvent",value:e(function(){var o=this;K()(this.options.menu,function(d){o._addMainMenuEvent(d),o._addSubMenuEvent(d)})},"_addMenuEvent")},{key:"_removeMainMenuEvent",value:e(function(){var o=this;K()(this.options.menu,function(d){o._buttonElements[d].removeEventListener("click",o.eventHandler[d]),o[d].off(Mt.INPUT_BOX_EDITING_STARTED),o[d].off(Mt.INPUT_BOX_EDITING_STOPPED)})},"_removeMainMenuEvent")},{key:"getEditorArea",value:e(function(){return this._editorElement},"getEditorArea")},{key:"activeMenuEvent",value:e(function(){this._initMenuEvent||(this._addHelpActionEvent(),this._addDownloadEvent(),this._addMenuEvent(),this._initMenu(),this._historyMenu.addEvent(this._actions.history),this._initMenuEvent=!0)},"activeMenuEvent")},{key:"_removeUiEvent",value:e(function(){this._removeHelpActionEvent(),this._removeDownloadEvent(),this._removeLoadEvent(),this._removeMainMenuEvent(),this._historyMenu.removeEvent()},"_removeUiEvent")},{key:"_destroyAllMenu",value:e(function(){var o=this;K()(this.options.menu,function(d){o[d].destroy()}),this._historyMenu.destroy()},"_destroyAllMenu")},{key:"initCanvas",value:e(function(){var o=this,d=this._getLoadImage();d.path&&this._actions.main.initLoadImage(d.path,d.name).then(function(){o.activeMenuEvent()}),this._addLoadEvent();var s=document.createElement("div");s.className=$n("grid-visual");var g=`<table><tr><td class="dot left-top"></td><td></td><td class="dot right-top"></td></tr><tr><td></td><td></td><td></td></tr><tr><td class="dot left-bottom"></td><td></td><td class="dot right-bottom"></td></tr></table>`;s.innerHTML=g,this._editorContainerElement=this._editorElement.querySelector(".tui-image-editor-canvas-container"),this._editorContainerElement.appendChild(s)},"initCanvas")},{key:"_getLoadImage",value:e(function(){return this.options.loadImage},"_getLoadImage")},{key:"changeMenu",value:e(function(o){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;this._submenuChangeTransection||(this._submenuChangeTransection=!0,this._changeMenu(o,d,s),this._submenuChangeTransection=!1)},"changeMenu")},{key:"_changeMenu",value:e(function(o,d,s){this.submenu&&(this._buttonElements[this.submenu].classList.remove("active"),this._mainElement.classList.remove("tui-image-editor-menu-".concat(this.submenu)),s&&this._actions.main.discardSelection(),this._actions.main.changeSelectableAll(!0),this[this.submenu].changeStandbyMode()),this.submenu===o&&d?this.submenu=null:(this._buttonElements[o].classList.add("active"),this._mainElement.classList.add("tui-image-editor-menu-".concat(o)),this.submenu=o,this[this.submenu].changeStartMode()),this.resizeEditor()},"_changeMenu")},{key:"_initMenu",value:e(function(){if(this.options.initMenu){var o=document.createEvent("MouseEvents");o.initEvent("click",!0,!1),this._buttonElements[this.options.initMenu].dispatchEvent(o)}this.icon&&this.icon.registerDefaultIcon()},"_initMenu")},{key:"_getCanvasMaxDimension",value:e(function(){var o=this._editorContainerElement.style,d=o.maxWidth,s=o.maxHeight,g=Ni()(d),M=Ni()(s);return{width:g,height:M}},"_getCanvasMaxDimension")},{key:"_setEditorPosition",value:e(function(o){var d=this._getCanvasMaxDimension(),s=d.width,g=d.height,M=this._editorElement.style,O=0,F=0;this.submenu&&(o==="bottom"?g>this._editorElementWrap.scrollHeight-150?O=(g-this._editorElementWrap.scrollHeight)/2:O=150/2*-1:o==="top"?g>this._editorElementWrap.offsetHeight-150?O=150/2-(g-(this._editorElementWrap.offsetHeight-150))/2:O=150/2:o==="left"?s>this._editorElementWrap.offsetWidth-248?F=248/2-(s-(this._editorElementWrap.offsetWidth-248))/2:F=248/2:o==="right"&&(s>this._editorElementWrap.scrollWidth-248?F=(s-this._editorElementWrap.scrollWidth)/2:F=248/2*-1)),M.top="".concat(O,"px"),M.left="".concat(F,"px")},"_setEditorPosition")}]),k}();yt().mixin($l);var Kd=$l,Qd=u(381),lr=u.n(Qd),Zl=function(){function k(){V(this,k),this.versionnumber="1.2.4",this.optionpresets={default:{corsenabled:!1,ltres:1,qtres:1,pathomit:8,rightangleenhance:!0,colorsampling:2,numberofcolors:16,mincolorratio:0,colorquantcycles:3,layering:0,strokewidth:1,linefilter:!1,scale:1,roundcoords:1,viewbox:!1,desc:!1,lcpr:0,qcpr:0,blurradius:0,blurdelta:20},posterized1:{colorsampling:0,numberofcolors:2},posterized2:{numberofcolors:4,blurradius:5},curvy:{ltres:.01,linefilter:!0,rightangleenhance:!1},sharp:{qtres:.01,linefilter:!1},detailed:{pathomit:0,roundcoords:2,ltres:.5,qtres:.5,numberofcolors:64},smoothed:{blurradius:5,blurdelta:64},grayscale:{colorsampling:0,colorquantcycles:1,numberofcolors:7},fixedpalette:{colorsampling:0,colorquantcycles:1,numberofcolors:27},randomsampling1:{colorsampling:1,numberofcolors:8},randomsampling2:{colorsampling:1,numberofcolors:64},artistic1:{colorsampling:0,colorquantcycles:1,pathomit:0,blurradius:5,blurdelta:64,ltres:.01,linefilter:!0,numberofcolors:16,strokewidth:2},artistic2:{qtres:.01,colorsampling:0,colorquantcycles:1,numberofcolors:4,strokewidth:0},artistic3:{qtres:10,ltres:10,numberofcolors:8},artistic4:{qtres:10,ltres:10,numberofcolors:64,blurradius:5,blurdelta:256,strokewidth:2},posterized3:{ltres:1,qtres:1,pathomit:20,rightangleenhance:!0,colorsampling:0,numberofcolors:3,mincolorratio:0,colorquantcycles:3,blurradius:3,blurdelta:20,strokewidth:0,linefilter:!1,roundcoords:1,pal:[{r:0,g:0,b:100,a:255},{r:255,g:255,b:255,a:255}]}},this.pathscan_combined_lookup=[[[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1]],[[0,1,0,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],[0,2,-1,0]],[[-1,-1,-1,-1],[-1,-1,-1,-1],[0,1,0,-1],[0,0,1,0]],[[0,0,1,0],[-1,-1,-1,-1],[0,2,-1,0],[-1,-1,-1,-1]],[[-1,-1,-1,-1],[0,0,1,0],[0,3,0,1],[-1,-1,-1,-1]],[[13,3,0,1],[13,2,-1,0],[7,1,0,-1],[7,0,1,0]],[[-1,-1,-1,-1],[0,1,0,-1],[-1,-1,-1,-1],[0,3,0,1]],[[0,3,0,1],[0,2,-1,0],[-1,-1,-1,-1],[-1,-1,-1,-1]],[[0,3,0,1],[0,2,-1,0],[-1,-1,-1,-1],[-1,-1,-1,-1]],[[-1,-1,-1,-1],[0,1,0,-1],[-1,-1,-1,-1],[0,3,0,1]],[[11,1,0,-1],[14,0,1,0],[14,3,0,1],[11,2,-1,0]],[[-1,-1,-1,-1],[0,0,1,0],[0,3,0,1],[-1,-1,-1,-1]],[[0,0,1,0],[-1,-1,-1,-1],[0,2,-1,0],[-1,-1,-1,-1]],[[-1,-1,-1,-1],[-1,-1,-1,-1],[0,1,0,-1],[0,0,1,0]],[[0,1,0,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],[0,2,-1,0]],[[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1]]],this.gks=[[.27901,.44198,.27901],[.135336,.228569,.272192,.228569,.135336],[.086776,.136394,.178908,.195843,.178908,.136394,.086776],[.063327,.093095,.122589,.144599,.152781,.144599,.122589,.093095,.063327],[.049692,.069304,.089767,.107988,.120651,.125194,.120651,.107988,.089767,.069304,.049692]],this.specpalette=[{r:0,g:0,b:0,a:255},{r:128,g:128,b:128,a:255},{r:0,g:0,b:128,a:255},{r:64,g:64,b:128,a:255},{r:192,g:192,b:192,a:255},{r:255,g:255,b:255,a:255},{r:128,g:128,b:192,a:255},{r:0,g:0,b:192,a:255},{r:128,g:0,b:0,a:255},{r:128,g:64,b:64,a:255},{r:128,g:0,b:128,a:255},{r:168,g:168,b:168,a:255},{r:192,g:128,b:128,a:255},{r:192,g:0,b:0,a:255},{r:255,g:255,b:255,a:255},{r:0,g:128,b:0,a:255}]}return e(k,"ImageTracer"),rt(k,[{key:"imageToSVG",value:e(function(o,d,s){var g=this;s=this.checkoptions(s),this.loadImage(o,function(M){d(g.imagedataToSVG(g.getImgdata(M),s))},s)},"imageToSVG")},{key:"imagedataToSVG",value:e(function(o,d){d=this.checkoptions(d);var s=this.imagedataToTracedata(o,d);return this.getsvgstring(s,d)},"imagedataToSVG")},{key:"imageToTracedata",value:e(function(o,d,s){var g=this;s=this.checkoptions(s),this.loadImage(o,function(M){d(g.imagedataToTracedata(g.getImgdata(M),s))},s)},"imageToTracedata")},{key:"imagedataToTracedata",value:e(function(o,d){d=this.checkoptions(d);var s=this.colorquantization(o,d),g;if(d.layering===0){g={layers:[],palette:s.palette,width:s.array[0].length-2,height:s.array.length-2};for(var M=0;M<s.palette.length;M+=1){var O=this.batchtracepaths(this.internodes(this.pathscan(this.layeringstep(s,M),d.pathomit),d),d.ltres,d.qtres);g.layers.push(O)}}else{var F=this.layering(s);d.layercontainerid&&this.drawLayers(F,this.specpalette,d.scale,d.layercontainerid);var R=this.batchpathscan(F,d.pathomit),U=this.batchinternodes(R,d);g={layers:this.batchtracelayers(U,d.ltres,d.qtres),palette:s.palette,width:o.width,height:o.height}}return g},"imagedataToTracedata")},{key:"checkoptions",value:e(function(o){o=o||{},typeof o=="string"&&(o=o.toLowerCase(),this.optionpresets[o]?o=this.optionpresets[o]:o={});for(var d=Et()(this.optionpresets.default),s=0;s<d.length;s+=1)o.hasOwnProperty(d[s])||(o[d[s]]=this.optionpresets.default[d[s]]);return o},"checkoptions")},{key:"colorquantization",value:e(function(o,d){var s=[],g=0,M,O,F,R=[],U=o.width*o.height,W,at,ot,mt,ft;for(at=0;at<o.height+2;at+=1)for(s[at]=[],W=0;W<o.width+2;W+=1)s[at][W]=-1;for(d.pal?ft=d.pal:d.colorsampling===0?ft=this.generatepalette(d.numberofcolors):d.colorsampling===1?ft=this.samplepalette(d.numberofcolors,o):ft=this.samplepalette2(d.numberofcolors,o),d.blurradius>0&&(o=this.blur(o,d.blurradius,d.blurdelta)),mt=0;mt<d.colorquantcycles;mt+=1){if(mt>0)for(ot=0;ot<ft.length;ot+=1)R[ot].n>0&&(ft[ot]={r:Math.floor(R[ot].r/R[ot].n),g:Math.floor(R[ot].g/R[ot].n),b:Math.floor(R[ot].b/R[ot].n),a:Math.floor(R[ot].a/R[ot].n)}),R[ot].n/U<d.mincolorratio&&mt<d.colorquantcycles-1&&(ft[ot]={r:Math.floor(Math.random()*255),g:Math.floor(Math.random()*255),b:Math.floor(Math.random()*255),a:Math.floor(Math.random()*255)});for(W=0;W<ft.length;W+=1)R[W]={r:0,g:0,b:0,a:0,n:0};for(at=0;at<o.height;at+=1)for(W=0;W<o.width;W+=1){for(g=(at*o.width+W)*4,F=0,O=1024,ot=0;ot<ft.length;ot+=1)M=Math.abs(ft[ot].r-o.data[g])+Math.abs(ft[ot].g-o.data[g+1])+Math.abs(ft[ot].b-o.data[g+2])+Math.abs(ft[ot].a-o.data[g+3]),M<O&&(O=M,F=ot);R[F].r+=o.data[g],R[F].g+=o.data[g+1],R[F].b+=o.data[g+2],R[F].a+=o.data[g+3],R[F].n+=1,s[at+1][W+1]=F}}return{array:s,palette:ft}},"colorquantization")},{key:"samplepalette",value:e(function(o,d){for(var s,g=[],M=0;M<o;M+=1)s=Math.floor(Math.random()*d.data.length/4)*4,g.push({r:d.data[s],g:d.data[s+1],b:d.data[s+2],a:d.data[s+3]});return g},"samplepalette")},{key:"samplepalette2",value:e(function(o,d){for(var s,g=[],M=Math.ceil(Math.sqrt(o)),O=Math.ceil(o/M),F=d.width/(M+1),R=d.height/(O+1),U=0;U<O;U+=1)for(var W=0;W<M&&g.length!==o;W+=1)s=Math.floor((U+1)*R*d.width+(W+1)*F)*4,g.push({r:d.data[s],g:d.data[s+1],b:d.data[s+2],a:d.data[s+3]});return g},"samplepalette2")},{key:"generatepalette",value:e(function(o){var d=[],s,g,M;if(o<8)for(var O=Math.floor(255/(o-1)),F=0;F<o;F+=1)d.push({r:F*O,g:F*O,b:F*O,a:255});else{var R=Math.floor(Math.pow(o,.3333333333333333)),U=Math.floor(255/(R-1)),W=o-R*R*R;for(s=0;s<R;s+=1)for(g=0;g<R;g+=1)for(M=0;M<R;M+=1)d.push({r:s*U,g:g*U,b:M*U,a:255});for(s=0;s<W;s+=1)d.push({r:Math.floor(Math.random()*255),g:Math.floor(Math.random()*255),b:Math.floor(Math.random()*255),a:Math.floor(Math.random()*255)})}return d},"generatepalette")},{key:"layering",value:e(function(o){var d=[],s=0,g=o.array.length,M=o.array[0].length,O,F,R,U,W,at,ot,mt,ft,pt,Pt;for(Pt=0;Pt<o.palette.length;Pt+=1)for(d[Pt]=[],pt=0;pt<g;pt+=1)for(d[Pt][pt]=[],ft=0;ft<M;ft+=1)d[Pt][pt][ft]=0;for(pt=1;pt<g-1;pt+=1)for(ft=1;ft<M-1;ft+=1)s=o.array[pt][ft],O=o.array[pt-1][ft-1]===s?1:0,F=o.array[pt-1][ft]===s?1:0,R=o.array[pt-1][ft+1]===s?1:0,U=o.array[pt][ft-1]===s?1:0,W=o.array[pt][ft+1]===s?1:0,at=o.array[pt+1][ft-1]===s?1:0,ot=o.array[pt+1][ft]===s?1:0,mt=o.array[pt+1][ft+1]===s?1:0,d[s][pt+1][ft+1]=1+W*2+mt*4+ot*8,U||(d[s][pt+1][ft]=2+ot*4+at*8),F||(d[s][pt][ft+1]=0+R*2+W*4+8),O||(d[s][pt][ft]=0+F*2+4+U*8);return d},"layering")},{key:"layeringstep",value:e(function(o,d){var s=[],g=o.array.length,M=o.array[0].length,O,F;for(F=0;F<g;F+=1)for(s[F]=[],O=0;O<M;O+=1)s[F][O]=0;for(F=1;F<g;F+=1)for(O=1;O<M;O+=1)s[F][O]=(o.array[F-1][O-1]===d?1:0)+(o.array[F-1][O]===d?2:0)+(o.array[F][O-1]===d?8:0)+(o.array[F][O]===d?4:0);return s},"layeringstep")},{key:"pathscan",value:e(function(o,d){for(var s=[],g=0,M=0,O=0,F=0,R=o[0].length,U=o.length,W=0,at=!0,ot=!1,mt,ft=0;ft<U;ft+=1)for(var pt=0;pt<R;pt+=1)if(o[ft][pt]===4||o[ft][pt]===11)for(O=pt,F=ft,s[g]={},s[g].points=[],s[g].boundingbox=[O,F,O,F],s[g].holechildren=[],at=!1,M=0,ot=o[ft][pt]===11,W=1;!at;){if(s[g].points[M]={},s[g].points[M].x=O-1,s[g].points[M].y=F-1,s[g].points[M].t=o[F][O],O-1<s[g].boundingbox[0]&&(s[g].boundingbox[0]=O-1),O-1>s[g].boundingbox[2]&&(s[g].boundingbox[2]=O-1),F-1<s[g].boundingbox[1]&&(s[g].boundingbox[1]=F-1),F-1>s[g].boundingbox[3]&&(s[g].boundingbox[3]=F-1),mt=this.pathscan_combined_lookup[o[F][O]][W],o[F][O]=mt[0],W=mt[1],O+=mt[2],F+=mt[3],O-1===s[g].points[0].x&&F-1===s[g].points[0].y)if(at=!0,s[g].points.length<d)s.pop();else{if(s[g].isholepath=!!ot,ot){for(var Pt=0,Qt=[-1,-1,R+1,U+1],qt=0;qt<g;qt++)!s[qt].isholepath&&this.boundingboxincludes(s[qt].boundingbox,s[g].boundingbox)&&this.boundingboxincludes(Qt,s[qt].boundingbox)&&(Pt=qt,Qt=s[qt].boundingbox);s[Pt].holechildren.push(g)}g+=1}M+=1}return s},"pathscan")},{key:"boundingboxincludes",value:e(function(o,d){return o[0]<d[0]&&o[1]<d[1]&&o[2]>d[2]&&o[3]>d[3]},"boundingboxincludes")},{key:"batchpathscan",value:e(function(o,d){var s=[];for(var g in o)o.hasOwnProperty(g)&&(s[g]=this.pathscan(o[g],d));return s},"batchpathscan")},{key:"internodes",value:e(function(o,d){var s=[],g=0,M=0,O=0,F=0,R=0,U,W;for(U=0;U<o.length;U+=1)for(s[U]={},s[U].points=[],s[U].boundingbox=o[U].boundingbox,s[U].holechildren=o[U].holechildren,s[U].isholepath=o[U].isholepath,g=o[U].points.length,W=0;W<g;W+=1)M=(W+1)%g,O=(W+2)%g,F=(W-1+g)%g,R=(W-2+g)%g,d.rightangleenhance&&this.testrightangle(o[U],R,F,W,M,O)&&(s[U].points.length>0&&(s[U].points[s[U].points.length-1].linesegment=this.getdirection(s[U].points[s[U].points.length-1].x,s[U].points[s[U].points.length-1].y,o[U].points[W].x,o[U].points[W].y)),s[U].points.push({x:o[U].points[W].x,y:o[U].points[W].y,linesegment:this.getdirection(o[U].points[W].x,o[U].points[W].y,(o[U].points[W].x+o[U].points[M].x)/2,(o[U].points[W].y+o[U].points[M].y)/2)})),s[U].points.push({x:(o[U].points[W].x+o[U].points[M].x)/2,y:(o[U].points[W].y+o[U].points[M].y)/2,linesegment:this.getdirection((o[U].points[W].x+o[U].points[M].x)/2,(o[U].points[W].y+o[U].points[M].y)/2,(o[U].points[M].x+o[U].points[O].x)/2,(o[U].points[M].y+o[U].points[O].y)/2)});return s},"internodes")},{key:"testrightangle",value:e(function(o,d,s,g,M,O){return o.points[g].x===o.points[d].x&&o.points[g].x===o.points[s].x&&o.points[g].y===o.points[M].y&&o.points[g].y===o.points[O].y||o.points[g].y===o.points[d].y&&o.points[g].y===o.points[s].y&&o.points[g].x===o.points[M].x&&o.points[g].x===o.points[O].x},"testrightangle")},{key:"getdirection",value:e(function(o,d,s,g){var M=8;return o<s?d<g?M=1:d>g?M=7:M=0:o>s?d<g?M=3:d>g?M=5:M=4:d<g?M=2:d>g?M=6:M=8,M},"getdirection")},{key:"batchinternodes",value:e(function(o,d){var s=[];for(var g in o)o.hasOwnProperty(g)&&(s[g]=this.internodes(o[g],d));return s},"batchinternodes")},{key:"tracepath",value:e(function(o,d,s){var g=0,M,O,F,R={};for(R.segments=[],R.boundingbox=o.boundingbox,R.holechildren=o.holechildren,R.isholepath=o.isholepath;g<o.points.length;){var U;for(M=o.points[g].linesegment,O=-1,F=g+1;(o.points[F].linesegment===M||o.points[F].linesegment===O||O===-1)&&F<o.points.length-1;)o.points[F].linesegment!==M&&O===-1&&(O=o.points[F].linesegment),F+=1;F===o.points.length-1&&(F=0),R.segments=G()(U=R.segments).call(U,this.fitseq(o,d,s,g,F)),F>0?g=F:g=o.points.length}return R},"tracepath")},{key:"fitseq",value:e(function(o,d,s,g,M){var O;if(M>o.points.length||M<0)return[];var F=g,R=0,U=!0,W,at,ot,mt=M-g;mt<0&&(mt+=o.points.length);for(var ft=(o.points[M].x-o.points[g].x)/mt,pt=(o.points[M].y-o.points[g].y)/mt,Pt=(g+1)%o.points.length,Qt;Pt!=M;)Qt=Pt-g,Qt<0&&(Qt+=o.points.length),W=o.points[g].x+ft*Qt,at=o.points[g].y+pt*Qt,ot=(o.points[Pt].x-W)*(o.points[Pt].x-W)+(o.points[Pt].y-at)*(o.points[Pt].y-at),ot>d&&(U=!1),ot>R&&(F=Pt,R=ot),Pt=(Pt+1)%o.points.length;if(U)return[{type:"L",x1:o.points[g].x,y1:o.points[g].y,x2:o.points[M].x,y2:o.points[M].y}];var qt=F;U=!0,R=0;var ee=(qt-g)/mt,Ft=(1-ee)*(1-ee),ve=2*(1-ee)*ee,Be=ee*ee,ri=(Ft*o.points[g].x+Be*o.points[M].x-o.points[qt].x)/-ve,hi=(Ft*o.points[g].y+Be*o.points[M].y-o.points[qt].y)/-ve;for(Pt=g+1;Pt!=M;)ee=(Pt-g)/mt,Ft=(1-ee)*(1-ee),ve=2*(1-ee)*ee,Be=ee*ee,W=Ft*o.points[g].x+ve*ri+Be*o.points[M].x,at=Ft*o.points[g].y+ve*hi+Be*o.points[M].y,ot=(o.points[Pt].x-W)*(o.points[Pt].x-W)+(o.points[Pt].y-at)*(o.points[Pt].y-at),ot>s&&(U=!1),ot>R&&(F=Pt,R=ot),Pt=(Pt+1)%o.points.length;if(U)return[{type:"Q",x1:o.points[g].x,y1:o.points[g].y,x2:ri,y2:hi,x3:o.points[M].x,y3:o.points[M].y}];var Le=qt;return G()(O=this.fitseq(o,d,s,g,Le)).call(O,this.fitseq(o,d,s,Le,M))},"fitseq")},{key:"batchtracepaths",value:e(function(o,d,s){var g=[];for(var M in o)o.hasOwnProperty(M)&&g.push(this.tracepath(o[M],d,s));return g},"batchtracepaths")},{key:"batchtracelayers",value:e(function(o,d,s){var g=[];for(var M in o)o.hasOwnProperty(M)&&(g[M]=this.batchtracepaths(o[M],d,s));return g},"batchtracelayers")},{key:"roundtodec",value:e(function(o,d){return Number(o.toFixed(d))},"roundtodec")},{key:"svgpathstring",value:e(function(o,d,s,g){var M,O,F=o.layers[d],R=F[s],U="",W;if(g.linefilter&&R.segments.length<3)return U;if(U=G()(M="<path ".concat(g.desc?G()(O='desc="l '.concat(d," p ")).call(O,s,'" '):"")).call(M,this.tosvgcolorstr(o.palette[d],g),'d="'),g.roundcoords===-1){var at;for(U+=G()(at="M ".concat(R.segments[0].x1*g.scale," ")).call(at,R.segments[0].y1*g.scale," "),W=0;W<R.segments.length;W++){var ot,mt;if(U+=G()(ot=G()(mt="".concat(R.segments[W].type," ")).call(mt,R.segments[W].x2*g.scale," ")).call(ot,R.segments[W].y2*g.scale," "),R.segments[W].hasOwnProperty("x3")){var ft;U+=G()(ft="".concat(R.segments[W].x3*g.scale," ")).call(ft,R.segments[W].y3*g.scale," ")}}U+="Z "}else{var pt;for(U+=G()(pt="M ".concat(this.roundtodec(R.segments[0].x1*g.scale,g.roundcoords)," ")).call(pt,this.roundtodec(R.segments[0].y1*g.scale,g.roundcoords)," "),W=0;W<R.segments.length;W++){var Pt,Qt;if(U+=G()(Pt=G()(Qt="".concat(R.segments[W].type," ")).call(Qt,this.roundtodec(R.segments[W].x2*g.scale,g.roundcoords)," ")).call(Pt,this.roundtodec(R.segments[W].y2*g.scale,g.roundcoords)," "),R.segments[W].hasOwnProperty("x3")){var qt;U+=G()(qt="".concat(this.roundtodec(R.segments[W].x3*g.scale,g.roundcoords)," ")).call(qt,this.roundtodec(R.segments[W].y3*g.scale,g.roundcoords)," ")}}U+="Z "}for(var ee=0;ee<R.holechildren.length;ee++){var Ft=F[R.holechildren[ee]];if(g.roundcoords===-1){if(Ft.segments[Ft.segments.length-1].hasOwnProperty("x3")){var ve;U+=G()(ve="M ".concat(Ft.segments[Ft.segments.length-1].x3*g.scale," ")).call(ve,Ft.segments[Ft.segments.length-1].y3*g.scale," ")}else{var Be;U+=G()(Be="M ".concat(Ft.segments[Ft.segments.length-1].x2*g.scale," ")).call(Be,Ft.segments[Ft.segments.length-1].y2*g.scale," ")}for(W=Ft.segments.length-1;W>=0;W--){var ri;if(U+="".concat(Ft.segments[W].type," "),Ft.segments[W].hasOwnProperty("x3")){var hi;U+=G()(hi="".concat(Ft.segments[W].x2*g.scale," ")).call(hi,Ft.segments[W].y2*g.scale," ")}U+=G()(ri="".concat(Ft.segments[W].x1*g.scale," ")).call(ri,Ft.segments[W].y1*g.scale," ")}}else{if(Ft.segments[Ft.segments.length-1].hasOwnProperty("x3")){var Le;U+=G()(Le="M ".concat(this.roundtodec(Ft.segments[Ft.segments.length-1].x3*g.scale)," ")).call(Le,this.roundtodec(Ft.segments[Ft.segments.length-1].y3*g.scale)," ")}else{var Fi;U+=G()(Fi="M ".concat(this.roundtodec(Ft.segments[Ft.segments.length-1].x2*g.scale)," ")).call(Fi,this.roundtodec(Ft.segments[Ft.segments.length-1].y2*g.scale)," ")}for(W=Ft.segments.length-1;W>=0;W--){var zi;if(U+="".concat(Ft.segments[W].type," "),Ft.segments[W].hasOwnProperty("x3")){var Qe;U+=G()(Qe="".concat(this.roundtodec(Ft.segments[W].x2*g.scale)," ")).call(Qe,this.roundtodec(Ft.segments[W].y2*g.scale)," ")}U+=G()(zi="".concat(this.roundtodec(Ft.segments[W].x1*g.scale)," ")).call(zi,this.roundtodec(Ft.segments[W].y1*g.scale)," ")}}U+="Z "}if(U+='" />',g.lcpr||g.qcpr){for(W=0;W<R.segments.length;W++){if(R.segments[W].hasOwnProperty("x3")&&g.qcpr){var ns,ss,as,os,ls,cs,us,hs,fs,ds,gs,vs,ps,ms;U+=G()(ns=G()(ss=G()(as='<circle cx="'.concat(R.segments[W].x2*g.scale,'" cy="')).call(as,R.segments[W].y2*g.scale,'" r="')).call(ss,g.qcpr,'" fill="cyan" stroke-width="')).call(ns,g.qcpr*.2,'" stroke="black" />'),U+=G()(os=G()(ls=G()(cs='<circle cx="'.concat(R.segments[W].x3*g.scale,'" cy="')).call(cs,R.segments[W].y3*g.scale,'" r="')).call(ls,g.qcpr,'" fill="white" stroke-width="')).call(os,g.qcpr*.2,'" stroke="black" />'),U+=G()(us=G()(hs=G()(fs=G()(ds='<line x1="'.concat(R.segments[W].x1*g.scale,'" y1="')).call(ds,R.segments[W].y1*g.scale,'" x2="')).call(fs,R.segments[W].x2*g.scale,'" y2="')).call(hs,R.segments[W].y2*g.scale,'" stroke-width="')).call(us,g.qcpr*.2,'" stroke="cyan" />'),U+=G()(gs=G()(vs=G()(ps=G()(ms='<line x1="'.concat(R.segments[W].x2*g.scale,'" y1="')).call(ms,R.segments[W].y2*g.scale,'" x2="')).call(ps,R.segments[W].x3*g.scale,'" y2="')).call(vs,R.segments[W].y3*g.scale,'" stroke-width="')).call(gs,g.qcpr*.2,'" stroke="cyan" />')}if(!R.segments[W].hasOwnProperty("x3")&&g.lcpr){var ys,bs,Cs;U+=G()(ys=G()(bs=G()(Cs='<circle cx="'.concat(R.segments[W].x2*g.scale,'" cy="')).call(Cs,R.segments[W].y2*g.scale,'" r="')).call(bs,g.lcpr,'" fill="white" stroke-width="')).call(ys,g.lcpr*.2,'" stroke="black" />')}}for(var ee=0;ee<R.holechildren.length;ee++){var Ft=F[R.holechildren[ee]];for(W=0;W<Ft.segments.length;W++){if(Ft.segments[W].hasOwnProperty("x3")&&g.qcpr){var _s,fi,Ji,Pc,Lc,Nc,Rc,jc,Fc,zc,Bc,Uc,Hc,Wc;U+=G()(_s=G()(fi=G()(Ji='<circle cx="'.concat(Ft.segments[W].x2*g.scale,'" cy="')).call(Ji,Ft.segments[W].y2*g.scale,'" r="')).call(fi,g.qcpr,'" fill="cyan" stroke-width="')).call(_s,g.qcpr*.2,'" stroke="black" />'),U+=G()(Pc=G()(Lc=G()(Nc='<circle cx="'.concat(Ft.segments[W].x3*g.scale,'" cy="')).call(Nc,Ft.segments[W].y3*g.scale,'" r="')).call(Lc,g.qcpr,'" fill="white" stroke-width="')).call(Pc,g.qcpr*.2,'" stroke="black" />'),U+=G()(Rc=G()(jc=G()(Fc=G()(zc='<line x1="'.concat(Ft.segments[W].x1*g.scale,'" y1="')).call(zc,Ft.segments[W].y1*g.scale,'" x2="')).call(Fc,Ft.segments[W].x2*g.scale,'" y2="')).call(jc,Ft.segments[W].y2*g.scale,'" stroke-width="')).call(Rc,g.qcpr*.2,'" stroke="cyan" />'),U+=G()(Bc=G()(Uc=G()(Hc=G()(Wc='<line x1="'.concat(Ft.segments[W].x2*g.scale,'" y1="')).call(Wc,Ft.segments[W].y2*g.scale,'" x2="')).call(Hc,Ft.segments[W].x3*g.scale,'" y2="')).call(Uc,Ft.segments[W].y3*g.scale,'" stroke-width="')).call(Bc,g.qcpr*.2,'" stroke="cyan" />')}if(!Ft.segments[W].hasOwnProperty("x3")&&g.lcpr){var Yc,Gc,Xc;U+=G()(Yc=G()(Gc=G()(Xc='<circle cx="'.concat(Ft.segments[W].x2*g.scale,'" cy="')).call(Xc,Ft.segments[W].y2*g.scale,'" r="')).call(Gc,g.lcpr,'" fill="white" stroke-width="')).call(Yc,g.lcpr*.2,'" stroke="black" />')}}}}return U},"svgpathstring")},{key:"getsvgstring",value:e(function(o,d){var s,g,M;d=this.checkoptions(d);for(var O=o.width*d.scale,F=o.height*d.scale,R=G()(s="<svg ".concat(d.viewbox?G()(g='viewBox="0 0 '.concat(O," ")).call(g,F,'" '):G()(M='width="'.concat(O,'" height="')).call(M,F,'" '),'version="1.1" xmlns="http://www.w3.org/2000/svg" desc="Created with imagetracer.js version ')).call(s,this.versionnumber,'" >'),U=0;U<o.layers.length;U+=1)for(var W=0;W<o.layers[U].length;W+=1)o.layers[U][W].isholepath||(R+=this.svgpathstring(o,U,W,d));return R+="</svg>",R},"getsvgstring")},{key:"compareNumbers",value:e(function(o,d){return o-d},"compareNumbers")},{key:"torgbastr",value:e(function(o){var d,s,g;return G()(d=G()(s=G()(g="rgba(".concat(o.r,",")).call(g,o.g,",")).call(s,o.b,",")).call(d,o.a,")")},"torgbastr")},{key:"tosvgcolorstr",value:e(function(o,d){var s,g,M,O,F,R,U;return G()(s=G()(g=G()(M=G()(O=G()(F=G()(R=G()(U='fill="rgb('.concat(o.r,",")).call(U,o.g,",")).call(R,o.b,')" stroke="rgb(')).call(F,o.r,",")).call(O,o.g,",")).call(M,o.b,')" stroke-width="')).call(g,d.strokewidth,'" opacity="')).call(s,o.a/255,'" ')},"tosvgcolorstr")},{key:"appendSVGString",value:e(function(o,d){var s;d?(s=document.getElementById(d),s||(s=document.createElement("div"),s.id=d,document.body.appendChild(s))):(s=document.createElement("div"),document.body.appendChild(s)),s.innerHTML+=o},"appendSVGString")},{key:"blur",value:e(function(o,d,s){var g,M,O,F,R,U,W,at,ot,mt,ft={width:o.width,height:o.height,data:[]};if(d=Math.floor(d),d<1)return o;d>5&&(d=5),s=Math.abs(s),s>1024&&(s=1024);var pt=this.gks[d-1];for(M=0;M<o.height;M++)for(g=0;g<o.width;g++){for(U=0,W=0,at=0,ot=0,mt=0,O=-d;O<d+1;O++)g+O>0&&g+O<o.width&&(R=(M*o.width+g+O)*4,U+=o.data[R]*pt[O+d],W+=o.data[R+1]*pt[O+d],at+=o.data[R+2]*pt[O+d],ot+=o.data[R+3]*pt[O+d],mt+=pt[O+d]);R=(M*o.width+g)*4,ft.data[R]=Math.floor(U/mt),ft.data[R+1]=Math.floor(W/mt),ft.data[R+2]=Math.floor(at/mt),ft.data[R+3]=Math.floor(ot/mt)}var Pt=new Uint8ClampedArray(ft.data);for(M=0;M<o.height;M++)for(g=0;g<o.width;g++){for(U=0,W=0,at=0,ot=0,mt=0,O=-d;O<d+1;O++)M+O>0&&M+O<o.height&&(R=((M+O)*o.width+g)*4,U+=Pt[R]*pt[O+d],W+=Pt[R+1]*pt[O+d],at+=Pt[R+2]*pt[O+d],ot+=Pt[R+3]*pt[O+d],mt+=pt[O+d]);R=(M*o.width+g)*4,ft.data[R]=Math.floor(U/mt),ft.data[R+1]=Math.floor(W/mt),ft.data[R+2]=Math.floor(at/mt),ft.data[R+3]=Math.floor(ot/mt)}for(M=0;M<o.height;M++)for(g=0;g<o.width;g++)R=(M*o.width+g)*4,F=Math.abs(ft.data[R]-o.data[R])+Math.abs(ft.data[R+1]-o.data[R+1])+Math.abs(ft.data[R+2]-o.data[R+2])+Math.abs(ft.data[R+3]-o.data[R+3]),F>s&&(ft.data[R]=o.data[R],ft.data[R+1]=o.data[R+1],ft.data[R+2]=o.data[R+2],ft.data[R+3]=o.data[R+3]);return ft},"blur")},{key:"loadImage",value:e(function(o,d,s){var g=new Image;s&&s.corsenabled&&(g.crossOrigin="Anonymous"),g.src=o,g.onload=function(){var M=document.createElement("canvas");M.width=g.width,M.height=g.height;var O=M.getContext("2d");O.drawImage(g,0,0),d(M)}},"loadImage")},{key:"getImgdata",value:e(function(o){var d=o.getContext("2d");return d.getImageData(0,0,o.width,o.height)},"getImgdata")},{key:"drawLayers",value:e(function(o,d,s,g){s=s||1;var M,O,F,R,U,W;g?(W=document.getElementById(g),W||(W=document.createElement("div"),W.id=g,document.body.appendChild(W))):(W=document.createElement("div"),document.body.appendChild(W));for(U in o)if(o.hasOwnProperty(U)){M=o[U][0].length,O=o[U].length;var at=document.createElement("canvas");at.width=M*s,at.height=O*s;var ot=at.getContext("2d");for(R=0;R<O;R+=1)for(F=0;F<M;F+=1)ot.fillStyle=this.torgbastr(d[o[U][R][F]%d.length]),ot.fillRect(F*s,R*s,s,s);W.appendChild(at)}},"drawLayers")}],[{key:"tracerDefaultOption",value:e(function(){return{pathomit:100,ltres:.1,qtres:1,scale:1,strokewidth:5,viewbox:!1,linefilter:!0,desc:!1,rightangleenhance:!1,pal:[{r:0,g:0,b:0,a:255},{r:255,g:255,b:255,a:255}]}},"tracerDefaultOption")}]),k}(),qd={getActions:e(function(){return{main:this._mainAction(),shape:this._shapeAction(),crop:this._cropAction(),resize:this._resizeAction(),flip:this._flipAction(),rotate:this._rotateAction(),text:this._textAction(),mask:this._maskAction(),draw:this._drawAction(),icon:this._iconAction(),filter:this._filterAction(),history:this._historyAction()}},"getActions"),_mainAction:e(function(){var C=this,o=e(function(){C.ui.submenu==="crop"&&(C.stopDrawingMode(),C.ui.changeMenu("crop"))},"exitCropOnAction"),d=e(function(U){C.ui.submenu==="rotate"&&C.ui.rotate.setRangeBarAngle("setAngle",U)},"setAngleRangeBarOnAction"),s=e(function(U){C.ui.submenu==="filter"&&lr()(C.ui).setFilterState(U)},"setFilterStateRangeBarOnAction"),g=e(function(U){return d(U),s(U),U},"onEndUndoRedo"),M=e(function(){var U=C._graphics.getZoomMode();C.stopDrawingMode(),U!==We.ZOOM?(C.startDrawingMode(ge.ZOOM),C._graphics.startZoomInMode()):C._graphics.endZoomInMode()},"toggleZoomMode"),O=e(function(){var U=C._graphics.getZoomMode();C.stopDrawingMode(),U!==We.HAND?(C.startDrawingMode(ge.ZOOM),C._graphics.startHandMode()):C._graphics.endHandMode()},"toggleHandMode"),F=e(function(){lr()(C.ui)&&lr()(C.ui).initFilterCheckBoxState()},"initFilterState");return Z()({initLoadImage:e(function(U,W){return C.loadImageFromURL(U,W).then(function(at){o(),C.ui.initializeImgUrl=U,C.ui.resizeEditor({imageSize:at}),C.clearUndoStack(),C._invoker.fire(Mt.EXECUTE_COMMAND,ue.LOAD_IMAGE)})},"initLoadImage"),undo:e(function(){C.isEmptyUndoStack()||(o(),C.deactivateAll(),C.undo().then(g))},"undo"),redo:e(function(){C.isEmptyRedoStack()||(o(),C.deactivateAll(),C.redo().then(g))},"redo"),reset:e(function(){o(),C.loadImageFromURL(C.ui.initializeImgUrl,"resetImage").then(function(U){o(),F(),C.ui.resizeEditor({imageSize:U}),C.clearUndoStack(),C._initHistory()})},"reset"),delete:e(function(){C.ui.changeHelpButtonEnabled("delete",!1),o(),C.removeActiveObject(),C.activeObjectId=null},"_delete"),deleteAll:e(function(){o(),C.clearObjects(),C.ui.changeHelpButtonEnabled("delete",!1),C.ui.changeHelpButtonEnabled("deleteAll",!1)},"deleteAll"),load:e(function(U){Ke()||alert("This browser does not support file-api"),C.ui.initializeImgUrl=it().createObjectURL(U),C.loadImageFromFile(U).then(function(W){o(),F(),C.clearUndoStack(),C.ui.activeMenuEvent(),C.ui.resizeEditor({imageSize:W}),C._clearHistory(),C._invoker.fire(Mt.EXECUTE_COMMAND,ue.LOAD_IMAGE)}).catch(function(W){return xt().reject(W)})},"load"),download:e(function(){var U=C.toDataURL(),W=C.getImageName(),at,ot,mt;Ke()&&window.saveAs?(at=Qh(U),ot=at.type.split("/")[1],W.split(".").pop()!==ot&&(W+=".".concat(ot)),saveAs(at,W)):(mt=window.open(),mt.document.body.innerHTML="<img src='".concat(U,"'>"))},"download"),history:e(function(U){C.ui.toggleHistoryMenu(U)},"history"),zoomIn:e(function(){C.ui.toggleZoomButtonStatus("zoomIn"),C.deactivateAll(),M()},"zoomIn"),zoomOut:e(function(){C._graphics.zoomOut()},"zoomOut"),hand:e(function(){C.ui.offZoomInButtonStatus(),C.ui.toggleZoomButtonStatus("hand"),C.deactivateAll(),O()},"hand")},this._commonAction())},"_mainAction"),_iconAction:e(function(){var C=this;return Z()({changeColor:e(function(d){C.activeObjectId&&C.changeIconColor(C.activeObjectId,d)},"changeColor"),addIcon:e(function(d,s){C.startDrawingMode("ICON"),C.setDrawingIcon(d,s)},"addIcon"),cancelAddIcon:e(function(){C.ui.icon.clearIconType(),C.changeSelectableAll(!0),C.changeCursor("default"),C.stopDrawingMode()},"cancelAddIcon"),registerDefaultIcons:e(function(d,s){var g={};g[d]=s,C.registerIcons(g)},"registerDefaultIcons"),registerCustomIcon:e(function(d,s){var g=new Zl;g.imageToSVG(d,function(M){var O=M.match(/path[^>]*d="([^"]*)"/),F=ht(O,2),R=F[1],U={};U[s.name]=R,C.registerIcons(U),C.addIcon(s.name,{left:100,top:100})},Zl.tracerDefaultOption())},"registerCustomIcon")},this._commonAction())},"_iconAction"),_drawAction:e(function(){var C=this;return Z()({setDrawMode:e(function(d,s){C.stopDrawingMode(),d==="free"?C.startDrawingMode("FREE_DRAWING",s):C.startDrawingMode("LINE_DRAWING",s)},"setDrawMode"),setColor:e(function(d){C.setBrush({color:d})},"setColor")},this._commonAction())},"_drawAction"),_maskAction:e(function(){var C=this;return Z()({loadImageFromURL:e(function(d,s){return C.loadImageFromURL(C.toDataURL(),"FilterImage").then(function(){C.addImageObject(d).then(function(){it().revokeObjectURL(s)}),C._invoker.fire(Mt.EXECUTE_COMMAND,ue.LOAD_MASK_IMAGE)})},"loadImageFromURL"),applyFilter:e(function(){C.applyFilter("mask",{maskObjId:C.activeObjectId})},"applyFilter")},this._commonAction())},"_maskAction"),_textAction:e(function(){var C=this;return Z()({changeTextStyle:e(function(d,s){C.activeObjectId&&C.changeTextStyle(C.activeObjectId,d,s)},"changeTextStyle")},this._commonAction())},"_textAction"),_rotateAction:e(function(){var C=this;return Z()({rotate:e(function(d,s){C.rotate(d,s),C.ui.resizeEditor(),C.ui.rotate.setRangeBarAngle("rotate",d)},"rotate"),setAngle:e(function(d,s){C.setAngle(d,s),C.ui.resizeEditor(),C.ui.rotate.setRangeBarAngle("setAngle",d)},"setAngle")},this._commonAction())},"_rotateAction"),_shapeAction:e(function(){var C=this;return Z()({changeShape:e(function(d,s){C.activeObjectId&&C.changeShape(C.activeObjectId,d,s)},"changeShape"),setDrawingShape:e(function(d){C.setDrawingShape(d)},"setDrawingShape")},this._commonAction())},"_shapeAction"),_cropAction:e(function(){var C=this;return Z()({crop:e(function(){var d=C.getCropzoneRect();d&&!lf(d)&&C.crop(d).then(function(){C.stopDrawingMode(),C.ui.resizeEditor(),C.ui.changeMenu("crop"),C._invoker.fire(Mt.EXECUTE_COMMAND,ue.CROP)}).catch(function(s){return xt().reject(s)})},"crop"),cancel:e(function(){C.stopDrawingMode(),C.ui.changeMenu("crop")},"cancel"),preset:e(function(d){switch(d){case"preset-square":C.setCropzoneRect(1/1);break;case"preset-3-2":C.setCropzoneRect(3/2);break;case"preset-4-3":C.setCropzoneRect(4/3);break;case"preset-5-4":C.setCropzoneRect(5/4);break;case"preset-7-5":C.setCropzoneRect(7/5);break;case"preset-16-9":C.setCropzoneRect(16/9);break;default:C.setCropzoneRect(),C.ui.crop.changeApplyButtonStatus(!1);break}},"preset")},this._commonAction())},"_cropAction"),_resizeAction:e(function(){var C=this;return Z()({getCurrentDimensions:e(function(){return C._graphics.getCurrentDimensions()},"getCurrentDimensions"),preview:e(function(d,s,g){var M=C._graphics.getCurrentDimensions(),O=e(function(){return M.width/M.height},"calcAspectRatio"),F={};switch(d){case"width":F.width=s,g?F.height=s/O():F.height=M.height;break;case"height":F.height=s,g?F.width=s*O():F.width=M.width;break;default:F=M}C._graphics.resize(F).then(function(){C.ui.resizeEditor()}),g&&(C.ui.resize.setWidthValue(F.width),C.ui.resize.setHeightValue(F.height))},"preview"),lockAspectRatio:e(function(d,s,g){var M=C._graphics.getCurrentDimensions(),O=M.width,F=M.height,R=O/F;if(d)if(O>F){var U=g/R,W=s*R;C.ui.resize.setLimit({minWidth:W>s?W:s,minHeight:s,maxWidth:g,maxHeight:U<g?U:g})}else{var at=g*R,ot=s/R;C.ui.resize.setLimit({minWidth:s,minHeight:ot>s?ot:s,maxWidth:at<g?at:g,maxHeight:g})}else C.ui.resize.setLimit({minWidth:s,minHeight:s,maxWidth:g,maxHeight:g})},"lockAspectRatio"),resize:e(function(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;d||(d=C._graphics.getCurrentDimensions()),C.resize(d).then(function(){C._graphics.setOriginalDimensions(d),C.stopDrawingMode(),C.ui.resizeEditor(),C.ui.changeMenu("resize")}).catch(function(s){return xt().reject(s)})},"resize"),reset:e(function(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,s=C._graphics.getOriginalDimensions();C.ui.resize.setWidthValue(s.width,!0),C.ui.resize.setHeightValue(s.height,!0),C._graphics.resize(s).then(function(){d||(C.stopDrawingMode(),C.ui.resizeEditor(),C.ui.changeMenu("resize"))})},"reset")},this._commonAction())},"_resizeAction"),_flipAction:e(function(){var C=this;return Z()({flip:e(function(d){return C[d]()},"flip")},this._commonAction())},"_flipAction"),_filterAction:e(function(){var C=this;return Z()({applyFilter:e(function(d,s,g,M){d?C.applyFilter(s,g,M):C.hasFilter(s)&&C.removeFilter(s)},"applyFilter")},this._commonAction())},"_filterAction"),setReAction:e(function(){var C=this;this.on({undoStackChanged:e(function(d){d?(C.ui.changeHelpButtonEnabled("undo",!0),C.ui.changeHelpButtonEnabled("reset",!0)):(C.ui.changeHelpButtonEnabled("undo",!1),C.ui.changeHelpButtonEnabled("reset",!1)),C.ui.resizeEditor()},"undoStackChanged"),redoStackChanged:e(function(d){d?C.ui.changeHelpButtonEnabled("redo",!0):C.ui.changeHelpButtonEnabled("redo",!1),C.ui.resizeEditor()},"redoStackChanged"),objectActivated:e(function(d){var s,g;C.activeObjectId=d.id,C.ui.changeHelpButtonEnabled("delete",!0),C.ui.changeHelpButtonEnabled("deleteAll",!0),d.type==="cropzone"?C.ui.crop.changeApplyButtonStatus(!0):c()(s=["rect","circle","triangle"]).call(s,d.type)>-1?(C.stopDrawingMode(),C.ui.submenu!=="shape"&&C.ui.changeMenu("shape",!1,!1),C.ui.shape.setShapeStatus({strokeColor:d.stroke,strokeWidth:d.strokeWidth,fillColor:Ct()(d)}),C.ui.shape.setMaxStrokeValue(Math.min(d.width,d.height))):d.type==="path"||d.type==="line"?C.ui.submenu!=="draw"&&(C.ui.changeMenu("draw",!1,!1),C.ui.draw.changeStandbyMode()):c()(g=["i-text","text"]).call(g,d.type)>-1?(C.ui.submenu!=="text"&&C.ui.changeMenu("text",!1,!1),C.ui.text.setTextStyleStateOnAction(d)):d.type==="icon"&&(C.stopDrawingMode(),C.ui.submenu!=="icon"&&C.ui.changeMenu("icon",!1,!1),C.ui.icon.setIconPickerColor(Ct()(d)))},"objectActivated"),addText:e(function(d){var s=C.ui.text,g=s.textColor,M=s.fontSize,O=s.fontStyle,F=s.fontWeight,R=s.underline,U="Noto Sans";C.addText("Double Click",{position:d.originPosition,styles:{fill:g,fontSize:M,fontFamily:U,fontStyle:O,fontWeight:F,underline:R}}).then(function(){C.changeCursor("default")})},"addText"),addObjectAfter:e(function(d){var s;d.type==="icon"?C.ui.icon.changeStandbyMode():c()(s=["rect","circle","triangle"]).call(s,d.type)>-1&&(C.ui.shape.setMaxStrokeValue(Math.min(d.width,d.height)),C.ui.shape.changeStandbyMode())},"addObjectAfter"),objectScaled:e(function(d){var s,g;if(c()(s=["i-text","text"]).call(s,d.type)>-1)C.ui.text.fontSize=Nt(d.fontSize);else if(c()(g=["rect","circle","triangle"]).call(g,d.type)>=0){var M=d.width,O=d.height,F=C.ui.shape.getStrokeValue();M<F&&C.ui.shape.setStrokeValue(M),O<F&&C.ui.shape.setStrokeValue(O)}},"objectScaled"),selectionCleared:e(function(){C.activeObjectId=null,C.ui.submenu==="text"?C.changeCursor("text"):Zn(["draw","crop","resize"],C.ui.submenu)||C.stopDrawingMode()},"selectionCleared")})},"setReAction"),_historyAction:e(function(){var C=this;return{undo:e(function(d){return C.undo(d)},"undo"),redo:e(function(d){return C.redo(d)},"redo")}},"_historyAction"),_commonAction:e(function(){var C=this,o,d,s,g,M=ge.TEXT,O=ge.CROPPER,F=ge.SHAPE,R=ge.ZOOM,U=ge.RESIZE;return{modeChange:e(function(at){switch(at){case Ye.TEXT:C._changeActivateMode(M);break;case Ye.CROP:C.startDrawingMode(O);break;case Ye.SHAPE:C._changeActivateMode(F),C.setDrawingShape(C.ui.shape.type,C.ui.shape.options);break;case Ye.ZOOM:C.startDrawingMode(R);break;case Ye.RESIZE:C.startDrawingMode(U);break;default:break}},"modeChange"),deactivateAll:q()(o=this.deactivateAll).call(o,this),changeSelectableAll:q()(d=this.changeSelectableAll).call(d,this),discardSelection:q()(s=this.discardSelection).call(s,this),stopDrawingMode:q()(g=this.stopDrawingMode).call(g,this)}},"_commonAction"),mixin:e(function(C){Z()(C.prototype,this)},"mixin")},tg=u(602),Jl=u.n(tg),eg=u(5573),Qn=u.n(eg),ig=function(){function k(C,o){V(this,k),this.name=C,this.graphics=o}return e(k,"Component"),rt(k,[{key:"fire",value:e(function(){for(var o=this.graphics,d=arguments.length,s=new Array(d),g=0;g<d;g++)s[g]=arguments[g];return this.graphics.fire.apply(o,s)},"fire")},{key:"setCanvasImage",value:e(function(o,d){this.graphics.setCanvasImage(o,d)},"setCanvasImage")},{key:"getCanvasElement",value:e(function(){return this.graphics.getCanvasElement()},"getCanvasElement")},{key:"getCanvas",value:e(function(){return this.graphics.getCanvas()},"getCanvas")},{key:"getCanvasImage",value:e(function(){return this.graphics.getCanvasImage()},"getCanvasImage")},{key:"getImageName",value:e(function(){return this.graphics.getImageName()},"getImageName")},{key:"getEditor",value:e(function(){return this.graphics.getEditor()},"getEditor")},{key:"getName",value:e(function(){return this.name},"getName")},{key:"setImageProperties",value:e(function(o,d){this.graphics.setImageProperties(o,d)},"setImageProperties")},{key:"setCanvasCssDimension",value:e(function(o){this.graphics.setCanvasCssDimension(o)},"setCanvasCssDimension")},{key:"setCanvasBackstoreDimension",value:e(function(o){this.graphics.setCanvasBackstoreDimension(o)},"setCanvasBackstoreDimension")},{key:"adjustCanvasDimension",value:e(function(){this.graphics.adjustCanvasDimension()},"adjustCanvasDimension")},{key:"adjustCanvasDimensionBase",value:e(function(){this.graphics.adjustCanvasDimensionBase()},"adjustCanvasDimensionBase")}]),k}(),oi=ig;function rg(k){var C=ng();return e(function(){var d=Kt(k),s;if(C){var g=Kt(this).constructor;s=At()(d,arguments,g)}else s=d.apply(this,arguments);return _e(this,s)},"_createSuperInternal")}e(rg,"imageLoader_createSuper");function ng(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch{return!1}}e(ng,"imageLoader_isNativeReflectConstruct");var sg={padding:0,crossOrigin:"Anonymous"},ag=function(k){Ce(o,k);var C=rg(o);function o(d){return V(this,o),C.call(this,jt.IMAGE_LOADER,d)}return e(o,"ImageLoader"),rt(o,[{key:"load",value:e(function(s,g){var M=this,O;if(!s&&!g){var F=this.getCanvas();F.backgroundImage=null,F.renderAll(),O=new(xt())(function(R){M.setCanvasImage("",null),R()})}else O=this._setBackgroundImage(g).then(function(R){return M.setCanvasImage(s,R),M.adjustCanvasDimension(),R});return O},"load")},{key:"_setBackgroundImage",value:e(function(s){var g=this;return s?new(xt())(function(M,O){var F=g.getCanvas();F.setBackgroundImage(s,function(){var R=F.backgroundImage;R&&R.getElement()?M(R):O(be.loadingImageFailed)},sg)}):xt().reject(be.loadImage)},"_setBackgroundImage")}]),o}(oi),og=ag,lg="tl",cg="tr",ug="mt",hg="ml",fg="mr",dg="mb",gg="bl",vg="br",Kl=[lg,cg,ug,hg,fg,dg,gg,vg],Aa=e(function(){},"NOOP_FUNCTION");function pg(k){return c()(Kl).call(Kl,k)>=0}e(pg,"cornerTypeValid");function qn(k,C){return k>C?"width":"height"}e(qn,"getScaleBasis");var mg=ut.fabric.util.createClass(ut.fabric.Rect,{initialize:e(function(C,o,d){o=Z()(o,d),o.type="cropzone",this.callSuper("initialize",o),this._addEventHandler(),this.canvas=C,this.options=o},"initialize"),canvasEventDelegation:e(function(C){var o,d="unregistered",s=this.canvasEventTrigger[C]!==Aa;return s?d="registered":c()(o=[Mt.OBJECT_MOVED,Mt.OBJECT_SCALED]).call(o,C)<0&&(d="none"),d},"canvasEventDelegation"),canvasEventRegister:e(function(C,o){this.canvasEventTrigger[C]=o},"canvasEventRegister"),_addEventHandler:e(function(){var C,o,d,s,g;this.canvasEventTrigger=(C={},H(C,Mt.OBJECT_MOVED,Aa),H(C,Mt.OBJECT_SCALED,Aa),C),this.on({moving:q()(o=this._onMoving).call(o,this),scaling:q()(d=this._onScaling).call(d,this)}),ut.fabric.util.addListener(document,"keydown",q()(s=this._onKeyDown).call(s,this)),ut.fabric.util.addListener(document,"keyup",q()(g=this._onKeyUp).call(g,this))},"_addEventHandler"),_renderCropzone:e(function(C){var o=7,d=7,s=this.flipX?-1:1,g=this.flipY?-1:1,M=s/this.scaleX,O=g/this.scaleY;C.scale(M,O),this._fillOuterRect(C,"rgba(0, 0, 0, 0.5)"),this.options.lineWidth?(this._fillInnerRect(C),this._strokeBorder(C,"rgb(255, 255, 255)",{lineWidth:this.options.lineWidth})):(this._strokeBorder(C,"rgb(0, 0, 0)",{lineDashWidth:o}),this._strokeBorder(C,"rgb(255, 255, 255)",{lineDashWidth:o,lineDashOffset:d})),C.scale(1/M,1/O)},"_renderCropzone"),_render:e(function(C){this.callSuper("_render",C),this._renderCropzone(C)},"_render"),_fillOuterRect:e(function(C,o){var d=this._getCoordinates(),s=d.x,g=d.y;C.save(),C.fillStyle=o,C.beginPath(),C.moveTo(s[0]-1,g[0]-1),C.lineTo(s[3]+1,g[0]-1),C.lineTo(s[3]+1,g[3]+1),C.lineTo(s[0]-1,g[3]+1),C.lineTo(s[0]-1,g[0]-1),C.closePath(),C.moveTo(s[1],g[1]),C.lineTo(s[1],g[2]),C.lineTo(s[2],g[2]),C.lineTo(s[2],g[1]),C.lineTo(s[1],g[1]),C.closePath(),Ct()(C).call(C),C.restore()},"_fillOuterRect"),_fillInnerRect:e(function(C){var o=this._getCoordinates(),d=o.x,s=o.y,g=this._caculateInnerPosition(d,(d[2]-d[1])/3),M=this._caculateInnerPosition(s,(s[2]-s[1])/3);C.save(),C.strokeStyle="rgba(255, 255, 255, 0.7)",C.lineWidth=this.options.lineWidth,C.beginPath(),C.moveTo(g[0],M[1]),C.lineTo(g[3],M[1]),C.moveTo(g[0],M[2]),C.lineTo(g[3],M[2]),C.moveTo(g[1],M[0]),C.lineTo(g[1],M[3]),C.moveTo(g[2],M[0]),C.lineTo(g[2],M[3]),C.stroke(),C.closePath(),C.restore()},"_fillInnerRect"),_caculateInnerPosition:e(function(C,o){var d=[];return d[0]=C[1],d[1]=C[1]+o,d[2]=C[1]+o*2,d[3]=C[2],d},"_caculateInnerPosition"),_getCoordinates:e(function(){var C,o,d=this.canvas,s=this.width,g=this.height,M=this.left,O=this.top,F=s/2,R=g/2,U=d.getHeight(),W=d.getWidth();return{x:pi()(C=[-(F+M),-F,F,F+(W-M-s)]).call(C,Math.ceil),y:pi()(o=[-(R+O),-R,R,R+(U-O-g)]).call(o,Math.ceil)}},"_getCoordinates"),_strokeBorder:e(function(C,o,d){var s=d.lineDashWidth,g=d.lineDashOffset,M=d.lineWidth,O=this.width/2,F=this.height/2;C.save(),C.strokeStyle=o,C.setLineDash&&C.setLineDash([s,s]),g&&(C.lineDashOffset=g),M&&(C.lineWidth=M),C.beginPath(),C.moveTo(-O,-F),C.lineTo(O,-F),C.lineTo(O,F),C.lineTo(-O,F),C.lineTo(-O,-F),C.stroke(),C.restore()},"_strokeBorder"),_onMoving:e(function(){var C=this.height,o=this.width,d=this.left,s=this.top,g=this.canvas.getWidth()-o,M=this.canvas.getHeight()-C;this.left=re(d,0,g),this.top=re(s,0,M),this.canvasEventTrigger[Mt.OBJECT_MOVED](this)},"_onMoving"),_onScaling:e(function(C){var o=C.transform.corner,d=this.canvas.getPointer(C.e),s=this._calcScalingSizeFromPointer(d,o);this.scale(1).set(s),this.canvasEventTrigger[Mt.OBJECT_SCALED](this)},"_onScaling"),_calcScalingSizeFromPointer:e(function(C,o){var d=pg(o);return d&&this._resizeCropZone(C,o)},"_calcScalingSizeFromPointer"),adjustRatioCropzoneSize:e(function(C){var o=C.width,d=C.height,s=C.leftMaker,g=C.topMaker,M=C.maxWidth,O=C.maxHeight,F=C.scaleTo;if(o=M?re(o,1,M):o,d=O?re(d,1,O):d,!this.presetRatio)return this._withShiftKey&&(o>d?d=o:d>o&&(o=d)),{width:o,height:d,left:s(o),top:g(d)};F==="width"?d=o/this.presetRatio:o=d*this.presetRatio;var R=Math.min(M/o,O/d);if(R<=1){var U,W=pi()(U=[o,d]).call(U,function(ot){return ot*R}),at=ht(W,2);o=at[0],d=at[1]}return{width:o,height:d,left:s(o),top:g(d)}},"adjustRatioCropzoneSize"),_getCropzoneRectInfo:e(function(){var C=this.canvas,o=C.width,d=C.height,s=this.getBoundingRect(!1,!0),g=s.top,M=s.left,O=s.width,F=s.height;return{rectTop:g,rectLeft:M,rectWidth:O,rectHeight:F,rectRight:M+O,rectBottom:g+F,canvasWidth:o,canvasHeight:d}},"_getCropzoneRectInfo"),_resizeCropZone:e(function(C,o){var d=C.x,s=C.y,g=this._getCropzoneRectInfo(),M=g.rectWidth,O=g.rectHeight,F=g.rectTop,R=g.rectLeft,U=g.rectBottom,W=g.rectRight,at=g.canvasWidth,ot=g.canvasHeight,mt={tl:{width:W-d,height:U-s,leftMaker:e(function(pt){return W-pt},"leftMaker"),topMaker:e(function(pt){return U-pt},"topMaker"),maxWidth:W,maxHeight:U,scaleTo:qn(R-d,F-s)},tr:{width:d-R,height:U-s,leftMaker:e(function(){return R},"leftMaker"),topMaker:e(function(pt){return U-pt},"topMaker"),maxWidth:at-R,maxHeight:U,scaleTo:qn(d-W,F-s)},mt:{width:M,height:U-s,leftMaker:e(function(){return R},"leftMaker"),topMaker:e(function(pt){return U-pt},"topMaker"),maxWidth:at-R,maxHeight:U,scaleTo:"height"},ml:{width:W-d,height:O,leftMaker:e(function(pt){return W-pt},"leftMaker"),topMaker:e(function(){return F},"topMaker"),maxWidth:W,maxHeight:ot-F,scaleTo:"width"},mr:{width:d-R,height:O,leftMaker:e(function(){return R},"leftMaker"),topMaker:e(function(){return F},"topMaker"),maxWidth:at-R,maxHeight:ot-F,scaleTo:"width"},mb:{width:M,height:s-F,leftMaker:e(function(){return R},"leftMaker"),topMaker:e(function(){return F},"topMaker"),maxWidth:at-R,maxHeight:ot-F,scaleTo:"height"},bl:{width:W-d,height:s-F,leftMaker:e(function(pt){return W-pt},"leftMaker"),topMaker:e(function(){return F},"topMaker"),maxWidth:W,maxHeight:ot-F,scaleTo:qn(R-d,s-U)},br:{width:d-R,height:s-F,leftMaker:e(function(){return R},"leftMaker"),topMaker:e(function(){return F},"topMaker"),maxWidth:at-R,maxHeight:ot-F,scaleTo:qn(d-W,s-U)}};return this.adjustRatioCropzoneSize(mt[o])},"_resizeCropZone"),isValid:e(function(){return this.left>=0&&this.top>=0&&this.width>0&&this.height>0},"isValid"),_onKeyDown:e(function(C){var o=C.keyCode;o===we.SHIFT&&(this._withShiftKey=!0)},"_onKeyDown"),_onKeyUp:e(function(C){var o=C.keyCode;o===we.SHIFT&&(this._withShiftKey=!1)},"_onKeyUp")}),yg=mg;function bg(k){var C=Cg();return e(function(){var d=Kt(k),s;if(C){var g=Kt(this).constructor;s=At()(d,arguments,g)}else s=d.apply(this,arguments);return _e(this,s)},"_createSuperInternal")}e(bg,"cropper_createSuper");function Cg(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch{return!1}}e(Cg,"cropper_isNativeReflectConstruct");var _g=10,xg={presetRatio:null,top:-10,left:-10,height:1,width:1},Sg=function(k){Ce(o,k);var C=bg(o);function o(d){var s,g,M,O,F,R;return V(this,o),R=C.call(this,jt.CROPPER,d),R._cropzone=null,R._startX=null,R._startY=null,R._withShiftKey=!1,R._listeners={keydown:q()(s=R._onKeyDown).call(s,he(R)),keyup:q()(g=R._onKeyUp).call(g,he(R)),mousedown:q()(M=R._onFabricMouseDown).call(M,he(R)),mousemove:q()(O=R._onFabricMouseMove).call(O,he(R)),mouseup:q()(F=R._onFabricMouseUp).call(F,he(R))},R}return e(o,"Cropper"),rt(o,[{key:"start",value:e(function(){if(!this._cropzone){var s=this.getCanvas();s.forEachObject(function(g){g.evented=!1}),this._cropzone=new yg(s,Z()({left:0,top:0,width:.5,height:.5,strokeWidth:0,cornerSize:10,cornerColor:"black",fill:"transparent"},Pe,this.graphics.cropSelectionStyle)),s.discardActiveObject(),s.add(this._cropzone),s.on("mouse:down",this._listeners.mousedown),s.selection=!1,s.defaultCursor="crosshair",ut.fabric.util.addListener(document,"keydown",this._listeners.keydown),ut.fabric.util.addListener(document,"keyup",this._listeners.keyup)}},"start")},{key:"end",value:e(function(){var s=this.getCanvas(),g=this._cropzone;g&&(s.remove(g),s.selection=!0,s.defaultCursor="default",s.off("mouse:down",this._listeners.mousedown),s.forEachObject(function(M){M.evented=!0}),this._cropzone=null,ut.fabric.util.removeListener(document,"keydown",this._listeners.keydown),ut.fabric.util.removeListener(document,"keyup",this._listeners.keyup))},"end")},{key:"changeVisibility",value:e(function(s){this._cropzone&&this._cropzone.set({visible:s})},"changeVisibility")},{key:"_onFabricMouseDown",value:e(function(s){var g=this.getCanvas();if(!s.target){g.selection=!1;var M=g.getPointer(s.e);this._startX=M.x,this._startY=M.y,g.on({"mouse:move":this._listeners.mousemove,"mouse:up":this._listeners.mouseup})}},"_onFabricMouseDown")},{key:"_onFabricMouseMove",value:e(function(s){var g=this.getCanvas(),M=g.getPointer(s.e),O=M.x,F=M.y,R=this._cropzone;Math.abs(O-this._startX)+Math.abs(F-this._startY)>_g&&(g.remove(R),R.set(this._calcRectDimensionFromPoint(O,F,R.presetRatio)),g.add(R),g.setActiveObject(R))},"_onFabricMouseMove")},{key:"_calcRectDimensionFromPoint",value:e(function(s,g){var M=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,O=this.getCanvas(),F=O.getWidth(),R=O.getHeight(),U=this._startX,W=this._startY,at=re(s,0,U),ot=re(g,0,W),mt=re(s,U,F)-at,ft=re(g,W,R)-ot;return this._withShiftKey&&!M?(mt>ft?ft=mt:ft>mt&&(mt=ft),U>=s&&(at=U-mt),W>=g&&(ot=W-ft)):M&&(ft=mt/M,U>=s&&(at=re(U-mt,0,F)),W>=g&&(ot=re(W-ft,0,R)),ot+ft>R&&(ft=R-ot,mt=ft*M,U>=s&&(at=re(U-mt,0,F)),W>=g&&(ot=re(W-ft,0,R)))),{left:at,top:ot,width:mt,height:ft}},"_calcRectDimensionFromPoint")},{key:"_onFabricMouseUp",value:e(function(){var s=this._cropzone,g=this._listeners,M=this.getCanvas();M.setActiveObject(s),M.off({"mouse:move":g.mousemove,"mouse:up":g.mouseup})},"_onFabricMouseUp")},{key:"getCroppedImageData",value:e(function(s){var g=this.getCanvas(),M=g.contains(this._cropzone);if(!s)return null;M&&g.remove(this._cropzone);var O={imageName:this.getImageName(),url:g.toDataURL(s)};return M&&g.add(this._cropzone),O},"getCroppedImageData")},{key:"getCropzoneRect",value:e(function(){var s=this._cropzone;return s.isValid()?{left:s.left,top:s.top,width:s.width,height:s.height}:null},"getCropzoneRect")},{key:"setCropzoneRect",value:e(function(s){var g=this.getCanvas(),M=this._cropzone;g.discardActiveObject(),g.selection=!1,g.remove(M),M.set(s?this._getPresetPropertiesForCropSize(s):xg),g.add(M),g.selection=!0,s&&g.setActiveObject(M)},"setCropzoneRect")},{key:"_getPresetPropertiesForCropSize",value:e(function(s){var g,M,O=this.getCanvas(),F=O.getWidth(),R=O.getHeight(),U=F>=R?F:R,W=e(function(Ft,ve){return Ft>ve?ve/Ft:1},"getScale"),at=U*s,ot=U,mt=W(at,F),ft=pi()(g=[at,ot]).call(g,function(ee){return ee*mt}),pt=ht(ft,2);at=pt[0],ot=pt[1];var Pt=W(ot,R),Qt=pi()(M=[at,ot]).call(M,function(ee){return qh(ee*Pt)}),qt=ht(Qt,2);return at=qt[0],ot=qt[1],{presetRatio:s,top:(R-ot)/2,left:(F-at)/2,width:at,height:ot}},"_getPresetPropertiesForCropSize")},{key:"_onKeyDown",value:e(function(s){s.keyCode===we.SHIFT&&(this._withShiftKey=!0)},"_onKeyDown")},{key:"_onKeyUp",value:e(function(s){s.keyCode===we.SHIFT&&(this._withShiftKey=!1)},"_onKeyUp")}]),o}(oi),Ig=Sg;function Eg(k){var C=wg();return e(function(){var d=Kt(k),s;if(C){var g=Kt(this).constructor;s=At()(d,arguments,g)}else s=d.apply(this,arguments);return _e(this,s)},"_createSuperInternal")}e(Eg,"component_flip_createSuper");function wg(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch{return!1}}e(wg,"component_flip_isNativeReflectConstruct");var Mg=function(k){Ce(o,k);var C=Eg(o);function o(d){return V(this,o),C.call(this,jt.FLIP,d)}return e(o,"Flip"),rt(o,[{key:"getCurrentSetting",value:e(function(){var s=this.getCanvasImage();return{flipX:s.flipX,flipY:s.flipY}},"getCurrentSetting")},{key:"set",value:e(function(s){var g=this.getCurrentSetting(),M=g.flipX!==s.flipX,O=g.flipY!==s.flipY;return!M&&!O?xt().reject(be.flip):(Z()(g,s),this.setImageProperties(g,!0),this._invertAngle(M,O),this._flipObjects(M,O),xt().resolve({flipX:g.flipX,flipY:g.flipY,angle:this.getCanvasImage().angle}))},"set")},{key:"_invertAngle",value:e(function(s,g){var M=this.getCanvasImage(),O=M.angle;s&&(O*=-1),g&&(O*=-1),M.rotate(Ni()(O)).setCoords()},"_invertAngle")},{key:"_flipObjects",value:e(function(s,g){var M=this.getCanvas();s&&M.forEachObject(function(O){O.set({angle:Ni()(O.angle*-1),flipX:!O.flipX,left:M.width-O.left}).setCoords()}),g&&M.forEachObject(function(O){O.set({angle:Ni()(O.angle*-1),flipY:!O.flipY,top:M.height-O.top}).setCoords()}),M.renderAll()},"_flipObjects")},{key:"reset",value:e(function(){return this.set({flipX:!1,flipY:!1})},"reset")},{key:"flipX",value:e(function(){var s=this.getCurrentSetting();return this.set({flipX:!s.flipX,flipY:s.flipY})},"flipX")},{key:"flipY",value:e(function(){var s=this.getCurrentSetting();return this.set({flipX:s.flipX,flipY:!s.flipY})},"flipY")}]),o}(oi),Tg=Mg;function Ag(k){var C=Og();return e(function(){var d=Kt(k),s;if(C){var g=Kt(this).constructor;s=At()(d,arguments,g)}else s=d.apply(this,arguments);return _e(this,s)},"_createSuperInternal")}e(Ag,"rotation_createSuper");function Og(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch{return!1}}e(Og,"rotation_isNativeReflectConstruct");var Dg=function(k){Ce(o,k);var C=Ag(o);function o(d){return V(this,o),C.call(this,jt.ROTATION,d)}return e(o,"Rotation"),rt(o,[{key:"getCurrentAngle",value:e(function(){return this.getCanvasImage().angle},"getCurrentAngle")},{key:"setAngle",value:e(function(s){var g=this.getCurrentAngle()%360;s%=360;var M=this.getCanvasImage(),O=M.getCenterPoint();M.set({angle:s}).setCoords(),this.adjustCanvasDimension();var F=M.getCenterPoint();return this._rotateForEachObject(O,F,s-g),xt().resolve(s)},"setAngle")},{key:"_rotateForEachObject",value:e(function(s,g,M){var O=this.getCanvas(),F={x:s.x-g.x,y:s.y-g.y};O.forEachObject(function(R){var U=R.getCenterPoint(),W=ut.fabric.util.degreesToRadians(M),at=ut.fabric.util.rotatePoint(U,s,W);R.set({left:at.x-F.x,top:at.y-F.y,angle:(R.angle+M)%360}),R.setCoords()}),O.renderAll()},"_rotateForEachObject")},{key:"rotate",value:e(function(s){var g=this.getCurrentAngle();return this.setAngle(g+s)},"rotate")}]),o}(oi),kg=Dg;function Pg(k){var C=Lg();return e(function(){var d=Kt(k),s;if(C){var g=Kt(this).constructor;s=At()(d,arguments,g)}else s=d.apply(this,arguments);return _e(this,s)},"_createSuperInternal")}e(Pg,"freeDrawing_createSuper");function Lg(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch{return!1}}e(Lg,"freeDrawing_isNativeReflectConstruct");var Ng=function(k){Ce(o,k);var C=Pg(o);function o(d){var s;return V(this,o),s=C.call(this,jt.FREE_DRAWING,d),s.width=12,s.oColor=new ut.fabric.Color("rgba(0, 0, 0, 0.5)"),s}return e(o,"FreeDrawing"),rt(o,[{key:"start",value:e(function(s){var g=this.getCanvas();g.isDrawingMode=!0,this.setBrush(s)},"start")},{key:"setBrush",value:e(function(s){var g=this.getCanvas().freeDrawingBrush;s=s||{},this.width=s.width||this.width,s.color&&(this.oColor=new ut.fabric.Color(s.color)),g.width=this.width,g.color=this.oColor.toRgba()},"setBrush")},{key:"end",value:e(function(){var s=this.getCanvas();s.isDrawingMode=!1},"end")}]),o}(oi),Rg=Ng,Ql=30,jg=2.7,Fg=1.7,ql=180,zg=ut.fabric.util.createClass(ut.fabric.Line,{type:"line",initialize:e(function(C){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.callSuper("initialize",C,o),this.arrowType=o.arrowType},"initialize"),_render:e(function(C){var o=this.calcLinePoints(),d=o.x1,s=o.y1,g=o.x2,M=o.y2,O={fromX:d,fromY:s,toX:g,toY:M};this.ctx=C,C.lineWidth=this.strokeWidth,this._renderBasicLinePath(O),this._drawDecoratorPath(O),this._renderStroke(C)},"_render"),_renderBasicLinePath:e(function(C){var o=C.fromX,d=C.fromY,s=C.toX,g=C.toY;this.ctx.beginPath(),this.ctx.moveTo(o,d),this.ctx.lineTo(s,g)},"_renderBasicLinePath"),_drawDecoratorPath:e(function(C){this._drawDecoratorPathType("head",C),this._drawDecoratorPathType("tail",C)},"_drawDecoratorPath"),_drawDecoratorPathType:e(function(C,o){switch(this.arrowType[C]){case"triangle":this._drawTrianglePath(C,o);break;case"chevron":this._drawChevronPath(C,o);break;default:break}},"_drawDecoratorPathType"),_drawTrianglePath:e(function(C,o){var d=this.ctx.lineWidth*Fg;this._drawChevronPath(C,o,d),this.ctx.closePath()},"_drawTrianglePath"),_drawChevronPath:e(function(C,o,d){var s=this,g=o.fromX,M=o.fromY,O=o.toX,F=o.toY,R=this.ctx;d||(d=this.ctx.lineWidth*jg);var U=C==="head"?[g,M]:[O,F],W=ht(U,2),at=W[0],ot=W[1],mt=C==="head"?[O,F]:[g,M],ft=ht(mt,2),pt=ft[0],Pt=ft[1],Qt=Math.atan2(Pt-ot,pt-at)*ql/Math.PI,qt=e(function(Ft){return s.getRotatePosition(d,Ft,{x:at,y:ot})},"rotatedPosition");R.moveTo.apply(R,B(qt(Qt+Ql))),R.lineTo(at,ot),R.lineTo.apply(R,B(qt(Qt-Ql)))},"_drawChevronPath"),getRotatePosition:e(function(C,o,d){var s=o*Math.PI/ql,g=d.x,M=d.y;return[C*Math.cos(s)+g,C*Math.sin(s)+M]},"getRotatePosition")}),Bg=zg;function Ug(k){var C=Hg();return e(function(){var d=Kt(k),s;if(C){var g=Kt(this).constructor;s=At()(d,arguments,g)}else s=d.apply(this,arguments);return _e(this,s)},"_createSuperInternal")}e(Ug,"line_createSuper");function Hg(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch{return!1}}e(Hg,"line_isNativeReflectConstruct");var Wg=function(k){Ce(o,k);var C=Ug(o);function o(d){var s,g,M,O;return V(this,o),O=C.call(this,jt.LINE,d),O._width=12,O._oColor=new ut.fabric.Color("rgba(0, 0, 0, 0.5)"),O._listeners={mousedown:q()(s=O._onFabricMouseDown).call(s,he(O)),mousemove:q()(g=O._onFabricMouseMove).call(g,he(O)),mouseup:q()(M=O._onFabricMouseUp).call(M,he(O))},O}return e(o,"Line"),rt(o,[{key:"setHeadOption",value:e(function(s){var g=s.arrowType,M=g===void 0?{head:null,tail:null}:g;this._arrowType=M},"setHeadOption")},{key:"start",value:e(function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},g=this.getCanvas();g.defaultCursor="crosshair",g.selection=!1,this.setHeadOption(s),this.setBrush(s),g.forEachObject(function(M){M.set({evented:!1})}),g.on({"mouse:down":this._listeners.mousedown})},"start")},{key:"setBrush",value:e(function(s){var g=this.getCanvas().freeDrawingBrush;s=s||{},this._width=s.width||this._width,s.color&&(this._oColor=new ut.fabric.Color(s.color)),g.width=this._width,g.color=this._oColor.toRgba()},"setBrush")},{key:"end",value:e(function(){var s=this.getCanvas();s.defaultCursor="default",s.selection=!0,s.forEachObject(function(g){g.set({evented:!0})}),s.off("mouse:down",this._listeners.mousedown)},"end")},{key:"_onFabricMouseDown",value:e(function(s){var g=this.getCanvas(),M=g.getPointer(s.e),O=M.x,F=M.y,R=[O,F,O,F];this._line=new Bg(R,{stroke:this._oColor.toRgba(),strokeWidth:this._width,arrowType:this._arrowType,evented:!1}),this._line.set(ui.SELECTION_STYLE),g.add(this._line),g.on({"mouse:move":this._listeners.mousemove,"mouse:up":this._listeners.mouseup}),this.fire(Mt.ADD_OBJECT,this._createLineEventObjectProperties())},"_onFabricMouseDown")},{key:"_onFabricMouseMove",value:e(function(s){var g=this.getCanvas(),M=g.getPointer(s.e);this._line.set({x2:M.x,y2:M.y}),this._line.setCoords(),g.renderAll()},"_onFabricMouseMove")},{key:"_onFabricMouseUp",value:e(function(){var s=this.getCanvas();this.fire(Mt.OBJECT_ADDED,this._createLineEventObjectProperties()),this._line=null,s.off({"mouse:move":this._listeners.mousemove,"mouse:up":this._listeners.mouseup})},"_onFabricMouseUp")},{key:"_createLineEventObjectProperties",value:e(function(){var s=this.graphics.createObjectProperties(this._line),g=this._line,M=g.x1,O=g.x2,F=g.y1,R=g.y2;return Z()({},s,{startPosition:{x:M,y:F},endPosition:{x:O,y:R}})},"_createLineEventObjectProperties")}]),o}(oi),Yg=Wg;function Gg(k){var C=Xg();return e(function(){var d=Kt(k),s;if(C){var g=Kt(this).constructor;s=At()(d,arguments,g)}else s=d.apply(this,arguments);return _e(this,s)},"_createSuperInternal")}e(Gg,"component_text_createSuper");function Xg(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch{return!1}}e(Xg,"component_text_isNativeReflectConstruct");var Vg={fill:"#000000",left:0,top:0},$g={fill:"#000000",fontStyle:"normal",fontWeight:"normal",textAlign:"tie-text-align-left",underline:!1},Zg=500,Jg=function(k){Ce(o,k);var C=Gg(o);function o(d){var s,g,M,O,F,R;return V(this,o),R=C.call(this,jt.TEXT,d),R._defaultStyles=Vg,R._isSelected=!1,R._selectedObj={},R._editingObj={},R._listeners={mousedown:q()(s=R._onFabricMouseDown).call(s,he(R)),select:q()(g=R._onFabricSelect).call(g,he(R)),selectClear:q()(M=R._onFabricSelectClear).call(M,he(R)),scaling:q()(O=R._onFabricScaling).call(O,he(R)),textChanged:q()(F=R._onFabricTextChanged).call(F,he(R))},R._textarea=null,R._ratio=1,R._lastClickTime=new Date().getTime(),R._editingObjInfos={},R.isPrevEditing=!1,R}return e(o,"Text"),rt(o,[{key:"start",value:e(function(){var s=this,g=this.getCanvas();g.selection=!1,g.defaultCursor="text",g.on({"mouse:down":this._listeners.mousedown,"selection:created":this._listeners.select,"selection:updated":this._listeners.select,"before:selection:cleared":this._listeners.selectClear,"object:scaling":this._listeners.scaling,"text:changed":this._listeners.textChanged}),g.forEachObject(function(M){M.type==="i-text"&&s.adjustOriginPosition(M,"start")}),this.setCanvasRatio()},"start")},{key:"end",value:e(function(){var s=this,g=this.getCanvas();g.selection=!0,g.defaultCursor="default",g.forEachObject(function(M){M.type==="i-text"&&(M.text===""?g.remove(M):s.adjustOriginPosition(M,"end"))}),g.off({"mouse:down":this._listeners.mousedown,"selection:created":this._listeners.select,"selection:updated":this._listeners.select,"before:selection:cleared":this._listeners.selectClear,"object:selected":this._listeners.select,"object:scaling":this._listeners.scaling,"text:changed":this._listeners.textChanged})},"end")},{key:"adjustOriginPosition",value:e(function(s,g){var M="center",O="center";g==="start"&&(M="left",O="top");var F=s.getPointByOrigin(M,O),R=F.x,U=F.y;s.set({left:R,top:U,originX:M,originY:O}),s.setCoords()},"adjustOriginPosition")},{key:"add",value:e(function(s,g){var M=this;return new(xt())(function(O){var F,R=M.getCanvas(),U=null,W=ui.SELECTION_STYLE,at=M._defaultStyles;M._setInitPos(g.position),g.styles&&(at=Z()(at,g.styles)),Bl()(g.autofocus)||(g.autofocus=!0),U=new ut.fabric.IText(s,at),W=Z()({},W,{originX:"left",originY:"top"}),U.set(W),U.on({mouseup:q()(F=M._onFabricMouseUp).call(F,M)}),R.add(U),g.autofocus&&(U.enterEditing(),U.selectAll()),R.getActiveObject()||R.setActiveObject(U),M.isPrevEditing=!0,O(M.graphics.createObjectProperties(U))})},"add")},{key:"change",value:e(function(s,g){var M=this;return new(xt())(function(O){s.set("text",g),M.getCanvas().renderAll(),O()})},"change")},{key:"setStyle",value:e(function(s,g){var M=this;return new(xt())(function(O){K()(g,function(F,R){s[R]===F&&R!=="fontSize"&&(g[R]=$g[R]||"")},M),"textDecoration"in g&&Z()(g,M._getTextDecorationAdaptObject(g.textDecoration)),s.set(g),M.getCanvas().renderAll(),O()})},"setStyle")},{key:"getText",value:e(function(s){return s.text},"getText")},{key:"setSelectedInfo",value:e(function(s,g){this._selectedObj=s,this._isSelected=g},"setSelectedInfo")},{key:"isSelected",value:e(function(){return this._isSelected},"isSelected")},{key:"getSelectedObj",value:e(function(){return this._selectedObj},"getSelectedObj")},{key:"setCanvasRatio",value:e(function(){var s=this.getCanvasElement(),g=bt()(s.style.maxWidth,10),M=s.width;this._ratio=M/g},"setCanvasRatio")},{key:"getCanvasRatio",value:e(function(){return this._ratio},"getCanvasRatio")},{key:"_getTextDecorationAdaptObject",value:e(function(s){return{underline:s==="underline",linethrough:s==="line-through",overline:s==="overline"}},"_getTextDecorationAdaptObject")},{key:"_setInitPos",value:e(function(s){s=s||this.getCanvasImage().getCenterPoint(),this._defaultStyles.left=s.x,this._defaultStyles.top=s.y},"_setInitPos")},{key:"_onInput",value:e(function(){var s=this.getCanvasRatio(),g=this._editingObj,M=this._textarea.style;M.width="".concat(Math.ceil(g.width/s),"px"),M.height="".concat(Math.ceil(g.height/s),"px")},"_onInput")},{key:"_onKeyDown",value:e(function(){var s=this,g=this.getCanvasRatio(),M=this._editingObj,O=this._textarea.style;i()(function(){M.text(s._textarea.value),O.width="".concat(Math.ceil(M.width/g),"px"),O.height="".concat(Math.ceil(M.height/g),"px")},0)},"_onKeyDown")},{key:"_onBlur",value:e(function(){var s=this.getCanvasRatio(),g=this._editingObj,M=this._editingObjInfos,O=this._textarea.value,F=g.width/s-M.width/s,R=g.height/s-M.height/s;if(s===1&&(F/=2,R/=2),this._textarea.style.display="none",g.set({left:M.left+F,top:M.top+R}),O.length){this.getCanvas().add(g);var U={id:Rt(g),type:g.type,text:O};this.fire(Mt.TEXT_CHANGED,U)}},"_onBlur")},{key:"_onScroll",value:e(function(){this._textarea.scrollLeft=0,this._textarea.scrollTop=0},"_onScroll")},{key:"_onFabricScaling",value:e(function(s){var g=s.target;g.fontSize=g.fontSize*g.scaleY,g.scaleX=1,g.scaleY=1},"_onFabricScaling")},{key:"_onFabricTextChanged",value:e(function(s){this.fire(Mt.TEXT_CHANGED,s.target)},"_onFabricTextChanged")},{key:"_onFabricSelectClear",value:e(function(s){var g=this.getSelectedObj();this.isPrevEditing=!0,this.setSelectedInfo(s.target,!1),g&&g.text===""&&this.getCanvas().remove(g)},"_onFabricSelectClear")},{key:"_onFabricSelect",value:e(function(s){this.isPrevEditing=!0,this.setSelectedInfo(s.target,!0)},"_onFabricSelect")},{key:"_onFabricMouseDown",value:e(function(s){var g=s.target;if(!(g&&!g.isType("text"))){if(this.isPrevEditing){this.isPrevEditing=!1;return}this._fireAddText(s)}},"_onFabricMouseDown")},{key:"_fireAddText",value:e(function(s){var g=s.target,M=s.e||{},O=this.getCanvas().getPointer(M);g||this.fire(Mt.ADD_TEXT,{originPosition:{x:O.x,y:O.y},clientPosition:{x:M.clientX||0,y:M.clientY||0}})},"_fireAddText")},{key:"_onFabricMouseUp",value:e(function(s){var g=s.target,M=new Date().getTime();this._isDoubleClick(M)&&!g.isEditing&&g.enterEditing(),g.isEditing&&this.fire(Mt.TEXT_EDITING),this._lastClickTime=M},"_onFabricMouseUp")},{key:"_isDoubleClick",value:e(function(s){return s-this._lastClickTime<Zg},"_isDoubleClick")}]),o}(oi),Kg=Jg;function Qg(k){var C=qg();return e(function(){var d=Kt(k),s;if(C){var g=Kt(this).constructor;s=At()(d,arguments,g)}else s=d.apply(this,arguments);return _e(this,s)},"_createSuperInternal")}e(Qg,"component_icon_createSuper");function qg(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch{return!1}}e(qg,"component_icon_isNativeReflectConstruct");var tv={arrow:"M 0 90 H 105 V 120 L 160 60 L 105 0 V 30 H 0 Z",cancel:"M 0 30 L 30 60 L 0 90 L 30 120 L 60 90 L 90 120 L 120 90 L 90 60 L 120 30 L 90 0 L 60 30 L 30 0 Z"},ev=function(k){Ce(o,k);var C=Qg(o);function o(d){var s,g,M,O;return V(this,o),O=C.call(this,jt.ICON,d),O._oColor="#000000",O._pathMap=tv,O._type=null,O._iconColor=null,O._handlers={mousedown:q()(s=O._onFabricMouseDown).call(s,he(O)),mousemove:q()(g=O._onFabricMouseMove).call(g,he(O)),mouseup:q()(M=O._onFabricMouseUp).call(M,he(O))},O}return e(o,"Icon"),rt(o,[{key:"setStates",value:e(function(s,g){this._type=s,this._iconColor=g},"setStates")},{key:"start",value:e(function(){var s=this.getCanvas();s.selection=!1,s.on("mouse:down",this._handlers.mousedown)},"start")},{key:"end",value:e(function(){var s=this.getCanvas();s.selection=!0,s.off({"mouse:down":this._handlers.mousedown})},"end")},{key:"add",value:e(function(s,g){var M=this;return new(xt())(function(O,F){var R=M.getCanvas(),U=M._pathMap[s],W=ui.SELECTION_STYLE,at=U?M._createIcon(U):null;M._icon=at,at||F(be.invalidParameters),at.set(Z()({type:"icon",fill:M._oColor},W,g,M.graphics.controlStyle)),R.add(at).setActiveObject(at),O(M.graphics.createObjectProperties(at))})},"add")},{key:"registerPaths",value:e(function(s){var g=this;K()(s,function(M,O){g._pathMap[O]=M},this)},"registerPaths")},{key:"setColor",value:e(function(s,g){this._oColor=s,g&&g.get("type")==="icon"&&(g.set({fill:this._oColor}),this.getCanvas().renderAll())},"setColor")},{key:"getColor",value:e(function(s){return Ct()(s)},"getColor")},{key:"_createIcon",value:e(function(s){return new ut.fabric.Path(s)},"_createIcon")},{key:"_onFabricMouseDown",value:e(function(s){var g=this,M=this.getCanvas();this._startPoint=M.getPointer(s.e);var O=this._startPoint,F=O.x,R=O.y;this.add(this._type,{left:F,top:R,fill:this._iconColor}).then(function(){g.fire(Mt.ADD_OBJECT,g.graphics.createObjectProperties(g._icon)),M.on("mouse:move",g._handlers.mousemove),M.on("mouse:up",g._handlers.mouseup)})},"_onFabricMouseDown")},{key:"_onFabricMouseMove",value:e(function(s){var g=this.getCanvas();if(this._icon){var M=g.getPointer(s.e),O=(M.x-this._startPoint.x)/this._icon.width,F=(M.y-this._startPoint.y)/this._icon.height;this._icon.set({scaleX:Math.abs(O*2),scaleY:Math.abs(F*2)}),this._icon.setCoords(),g.renderAll()}},"_onFabricMouseMove")},{key:"_onFabricMouseUp",value:e(function(){var s=this.getCanvas();this.fire(Mt.OBJECT_ADDED,this.graphics.createObjectProperties(this._icon)),this._icon=null,s.off("mouse:down",this._handlers.mousedown),s.off("mouse:move",this._handlers.mousemove),s.off("mouse:up",this._handlers.mouseup)},"_onFabricMouseUp")}]),o}(oi),iv=ev,rv=ut.fabric.util.createClass(ut.fabric.Image.filters.BlendImage,{applyTo:e(function(C){if(this.mask){var o=C.canvasEl,d=o.width,s=o.height,g=this._createCanvasOfMask(d,s),M=o.getContext("2d"),O=g.getContext("2d"),F=M.getImageData(0,0,d,s);this._drawMask(O,o,M),this._mapData(O,F,d,s),C.imageData=F}},"applyTo"),_createCanvasOfMask:e(function(C,o){var d=ut.fabric.util.createCanvasElement();return d.width=C,d.height=o,d},"_createCanvasOfMask"),_drawMask:e(function(C){var o=this.mask,d=o.getElement(),s=o.angle,g=o.left,M=o.scaleX,O=o.scaleY,F=o.top;C.save(),C.translate(g,F),C.rotate(s*Math.PI/180),C.scale(M,O),C.drawImage(d,-d.width/2,-d.height/2),C.restore()},"_drawMask"),_mapData:e(function(C,o,d,s){for(var g=o.data,M=o.height,O=o.width,F=g,R=O*M*4,U=C.getImageData(0,0,d,s).data,W=0;W<R;W+=4)F[W+3]=U[W]},"_mapData")}),nv=rv,sv=ut.fabric.util.createClass(ut.fabric.Image.filters.Convolute,{type:"Sharpen",initialize:e(function(){this.matrix=[0,-1,0,-1,5,-1,0,-1,0]},"initialize")}),av=sv,ov=ut.fabric.util.createClass(ut.fabric.Image.filters.Convolute,{type:"Emboss",initialize:e(function(){this.matrix=[1,1,1,1,.7,-1,-1,-1,-1]},"initialize")}),lv=ov,cv=ut.fabric.util.createClass(ut.fabric.Image.filters.BaseFilter,{type:"ColorFilter",initialize:e(function(C){C||(C={}),this.color=C.color||"#FFFFFF",this.threshold=C.threshold||45,this.x=C.x||null,this.y=C.y||null},"initialize"),applyTo:e(function(C){var o=C.canvasEl,d=o.getContext("2d"),s=d.getImageData(0,0,o.width,o.height),g=s.data,M=this.threshold,O=ut.fabric.Color.sourceFromHex(this.color),F,R;for(this.x&&this.y&&(O=this._getColor(s,this.x,this.y)),F=0,R=g.length;F<R;F+=4)this._isOutsideThreshold(g[F],O[0],M)||this._isOutsideThreshold(g[F+1],O[1],M)||this._isOutsideThreshold(g[F+2],O[2],M)||(g[F]=g[F+1]=g[F+2]=g[F+3]=0);d.putImageData(s,0,0)},"applyTo"),_isOutsideThreshold:e(function(C,o,d){var s=C-o;return Math.abs(s)>d},"_isOutsideThreshold"),_getColor:e(function(C,o,d){var s=[0,0,0,0],g=C.data,M=C.width,O=4,F=(M*d+o)*O;return s[0]=g[F],s[1]=g[F+1],s[2]=g[F+2],s[3]=g[F+3],s},"_getColor")}),uv=cv;function hv(k){var C=fv();return e(function(){var d=Kt(k),s;if(C){var g=Kt(this).constructor;s=At()(d,arguments,g)}else s=d.apply(this,arguments);return _e(this,s)},"_createSuperInternal")}e(hv,"component_filter_createSuper");function fv(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch{return!1}}e(fv,"component_filter_isNativeReflectConstruct");var ts=ut.fabric.Image.filters;ts.Mask=nv,ts.Sharpen=av,ts.Emboss=lv,ts.ColorFilter=uv;var dv=function(k){Ce(o,k);var C=hv(o);function o(d){return V(this,o),C.call(this,jt.FILTER,d)}return e(o,"Filter"),rt(o,[{key:"add",value:e(function(s,g){var M=this;return new(xt())(function(O,F){var R=M._getSourceImage(),U=M.getCanvas(),W=M._getFilter(R,s);W||(W=M._createFilter(R,s,g)),W||F(be.invalidParameters),M._changeFilterValues(W,g),M._apply(R,function(){U.renderAll(),O({type:s,action:"add",options:g})})})},"add")},{key:"remove",value:e(function(s){var g=this;return new(xt())(function(M,O){var F=g._getSourceImage(),R=g.getCanvas(),U=g.getOptions(s);F.filters.length||O(be.unsupportedOperation),g._removeFilter(F,s),g._apply(F,function(){R.renderAll(),M({type:s,action:"remove",options:U})})})},"remove")},{key:"hasFilter",value:e(function(s){return!!this._getFilter(this._getSourceImage(),s)},"hasFilter")},{key:"getOptions",value:e(function(s){var g=this._getSourceImage(),M=this._getFilter(g,s);return M?Z()({},M.options):null},"getOptions")},{key:"_changeFilterValues",value:e(function(s,g){K()(g,function(M,O){X()(s[O])||(s[O]=M)}),K()(s.options,function(M,O){X()(g[O])||(s.options[O]=g[O])})},"_changeFilterValues")},{key:"_apply",value:e(function(s,g){s.filters.push();var M=s.applyFilters();M&&g()},"_apply")},{key:"_getSourceImage",value:e(function(){return this.getCanvasImage()},"_getSourceImage")},{key:"_createFilter",value:e(function(s,g,M){var O,F=this._getFabricFilterType(g),R=ut.fabric.Image.filters[F];return R&&(O=new R(M),O.options=M,s.filters.push(O)),O},"_createFilter")},{key:"_getFilter",value:e(function(s,g){var M=null;if(s){var O=this._getFabricFilterType(g),F=s.filters.length,R,U;for(U=0;U<F;U+=1)if(R=s.filters[U],R.type===O){M=R;break}}return M},"_getFilter")},{key:"_removeFilter",value:e(function(s,g){var M,O=this._getFabricFilterType(g);s.filters=lr()(M=s.filters).call(M,function(F){return F.type!==O})},"_removeFilter")},{key:"_getFabricFilterType",value:e(function(s){return s.charAt(0).toUpperCase()+b()(s).call(s,1)},"_getFabricFilterType")}]),o}(oi),gv=dv,vv=u(1801),Mi=u.n(vv),tc={pixelate:"blocksize",blur:"blur"},Oa={x:"width",y:"height"},pv=ef(tc),$r=null;function es(k){var C=Yr(k,"patternSourceCanvas"),o=C.patternSourceCanvas,d=o.getObjects(),s=ht(d,1),g=s[0];return g}e(es,"getFillImageFromShape");function mv(k){var C=k.angle,o=k.flipX,d=k.flipY,s=es(k),g=Av(k),M=g.right,O=g.bottom,F=g.width,R=g.height,U=(F-k.width)/2,W=(R-k.height)/2,at=k.left-k.width/2-U,ot=k.top-k.height/2-W,mt=F/2-U,ft=R/2-W,pt=Math.max(F,R)+Math.max(U,W),Pt=yv({shapeObj:k,left:mt,top:ft,width:F,height:R,cropX:at,cropY:ot,flipX:o,flipY:d,right:M,bottom:O}),Qt=ht(Pt,4);mt=Qt[0],ft=Qt[1],F=Qt[2],R=Qt[3],s.set({angle:o===d?-C:C,left:mt,top:ft,width:F,height:R,cropX:at,cropY:ot,flipX:o,flipY:d}),Ea(s,{fillImageMaxSize:pt})}e(mv,"rePositionFilterTypeFillImage");function Da(k){var C;return pi()(C=k.filters).call(C,function(o){var d=Et()(o),s=ht(d,1),g=s[0];return H({},pv[g],o[g])})}e(Da,"makeFilterOptionFromFabricImage");function yv(k){var C=k.shapeObj,o=k.left,d=k.top,s=k.width,g=k.height,M=k.cropX,O=k.cropY,F=k.flipX,R=k.flipY,U=k.right,W=k.bottom,at=e(function(ee,Ft,ve,Be){return Sv({type:ee,outDistance:Ft,shapeObj:C,flipX:F,flipY:R,left:ve,top:Be})},"overflowAreaPositionFixer"),ot=s,mt=g,ft=Cv(at,{left:o,top:d,width:s,height:g,cropX:M,cropY:O}),pt=ht(ft,4);o=pt[0],d=pt[1],s=pt[2],g=pt[3];var Pt=bv(at,{left:o,top:d,insideCanvasRealImageWidth:s,insideCanvasRealImageHeight:g,right:U,bottom:W,cropX:M,cropY:O,originalWidth:ot,originalHeight:mt}),Qt=ht(Pt,4);return o=Qt[0],d=Qt[1],s=Qt[2],g=Qt[3],[o,d,s,g]}e(yv,"calculateFillImageDimensionOutsideCanvas");function bv(k,C){var o=C.left,d=C.top,s=C.insideCanvasRealImageWidth,g=C.insideCanvasRealImageHeight,M=C.right,O=C.bottom,F=C.cropX,R=C.cropY,U=C.originalWidth,W=C.originalHeight,at=s,ot=g,mt=$r,ft=mt.width,pt=mt.height;M>ft&&F>0&&(at=U-Math.abs(M-ft)),O>pt&&R>0&&(ot=W-Math.abs(O-pt));var Pt={x:(s-at)/2,y:(g-ot)/2};return K()(["x","y"],function(Qt){var qt=Pt[Qt];if(qt>0){var ee=k(Qt,qt,o,d),Ft=ht(ee,2);o=Ft[0],d=Ft[1]}}),[o,d,at,ot]}e(bv,"calculateDimensionRightBottomEdge");function Cv(k,C){var o=C.left,d=C.top,s=C.width,g=C.height,M=C.cropX,O=C.cropY,F={width:s,height:g};return K()(["x","y"],function(R){var U=R==="x"?M:O,W=F[Oa[R]],at=$r[Oa[R]];if(W>at){var ot=(W-at)/2;F[Oa[R]]=at;var mt=k(R,ot,o,d),ft=ht(mt,2);o=ft[0],d=ft[1]}if(U<0){var pt=k(R,U,o,d),Pt=ht(pt,2);o=Pt[0],d=Pt[1]}}),[o,d,F.width,F.height]}e(Cv,"calculateDimensionLeftTopEdge");function ec(k,C,o){var d=ic(k),s=nc(d,k.angle,C);o.add(s);var g={fill:new ut.fabric.Pattern({source:o.getElement(),repeat:"no-repeat"})};return Ea(g,{patternSourceCanvas:o}),g}e(ec,"makeFillPatternForFilter");function _v(k){var C=k.getObjects(),o=ht(C,1),d=o[0],s=Yr(d,"fillImageMaxSize"),g=s.fillImageMaxSize;g=Math.max(1,g),k.setDimensions({width:g,height:g}),k.renderAll()}e(_v,"resetFillPatternCanvas");function xv(k,C){var o=Yr(k,"patternSourceCanvas"),d=o.patternSourceCanvas,s=d.getObjects(),g=ht(s,1),M=g[0],O=Da(M);d.remove(M);var F=ic(C,!0),R=nc(F,C.angle,O);d.add(R)}e(xv,"reMakePatternImageSource");function ic(k){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return(!$r||C)&&($r=k.toCanvasElement()),$r}e(ic,"getCachedCanvasImageElement");function Sv(k){var C=k.type,o=k.shapeObj,d=k.outDistance,s=k.left,g=k.top,M=k.flipX,O=k.flipY,F=rc(o),R=[[1,2],[0,3],[0,3],[1,2]],U=Ev(C,F,R),W=wv(C,F,U),at=U.startPointIndex,ot=Iv({outDistance:d,startPointIndex:at,flipX:M,flipY:O,reatAngles:W});return[s+ot.left,g+ot.top]}e(Sv,"calculateDistanceOverflowPart");function Iv(k){var C=k.outDistance,o=k.startPointIndex,d=k.flipX,s=k.flipY,g=k.reatAngles,M=C*Math.cos(g[0]*Math.PI/180),O=C*Math.cos(g[1]*Math.PI/180),F=o===2||o===3,R={top:F?M:O,left:F?O:M};return Mv(o,d,s)&&(R.left=R.left*-1),Tv(o,d,s)&&(R.top=R.top*-1),R}e(Iv,"getReversePositionForFlip");function Ev(k,C,o){var d=0,s=0;K()(C,function(F,R){F[k]<d&&(d=F[k],s=R)});var g=ht(o[s],2),M=g[0],O=g[1];return{startPointIndex:s,endPointIndex1:M,endPointIndex2:O}}e(Ev,"calculateLinePointsOutsideCanvas");function wv(k,C,o){var d,s=o.startPointIndex,g=o.endPointIndex1,M=o.endPointIndex2,O=k==="x"?180:270;return pi()(d=[g,M]).call(d,function(F){var R=C[s],U=C[F],W=R.y-U.y,at=R.x-U.x;return Math.atan2(W,at)*180/Math.PI-O})}e(wv,"calculateLineAngleOfOutsideCanvas");function Mv(k,C,o){return(!C&&o||!C&&!o)&&k===0||(C&&o||C&&!o)&&k===1||(!C&&!o||!C&&o)&&k===2||(C&&!o||C&&o)&&k===3}e(Mv,"isReverseLeftPositionForFlip");function Tv(k,C,o){return(C&&!o||!C&&!o)&&k===0||(!C&&!o||C&&!o)&&k===1||(C&&o||!C&&o)&&k===2||(!C&&o||C&&o)&&k===3}e(Tv,"isReverseTopPositionForFlip");function rc(k){return[k.getPointByOrigin("left","top"),k.getPointByOrigin("right","top"),k.getPointByOrigin("left","bottom"),k.getPointByOrigin("right","bottom")]}e(rc,"getShapeEdgePoint");function Av(k){var C=rc(k),o=ht(C,4),d=o[0],s=d.x,g=d.y,M=o[1],O=M.x,F=M.y,R=o[2],U=R.x,W=R.y,at=o[3],ot=at.x,mt=at.y,ft=Math.min(s,O,U,ot),pt=Math.min(g,F,W,mt),Pt=Math.max(s,O,U,ot),Qt=Math.max(g,F,W,mt);return{left:ft,top:pt,right:Pt,bottom:Qt,width:Pt-ft,height:Qt-pt}}e(Av,"getRotatedDimension");function nc(k,C,o){var d,s=new ut.fabric.Image(k);return K()(Z().apply(void 0,G()(d=[{}]).call(d,B(o))),function(g,M){var O=rf(M),F=new ut.fabric.Image.filters[O](H({},tc[M],g));s.filters.push(F)}),s.applyFilters(),Ea(s,{originalAngle:C,fillImageMaxSize:Math.max(s.width,s.height)}),Mi().adjustOriginToCenter(s),s}e(nc,"makeFillImage");function Ov(k){var C=Dv();return e(function(){var d=Kt(k),s;if(C){var g=Kt(this).constructor;s=At()(d,arguments,g)}else s=d.apply(this,arguments);return _e(this,s)},"_createSuperInternal")}e(Ov,"shape_createSuper");function Dv(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch{return!1}}e(Dv,"shape_isNativeReflectConstruct");var sc=Z()({strokeWidth:1,stroke:"#000000",fill:"#ffffff",width:1,height:1,rx:0,ry:0},Oe),kv="rect",Pv=20,Lv=20;function ac(k,C,o){var d=Ct()(k),s=Ml(Ct()(k)),g=d;d.color&&(g=d.color);var M=null;if(s==="filter"){var O=o();M=ec(C,lr()(d),O)}else M={fill:g};return Z()({},k,M)}e(ac,"makeFabricFillOption");var Nv=function(k){Ce(o,k);var C=Ov(o);function o(d){var s,g,M,O,F,R;return V(this,o),R=C.call(this,jt.SHAPE,d),R._shapeObj=null,R._type=kv,R._options=Z()({},sc),R._isSelected=!1,R._startPoint={},R._withShiftKey=!1,R._handlers={mousedown:q()(s=R._onFabricMouseDown).call(s,he(R)),mousemove:q()(g=R._onFabricMouseMove).call(g,he(R)),mouseup:q()(M=R._onFabricMouseUp).call(M,he(R)),keydown:q()(O=R._onKeyDown).call(O,he(R)),keyup:q()(F=R._onKeyUp).call(F,he(R))},R}return e(o,"Shape"),rt(o,[{key:"start",value:e(function(){var s=this.getCanvas();this._isSelected=!1,s.defaultCursor="crosshair",s.selection=!1,s.uniformScaling=!0,s.on({"mouse:down":this._handlers.mousedown}),ut.fabric.util.addListener(document,"keydown",this._handlers.keydown),ut.fabric.util.addListener(document,"keyup",this._handlers.keyup)},"start")},{key:"end",value:e(function(){var s=this.getCanvas();this._isSelected=!1,s.defaultCursor="default",s.selection=!0,s.uniformScaling=!1,s.off({"mouse:down":this._handlers.mousedown}),ut.fabric.util.removeListener(document,"keydown",this._handlers.keydown),ut.fabric.util.removeListener(document,"keyup",this._handlers.keyup)},"end")},{key:"setStates",value:e(function(s,g){this._type=s,g&&(this._options=Z()(this._options,g))},"setStates")},{key:"add",value:e(function(s,g){var M=this;return new(xt())(function(O){var F=M.getCanvas(),R=M._extendOptions(g),U=M._createInstance(s,R),W=M.graphics.createObjectProperties(U);M._bindEventOnShape(U),F.add(U).setActiveObject(U),M._resetPositionFillFilter(U),O(W)})},"add")},{key:"change",value:e(function(s,g){var M=this;return new(xt())(function(O,F){Tl(s)||F(be.unsupportedType);var R=Ml(Ct()(g))==="filter",U=M.graphics,W=U.canvasImage,at=U.createStaticCanvas;s.set(R?ac(g,W,at):g),R&&M._resetPositionFillFilter(s),M.getCanvas().renderAll(),O()})},"change")},{key:"makeFillPropertyForUserEvent",value:e(function(s){var g=wa(s),M={};if(g===kt.FILTER){var O=es(s),F=Da(O);M.type=g,M.filter=F}else M.type=kt.COLOR,M.color=Ct()(s)||"transparent";return M},"makeFillPropertyForUserEvent")},{key:"processForCopiedObject",value:e(function(s,g){if(this._bindEventOnShape(s),wa(s)==="filter"){var M=es(g),O=Da(M),F=this.graphics.createStaticCanvas();s.set(ec(this.graphics.canvasImage,O,F)),this._resetPositionFillFilter(s)}},"processForCopiedObject")},{key:"_createInstance",value:e(function(s,g){var M;switch(s){case"rect":M=new ut.fabric.Rect(g);break;case"circle":M=new ut.fabric.Ellipse(Z()({type:"circle"},g));break;case"triangle":M=new ut.fabric.Triangle(g);break;default:M={}}return M},"_createInstance")},{key:"_extendOptions",value:e(function(s){var g=ui.SELECTION_STYLE,M=this.graphics,O=M.canvasImage,F=M.createStaticCanvas;return s=Z()({},sc,this._options,g,s),ac(s,O,F)},"_extendOptions")},{key:"_bindEventOnShape",value:e(function(s){var g=this,M=this.getCanvas();s.on({added:e(function(){g._shapeObj=this,Mi().setOrigins(g._shapeObj)},"added"),selected:e(function(){g._isSelected=!0,g._shapeObj=this,M.uniformScaling=!0,M.defaultCursor="default",Mi().setOrigins(g._shapeObj)},"selected"),deselected:e(function(){g._isSelected=!1,g._shapeObj=null,M.defaultCursor="crosshair",M.uniformScaling=!1},"deselected"),modified:e(function(){var F=g._shapeObj;Mi().adjustOriginToCenter(F),Mi().setOrigins(F)},"modified"),modifiedInGroup:e(function(F){g._fillFilterRePositionInGroupSelection(s,F)},"modifiedInGroup"),moving:e(function(){g._resetPositionFillFilter(this)},"moving"),rotating:e(function(){g._resetPositionFillFilter(this)},"rotating"),scaling:e(function(F){var R=M.getPointer(F.e),U=g._shapeObj;M.setCursor("crosshair"),Mi().resize(U,R,!0),g._resetPositionFillFilter(this)},"scaling")})},"_bindEventOnShape")},{key:"_onFabricMouseDown",value:e(function(s){if(s.target||(this._isSelected=!1,this._shapeObj=!1),!this._isSelected&&!this._shapeObj){var g=this.getCanvas();this._startPoint=g.getPointer(s.e),g.on({"mouse:move":this._handlers.mousemove,"mouse:up":this._handlers.mouseup})}},"_onFabricMouseDown")},{key:"_onFabricMouseMove",value:e(function(s){var g=this,M=this.getCanvas(),O=M.getPointer(s.e),F=this._startPoint.x,R=this._startPoint.y,U=F-O.x,W=R-O.y,at=this._shapeObj;at?(this._shapeObj.set({isRegular:this._withShiftKey}),Mi().resize(at,O),M.renderAll(),this._resetPositionFillFilter(at)):this.add(this._type,{left:F,top:R,width:U,height:W}).then(function(ot){g.fire(Mt.ADD_OBJECT,ot)})},"_onFabricMouseMove")},{key:"_onFabricMouseUp",value:e(function(){var s=this,g=this.getCanvas(),M=this._startPoint.x,O=this._startPoint.y,F=this._shapeObj;F?F&&(Mi().adjustOriginToCenter(F),this.fire(Mt.OBJECT_ADDED,this.graphics.createObjectProperties(F))):this.add(this._type,{left:M,top:O,width:Pv,height:Lv}).then(function(R){s.fire(Mt.ADD_OBJECT,R)}),g.off({"mouse:move":this._handlers.mousemove,"mouse:up":this._handlers.mouseup})},"_onFabricMouseUp")},{key:"_onKeyDown",value:e(function(s){s.keyCode===we.SHIFT&&(this._withShiftKey=!0,this._shapeObj&&(this._shapeObj.isRegular=!0))},"_onKeyDown")},{key:"_onKeyUp",value:e(function(s){s.keyCode===we.SHIFT&&(this._withShiftKey=!1,this._shapeObj&&(this._shapeObj.isRegular=!1))},"_onKeyUp")},{key:"_resetPositionFillFilter",value:e(function(s){if(wa(s)==="filter"){var g=Yr(s,"patternSourceCanvas"),M=g.patternSourceCanvas,O=es(s),F=Yr(O,"originalAngle"),R=F.originalAngle;this.graphics.canvasImage.angle!==R&&xv(s,this.graphics.canvasImage);var U=s.originX,W=s.originY;Mi().adjustOriginToCenter(s),s.width*=s.scaleX,s.height*=s.scaleY,s.rx*=s.scaleX,s.ry*=s.scaleY,s.scaleX=1,s.scaleY=1,mv(s),tf(s,{originX:U,originY:W}),_v(M)}},"_resetPositionFillFilter")},{key:"_fillFilterRePositionInGroupSelection",value:e(function(s,g){(g.scaleX!==1||g.scaleY!==1)&&g.addWithUpdate();var M=s.angle,O=s.left,F=s.top;ut.fabric.util.addTransformToObject(s,g.calcTransformMatrix()),this._resetPositionFillFilter(s),s.set({angle:M,left:O,top:F})},"_fillFilterRePositionInGroupSelection")}]),o}(oi);function Rv(k){var C=jv();return e(function(){var d=Kt(k),s;if(C){var g=Kt(this).constructor;s=At()(d,arguments,g)}else s=d.apply(this,arguments);return _e(this,s)},"_createSuperInternal")}e(Rv,"zoom_createSuper");function jv(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch{return!1}}e(jv,"zoom_isNativeReflectConstruct");var ka=10,oc={left:0,top:0,width:0,height:0,stroke:"#000000",strokeWidth:0,fill:"#000000",opacity:.4,evented:!1,selectable:!1,hoverCursor:"auto"},Pa={SIZE:.0045,MARGIN:.003,BORDER_RADIUS:.003},La={SIZE:.0066,MARGIN:.0044,BORDER_RADIUS:.003},is=1,lc=Mt.ZOOM_CHANGED,Fv=Mt.ADD_TEXT,zv=Mt.TEXT_EDITING,Bv=Mt.OBJECT_MODIFIED,cc=Mt.KEY_DOWN,uc=Mt.KEY_UP,Uv=Mt.HAND_STARTED,Hv=Mt.HAND_STOPPED,Wv=function(k){Ce(o,k);var C=Rv(o);function o(d){var s,g,M,O,F,R,U,W,at,ot,mt,ft,pt;V(this,o),pt=C.call(this,jt.ZOOM,d),pt.zoomArea=null,pt._startPoint=null,pt._centerPoints=[],pt.zoomLevel=is,pt.zoomMode=We.DEFAULT,pt._listeners={startZoom:q()(s=pt._onMouseDownWithZoomMode).call(s,he(pt)),moveZoom:q()(g=pt._onMouseMoveWithZoomMode).call(g,he(pt)),stopZoom:q()(M=pt._onMouseUpWithZoomMode).call(M,he(pt)),startHand:q()(O=pt._onMouseDownWithHandMode).call(O,he(pt)),moveHand:q()(F=pt._onMouseMoveWithHandMode).call(F,he(pt)),stopHand:q()(R=pt._onMouseUpWithHandMode).call(R,he(pt)),zoomChanged:q()(U=pt._changeScrollState).call(U,he(pt)),keydown:q()(W=pt._startHandModeWithSpaceBar).call(W,he(pt)),keyup:q()(at=pt._endHandModeWithSpaceBar).call(at,he(pt))};var Pt=pt.getCanvas();return pt.aspectRatio=Pt.width/Pt.height,pt._verticalScroll=new ut.fabric.Rect(oc),pt._horizontalScroll=new ut.fabric.Rect(oc),Pt.on(lc,pt._listeners.zoomChanged),pt.graphics.on(Fv,q()(ot=pt._startTextEditingHandler).call(ot,he(pt))),pt.graphics.on(zv,q()(mt=pt._startTextEditingHandler).call(mt,he(pt))),pt.graphics.on(Bv,q()(ft=pt._stopTextEditingHandler).call(ft,he(pt))),pt}return e(o,"Zoom"),rt(o,[{key:"attachKeyboardZoomEvents",value:e(function(){ut.fabric.util.addListener(document,cc,this._listeners.keydown),ut.fabric.util.addListener(document,uc,this._listeners.keyup)},"attachKeyboardZoomEvents")},{key:"detachKeyboardZoomEvents",value:e(function(){ut.fabric.util.removeListener(document,cc,this._listeners.keydown),ut.fabric.util.removeListener(document,uc,this._listeners.keyup)},"detachKeyboardZoomEvents")},{key:"_startTextEditingHandler",value:e(function(){this.isTextEditing=!0},"_startTextEditingHandler")},{key:"_stopTextEditingHandler",value:e(function(){this.isTextEditing=!1},"_stopTextEditingHandler")},{key:"_startHandModeWithSpaceBar",value:e(function(s){this.withSpace||this.isTextEditing||s.keyCode===we.SPACE&&(this.withSpace=!0,this.startHandMode())},"_startHandModeWithSpaceBar")},{key:"_endHandModeWithSpaceBar",value:e(function(s){s.keyCode===we.SPACE&&(this.withSpace=!1,this.endHandMode())},"_endHandModeWithSpaceBar")},{key:"startZoomInMode",value:e(function(){if(!this.zoomArea){this.endHandMode(),this.zoomMode=We.ZOOM;var s=this.getCanvas();this._changeObjectsEventedState(!1),this.zoomArea=new ut.fabric.Rect({left:0,top:0,width:.5,height:.5,stroke:"black",strokeWidth:1,fill:"transparent",hoverCursor:"zoom-in"}),s.discardActiveObject(),s.add(this.zoomArea),s.on("mouse:down",this._listeners.startZoom),s.selection=!1,s.defaultCursor="zoom-in"}},"startZoomInMode")},{key:"endZoomInMode",value:e(function(){this.zoomMode=We.DEFAULT;var s=this.getCanvas(),g=this._listeners,M=g.startZoom,O=g.moveZoom,F=g.stopZoom;s.selection=!0,s.defaultCursor="auto",s.off({"mouse:down":M,"mouse:move":O,"mouse:up":F}),this._changeObjectsEventedState(!0),s.remove(this.zoomArea),this.zoomArea=null},"endZoomInMode")},{key:"start",value:e(function(){this.zoomArea=null,this._startPoint=null,this._startHandPoint=null},"start")},{key:"end",value:e(function(){this.endZoomInMode(),this.endHandMode()},"end")},{key:"startHandMode",value:e(function(){this.endZoomInMode(),this.zoomMode=We.HAND;var s=this.getCanvas();this._changeObjectsEventedState(!1),s.discardActiveObject(),s.off("mouse:down",this._listeners.startHand),s.on("mouse:down",this._listeners.startHand),s.selection=!1,s.defaultCursor="grab",s.fire(Uv)},"startHandMode")},{key:"endHandMode",value:e(function(){this.zoomMode=We.DEFAULT;var s=this.getCanvas();this._changeObjectsEventedState(!0),s.off("mouse:down",this._listeners.startHand),s.selection=!0,s.defaultCursor="auto",this._startHandPoint=null,s.fire(Hv)},"endHandMode")},{key:"_onMouseDownWithZoomMode",value:e(function(s){var g=s.target,M=s.e;if(!g){var O=this.getCanvas();O.selection=!1,this._startPoint=O.getPointer(M),this.zoomArea.set({width:0,height:0});var F=this._listeners,R=F.moveZoom,U=F.stopZoom;O.on({"mouse:move":R,"mouse:up":U})}},"_onMouseDownWithZoomMode")},{key:"_onMouseMoveWithZoomMode",value:e(function(s){var g=s.e,M=this.getCanvas(),O=M.getPointer(g),F=O.x,R=O.y,U=this.zoomArea,W=this._startPoint,at=Math.abs(F-W.x),ot=Math.abs(R-W.y);at+ot>ka&&(M.remove(U),U.set(this._calcRectDimensionFromPoint(F,R)),M.add(U))},"_onMouseMoveWithZoomMode")},{key:"_calcRectDimensionFromPoint",value:e(function(s,g){var M=this.getCanvas(),O=M.getWidth(),F=M.getHeight(),R=this._startPoint,U=R.x,W=R.y,at=Math.min,ot=at(U,s),mt=at(W,g),ft=re(s,U,O)-ot,pt=re(g,W,F)-mt;return{left:ot,top:mt,width:ft,height:pt}},"_calcRectDimensionFromPoint")},{key:"_onMouseUpWithZoomMode",value:e(function(){var s=this.zoomLevel,g=this.zoomArea,M=this._listeners,O=M.moveZoom,F=M.stopZoom,R=this.getCanvas(),U=this._getCenterPoint(),W=U.x,at=U.y;this._isMaxZoomLevel()||(this._centerPoints.push({x:W,y:at,prevZoomLevel:s,zoomLevel:s+1}),s+=1,R.zoomToPoint({x:W,y:at},s),this._fireZoomChanged(R,s),this.zoomLevel=s),R.off({"mouse:move":O,"mouse:up":F}),R.remove(g),this._startPoint=null},"_onMouseUpWithZoomMode")},{key:"_getCenterPoint",value:e(function(){var s=this.zoomArea,g=s.left,M=s.top,O=s.width,F=s.height,R=this._startPoint,U=R.x,W=R.y,at=this.aspectRatio;return O<ka&&F<ka?{x:U,y:W}:O>F?{x:g+at*F/2,y:M+F/2}:{x:g+O/2,y:M+O/at/2}},"_getCenterPoint")},{key:"zoom",value:e(function(s){for(var g=s.x,M=s.y,O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.zoomLevel,F=this.getCanvas(),R=this._centerPoints,U=R.length-1;U>=0&&!(R[U].zoomLevel<O);U-=1){var W=R.pop(),at=W.x,ot=W.y,mt=W.prevZoomLevel;F.zoomToPoint({x:at,y:ot},mt),this.zoomLevel=mt}F.zoomToPoint({x:g,y:M},O),this._isDefaultZoomLevel(O)||this._centerPoints.push({x:g,y:M,zoomLevel:O,prevZoomLevel:this.zoomLevel}),this.zoomLevel=O,this._fireZoomChanged(F,O)},"zoom")},{key:"zoomOut",value:e(function(){var s=this._centerPoints;if(s.length){var g=this.getCanvas(),M=s.pop(),O=M.x,F=M.y,R=M.prevZoomLevel;this._isDefaultZoomLevel(R)?g.setViewportTransform([1,0,0,1,0,0]):g.zoomToPoint({x:O,y:F},R),this.zoomLevel=R,this._fireZoomChanged(g,this.zoomLevel)}},"zoomOut")},{key:"resetZoom",value:e(function(){var s=this.getCanvas();s.setViewportTransform([1,0,0,1,0,0]),this.zoomLevel=is,this._centerPoints=[],this._fireZoomChanged(s,this.zoomLevel)},"resetZoom")},{key:"_isMaxZoomLevel",value:e(function(){return this.zoomLevel>=5},"_isMaxZoomLevel")},{key:"_movePointOfZoom",value:e(function(s){var g=s.x,M=s.y,O=this._centerPoints;if(O.length){var F=this.getCanvas(),R=this.zoomLevel,U=O.pop(),W=U.x,at=U.y,ot=U.prevZoomLevel,mt=W-g,ft=at-M;F.zoomToPoint({x:W,y:at},ot),F.zoomToPoint({x:mt,y:ft},R),O.push({x:mt,y:ft,prevZoomLevel:ot,zoomLevel:R}),this._fireZoomChanged(F,R)}},"_movePointOfZoom")},{key:"_onMouseDownWithHandMode",value:e(function(s){var g=s.target,M=s.e;if(!g){var O=this.getCanvas();if(!(this.zoomLevel<=is)){O.selection=!1,this._startHandPoint=O.getPointer(M);var F=this._listeners,R=F.moveHand,U=F.stopHand;O.on({"mouse:move":R,"mouse:up":U})}}},"_onMouseDownWithHandMode")},{key:"_onMouseMoveWithHandMode",value:e(function(s){var g=s.e,M=this.getCanvas(),O=M.getPointer(g),F=O.x,R=O.y,U=F-this._startHandPoint.x,W=R-this._startHandPoint.y;this._movePointOfZoom({x:U,y:W})},"_onMouseMoveWithHandMode")},{key:"_onMouseUpWithHandMode",value:e(function(){var s=this.getCanvas(),g=this._listeners,M=g.moveHand,O=g.stopHand;s.off({"mouse:move":M,"mouse:up":O}),this._startHandPoint=null},"_onMouseUpWithHandMode")},{key:"_changeScrollState",value:e(function(s){var g=s.viewport,M=s.zoomLevel,O=this.getCanvas();if(O.remove(this._verticalScroll),O.remove(this._horizontalScroll),!this._isDefaultZoomLevel(M)){var F=O.width,R=O.height,U=g.tl,W=g.tr,at=g.bl,ot=W.x-U.x,mt=at.y-U.y,ft=ot*ot/F,pt=mt*La.SIZE,Pt=re(U.x+U.x/F*ot,U.x,W.x-ft),Qt=mt*La.MARGIN,qt=mt*La.BORDER_RADIUS;this._horizontalScroll.set({left:Pt,top:at.y-pt-Qt,width:ft,height:pt,rx:qt,ry:qt});var ee=ot*Pa.SIZE,Ft=mt*mt/R,ve=re(U.y+U.y/R*mt,W.y,at.y-Ft),Be=ot*Pa.MARGIN,ri=ot*Pa.BORDER_RADIUS;this._verticalScroll.set({left:W.x-ee-Be,top:ve,width:ee,height:Ft,rx:ri,ry:ri}),this._addScrollBar()}},"_changeScrollState")},{key:"_changeObjectsEventedState",value:e(function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,g=this.getCanvas();g.forEachObject(function(M){M.evented=s})},"_changeObjectsEventedState")},{key:"_addScrollBar",value:e(function(){var s=this,g=this.getCanvas();g.add(this._horizontalScroll),g.add(this._verticalScroll),this.scrollBarTid&&clearTimeout(this.scrollBarTid),this.scrollBarTid=i()(function(){g.remove(s._horizontalScroll),g.remove(s._verticalScroll)},3e3)},"_addScrollBar")},{key:"_isDefaultZoomLevel",value:e(function(s){return s===is},"_isDefaultZoomLevel")},{key:"_fireZoomChanged",value:e(function(s,g){s.fire(lc,{viewport:s.calcViewportBoundaries(),zoomLevel:g})},"_fireZoomChanged")},{key:"mode",get:e(function(){return this.zoomMode},"get")}]),o}(oi),Yv=Wv,hc=Jn.create,fc=Jn.types,Gv=function(){function k(C){V(this,k),this.name=C}return e(k,"DrawingMode"),rt(k,[{key:"getName",value:e(function(){return this.name},"getName")},{key:"start",value:e(function(){throw new Error(hc(fc.UN_IMPLEMENTATION,"start"))},"start")},{key:"end",value:e(function(){throw new Error(hc(fc.UN_IMPLEMENTATION,"stop"))},"end")}]),k}(),ji=Gv;function Xv(k){var C=Vv();return e(function(){var d=Kt(k),s;if(C){var g=Kt(this).constructor;s=At()(d,arguments,g)}else s=d.apply(this,arguments);return _e(this,s)},"_createSuperInternal")}e(Xv,"drawingMode_cropper_createSuper");function Vv(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch{return!1}}e(Vv,"drawingMode_cropper_isNativeReflectConstruct");var $v=function(k){Ce(o,k);var C=Xv(o);function o(){return V(this,o),C.call(this,ge.CROPPER)}return e(o,"CropperDrawingMode"),rt(o,[{key:"start",value:e(function(s){var g=s.getComponent(jt.CROPPER);g.start()},"start")},{key:"end",value:e(function(s){var g=s.getComponent(jt.CROPPER);g.end()},"end")}]),o}(ji),Zv=$v;function Jv(k){var C=Kv();return e(function(){var d=Kt(k),s;if(C){var g=Kt(this).constructor;s=At()(d,arguments,g)}else s=d.apply(this,arguments);return _e(this,s)},"_createSuperInternal")}e(Jv,"drawingMode_freeDrawing_createSuper");function Kv(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch{return!1}}e(Kv,"drawingMode_freeDrawing_isNativeReflectConstruct");var Qv=function(k){Ce(o,k);var C=Jv(o);function o(){return V(this,o),C.call(this,ge.FREE_DRAWING)}return e(o,"FreeDrawingMode"),rt(o,[{key:"start",value:e(function(s,g){var M=s.getComponent(jt.FREE_DRAWING);M.start(g)},"start")},{key:"end",value:e(function(s){var g=s.getComponent(jt.FREE_DRAWING);g.end()},"end")}]),o}(ji),qv=Qv;function tp(k){var C=ep();return e(function(){var d=Kt(k),s;if(C){var g=Kt(this).constructor;s=At()(d,arguments,g)}else s=d.apply(this,arguments);return _e(this,s)},"_createSuperInternal")}e(tp,"lineDrawing_createSuper");function ep(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch{return!1}}e(ep,"lineDrawing_isNativeReflectConstruct");var ip=function(k){Ce(o,k);var C=tp(o);function o(){return V(this,o),C.call(this,ge.LINE_DRAWING)}return e(o,"LineDrawingMode"),rt(o,[{key:"start",value:e(function(s,g){var M=s.getComponent(jt.LINE);M.start(g)},"start")},{key:"end",value:e(function(s){var g=s.getComponent(jt.LINE);g.end()},"end")}]),o}(ji),rp=ip;function np(k){var C=sp();return e(function(){var d=Kt(k),s;if(C){var g=Kt(this).constructor;s=At()(d,arguments,g)}else s=d.apply(this,arguments);return _e(this,s)},"_createSuperInternal")}e(np,"drawingMode_shape_createSuper");function sp(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch{return!1}}e(sp,"drawingMode_shape_isNativeReflectConstruct");var ap=function(k){Ce(o,k);var C=np(o);function o(){return V(this,o),C.call(this,ge.SHAPE)}return e(o,"ShapeDrawingMode"),rt(o,[{key:"start",value:e(function(s){var g=s.getComponent(jt.SHAPE);g.start()},"start")},{key:"end",value:e(function(s){var g=s.getComponent(jt.SHAPE);g.end()},"end")}]),o}(ji),op=ap;function lp(k){var C=cp();return e(function(){var d=Kt(k),s;if(C){var g=Kt(this).constructor;s=At()(d,arguments,g)}else s=d.apply(this,arguments);return _e(this,s)},"_createSuperInternal")}e(lp,"drawingMode_text_createSuper");function cp(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch{return!1}}e(cp,"drawingMode_text_isNativeReflectConstruct");var up=function(k){Ce(o,k);var C=lp(o);function o(){return V(this,o),C.call(this,ge.TEXT)}return e(o,"TextDrawingMode"),rt(o,[{key:"start",value:e(function(s){var g=s.getComponent(jt.TEXT);g.start()},"start")},{key:"end",value:e(function(s){var g=s.getComponent(jt.TEXT);g.end()},"end")}]),o}(ji),hp=up;function fp(k){var C=dp();return e(function(){var d=Kt(k),s;if(C){var g=Kt(this).constructor;s=At()(d,arguments,g)}else s=d.apply(this,arguments);return _e(this,s)},"_createSuperInternal")}e(fp,"drawingMode_icon_createSuper");function dp(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch{return!1}}e(dp,"drawingMode_icon_isNativeReflectConstruct");var gp=function(k){Ce(o,k);var C=fp(o);function o(){return V(this,o),C.call(this,ge.ICON)}return e(o,"IconDrawingMode"),rt(o,[{key:"start",value:e(function(s){var g=s.getComponent(jt.ICON);g.start()},"start")},{key:"end",value:e(function(s){var g=s.getComponent(jt.ICON);g.end()},"end")}]),o}(ji),vp=gp;function pp(k){var C=mp();return e(function(){var d=Kt(k),s;if(C){var g=Kt(this).constructor;s=At()(d,arguments,g)}else s=d.apply(this,arguments);return _e(this,s)},"_createSuperInternal")}e(pp,"drawingMode_zoom_createSuper");function mp(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch{return!1}}e(mp,"drawingMode_zoom_isNativeReflectConstruct");var yp=function(k){Ce(o,k);var C=pp(o);function o(){return V(this,o),C.call(this,ge.ZOOM)}return e(o,"ZoomDrawingMode"),rt(o,[{key:"start",value:e(function(s){var g=s.getComponent(jt.ZOOM);g.start()},"start")},{key:"end",value:e(function(s){var g=s.getComponent(jt.ZOOM);g.end()},"end")}]),o}(ji),bp=yp,dc=null;function gc(k){dc=k}e(gc,"setCachedUndoDataForDimension");function Cp(){return dc}e(Cp,"getCachedUndoDataForDimension");function Na(k,C){var o;if(k.type==="activeSelection"){var d;o=pi()(d=k.getObjects()).call(d,function(s){var g=s.angle,M=s.left,O=s.top,F=s.scaleX,R=s.scaleY,U=s.width,W=s.height;ut.fabric.util.addTransformToObject(s,k.calcTransformMatrix());var at=C(s);return s.set({angle:g,left:M,top:O,width:U,height:W,scaleX:F,scaleY:R}),at})}else o=[C(k)];return o}e(Na,"makeSelectionUndoData");function Ra(k,C,o){return o?{id:k,width:C.width,height:C.height,top:C.top,left:C.left,angle:C.angle,scaleX:C.scaleX,scaleY:C.scaleY}:Z()({id:k},C)}e(Ra,"makeSelectionUndoDatum");function _p(k){var C=xp();return e(function(){var d=Kt(k),s;if(C){var g=Kt(this).constructor;s=At()(d,arguments,g)}else s=d.apply(this,arguments);return _e(this,s)},"_createSuperInternal")}e(_p,"component_resize_createSuper");function xp(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch{return!1}}e(xp,"component_resize_isNativeReflectConstruct");var Sp=function(k){Ce(o,k);var C=_p(o);function o(d){var s;return V(this,o),s=C.call(this,jt.RESIZE,d),s._dimensions=null,s._originalDimensions=null,s}return e(o,"Resize"),rt(o,[{key:"getCurrentDimensions",value:e(function(){var s=this.getCanvasImage();if(!this._dimensions&&s){var g=s.width,M=s.height;this._dimensions={width:g,height:M}}return this._dimensions},"getCurrentDimensions")},{key:"getOriginalDimensions",value:e(function(){return this._originalDimensions},"getOriginalDimensions")},{key:"setOriginalDimensions",value:e(function(s){this._originalDimensions=s},"setOriginalDimensions")},{key:"resize",value:e(function(s){var g=this.getCanvasImage(),M=g.width,O=g.height,F=g.scaleX,R=g.scaleY,U=s.width,W=s.height,at={scaleX:U?U/M:F,scaleY:W?W/O:R};return(F!==at.scaleX||R!==at.scaleY)&&(g.set(at).setCoords(),this._dimensions={width:g.width*g.scaleX,height:g.height*g.scaleY}),this.adjustCanvasDimensionBase(),xt().resolve()},"resize")},{key:"start",value:e(function(){var s=this.getCurrentDimensions();this.setOriginalDimensions(s)},"start")},{key:"end",value:e(function(){},"end")}]),o}(oi),Ip=Sp;function Ep(k){var C=wp();return e(function(){var d=Kt(k),s;if(C){var g=Kt(this).constructor;s=At()(d,arguments,g)}else s=d.apply(this,arguments);return _e(this,s)},"_createSuperInternal")}e(Ep,"drawingMode_resize_createSuper");function wp(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch{return!1}}e(wp,"drawingMode_resize_isNativeReflectConstruct");var Mp=function(k){Ce(o,k);var C=Ep(o);function o(){return V(this,o),C.call(this,ge.RESIZE)}return e(o,"ResizeDrawingMode"),rt(o,[{key:"start",value:e(function(s){var g=s.getComponent(jt.RESIZE);g.start()},"start")},{key:"end",value:e(function(s){var g=s.getComponent(jt.RESIZE);g.end()},"end")}]),o}(ji),Tp=Mp,Ap=1e3,Op=800,rs=10,Dp={cssOnly:!0},kp={backstoreOnly:!0},vc=function(){function k(C){var o,d,s,g,M,O,F,R,U,W,at,ot=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},mt=ot.cssMaxWidth,ft=ot.cssMaxHeight;V(this,k),this.canvasImage=null,this.cssMaxWidth=mt||Ap,this.cssMaxHeight=ft||Op,this.cropSelectionStyle={},this.targetObjectForCopyPaste=null,this.imageName="",this._objects={},this._canvas=null,this._drawingMode=ge.NORMAL,this._drawingModeMap={},this._componentMap={},this._handler={onMouseDown:q()(o=this._onMouseDown).call(o,this),onObjectAdded:q()(d=this._onObjectAdded).call(d,this),onObjectRemoved:q()(s=this._onObjectRemoved).call(s,this),onObjectMoved:q()(g=this._onObjectMoved).call(g,this),onObjectScaled:q()(M=this._onObjectScaled).call(M,this),onObjectModified:q()(O=this._onObjectModified).call(O,this),onObjectRotated:q()(F=this._onObjectRotated).call(F,this),onObjectSelected:q()(R=this._onObjectSelected).call(R,this),onPathCreated:q()(U=this._onPathCreated).call(U,this),onSelectionCleared:q()(W=this._onSelectionCleared).call(W,this),onSelectionCreated:q()(at=this._onSelectionCreated).call(at,this)},this._setObjectCachingToFalse(),this._setCanvasElement(C),this._createDrawingModeInstances(),this._createComponents(),this._attachCanvasEvents(),this._attachZoomEvents()}return e(k,"Graphics"),rt(k,[{key:"destroy",value:e(function(){var o=this._canvas.wrapperEl;this._canvas.clear(),o.parentNode.removeChild(o),this._detachZoomEvents()},"destroy")},{key:"_attachZoomEvents",value:e(function(){var o=this.getComponent(jt.ZOOM);o.attachKeyboardZoomEvents()},"_attachZoomEvents")},{key:"_detachZoomEvents",value:e(function(){var o=this.getComponent(jt.ZOOM);o.detachKeyboardZoomEvents()},"_detachZoomEvents")},{key:"deactivateAll",value:e(function(){return this._canvas.discardActiveObject(),this},"deactivateAll")},{key:"renderAll",value:e(function(){return this._canvas.renderAll(),this},"renderAll")},{key:"add",value:e(function(o){var d,s=[];Jl()(o)?s=o:s.push(o),(d=this._canvas).add.apply(d,B(s))},"add")},{key:"contains",value:e(function(o){return this._canvas.contains(o)},"contains")},{key:"getObjects",value:e(function(){var o;return b()(o=this._canvas.getObjects()).call(o)},"getObjects")},{key:"getObject",value:e(function(o){return this._objects[o]},"getObject")},{key:"remove",value:e(function(o){this._canvas.remove(o)},"remove")},{key:"removeAll",value:e(function(o){var d,s=this._canvas,g=b()(d=s.getObjects()).call(d);return s.remove.apply(s,B(this._canvas.getObjects())),o&&s.clear(),g},"removeAll")},{key:"removeObjectById",value:e(function(o){var d=[],s=this._canvas,g=this.getObject(o),M=g&&g.isType("group")&&!g.isEmpty();return M?(s.discardActiveObject(),g.forEachObject(function(O){d.push(O),s.remove(O)})):s.contains(g)&&(d.push(g),s.remove(g)),d},"removeObjectById")},{key:"getObjectId",value:e(function(o){var d=null;for(d in this._objects)if(this._objects.hasOwnProperty(d)&&o===this._objects[d])return d;return null},"getObjectId")},{key:"getActiveObject",value:e(function(){return this._canvas._activeObject},"getActiveObject")},{key:"getActiveObjectIdForRemove",value:e(function(){var o=this.getActiveObject(),d=o.type,s=o.left,g=o.top,M=d==="activeSelection";if(M){var O=new ut.fabric.Group(B(o.getObjects()),{left:s,top:g});return this._addFabricObject(O)}return this.getObjectId(o)},"getActiveObjectIdForRemove")},{key:"isReadyRemoveObject",value:e(function(){var o=this.getActiveObject();return o&&!o.isEditing},"isReadyRemoveObject")},{key:"getActiveObjects",value:e(function(){var o=this._canvas._activeObject;return o&&o.type==="activeSelection"?o:null},"getActiveObjects")},{key:"getActiveSelectionFromObjects",value:e(function(o){var d=this.getCanvas();return new ut.fabric.ActiveSelection(o,{canvas:d})},"getActiveSelectionFromObjects")},{key:"setActiveObject",value:e(function(o){this._canvas.setActiveObject(o)},"setActiveObject")},{key:"setCropSelectionStyle",value:e(function(o){this.cropSelectionStyle=o},"setCropSelectionStyle")},{key:"getComponent",value:e(function(o){return this._componentMap[o]},"getComponent")},{key:"getDrawingMode",value:e(function(){return this._drawingMode},"getDrawingMode")},{key:"startDrawingMode",value:e(function(o,d){if(this._isSameDrawingMode(o))return!0;this.stopDrawingMode();var s=this._getDrawingModeInstance(o);return s&&s.start&&(s.start(this,d),this._drawingMode=o),!!s},"startDrawingMode")},{key:"stopDrawingMode",value:e(function(){if(!this._isSameDrawingMode(ge.NORMAL)){var o=this._getDrawingModeInstance(this.getDrawingMode());o&&o.end&&o.end(this),this._drawingMode=ge.NORMAL}},"stopDrawingMode")},{key:"zoom",value:e(function(o,d){var s=o.x,g=o.y,M=this.getComponent(jt.ZOOM);M.zoom({x:s,y:g},d)},"zoom")},{key:"getZoomMode",value:e(function(){var o=this.getComponent(jt.ZOOM);return o.mode},"getZoomMode")},{key:"startZoomInMode",value:e(function(){var o=this.getComponent(jt.ZOOM);o.startZoomInMode()},"startZoomInMode")},{key:"endZoomInMode",value:e(function(){var o=this.getComponent(jt.ZOOM);o.endZoomInMode()},"endZoomInMode")},{key:"zoomOut",value:e(function(){var o=this.getComponent(jt.ZOOM);o.zoomOut()},"zoomOut")},{key:"startHandMode",value:e(function(){var o=this.getComponent(jt.ZOOM);o.startHandMode()},"startHandMode")},{key:"endHandMode",value:e(function(){var o=this.getComponent(jt.ZOOM);o.endHandMode()},"endHandMode")},{key:"resetZoom",value:e(function(){var o=this.getComponent(jt.ZOOM);o.resetZoom()},"resetZoom")},{key:"toDataURL",value:e(function(o){var d=this.getComponent(jt.CROPPER);d.changeVisibility(!1);var s=this._canvas&&this._canvas.toDataURL(o);return d.changeVisibility(!0),s},"toDataURL")},{key:"setCanvasImage",value:e(function(o,d){d&&Rt(d),this.imageName=o,this.canvasImage=d},"setCanvasImage")},{key:"setCssMaxDimension",value:e(function(o){this.cssMaxWidth=o.width||this.cssMaxWidth,this.cssMaxHeight=o.height||this.cssMaxHeight},"setCssMaxDimension")},{key:"adjustCanvasDimension",value:e(function(){this.adjustCanvasDimensionBase(this.canvasImage.scale(1))},"adjustCanvasDimension")},{key:"adjustCanvasDimensionBase",value:e(function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;o||(o=this.canvasImage);var d=o.getBoundingRect(),s=d.width,g=d.height,M=this._calcMaxDimension(s,g);this.setCanvasCssDimension({width:"100%",height:"100%","max-width":"".concat(M.width,"px"),"max-height":"".concat(M.height,"px")}),this.setCanvasBackstoreDimension({width:s,height:g}),this._canvas.centerObject(o)},"adjustCanvasDimensionBase")},{key:"setCanvasCssDimension",value:e(function(o){this._canvas.setDimensions(o,Dp)},"setCanvasCssDimension")},{key:"setCanvasBackstoreDimension",value:e(function(o){this._canvas.setDimensions(o,kp)},"setCanvasBackstoreDimension")},{key:"setImageProperties",value:e(function(o,d){var s=this.canvasImage;s&&(s.set(o).setCoords(),d&&this._canvas.renderAll())},"setImageProperties")},{key:"getCanvasElement",value:e(function(){return this._canvas.getElement()},"getCanvasElement")},{key:"getCanvas",value:e(function(){return this._canvas},"getCanvas")},{key:"getCanvasImage",value:e(function(){return this.canvasImage},"getCanvasImage")},{key:"getImageName",value:e(function(){return this.imageName},"getImageName")},{key:"addImageObject",value:e(function(o){var d,s=this,g=q()(d=this._callbackAfterLoadingImageObject).call(d,this);return new(xt())(function(M){ut.fabric.Image.fromURL(o,function(O){g(O),M(s.createObjectProperties(O))},{crossOrigin:"Anonymous"})})},"addImageObject")},{key:"getCenter",value:e(function(){return this._canvas.getCenter()},"getCenter")},{key:"getCropzoneRect",value:e(function(){return this.getComponent(jt.CROPPER).getCropzoneRect()},"getCropzoneRect")},{key:"setCropzoneRect",value:e(function(o){this.getComponent(jt.CROPPER).setCropzoneRect(o)},"setCropzoneRect")},{key:"getCroppedImageData",value:e(function(o){return this.getComponent(jt.CROPPER).getCroppedImageData(o)},"getCroppedImageData")},{key:"setBrush",value:e(function(o){var d=this._drawingMode,s=jt.FREE_DRAWING;d===ge.LINE_DRAWING&&(s=jt.LINE),this.getComponent(s).setBrush(o)},"setBrush")},{key:"setDrawingShape",value:e(function(o,d){this.getComponent(jt.SHAPE).setStates(o,d)},"setDrawingShape")},{key:"setIconStyle",value:e(function(o,d){this.getComponent(jt.ICON).setStates(o,d)},"setIconStyle")},{key:"registerPaths",value:e(function(o){this.getComponent(jt.ICON).registerPaths(o)},"registerPaths")},{key:"changeCursor",value:e(function(o){var d=this.getCanvas();d.defaultCursor=o,d.renderAll()},"changeCursor")},{key:"hasFilter",value:e(function(o){return this.getComponent(jt.FILTER).hasFilter(o)},"hasFilter")},{key:"setSelectionStyle",value:e(function(o){Z()(ui.SELECTION_STYLE,o)},"setSelectionStyle")},{key:"setObjectProperties",value:e(function(o,d){var s=this.getObject(o),g=Z()({},d);return s.set(g),s.setCoords(),this.getCanvas().renderAll(),g},"setObjectProperties")},{key:"getObjectProperties",value:e(function(o,d){var s=this.getObject(o),g={};return It()(d)?g[d]=s[d]:Jl()(d)?Gr()(d,function(M){g[M]=s[M]}):Qn()(d,function(M,O){g[O]=s[O]}),g},"getObjectProperties")},{key:"getObjectPosition",value:e(function(o,d,s){var g=this.getObject(o);return g?g.getPointByOrigin(d,s):null},"getObjectPosition")},{key:"setObjectPosition",value:e(function(o,d){var s=this.getObject(o),g=d.x,M=d.y,O=d.originX,F=d.originY;if(!s)return!1;var R=s.getPointByOrigin(O,F),U=s.getPointByOrigin("center","center"),W=U.x-R.x,at=U.y-R.y;return s.set({left:g+W,top:M+at}),s.setCoords(),!0},"setObjectPosition")},{key:"getCanvasSize",value:e(function(){var o=this.getCanvasImage();return{width:o?o.width:0,height:o?o.height:0}},"getCanvasSize")},{key:"createStaticCanvas",value:e(function(){var o=new ut.fabric.StaticCanvas;return o.set({enableRetinaScaling:!1}),o},"createStaticCanvas")},{key:"_getDrawingModeInstance",value:e(function(o){return this._drawingModeMap[o]},"_getDrawingModeInstance")},{key:"_setObjectCachingToFalse",value:e(function(){ut.fabric.Object.prototype.objectCaching=!1},"_setObjectCachingToFalse")},{key:"_setCanvasElement",value:e(function(o){var d,s;o.nodeType?d=o:d=document.querySelector(o),d.nodeName.toUpperCase()!=="CANVAS"&&(s=document.createElement("canvas"),d.appendChild(s)),this._canvas=new ut.fabric.Canvas(s,{containerClass:"tui-image-editor-canvas-container",enableRetinaScaling:!1})},"_setCanvasElement")},{key:"_createDrawingModeInstances",value:e(function(){this._register(this._drawingModeMap,new Zv),this._register(this._drawingModeMap,new qv),this._register(this._drawingModeMap,new rp),this._register(this._drawingModeMap,new op),this._register(this._drawingModeMap,new hp),this._register(this._drawingModeMap,new vp),this._register(this._drawingModeMap,new bp),this._register(this._drawingModeMap,new Tp)},"_createDrawingModeInstances")},{key:"_createComponents",value:e(function(){this._register(this._componentMap,new og(this)),this._register(this._componentMap,new Ig(this)),this._register(this._componentMap,new Tg(this)),this._register(this._componentMap,new kg(this)),this._register(this._componentMap,new Rg(this)),this._register(this._componentMap,new Yg(this)),this._register(this._componentMap,new Kg(this)),this._register(this._componentMap,new iv(this)),this._register(this._componentMap,new gv(this)),this._register(this._componentMap,new Nv(this)),this._register(this._componentMap,new Yv(this)),this._register(this._componentMap,new Ip(this))},"_createComponents")},{key:"_register",value:e(function(o,d){o[d.getName()]=d},"_register")},{key:"_isSameDrawingMode",value:e(function(o){return this.getDrawingMode()===o},"_isSameDrawingMode")},{key:"_calcMaxDimension",value:e(function(o,d){var s=this.cssMaxWidth/o,g=this.cssMaxHeight/d,M=Math.min(o,this.cssMaxWidth),O=Math.min(d,this.cssMaxHeight);return s<1&&s<g?(M=o*s,O=d*s):g<1&&g<s&&(M=o*g,O=d*g),{width:Math.floor(M),height:Math.floor(O)}},"_calcMaxDimension")},{key:"_callbackAfterLoadingImageObject",value:e(function(o){var d=this.getCanvasImage().getCenterPoint();o.set(ui.SELECTION_STYLE),o.set({left:d.x,top:d.y,crossOrigin:"Anonymous"}),this.getCanvas().add(o).setActiveObject(o)},"_callbackAfterLoadingImageObject")},{key:"_attachCanvasEvents",value:e(function(){var o=this._canvas,d=this._handler;o.on({"mouse:down":d.onMouseDown,"object:added":d.onObjectAdded,"object:removed":d.onObjectRemoved,"object:moving":d.onObjectMoved,"object:scaling":d.onObjectScaled,"object:modified":d.onObjectModified,"object:rotating":d.onObjectRotated,"path:created":d.onPathCreated,"selection:cleared":d.onSelectionCleared,"selection:created":d.onSelectionCreated,"selection:updated":d.onObjectSelected})},"_attachCanvasEvents")},{key:"_onMouseDown",value:e(function(o){var d=this,s=o.e,g=o.target,M=this._canvas.getPointer(s);if(g){var O=g.type,F=Na(g,function(R){return Ra(d.getObjectId(R),R,O==="activeSelection")});gc(F)}this.fire(Mt.MOUSE_DOWN,s,M)},"_onMouseDown")},{key:"_onObjectAdded",value:e(function(o){var d=o.target;d.isType("cropzone")||this._addFabricObject(d)},"_onObjectAdded")},{key:"_onObjectRemoved",value:e(function(o){var d=o.target;this._removeFabricObject(Rt(d))},"_onObjectRemoved")},{key:"_onObjectMoved",value:e(function(o){var d=this;this._lazyFire(Mt.OBJECT_MOVED,function(s){return d.createObjectProperties(s)},o.target)},"_onObjectMoved")},{key:"_onObjectScaled",value:e(function(o){var d=this;this._lazyFire(Mt.OBJECT_SCALED,function(s){return d.createObjectProperties(s)},o.target)},"_onObjectScaled")},{key:"_onObjectModified",value:e(function(o){var d=o.target;if(d.type==="activeSelection"){var s=d.getObjects();Gt()(s).call(s,function(g){return g.fire("modifiedInGroup",d)})}this.fire(Mt.OBJECT_MODIFIED,d,this.getObjectId(d))},"_onObjectModified")},{key:"_onObjectRotated",value:e(function(o){var d=this;this._lazyFire(Mt.OBJECT_ROTATED,function(s){return d.createObjectProperties(s)},o.target)},"_onObjectRotated")},{key:"_lazyFire",value:e(function(o,d,s){var g=this,M=s&&s.canvasEventDelegation,O=M?s.canvasEventDelegation(o):"none";O==="unregistered"&&s.canvasEventRegister(o,function(F){g.fire(o,d(F))}),O==="none"&&this.fire(o,d(s))},"_lazyFire")},{key:"_onObjectSelected",value:e(function(o){var d=o.target,s=this.createObjectProperties(d);this.fire(Mt.OBJECT_ACTIVATED,s)},"_onObjectSelected")},{key:"_onPathCreated",value:e(function(o){var d=o.path.getCenterPoint(),s=d.x,g=d.y;o.path.set(Z()({left:s,top:g},ui.SELECTION_STYLE));var M=this.createObjectProperties(o.path);this.fire(Mt.ADD_OBJECT,M)},"_onPathCreated")},{key:"_onSelectionCleared",value:e(function(){this.fire(Mt.SELECTION_CLEARED)},"_onSelectionCleared")},{key:"_onSelectionCreated",value:e(function(o){var d=o.target,s=this.createObjectProperties(d);this.fire(Mt.OBJECT_ACTIVATED,s),this.fire(Mt.SELECTION_CREATED,o.target)},"_onSelectionCreated")},{key:"discardSelection",value:e(function(){this._canvas.discardActiveObject(),this._canvas.renderAll()},"discardSelection")},{key:"changeSelectableAll",value:e(function(o){this._canvas.forEachObject(function(d){d.selectable=o,d.hoverCursor=o?"move":"crosshair"})},"changeSelectableAll")},{key:"createObjectProperties",value:e(function(o){var d=["left","top","width","height","fill","stroke","strokeWidth","opacity","angle"],s={id:Rt(o),type:o.type};if(Z()(s,Ge(o,d)),Zn(["i-text","text"],o.type))Z()(s,this._createTextProperties(o,s));else if(Zn(["rect","triangle","circle"],o.type)){var g=this.getComponent(jt.SHAPE);Z()(s,{fill:g.makeFillPropertyForUserEvent(o)})}return s},"createObjectProperties")},{key:"_createTextProperties",value:e(function(o){var d=["text","fontFamily","fontSize","fontStyle","textAlign","textDecoration","fontWeight"],s={};return Z()(s,Ge(o,d)),s},"_createTextProperties")},{key:"_addFabricObject",value:e(function(o){var d=Rt(o);return this._objects[d]=o,d},"_addFabricObject")},{key:"_removeFabricObject",value:e(function(o){delete this._objects[o]},"_removeFabricObject")},{key:"resetTargetObjectForCopyPaste",value:e(function(){var o=this.getActiveObject();o&&(this.targetObjectForCopyPaste=o)},"resetTargetObjectForCopyPaste")},{key:"pasteObject",value:e(function(){var o=this;if(!this.targetObjectForCopyPaste)return xt().resolve([]);var d=this.targetObjectForCopyPaste,s=d.type==="activeSelection",g=s?d.getObjects():[d],M=null;return this.discardSelection(),this._cloneObject(g).then(function(O){if(O.length>1)M=o.getActiveSelectionFromObjects(O);else{var F=ht(O,1);M=F[0]}o.targetObjectForCopyPaste=M,o.setActiveObject(M)})},"pasteObject")},{key:"_cloneObject",value:e(function(o){var d=this,s=pi()(o).call(o,function(g){return d._cloneObjectItem(g)});return xt().all(s)},"_cloneObject")},{key:"_cloneObjectItem",value:e(function(o){var d=this;return this._copyFabricObjectForPaste(o).then(function(s){var g=d.createObjectProperties(s);return d.add(s),d.fire(Mt.ADD_OBJECT,g),s})},"_cloneObjectItem")},{key:"_copyFabricObjectForPaste",value:e(function(o){var d=this,s=e(function(M,O){return O?M-rs:M+rs},"addExtraPx");return this._copyFabricObject(o).then(function(g){var M=g.left,O=g.top,F=g.width,R=g.height,U=d.getCanvasSize(),W=U.width,at=U.height,ot=M+F/2,mt=O+R/2;return g.set(Z()({left:s(M,ot+rs>W),top:s(O,mt+rs>at)},ui.SELECTION_STYLE)),g})},"_copyFabricObjectForPaste")},{key:"_copyFabricObject",value:e(function(o){var d=this;return new(xt())(function(s){o.clone(function(g){var M=d.getComponent(jt.SHAPE);Tl(g)&&M.processForCopiedObject(g,o),s(g)})})},"_copyFabricObject")},{key:"getCurrentDimensions",value:e(function(){var o=this.getComponent(jt.RESIZE);return o.getCurrentDimensions()},"getCurrentDimensions")},{key:"getOriginalDimensions",value:e(function(){var o=this.getComponent(jt.RESIZE);return o.getOriginalDimensions()},"getOriginalDimensions")},{key:"setOriginalDimensions",value:e(function(o){var d=this.getComponent(jt.RESIZE);d.setOriginalDimensions(o)},"setOriginalDimensions")},{key:"resize",value:e(function(o){var d=this.getComponent(jt.RESIZE);return d.resize(o)},"resize")}]),k}();yt().mixin(vc);var Pp=vc,Lp=Mt.MOUSE_DOWN,Np=Mt.OBJECT_MOVED,Rp=Mt.OBJECT_SCALED,jp=Mt.OBJECT_ACTIVATED,Fp=Mt.OBJECT_ROTATED,pc=Mt.OBJECT_ADDED,zp=Mt.OBJECT_MODIFIED,Bp=Mt.ADD_TEXT,Up=Mt.ADD_OBJECT,Hp=Mt.TEXT_EDITING,Wp=Mt.TEXT_CHANGED,Yp=Mt.ICON_CREATE_RESIZE,Gp=Mt.ICON_CREATE_END,mc=Mt.SELECTION_CLEARED,yc=Mt.SELECTION_CREATED,Xp=Mt.ADD_OBJECT_AFTER,ja=function(){function k(C,o){var d,s,g,M,O,F,R,U,W,at,ot,mt,ft,pt,Pt,Qt;if(V(this,k),o=Z()({includeUI:!1,usageStatistics:!0},o),this.mode=null,this.activeObjectId=null,o.includeUI){var qt=o.includeUI;qt.usageStatistics=o.usageStatistics,this.ui=new Kd(C,qt,this.getActions()),o=this.ui.setUiDefaultSelectionStyle(o)}this._invoker=new vf,this._graphics=new Pp(this.ui?this.ui.getEditorArea():C,{cssMaxWidth:o.cssMaxWidth,cssMaxHeight:o.cssMaxHeight}),this._handlers={keydown:q()(d=this._onKeyDown).call(d,this),mousedown:q()(s=this._onMouseDown).call(s,this),objectActivated:q()(g=this._onObjectActivated).call(g,this),objectMoved:q()(M=this._onObjectMoved).call(M,this),objectScaled:q()(O=this._onObjectScaled).call(O,this),objectRotated:q()(F=this._onObjectRotated).call(F,this),objectAdded:q()(R=this._onObjectAdded).call(R,this),objectModified:q()(U=this._onObjectModified).call(U,this),createdPath:this._onCreatedPath,addText:q()(W=this._onAddText).call(W,this),addObject:q()(at=this._onAddObject).call(at,this),textEditing:q()(ot=this._onTextEditing).call(ot,this),textChanged:q()(mt=this._onTextChanged).call(mt,this),iconCreateResize:q()(ft=this._onIconCreateResize).call(ft,this),iconCreateEnd:q()(pt=this._onIconCreateEnd).call(pt,this),selectionCleared:q()(Pt=this._selectionCleared).call(Pt,this),selectionCreated:q()(Qt=this._selectionCreated).call(Qt,this)},this._attachInvokerEvents(),this._attachGraphicsEvents(),this._attachDomEvents(),this._setSelectionStyle(o.selectionStyle,{applyCropSelectionStyle:o.applyCropSelectionStyle,applyGroupSelectionStyle:o.applyGroupSelectionStyle}),o.usageStatistics&&Xn(),this.ui&&(this.ui.initCanvas(),this.setReAction(),this._attachColorPickerInputBoxEvents()),ut.fabric.enableGLFiltering=!1}return e(k,"ImageEditor"),rt(k,[{key:"_attachColorPickerInputBoxEvents",value:e(function(){var o=this;this.ui.on(Mt.INPUT_BOX_EDITING_STARTED,function(){o.isColorPickerInputBoxEditing=!0}),this.ui.on(Mt.INPUT_BOX_EDITING_STOPPED,function(){o.isColorPickerInputBoxEditing=!1})},"_attachColorPickerInputBoxEvents")},{key:"_detachColorPickerInputBoxEvents",value:e(function(){this.ui.off(Mt.INPUT_BOX_EDITING_STARTED),this.ui.off(Mt.INPUT_BOX_EDITING_STOPPED)},"_detachColorPickerInputBoxEvents")},{key:"_setSelectionStyle",value:e(function(o,d){var s=d.applyCropSelectionStyle,g=d.applyGroupSelectionStyle;o&&this._graphics.setSelectionStyle(o),s&&this._graphics.setCropSelectionStyle(o),g&&this.on("selectionCreated",function(M){M.type==="activeSelection"&&M.set(o)})},"_setSelectionStyle")},{key:"_attachInvokerEvents",value:e(function(){var o,d,s=this,g=Mt.UNDO_STACK_CHANGED,M=Mt.REDO_STACK_CHANGED,O=Mt.EXECUTE_COMMAND,F=Mt.AFTER_UNDO,R=Mt.AFTER_REDO,U=Mt.HAND_STARTED,W=Mt.HAND_STOPPED;if(this._invoker.on(g,q()(o=this.fire).call(o,this,g)),this._invoker.on(M,q()(d=this.fire).call(d,this,M)),this.ui){var at=this._graphics.getCanvas();this._invoker.on(O,function(ot){return s.ui.fire(O,ot)}),this._invoker.on(F,function(ot){return s.ui.fire(F,ot)}),this._invoker.on(R,function(ot){return s.ui.fire(R,ot)}),at.on(U,function(){return s.ui.fire(U)}),at.on(W,function(){return s.ui.fire(W)})}},"_attachInvokerEvents")},{key:"_attachGraphicsEvents",value:e(function(){var o;this._graphics.on((o={},H(o,Lp,this._handlers.mousedown),H(o,Np,this._handlers.objectMoved),H(o,Rp,this._handlers.objectScaled),H(o,Fp,this._handlers.objectRotated),H(o,jp,this._handlers.objectActivated),H(o,pc,this._handlers.objectAdded),H(o,zp,this._handlers.objectModified),H(o,Bp,this._handlers.addText),H(o,Up,this._handlers.addObject),H(o,Hp,this._handlers.textEditing),H(o,Wp,this._handlers.textChanged),H(o,Yp,this._handlers.iconCreateResize),H(o,Gp,this._handlers.iconCreateEnd),H(o,mc,this._handlers.selectionCleared),H(o,yc,this._handlers.selectionCreated),o))},"_attachGraphicsEvents")},{key:"_attachDomEvents",value:e(function(){document.addEventListener("keydown",this._handlers.keydown)},"_attachDomEvents")},{key:"_detachDomEvents",value:e(function(){document.removeEventListener("keydown",this._handlers.keydown)},"_detachDomEvents")},{key:"_onKeyDown",value:e(function(o){var d=o.ctrlKey,s=o.keyCode,g=o.metaKey,M=d||g;M&&(s===we.C?this._graphics.resetTargetObjectForCopyPaste():s===we.V?(this._graphics.pasteObject(),this.clearRedoStack()):s===we.Z?this.undo().catch(function(){}):s===we.Y&&this.redo().catch(function(){}));var O=s===we.BACKSPACE||s===we.DEL,F=this._graphics.isReadyRemoveObject();!this.isColorPickerInputBoxEditing&&F&&O&&(o.preventDefault(),this.removeActiveObject())},"_onKeyDown")},{key:"removeActiveObject",value:e(function(){var o=this._graphics.getActiveObjectIdForRemove();this.removeObject(o)},"removeActiveObject")},{key:"_onMouseDown",value:e(function(o,d){this.fire(Mt.MOUSE_DOWN,o,d)},"_onMouseDown")},{key:"_pushAddObjectCommand",value:e(function(o){var d=Me.create(Vt.ADD_OBJECT,this._graphics,o);this._invoker.pushUndoStack(d)},"_pushAddObjectCommand")},{key:"_pushModifyObjectCommand",value:e(function(o){var d=this,s=o.type,g=Na(o,function(O){return Ra(d._graphics.getObjectId(O),O,s==="activeSelection")}),M=Me.create(Vt.CHANGE_SELECTION,this._graphics,g);M.execute(this._graphics,g),this._invoker.pushUndoStack(M)},"_pushModifyObjectCommand")},{key:"_onObjectActivated",value:e(function(o){this.fire(Mt.OBJECT_ACTIVATED,o)},"_onObjectActivated")},{key:"_onObjectMoved",value:e(function(o){this.fire(Mt.OBJECT_MOVED,o)},"_onObjectMoved")},{key:"_onObjectScaled",value:e(function(o){this.fire(Mt.OBJECT_SCALED,o)},"_onObjectScaled")},{key:"_onObjectRotated",value:e(function(o){this.fire(Mt.OBJECT_ROTATED,o)},"_onObjectRotated")},{key:"getDrawingMode",value:e(function(){return this._graphics.getDrawingMode()},"getDrawingMode")},{key:"clearObjects",value:e(function(){return this.execute(Vt.CLEAR_OBJECTS)},"clearObjects")},{key:"deactivateAll",value:e(function(){this._graphics.deactivateAll(),this._graphics.renderAll()},"deactivateAll")},{key:"discardSelection",value:e(function(){this._graphics.discardSelection()},"discardSelection")},{key:"changeSelectableAll",value:e(function(o){this._graphics.changeSelectableAll(o)},"changeSelectableAll")},{key:"_initHistory",value:e(function(){this.ui&&this.ui.initHistory()},"_initHistory")},{key:"_clearHistory",value:e(function(){this.ui&&this.ui.clearHistory()},"_clearHistory")},{key:"execute",value:e(function(o){for(var d,s,g,M=arguments.length,O=new Array(M>1?M-1:0),F=1;F<M;F++)O[F-1]=arguments[F];var R=G()(d=[this._graphics]).call(d,O);return(s=this._invoker).execute.apply(s,G()(g=[o]).call(g,B(R)))},"execute")},{key:"executeSilent",value:e(function(o){for(var d,s,g,M=arguments.length,O=new Array(M>1?M-1:0),F=1;F<M;F++)O[F-1]=arguments[F];var R=G()(d=[this._graphics]).call(d,O);return(s=this._invoker).executeSilent.apply(s,G()(g=[o]).call(g,B(R)))},"executeSilent")},{key:"undo",value:e(function(){for(var o=this,d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1,s=xt().resolve(),g=0;g<d;g+=1)s=s.then(function(){return o._invoker.undo()});return s},"undo")},{key:"redo",value:e(function(){for(var o=this,d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1,s=xt().resolve(),g=0;g<d;g+=1)s=s.then(function(){return o._invoker.redo()});return s},"redo")},{key:"zoom",value:e(function(o){var d=o.x,s=o.y,g=o.zoomLevel;this._graphics.zoom({x:d,y:s},g)},"zoom")},{key:"resetZoom",value:e(function(){this._graphics.resetZoom()},"resetZoom")},{key:"loadImageFromFile",value:e(function(o,d){if(!o)return xt().reject(be.invalidParameters);var s=it().createObjectURL(o);return d=d||o.name,this.loadImageFromURL(s,d).then(function(g){return it().revokeObjectURL(o),g})},"loadImageFromFile")},{key:"loadImageFromURL",value:e(function(o,d){return!d||!o?xt().reject(be.invalidParameters):this.execute(Vt.LOAD_IMAGE,d,o)},"loadImageFromURL")},{key:"addImageObject",value:e(function(o){return o?this.execute(Vt.ADD_IMAGE_OBJECT,o):xt().reject(be.invalidParameters)},"addImageObject")},{key:"startDrawingMode",value:e(function(o,d){return this._graphics.startDrawingMode(o,d)},"startDrawingMode")},{key:"stopDrawingMode",value:e(function(){this._graphics.stopDrawingMode()},"stopDrawingMode")},{key:"crop",value:e(function(o){var d=this._graphics.getCroppedImageData(o);return d?this.loadImageFromURL(d.url,d.imageName):xt().reject(be.invalidParameters)},"crop")},{key:"getCropzoneRect",value:e(function(){return this._graphics.getCropzoneRect()},"getCropzoneRect")},{key:"setCropzoneRect",value:e(function(o){this._graphics.setCropzoneRect(o)},"setCropzoneRect")},{key:"_flip",value:e(function(o){return this.execute(Vt.FLIP_IMAGE,o)},"_flip")},{key:"flipX",value:e(function(){return this._flip("flipX")},"flipX")},{key:"flipY",value:e(function(){return this._flip("flipY")},"flipY")},{key:"resetFlip",value:e(function(){return this._flip("reset")},"resetFlip")},{key:"_rotate",value:e(function(o,d,s){var g=null;return s?g=this.executeSilent(Vt.ROTATE_IMAGE,o,d):g=this.execute(Vt.ROTATE_IMAGE,o,d),g},"_rotate")},{key:"rotate",value:e(function(o,d){return this._rotate("rotate",o,d)},"rotate")},{key:"setAngle",value:e(function(o,d){return this._rotate("setAngle",o,d)},"setAngle")},{key:"setBrush",value:e(function(o){this._graphics.setBrush(o)},"setBrush")},{key:"setDrawingShape",value:e(function(o,d){this._graphics.setDrawingShape(o,d)},"setDrawingShape")},{key:"setDrawingIcon",value:e(function(o,d){this._graphics.setIconStyle(o,d)},"setDrawingIcon")},{key:"addShape",value:e(function(o,d){return d=d||{},this._setPositions(d),this.execute(Vt.ADD_SHAPE,o,d)},"addShape")},{key:"changeShape",value:e(function(o,d,s){var g=s?"executeSilent":"execute";return this[g](Vt.CHANGE_SHAPE,o,d)},"changeShape")},{key:"addText",value:e(function(o,d){return o=o||"",d=d||{},this.execute(Vt.ADD_TEXT,o,d)},"addText")},{key:"changeText",value:e(function(o,d){return d=d||"",this.execute(Vt.CHANGE_TEXT,o,d)},"changeText")},{key:"changeTextStyle",value:e(function(o,d,s){var g=s?"executeSilent":"execute";return this[g](Vt.CHANGE_TEXT_STYLE,o,d)},"changeTextStyle")},{key:"_changeActivateMode",value:e(function(o){o!=="ICON"&&this.getDrawingMode()!==o&&this.startDrawingMode(o)},"_changeActivateMode")},{key:"_onTextChanged",value:e(function(o){this.fire(Mt.TEXT_CHANGED,o)},"_onTextChanged")},{key:"_onIconCreateResize",value:e(function(o){this.fire(Mt.ICON_CREATE_RESIZE,o)},"_onIconCreateResize")},{key:"_onIconCreateEnd",value:e(function(o){this.fire(Mt.ICON_CREATE_END,o)},"_onIconCreateEnd")},{key:"_onTextEditing",value:e(function(){this.fire(Mt.TEXT_EDITING)},"_onTextEditing")},{key:"_onAddText",value:e(function(o){this.fire(Mt.ADD_TEXT,{originPosition:o.originPosition,clientPosition:o.clientPosition})},"_onAddText")},{key:"_onAddObject",value:e(function(o){var d=this._graphics.getObject(o.id);this._invoker.fire(Mt.EXECUTE_COMMAND,Ma(d.type)),this._pushAddObjectCommand(d)},"_onAddObject")},{key:"_onObjectAdded",value:e(function(o){this.fire(pc,o),this.fire(Xp,o)},"_onObjectAdded")},{key:"_onObjectModified",value:e(function(o){o.type!==Yt.CROPZONE&&(this._invoker.fire(Mt.EXECUTE_COMMAND,Ma(o.type)),this._pushModifyObjectCommand(o))},"_onObjectModified")},{key:"_selectionCleared",value:e(function(){this.fire(mc)},"_selectionCleared")},{key:"_selectionCreated",value:e(function(o){this.fire(yc,o)},"_selectionCreated")},{key:"registerIcons",value:e(function(o){this._graphics.registerPaths(o)},"registerIcons")},{key:"changeCursor",value:e(function(o){this._graphics.changeCursor(o)},"changeCursor")},{key:"addIcon",value:e(function(o,d){return d=d||{},this._setPositions(d),this.execute(Vt.ADD_ICON,o,d)},"addIcon")},{key:"changeIconColor",value:e(function(o,d){return this.execute(Vt.CHANGE_ICON_COLOR,o,d)},"changeIconColor")},{key:"removeObject",value:e(function(o){var d=this._graphics.getObject(o),s=d.type;return this.execute(Vt.REMOVE_OBJECT,o,Ma(s))},"removeObject")},{key:"hasFilter",value:e(function(o){return this._graphics.hasFilter(o)},"hasFilter")},{key:"removeFilter",value:e(function(o){return this.execute(Vt.REMOVE_FILTER,o)},"removeFilter")},{key:"applyFilter",value:e(function(o,d,s){var g=s?"executeSilent":"execute";return this[g](Vt.APPLY_FILTER,o,d)},"applyFilter")},{key:"toDataURL",value:e(function(o){return this._graphics.toDataURL(o)},"toDataURL")},{key:"getImageName",value:e(function(){return this._graphics.getImageName()},"getImageName")},{key:"clearUndoStack",value:e(function(){this._invoker.clearUndoStack()},"clearUndoStack")},{key:"clearRedoStack",value:e(function(){this._invoker.clearRedoStack()},"clearRedoStack")},{key:"isEmptyUndoStack",value:e(function(){return this._invoker.isEmptyUndoStack()},"isEmptyUndoStack")},{key:"isEmptyRedoStack",value:e(function(){return this._invoker.isEmptyRedoStack()},"isEmptyRedoStack")},{key:"resizeCanvasDimension",value:e(function(o){return o?this.execute(Vt.RESIZE_CANVAS_DIMENSION,o):xt().reject(be.invalidParameters)},"resizeCanvasDimension")},{key:"destroy",value:e(function(){var o=this;this.stopDrawingMode(),this._detachDomEvents(),this._graphics.destroy(),this._graphics=null,this.ui&&(this._detachColorPickerInputBoxEvents(),this.ui.destroy()),K()(this,function(d,s){o[s]=null},this)},"destroy")},{key:"_setPositions",value:e(function(o){var d=this._graphics.getCenter();X()(o.left)&&(o.left=d.left),X()(o.top)&&(o.top=d.top)},"_setPositions")},{key:"setObjectProperties",value:e(function(o,d){return this.execute(Vt.SET_OBJECT_PROPERTIES,o,d)},"setObjectProperties")},{key:"setObjectPropertiesQuietly",value:e(function(o,d){this._graphics.setObjectProperties(o,d)},"setObjectPropertiesQuietly")},{key:"getObjectProperties",value:e(function(o,d){var s=this._graphics.getObject(o);return s?this._graphics.getObjectProperties(o,d):null},"getObjectProperties")},{key:"getCanvasSize",value:e(function(){return this._graphics.getCanvasSize()},"getCanvasSize")},{key:"getObjectPosition",value:e(function(o,d,s){return this._graphics.getObjectPosition(o,d,s)},"getObjectPosition")},{key:"setObjectPosition",value:e(function(o,d){return this.execute(Vt.SET_OBJECT_POSITION,o,d)},"setObjectPosition")},{key:"resize",value:e(function(o){return this.execute(Vt.RESIZE_IMAGE,o)},"resize")}]),k}();qd.mixin(ja),yt().mixin(ja);var Vp=ja,$p=jt.ICON,Zp={name:Vt.ADD_ICON,execute:e(function(C,o,d){var s=this,g=C.getComponent($p);return g.add(o,d).then(function(M){return s.undoData.object=C.getObject(M.id),M})},"execute"),undo:e(function(C){return C.remove(this.undoData.object),xt().resolve()},"undo")};Me.register(Zp);var S1=null,Jp={name:Vt.ADD_IMAGE_OBJECT,execute:e(function(C,o){var d=this;return C.addImageObject(o).then(function(s){return d.undoData.object=C.getObject(s.id),s})},"execute"),undo:e(function(C){return C.remove(this.undoData.object),xt().resolve()},"undo")};Me.register(Jp);var I1=null,Kp={name:Vt.ADD_OBJECT,execute:e(function(C,o){return new(xt())(function(d,s){C.contains(o)?s(be.addedObject):(C.add(o),d(o))})},"execute"),undo:e(function(C,o){return new(xt())(function(d,s){C.contains(o)?(C.remove(o),d(o)):s(be.noObject)})},"undo")};Me.register(Kp);var E1=null,Qp=jt.SHAPE,qp={name:Vt.ADD_SHAPE,execute:e(function(C,o,d){var s=this,g=C.getComponent(Qp);return g.add(o,d).then(function(M){var O=M.id;return s.undoData.object=C.getObject(O),M})},"execute"),undo:e(function(C){return C.remove(this.undoData.object),xt().resolve()},"undo")};Me.register(qp);var w1=null,tm=jt.TEXT,em={name:Vt.ADD_TEXT,execute:e(function(C,o,d){var s=this,g=C.getComponent(tm);if(this.undoData.object){var M=this.undoData.object;return new(xt())(function(O,F){C.contains(M)?F(be.redo):(C.add(M),O(M))})}return g.add(o,d).then(function(O){var F=O.id,R=C.getObject(F);return s.undoData.object=R,gc(Na(R,function(){return Ra(F,R,!1)})),O})},"execute"),undo:e(function(C){return C.remove(this.undoData.object),xt().resolve()},"undo")};Me.register(em);var M1=null,bc=jt.FILTER,Cc=null;function im(k,C,o){var d={};return k==="mask"&&(d.object=o.mask),d.options=C,d}e(im,"makeUndoData");var rm={name:Vt.APPLY_FILTER,execute:e(function(C,o,d,s){var g=C.getComponent(bc);if(o==="mask"){var M=C.getObject(d.maskObjId);if(!(M&&M.isType("image")))return xt().reject(be.invalidParameters);Z()(d,{mask:M}),C.remove(d.mask)}if(!this.isRedo){var O=g.getOptions(o),F=im(o,O,d);Cc=this.setUndoData(F,Cc,s)}return g.add(o,d)},"execute"),undo:e(function(C,o){var d=C.getComponent(bc);if(o==="mask"){var s=this.undoData.object;return C.add(s),C.setActiveObject(s),d.remove(o)}return this.undoData.options?d.add(o,this.undoData.options):d.remove(o)},"undo")};Me.register(rm);var T1=null,_c=jt.ICON,nm={name:Vt.CHANGE_ICON_COLOR,execute:e(function(C,o,d){var s=this;return new(xt())(function(g,M){var O=C.getComponent(_c),F=C.getObject(o);F||M(be.noObject),s.undoData.object=F,s.undoData.color=O.getColor(F),O.setColor(d,F),g()})},"execute"),undo:e(function(C){var o=C.getComponent(_c),d=this.undoData,s=d.object,g=d.color;return o.setColor(g,s),xt().resolve()},"undo")};Me.register(nm);var A1=null,xc=jt.SHAPE,Sc=null;function sm(k,C){var o={object:C,options:{}};return Qn()(k,function(d,s){o.options[s]=C[s]}),o}e(sm,"changeShape_makeUndoData");var am={name:Vt.CHANGE_SHAPE,execute:e(function(C,o,d,s){var g=C.getComponent(xc),M=C.getObject(o);if(!M)return xt().reject(be.noObject);if(!this.isRedo){var O=sm(d,M);Sc=this.setUndoData(O,Sc,s)}return g.change(M,d)},"execute"),undo:e(function(C){var o=C.getComponent(xc),d=this.undoData,s=d.object,g=d.options;return o.change(s,g)},"undo")};Me.register(am);var O1=null,Ic=jt.TEXT,om={name:Vt.CHANGE_TEXT,execute:e(function(C,o,d){var s=C.getComponent(Ic),g=C.getObject(o);return g?(this.undoData.object=g,this.undoData.text=s.getText(g),s.change(g,d)):xt().reject(be.noObject)},"execute"),undo:e(function(C){var o=C.getComponent(Ic),d=this.undoData,s=d.object,g=d.text;return o.change(s,g)},"undo")};Me.register(om);var D1=null,Ec=jt.TEXT,wc=null;function lm(k,C){var o={object:C,styles:{}};return Qn()(k,function(d,s){var g=C[s];o.styles[s]=g}),o}e(lm,"changeTextStyle_makeUndoData");var cm={name:Vt.CHANGE_TEXT_STYLE,execute:e(function(C,o,d,s){var g=C.getComponent(Ec),M=C.getObject(o);if(!M)return xt().reject(be.noObject);if(!this.isRedo){var O=lm(d,M);wc=this.setUndoData(O,wc,s)}return g.setStyle(M,d)},"execute"),undo:e(function(C){var o=C.getComponent(Ec),d=this.undoData,s=d.object,g=d.styles;return o.setStyle(s,g)},"undo")};Me.register(cm);var k1=null,um={name:Vt.CLEAR_OBJECTS,execute:e(function(C){var o=this;return new(xt())(function(d){o.undoData.objects=C.removeAll(),d()})},"execute"),undo:e(function(C){return C.add(this.undoData.objects),xt().resolve()},"undo")};Me.register(um);var P1=null,Mc=jt.FLIP,hm={name:Vt.FLIP_IMAGE,execute:e(function(C,o){var d=C.getComponent(Mc);return this.undoData.setting=d.getCurrentSetting(),d[o]()},"execute"),undo:e(function(C){var o=C.getComponent(Mc);return o.set(this.undoData.setting)},"undo")};Me.register(hm);var L1=null,Tc=jt.IMAGE_LOADER,fm={name:Vt.LOAD_IMAGE,execute:e(function(C,o,d){var s,g=C.getComponent(Tc),M=g.getCanvasImage(),O=M?M.width:0,F=M?M.height:0,R=lr()(s=C.removeAll(!0)).call(s,function(U){return U.type!=="cropzone"});return Gt()(R).call(R,function(U){U.evented=!0}),this.undoData={name:g.getImageName(),image:M,objects:R},g.load(o,d).then(function(U){return{oldWidth:O,oldHeight:F,newWidth:U.width,newHeight:U.height}})},"execute"),undo:e(function(C){var o=C.getComponent(Tc),d=this.undoData,s=d.objects,g=d.name,M=d.image;return C.removeAll(!0),C.add(s),o.load(g,M)},"undo")};Me.register(fm);var N1=null,Ac=jt.FILTER,dm={name:Vt.REMOVE_FILTER,execute:e(function(C,o){var d=C.getComponent(Ac);return this.undoData.options=d.getOptions(o),d.remove(o)},"execute"),undo:e(function(C,o){var d=C.getComponent(Ac),s=this.undoData.options;return d.add(o,s)},"undo")};Me.register(dm);var R1=null,gm={name:Vt.REMOVE_OBJECT,execute:e(function(C,o){var d=this;return new(xt())(function(s,g){d.undoData.objects=C.removeObjectById(o),d.undoData.objects.length?s():g(be.noObject)})},"execute"),undo:e(function(C){return C.add(this.undoData.objects),xt().resolve()},"undo")};Me.register(gm);var j1=null,vm={name:Vt.RESIZE_CANVAS_DIMENSION,execute:e(function(C,o){var d=this;return new(xt())(function(s){d.undoData.size={width:C.cssMaxWidth,height:C.cssMaxHeight},C.setCssMaxDimension(o),C.adjustCanvasDimension(),s()})},"execute"),undo:e(function(C){return C.setCssMaxDimension(this.undoData.size),C.adjustCanvasDimension(),xt().resolve()},"undo")};Me.register(vm);var F1=null,Oc=jt.ROTATION,Dc=null;function pm(k){return{angle:k.getCurrentAngle()}}e(pm,"rotate_makeUndoData");var mm={name:Vt.ROTATE_IMAGE,execute:e(function(C,o,d,s){var g=C.getComponent(Oc);if(!this.isRedo){var M=pm(g);Dc=this.setUndoData(M,Dc,s)}return g[o](d)},"execute"),undo:e(function(C){var o=C.getComponent(Oc),d=ht(this.args,3),s=d[1],g=d[2];return s==="setAngle"?o[s](this.undoData.angle):o.rotate(-g)},"undo")};Me.register(mm);var z1=null,ym={name:Vt.SET_OBJECT_PROPERTIES,execute:e(function(C,o,d){var s=this,g=C.getObject(o);return g?(this.undoData.props={},Qn()(d,function(M,O){s.undoData.props[O]=g[O]}),C.setObjectProperties(o,d),xt().resolve()):xt().reject(be.noObject)},"execute"),undo:e(function(C,o){var d=this.undoData.props;return C.setObjectProperties(o,d),xt().resolve()},"undo")};Me.register(ym);var B1=null,bm={name:Vt.SET_OBJECT_POSITION,execute:e(function(C,o,d){var s=C.getObject(o);return s?(this.undoData.objectId=o,this.undoData.props=C.getObjectProperties(o,["left","top"]),C.setObjectPosition(o,d),C.renderAll(),xt().resolve()):xt().reject(be.noObject)},"execute"),undo:e(function(C){var o=this.undoData,d=o.objectId,s=o.props;return C.setObjectProperties(d,s),C.renderAll(),xt().resolve()},"undo")};Me.register(bm);var U1=null,Cm={name:Vt.CHANGE_SELECTION,execute:e(function(C,o){return this.isRedo?Gt()(o).call(o,function(d){C.setObjectProperties(d.id,d)}):this.undoData=Cp(),xt().resolve()},"execute"),undo:e(function(C){var o;return Gt()(o=this.undoData).call(o,function(d){C.setObjectProperties(d.id,d)}),xt().resolve()},"undo")};Me.register(Cm);var H1=null,kc=jt.RESIZE,_m={name:Vt.RESIZE_IMAGE,execute:e(function(C,o){var d=C.getComponent(kc),s=d.getOriginalDimensions();return s||(s=d.getCurrentDimensions()),this.undoData.dimensions=s,d.resize(o)},"execute"),undo:e(function(C){var o=C.getComponent(kc);return o.resize(this.undoData.dimensions)},"undo")};Me.register(_m);var W1=null,xm=Vp}(),x=x.default,x}()})});var x1={};Am(x1,{ActivityBlock:()=>te,ActivityHeader:()=>pa,BaseComponent:()=>Qi,Block:()=>ne,BtnUi:()=>Lr,CameraSource:()=>xn,CloudImageEditor:()=>Sa,CloudImageEditorActivity:()=>ga,CloudImageEditorBlock:()=>Ii,Config:()=>ph,Copyright:()=>ma,CropFrame:()=>En,Data:()=>ce,DropArea:()=>Mr,EditorCropButtonControl:()=>Dr,EditorFilterControl:()=>or,EditorImageCropper:()=>On,EditorImageFader:()=>fa,EditorOperationControl:()=>kr,EditorScroller:()=>Dn,EditorSlider:()=>Mn,EditorToolbar:()=>kn,ExternalSource:()=>Rn,ExternalUploadSource:()=>rr,FileItem:()=>Or,FileUploaderInline:()=>Bn,FileUploaderMinimal:()=>zn,FileUploaderRegular:()=>Rr,FormInput:()=>va,Icon:()=>_r,Img:()=>sa,LineLoaderUi:()=>Pn,LocalEditorImage:()=>Fn,Modal:()=>bn,PACKAGE_NAME:()=>er,PACKAGE_VERSION:()=>ir,PresenceToggle:()=>Ln,ProgressBar:()=>In,ProgressBarCommon:()=>Sn,Select:()=>jn,SimpleBtn:()=>Ir,SliderUi:()=>Nn,SolutionBlock:()=>bi,SourceBtn:()=>Tr,SourceList:()=>aa,StartFrom:()=>mn,UID:()=>Ki,UploadCtxProvider:()=>Rh,UploadList:()=>Cn,UploadSource:()=>ke,UploaderBlock:()=>pe,UrlSource:()=>_n,defineComponents:()=>Ia,defineLocale:()=>ho,loadFileUploaderFrom:()=>Kh,toKebabCase:()=>br});var Dm=Object.defineProperty,km=e((S,v,t)=>v in S?Dm(S,v,{enumerable:!0,configurable:!0,writable:!0,value:t}):S[v]=t,"__defNormalProp"),za=e((S,v,t)=>(km(S,typeof v!="symbol"?v+"":v,t),t),"__publicField");function Pm(S){let v=e(t=>{var u;for(let x in t)((u=t[x])==null?void 0:u.constructor)===Object&&(t[x]=v(t[x]));return{...t}},"clone");return v(S)}e(Pm,"cloneObj");var Jr,ce=(Jr=class{constructor(v){v.constructor===Object?this.store=Pm(v):(this._storeIsProxy=!0,this.store=v),this.callbackMap=Object.create(null)}static warn(v,t){console.warn(`Symbiote Data: cannot ${v}. Prop name: `+t)}read(v){return!this._storeIsProxy&&!this.store.hasOwnProperty(v)?(ce.warn("read",v),null):this.store[v]}has(v){return this._storeIsProxy?this.store[v]!==void 0:this.store.hasOwnProperty(v)}add(v,t,u=!1){!u&&Object.keys(this.store).includes(v)||(this.store[v]=t,this.notify(v))}pub(v,t){if(!this._storeIsProxy&&!this.store.hasOwnProperty(v)){ce.warn("publish",v);return}this.store[v]=t,this.notify(v)}multiPub(v){for(let t in v)this.pub(t,v[t])}notify(v){this.callbackMap[v]&&this.callbackMap[v].forEach(t=>{t(this.store[v])})}sub(v,t,u=!0){return!this._storeIsProxy&&!this.store.hasOwnProperty(v)?(ce.warn("subscribe",v),null):(this.callbackMap[v]||(this.callbackMap[v]=new Set),this.callbackMap[v].add(t),u&&t(this.store[v]),{remove:()=>{this.callbackMap[v].delete(t),this.callbackMap[v].size||delete this.callbackMap[v]},callback:t})}static registerCtx(v,t=Symbol()){let u=ce.globalStore.get(t);return u?console.warn('State: context UID "'+t+'" already in use'):(u=new ce(v),ce.globalStore.set(t,u)),u}static deleteCtx(v){ce.globalStore.delete(v)}static getCtx(v,t=!0){return ce.globalStore.get(v)||(t&&console.warn('State: wrong context UID - "'+v+'"'),null)}},e(Jr,"Data"),Jr);ce.globalStore=new Map;var le=Object.freeze({BIND_ATTR:"set",ATTR_BIND_PRFX:"@",EXT_DATA_CTX_PRFX:"*",NAMED_DATA_CTX_SPLTR:"/",CTX_NAME_ATTR:"ctx-name",CTX_OWNER_ATTR:"ctx-owner",CSS_CTX_PROP:"--ctx-name",EL_REF_ATTR:"ref",AUTO_TAG_PRFX:"sym",REPEAT_ATTR:"repeat",REPEAT_ITEM_TAG_ATTR:"repeat-item-tag",SET_LATER_KEY:"__toSetLater__",USE_TPL:"use-template",ROOT_STYLE_ATTR_NAME:"sym-component"}),qc="1234567890QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm",Lm=qc.length-1,Kr,Ki=(Kr=class{static generate(v="XXXXXXXXX-XXX"){let t="";for(let u=0;u<v.length;u++)t+=v[u]==="-"?v[u]:qc.charAt(Math.random()*Lm);return t}},e(Kr,"UID"),Kr);function tu(S,v,t){let u=!0,x,y=v.split(".");return y.forEach((I,l)=>{l<y.length-1?S=S[I]:x=I}),S?S[x]=t:u=!1,u}e(tu,"setNestedProp");function Nm(S){return S.split("-").map((v,t)=>v&&t?v[0].toUpperCase()+v.slice(1):v).join("").split("_").map((v,t)=>v&&t?v.toUpperCase():v).join("")}e(Nm,"kebabToCamel");function Rm(S,v){[...S.querySelectorAll(`[${le.REPEAT_ATTR}]`)].forEach(t=>{var I;let u=t.getAttribute(le.REPEAT_ITEM_TAG_ATTR),x;if(u&&(x=window.customElements.get(u)),!x){x=(I=class extends v.BaseComponent{constructor(){super(),u||(this.style.display="contents")}},e(I,"itemClass"),I);let l=t.innerHTML;x.template=l,x.reg(u)}for(;t.firstChild;)t.firstChild.remove();let y=t.getAttribute(le.REPEAT_ATTR);v.sub(y,l=>{if(!l){for(;t.firstChild;)t.firstChild.remove();return}let c=[...t.children],T,P=e(L=>{L.forEach((j,b)=>{if(c[b])if(c[b].set$)setTimeout(()=>{c[b].set$(j)});else for(let r in j)c[b][r]=j[r];else{T||(T=new DocumentFragment);let r=new x;Object.assign(r.init$,j),T.appendChild(r)}}),T&&t.appendChild(T);let N=c.slice(L.length,c.length);for(let j of N)j.remove()},"fillItems");if(l.constructor===Array)P(l);else if(l.constructor===Object){let L=[];for(let N in l){let j=l[N];Object.defineProperty(j,"_KEY_",{value:N,enumerable:!0}),L.push(j)}P(L)}else console.warn("Symbiote repeat data type error:"),console.log(l)}),t.removeAttribute(le.REPEAT_ATTR),t.removeAttribute(le.REPEAT_ITEM_TAG_ATTR)})}e(Rm,"repeatProcessor");var Kc="__default__";function jm(S,v){if(v.shadowRoot)return;let t=[...S.querySelectorAll("slot")];if(!t.length)return;let u={};t.forEach(x=>{let y=x.getAttribute("name")||Kc;u[y]={slot:x,fr:document.createDocumentFragment()}}),v.initChildren.forEach(x=>{var y;let I=Kc;x instanceof Element&&x.hasAttribute("slot")&&(I=x.getAttribute("slot"),x.removeAttribute("slot")),(y=u[I])==null||y.fr.appendChild(x)}),Object.values(u).forEach(x=>{if(x.fr.childNodes.length)x.slot.parentNode.replaceChild(x.fr,x.slot);else if(x.slot.childNodes.length){let y=document.createDocumentFragment();y.append(...x.slot.childNodes),x.slot.parentNode.replaceChild(y,x.slot)}else x.slot.remove()})}e(jm,"slotProcessor");function Fm(S,v){[...S.querySelectorAll(`[${le.EL_REF_ATTR}]`)].forEach(t=>{let u=t.getAttribute(le.EL_REF_ATTR);v.ref[u]=t,t.removeAttribute(le.EL_REF_ATTR)})}e(Fm,"refProcessor");function zm(S,v){[...S.querySelectorAll(`[${le.BIND_ATTR}]`)].forEach(t=>{let x=t.getAttribute(le.BIND_ATTR).split(";");[...t.attributes].forEach(y=>{if(y.name.startsWith("-")&&y.value){let I=Nm(y.name.replace("-",""));x.push(I+":"+y.value),t.removeAttribute(y.name)}}),x.forEach(y=>{if(!y)return;let I=y.split(":").map(P=>P.trim()),l=I[0],c;l.indexOf(le.ATTR_BIND_PRFX)===0&&(c=!0,l=l.replace(le.ATTR_BIND_PRFX,""));let T=I[1].split(",").map(P=>P.trim());for(let P of T){let L;P.startsWith("!!")?(L="double",P=P.replace("!!","")):P.startsWith("!")&&(L="single",P=P.replace("!","")),v.sub(P,N=>{L==="double"?N=!!N:L==="single"&&(N=!N),c?(N==null?void 0:N.constructor)===Boolean?N?t.setAttribute(l,""):t.removeAttribute(l):t.setAttribute(l,N):tu(t,l,N)||(t[le.SET_LATER_KEY]||(t[le.SET_LATER_KEY]=Object.create(null)),t[le.SET_LATER_KEY][l]=N)})}}),t.removeAttribute(le.BIND_ATTR)})}e(zm,"domSetProcessor");var xs="{{",Zr="}}",Bm="skip-text";function Um(S){let v,t=[],u=document.createTreeWalker(S,NodeFilter.SHOW_TEXT,{acceptNode:x=>{var y;return!((y=x.parentElement)!=null&&y.hasAttribute(Bm))&&x.textContent.includes(xs)&&x.textContent.includes(Zr)&&1}});for(;v=u.nextNode();)t.push(v);return t}e(Um,"getTextNodesWithTokens");var Hm=e(function(S,v){Um(S).forEach(u=>{let x=[],y;for(;u.textContent.includes(Zr);)u.textContent.startsWith(xs)?(y=u.textContent.indexOf(Zr)+Zr.length,u.splitText(y),x.push(u)):(y=u.textContent.indexOf(xs),u.splitText(y)),u=u.nextSibling;x.forEach(I=>{let l=I.textContent.replace(xs,"").replace(Zr,"");I.textContent="",v.sub(l,c=>{I.textContent=c})})})},"txtNodesProcessor"),Wm=[Rm,jm,Fm,zm,Hm],Ss="'",hr='"',Ym=/\\([0-9a-fA-F]{1,6} ?)/g;function Gm(S){return(S[0]===hr||S[0]===Ss)&&(S[S.length-1]===hr||S[S.length-1]===Ss)}e(Gm,"hasLeadingTrailingQuotes");function Xm(S){return(S[0]===hr||S[0]===Ss)&&(S=S.slice(1)),(S[S.length-1]===hr||S[S.length-1]===Ss)&&(S=S.slice(0,-1)),S}e(Xm,"trimQuotes");function Vm(S){let v="",t="";for(var u=0;u<S.length;u++){let x=S[u+1];S[u]==="\\"&&x==='"'?(v+='\\"',u++):S[u]==='"'&&t!=="\\"?v+='\\"':v+=S[u],t=S[u]}return v}e(Vm,"escapeQuotes");function $m(S){let v=S;Gm(S)&&(v=Xm(v),v=v.replace(Ym,(t,u)=>String.fromCodePoint(parseInt(u.trim(),16))),v=v.replaceAll(`\\
|
|
390
|
-
`,"\\n"),v=Vm(v),v=hr+v+hr);try{return JSON.parse(v)}catch{throw new Error(`Failed to parse CSS property value: ${v}. Original input: ${S}`)}}e($m,"parseCssPropertyValue");var Qc=0,ur=null,Ti=null,Qr,Bi=(Qr=class extends HTMLElement{constructor(){super(),za(this,"updateCssData",()=>{var v;this.dropCssDataCache(),(v=this.__boundCssProps)==null||v.forEach(t=>{let u=this.getCssData(this.__extractCssName(t),!0);u!==null&&this.$[t]!==u&&(this.$[t]=u)})}),this.init$=Object.create(null),this.cssInit$=Object.create(null),this.tplProcessors=new Set,this.ref=Object.create(null),this.allSubs=new Set,this.pauseRender=!1,this.renderShadow=!1,this.readyToDestroy=!0,this.processInnerHtml=!1,this.allowCustomTemplate=!1,this.ctxOwner=!1}get BaseComponent(){return Bi}initCallback(){}__initCallback(){var v;this.__initialized||(this.__initialized=!0,(v=this.initCallback)==null||v.call(this))}render(v,t=this.renderShadow){let u;if((t||this.constructor.__shadowStylesUrl)&&!this.shadowRoot&&this.attachShadow({mode:"open"}),this.allowCustomTemplate){let y=this.getAttribute(le.USE_TPL);if(y){let I=this.getRootNode(),l=(I==null?void 0:I.querySelector(y))||document.querySelector(y);l?v=l.content.cloneNode(!0):console.warn(`Symbiote template "${y}" is not found...`)}}if(this.processInnerHtml)for(let y of this.tplProcessors)y(this,this);if(v||this.constructor.template){if(this.constructor.template&&!this.constructor.__tpl&&(this.constructor.__tpl=document.createElement("template"),this.constructor.__tpl.innerHTML=this.constructor.template),(v==null?void 0:v.constructor)===DocumentFragment)u=v;else if((v==null?void 0:v.constructor)===String){let y=document.createElement("template");y.innerHTML=v,u=y.content.cloneNode(!0)}else this.constructor.__tpl&&(u=this.constructor.__tpl.content.cloneNode(!0));for(let y of this.tplProcessors)y(u,this)}let x=e(()=>{u&&(t&&this.shadowRoot.appendChild(u)||this.appendChild(u)),this.__initCallback()},"addFr");if(this.constructor.__shadowStylesUrl){t=!0;let y=document.createElement("link");y.rel="stylesheet",y.href=this.constructor.__shadowStylesUrl,y.onload=x,this.shadowRoot.prepend(y)}else x()}addTemplateProcessor(v){this.tplProcessors.add(v)}get autoCtxName(){return this.__autoCtxName||(this.__autoCtxName=Ki.generate(),this.style.setProperty(le.CSS_CTX_PROP,`'${this.__autoCtxName}'`)),this.__autoCtxName}get cssCtxName(){return this.getCssData(le.CSS_CTX_PROP,!0)}get ctxName(){var v;let t=((v=this.getAttribute(le.CTX_NAME_ATTR))==null?void 0:v.trim())||this.cssCtxName||this.__cachedCtxName||this.autoCtxName;return this.__cachedCtxName=t,t}get localCtx(){return this.__localCtx||(this.__localCtx=ce.registerCtx({},this)),this.__localCtx}get nodeCtx(){return ce.getCtx(this.ctxName,!1)||ce.registerCtx({},this.ctxName)}static __parseProp(v,t){let u,x;if(v.startsWith(le.EXT_DATA_CTX_PRFX))u=t.nodeCtx,x=v.replace(le.EXT_DATA_CTX_PRFX,"");else if(v.includes(le.NAMED_DATA_CTX_SPLTR)){let y=v.split(le.NAMED_DATA_CTX_SPLTR);u=ce.getCtx(y[0]),x=y[1]}else u=t.localCtx,x=v;return{ctx:u,name:x}}sub(v,t,u=!0){let x=e(I=>{this.isConnected&&t(I)},"subCb"),y=Bi.__parseProp(v,this);y.ctx.has(y.name)?this.allSubs.add(y.ctx.sub(y.name,x,u)):window.setTimeout(()=>{this.allSubs.add(y.ctx.sub(y.name,x,u))})}notify(v){let t=Bi.__parseProp(v,this);t.ctx.notify(t.name)}has(v){let t=Bi.__parseProp(v,this);return t.ctx.has(t.name)}add(v,t,u=!1){let x=Bi.__parseProp(v,this);x.ctx.add(x.name,t,u)}add$(v,t=!1){for(let u in v)this.add(u,v[u],t)}get $(){if(!this.__stateProxy){let v=Object.create(null);this.__stateProxy=new Proxy(v,{set:(t,u,x)=>{let y=Bi.__parseProp(u,this);return y.ctx.pub(y.name,x),!0},get:(t,u)=>{let x=Bi.__parseProp(u,this);return x.ctx.read(x.name)}})}return this.__stateProxy}set$(v,t=!1){for(let u in v){let x=v[u];t||![String,Number,Boolean].includes(x==null?void 0:x.constructor)?this.$[u]=x:this.$[u]!==x&&(this.$[u]=x)}}get __ctxOwner(){return this.ctxOwner||this.hasAttribute(le.CTX_OWNER_ATTR)&&this.getAttribute(le.CTX_OWNER_ATTR)!=="false"}__initDataCtx(){let v=this.constructor.__attrDesc;if(v)for(let t of Object.values(v))Object.keys(this.init$).includes(t)||(this.init$[t]="");for(let t in this.init$)if(t.startsWith(le.EXT_DATA_CTX_PRFX))this.nodeCtx.add(t.replace(le.EXT_DATA_CTX_PRFX,""),this.init$[t],this.__ctxOwner);else if(t.includes(le.NAMED_DATA_CTX_SPLTR)){let u=t.split(le.NAMED_DATA_CTX_SPLTR),x=u[0].trim(),y=u[1].trim();if(x&&y){let I=ce.getCtx(x,!1);I||(I=ce.registerCtx({},x)),I.add(y,this.init$[t])}}else this.localCtx.add(t,this.init$[t]);for(let t in this.cssInit$)this.bindCssData(t,this.cssInit$[t]);this.__dataCtxInitialized=!0}connectedCallback(){var v;if(this.isConnected){if(this.__disconnectTimeout&&window.clearTimeout(this.__disconnectTimeout),!this.connectedOnce){let t=(v=this.getAttribute(le.CTX_NAME_ATTR))==null?void 0:v.trim();if(t&&this.style.setProperty(le.CSS_CTX_PROP,`'${t}'`),this.__initDataCtx(),this[le.SET_LATER_KEY]){for(let u in this[le.SET_LATER_KEY])tu(this,u,this[le.SET_LATER_KEY][u]);delete this[le.SET_LATER_KEY]}this.initChildren=[...this.childNodes];for(let u of Wm)this.addTemplateProcessor(u);if(this.pauseRender)this.__initCallback();else if(this.constructor.__rootStylesLink){let u=this.getRootNode();if(!u)return;if(u==null?void 0:u.querySelector(`link[${le.ROOT_STYLE_ATTR_NAME}="${this.constructor.is}"]`)){this.render();return}let y=this.constructor.__rootStylesLink.cloneNode(!0);y.setAttribute(le.ROOT_STYLE_ATTR_NAME,this.constructor.is),y.onload=()=>{this.render()},u.nodeType===Node.DOCUMENT_NODE?u.head.appendChild(y):u.prepend(y)}else this.render()}this.connectedOnce=!0}}destroyCallback(){}disconnectedCallback(){this.connectedOnce&&(this.dropCssDataCache(),this.readyToDestroy&&(this.__disconnectTimeout&&window.clearTimeout(this.__disconnectTimeout),this.__disconnectTimeout=window.setTimeout(()=>{this.destroyCallback();for(let v of this.allSubs)v.remove(),this.allSubs.delete(v);for(let v of this.tplProcessors)this.tplProcessors.delete(v);Ti==null||Ti.delete(this.updateCssData),Ti!=null&&Ti.size||(ur==null||ur.disconnect(),ur=null,Ti=null)},100)))}static reg(v,t=!1){v||(Qc++,v=`${le.AUTO_TAG_PRFX}-${Qc}`),this.__tag=v;let u=window.customElements.get(v);if(u){!t&&u!==this&&console.warn([`Element with tag name "${v}" already registered.`,`You're trying to override it with another class "${this.name}".`,"This is most likely a mistake.","New element will not be registered."].join(`
|
|
391
|
-
`));return}window.customElements.define(v,t?class extends this{}:this)}static get is(){return this.__tag||this.reg(),this.__tag}static bindAttributes(v){this.observedAttributes=Object.keys(v),this.__attrDesc=v}attributeChangedCallback(v,t,u){var x;if(t===u)return;let y=(x=this.constructor.__attrDesc)==null?void 0:x[v];y?this.__dataCtxInitialized?this.$[y]=u:this.init$[y]=u:this[v]=u}getCssData(v,t=!1){if(this.__cssDataCache||(this.__cssDataCache=Object.create(null)),!Object.keys(this.__cssDataCache).includes(v)){this.__computedStyle||(this.__computedStyle=window.getComputedStyle(this));let u=this.__computedStyle.getPropertyValue(v).trim();try{this.__cssDataCache[v]=$m(u)}catch{!t&&console.warn(`CSS Data error: ${v}`),this.__cssDataCache[v]=null}}return this.__cssDataCache[v]}__extractCssName(v){return v.split("--").map((t,u)=>u===0?"":t).join("--")}__initStyleAttrObserver(){Ti||(Ti=new Set),Ti.add(this.updateCssData),ur||(ur=new MutationObserver(v=>{v[0].type==="attributes"&&Ti.forEach(t=>{t()})}),ur.observe(document,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style"]}))}bindCssData(v,t=""){this.__boundCssProps||(this.__boundCssProps=new Set),this.__boundCssProps.add(v);let u=this.getCssData(this.__extractCssName(v),!0);u===null&&(u=t),this.add(v,u),this.__initStyleAttrObserver()}dropCssDataCache(){this.__cssDataCache=null,this.__computedStyle=null}defineAccessor(v,t,u){let x="__"+v;this[x]=this[v],Object.defineProperty(this,v,{set:y=>{this[x]=y,u?window.setTimeout(()=>{t==null||t(y)}):t==null||t(y)},get:()=>this[x]}),this[v]=this[x]}static set shadowStyles(v){let t=new Blob([v],{type:"text/css"});this.__shadowStylesUrl=URL.createObjectURL(t)}static set rootStyles(v){if(!this.__rootStylesLink){let t=new Blob([v],{type:"text/css"}),u=URL.createObjectURL(t),x=document.createElement("link");x.href=u,x.rel="stylesheet",this.__rootStylesLink=x}}},e(Qr,"_BaseComponent"),Qr),Qi=Bi;za(Qi,"template");var qr,Fa=(qr=class{static _print(v){console.warn(v)}static setDefaultTitle(v){this.defaultTitle=v}static setRoutingMap(v){Object.assign(this.appMap,v);for(let t in this.appMap)!this.defaultRoute&&this.appMap[t].default===!0?this.defaultRoute=t:!this.errorRoute&&this.appMap[t].error===!0&&(this.errorRoute=t)}static set routingEventName(v){this.__routingEventName=v}static get routingEventName(){return this.__routingEventName||"sym-on-route"}static readAddressBar(){let v={route:null,options:{}};return window.location.search.split(this.separator).forEach(u=>{if(u.includes("?"))v.route=u.replace("?","");else if(u.includes("=")){let x=u.split("=");v.options[x[0]]=decodeURI(x[1])}else v.options[u]=!0}),v}static notify(){let v=this.readAddressBar(),t=this.appMap[v.route];if(t&&t.title&&(document.title=t.title),v.route===null&&this.defaultRoute){this.applyRoute(this.defaultRoute);return}else if(!t&&this.errorRoute){this.applyRoute(this.errorRoute);return}else if(!t&&this.defaultRoute){this.applyRoute(this.defaultRoute);return}else if(!t){this._print(`Route "${v.route}" not found...`);return}let u=new CustomEvent(Fa.routingEventName,{detail:{route:v.route,options:Object.assign(t||{},v.options)}});window.dispatchEvent(u)}static reflect(v,t={}){let u=this.appMap[v];if(!u){this._print("Wrong route: "+v);return}let x="?"+v;for(let I in t)t[I]===!0?x+=this.separator+I:x+=this.separator+I+`=${t[I]}`;let y=u.title||this.defaultTitle||"";window.history.pushState(null,y,x),document.title=y}static applyRoute(v,t={}){this.reflect(v,t),this.notify()}static setSeparator(v){this._separator=v}static get separator(){return this._separator||"&"}static createRouterData(v,t){this.setRoutingMap(t);let u=ce.registerCtx({route:null,options:null,title:null},v);return window.addEventListener(this.routingEventName,x=>{var y;u.multiPub({route:x.detail.route,options:x.detail.options,title:((y=x.detail.options)==null?void 0:y.title)||this.defaultTitle||""})}),Fa.notify(),this.initPopstateListener(),u}static initPopstateListener(){this.__onPopstate||(this.__onPopstate=()=>{this.notify()},window.addEventListener("popstate",this.__onPopstate))}static removePopstateListener(){window.removeEventListener("popstate",this.__onPopstate),this.__onPopstate=null}},e(qr,"AppRouter"),qr);Fa.appMap=Object.create(null);function rn(S,v){for(let t in v)t.includes("-")?S.style.setProperty(t,v[t]):S.style[t]=v[t]}e(rn,"applyStyles");function Zm(S,v){for(let t in v)v[t].constructor===Boolean?v[t]?S.setAttribute(t,""):S.removeAttribute(t):S.setAttribute(t,v[t])}e(Zm,"applyAttributes");function Ba(S={tag:"div"}){let v=document.createElement(S.tag);if(S.attributes&&Zm(v,S.attributes),S.styles&&rn(v,S.styles),S.properties)for(let t in S.properties)v[t]=S.properties[t];return S.processors&&S.processors.forEach(t=>{t(v)}),S.children&&S.children.forEach(t=>{let u=Ba(t);v.appendChild(u)}),v}e(Ba,"create");var eu="idb-store-ready",Jm="symbiote-db",Km="symbiote-idb-update_",tn,Qm=(tn=class{_notifyWhenReady(v=null){window.dispatchEvent(new CustomEvent(eu,{detail:{dbName:this.name,storeName:this.storeName,event:v}}))}get _updEventName(){return Km+this.name}_getUpdateEvent(v){return new CustomEvent(this._updEventName,{detail:{key:this.name,newValue:v}})}_notifySubscribers(v){window.localStorage.removeItem(this.name),window.localStorage.setItem(this.name,v),window.dispatchEvent(this._getUpdateEvent(v))}constructor(v,t){this.name=v,this.storeName=t,this.version=1,this.request=window.indexedDB.open(this.name,this.version),this.request.onupgradeneeded=u=>{this.db=u.target.result,this.objStore=this.db.createObjectStore(t,{keyPath:"_key"}),this.objStore.transaction.oncomplete=x=>{this._notifyWhenReady(x)}},this.request.onsuccess=u=>{this.db=u.target.result,this._notifyWhenReady(u)},this.request.onerror=u=>{console.error(u)},this._subscriptionsMap={},this._updateHandler=u=>{u.key===this.name&&this._subscriptionsMap[u.newValue]&&this._subscriptionsMap[u.newValue].forEach(async y=>{y(await this.read(u.newValue))})},this._localUpdateHandler=u=>{this._updateHandler(u.detail)},window.addEventListener("storage",this._updateHandler),window.addEventListener(this._updEventName,this._localUpdateHandler)}read(v){let u=this.db.transaction(this.storeName,"readwrite").objectStore(this.storeName).get(v);return new Promise((x,y)=>{u.onsuccess=I=>{var l;(l=I.target.result)!=null&&l._value?x(I.target.result._value):(x(null),console.warn(`IDB: cannot read "${v}"`))},u.onerror=I=>{y(I)}})}write(v,t,u=!1){let x={_key:v,_value:t},I=this.db.transaction(this.storeName,"readwrite").objectStore(this.storeName).put(x);return new Promise((l,c)=>{I.onsuccess=T=>{u||this._notifySubscribers(v),l(T.target.result)},I.onerror=T=>{c(T)}})}delete(v,t=!1){let x=this.db.transaction(this.storeName,"readwrite").objectStore(this.storeName).delete(v);return new Promise((y,I)=>{x.onsuccess=l=>{t||this._notifySubscribers(v),y(l)},x.onerror=l=>{I(l)}})}getAll(){let t=this.db.transaction(this.storeName,"readwrite").objectStore(this.storeName).getAll();return new Promise((u,x)=>{t.onsuccess=y=>{let I=y.target.result;u(I.map(l=>l._value))},t.onerror=y=>{x(y)}})}subscribe(v,t){this._subscriptionsMap[v]||(this._subscriptionsMap[v]=new Set);let u=this._subscriptionsMap[v];return u.add(t),{remove:()=>{u.delete(t),u.size||delete this._subscriptionsMap[v]}}}stop(){window.removeEventListener("storage",this._updateHandler),this._subscriptionsMap=null,iu.clear(this.name)}},e(tn,"DbInstance"),tn),en,iu=(en=class{static get readyEventName(){return eu}static open(v=Jm,t="store"){let u=v+"/"+t;return this._reg[u]||(this._reg[u]=new Qm(v,t)),this._reg[u]}static clear(v){window.indexedDB.deleteDatabase(v);for(let t in this._reg)t.split("/")[0]===v&&delete this._reg[t]}},e(en,"IDB"),en);za(iu,"_reg",Object.create(null));var ru=e(S=>{if(typeof S!="string"||!S)return"";let v=S.trim();return v.startsWith("-/")?v=v.slice(2):v.startsWith("/")&&(v=v.slice(1)),v.endsWith("/")&&(v=v.slice(0,v.length-1)),v},"normalizeCdnOperation"),Is=e((...S)=>S.filter(v=>typeof v=="string"&&v).map(v=>ru(v)).join("/-/"),"joinCdnOperations"),Xe=e((...S)=>{let v=Is(...S);return v?`-/${v}/`:""},"createCdnUrlModifiers");function Es(S){let v=new URL(S),t=v.pathname+v.search+v.hash,u=t.lastIndexOf("http"),x=t.lastIndexOf("/"),y="";return u>=0?y=t.slice(u):x>=0&&(y=t.slice(x+1)),y}e(Es,"extractFilename");function ws(S){let v=new URL(S),{pathname:t}=v,u=t.indexOf("/"),x=t.indexOf("/",u+1);return t.substring(u+1,x)}e(ws,"extractUuid");function Ua(S){let v=su(S),t=new URL(v),u=t.pathname.indexOf("/-/");return u===-1?"":t.pathname.substring(u).slice(1)}e(Ua,"extractCdnUrlModifiers");function nu(S){return Ua(S).split("/-/").filter(Boolean).map(t=>ru(t))}e(nu,"extractOperations");function su(S){let v=new URL(S),t=Es(S),u=au(t)?ou(t).pathname:t;return v.pathname=v.pathname.replace(u,""),v.search="",v.hash="",v.toString()}e(su,"trimFilename");function au(S){return S.startsWith("http")}e(au,"isFileUrl");function ou(S){let v=new URL(S);return{pathname:v.origin+v.pathname||"",search:v.search||"",hash:v.hash||""}}e(ou,"splitFileUrl");var ze=e((S,v,t)=>{let u=new URL(su(S));if(t=t||Es(S),u.pathname.startsWith("//")&&(u.pathname=u.pathname.replace("//","/")),au(t)){let x=ou(t);u.pathname=u.pathname+(v||"")+(x.pathname||""),u.search=x.search,u.hash=x.hash}else u.pathname=u.pathname+(v||"")+(t||"");return u.toString()},"createCdnUrl"),Ui=e((S,v)=>{let t=new URL(S);return t.pathname=v+"/",t.toString()},"createOriginalUrl");var Ve=e((S,v=",")=>S.trim().split(v).map(t=>t.trim()).filter(t=>t.length>0),"stringToArray");var ni=Object.freeze({brightness:0,exposure:0,gamma:100,contrast:0,saturation:0,vibrance:0,warmth:0,enhance:0,filter:0,rotate:0,mirror:!1,flip:!1,crop:void 0}),cu=["enhance","brightness","exposure","gamma","contrast","saturation","vibrance","warmth","filter","mirror","flip","rotate","crop"];function qm(S,v){if(typeof v=="number"){let t=v;return ni[S]!==t?`${S}/${t}`:""}if(typeof v=="boolean"){let t=v;return ni[S]!==t?`${S}`:""}if(S==="filter"&&v){let{name:t,amount:u}=v;return ni.filter===u?"":`${S}/${t}/${u}`}if(S==="crop"&&v){let{dimensions:t,coords:u}=v;return`${S}/${t.join("x")}/${u.join(",")}`}return""}e(qm,"transformationToStr");function Hi(S){return Is(...cu.filter(v=>typeof S[v]!="undefined"&&S[v]!==null).map(v=>{let t=S[v];return qm(v,t)}).filter(v=>!!v))}e(Hi,"transformationsToOperations");var Ms=Is("format/auto","progressive/yes"),Ai=e(([S])=>typeof S!="undefined"?Number(S):void 0,"asNumber"),lu=e(()=>!0,"asBoolean"),t0=e(([S,v])=>({name:S,amount:typeof v!="undefined"?Number(v):100}),"asFilter"),e0=e(([S,v])=>{if(!/\d+x\d+/.test(S)||!/\d+,\d+/.test(v))throw new Error("Crop by aspect ratio, percentage or alignment shortcuts is not supported.");return{dimensions:Ve(S,"x").map(Number),coords:Ve(v).map(Number)}},"asCrop"),i0=Object.freeze({enhance:Ai,brightness:Ai,exposure:Ai,gamma:Ai,contrast:Ai,saturation:Ai,vibrance:Ai,warmth:Ai,filter:t0,mirror:lu,flip:lu,rotate:Ai,crop:e0});function uu(S){let v={};for(let t of S){let[u,...x]=t.split("/");if(!cu.includes(u))continue;let y=u,I=i0[y];try{let l=I(x);v[y]=l}catch(l){console.warn([`Failed to parse URL operation "${t}". It will be ignored.`,l instanceof Error?`Error message: "${l.message}"`:l,"If you need this functionality, please feel free to open an issue at https://github.com/uploadcare/blocks/issues/new"].join(`
|
|
392
|
-
`))}}return v}e(uu,"operationsToTransformations");var De=Object.freeze({CROP:"crop",TUNING:"tuning",FILTERS:"filters"}),ti=[De.CROP,De.TUNING,De.FILTERS],hu=["brightness","exposure","gamma","contrast","saturation","vibrance","warmth","enhance"],fu=["adaris","briaril","calarel","carris","cynarel","cyren","elmet","elonni","enzana","erydark","fenralan","ferand","galen","gavin","gethriel","iorill","iothari","iselva","jadis","lavra","misiara","namala","nerion","nethari","pamaya","sarnar","sedis","sewen","sorahel","sorlen","tarian","thellassan","varriel","varven","vevera","virkas","yedis","yllara","zatvel","zevcen"],du=["rotate","mirror","flip"],yi=Object.freeze({brightness:{zero:ni.brightness,range:[-100,100],keypointsNumber:2},exposure:{zero:ni.exposure,range:[-500,500],keypointsNumber:2},gamma:{zero:ni.gamma,range:[0,1e3],keypointsNumber:2},contrast:{zero:ni.contrast,range:[-100,500],keypointsNumber:2},saturation:{zero:ni.saturation,range:[-100,500],keypointsNumber:1},vibrance:{zero:ni.vibrance,range:[-100,500],keypointsNumber:1},warmth:{zero:ni.warmth,range:[-100,100],keypointsNumber:1},enhance:{zero:ni.enhance,range:[0,100],keypointsNumber:1},filter:{zero:ni.filter,range:[0,100],keypointsNumber:1}});var gu=e(S=>S?S.split(",").map(v=>v.trim()):[],"deserealizeCsv"),fr=e(S=>S?S.join(","):"","serializeCsv");var r0="https://ucarecdn.com",n0="https://upload.uploadcare.com",s0="https://social.uploadcare.com",di={pubkey:"",multiple:!0,multipleMin:0,multipleMax:Number.MAX_SAFE_INTEGER,confirmUpload:!1,imgOnly:!1,accept:"",externalSourcesPreferredTypes:"",store:"auto",cameraMirror:!1,cameraCapture:"",sourceList:"local, url, camera, dropbox, gdrive",cloudImageEditorTabs:fr(ti),maxLocalFileSizeBytes:0,thumbSize:76,showEmptyList:!1,useLocalImageEditor:!1,useCloudImageEditor:!0,removeCopyright:!1,cropPreset:"",imageShrink:"",modalScrollLock:!0,modalBackdropStrokes:!1,sourceListWrap:!0,remoteTabSessionKey:"",cdnCname:r0,baseUrl:n0,socialBaseUrl:s0,secureSignature:"",secureExpire:"",secureDeliveryProxy:"",retryThrottledRequestMaxTimes:1,multipartMinFileSize:26214400,multipartChunkSize:5242880,maxConcurrentRequests:10,multipartMaxConcurrentRequests:4,multipartMaxAttempts:3,checkForUrlDuplicates:!1,saveUrlForRecurrentUploads:!1,groupOutput:!1,userAgentIntegration:"",debug:!1,metadata:null,localeName:"en",localeDefinitionOverride:null,secureUploadsExpireThreshold:10*60*1e3,secureUploadsSignatureResolver:null,secureDeliveryProxyUrlResolver:null,iconHrefResolver:null,fileValidators:[],collectionValidators:[]};var Se=Object.freeze({FILE_ADDED:"file-added",FILE_REMOVED:"file-removed",FILE_UPLOAD_START:"file-upload-start",FILE_UPLOAD_PROGRESS:"file-upload-progress",FILE_UPLOAD_SUCCESS:"file-upload-success",FILE_UPLOAD_FAILED:"file-upload-failed",FILE_URL_CHANGED:"file-url-changed",MODAL_OPEN:"modal-open",MODAL_CLOSE:"modal-close",DONE_CLICK:"done-click",UPLOAD_CLICK:"upload-click",ACTIVITY_CHANGE:"activity-change",COMMON_UPLOAD_START:"common-upload-start",COMMON_UPLOAD_PROGRESS:"common-upload-progress",COMMON_UPLOAD_SUCCESS:"common-upload-success",COMMON_UPLOAD_FAILED:"common-upload-failed",CHANGE:"change",GROUP_CREATED:"group-created"}),Ha=class Ha{constructor(v){st(this,"_timeoutStore",new Map);st(this,"_targets",new Set);st(this,"_debugPrint",null);this._debugPrint=v}bindTarget(v){this._targets.add(v)}unbindTarget(v){this._targets.delete(v)}_dispatch(v,t){var u;for(let x of this._targets)x.dispatchEvent(new CustomEvent(v,{detail:t}));(u=this._debugPrint)==null||u.call(this,()=>{let x=t&&typeof t=="object"?{...t}:t;return[`event "${v}"`,x]})}emit(v,t,{debounce:u}={}){if(typeof u!="number"&&!u){this._dispatch(v,typeof t=="function"?t():t);return}this._timeoutStore.has(v)&&window.clearTimeout(this._timeoutStore.get(v));let x=typeof u=="number"?u:20,y=window.setTimeout(()=>{this._dispatch(v,typeof t=="function"?t():t),this._timeoutStore.delete(v)},x);this._timeoutStore.set(v,y)}};e(Ha,"EventEmitter");var Ts=Ha;function Ne(S,v){let t,u=e((...x)=>{clearTimeout(t),t=setTimeout(()=>S(...x),v)},"debounced");return u.cancel=()=>{clearTimeout(t)},u}e(Ne,"debounce");var vu="--uploadcare-blocks-window-height",nn=class nn{static registerClient(v){this.clientsRegistry.size===0&&this.attachTracker(),this.clientsRegistry.add(v)}static unregisterClient(v){this.clientsRegistry.delete(v),this.clientsRegistry.size===0&&this.detachTracker()}static attachTracker(){window.addEventListener("resize",this.flush,{passive:!0,capture:!0}),this.flush()}static detachTracker(){window.removeEventListener("resize",this.flush,{capture:!0}),document.documentElement.style.removeProperty(vu)}};e(nn,"WindowHeightTracker"),st(nn,"clientsRegistry",new Set),st(nn,"flush",Ne(()=>{document.documentElement.style.setProperty(vu,`${window.innerHeight}px`)},100));var sn=nn;var pu=e(S=>{var u;let v=new Intl.Locale(S),t="ltr";return typeof v.getTextInfo=="function"&&v.getTextInfo().direction?t=v.getTextInfo().direction:"textInfo"in v&&((u=v.textInfo)!=null&&u.direction)&&(t=v.textInfo.direction),t},"getLocaleDirection");var As=e((S,v)=>new Intl.PluralRules(S).select(v),"getPluralForm");var a0=e(S=>S,"DEFAULT_TRANSFORMER"),Wa="{{",yu="}}",mu="plural:";function an(S,v,t={}){var I;let{openToken:u=Wa,closeToken:x=yu,transform:y=a0}=t;for(let l in v){let c=(I=v[l])==null?void 0:I.toString();S=S.replaceAll(u+l+x,typeof c=="string"?y(c):c)}return S}e(an,"applyTemplateData");function bu(S){let v=[],t=S.indexOf(Wa);for(;t!==-1;){let u=S.indexOf(yu,t),x=S.substring(t+2,u);if(x.startsWith(mu)){let y=S.substring(t+2,u).replace(mu,""),I=y.substring(0,y.indexOf("(")),l=y.substring(y.indexOf("(")+1,y.indexOf(")"));v.push({variable:x,pluralKey:I,countVariable:l})}t=S.indexOf(Wa,u)}return v}e(bu,"getPluralObjects");var Cu=e(({element:S,attribute:v,onSuccess:t,onTimeout:u,timeout:x=300})=>{let y=S.getAttribute(v);if(y!==null){t(y);return}let I=new MutationObserver(T=>{let P=T[T.length-1];c(P)});I.observe(S,{attributes:!0,attributeFilter:[v]});let l=setTimeout(()=>{I.disconnect(),u()},x),c=e(T=>{let P=S.getAttribute(v);T.type==="attributes"&&T.attributeName===v&&P!==null&&(clearTimeout(l),I.disconnect(),t(P))},"handleMutation")},"waitForAttribute");function _u(S){return Object.prototype.toString.call(S)==="[object Object]"}e(_u,"isObject");var o0=/\W|_/g;function l0(S){return S.split(o0).map((v,t)=>v.charAt(0)[t>0?"toUpperCase":"toLowerCase"]()+v.slice(1)).join("")}e(l0,"camelizeString");function xu(S,{ignoreKeys:v}={ignoreKeys:[]}){return Array.isArray(S)?S.map(t=>ki(t,{ignoreKeys:v})):S}e(xu,"camelizeArrayItems");function ki(S,{ignoreKeys:v}={ignoreKeys:[]}){if(Array.isArray(S))return xu(S,{ignoreKeys:v});if(!_u(S))return S;let t={};for(let u of Object.keys(S)){let x=S[u];if(v.includes(u)){t[u]=x;continue}_u(x)?x=ki(x,{ignoreKeys:v}):Array.isArray(x)&&(x=xu(x,{ignoreKeys:v})),t[l0(u)]=x}return t}e(ki,"camelizeKeys");var c0=e(S=>new Promise(v=>setTimeout(v,S)),"delay");function Ja({libraryName:S,libraryVersion:v,userAgent:t,publicKey:u="",integration:x=""}){let y="JavaScript";if(typeof t=="string")return t;if(typeof t=="function")return t({publicKey:u,libraryName:S,libraryVersion:v,languageName:y,integration:x});let I=[S,v,u].filter(Boolean).join("/"),l=[y,x].filter(Boolean).join("; ");return`${I} (${l})`}e(Ja,"getUserAgent$1");var u0={factor:2,time:100};function h0(S,v=u0){let t=0;function u(x){let y=Math.round(v.time*v.factor**t);return x({attempt:t,retry:e(l=>c0(l!=null?l:y).then(()=>(t+=1,u(x))),"retry")})}return e(u,"runAttempt"),u(S)}e(h0,"retrier");var io=class io extends Error{};e(io,"UploadcareError");var on=io,Ds=class Ds extends on{constructor(t){super();st(this,"originalProgressEvent");this.name="NetworkError",this.message="Network error",Object.setPrototypeOf(this,Ds.prototype),this.originalProgressEvent=t}};e(Ds,"NetworkError");var dr=Ds,Ls=e((S,v)=>{S&&(S.aborted?Promise.resolve().then(v):S.addEventListener("abort",()=>v(),{once:!0}))},"onCancel"),ks=class ks extends on{constructor(t="Request canceled"){super(t);st(this,"isCancel",!0);this.name="CancelError",Object.setPrototypeOf(this,ks.prototype)}};e(ks,"CancelError");var Wi=ks,f0=500,Iu=e(({check:S,interval:v=f0,timeout:t,signal:u})=>new Promise((x,y)=>{let I,l;Ls(u,()=>{I&&clearTimeout(I),y(new Wi("Poll cancelled"))}),t&&(l=setTimeout(()=>{I&&clearTimeout(I),y(new Wi("Timed out"))},t));let c=e(()=>{try{Promise.resolve(S(u)).then(T=>{T?(l&&clearTimeout(l),x(T)):I=setTimeout(c,v)}).catch(T=>{l&&clearTimeout(l),y(T)})}catch(T){l&&clearTimeout(l),y(T)}},"tick");I=setTimeout(c,0)}),"poll"),fe={baseCDN:"https://ucarecdn.com",baseURL:"https://upload.uploadcare.com",maxContentLength:50*1024*1024,retryThrottledRequestMaxTimes:1,retryNetworkErrorMaxTimes:3,multipartMinFileSize:25*1024*1024,multipartChunkSize:5*1024*1024,multipartMinLastPartSize:1024*1024,maxConcurrentRequests:4,pollingTimeoutMilliseconds:1e4,pusherKey:"79ae88bd931ea68464d9"},Ns="application/octet-stream",Eu="original",Yi=e(({method:S,url:v,data:t,headers:u={},signal:x,onProgress:y})=>new Promise((I,l)=>{let c=new XMLHttpRequest,T=(S==null?void 0:S.toUpperCase())||"GET",P=!1;c.open(T,v,!0),u&&Object.entries(u).forEach(L=>{let[N,j]=L;typeof j!="undefined"&&!Array.isArray(j)&&c.setRequestHeader(N,j)}),c.responseType="text",Ls(x,()=>{P=!0,c.abort(),l(new Wi)}),c.onload=()=>{if(c.status!=200)l(new Error(`Error ${c.status}: ${c.statusText}`));else{let L={method:T,url:v,data:t,headers:u||void 0,signal:x,onProgress:y},N=c.getAllResponseHeaders().trim().split(/[\r\n]+/),j={};N.forEach(function(m){let p=m.split(": "),i=p.shift(),a=p.join(": ");i&&typeof i!="undefined"&&(j[i]=a)});let b=c.response,r=c.status;I({request:L,data:b,headers:j,status:r})}},c.onerror=L=>{P||l(new dr(L))},y&&typeof y=="function"&&(c.upload.onprogress=L=>{L.lengthComputable?y({isComputable:!0,value:L.loaded/L.total}):y({isComputable:!1})}),t?c.send(t):c.send()}),"request");function d0(S,...v){return S}e(d0,"identity");var g0=e(({name:S})=>S?[S]:[],"getFileOptions"),v0=d0,p0=e(()=>new FormData,"getFormData"),wu=e(S=>!1,"isBuffer"),Rs=e(S=>typeof Blob!="undefined"&&S instanceof Blob,"isBlob"),js=e(S=>typeof File!="undefined"&&S instanceof File,"isFile"),Fs=e(S=>!!S&&typeof S=="object"&&!Array.isArray(S)&&"uri"in S&&typeof S.uri=="string","isReactNativeAsset"),gr=e(S=>Rs(S)||js(S)||wu()||Fs(S),"isFileData"),m0=e(S=>typeof S=="string"||typeof S=="number"||typeof S=="undefined","isSimpleValue"),y0=e(S=>!!S&&typeof S=="object"&&!Array.isArray(S),"isObjectValue"),b0=e(S=>!!S&&typeof S=="object"&&"data"in S&&gr(S.data),"isFileValue");function Mu(S,v,t){if(Array.isArray(t))for(let u of t)Mu(S,`${v}[]`,u);else if(b0(t)){let{name:u,contentType:x}=t,y=v0(t.data,u,x!=null?x:Ns),I=g0({name:u,contentType:x});S.push([v,y,...I])}else if(y0(t))for(let[u,x]of Object.entries(t))typeof x!="undefined"&&S.push([`${v}[${u}]`,String(x)]);else m0(t)&&t&&S.push([v,t.toString()])}e(Mu,"collectParams");function C0(S){let v=[];for(let[t,u]of Object.entries(S))Mu(v,t,u);return v}e(C0,"getFormDataParams");function zs(S){let v=p0(),t=C0(S);for(let u of t){let[x,y,...I]=u;v.append(x,y,...I)}return v}e(zs,"buildFormData");var Ps=class Ps extends on{constructor(t,u,x,y,I){super();st(this,"code");st(this,"request");st(this,"response");st(this,"headers");this.name="UploadError",this.message=t,this.code=u,this.request=x,this.response=y,this.headers=I,Object.setPrototypeOf(this,Ps.prototype)}};e(Ps,"UploadError");var $e=Ps,_0=e(S=>{let v=new URLSearchParams;for(let[t,u]of Object.entries(S))u&&typeof u=="object"&&!Array.isArray(u)?Object.entries(u).filter(x=>{var y;return(y=x[1])!=null?y:!1}).forEach(x=>v.set(`${t}[${x[0]}]`,String(x[1]))):Array.isArray(u)?u.forEach(x=>{v.append(`${t}[]`,x)}):typeof u=="string"&&u?v.set(t,u):typeof u=="number"&&v.set(t,u.toString());return v.toString()},"buildSearchParams"),Oi=e((S,v,t)=>{let u=new URL(S);return u.pathname=(u.pathname+v).replace("//","/"),t&&(u.search=_0(t)),u.toString()},"getUrl"),x0="6.14.1",S0="UploadcareUploadClient",I0=x0;function qi(S){return Ja({libraryName:S0,libraryVersion:I0,...S})}e(qi,"getUserAgent");var E0="RequestThrottledError",Su=15e3,w0=1e3;function M0(S){let{headers:v}=S||{};if(!v||typeof v["retry-after"]!="string")return Su;let t=parseInt(v["retry-after"],10);return Number.isFinite(t)?t*1e3:Su}e(M0,"getTimeoutFromThrottledRequest");function Gi(S,v){let{retryThrottledRequestMaxTimes:t,retryNetworkErrorMaxTimes:u}=v;return h0(({attempt:x,retry:y})=>S().catch(I=>{if("response"in I&&(I==null?void 0:I.code)===E0&&x<t)return y(M0(I));if(I instanceof dr&&x<u)return y((x+1)*w0);throw I}))}e(Gi,"retryIfFailed");var Tu=e(S=>{let v="";return(Rs(S)||js(S)||Fs(S))&&(v=S.type),v||Ns},"getContentType"),Au=e(S=>{let v="";return js(S)&&S.name?v=S.name:Rs(S)||wu()?v="":Fs(S)&&S.name&&(v=S.name),v||Eu},"getFileName");function Ka(S){return typeof S=="undefined"||S==="auto"?"auto":S?"1":"0"}e(Ka,"getStoreValue");function T0(S,{publicKey:v,fileName:t,contentType:u,baseURL:x=fe.baseURL,secureSignature:y,secureExpire:I,store:l,signal:c,onProgress:T,source:P="local",integration:L,userAgent:N,retryThrottledRequestMaxTimes:j=fe.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:b=fe.retryNetworkErrorMaxTimes,metadata:r}){return Gi(()=>Yi({method:"POST",url:Oi(x,"/base/",{jsonerrors:1}),headers:{"X-UC-User-Agent":qi({publicKey:v,integration:L,userAgent:N})},data:zs({file:{data:S,name:t||Au(S),contentType:u||Tu(S)},UPLOADCARE_PUB_KEY:v,UPLOADCARE_STORE:Ka(l),signature:y,expire:I,source:P,metadata:r}),signal:c,onProgress:T}).then(({data:m,headers:p,request:i})=>{let a=ki(JSON.parse(m));if("error"in a)throw new $e(a.error.content,a.error.errorCode,i,a,p);return a}),{retryNetworkErrorMaxTimes:b,retryThrottledRequestMaxTimes:j})}e(T0,"base");var Xa;(function(S){S.Token="token",S.FileInfo="file_info"})(Xa||(Xa={}));function A0(S,{publicKey:v,baseURL:t=fe.baseURL,store:u,fileName:x,checkForUrlDuplicates:y,saveUrlForRecurrentUploads:I,secureSignature:l,secureExpire:c,source:T="url",signal:P,integration:L,userAgent:N,retryThrottledRequestMaxTimes:j=fe.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:b=fe.retryNetworkErrorMaxTimes,metadata:r}){return Gi(()=>Yi({method:"POST",headers:{"X-UC-User-Agent":qi({publicKey:v,integration:L,userAgent:N})},url:Oi(t,"/from_url/",{jsonerrors:1,pub_key:v,source_url:S,store:Ka(u),filename:x,check_URL_duplicates:y?1:void 0,save_URL_duplicates:I?1:void 0,signature:l,expire:c,source:T,metadata:r}),signal:P}).then(({data:m,headers:p,request:i})=>{let a=ki(JSON.parse(m));if("error"in a)throw new $e(a.error.content,a.error.errorCode,i,a,p);return a}),{retryNetworkErrorMaxTimes:b,retryThrottledRequestMaxTimes:j})}e(A0,"fromUrl");var ei;(function(S){S.Unknown="unknown",S.Waiting="waiting",S.Progress="progress",S.Error="error",S.Success="success"})(ei||(ei={}));var O0=e(S=>"status"in S&&S.status===ei.Error,"isErrorResponse");function D0(S,{publicKey:v,baseURL:t=fe.baseURL,signal:u,integration:x,userAgent:y,retryThrottledRequestMaxTimes:I=fe.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:l=fe.retryNetworkErrorMaxTimes}={}){return Gi(()=>Yi({method:"GET",headers:v?{"X-UC-User-Agent":qi({publicKey:v,integration:x,userAgent:y})}:void 0,url:Oi(t,"/from_url/status/",{jsonerrors:1,token:S}),signal:u}).then(({data:c,headers:T,request:P})=>{let L=ki(JSON.parse(c));if("error"in L&&!O0(L))throw new $e(L.error.content,L.error.errorCode,P,L,T);return L}),{retryNetworkErrorMaxTimes:l,retryThrottledRequestMaxTimes:I})}e(D0,"fromUrlStatus");function k0(S,{publicKey:v,baseURL:t=fe.baseURL,jsonpCallback:u,secureSignature:x,secureExpire:y,signal:I,source:l,integration:c,userAgent:T,retryThrottledRequestMaxTimes:P=fe.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:L=fe.retryNetworkErrorMaxTimes}){return Gi(()=>Yi({method:"POST",headers:{"X-UC-User-Agent":qi({publicKey:v,integration:c,userAgent:T})},url:Oi(t,"/group/",{jsonerrors:1}),data:zs({files:S,callback:u,pub_key:v,signature:x,expire:y,source:l}),signal:I}).then(({data:N,headers:j,request:b})=>{let r=ki(JSON.parse(N));if("error"in r)throw new $e(r.error.content,r.error.errorCode,b,r,j);return r}),{retryNetworkErrorMaxTimes:L,retryThrottledRequestMaxTimes:P})}e(k0,"group");function Ou(S,{publicKey:v,baseURL:t=fe.baseURL,signal:u,source:x,integration:y,userAgent:I,retryThrottledRequestMaxTimes:l=fe.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:c=fe.retryNetworkErrorMaxTimes}){return Gi(()=>Yi({method:"GET",headers:{"X-UC-User-Agent":qi({publicKey:v,integration:y,userAgent:I})},url:Oi(t,"/info/",{jsonerrors:1,pub_key:v,file_id:S,source:x}),signal:u}).then(({data:T,headers:P,request:L})=>{let N=ki(JSON.parse(T));if("error"in N)throw new $e(N.error.content,N.error.errorCode,L,N,P);return N}),{retryThrottledRequestMaxTimes:l,retryNetworkErrorMaxTimes:c})}e(Ou,"info");function P0(S,{publicKey:v,contentType:t,fileName:u,multipartChunkSize:x=fe.multipartChunkSize,baseURL:y="",secureSignature:I,secureExpire:l,store:c,signal:T,source:P="local",integration:L,userAgent:N,retryThrottledRequestMaxTimes:j=fe.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:b=fe.retryNetworkErrorMaxTimes,metadata:r}){return Gi(()=>Yi({method:"POST",url:Oi(y,"/multipart/start/",{jsonerrors:1}),headers:{"X-UC-User-Agent":qi({publicKey:v,integration:L,userAgent:N})},data:zs({filename:u||Eu,size:S,content_type:t||Ns,part_size:x,UPLOADCARE_STORE:Ka(c),UPLOADCARE_PUB_KEY:v,signature:I,expire:l,source:P,metadata:r}),signal:T}).then(({data:m,headers:p,request:i})=>{let a=ki(JSON.parse(m));if("error"in a)throw new $e(a.error.content,a.error.errorCode,i,a,p);return a.parts=Object.keys(a.parts).map(n=>a.parts[Number(n)]),a}),{retryThrottledRequestMaxTimes:j,retryNetworkErrorMaxTimes:b})}e(P0,"multipartStart");function L0(S,v,{contentType:t,signal:u,onProgress:x,retryThrottledRequestMaxTimes:y=fe.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:I=fe.retryNetworkErrorMaxTimes}){return Gi(()=>Yi({method:"PUT",url:v,data:S,onProgress:x,signal:u,headers:{"Content-Type":t||Ns}}).then(l=>(x&&x({isComputable:!0,value:1}),l)).then(({status:l})=>({code:l})),{retryThrottledRequestMaxTimes:y,retryNetworkErrorMaxTimes:I})}e(L0,"multipartUpload");function N0(S,{publicKey:v,baseURL:t=fe.baseURL,source:u="local",signal:x,integration:y,userAgent:I,retryThrottledRequestMaxTimes:l=fe.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:c=fe.retryNetworkErrorMaxTimes}){return Gi(()=>Yi({method:"POST",url:Oi(t,"/multipart/complete/",{jsonerrors:1}),headers:{"X-UC-User-Agent":qi({publicKey:v,integration:y,userAgent:I})},data:zs({uuid:S,UPLOADCARE_PUB_KEY:v,source:u}),signal:x}).then(({data:T,headers:P,request:L})=>{let N=ki(JSON.parse(T));if("error"in N)throw new $e(N.error.content,N.error.errorCode,L,N,P);return N}),{retryThrottledRequestMaxTimes:l,retryNetworkErrorMaxTimes:c})}e(N0,"multipartComplete");function Qa(S,{publicKey:v,baseURL:t,source:u,integration:x,userAgent:y,retryThrottledRequestMaxTimes:I,retryNetworkErrorMaxTimes:l,signal:c,onProgress:T}){return Iu({check:P=>Ou(S,{publicKey:v,baseURL:t,signal:P,source:u,integration:x,userAgent:y,retryThrottledRequestMaxTimes:I,retryNetworkErrorMaxTimes:l}).then(L=>L.isReady?L:(T&&T({isComputable:!0,value:1}),!1)),signal:c})}e(Qa,"isReadyPoll");function R0(S){return"defaultEffects"in S}e(R0,"isGroupFileInfo");var ro=class ro{constructor(v,{baseCDN:t=fe.baseCDN,fileName:u}={}){st(this,"uuid");st(this,"name",null);st(this,"size",null);st(this,"isStored",null);st(this,"isImage",null);st(this,"mimeType",null);st(this,"cdnUrl",null);st(this,"s3Url",null);st(this,"originalFilename",null);st(this,"imageInfo",null);st(this,"videoInfo",null);st(this,"contentInfo",null);st(this,"metadata",null);st(this,"s3Bucket",null);st(this,"defaultEffects",null);let{uuid:x,s3Bucket:y}=v,I=Oi(t,`${x}/`),l=y?Oi(`https://${y}.s3.amazonaws.com/`,`${x}/${v.filename}`):null;this.uuid=x,this.name=u||v.filename,this.size=v.size,this.isStored=v.isStored,this.isImage=v.isImage,this.mimeType=v.mimeType,this.cdnUrl=I,this.originalFilename=v.originalFilename,this.imageInfo=v.imageInfo,this.videoInfo=v.videoInfo,this.contentInfo=v.contentInfo,this.metadata=v.metadata||null,this.s3Bucket=y||null,this.s3Url=l,R0(v)&&(this.defaultEffects=v.defaultEffects)}};e(ro,"UploadcareFile");var Di=ro,j0=e((S,{publicKey:v,fileName:t,baseURL:u,secureSignature:x,secureExpire:y,store:I,contentType:l,signal:c,onProgress:T,source:P,integration:L,userAgent:N,retryThrottledRequestMaxTimes:j,retryNetworkErrorMaxTimes:b,baseCDN:r,metadata:m})=>T0(S,{publicKey:v,fileName:t,contentType:l,baseURL:u,secureSignature:x,secureExpire:y,store:I,signal:c,onProgress:T,source:P,integration:L,userAgent:N,retryThrottledRequestMaxTimes:j,retryNetworkErrorMaxTimes:b,metadata:m}).then(({file:p})=>Qa(p,{publicKey:v,baseURL:u,source:P,integration:L,userAgent:N,retryThrottledRequestMaxTimes:j,retryNetworkErrorMaxTimes:b,onProgress:T,signal:c})).then(p=>new Di(p,{baseCDN:r})),"uploadDirect"),F0=e((S,{publicKey:v,fileName:t,baseURL:u,signal:x,onProgress:y,source:I,integration:l,userAgent:c,retryThrottledRequestMaxTimes:T,retryNetworkErrorMaxTimes:P,baseCDN:L})=>Ou(S,{publicKey:v,baseURL:u,signal:x,source:I,integration:l,userAgent:c,retryThrottledRequestMaxTimes:T,retryNetworkErrorMaxTimes:P}).then(N=>new Di(N,{baseCDN:L,fileName:t})).then(N=>(y&&y({isComputable:!0,value:1}),N)),"uploadFromUploaded"),z0=e((S,{signal:v}={})=>{let t=null,u=null,x=S.map(()=>new AbortController),y=e(I=>()=>{u=I,x.forEach((l,c)=>c!==I&&l.abort())},"createStopRaceCallback");return Ls(v,()=>{x.forEach(I=>I.abort())}),Promise.all(S.map((I,l)=>{let c=y(l);return Promise.resolve().then(()=>I({stopRace:c,signal:x[l].signal})).then(T=>(c(),T)).catch(T=>(t=T,null))})).then(I=>{if(u===null)throw t;return I[u]})},"race"),B0=window.WebSocket,no=class no{constructor(){st(this,"events",Object.create({}))}emit(v,t){var u;(u=this.events[v])==null||u.forEach(x=>x(t))}on(v,t){this.events[v]=this.events[v]||[],this.events[v].push(t)}off(v,t){t?this.events[v]=this.events[v].filter(u=>u!==t):this.events[v]=[]}};e(no,"Events");var Va=no,U0=e((S,v)=>S==="success"?{status:ei.Success,...v}:S==="progress"?{status:ei.Progress,...v}:{status:ei.Error,...v},"response"),so=class so{constructor(v,t=3e4){st(this,"key");st(this,"disconnectTime");st(this,"ws");st(this,"queue",[]);st(this,"isConnected",!1);st(this,"subscribers",0);st(this,"emmitter",new Va);st(this,"disconnectTimeoutId",null);this.key=v,this.disconnectTime=t}connect(){if(this.disconnectTimeoutId&&clearTimeout(this.disconnectTimeoutId),!this.isConnected&&!this.ws){let v=`wss://ws.pusherapp.com/app/${this.key}?protocol=5&client=js&version=1.12.2`;this.ws=new B0(v),this.ws.addEventListener("error",t=>{this.emmitter.emit("error",new Error(t.message))}),this.emmitter.on("connected",()=>{this.isConnected=!0,this.queue.forEach(t=>this.send(t.event,t.data)),this.queue=[]}),this.ws.addEventListener("message",t=>{let u=JSON.parse(t.data.toString());switch(u.event){case"pusher:connection_established":{this.emmitter.emit("connected",void 0);break}case"pusher:ping":{this.send("pusher:pong",{});break}case"progress":case"success":case"fail":this.emmitter.emit(u.channel,U0(u.event,JSON.parse(u.data)))}})}}disconnect(){let v=e(()=>{var t;(t=this.ws)==null||t.close(),this.ws=void 0,this.isConnected=!1},"actualDisconect");this.disconnectTime?this.disconnectTimeoutId=setTimeout(()=>{v()},this.disconnectTime):v()}send(v,t){var x;let u=JSON.stringify({event:v,data:t});(x=this.ws)==null||x.send(u)}subscribe(v,t){this.subscribers+=1,this.connect();let u=`task-status-${v}`,x={event:"pusher:subscribe",data:{channel:u}};this.emmitter.on(u,t),this.isConnected?this.send(x.event,x.data):this.queue.push(x)}unsubscribe(v){this.subscribers-=1;let t=`task-status-${v}`,u={event:"pusher:unsubscribe",data:{channel:t}};this.emmitter.off(t),this.isConnected?this.send(u.event,u.data):this.queue=this.queue.filter(x=>x.data.channel!==t),this.subscribers===0&&this.disconnect()}onError(v){return this.emmitter.on("error",v),()=>this.emmitter.off("error",v)}};e(so,"Pusher");var $a=so,Ya=null,qa=e(S=>{if(!Ya){let v=typeof window=="undefined"?0:3e4;Ya=new $a(S,v)}return Ya},"getPusher"),H0=e(S=>{qa(S).connect()},"preconnect");function W0({token:S,publicKey:v,baseURL:t,integration:u,userAgent:x,retryThrottledRequestMaxTimes:y,retryNetworkErrorMaxTimes:I,onProgress:l,signal:c}){return Iu({check:T=>D0(S,{publicKey:v,baseURL:t,integration:u,userAgent:x,retryThrottledRequestMaxTimes:y,retryNetworkErrorMaxTimes:I,signal:T}).then(P=>{switch(P.status){case ei.Error:return new $e(P.error,P.errorCode);case ei.Waiting:return!1;case ei.Unknown:return new $e(`Token "${S}" was not found.`);case ei.Progress:return l&&(P.total==="unknown"?l({isComputable:!1}):l({isComputable:!0,value:P.done/P.total})),!1;case ei.Success:return l&&l({isComputable:!0,value:P.done/P.total}),P;default:throw new Error("Unknown status")}}),signal:c})}e(W0,"pollStrategy");var Y0=e(({token:S,pusherKey:v,signal:t,onProgress:u})=>new Promise((x,y)=>{let I=qa(v),l=I.onError(y),c=e(()=>{l(),I.unsubscribe(S)},"destroy");Ls(t,()=>{c(),y(new Wi("pusher cancelled"))}),I.subscribe(S,T=>{switch(T.status){case ei.Progress:{u&&(T.total==="unknown"?u({isComputable:!1}):u({isComputable:!0,value:T.done/T.total}));break}case ei.Success:{c(),u&&u({isComputable:!0,value:T.done/T.total}),x(T);break}case ei.Error:c(),y(new $e(T.msg,T.error_code))}})}),"pushStrategy"),G0=e((S,{publicKey:v,fileName:t,baseURL:u,baseCDN:x,checkForUrlDuplicates:y,saveUrlForRecurrentUploads:I,secureSignature:l,secureExpire:c,store:T,signal:P,onProgress:L,source:N,integration:j,userAgent:b,retryThrottledRequestMaxTimes:r,pusherKey:m=fe.pusherKey,metadata:p})=>Promise.resolve(H0(m)).then(()=>A0(S,{publicKey:v,fileName:t,baseURL:u,checkForUrlDuplicates:y,saveUrlForRecurrentUploads:I,secureSignature:l,secureExpire:c,store:T,signal:P,source:N,integration:j,userAgent:b,retryThrottledRequestMaxTimes:r,metadata:p})).catch(i=>{let a=qa(m);return a==null||a.disconnect(),Promise.reject(i)}).then(i=>i.type===Xa.FileInfo?i:z0([({signal:a})=>W0({token:i.token,publicKey:v,baseURL:u,integration:j,userAgent:b,retryThrottledRequestMaxTimes:r,onProgress:L,signal:a}),({signal:a})=>Y0({token:i.token,pusherKey:m,signal:a,onProgress:L})],{signal:P})).then(i=>{if(i instanceof $e)throw i;return i}).then(i=>Qa(i.uuid,{publicKey:v,baseURL:u,integration:j,userAgent:b,retryThrottledRequestMaxTimes:r,onProgress:L,signal:P})).then(i=>new Di(i,{baseCDN:x})),"uploadFromUrl"),Ga=new WeakMap,X0=e(async S=>{if(Ga.has(S))return Ga.get(S);let v=await fetch(S.uri).then(t=>t.blob());return Ga.set(S,v),v},"getBlobFromReactNativeAsset"),Du=e(async S=>{if(js(S)||Rs(S))return S.size;if(Fs(S))return(await X0(S)).size;throw new Error("Unknown file type. Cannot determine file size.")},"getFileSize"),V0=e((S,v=fe.multipartMinFileSize)=>S>=v,"isMultipart"),ku=e(S=>{let v="[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}",t=new RegExp(v);return!gr(S)&&t.test(S)},"isUuid"),to=e(S=>{let v="^(?:\\w+:)?\\/\\/([^\\s\\.]+\\.\\S{2}|localhost[\\:?\\d]*)\\S*$",t=new RegExp(v);return!gr(S)&&t.test(S)},"isUrl"),$0=e((S,v)=>new Promise((t,u)=>{let x=[],y=!1,I=v.length,l=[...v],c=e(()=>{let T=v.length-l.length,P=l.shift();P&&P().then(L=>{y||(x[T]=L,I-=1,I?c():t(x))}).catch(L=>{y=!0,u(L)})},"run");for(let T=0;T<S;T++)c()}),"runWithConcurrency"),Z0=e((S,v,t,u)=>{let x=u*v,y=Math.min(x+u,t);return S.slice(x,y)},"sliceChunk"),J0=e(async(S,v,t)=>u=>Z0(S,u,v,t),"prepareChunks"),K0=e((S,v,{publicKey:t,contentType:u,onProgress:x,signal:y,integration:I,retryThrottledRequestMaxTimes:l,retryNetworkErrorMaxTimes:c})=>L0(S,v,{publicKey:t,contentType:u,onProgress:x,signal:y,integration:I,retryThrottledRequestMaxTimes:l,retryNetworkErrorMaxTimes:c}),"uploadPart"),Q0=e(async(S,{publicKey:v,fileName:t,fileSize:u,baseURL:x,secureSignature:y,secureExpire:I,store:l,signal:c,onProgress:T,source:P,integration:L,userAgent:N,retryThrottledRequestMaxTimes:j,retryNetworkErrorMaxTimes:b,contentType:r,multipartChunkSize:m=fe.multipartChunkSize,maxConcurrentRequests:p=fe.maxConcurrentRequests,baseCDN:i,metadata:a})=>{let n=u!=null?u:await Du(S),f,_=e((h,E)=>{if(!T)return;f||(f=Array(h).fill(0));let w=e(A=>A.reduce((D,z)=>D+z,0),"sum");return A=>{A.isComputable&&(f[E]=A.value,T({isComputable:!0,value:w(f)/h}))}},"createProgressHandler");return r||(r=Tu(S)),P0(n,{publicKey:v,contentType:r,fileName:t||Au(S),baseURL:x,secureSignature:y,secureExpire:I,store:l,signal:c,source:P,integration:L,userAgent:N,retryThrottledRequestMaxTimes:j,retryNetworkErrorMaxTimes:b,metadata:a}).then(async({uuid:h,parts:E})=>{let w=await J0(S,n,m);return Promise.all([h,$0(p,E.map((A,D)=>()=>K0(w(D),A,{publicKey:v,contentType:r,onProgress:_(E.length,D),signal:c,integration:L,retryThrottledRequestMaxTimes:j,retryNetworkErrorMaxTimes:b})))])}).then(([h])=>N0(h,{publicKey:v,baseURL:x,source:P,integration:L,userAgent:N,retryThrottledRequestMaxTimes:j,retryNetworkErrorMaxTimes:b})).then(h=>h.isReady?h:Qa(h.uuid,{publicKey:v,baseURL:x,source:P,integration:L,userAgent:N,retryThrottledRequestMaxTimes:j,retryNetworkErrorMaxTimes:b,onProgress:T,signal:c})).then(h=>new Di(h,{baseCDN:i}))},"uploadMultipart");async function eo(S,{publicKey:v,fileName:t,baseURL:u=fe.baseURL,secureSignature:x,secureExpire:y,store:I,signal:l,onProgress:c,source:T,integration:P,userAgent:L,retryThrottledRequestMaxTimes:N,retryNetworkErrorMaxTimes:j,contentType:b,multipartMinFileSize:r,multipartChunkSize:m,maxConcurrentRequests:p,baseCDN:i=fe.baseCDN,checkForUrlDuplicates:a,saveUrlForRecurrentUploads:n,pusherKey:f,metadata:_}){if(gr(S)){let h=await Du(S);return V0(h,r)?Q0(S,{publicKey:v,contentType:b,multipartChunkSize:m,fileSize:h,fileName:t,baseURL:u,secureSignature:x,secureExpire:y,store:I,signal:l,onProgress:c,source:T,integration:P,userAgent:L,maxConcurrentRequests:p,retryThrottledRequestMaxTimes:N,retryNetworkErrorMaxTimes:j,baseCDN:i,metadata:_}):j0(S,{publicKey:v,fileName:t,contentType:b,baseURL:u,secureSignature:x,secureExpire:y,store:I,signal:l,onProgress:c,source:T,integration:P,userAgent:L,retryThrottledRequestMaxTimes:N,retryNetworkErrorMaxTimes:j,baseCDN:i,metadata:_})}if(to(S))return G0(S,{publicKey:v,fileName:t,baseURL:u,baseCDN:i,checkForUrlDuplicates:a,saveUrlForRecurrentUploads:n,secureSignature:x,secureExpire:y,store:I,signal:l,onProgress:c,source:T,integration:P,userAgent:L,retryThrottledRequestMaxTimes:N,retryNetworkErrorMaxTimes:j,pusherKey:f,metadata:_});if(ku(S))return F0(S,{publicKey:v,fileName:t,baseURL:u,signal:l,onProgress:c,source:T,integration:P,userAgent:L,retryThrottledRequestMaxTimes:N,retryNetworkErrorMaxTimes:j,baseCDN:i});throw new TypeError(`File uploading from "${S}" is not supported`)}e(eo,"uploadFile");var ao=class ao{constructor(v,{baseCDN:t=fe.baseCDN}={}){st(this,"uuid");st(this,"filesCount");st(this,"totalSize");st(this,"isStored");st(this,"isImage");st(this,"cdnUrl");st(this,"files");st(this,"createdAt");st(this,"storedAt",null);this.uuid=v.id,this.filesCount=v.filesCount;let u=v.files.filter(Boolean);this.totalSize=Object.values(u).reduce((x,y)=>x+y.size,0),this.isStored=!!v.datetimeStored,this.isImage=!!Object.values(u).filter(x=>x.isImage).length,this.cdnUrl=v.cdnUrl,this.files=u.map(x=>new Di(x,{baseCDN:t})),this.createdAt=v.datetimeCreated,this.storedAt=v.datetimeStored}};e(ao,"UploadcareGroup");var Za=ao,q0=e(S=>{for(let v of S)if(!gr(v))return!1;return!0},"isFileDataArray"),ty=e(S=>{for(let v of S)if(!ku(v))return!1;return!0},"isUuidArray"),ey=e(S=>{for(let v of S)if(!to(v))return!1;return!0},"isUrlArray");function Pu(S,{publicKey:v,fileName:t,baseURL:u=fe.baseURL,secureSignature:x,secureExpire:y,store:I,signal:l,onProgress:c,source:T,integration:P,userAgent:L,retryThrottledRequestMaxTimes:N,retryNetworkErrorMaxTimes:j,contentType:b,multipartChunkSize:r=fe.multipartChunkSize,baseCDN:m=fe.baseCDN,checkForUrlDuplicates:p,saveUrlForRecurrentUploads:i,jsonpCallback:a}){if(!q0(S)&&!ey(S)&&!ty(S))throw new TypeError(`Group uploading from "${S}" is not supported`);let n,f=!0,_=S.length,h=e((E,w)=>{if(!c)return;n||(n=Array(E).fill(0));let A=e(D=>D.reduce((z,B)=>z+B)/E,"normalize");return D=>{if(!D.isComputable||!f){f=!1,c({isComputable:!1});return}n[w]=D.value,c({isComputable:!0,value:A(n)})}},"createProgressHandler");return Promise.all(S.map((E,w)=>gr(E)||to(E)?eo(E,{publicKey:v,fileName:t,baseURL:u,secureSignature:x,secureExpire:y,store:I,signal:l,onProgress:h(_,w),source:T,integration:P,userAgent:L,retryThrottledRequestMaxTimes:N,retryNetworkErrorMaxTimes:j,contentType:b,multipartChunkSize:r,baseCDN:m,checkForUrlDuplicates:p,saveUrlForRecurrentUploads:i}).then(A=>A.uuid):E)).then(E=>k0(E,{publicKey:v,baseURL:u,jsonpCallback:a,secureSignature:x,secureExpire:y,signal:l,source:T,integration:P,userAgent:L,retryThrottledRequestMaxTimes:N,retryNetworkErrorMaxTimes:j}).then(w=>new Za(w,{baseCDN:m})).then(w=>(c&&c({isComputable:!0,value:1}),w)))}e(Pu,"uploadFileGroup");var oo=class oo{constructor(v){st(this,"_concurrency",1);st(this,"_pending",[]);st(this,"_running",0);st(this,"_resolvers",new Map);st(this,"_rejectors",new Map);this._concurrency=v}_run(){let v=this._concurrency-this._running;for(let t=0;t<v;t++){let u=this._pending.shift();if(!u)return;let x=this._resolvers.get(u),y=this._rejectors.get(u);if(!x||!y)throw new Error("Unexpected behavior: resolver or rejector is undefined");this._running+=1,u().finally(()=>{this._resolvers.delete(u),this._rejectors.delete(u),this._running-=1,this._run()}).then(I=>x(I)).catch(I=>y(I))}}add(v){return new Promise((t,u)=>{this._resolvers.set(v,t),this._rejectors.set(v,u),this._pending.push(v),this._run()})}get pending(){return this._pending.length}get running(){return this._running}set concurrency(v){this._concurrency=v,this._run()}get concurrency(){return this._concurrency}};e(oo,"Queue");var Os=oo;var lo=e(()=>({}),"blockCtx"),co=e(S=>({...lo(),"*currentActivity":null,"*currentActivityParams":{},"*history":[],"*historyBack":null,"*closeModal":()=>{S.set$({"*currentActivity":null,"*modalActive":!1})}}),"activityBlockCtx"),Bs=e(S=>({...co(S),"*commonProgress":0,"*uploadList":[],"*uploadQueue":new Os(1),"*collectionErrors":[],"*collectionState":null,"*groupInfo":null,"*uploadTrigger":new Set,"*secureUploadsManager":null}),"uploaderBlockCtx");var ln={"locale-id":"en","social-source-lang":"en","upload-file":"Upload file","upload-files":"Upload files","choose-file":"Choose file","choose-files":"Choose files","drop-files-here":"Drop files here","select-file-source":"Select file source",selected:"Selected",upload:"Upload","add-more":"Add more",cancel:"Cancel","start-from-cancel":"Cancel",clear:"Clear","camera-shot":"Shot","upload-url":"Import","upload-url-placeholder":"Paste link here","edit-image":"Edit image","edit-detail":"Details",back:"Back",done:"Done",ok:"Ok","remove-from-list":"Remove",no:"No",yes:"Yes","confirm-your-action":"Confirm your action","are-you-sure":"Are you sure?","selected-count":"Selected:","upload-error":"Upload error","validation-error":"Validation error","no-files":"No files selected",browse:"Browse","not-uploaded-yet":"Not uploaded yet...",file__one:"file",file__other:"files",error__one:"error",error__other:"errors","header-uploading":"Uploading {{count}} {{plural:file(count)}}","header-failed":"{{count}} {{plural:error(count)}}","header-succeed":"{{count}} {{plural:file(count)}} uploaded","header-total":"{{count}} {{plural:file(count)}} selected","src-type-local":"From device","src-type-from-url":"From link","src-type-camera":"Camera","src-type-draw":"Draw","src-type-facebook":"Facebook","src-type-dropbox":"Dropbox","src-type-gdrive":"Google Drive","src-type-gphotos":"Google Photos","src-type-instagram":"Instagram","src-type-flickr":"Flickr","src-type-vk":"VK","src-type-evernote":"Evernote","src-type-box":"Box","src-type-onedrive":"Onedrive","src-type-huddle":"Huddle","src-type-other":"Other","caption-from-url":"Import from link","caption-camera":"Camera","caption-draw":"Draw","caption-edit-file":"Edit file","file-no-name":"No name...","toggle-fullscreen":"Toggle fullscreen","toggle-guides":"Toggle guides",rotate:"Rotate","flip-vertical":"Flip vertical","flip-horizontal":"Flip horizontal",apply:"Apply",brightness:"Brightness",contrast:"Contrast",saturation:"Saturation",exposure:"Exposure",gamma:"Gamma",vibrance:"Vibrance",warmth:"Warmth",enhance:"Enhance",original:"Original",resize:"Resize image",crop:"Crop","select-color":"Select color",text:"Text",draw:"Draw","cancel-edit":"Cancel edit","tab-view":"Preview","tab-details":"Details","file-name":"Name","file-size":"Size","cdn-url":"CDN URL","file-size-unknown":"Unknown","camera-permissions-denied":"Camera access denied","camera-permissions-prompt":"Please allow access to the camera","camera-permissions-request":"Request access","files-count-limit-error-title":"Files count limit overflow","files-count-limit-error-too-few":"You\u2019ve chosen {{total}} {{plural:file(total)}}. At least {{min}} {{plural:file(min)}} required.","files-count-limit-error-too-many":"You\u2019ve chosen too many files. {{max}} {{plural:file(max)}} is maximum.","files-max-size-limit-error":"File is too big. Max file size is {{maxFileSize}}.","has-validation-errors":"File validation error ocurred. Please, check your files before upload.","images-only-accepted":"Only image files are accepted.","file-type-not-allowed":"Uploading of these file types is not allowed.","some-files-were-not-uploaded":"Some files were not uploaded.","file-item-edit-button":"Edit","file-item-remove-button":"Remove","a11y-editor-tab-filters":"Filters","a11y-editor-tab-tuning":"Tuning","a11y-editor-tab-crop":"Crop","a11y-activity-header-button-close":"Close",flip:"Flip",mirror:"Mirror","a11y-cloud-editor-apply-filter":"Apply {{name}} filter","a11y-cloud-editor-apply-crop":"Apply {{name}} operation","a11y-cloud-editor-apply-tuning":"Apply {{name}} tuning",finished:"Finished",failed:"Failed",uploading:"Uploading",idle:"Idle","a11y-file-item-status":"File {{fileName}} in status {{status}}"};var Us=new Map,uo=new Map,Lu=e((S,v)=>{Us.has(S)&&console.log(`Locale ${S} is already defined. Overwriting...`),Us.set(S,{...ln,...v})},"defineLocaleSync"),iy=e((S,v)=>{uo.set(S,v)},"defineLocaleAsync"),ho=e((S,v)=>{typeof v=="function"?iy(S,v):Lu(S,v)},"defineLocale"),Nu=e(async S=>{if(!Us.has(S)){if(!uo.has(S))throw new Error(`Locale ${S} is not defined`);let t=await uo.get(S)();Lu(S,t)}return Us.get(S)},"resolveLocaleDefinition");ho("en",ln);var Pi=e(S=>`*l10n/${S}`,"localeStateKey"),ry="en",fo=class fo{constructor(v){st(this,"_blockInstance",null);st(this,"_localeName","");st(this,"_callbacks",new Set);st(this,"_boundBlocks",new Map);this._blockInstance=v;for(let[t,u]of Object.entries(ln))this._blockInstance.add(Pi(t),u,!1);setTimeout(()=>{v.subConfigValue("localeName",async t=>{var y;if(!this._blockInstance||!t)return;this._localeName=t;let u=await Nu(t);if(t!==ry&&this._localeName!==t)return;let x=(y=this._blockInstance.cfg.localeDefinitionOverride)==null?void 0:y[t];for(let[I,l]of Object.entries(u)){let c=x==null?void 0:x[I];this._blockInstance.add(Pi(I),c!=null?c:l,!0);for(let T of this._callbacks)T()}}),v.subConfigValue("localeDefinitionOverride",t=>{var x;if(!t)return;let u=t[this._localeName];if(u)for(let[y,I]of Object.entries(u)){(x=this._blockInstance)==null||x.add(Pi(y),I,!0);for(let l of this._callbacks)l()}})})}onLocaleChange(v){let t=Ne(v,0);return this._callbacks.add(t),()=>{this._callbacks.delete(t)}}bindL10n(v,t,u){var y,I,l;v.$[t]=u(),this._boundBlocks.has(v)||this._boundBlocks.set(v,new Map),(I=(y=this._boundBlocks.get(v))==null?void 0:y.get(t))==null||I();let x=this.onLocaleChange(()=>{v.$[t]=u()});(l=this._boundBlocks.get(v))==null||l.set(t,x)}destroyL10nBindings(v){let t=this._boundBlocks.get(v);if(t){for(let u of t.values())u();this._boundBlocks.delete(v)}}destroy(){this._callbacks.clear()}};e(fo,"LocaleManager");var Hs=fo;function Ru(S,v){[...S.querySelectorAll("[l10n]")].forEach(t=>{let u=t.getAttribute("l10n");if(!u)return;let x="textContent",y=!1;if(u.includes(":")){let c=u.split(":");x=c[0],u=c[1],x.startsWith("@")&&(x=x.slice(1),y=!0)}let I=u;v.has(I)&&v.sub(I,c=>{if(!c)return;v.l10nProcessorSubs.has(I)||v.l10nProcessorSubs.set(I,new Set);let T=v.l10nProcessorSubs.get(I);T==null||T.forEach(N=>{N.remove(),T.delete(N),v.allSubs.delete(N)});let P=Pi(c).replace("*","");v.nodeCtx.has(P)||v.nodeCtx.add(P,c);let L=v.nodeCtx.sub(P,()=>{t[x]=v.l10n(c)});T==null||T.add(L),v.allSubs.add(L),t.removeAttribute("l10n")});let l=Pi(u);v.has(l)||v.add(l,""),v.sub(l,()=>{u=u,y?t.setAttribute(x,v.l10n(u)):t[x]=v.l10n(u)}),t.removeAttribute("l10n")})}e(Ru,"l10nProcessor");var ii=e(S=>`*cfg/${S}`,"sharedConfigKey");var ny={button:["toolbar"],checkbox:["toolbar"],menuitem:["menu","menubar"],option:["listbox"],tab:["tablist"]};function cn(S,v){v.tabIndex=0,v.focus(),S.tabIndex=-1}e(cn,"focus");function go(S){let v=S.role||S.type||S.tagName;if(!v)return null;let t=ny[v.toLowerCase()];if(!t)return null;for(let u of t){let x=S.closest(`[role=${u}]`);if(x)return x}}e(go,"findGroupNodeByEventTarget");function vo(S,v){return v.role==="toolbar"?sy(v):v.querySelectorAll(`[role=${S.role}]`)}e(vo,"getItems");function sy(S){return[...S.querySelectorAll("*")].filter(t=>t.role==="button"||t.type==="button"||t.role==="checkbox"||t.type==="checkbox")}e(sy,"getToolbarItems");function ay(S){let v=S.getAttribute("aria-orientation");if(v==="vertical")return!1;if(v==="horizontal")return!0;let t=S.role;return t==="menubar"||t==="tablist"||t==="toolbar"}e(ay,"isHorizontalOrientation");function ju(S){return v=>{let t=!1,u=(S==null?void 0:S.searchDelayMs)||300,x=0,y="";function I(L){let N=go(L.target);if(!N){l();return}let j=vo(L.target,N),b=Array.from(j).indexOf(L.target),r="ArrowDown",m="ArrowUp";if(ay(N)&&(v.document.dir==="rtl"?(r="ArrowLeft",m="ArrowRight"):(r="ArrowRight",m="ArrowLeft")),L.key===r)L.preventDefault(),cn(L.target,j[b+1]||j[0]);else if(L.key===m)L.preventDefault(),cn(L.target,j[b-1]||j[j.length-1]);else if(L.key==="Home")L.preventDefault(),cn(L.target,j[0]);else if(L.key==="End")L.preventDefault(),cn(L.target,j[j.length-1]);else if(L.key.length===1&&N.role!=="tablist"){let p=Date.now();p-x<=u?y+=L.key.toLowerCase():y=L.key.toLowerCase(),x=p;let i=Array.from(j).find(a=>{var n,f,_;return(_=(f=(n=a.textContent)==null?void 0:n.trim())==null?void 0:f.toLowerCase())==null?void 0:_.startsWith(y)});i&&(L.preventDefault(),cn(L.target,i))}}e(I,"keyDown");function l(){t=!1,v.removeEventListener("keydown",I)}e(l,"stop");function c(L){let N=go(L.target);if(N){t||(t=!0,v.addEventListener("keydown",I));let j=vo(L.target,N);for(let b of j)b!==L.target&&b.setAttribute("tabindex",-1)}else t&&l()}e(c,"focusIn");function T(L){(!L.relatedTarget||L.relatedTarget===v.document)&&l()}e(T,"focusOut");function P(L){let N=go(L.target);if(N){let j=vo(L.target,N);for(let b of j)b!==L.target&&b.setAttribute("tabindex",-1);L.target.setAttribute("tabindex",0)}}return e(P,"click"),v.addEventListener("click",P),v.addEventListener("focusin",c),v.addEventListener("focusout",T),()=>{l(),v.removeEventListener("click",P),v.removeEventListener("focusin",c),v.removeEventListener("focusout",T)}}}e(ju,"focusGroupKeyUX");function Fu(){return S=>{let v,t;function u(y){if(y.target.getAttribute("aria-hidden")==="true"){v=y.target,v.setAttribute("aria-hidden","false"),t=v.hidden,t&&(v.hidden=!1);let I=y.target.querySelector('a, button, select, textarea, input:not([type=radio]), [type=radio]:checked, [tabindex]:not([tabindex="-1"])');I&&(I.tabIndex=0)}}e(u,"jump");function x(y){v&&v.contains(y.target)&&(!y.relatedTarget||!v.contains(y.relatedTarget))&&(y.target.tabIndex=-1,v.setAttribute("aria-hidden","true"),t&&(v.hidden=!0),v=null)}return e(x,"focusOut"),S.addEventListener("keyuxJump",u),S.addEventListener("focusout",x),()=>{S.removeEventListener("keyuxJump",u),S.removeEventListener("focusout",x)}}}e(Fu,"hiddenKeyUX");function zu(){return S=>{let v=[];function t(T){let P=S.document.activeElement;P&&P!==S.document.body&&v.push(new WeakRef(P)),T.focus({focusVisible:!0})}e(t,"focus");function u(){let T=v.pop();if(!T){S.document.activeElement.blur();return}let P=T.deref();P&&P.isConnected?P.focus():u()}e(u,"back");let x=0,y;function I(T){clearInterval(y);let P=T.getAttribute("aria-controls");P&&(y=setInterval(()=>{if(x++>50){clearInterval(y);return}let L=S.document.getElementById(P);if(L){let N=L.querySelector('a, button, select, textarea, input:not([type=radio]), [type=radio]:checked, [tabindex]:not([tabindex="-1"])');N&&(clearInterval(y),L.dispatchEvent(new S.CustomEvent("keyuxJump",{bubbles:!0})),t(N))}},50))}e(I,"jump");function l(T){T.clientX===0&&T.clientY===0&&I(T.target)}e(l,"click");function c(T){T.target.tagName==="INPUT"&&T.key==="Enter"&&I(T.target),T.key==="Escape"&&u()}return e(c,"keyDown"),S.addEventListener("click",l),S.addEventListener("keydown",c),()=>{S.removeEventListener("click",l),S.removeEventListener("keydown",c)}}}e(zu,"jumpKeyUX");function Bu(S){let v,t=S.split(" ");function u(){v&&v.classList.remove(...t)}e(u,"keyUp");function x(y){y.clientX===0&&y.clientY===0&&(u(),y.target.classList.add(...t),v=y.target)}return e(x,"click"),y=>(y.addEventListener("keyup",u),y.addEventListener("click",x),()=>{y.removeEventListener("keyup",u),y.removeEventListener("click",x)})}e(Bu,"pressKeyUX");function Uu(S,v){let t=v.map(u=>u(S));return()=>{t.forEach(u=>u())}}e(Uu,"startKeyUX");var mo=class mo{constructor(){st(this,"_listeners",new Map);st(this,"_scope",[])}addEventListener(v,t){let u=e(x=>{let y=x.target;y&&this._scope.some(I=>I===x.target||I.contains(y))&&t(x)},"wrappedListener");this._listeners.set(t,u),window.addEventListener(v,u)}removeEventListener(v,t){let u=this._listeners.get(t);u&&window.removeEventListener(v,u),this._listeners.delete(t)}get CustomEvent(){return window.CustomEvent}get document(){return window.document}get navigator(){return window.navigator}registerScope(v){this._scope.push(v)}destroy(){this._scope=[],this._listeners.forEach((v,t)=>{window.removeEventListener("keydown",v),window.removeEventListener("keyup",v),this._listeners.delete(t)})}};e(mo,"ScopedMinimalWindow");var po=mo,yo=class yo{constructor(){st(this,"_destroyKeyUX");st(this,"_scopedWindow");this._scopedWindow=new po,this._destroyKeyUX=Uu(this._scopedWindow,[ju(),Bu("is-pressed"),zu(),Fu()])}registerBlock(v){this._scopedWindow.registerScope(v)}destroy(){var v;(v=this._destroyKeyUX)==null||v.call(this),this._scopedWindow.destroy()}};e(yo,"A11y");var Ws=yo;var oy="uc-",un=class un extends Qi{constructor(){super();st(this,"requireCtxName",!1);st(this,"activityType",null);st(this,"init$",lo());this.l10nProcessorSubs=new Map,this.addTemplateProcessor(Ru)}l10n(t,u={}){if(!t)return"";let x=this.$[Pi(t)]||t,y=bu(x);for(let l of y)u[l.variable]=this.pluralize(l.pluralKey,Number(u[l.countVariable]));return an(x,u)}pluralize(t,u){let x=this.l10n("locale-id")||"en",y=As(x,u);return this.l10n(`${t}__${y}`)}bindL10n(t,u){var x;(x=this.localeManager)==null||x.bindL10n(this,t,u)}emit(t,u,x){let y=this.has("*eventEmitter")&&this.$["*eventEmitter"];y&&y.emit(t,u,x)}hasBlockInCtx(t){for(let u of this.blocksRegistry)if(t(u))return!0;return!1}setOrAddState(t,u){this.add$({[t]:u},!0)}connectedCallback(){this.constructor.styleAttrs.forEach(u=>{this.setAttribute(u,"")}),this.hasAttribute("retpl")&&(this.constructor.template=null,this.processInnerHtml=!0),this.requireCtxName?Cu({element:this,attribute:"ctx-name",onSuccess:()=>{super.connectedCallback()},onTimeout:()=>{console.error("Attribute `ctx-name` is required and it is not set.")}}):super.connectedCallback(),sn.registerClient(this)}disconnectedCallback(){super.disconnectedCallback(),sn.unregisterClient(this)}initCallback(){this.has("*blocksRegistry")||this.add("*blocksRegistry",new Set),this.$["*blocksRegistry"].add(this),this.has("*eventEmitter")||this.add("*eventEmitter",new Ts(this.debugPrint.bind(this))),this.has("*localeManager")||this.add("*localeManager",new Hs(this)),this.has("*a11y")||this.add("*a11y",new Ws),this.sub(Pi("locale-id"),u=>{let x=pu(u);this.style.direction=x==="ltr"?"":x})}get localeManager(){return this.has("*localeManager")?this.$["*localeManager"]:null}get a11y(){return this.has("*a11y")?this.$["*a11y"]:null}get blocksRegistry(){return this.$["*blocksRegistry"]}destroyCallback(){var u;super.destroyCallback();let t=this.blocksRegistry;t==null||t.delete(this),(u=this.localeManager)==null||u.destroyL10nBindings(this),this.l10nProcessorSubs=new Map,ce.deleteCtx(this),(t==null?void 0:t.size)===0&&setTimeout(()=>{this.destroyCtxCallback()},0)}destroyCtxCallback(){var t;ce.deleteCtx(this.ctxName),(t=this.localeManager)==null||t.destroy()}async proxyUrl(t){if(this.cfg.secureDeliveryProxy&&this.cfg.secureDeliveryProxyUrlResolver&&console.warn("Both secureDeliveryProxy and secureDeliveryProxyUrlResolver are set. The secureDeliveryProxyUrlResolver will be used."),this.cfg.secureDeliveryProxyUrlResolver)try{return await this.cfg.secureDeliveryProxyUrlResolver(t,{uuid:ws(t),cdnUrlModifiers:Ua(t),fileName:Es(t)})}catch(u){return console.error("Failed to resolve secure delivery proxy URL. Falling back to the default URL.",u),t}return this.cfg.secureDeliveryProxy?an(this.cfg.secureDeliveryProxy,{previewUrl:t},{transform:u=>window.encodeURIComponent(u)}):t}get cfg(){if(!this.__cfgProxy){let t=Object.create(null);this.__cfgProxy=new Proxy(t,{set:(u,x,y)=>{if(typeof x!="string")return!1;let I=ii(x);return this.has(I)||this.add(I,di[x]),this.$[I]=y,!0},get:(u,x)=>{let y=ii(x);return this.has(y)||this.add(y,di[x]),this.$[ii(x)]}})}return this.__cfgProxy}subConfigValue(t,u){let x=ii(t);this.has(x)||this.add(x,di[t]),this.sub(x,u)}debugPrint(...t){if(!this.cfg.debug)return;let u=t;if(typeof(t==null?void 0:t[0])=="function"){let x=t[0];u=x()}console.log(`[${this.ctxName}]`,...u)}static reg(t){if(!t){super.reg();return}t.startsWith(oy)&&super.reg(t)}};e(un,"Block"),st(un,"StateConsumerScope",null),st(un,"styleAttrs",[]);var ne=un;var Hu="<svg width='0' height='0' style='position:absolute'><symbol viewBox='0 0 24 24' id='uc-icon-about' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11.152 14.12v.1h1.523v-.1c.007-.409.053-.752.138-1.028.086-.277.22-.517.405-.72.188-.202.434-.397.735-.586.32-.191.593-.412.82-.66.232-.249.41-.531.533-.847.125-.32.187-.678.187-1.076 0-.579-.137-1.085-.41-1.518a2.717 2.717 0 0 0-1.14-1.018c-.49-.245-1.062-.367-1.715-.367-.597 0-1.142.114-1.636.34-.49.228-.884.564-1.182 1.008-.299.44-.46.98-.485 1.619h1.62c.024-.377.118-.684.282-.922a1.48 1.48 0 0 1 .617-.532c.25-.114.51-.17.784-.17.301 0 .575.063.82.191.248.124.447.302.597.533.149.23.223.504.223.82 0 .263-.05.502-.149.72a1.91 1.91 0 0 1-.405.574 3.48 3.48 0 0 1-.575.453 4.22 4.22 0 0 0-.847.66c-.234.242-.415.558-.543.949-.125.39-.19.916-.197 1.577Zm.053 3.03c.21.206.46.31.75.31.196 0 .374-.049.534-.144a1.1 1.1 0 0 0 .383-.384c.1-.163.15-.343.15-.538a1 1 0 0 0-.32-.746 1.019 1.019 0 0 0-.746-.314c-.291 0-.542.105-.751.314-.21.206-.314.455-.314.746 0 .295.104.547.314.756ZM24 12c0 6.627-5.373 12-12 12S0 18.627 0 12 5.373 0 12 0s12 5.373 12 12Zm-1.5 0c0 5.799-4.701 10.5-10.5 10.5S1.5 17.799 1.5 12 6.201 1.5 12 1.5 22.5 6.201 22.5 12Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-add' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M12.75 21a.75.75 0 0 1-1.5 0v-8.25H3a.75.75 0 0 1 0-1.5h8.25V3a.75.75 0 0 1 1.5 0v8.25H21a.75.75 0 0 1 0 1.5h-8.25V21Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-arrow-down' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11.5 23.03a.75.75 0 0 0 .999 0l9.29-8.276a.75.75 0 0 0-.998-1.12l-8.042 7.164V1.53a.75.75 0 0 0-1.5 0v19.267l-8.04-7.163a.75.75 0 0 0-.998 1.12z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-back' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M20.251 12a.75.75 0 0 1-.75.75H6.067l5.72 5.85a.75.75 0 1 1-1.072 1.05L4.136 12.92a1.292 1.292 0 0 1 0-1.842l6.579-6.728a.75.75 0 1 1 1.072 1.048l-5.72 5.851H19.5a.75.75 0 0 1 .75.75Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-badge-error' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M13.6 18.4a1.6 1.6 0 1 1-3.2 0 1.6 1.6 0 0 1 3.2 0zM12 4.5A1.5 1.5 0 0 1 13.5 6v7a1.5 1.5 0 0 1-3 0V6A1.5 1.5 0 0 1 12 4.5z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-badge-success' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='m10.5 18.204 7.6-8.183a1.5 1.5 0 0 0-2.2-2.042l-5.4 5.817-2.4-2.586a1.5 1.5 0 1 0-2.2 2.041l4.6 4.953Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-box' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M1.01 4.148a.75.75 0 0 1 .75.75v4.348a4.437 4.437 0 0 1 2.988-1.153c1.734 0 3.23.992 3.978 2.438a4.478 4.478 0 0 1 3.978-2.438c2.49 0 4.488 2.044 4.488 4.543 0 2.5-1.999 4.544-4.488 4.544a4.478 4.478 0 0 1-3.978-2.438 4.478 4.478 0 0 1-3.978 2.438C2.26 17.18.26 15.135.26 12.636V4.898a.75.75 0 0 1 .75-.75Zm.75 8.488c0 1.692 1.348 3.044 2.988 3.044s2.989-1.352 2.989-3.044c0-1.691-1.349-3.043-2.989-3.043S1.76 10.945 1.76 12.636Zm10.944-3.043c-1.64 0-2.988 1.352-2.988 3.043 0 1.692 1.348 3.044 2.988 3.044s2.988-1.352 2.988-3.044c0-1.69-1.348-3.043-2.988-3.043Zm4.328-1.23a.75.75 0 0 1 1.052.128l2.333 2.983 2.333-2.983a.75.75 0 0 1 1.181.924l-2.562 3.277 2.562 3.276a.75.75 0 1 1-1.181.924l-2.333-2.983-2.333 2.983a.75.75 0 1 1-1.181-.924l2.562-3.276-2.562-3.277a.75.75 0 0 1 .129-1.052Z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-brightness' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M15 10a5 5 0 0 1-5 5m5-5a5 5 0 0 0-5-5m5 5h-5m0 5a5 5 0 0 1 0-10m0 10V5m0 15v-3M2.93 2.929 5.05 5.05M0 10h3m-.07 7.071 2.12-2.121M10 0v3m7.07 14.071-2.12-2.121M20 10h-3m.07-7.071L14.95 5.05m-.626 2.45H10m4.324 5H10'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-camera' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M7.65 2.55a.75.75 0 0 1 .6-.3h7.5a.75.75 0 0 1 .6.3l2.025 2.7H21a3 3 0 0 1 3 3v10.5a3 3 0 0 1-3 3H3a3 3 0 0 1-3-3V8.25a3 3 0 0 1 3-3h2.625zm.975 1.2L6.6 6.45a.75.75 0 0 1-.6.3H3a1.5 1.5 0 0 0-1.5 1.5v10.5a1.5 1.5 0 0 0 1.5 1.5h18a1.5 1.5 0 0 0 1.5-1.5V8.25a1.5 1.5 0 0 0-1.5-1.5h-3a.75.75 0 0 1-.6-.3l-2.025-2.7zm3.375 6a3.375 3.375 0 1 0 0 6.75 3.375 3.375 0 0 0 0-6.75zm-4.875 3.375a4.875 4.875 0 1 1 9.75 0 4.875 4.875 0 0 1-9.75 0z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-close' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M4.604 4.604a.75.75 0 0 1 1.06 0L12 10.939l6.335-6.335a.75.75 0 1 1 1.061 1.06L13.061 12l6.335 6.335a.75.75 0 1 1-1.06 1.061L12 13.061l-6.335 6.335a.75.75 0 0 1-1.061-1.06L10.939 12 4.604 5.665a.75.75 0 0 1 0-1.061z'/></symbol><symbol fill='currentColor' viewBox='0 0 20 20' id='uc-icon-closeMax' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' d='M8.232 10 3.585 5.353l1.768-1.768L10 8.232l4.648-4.647 1.767 1.768L11.768 10l4.647 4.648-1.767 1.767L10 11.768l-4.647 4.647-1.768-1.767L8.232 10Z' clip-rule='evenodd'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-collapse' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M3.116 12a.75.75 0 0 1 .75-.75h16.268a.75.75 0 0 1 0 1.5H3.866a.75.75 0 0 1-.75-.75Z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-contrast' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M2 10a8 8 0 1 0 16 0 8 8 0 1 0-16 0m8-8v16m8-8h-8m7.598 2.5H10m6.24 2.5H10m7.6-7.5H10M16.242 5H10'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-crop' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M20 14H7.005C6.45 14 6 13.55 6 12.995V0M0 6h13.067c.515 0 .933.418.933.933V20M14.5.4 13 2l1.5 1.6M13 2h2a3 3 0 0 1 3 3v2M5.5 19.6 7 18l-1.5-1.6M7 18H5a3 3 0 0 1-3-3v-2'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-default' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11.501.392a.75.75 0 0 1 .998 0l6.704 5.972a.75.75 0 0 1-.998 1.12l-5.455-4.86v13.439a.75.75 0 0 1-1.5 0V2.625l-5.454 4.86a.75.75 0 1 1-.998-1.12zM.857 16.73a.75.75 0 0 1 .75.75v4.914h20.786v-4.914a.75.75 0 0 1 1.5 0v5.664a.75.75 0 0 1-.75.75H.857a.75.75 0 0 1-.75-.75v-5.664a.75.75 0 0 1 .75-.75z'/></symbol><symbol fill='currentColor' viewBox='0 0 20 20' id='uc-icon-done' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' d='m18.057 6.333-9.365 9.125a1.25 1.25 0 0 1-1.768-.023L1.92 10.296l1.791-1.744 4.132 4.243 8.47-8.253 1.744 1.79Z' clip-rule='evenodd'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-dropbox' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M6.019 1.92a.75.75 0 0 1 .806 0L12 5.219l5.176-3.297a.75.75 0 0 1 .806 0l5.577 3.553a.75.75 0 0 1 0 1.265l-4.574 2.914 4.574 2.914a.75.75 0 0 1 0 1.265l-5.577 3.554a.75.75 0 0 1-.806 0L12 14.089l-5.175 3.297a.75.75 0 0 1-.806 0L.44 13.833a.75.75 0 0 1 0-1.266l4.575-2.914L.44 6.74a.75.75 0 0 1 0-1.265zm.403 8.616L2.24 13.2l4.182 2.664 4.181-2.664zm6.975 2.664 4.182 2.664L21.76 13.2l-4.181-2.664zm2.776-3.547L12 12.311 7.828 9.653 12 6.995zm1.406-.882 4.181-2.664-4.181-2.664-4.182 2.664zm-6.976-2.664L6.422 3.443 2.24 6.107 6.422 8.77zM5.791 18.544a.75.75 0 0 1 1.035-.23l5.175 3.297 5.175-3.297a.75.75 0 1 1 .806 1.265l-5.578 3.554a.75.75 0 0 1-.806 0L6.02 19.579a.75.75 0 0 1-.23-1.035z'/></symbol><symbol fill='currentColor' viewBox='0 0 25 24' id='uc-icon-edit-file' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' d='M18.558 2.804a.78.78 0 0 0-.557.235l-.008.007-2.472 2.46 3.847 3.848 2.46-2.473.004-.003a.78.78 0 0 0 0-1.108l-.004-.003-2.712-2.728a.78.78 0 0 0-.558-.235Zm-.248 7.613-3.852-3.852-8.93 8.887-1.516 5.41 5.41-1.515 8.888-8.93Zm-.636-8.934a2.28 2.28 0 0 1 2.512.505l2.702 2.717.002.002a2.278 2.278 0 0 1 0 3.234l-.002.002-12.541 12.602a.75.75 0 0 1-.33.193l-6.884 1.928a.75.75 0 0 1-.925-.924l1.928-6.885a.75.75 0 0 1 .193-.33l12.603-12.54a2.28 2.28 0 0 1 .742-.504Z' clip-rule='evenodd'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-edit-file' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M18.558 2.804a.78.78 0 0 0-.557.235l-.008.007-2.472 2.46 3.847 3.848 2.46-2.473.004-.003a.78.78 0 0 0 0-1.108l-.004-.003-2.712-2.728a.78.78 0 0 0-.558-.235Zm-.248 7.613-3.852-3.852-8.93 8.887-1.516 5.41 5.41-1.515 8.888-8.93Zm-.636-8.934a2.28 2.28 0 0 1 2.512.505l2.702 2.717.002.002a2.278 2.278 0 0 1 0 3.234l-.002.002-12.541 12.602a.75.75 0 0 1-.33.193l-6.884 1.928a.75.75 0 0 1-.925-.924l1.928-6.885a.75.75 0 0 1 .193-.33l12.603-12.54a2.28 2.28 0 0 1 .742-.504Z' clip-rule='evenodd'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-enhance' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M19 13h-2m0 0a4 4 0 0 1-4-4m4 4a4 4 0 0 0-4 4m0-8V7m0 2a4 4 0 0 1-4 4m-2 0h2m0 0a4 4 0 0 1 4 4m0 0v2M8 8.5H6.5m0 0a2 2 0 0 1-2-2m2 2a2 2 0 0 0-2 2m0-4V5m0 1.5a2 2 0 0 1-2 2M1 8.5h1.5m0 0a2 2 0 0 1 2 2m0 0V12M12 3h-1m0 0a1 1 0 0 1-1-1m1 1a1 1 0 0 0-1 1m0-2V1m0 1a1 1 0 0 1-1 1M8 3h1m0 0a1 1 0 0 1 1 1m0 0v1'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-error' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M13 13h-2V7h2m0 10h-2v-2h2M12 2A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-evernote' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M9.804 2.27v-.048c.055-.263.313-.562.85-.562h.44c.142 0 .325.014.526.033.066.009.124.023.267.06l.13.032h.002c.319.079.515.275.644.482a1.461 1.461 0 0 1 .16.356l.004.012a.75.75 0 0 0 .603.577l1.191.207a1988.512 1988.512 0 0 0 2.332.402c.512.083 1.1.178 1.665.442.64.3 1.19.795 1.376 1.77.548 2.931.657 5.829.621 8a39.233 39.233 0 0 1-.125 2.602 17.518 17.518 0 0 1-.092.849.735.735 0 0 0-.024.112c-.378 2.705-1.269 3.796-2.04 4.27-.746.457-1.53.451-2.217.447h-.192c-.46 0-1.073-.23-1.581-.635-.518-.412-.763-.87-.763-1.217 0-.45.188-.688.355-.786.161-.095.436-.137.796.087a.75.75 0 1 0 .792-1.274c-.766-.476-1.64-.52-2.345-.108-.7.409-1.098 1.188-1.098 2.08 0 .996.634 1.84 1.329 2.392.704.56 1.638.96 2.515.96l.185.002c.667.009 1.874.025 3.007-.67 1.283-.786 2.314-2.358 2.733-5.276a4.213 4.213 0 0 0 .056-.335c.023-.184.051-.445.079-.772.055-.655.111-1.585.13-2.704.037-2.234-.074-5.239-.647-8.301v-.002c-.294-1.544-1.233-2.391-2.215-2.85-.777-.363-1.623-.496-2.129-.576a8.872 8.872 0 0 1-.25-.041l-.006-.001-1.99-.345-.761-.132a2.93 2.93 0 0 0-.182-.338A2.532 2.532 0 0 0 12.379.329l-.091-.023a3.967 3.967 0 0 0-.493-.103L11.769.2a7.846 7.846 0 0 0-.675-.04h-.44c-.733 0-1.368.284-1.795.742L2.416 7.431c-.468.428-.751 1.071-.751 1.81 0 .02 0 .041.003.062l.003.034c.017.21.038.468.096.796.107.715.275 1.47.391 1.994.029.13.055.245.075.342l.002.008c.258 1.141.641 1.94.978 2.466.168.263.323.456.444.589a2.808 2.808 0 0 0 .192.194c1.536 1.562 3.713 2.196 5.731 2.08.13-.005.35-.032.537-.073a2.627 2.627 0 0 0 .652-.24c.425-.26.75-.661.992-1.046.184-.294.342-.61.473-.915a3.8 3.8 0 0 0 .627.493 5.022 5.022 0 0 0 1.97.709l.023.002.018.003.11.016c.088.014.205.035.325.058l.056.014c.088.022.164.04.235.061a1.736 1.736 0 0 1 .145.048l.03.014c.765.34 1.302 1.09 1.302 1.871a.75.75 0 0 0 1.5 0c0-1.456-.964-2.69-2.18-3.235a3.595 3.595 0 0 0-.679-.217l-.063-.015a10.616 10.616 0 0 0-.606-.105l-.02-.003-.03-.003h-.002a3.542 3.542 0 0 1-1.331-.485c-.471-.298-.788-.692-.828-1.234a.75.75 0 0 0-1.48-.106l-.001.003-.004.017a8.23 8.23 0 0 1-.092.352 9.963 9.963 0 0 1-.298.892c-.132.34-.29.68-.47.966-.174.276-.339.454-.478.549a1.178 1.178 0 0 1-.221.072 1.949 1.949 0 0 1-.241.036h-.013l-.032.002c-1.684.1-3.423-.437-4.604-1.65a.746.746 0 0 0-.053-.05L4.84 14.6a1.348 1.348 0 0 1-.07-.073 2.99 2.99 0 0 1-.293-.392c-.242-.379-.558-1.014-.778-1.985a54.1 54.1 0 0 0-.083-.376 27.494 27.494 0 0 1-.367-1.872l-.003-.02a6.791 6.791 0 0 1-.08-.67c.004-.277.086-.475.2-.609l.067-.067a.63.63 0 0 1 .292-.145h.05c.18 0 1.095.055 2.013.115l1.207.08.534.037a.747.747 0 0 0 .052.002c.782 0 1.349-.206 1.759-.585l.005-.005c.553-.52.622-1.225.622-1.76V6.24l-.026-.565A774.97 774.97 0 0 1 9.885 4.4c-.042-.961-.081-1.939-.081-2.13ZM4.995 6.953a251.126 251.126 0 0 1 2.102.137l.508.035c.48-.004.646-.122.715-.185.07-.068.146-.209.147-.649l-.024-.548a791.69 791.69 0 0 1-.095-2.187L4.995 6.953Zm16.122 9.996Zm-5.479-5.323a.75.75 0 0 0 1.014.31 2.04 2.04 0 0 1 .304-.089 1.84 1.84 0 0 1 .544-.039c.215.023.321.06.37.085.033.016.039.026.047.04a.75.75 0 0 0 1.289-.767c-.337-.567-.906-.783-1.552-.85a3.334 3.334 0 0 0-1.002.062c-.27.056-.531.14-.705.234a.75.75 0 0 0-.31 1.014Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-expand' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='m12 8.337-8.47 8.47a.75.75 0 0 1-1.06-1.06l8.605-8.606a1.29 1.29 0 0 1 1.85 0l8.605 8.605a.75.75 0 1 1-1.06 1.06L12 8.338Z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-exposure' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M10 20v-3M2.93 2.929 5.05 5.05M0 10h3m-.07 7.071 2.12-2.121M10 0v3m7.07 14.071-2.12-2.121M20 10h-3m.07-7.071L14.95 5.05M5 10a5 5 0 1 0 10 0 5 5 0 1 0-10 0'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-external-source-placeholder' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M6.341 3.27a10.5 10.5 0 0 1 5.834-1.77.75.75 0 0 0 0-1.5 12 12 0 1 0 12 12 .75.75 0 0 0-1.5 0A10.5 10.5 0 1 1 6.34 3.27Zm14.145 1.48a.75.75 0 1 0-1.06-1.062L9.925 13.19V7.95a.75.75 0 1 0-1.5 0V15c0 .414.336.75.75.75h7.05a.75.75 0 0 0 0-1.5h-5.24l9.501-9.5Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-facebook' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M12 1.5C6.201 1.5 1.5 6.201 1.5 12c0 4.943 3.416 9.089 8.016 10.204v-6.108H7.383a.75.75 0 0 1-.75-.75v-3.281a.75.75 0 0 1 .75-.75h2.133V9.393c0-.958.225-2.511 1.38-3.65 1.194-1.177 3.174-1.718 6.254-1.056a.75.75 0 0 1 .592.733v2.754a.75.75 0 0 1-.75.75c-.692 0-1.203.026-1.584.082-.387.057-.578.137-.675.202-.109.073-.237.205-.237 1.029v1.078h2.39a.75.75 0 0 1 .742.866l-.516 3.281a.75.75 0 0 1-.74.634h-1.876v6.106C19.09 21.082 22.5 16.939 22.5 12c0-5.799-4.701-10.5-10.5-10.5zM0 12C0 5.373 5.373 0 12 0s12 5.373 12 12c0 5.995-4.395 10.961-10.138 11.856a.75.75 0 0 1-.866-.74v-7.77a.75.75 0 0 1 .75-.75h1.984l.28-1.781h-2.264a.75.75 0 0 1-.75-.75v-1.828c0-.829.089-1.729.9-2.274.363-.244.807-.37 1.293-.441a9.623 9.623 0 0 1 1.053-.086V6.04c-2.41-.405-3.645.132-4.293.771-.737.728-.933 1.793-.933 2.582v2.672a.75.75 0 0 1-.75.75H8.133v1.78h2.133a.75.75 0 0 1 .75.75v7.772a.75.75 0 0 1-.865.741C4.4 22.968 0 18 0 12z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-file' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M2.895 1.201c0-.473.383-.857.857-.857h8.4c.227 0 .445.09.606.251l8.4 8.4c.16.16.25.379.25.606v13.2a.857.857 0 0 1-.856.857h-16.8a.857.857 0 0 1-.857-.857zm1.714.857v19.886h15.085V10.458h-7.542a.857.857 0 0 1-.858-.857V2.058zm8.4 1.213 5.473 5.473H13.01z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-filters' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M4.5 6.5a5.5 5.5 0 1 0 11 0 5.5 5.5 0 1 0-11 0m-3.5 6a5.5 5.5 0 1 0 11 0 5.5 5.5 0 1 0-11 0m7 0a5.5 5.5 0 1 0 11 0 5.5 5.5 0 1 0-11 0'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-flickr' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M5.959 7.926c-2.298 0-4.14 1.834-4.14 4.073 0 2.241 1.842 4.075 4.14 4.075 2.302 0 4.145-1.834 4.145-4.075 0-2.238-1.843-4.073-4.145-4.073Zm-5.64 4.073c0-3.086 2.533-5.573 5.64-5.573 3.11 0 5.645 2.486 5.645 5.573 0 3.089-2.535 5.575-5.645 5.575-3.107 0-5.64-2.487-5.64-5.575Zm18.07-4.073c-2.301 0-4.144 1.835-4.144 4.073 0 2.24 1.843 4.075 4.145 4.075 2.299 0 4.141-1.834 4.141-4.075 0-2.239-1.842-4.073-4.141-4.073Zm-5.644 4.073c0-3.087 2.535-5.573 5.645-5.573 3.108 0 5.641 2.487 5.641 5.573 0 3.088-2.533 5.575-5.641 5.575-3.11 0-5.645-2.486-5.645-5.575Z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-flip' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M19.6 5 18 3.5 16.4 5m3.2 10L18 16.5 16.4 15M18 3.523v12.954M3.3 8.5h10.654c.301 0 .415-.395.159-.554L3.459 1.286A.3.3 0 0 0 3 1.542V8.2a.3.3 0 0 0 .3.3zm0 3h10.654c.301 0 .415.395.159.554l-10.654 6.66A.3.3 0 0 1 3 18.458v-6.66a.3.3 0 0 1 .3-.3z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-gamma' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M17 3C9 6 2.5 11.5 2.5 17.5m0 0h1m-1 0v-1m14 1h1m-3 0h1m-3 0h1m-3 0h1m-3 0h1m-3 0h1m-3 0h1m-3-14v-1m0 3v-1m0 3v-1m0 3v-1m0 3v-1m0 3v-1m0 3v-1'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-gdrive' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M7.736 1.818a.75.75 0 0 1 .647-.37h7.587a.75.75 0 0 1 .655.383l7.233 12.946a.75.75 0 0 1-.003.737l-3.794 6.66a.75.75 0 0 1-.651.378H4.59a.75.75 0 0 1-.651-.378l-3.794-6.66a.75.75 0 0 1 .005-.75zm.64 1.876L1.663 15.148l2.93 5.145 6.655-11.581zm3.736 6.526-2.398 4.173H14.5zm4.116 4.173h5.697L15.53 2.947H9.677zm5.685 1.5H8.852l-2.966 5.16h13.088z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-gphotos' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M12.51 0c-.702 0-1.272.57-1.272 1.273V7.35A6.381 6.381 0 0 0 0 11.489c0 .703.57 1.273 1.273 1.273H7.35A6.381 6.381 0 0 0 11.488 24c.704 0 1.274-.57 1.274-1.273V16.65A6.381 6.381 0 0 0 24 12.51c0-.703-.57-1.273-1.273-1.273H16.65A6.381 6.381 0 0 0 12.511 0Zm.252 11.232V1.53a4.857 4.857 0 0 1 0 9.702Zm-1.53.006H1.53a4.857 4.857 0 0 1 9.702 0Zm1.536 1.524a4.857 4.857 0 0 0 9.702 0h-9.702Zm-6.136 4.857c0-2.598 2.04-4.72 4.606-4.85v9.7a4.857 4.857 0 0 1-4.606-4.85Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-huddle' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M6.204 2.002c-.252.23-.357.486-.357.67V21.07c0 .15.084.505.313.812.208.28.499.477.929.477.519 0 .796-.174.956-.365.178-.212.286-.535.286-.924v-.013l.117-6.58c.004-1.725 1.419-3.883 3.867-3.883 1.33 0 2.332.581 2.987 1.364.637.762.95 1.717.95 2.526v6.47c0 .392.11.751.305.995.175.22.468.41 1.008.41.52 0 .816-.198 1.002-.437.207-.266.31-.633.31-.969V14.04c0-2.81-1.943-5.108-4.136-5.422a5.971 5.971 0 0 0-3.183.41c-.912.393-1.538.96-1.81 1.489a.75.75 0 0 1-1.417-.344v-7.5c0-.587-.47-1.031-1.242-1.031-.315 0-.638.136-.885.36ZM5.194.892A2.844 2.844 0 0 1 7.09.142c1.328 0 2.742.867 2.742 2.53v5.607a6.358 6.358 0 0 1 1.133-.629 7.47 7.47 0 0 1 3.989-.516c3.056.436 5.425 3.482 5.425 6.906v6.914c0 .602-.177 1.313-.627 1.89-.47.605-1.204 1.016-2.186 1.016-.96 0-1.698-.37-2.179-.973-.46-.575-.633-1.294-.633-1.933v-6.469c0-.456-.19-1.071-.602-1.563-.394-.471-.986-.827-1.836-.827-1.447 0-2.367 1.304-2.367 2.39v.014l-.117 6.58c-.001.64-.177 1.333-.637 1.881-.48.57-1.2.9-2.105.9-.995 0-1.7-.5-2.132-1.081-.41-.552-.61-1.217-.61-1.708V2.672c0-.707.366-1.341.847-1.78Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-info' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11 9h2V7h-2m1 13c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-18A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2m-1 15h2v-6h-2v6Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-instagram' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M6.225 12a5.775 5.775 0 1 1 11.55 0 5.775 5.775 0 0 1-11.55 0zM12 7.725a4.275 4.275 0 1 0 0 8.55 4.275 4.275 0 0 0 0-8.55zm6.425-.75a1.4 1.4 0 1 0 0-2.8 1.4 1.4 0 0 0 0 2.8zm-6.467-6.8h.084c2.152 0 3.823 0 5.152.132 1.35.134 2.427.41 3.362 1.013a7.15 7.15 0 0 1 2.124 2.124c.604.935.88 2.012 1.013 3.362.132 1.329.132 3 .132 5.152v.084c0 2.152 0 3.823-.132 5.152-.134 1.35-.41 2.427-1.013 3.362a7.15 7.15 0 0 1-2.124 2.124c-.935.604-2.012.88-3.362 1.013-1.329.132-3 .132-5.152.132h-.084c-2.152 0-3.824 0-5.153-.132-1.35-.134-2.427-.409-3.36-1.013a7.15 7.15 0 0 1-2.125-2.124C.716 19.62.44 18.544.307 17.194c-.132-1.329-.132-3-.132-5.152v-.084c0-2.152 0-3.823.132-5.152.133-1.35.409-2.427 1.013-3.362A7.15 7.15 0 0 1 3.444 1.32C4.378.716 5.456.44 6.805.307c1.33-.132 3-.132 5.153-.132zM6.953 1.799c-1.234.123-2.043.36-2.695.78A5.65 5.65 0 0 0 2.58 4.26c-.42.65-.657 1.46-.78 2.695C1.676 8.2 1.675 9.797 1.675 12s0 3.8.124 5.046c.123 1.235.36 2.044.78 2.696a5.649 5.649 0 0 0 1.68 1.678c.65.421 1.46.658 2.694.78 1.247.124 2.844.125 5.047.125s3.8 0 5.046-.124c1.235-.123 2.044-.36 2.695-.78a5.648 5.648 0 0 0 1.68-1.68c.42-.65.657-1.46.78-2.694.123-1.247.124-2.844.124-5.047s-.001-3.8-.125-5.046c-.122-1.235-.359-2.044-.78-2.695a5.65 5.65 0 0 0-1.679-1.68c-.651-.42-1.46-.657-2.695-.78-1.246-.123-2.843-.124-5.046-.124-2.203 0-3.8 0-5.047.124z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-local' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M3 3.75a1.5 1.5 0 0 0-1.5 1.5v13.5a1.5 1.5 0 0 0 1.5 1.5h18a1.5 1.5 0 0 0 1.5-1.5V9A1.5 1.5 0 0 0 21 7.5h-9a.75.75 0 0 1-.643-.364L9.325 3.75zm-3 1.5a3 3 0 0 1 3-3h6.75a.75.75 0 0 1 .643.364L12.425 6H21a3 3 0 0 1 3 3v9.75a3 3 0 0 1-3 3H3a3 3 0 0 1-3-3z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-mirror' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M5 .4 3.5 2 5 3.6M15 .4 16.5 2 15 3.6M3.52 2h12.957M8.5 16.7V6.046c0-.301-.394-.415-.554-.159L1.287 16.541a.3.3 0 0 0 .255.459H8.2a.3.3 0 0 0 .3-.3zm3 0V6.046c0-.301.395-.415.555-.159l6.659 10.654a.3.3 0 0 1-.255.459H11.8a.3.3 0 0 1-.3-.3z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-onedrive' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M13.616 4.147a7.689 7.689 0 0 0-7.642 3.285A6.299 6.299 0 0 0 1.455 17.3c.684.894 2.473 2.658 5.17 2.658h12.141c.95 0 1.882-.256 2.697-.743.815-.486 1.514-1.247 1.964-2.083a5.26 5.26 0 0 0-3.713-7.612 7.69 7.69 0 0 0-6.098-5.373ZM3.34 17.15c.674.63 1.761 1.308 3.284 1.308h12.142a3.76 3.76 0 0 0 2.915-1.383l-7.494-4.489L3.34 17.15Zm10.875-6.25 2.47-1.038a5.239 5.239 0 0 1 1.427-.389 6.19 6.19 0 0 0-10.3-1.952 6.338 6.338 0 0 1 2.118.813l4.285 2.567Zm4.55.033c-.512 0-1.019.104-1.489.307l-.006.003-1.414.594 6.521 3.906a3.76 3.76 0 0 0-3.357-4.8l-.254-.01ZM4.097 9.617A4.799 4.799 0 0 1 6.558 8.9c.9 0 1.84.25 2.587.713l3.4 2.037-10.17 4.28a4.799 4.799 0 0 1 1.721-6.312Z'/></symbol><symbol viewBox='0 0 40 40' id='uc-icon-original' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.5' d='M0 40 40 0'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-remove-file' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11.955 3.3A2.969 2.969 0 0 0 8.998 6h5.914a2.97 2.97 0 0 0-2.957-2.7zM16.416 6a4.47 4.47 0 0 0-8.922 0h-2.32a.755.755 0 0 0-.111.008H3.075a.75.75 0 1 0 0 1.5h1.35V19.35a2.85 2.85 0 0 0 2.85 2.85h9.45a2.85 2.85 0 0 0 2.85-2.85V7.508h1.35a.75.75 0 0 0 0-1.5h-1.989A.754.754 0 0 0 18.825 6zM5.925 7.508V19.35a1.35 1.35 0 0 0 1.35 1.35h9.45a1.35 1.35 0 0 0 1.35-1.35V7.508z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-rotate' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M13.5.4 12 2l1.5 1.6M12.023 2H14.4A3.6 3.6 0 0 1 18 5.6V8M4 17h9a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v9a1 1 0 0 0 1 1z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-sad' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M2 17c4.418-4 11.582-4 16 0M16.5 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm-11 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-saturation' xmlns='http://www.w3.org/2000/svg'><defs><linearGradient id='apuc-icon-id__a' x1='10.001' y1='1' x2='10.001' y2='19' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient></defs><circle cx='10.001' cy='10' r='9' transform='rotate(90 10 10)' fill='url(#apuc-icon-id__a)'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-select' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='m7 10 5 5 5-5H7Z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-slider' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M0 10h11m0 0a2 2 0 1 0 4 0m-4 0a2 2 0 1 1 4 0m0 0h5'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-tuning' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M8 10h11M1 10h4M1 4.5h11m3 0h4m-18 11h11m3 0h4m-7-11a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0M5 10a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0m7 5.5a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-upload' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11.501.392a.75.75 0 0 1 .998 0l6.704 5.972a.75.75 0 0 1-.998 1.12l-5.455-4.86v13.439a.75.75 0 0 1-1.5 0V2.625l-5.454 4.86a.75.75 0 1 1-.998-1.12zM.857 16.73a.75.75 0 0 1 .75.75v4.914h20.786v-4.914a.75.75 0 0 1 1.5 0v5.664a.75.75 0 0 1-.75.75H.857a.75.75 0 0 1-.75-.75v-5.664a.75.75 0 0 1 .75-.75z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-upload-error' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M13 13h-2V7h2m0 10h-2v-2h2M12 2A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-url' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M19.11 3.67c-1.71-1.709-4.578-1.682-6.408.148l-2.22 2.22a.75.75 0 0 1-1.062-1.06l2.222-2.221C14.018.381 17.836.276 20.17 2.61l1.22 1.22c2.335 2.334 2.23 6.153-.147 8.529l-2.22 2.22a.75.75 0 0 1-1.062-1.06l2.222-2.221c1.83-1.83 1.856-4.698.147-6.408zm-3.36 4.58a.75.75 0 0 1 0 1.06l-6.439 6.44a.75.75 0 0 1-1.06-1.06l6.439-6.44a.75.75 0 0 1 1.06 0zM6.04 9.42a.75.75 0 0 1 0 1.061l-2.222 2.222c-1.83 1.83-1.856 4.698-.147 6.407l1.22 1.22c1.71 1.71 4.578 1.683 6.408-.147l2.221-2.221a.75.75 0 1 1 1.06 1.06l-2.22 2.222c-2.377 2.376-6.195 2.481-8.53.147l-1.22-1.22c-2.334-2.334-2.228-6.153.148-8.53l2.221-2.22a.75.75 0 0 1 1.06 0z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-vibrance' xmlns='http://www.w3.org/2000/svg'><path d='M2.125 5.64A8.96 8.96 0 0 0 1.001 10a8.96 8.96 0 0 0 1.124 4.36V5.64z' fill='url(#asuc-icon-id__a)'/><path d='M2.875 15.499V4.502a9.053 9.053 0 0 1 1.75-1.72v14.437a9.05 9.05 0 0 1-1.75-1.72z' fill='url(#asuc-icon-id__b)'/><path d='M5.375 17.722c.548.33 1.134.601 1.75.809V1.469a8.956 8.956 0 0 0-1.75.81v15.443z' fill='url(#asuc-icon-id__c)'/><path d='M7.875 1.253v17.495c.564.136 1.15.22 1.75.244V1.008a9 9 0 0 0-1.75.245z' fill='url(#asuc-icon-id__d)'/><path d='M10.375 1.008v17.984a9 9 0 0 0 1.75-.244V1.252a9 9 0 0 0-1.75-.244z' fill='url(#asuc-icon-id__e)'/><path d='M12.875 1.469V18.53a8.957 8.957 0 0 0 1.75-.808V2.277a8.957 8.957 0 0 0-1.75-.808z' fill='url(#asuc-icon-id__f)'/><path d='M15.375 2.78v14.44a9.053 9.053 0 0 0 1.75-1.72v-11a9.054 9.054 0 0 0-1.75-1.72z' fill='url(#asuc-icon-id__g)'/><path d='M17.875 5.638v8.724A8.959 8.959 0 0 0 19.001 10a8.96 8.96 0 0 0-1.126-4.362z' fill='url(#asuc-icon-id__h)'/><defs><linearGradient id='asuc-icon-id__a' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='asuc-icon-id__b' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='asuc-icon-id__c' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='asuc-icon-id__d' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='asuc-icon-id__e' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='asuc-icon-id__f' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='asuc-icon-id__g' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='asuc-icon-id__h' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient></defs></symbol><symbol viewBox='0 0 24 24' id='uc-icon-vk' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M6.341 3.27a10.5 10.5 0 0 1 5.834-1.77.75.75 0 0 0 0-1.5 12 12 0 1 0 12 12 .75.75 0 0 0-1.5 0A10.5 10.5 0 1 1 6.34 3.27Zm14.145 1.48a.75.75 0 1 0-1.06-1.062L9.925 13.19V7.95a.75.75 0 1 0-1.5 0V15c0 .414.336.75.75.75h7.05a.75.75 0 0 0 0-1.5h-5.24l9.501-9.5Z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-warmth' xmlns='http://www.w3.org/2000/svg'><path d='m7.5 13.05.429.42.171-.175v-.244h-.6zm5 0h-.6v.245l.172.175.428-.42zM8.1 3.5c0-1.05.85-1.9 1.9-1.9V.4a3.1 3.1 0 0 0-3.1 3.1h1.2zm0 9.55V3.5H6.9v9.55h1.2zm-1 2.45c0-.79.315-1.506.829-2.03l-.858-.84A4.088 4.088 0 0 0 5.9 15.5h1.2zm2.9 2.9a2.9 2.9 0 0 1-2.9-2.9H5.9a4.1 4.1 0 0 0 4.1 4.1v-1.2zm2.9-2.9a2.9 2.9 0 0 1-2.9 2.9v1.2a4.1 4.1 0 0 0 4.1-4.1h-1.2zm-.829-2.03c.514.524.829 1.24.829 2.03h1.2c0-1.117-.447-2.13-1.171-2.87l-.858.84zM11.9 3.5v9.55h1.2V3.5h-1.2zM10 1.6c1.05 0 1.9.85 1.9 1.9h1.2A3.1 3.1 0 0 0 10 .4v1.2z' fill='currentColor'/><path d='M10 14V8' stroke='currentColor' stroke-width='1.2' stroke-linecap='round'/><path d='M14 3h3m-3 3h3m-3 3h3m-8 6.5a1 1 0 1 0 2 0 1 1 0 1 0-2 0' stroke='currentColor' stroke-width='1.2'/></symbol></svg>";var Ys=class Ys extends ne{constructor(){super(...arguments);st(this,"requireCtxName",!0);st(this,"init$",Bs(this));st(this,"_template",null)}initCallback(){var t;super.initCallback(),(t=this.a11y)==null||t.registerBlock(this)}static set template(t){this._template=Hu+t+"<slot></slot>"}static get template(){return this._template}};e(Ys,"SolutionBlock"),st(Ys,"styleAttrs",["uc-wgt-common"]);var bi=Ys;var Wu="active",hn="___ACTIVITY_IS_ACTIVE___",Ci=class Ci extends ne{constructor(){super(...arguments);st(this,"historyTracked",!1);st(this,"init$",co(this));st(this,"_debouncedHistoryFlush",Ne(this._historyFlush.bind(this),10))}_deactivate(){var u;let t=Ci._activityCallbacks.get(this);this[hn]=!1,this.removeAttribute(Wu),(u=t==null?void 0:t.deactivateCallback)==null||u.call(t)}_activate(){var u;let t=Ci._activityCallbacks.get(this);this.$["*historyBack"]=this.historyBack.bind(this),this[hn]=!0,this.setAttribute(Wu,""),(u=t==null?void 0:t.activateCallback)==null||u.call(t),this._debouncedHistoryFlush(),this.emit(Se.ACTIVITY_CHANGE,{activity:this.activityType})}initCallback(){super.initCallback(),this.hasAttribute("current-activity")&&this.sub("*currentActivity",t=>{this.setAttribute("current-activity",t)}),this.activityType&&(this.hasAttribute("activity")||this.setAttribute("activity",this.activityType),this.sub("*currentActivity",t=>{var u;try{this.activityType!==t&&this[hn]?this._deactivate():this.activityType===t&&!this[hn]&&this._activate()}catch(x){console.error(`Error in activity "${this.activityType}". `,x),this.$["*currentActivity"]=(u=this.$["*history"][this.$["*history"].length-1])!=null?u:null}t||(this.$["*history"]=[])}),this.has("*modalActive")&&this.sub("*modalActive",t=>{!t&&this.activityType===this.$["*currentActivity"]&&(this.$["*currentActivity"]=null)}))}_historyFlush(){let t=this.$["*history"];t&&(t.length>10&&(t=t.slice(t.length-11,t.length-1)),this.historyTracked&&t[t.length-1]!==this.activityType&&t.push(this.activityType),this.$["*history"]=t)}_isActivityRegistered(){return this.activityType&&Ci._activityCallbacks.has(this)}get isActivityActive(){return this[hn]}get couldOpenActivity(){return!0}registerActivity(t,u={}){let{onActivate:x,onDeactivate:y}=u;Ci._activityCallbacks.set(this,{activateCallback:x,deactivateCallback:y})}unregisterActivity(){this.isActivityActive&&this._deactivate(),Ci._activityCallbacks.delete(this)}destroyCallback(){super.destroyCallback(),this._isActivityRegistered()&&this.unregisterActivity();let t=this.$["*currentActivity"];!![...this.blocksRegistry].find(x=>x instanceof Ci&&x.activityType===t)||(this.$["*currentActivity"]=null,this.setOrAddState("*modalActive",!1))}get activityKey(){return this.ctxName+this.activityType}get activityParams(){return this.$["*currentActivityParams"]}get initActivity(){return this.getCssData("--cfg-init-activity")}get doneActivity(){return this.getCssData("--cfg-done-activity")}historyBack(){var u;let t=this.$["*history"];if(t){let x=t.pop();for(;x===this.activityType;)x=t.pop();let y=!!x;if(x){let I=[...this.blocksRegistry].find(l=>l.activityType===x);y=(u=I==null?void 0:I.couldOpenActivity)!=null?u:!1}x=y?x:void 0,this.$["*currentActivity"]=x,this.$["*history"]=t,x||this.setOrAddState("*modalActive",!1)}}};e(Ci,"ActivityBlock"),st(Ci,"_activityCallbacks",new Map);var te=Ci;te.activities=Object.freeze({START_FROM:"start-from",CAMERA:"camera",DRAW:"draw",UPLOAD_LIST:"upload-list",URL:"url",CLOUD_IMG_EDIT:"cloud-image-edit",EXTERNAL:"external",LOCAL_IMAGE_EDITOR:"local-image-editor"});var fn=33.333333333333336,oe=1,bo=24,Yu=6;function tr(S,v){for(let t in v)S.setAttributeNS(null,t,v[t].toString())}e(tr,"setSvgNodeAttrs");function li(S,v={}){let t=document.createElementNS("http://www.w3.org/2000/svg",S);return tr(t,v),t}e(li,"createSvgNode");function Gu(S,v,t){let{x:u,y:x,width:y,height:I}=S,l=v.includes("w")?0:1,c=v.includes("n")?0:1,T=[-1,1][l],P=[-1,1][c],L=[u+l*y+1.5*T,x+c*I+1.5*P-24*t*P],N=[u+l*y+1.5*T,x+c*I+1.5*P],j=[u+l*y-24*t*T+1.5*T,x+c*I+1.5*P];return{d:`M ${L[0]} ${L[1]} L ${N[0]} ${N[1]} L ${j[0]} ${j[1]}`,center:N}}e(Gu,"cornerPath");function Xu(S,v,t){let{x:u,y:x,width:y,height:I}=S,l=["n","s"].includes(v)?.5:{w:0,e:1}[v],c=["w","e"].includes(v)?.5:{n:0,s:1}[v],T=[-1,1][l],P=[-1,1][c],L,N;["n","s"].includes(v)?(L=[u+l*y-34*t/2,x+c*I+1.5*P],N=[u+l*y+34*t/2,x+c*I+1.5*P]):(L=[u+l*y+1.5*T,x+c*I-34*t/2],N=[u+l*y+1.5*T,x+c*I+34*t/2]);let j=`M ${L[0]} ${L[1]} L ${N[0]} ${N[1]}`,b=[N[0]-(N[0]-L[0])/2,N[1]-(N[1]-L[1])/2];return{d:j,center:b}}e(Xu,"sidePath");function Vu(S){return S===""?"move":["e","w"].includes(S)?"ew-resize":["n","s"].includes(S)?"ns-resize":["nw","se"].includes(S)?"nwse-resize":"nesw-resize"}e(Vu,"thumbCursor");function $u({rect:S,delta:[v,t],imageBox:u}){return pr({...S,x:S.x+v,y:S.y+t},u)}e($u,"moveRect");function pr(S,v){let{x:t}=S,{y:u}=S;return S.x<v.x?t=v.x:S.x+S.width>v.x+v.width&&(t=v.x+v.width-S.width),S.y<v.y?u=v.y:S.y+S.height>v.y+v.height&&(u=v.y+v.height-S.height),{...S,x:t,y:u}}e(pr,"constraintRect");function ly({rect:S,delta:v,aspectRatio:t,imageBox:u}){let[,x]=v,{y,width:I,height:l}=S;y+=x,l-=x,t&&(I=l*t);let c=S.x+S.width/2-I/2;return y<=u.y&&(y=u.y,l=S.y+S.height-y,t&&(I=l*t,c=S.x+S.width/2-I/2)),c<=u.x&&(c=u.x,y=S.y+S.height-l),c+I>=u.x+u.width&&(c=Math.max(u.x,u.x+u.width-I),I=u.x+u.width-c,t&&(l=I/t),y=S.y+S.height-l),l<oe&&(l=oe,t&&(I=l*t,c=S.x+S.width/2-I/2),y=S.y+S.height-l),I<oe&&(I=oe,t&&(l=I/t,c=S.x+S.width/2-I/2),y=S.y+S.height-l),{x:c,y,width:I,height:l}}e(ly,"resizeNorth");function cy({rect:S,delta:v,aspectRatio:t,imageBox:u}){let[x]=v,{x:y,width:I,height:l}=S;y+=x,I-=x,t&&(l=I/t);let c=S.y+S.height/2-l/2;return y<=u.x&&(y=u.x,I=S.x+S.width-y,t&&(l=I/t,c=S.y+S.height/2-l/2)),c<=u.y&&(c=u.y,y=S.x+S.width-I),c+l>=u.y+u.height&&(c=Math.max(u.y,u.y+u.height-l),l=u.y+u.height-c,t&&(I=l*t),y=S.x+S.width-I),l<oe&&(l=oe,t&&(I=l*t),c=S.y+S.height/2-l/2,y=S.x+S.width-I),I<oe&&(I=oe,t&&(l=I/t),c=S.y+S.height/2-l/2,y=S.x+S.width-I),{x:y,y:c,width:I,height:l}}e(cy,"resizeWest");function uy({rect:S,delta:v,aspectRatio:t,imageBox:u}){let[,x]=v,{y,width:I,height:l}=S;l+=x,t&&(I=l*t);let c=S.x+S.width/2-I/2;return y+l>=u.y+u.height&&(l=u.y+u.height-y,t&&(I=l*t),c=S.x+S.width/2-I/2),c<=u.x&&(c=u.x,y=S.y),c+I>=u.x+u.width&&(c=Math.max(u.x,u.x+u.width-I),I=u.x+u.width-c,t&&(l=I/t),y=S.y),l<oe&&(l=oe,t&&(I=l*t),c=S.x+S.width/2-I/2),I<oe&&(I=oe,t&&(l=I/t),c=S.x+S.width/2-I/2),{x:c,y,width:I,height:l}}e(uy,"resizeSouth");function hy({rect:S,delta:v,aspectRatio:t,imageBox:u}){let[x]=v,{x:y,width:I,height:l}=S;I+=x,t&&(l=I/t);let c=S.y+S.height/2-l/2;return y+I>=u.x+u.width&&(I=u.x+u.width-y,t&&(l=I/t),c=S.y+S.height/2-l/2),c<=u.y&&(c=u.y,y=S.x),c+l>=u.y+u.height&&(c=Math.max(u.y,u.y+u.height-l),l=u.y+u.height-c,t&&(I=l*t),y=S.x),l<oe&&(l=oe,t&&(I=l*t),c=S.y+S.height/2-l/2),I<oe&&(I=oe,t&&(l=I/t),c=S.y+S.height/2-l/2),{x:y,y:c,width:I,height:l}}e(hy,"resizeEast");function fy({rect:S,delta:v,aspectRatio:t,imageBox:u}){let[x,y]=v,{x:I,y:l,width:c,height:T}=S;return I+x<u.x&&(x=u.x-I),l+y<u.y&&(y=u.y-l),I+=x,c-=x,l+=y,T-=y,t&&Math.abs(c/T)>t?(y=c/t-T,T+=y,l-=y,l<=u.y&&(T=T-(u.y-l),c=T*t,I=S.x+S.width-c,l=u.y)):t&&(x=T*t-c,c=c+x,I-=x,I<=u.x&&(c=c-(u.x-I),T=c/t,I=u.x,l=S.y+S.height-T)),T<oe&&(T=oe,t&&(c=T*t),I=S.x+S.width-c,l=S.y+S.height-T),c<oe&&(c=oe,t&&(T=c/t),I=S.x+S.width-c,l=S.y+S.height-T),{x:I,y:l,width:c,height:T}}e(fy,"resizeNorthWest");function dy({rect:S,delta:v,aspectRatio:t,imageBox:u}){let[x,y]=v,{x:I,y:l,width:c,height:T}=S;return I+c+x>u.x+u.width&&(x=u.x+u.width-I-c),l+y<u.y&&(y=u.y-l),c+=x,l+=y,T-=y,t&&Math.abs(c/T)>t?(y=c/t-T,T+=y,l-=y,l<=u.y&&(T=T-(u.y-l),c=T*t,I=S.x,l=u.y)):t&&(x=T*t-c,c+=x,I+c>=u.x+u.width&&(c=u.x+u.width-I,T=c/t,I=u.x+u.width-c,l=S.y+S.height-T)),T<oe&&(T=oe,t&&(c=T*t),l=S.y+S.height-T),c<oe&&(c=oe,t&&(T=c/t),l=S.y+S.height-T),{x:I,y:l,width:c,height:T}}e(dy,"resizeNorthEast");function gy({rect:S,delta:v,aspectRatio:t,imageBox:u}){let[x,y]=v,{x:I,y:l,width:c,height:T}=S;return I+x<u.x&&(x=u.x-I),l+T+y>u.y+u.height&&(y=u.y+u.height-l-T),I+=x,c-=x,T+=y,t&&Math.abs(c/T)>t?(y=c/t-T,T+=y,l+T>=u.y+u.height&&(T=u.y+u.height-l,c=T*t,I=S.x+S.width-c,l=u.y+u.height-T)):t&&(x=T*t-c,c+=x,I-=x,I<=u.x&&(c=c-(u.x-I),T=c/t,I=u.x,l=S.y)),T<oe&&(T=oe,t&&(c=T*t),I=S.x+S.width-c),c<oe&&(c=oe,t&&(T=c/t),I=S.x+S.width-c),{x:I,y:l,width:c,height:T}}e(gy,"resizeSouthWest");function vy({rect:S,delta:v,aspectRatio:t,imageBox:u}){let[x,y]=v,{x:I,y:l,width:c,height:T}=S;return I+c+x>u.x+u.width&&(x=u.x+u.width-I-c),l+T+y>u.y+u.height&&(y=u.y+u.height-l-T),c+=x,T+=y,t&&Math.abs(c/T)>t?(y=c/t-T,T+=y,l+T>=u.y+u.height&&(T=u.y+u.height-l,c=T*t,I=S.x,l=u.y+u.height-T)):t&&(x=T*t-c,c+=x,I+c>=u.x+u.width&&(c=u.x+u.width-I,T=c/t,I=u.x+u.width-c,l=S.y)),T<oe&&(T=oe,t&&(c=T*t)),c<oe&&(c=oe,t&&(T=c/t)),{x:I,y:l,width:c,height:T}}e(vy,"resizeSouthEast");function Zu({direction:S,...v}){switch(S){case"n":return ly(v);case"w":return cy(v);case"s":return uy(v);case"e":return hy(v);case"nw":return fy(v);case"ne":return dy(v);case"sw":return gy(v);case"se":return vy(v);default:return v.rect}}e(Zu,"resizeRect");function Ju(S,[v,t]){return S.x<=v&&v<=S.x+S.width&&S.y<=t&&t<=S.y+S.height}e(Ju,"rectContainsPoint");function Ku(S,v){return S.x>=v.x&&S.y>=v.y&&S.x+S.width<=v.x+v.width&&S.y+S.height<=v.y+v.height}e(Ku,"isRectInsideRect");function Qu(S,v){return Math.abs(S.width/S.height-v)<.1}e(Qu,"isRectMatchesAspectRatio");function mr({width:S,height:v},t){let u=t/90%2!==0;return{width:u?v:S,height:u?S:v}}e(mr,"rotateSize");function qu(S,v,t){let u=S/v,x,y;u>t?(x=Math.round(v*t),y=v):(x=S,y=Math.round(S/t));let I=Math.round((S-x)/2),l=Math.round((v-y)/2);return I+x>S&&(x=S-I),l+y>v&&(y=v-l),{x:I,y:l,width:x,height:y}}e(qu,"calculateMaxCenteredCropFrame");function yr(S){return{x:Math.round(S.x),y:Math.round(S.y),width:Math.round(S.width),height:Math.round(S.height)}}e(yr,"roundRect");function Xi(S,v,t){return Math.min(Math.max(S,v),t)}e(Xi,"clamp");var Xs=e(S=>{if(!S)return[];let[v,t]=S.split(":").map(Number);if(!Number.isFinite(v)||!Number.isFinite(t)){console.error(`Invalid crop preset: ${S}`);return}return[{type:"aspect-ratio",width:v,height:t}]},"parseCropPreset");var er="blocks",ir="1.8.0";function th(S){return Ja({...S,libraryName:er,libraryVersion:ir})}e(th,"customUserAgent");var eh=e(S=>Math.floor(S/1e3),"msToUnixTimestamp"),ih=e((S,{threshold:v})=>{let{secureExpire:t}=S,u=eh(Date.now()),x=Number(t),y=eh(v);return u+y>=x},"isSecureTokenExpired");var Co=class Co{constructor(v){st(this,"_block");st(this,"_secureToken",null);this._block=v}_debugPrint(...v){this._block.debugPrint("[secure-uploads]",...v)}async getSecureToken(){let{secureSignature:v,secureExpire:t,secureUploadsSignatureResolver:u}=this._block.cfg;if((v||t)&&u&&console.warn("Both secureSignature/secureExpire and secureUploadsSignatureResolver are set. secureUploadsSignatureResolver will be used."),u){if(!this._secureToken||ih(this._secureToken,{threshold:this._block.cfg.secureUploadsExpireThreshold})){this._secureToken?this._debugPrint("Secure signature is expired. Resolving a new one..."):this._debugPrint("Secure signature is not set yet.");try{let x=await u();x?!x.secureSignature||!x.secureExpire?console.error("Secure signature resolver returned an invalid result:",x):(this._debugPrint("Secure signature resolved:",x),this._debugPrint("Secure signature will expire in",new Date(Number(x.secureExpire)*1e3).toISOString()),this._secureToken=x):(this._debugPrint("Secure signature resolver returned nothing."),this._secureToken=null)}catch(x){console.error("Secure signature resolving failed. Falling back to the previous one.",x)}}return this._secureToken}return v&&t?(this._debugPrint("Secure signature and expire are set. Using them...",{secureSignature:v,secureExpire:t}),{secureSignature:v,secureExpire:t}):null}};e(Co,"SecureUploadsManager");var Vs=Co;var rh="[Typed State] Wrong property name: ",py="[Typed State] Wrong property type: ",_o=class _o{constructor(v,t){this.__typedSchema=v,this.__ctxId=t||Ki.generate(),this.__schema=Object.keys(v).reduce((u,x)=>(u[x]=v[x].value,u),{}),this.__data=ce.registerCtx(this.__schema,this.__ctxId)}get uid(){return this.__ctxId}setValue(v,t){if(!this.__typedSchema.hasOwnProperty(v)){console.warn(rh+v);return}let u=this.__typedSchema[v];if((t==null?void 0:t.constructor)===u.type||t instanceof u.type||u.nullable&&t===null){this.__data.pub(v,t);return}console.warn(py+v)}setMultipleValues(v){for(let t in v)this.setValue(t,v[t])}getValue(v){if(!this.__typedSchema.hasOwnProperty(v)){console.warn(rh+v);return}return this.__data.read(v)}subscribe(v,t){return this.__data.sub(v,t)}remove(){ce.deleteCtx(this.__ctxId)}};e(_o,"TypedData");var $s=_o;var xo=class xo{constructor(v){this.__typedSchema=v.typedSchema,this.__ctxId=v.ctxName||Ki.generate(),this.__data=ce.registerCtx({},this.__ctxId),this.__watchList=v.watchList||[],this.__subsMap=Object.create(null),this.__propertyObservers=new Set,this.__collectionObservers=new Set,this.__items=new Set,this.__removed=new Set,this.__added=new Set;let t=Object.create(null);this.__notifyObservers=(u,x)=>{this.__observeTimeout&&window.clearTimeout(this.__observeTimeout),t[u]||(t[u]=new Set),t[u].add(x),this.__observeTimeout=window.setTimeout(()=>{Object.keys(t).length!==0&&(this.__propertyObservers.forEach(y=>{y({...t})}),t=Object.create(null))})}}notify(){this.__notifyTimeout&&window.clearTimeout(this.__notifyTimeout),this.__notifyTimeout=window.setTimeout(()=>{let v=new Set(this.__added),t=new Set(this.__removed);this.__added.clear(),this.__removed.clear();for(let u of this.__collectionObservers)u==null||u([...this.__items],v,t)})}observeCollection(v){return this.__collectionObservers.add(v),this.__items.size>0&&this.notify(),()=>{this.unobserveCollection(v)}}unobserveCollection(v){var t;(t=this.__collectionObservers)==null||t.delete(v)}add(v){let t=new $s(this.__typedSchema);for(let u in v)t.setValue(u,v[u]);return this.__items.add(t.uid),this.notify(),this.__data.add(t.uid,t),this.__added.add(t),this.__watchList.forEach(u=>{this.__subsMap[t.uid]||(this.__subsMap[t.uid]=[]),this.__subsMap[t.uid].push(t.subscribe(u,()=>{this.__notifyObservers(u,t.uid)}))}),t.uid}read(v){return this.__data.read(v)}readProp(v,t){return this.read(v).getValue(t)}publishProp(v,t,u){this.read(v).setValue(t,u)}remove(v){this.__removed.add(this.__data.read(v)),this.__items.delete(v),this.notify(),this.__data.pub(v,null),delete this.__subsMap[v]}clearAll(){this.__items.forEach(v=>{this.remove(v)})}observeProperties(v){return this.__propertyObservers.add(v),()=>{this.unobserveProperties(v)}}unobserveProperties(v){var t;(t=this.__propertyObservers)==null||t.delete(v)}findItems(v){let t=[];return this.__items.forEach(u=>{let x=this.read(u);v(x)&&t.push(u)}),t}items(){return[...this.__items]}get size(){return this.__items.size}destroy(){ce.deleteCtx(this.__ctxId),this.__propertyObservers=null,this.__collectionObservers=null;for(let v in this.__subsMap)this.__subsMap[v].forEach(t=>{t.remove()}),delete this.__subsMap[v]}};e(xo,"TypedCollection");var Zs=xo;var rr=Object.freeze({FACEBOOK:"facebook",DROPBOX:"dropbox",GDRIVE:"gdrive",GPHOTOS:"gphotos",INSTAGRAM:"instagram",FLICKR:"flickr",VK:"vk",EVERNOTE:"evernote",BOX:"box",ONEDRIVE:"onedrive",HUDDLE:"huddle"}),ke=Object.freeze({LOCAL:"local",DROP_AREA:"drop-area",CAMERA:"camera",EXTERNAL:"external",API:"js-api",URL:"url",DRAW:"draw",...rr});var dn=["image/*","image/heif","image/heif-sequence","image/heic","image/heic-sequence","image/avif","image/avif-sequence",".heif",".heifs",".heic",".heics",".avif",".avifs"],Js=e(S=>S?S.filter(v=>typeof v=="string").map(v=>Ve(v)).flat():[],"mergeFileTypes"),So=e((S,v)=>v.some(t=>t.endsWith("*")?(t=t.replace("*",""),S.startsWith(t)):S===t),"matchMimeType"),nh=e((S,v)=>v.some(t=>t.startsWith(".")?S.toLowerCase().endsWith(t.toLowerCase()):!1),"matchExtension"),sh=e(S=>{let v=S==null?void 0:S.type;return v?So(v,dn):!1},"fileIsImage");var my=/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/i,yy=new RegExp(`^/?(${my.source})(?:/(-/(?:[^/]+/)+)?([^/]*))?$`,"i"),ah=e(({url:S,cdnBase:v})=>{let t=new URL(v),u=new URL(S);if(t.host!==u.host)return null;let[,x,y,I]=yy.exec(u.pathname);return{uuid:x,cdnUrlModifiers:y||"",filename:I||null}},"parseCdnUrl");var oh=e(S=>{let v=new Map;return(...t)=>{let u=JSON.stringify(t);if(v.has(u))return v.get(u);let x=S(...t);return v.set(u,x),x}},"memoize");var lh=new Set;function ch(S){lh.has(S)||(lh.add(S),console.warn(S))}e(ch,"warnOnce");function by(S){let v=!1;return setTimeout(()=>{v=!0},0),e(u=>(...x)=>(v&&ch(S),u(...x)),"withAssert")}e(by,"createAsyncAssertWrapper");function uh(S){let v={progress:()=>S.$["*commonProgress"],errors:()=>S.$["*collectionErrors"],group:()=>S.$["*groupInfo"],totalCount:()=>S.uploadCollection.size,failedCount:()=>t.failedEntries.length,successCount:()=>t.successEntries.length,uploadingCount:()=>t.uploadingEntries.length,status:()=>t.isFailed?"failed":t.isUploading?"uploading":t.isSuccess?"success":"idle",isSuccess:()=>t.allEntries.length>0&&t.errors.length===0&&t.successEntries.length===t.allEntries.length,isUploading:()=>t.allEntries.some(x=>x.status==="uploading"),isFailed:()=>t.errors.length>0||t.failedEntries.length>0,allEntries:()=>S.getOutputData(),successEntries:()=>t.allEntries.filter(x=>x.status==="success"),failedEntries:()=>t.allEntries.filter(x=>x.status==="failed"),uploadingEntries:()=>t.allEntries.filter(x=>x.status==="uploading"),idleEntries:()=>t.allEntries.filter(x=>x.status==="idle")},t={},u=by("You're trying to access the OutputCollectionState asynchronously. In this case, the data you retrieve will be newer than it was when the OutputCollectionState was created or when the event was dispatched. If you want to retain the state at a specific moment in time, you should use the spread operator like this: `{...outputCollectionState}` or `{...e.detail}`");for(let[x,y]of Object.entries(v)){let I=x,c=oh(u(y));Object.defineProperty(t,I,{get:c,enumerable:!0})}return t}e(uh,"buildOutputCollectionState");var Io=class Io{constructor(v){st(this,"_ctx");st(this,"addFileFromUrl",e((v,{silent:t,fileName:u,source:x}={})=>{let y=this._uploadCollection.add({externalUrl:v,fileName:u!=null?u:null,silent:t!=null?t:!1,source:x!=null?x:ke.API});return this.getOutputItem(y)},"addFileFromUrl"));st(this,"addFileFromUuid",e((v,{silent:t,fileName:u,source:x}={})=>{let y=this._uploadCollection.add({uuid:v,fileName:u!=null?u:null,silent:t!=null?t:!1,source:x!=null?x:ke.API});return this.getOutputItem(y)},"addFileFromUuid"));st(this,"addFileFromCdnUrl",e((v,{silent:t,fileName:u,source:x}={})=>{var l;let y=ah({url:v,cdnBase:this.cfg.cdnCname});if(!y)throw new Error("Invalid CDN URL");let I=this._uploadCollection.add({uuid:y.uuid,cdnUrl:v,cdnUrlModifiers:y.cdnUrlModifiers,fileName:(l=u!=null?u:y.filename)!=null?l:null,silent:t!=null?t:!1,source:x!=null?x:ke.API});return this.getOutputItem(I)},"addFileFromCdnUrl"));st(this,"addFileFromObject",e((v,{silent:t,fileName:u,source:x,fullPath:y}={})=>{let I=this._uploadCollection.add({file:v,isImage:sh(v),mimeType:v.type,fileName:u!=null?u:v.name,fileSize:v.size,silent:t!=null?t:!1,source:x!=null?x:ke.API,fullPath:y!=null?y:null});return this.getOutputItem(I)},"addFileFromObject"));st(this,"removeFileByInternalId",e(v=>{if(!this._uploadCollection.read(v))throw new Error(`File with internalId ${v} not found`);this._uploadCollection.remove(v)},"removeFileByInternalId"));st(this,"uploadAll",e(()=>{let v=this._uploadCollection.items().filter(t=>{let u=this._uploadCollection.read(t);return!u.getValue("isRemoved")&&!u.getValue("isUploading")&&!u.getValue("fileInfo")});v.length!==0&&(this._ctx.$["*uploadTrigger"]=new Set(v),this._ctx.emit(Se.COMMON_UPLOAD_START,this.getOutputCollectionState()))},"uploadAll"));st(this,"openSystemDialog",e((v={})=>{var y;let t=fr(Js([(y=this.cfg.accept)!=null?y:"",...this.cfg.imgOnly?dn:[]]));this.cfg.accept&&this.cfg.imgOnly&&console.warn("There could be a mistake.\nBoth `accept` and `imgOnly` parameters are set.\nThe value of `accept` will be concatenated with the internal image mime types list.");let u="uploadcare-file-input",x=document.createElement("input");x.setAttribute(u,""),rn(x,{opacity:0,height:0,width:0,visibility:"hidden"}),x.type="file",x.multiple=this.cfg.multiple,v.captureCamera?(x.capture=this.cfg.cameraCapture,x.accept="image/*"):x.accept=t,x.addEventListener("change",()=>{x.files&&([...x.files].forEach(I=>this.addFileFromObject(I,{source:v.captureCamera?ke.CAMERA:ke.LOCAL})),this._ctx.$["*currentActivity"]=te.activities.UPLOAD_LIST,this._ctx.setOrAddState("*modalActive",!0),x.remove())},{once:!0}),document.querySelectorAll(`[${u}]`).forEach(I=>I.remove()),document.body.appendChild(x),x.dispatchEvent(new MouseEvent("click"))},"openSystemDialog"));st(this,"getOutputItem",e(v=>{var I,l,c,T,P,L,N,j,b,r;let t=ce.getCtx(v).store,u=t.fileInfo,x=t.isRemoved?"removed":t.errors.length>0?"failed":t.fileInfo?"success":t.isUploading?"uploading":"idle";return{uuid:(l=(I=u==null?void 0:u.uuid)!=null?I:t.uuid)!=null?l:null,internalId:v,name:(c=u==null?void 0:u.originalFilename)!=null?c:t.fileName,size:(T=u==null?void 0:u.size)!=null?T:t.fileSize,isImage:(P=u==null?void 0:u.isImage)!=null?P:t.isImage,mimeType:(L=u==null?void 0:u.mimeType)!=null?L:t.mimeType,file:t.file,externalUrl:t.externalUrl,cdnUrlModifiers:t.cdnUrlModifiers,cdnUrl:(j=(N=t.cdnUrl)!=null?N:u==null?void 0:u.cdnUrl)!=null?j:null,fullPath:t.fullPath,uploadProgress:t.uploadProgress,fileInfo:u!=null?u:null,metadata:(r=(b=t.metadata)!=null?b:u==null?void 0:u.metadata)!=null?r:null,isSuccess:x==="success",isUploading:x==="uploading",isFailed:x==="failed",isRemoved:x==="removed",errors:t.errors,status:x,source:t==null?void 0:t.source}},"getOutputItem"));st(this,"getOutputCollectionState",e(()=>uh(this._ctx),"getOutputCollectionState"));st(this,"initFlow",e((v=!1)=>{var t;if(this._uploadCollection.size>0&&!v)this._ctx.set$({"*currentActivity":te.activities.UPLOAD_LIST}),this._ctx.setOrAddState("*modalActive",!0);else if(((t=this._sourceList)==null?void 0:t.length)===1){let u=this._sourceList[0];if(u==="local"){this._ctx.$["*currentActivity"]=te.activities.UPLOAD_LIST,this.openSystemDialog();return}let x=this._ctx.$["*blocksRegistry"],y=e(l=>"type"in l&&l.type===u,"isSourceBtn"),I=[...x].find(y);I==null||I.activate(),this._ctx.$["*currentActivity"]&&this._ctx.setOrAddState("*modalActive",!0)}else this._ctx.set$({"*currentActivity":te.activities.START_FROM}),this._ctx.setOrAddState("*modalActive",!0)},"initFlow"));st(this,"doneFlow",e(()=>{this._ctx.set$({"*currentActivity":this._ctx.doneActivity,"*history":this._ctx.doneActivity?[this._ctx.doneActivity]:[]}),this._ctx.$["*currentActivity"]||this._ctx.setOrAddState("*modalActive",!1)},"doneFlow"));st(this,"setCurrentActivity",e((v,t=void 0)=>{if(this._ctx.hasBlockInCtx(u=>u.activityType===v)){this._ctx.set$({"*currentActivityParams":t!=null?t:{},"*currentActivity":v});return}console.warn(`Activity type "${v}" not found in the context`)},"setCurrentActivity"));st(this,"getCurrentActivity",e(()=>this._ctx.$["*currentActivity"],"getCurrentActivity"));st(this,"setModalState",e(v=>{if(v&&!this._ctx.$["*currentActivity"]){console.warn(`Can't open modal without current activity. Please use "setCurrentActivity" method first.`);return}this._ctx.setOrAddState("*modalActive",v)},"setModalState"));this._ctx=v}get _uploadCollection(){return this._ctx.uploadCollection}get cfg(){return this._ctx.cfg}get l10n(){return this._ctx.l10n.bind(this._ctx)}removeAllFiles(){this._uploadCollection.clearAll()}get _sourceList(){let v=[];return this.cfg.sourceList&&(v=Ve(this.cfg.sourceList)),v}};e(Io,"UploaderPublicApi");var Ks=Io;var Eo=e((S,v)=>{let t=v.cfg.imgOnly,u=S.isImage;if(!(!t||u)&&!(!S.fileInfo&&S.externalUrl)&&!(!S.fileInfo&&!S.mimeType))return{type:"NOT_AN_IMAGE",message:v.l10n("images-only-accepted"),payload:{entry:S}}},"validateIsImage");var wo=e((S,v)=>{let t=v.cfg.imgOnly,u=v.cfg.accept,x=Js([...t?dn:[],u]);if(!x.length)return;let y=S.mimeType,I=S.name;if(!y||!I)return;let l=So(y,x),c=nh(I,x);if(!l&&!c)return{type:"FORBIDDEN_FILE_TYPE",message:v.l10n("file-type-not-allowed"),payload:{entry:S}}},"validateFileType");var xi=1e3,nr=Object.freeze({AUTO:"auto",BYTE:"byte",KB:"kb",MB:"mb",GB:"gb",TB:"tb",PB:"pb"}),gn=e(S=>Math.ceil(S*100)/100,"round"),hh=e((S,v=nr.AUTO)=>{let t=v===nr.AUTO;if(v===nr.BYTE||t&&S<xi**1){let u=As("en-US",S),x={one:"byte",other:"bytes"}[u];return`${S} ${x}`}return v===nr.KB||t&&S<xi**2?`${gn(S/xi**1)} KB`:v===nr.MB||t&&S<xi**3?`${gn(S/xi**2)} MB`:v===nr.GB||t&&S<xi**4?`${gn(S/xi**3)} GB`:v===nr.TB||t&&S<xi**5?`${gn(S/xi**4)} TB`:`${gn(S/xi**5)} PB`},"prettyBytes");var Mo=e((S,v)=>{let t=v.cfg.maxLocalFileSizeBytes,u=S.size;if(t&&u&&u>t)return{type:"FILE_SIZE_EXCEEDED",message:v.l10n("files-max-size-limit-error",{maxFileSize:hh(t)}),payload:{entry:S}}},"validateMaxSizeLimit");var To=e((S,v)=>{let{internalId:t}=S,u=v._uploadCollection.read(t),x=u==null?void 0:u.getValue("uploadError");if(!x)return;if(x instanceof $e)return{type:"UPLOAD_ERROR",message:x.message,payload:{entry:S,error:x}};if(x instanceof dr)return{type:"NETWORK_ERROR",message:x.message,payload:{entry:S,error:x}};let y=x instanceof Error?x:new Error("Unknown error",{cause:x});return{type:"UNKNOWN_ERROR",message:y.message,payload:{entry:S,error:y}}},"validateUploadError");var Ao=e((S,v)=>{if(S.failedCount>0)return{type:"SOME_FILES_HAS_ERRORS",message:v.l10n("some-files-were-not-uploaded")}},"validateCollectionUploadError");var Oo=e((S,v)=>{let t=S.totalCount,u=v.cfg.multiple?v.cfg.multipleMin:0,x=v.cfg.multiple?v.cfg.multipleMax:1;if(u&&t<u)return{type:"TOO_FEW_FILES",message:v.l10n("files-count-limit-error-too-few",{min:u,max:x,total:t}),payload:{total:t,min:u,max:x}};if(x&&t>x)return{type:"TOO_MANY_FILES",message:v.l10n("files-count-limit-error-too-many",{min:u,max:x,total:t}),payload:{total:t,min:u,max:x}}},"validateMultiple");var Qs={file:"File validator execution has failed",collection:"Collection validator execution has failed",message:"Missing message. We recommend adding message: value."},Do=class Do{constructor(v){st(this,"_blockInstance");st(this,"_fileValidators",[Eo,wo,Mo,To]);st(this,"_collectionValidators",[Oo,Ao]);this._blockInstance=v,this._uploadCollection=this._blockInstance.uploadCollection;let t=e(()=>{this.runFileValidators(),this.runCollectionValidators()},"runAllValidators");this._blockInstance.subConfigValue("maxLocalFileSizeBytes",t),this._blockInstance.subConfigValue("multipleMin",t),this._blockInstance.subConfigValue("multipleMax",t),this._blockInstance.subConfigValue("multiple",t),this._blockInstance.subConfigValue("imgOnly",t),this._blockInstance.subConfigValue("accept",t)}runFileValidators(v){let t=v!=null?v:this._uploadCollection.items();for(let u of t){let x=this._uploadCollection.read(u);x&&this._runFileValidatorsForEntry(x)}}runCollectionValidators(){let v=this._blockInstance.api.getOutputCollectionState(),t=[];for(let u of[...this._collectionValidators,...this._addCustomTypeToValidators(this._blockInstance.cfg.collectionValidators)])try{let x=u(v,this._blockInstance.api);if(!x)continue;x&&(t.push(x),x.message||console.warn(Qs.message))}catch(x){console.warn(Qs.collection,x)}this._blockInstance.$["*collectionErrors"]=t,t.length>0&&this._blockInstance.emit(Se.COMMON_UPLOAD_FAILED,()=>this._blockInstance.api.getOutputCollectionState(),{debounce:!0})}_runFileValidatorsForEntry(v){let t=this._blockInstance.api.getOutputItem(v.uid),u=[];for(let x of[...this._fileValidators,...this._addCustomTypeToValidators(this._blockInstance.cfg.fileValidators)])try{let y=x(t,this._blockInstance.api);if(!y)continue;y&&(u.push(y),y.message||console.warn(Qs.message))}catch(y){console.warn(Qs.file,y)}v.setValue("errors",u)}_addCustomTypeToValidators(v){return v.map(t=>(...u)=>{let x=t(...u);return x?{...x,type:"CUSTOM_ERROR"}:void 0})}};e(Do,"ValidationManager");var qs=Do;var fh=Object.freeze({file:{type:File,value:null},externalUrl:{type:String,value:null},fileName:{type:String,value:null,nullable:!0},fileSize:{type:Number,value:null,nullable:!0},lastModified:{type:Number,value:Date.now()},uploadProgress:{type:Number,value:0},uuid:{type:String,value:null},isImage:{type:Boolean,value:!1},mimeType:{type:String,value:null,nullable:!0},ctxName:{type:String,value:null},cdnUrl:{type:String,value:null},cdnUrlModifiers:{type:String,value:null},fileInfo:{type:Di,value:null},isUploading:{type:Boolean,value:!1},abortController:{type:AbortController,value:null,nullable:!0},thumbUrl:{type:String,value:null,nullable:!0},silent:{type:Boolean,value:!1},source:{type:String,value:!1,nullable:!0},fullPath:{type:String,value:null,nullable:!0},metadata:{type:Object,value:null,nullable:!0},errors:{type:Array,value:[]},uploadError:{type:Error,value:null,nullable:!0},isRemoved:{type:Boolean,value:!1}});var ta=class ta extends te{constructor(){super(...arguments);st(this,"couldBeCtxOwner",!1);st(this,"isCtxOwner",!1);st(this,"init$",Bs(this));st(this,"_flushOutputItems",Ne(async()=>{if(this.getOutputData().length!==this.uploadCollection.size)return;let u=this.api.getOutputCollectionState();this.$["*collectionState"]=u,this.emit(Se.CHANGE,()=>this.api.getOutputCollectionState(),{debounce:!0}),this.cfg.groupOutput&&u.totalCount>0&&u.status==="success"&&this._createGroup(u)},300));st(this,"_handleCollectionUpdate",e((t,u,x)=>{var y;(u.size||x.size)&&(this.$["*groupInfo"]=null),this.validationManager.runFileValidators(),this.validationManager.runCollectionValidators();for(let I of u)I.getValue("silent")||this.emit(Se.FILE_ADDED,this.api.getOutputItem(I.uid));for(let I of x)this.$["*uploadTrigger"].delete(I.uid),(y=I.getValue("abortController"))==null||y.abort(),I.setMultipleValues({isRemoved:!0,abortController:null,isUploading:!1,uploadProgress:0}),URL.revokeObjectURL(I==null?void 0:I.getValue("thumbUrl")),this.emit(Se.FILE_REMOVED,this.api.getOutputItem(I.uid));this.$["*uploadList"]=t.map(I=>({uid:I})),this._flushCommonUploadProgress(),this._flushOutputItems()},"_handleCollectionUpdate"));st(this,"_handleCollectionPropertiesUpdate",e(t=>{this._flushOutputItems();let u=this.uploadCollection,x=[...new Set(Object.entries(t).filter(([y])=>["uploadError","fileInfo"].includes(y)).map(([,y])=>[...y]).flat())];if(x.length>0&&setTimeout(()=>{this.validationManager.runFileValidators(x)}),t.uploadProgress){for(let y of t.uploadProgress){let{isUploading:I,silent:l}=ce.getCtx(y).store;I&&!l&&this.emit(Se.FILE_UPLOAD_PROGRESS,this.api.getOutputItem(y))}this._flushCommonUploadProgress()}if(t.isUploading)for(let y of t.isUploading){let{isUploading:I,silent:l}=ce.getCtx(y).store;I&&!l&&this.emit(Se.FILE_UPLOAD_START,this.api.getOutputItem(y))}if(t.fileInfo){for(let y of t.fileInfo){let{fileInfo:I,silent:l}=ce.getCtx(y).store;I&&!l&&this.emit(Se.FILE_UPLOAD_SUCCESS,this.api.getOutputItem(y))}this.cfg.cropPreset&&this.setInitialCrop()}if(t.errors){for(let l of t.errors){let{errors:c}=ce.getCtx(l).store;c.length>0&&(this.emit(Se.FILE_UPLOAD_FAILED,this.api.getOutputItem(l)),this.emit(Se.COMMON_UPLOAD_FAILED,()=>this.api.getOutputCollectionState(),{debounce:!0}))}let y=u.findItems(l=>!!l.getValue("fileInfo")),I=u.findItems(l=>l.getValue("errors").length>0);u.size>0&&I.length===0&&u.size===y.length&&this.$["*collectionErrors"].length===0&&this.emit(Se.COMMON_UPLOAD_SUCCESS,this.api.getOutputCollectionState())}t.cdnUrl&&([...t.cdnUrl].filter(I=>{var l;return!!((l=this.uploadCollection.read(I))!=null&&l.getValue("cdnUrl"))}).forEach(I=>{this.emit(Se.FILE_URL_CHANGED,this.api.getOutputItem(I))}),this.$["*groupInfo"]=null)},"_handleCollectionPropertiesUpdate"));st(this,"_flushCommonUploadProgress",e(()=>{let t=0,x=[...this.$["*uploadTrigger"]].filter(I=>!!this.uploadCollection.read(I));x.forEach(I=>{let l=this.uploadCollection.readProp(I,"uploadProgress");t+=l});let y=x.length?Math.round(t/x.length):0;this.$["*commonProgress"]!==y&&(this.$["*commonProgress"]=y,this.emit(Se.COMMON_UPLOAD_PROGRESS,this.api.getOutputCollectionState()))},"_flushCommonUploadProgress"))}get hasCtxOwner(){return this.hasBlockInCtx(t=>t instanceof ta?t.isCtxOwner&&t.isConnected&&t!==this:!1)}initCallback(){if(super.initCallback(),!this.has("*uploadCollection")){let t=new Zs({typedSchema:fh,watchList:["uploadProgress","uploadError","fileInfo","errors","cdnUrl","isUploading"]});this.add("*uploadCollection",t)}this.has("*publicApi")||this.add("*publicApi",new Ks(this)),this.has("*validationManager")||this.add("*validationManager",new qs(this)),!this.hasCtxOwner&&this.couldBeCtxOwner&&this.initCtxOwner()}get validationManager(){if(!this.has("*validationManager"))throw new Error("Unexpected error: ValidationManager is not initialized");return this.$["*validationManager"]}get api(){if(!this.has("*publicApi"))throw new Error("Unexpected error: UploaderPublicApi is not initialized");return this.$["*publicApi"]}getAPI(){return this.api}get uploadCollection(){if(!this.has("*uploadCollection"))throw new Error("Unexpected error: TypedCollection is not initialized");return this.$["*uploadCollection"]}destroyCtxCallback(){var t,u;(t=this._unobserveCollectionProperties)==null||t.call(this),(u=this._unobserveCollection)==null||u.call(this),this.uploadCollection.destroy(),this.$["*uploadCollection"]=null,super.destroyCtxCallback()}initCtxOwner(){this.isCtxOwner=!0,this._unobserveCollection=this.uploadCollection.observeCollection(this._handleCollectionUpdate),this._unobserveCollectionProperties=this.uploadCollection.observeProperties(this._handleCollectionPropertiesUpdate),this.subConfigValue("maxConcurrentRequests",t=>{this.$["*uploadQueue"].concurrency=Number(t)||1}),this.$["*secureUploadsManager"]||(this.$["*secureUploadsManager"]=new Vs(this)),this.has("*modalActive")&&this.sub("*modalActive",t=>{t&&!this.$["*currentActivity"]&&(this.$["*modalActive"]=!1)})}async _createGroup(t){let u=await this.getUploadClientOptions(),x=t.allEntries.map(c=>c.uuid+(c.cdnUrlModifiers?`/${c.cdnUrlModifiers}`:"")),y=new AbortController,I=await Pu(x,{...u,signal:y.signal});if(this.$["*collectionState"]!==t){y.abort();return}this.$["*groupInfo"]=I;let l=this.api.getOutputCollectionState();this.emit(Se.GROUP_CREATED,l),this.emit(Se.CHANGE,()=>this.api.getOutputCollectionState(),{debounce:!0}),this.$["*collectionState"]=l}setInitialCrop(){let t=Xs(this.cfg.cropPreset);if(t){let[u]=t,x=this.uploadCollection.findItems(y=>{var I;return y.getValue("fileInfo")&&y.getValue("isImage")&&!((I=y.getValue("cdnUrlModifiers"))!=null&&I.includes("/crop/"))}).map(y=>this.uploadCollection.read(y));for(let y of x){let I=y.getValue("fileInfo"),{width:l,height:c}=I.imageInfo,T=u.width/u.height,P=qu(l,c,T),L=Xe(`crop/${P.width}x${P.height}/${P.x},${P.y}`,"preview");y.setMultipleValues({cdnUrlModifiers:L,cdnUrl:ze(y.getValue("cdnUrl"),L)}),this.uploadCollection.size===1&&this.cfg.useCloudImageEditor&&this.hasBlockInCtx(N=>N.activityType===te.activities.CLOUD_IMG_EDIT)&&(this.$["*currentActivityParams"]={internalId:y.uid},this.$["*currentActivity"]=te.activities.CLOUD_IMG_EDIT)}}}async getMetadataFor(t){let u=this.cfg.metadata||void 0;if(typeof u=="function"){let x=this.api.getOutputItem(t);return await u(x)}return u}async getUploadClientOptions(){let u=await this.$["*secureUploadsManager"].getSecureToken().catch(()=>null);return{store:this.cfg.store,publicKey:this.cfg.pubkey,baseCDN:this.cfg.cdnCname,baseURL:this.cfg.baseUrl,userAgent:th,integration:this.cfg.userAgentIntegration,secureSignature:u==null?void 0:u.secureSignature,secureExpire:u==null?void 0:u.secureExpire,retryThrottledRequestMaxTimes:this.cfg.retryThrottledRequestMaxTimes,multipartMinFileSize:this.cfg.multipartMinFileSize,multipartChunkSize:this.cfg.multipartChunkSize,maxConcurrentRequests:this.cfg.multipartMaxConcurrentRequests,multipartMaxAttempts:this.cfg.multipartMaxAttempts,checkForUrlDuplicates:!!this.cfg.checkForUrlDuplicates,saveUrlForRecurrentUploads:!!this.cfg.saveUrlForRecurrentUploads}}getOutputData(){return this.uploadCollection.items().map(x=>this.api.getOutputItem(x))}};e(ta,"UploaderBlock");var pe=ta;pe.extSrcList=Object.freeze({...rr});pe.sourceTypes=Object.freeze({...ke});var br=e(S=>{var v;return(v=S.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g))==null?void 0:v.map(t=>t.toLowerCase()).join("-")},"toKebabCase");var Ue=e(S=>String(S),"asString"),gi=e(S=>{let v=Number(S);if(Number.isNaN(v))throw new Error(`Invalid number: "${S}"`);return v},"asNumber"),Te=e(S=>{if(typeof S=="undefined"||S===null)return!1;if(typeof S=="boolean")return S;if(S==="true"||S==="")return!0;if(S==="false")return!1;throw new Error(`Invalid boolean: "${S}"`)},"asBoolean"),Cy=e(S=>S==="auto"?S:Te(S),"asStore"),_y=e(S=>{let v=Ue(S);if(v!=="user"&&v!=="environment"&&v!=="")throw new Error(`Invalid "cameraCapture" value: "${v}"`);return v},"asCameraCapture"),xy=e(S=>{if(typeof S=="object"&&!Array.isArray(S)||typeof S=="function")return S;throw new Error("Invalid metadata value. Must be an object or function.")},"asMetadata"),Sy=e(S=>{if(typeof S=="object")return S;throw new Error("Invalid value. Must be an object.")},"asObject"),ko=e(S=>{if(typeof S=="function")return S;throw new Error("Invalid value. Must be a function.")},"asFunction"),dh=e(S=>{if(Array.isArray(S))return S;throw new Error("Must be an array.")},"asArray"),Iy={pubkey:Ue,multiple:Te,multipleMin:gi,multipleMax:gi,confirmUpload:Te,imgOnly:Te,accept:Ue,externalSourcesPreferredTypes:Ue,store:Cy,cameraMirror:Te,cameraCapture:_y,sourceList:Ue,maxLocalFileSizeBytes:gi,thumbSize:gi,showEmptyList:Te,useLocalImageEditor:Te,useCloudImageEditor:Te,cloudImageEditorTabs:Ue,removeCopyright:Te,cropPreset:Ue,imageShrink:Ue,modalScrollLock:Te,modalBackdropStrokes:Te,sourceListWrap:Te,remoteTabSessionKey:Ue,cdnCname:Ue,baseUrl:Ue,socialBaseUrl:Ue,secureSignature:Ue,secureExpire:Ue,secureDeliveryProxy:Ue,retryThrottledRequestMaxTimes:gi,multipartMinFileSize:gi,multipartChunkSize:gi,maxConcurrentRequests:gi,multipartMaxConcurrentRequests:gi,multipartMaxAttempts:gi,checkForUrlDuplicates:Te,saveUrlForRecurrentUploads:Te,groupOutput:Te,userAgentIntegration:Ue,debug:Te,localeName:Ue,metadata:xy,secureUploadsExpireThreshold:gi,localeDefinitionOverride:Sy,secureUploadsSignatureResolver:ko,secureDeliveryProxyUrlResolver:ko,iconHrefResolver:ko,fileValidators:dh,collectionValidators:dh},gh=e((S,v)=>{if(!(typeof v=="undefined"||v===null))try{return Iy[S](v)}catch(t){return console.error(`Invalid value for config key "${S}".`,t),di[S]}},"normalizeConfigValue");var Po=[...new Set(["debug",...Object.keys(di)])],Ey=["metadata","localeDefinitionOverride","secureUploadsSignatureResolver","secureDeliveryProxyUrlResolver","iconHrefResolver","fileValidators","collectionValidators"],wy=e(S=>Ey.includes(S),"isComplexKey"),Cr=Po.filter(S=>!wy(S)),My={...Object.fromEntries(Cr.map(S=>[br(S),S])),...Object.fromEntries(Cr.map(S=>[S.toLowerCase(),S]))},Ty={...Object.fromEntries(Cr.map(S=>[br(S),ii(S)])),...Object.fromEntries(Cr.map(S=>[S.toLowerCase(),ii(S)]))},vh=e(S=>"__"+S,"getLocalPropName"),Lo=class Lo extends ne{constructor(){super();st(this,"requireCtxName",!0);this.init$={...this.init$,...Object.fromEntries(Object.entries(di).map(([t,u])=>[ii(t),u]))}}_flushValueToAttribute(t,u){if(Cr.includes(t)){let x=[...new Set([br(t),t.toLowerCase()])];for(let y of x)typeof u=="undefined"||u===null?this.removeAttribute(y):this.getAttribute(y)!==u.toString()&&this.setAttribute(y,u.toString())}}_flushValueToState(t,u){this.$[ii(t)]!==u&&(typeof u=="undefined"||u===null?this.$[ii(t)]=di[t]:this.$[ii(t)]=u)}_setValue(t,u){let x=this,y=gh(t,u),I=vh(t);x[I]!==y&&(this._assertSameValueDifferentReference(t,x[I],y),x[I]=y,this._flushValueToAttribute(t,y),this._flushValueToState(t,y),this.debugPrint(`[uc-config] "${t}"`,y))}_getValue(t){let u=this,x=vh(t);return u[x]}_assertSameValueDifferentReference(t,u,x){this.cfg.debug&&x!==u&&typeof x=="object"&&typeof u=="object"&&JSON.stringify(x)===JSON.stringify(u)&&(console.warn(`[uc-config] Option "${t}" value is the same as the previous one but the reference is different`),console.warn("[uc-config] You should avoid changing the reference of the object to prevent unnecessary calculations"),console.warn(`[uc-config] "${t}" previous value:`,u),console.warn(`[uc-config] "${t}" new value:`,x))}initCallback(){var u;super.initCallback();let t=this;for(let x of Cr)this.sub(ii(x),y=>{this._setValue(x,y)},!1);for(let x of Po){let y=(u=t[x])!=null?u:this.$[ii(x)];y!==di[x]&&this._setValue(x,y),Object.defineProperty(this,x,{set:I=>{this._setValue(x,I)},get:()=>this._getValue(x)})}}attributeChangedCallback(t,u,x){if(u===x)return;let y=this,I=My[t];y[I]=x}};e(Lo,"ConfigClass");var vn=Lo;vn.bindAttributes(Ty);for(let S of Po)vn.prototype[S]=void 0;var ph=vn;var No=class No extends ne{constructor(){super(),this.init$={...this.init$,name:"",href:"",title:""}}initCallback(){super.initCallback(),this.sub("name",v=>{if(!v)return;let t=`#uc-icon-${v}`;this.subConfigValue("iconHrefResolver",u=>{if(u){let x=u(v);t=x!=null?x:t}this.$.href=t})})}};e(No,"Icon");var _r=No;_r.template=`<svg ref="svg" xmlns="http://www.w3.org/2000/svg"><title>{{title}}</title><use set="@href: href;"></use></svg>`;_r.bindAttributes({name:"name",title:"title"});var mh=e(S=>[...new Set(S)],"uniqueArray");var yh=e(S=>Object.entries(S).filter(([v,t])=>t!==void 0&&t!=="").map(([v,t])=>v==="cdn-operations"||v==="analytics"?t:`${v}/${t}`),"parseObjectToString");var Ay="https://ucarecdn.com",pn=Object.freeze({"dev-mode":{},pubkey:{},uuid:{},src:{},lazy:{default:1},intersection:{},breakpoints:{},"cdn-cname":{default:Ay},"proxy-cname":{},"secure-delivery-proxy":{},"hi-res-support":{default:1},"ultra-res-support":{},format:{},"cdn-operations":{},progressive:{},quality:{},"is-background-for":{},"is-preview-blur":{default:1}});var xr="--uc-img-",Ro="unresolved";var jo=!window.location.host.trim()||window.location.host.includes(":")||window.location.hostname.includes("localhost"),Fo=3e3,zo=5e3,Bo=Object.freeze({PREVIEW:"PREVIEW",MAIN:"MAIN"});var Ch=Object.create(null),bh;for(let S in pn)Ch[xr+S]=((bh=pn[S])==null?void 0:bh.default)||"";var Uo=class Uo extends Qi{constructor(){super(...arguments);st(this,"cssInit$",Ch)}$$(t){return this.$[xr+t]}set$$(t){for(let u in t)this.$[xr+u]=t[u]}sub$$(t,u){this.sub(xr+t,x=>{x===null||x===""||u(x)})}analyticsParams(){return`-/@clib/${er}/${ir}/uc-img/`}initAttributes(t){[...this.attributes].forEach(u=>{pn[u.name]||t.setAttribute(u.name,u.value)})}initIntersection(t,u){let x={root:null,rootMargin:"0px"};this._isnObserver=new IntersectionObserver(y=>{y.forEach(I=>{I.isIntersecting&&(u(),this._isnObserver.unobserve(t))})},x),this._isnObserver.observe(t),this._observed||(this._observed=new Set),this._observed.add(t)}destroyCallback(){super.destroyCallback(),this._isnObserver&&(this._observed.forEach(t=>{this._isnObserver.unobserve(t)}),this._isnObserver=null),ce.deleteCtx(this)}static get observedAttributes(){return Object.keys(pn)}attributeChangedCallback(t,u,x){window.setTimeout(()=>{this.$[xr+t]=x})}};e(Uo,"ImgConfig");var ea=Uo;var Ho=class Ho extends ea{constructor(){super(...arguments);st(this,"_img",new Image);st(this,"_imgPreview",new Image)}_fmtAbs(t){return!t.includes("//")&&!jo&&(t=new URL(t,document.baseURI).href),t}_validateSize(t){if((t==null?void 0:t.trim())!==""){let u=t.match(/\d+/)[0],x=t.match(/[a-zA-Z]+/)[0],y=parseInt(u,10);if(Number(y)>zo&&this.hasFormatJPG)return zo+x;if(Number(y)>Fo&&!this.hasFormatJPG)return Fo+x}return t}_getCdnModifiers(t,u){let x={format:this.$$("format"),quality:this.$$("quality"),resize:this._validateSize(t),blur:u,"cdn-operations":this.$$("cdn-operations"),analytics:this.analyticsParams()};return Xe(...yh(x))}_getUrlBase(t="",u=""){if(this.$$("src").startsWith("data:")||this.$$("src").startsWith("blob:"))return this.$$("src");if(jo&&this.$$("src")&&!this.$$("src").includes("//"))return this._proxyUrl(this.$$("src"));let x=this._getCdnModifiers(t,u);if(this.$$("src").startsWith(this.$$("cdn-cname")))return ze(this.$$("src"),x);if(this.$$("cdn-cname")&&this.$$("uuid"))return this._proxyUrl(ze(Ui(this.$$("cdn-cname"),this.$$("uuid")),x));if(this.$$("uuid"))return this._proxyUrl(ze(Ui(this.$$("cdn-cname"),this.$$("uuid")),x));if(this.$$("proxy-cname"))return this._proxyUrl(ze(this.$$("proxy-cname"),x,this._fmtAbs(this.$$("src"))));if(this.$$("pubkey"))return this._proxyUrl(ze(`https://${this.$$("pubkey")}.ucr.io/`,x,this._fmtAbs(this.$$("src"))))}_proxyUrl(t){return this.$$("secure-delivery-proxy")?an(this.$$("secure-delivery-proxy"),{previewUrl:t},{transform:x=>window.encodeURIComponent(x)}):t}_getElSize(t,u=1,x=!0){let y=t.getBoundingClientRect(),I=u*Math.round(y.width),l=x?"":u*Math.round(y.height);return I||l?`${I||""}x${l||""}`:null}_setupEventProxy(t){let u=e(y=>{y.stopPropagation();let I=new Event(y.type,y);this.dispatchEvent(I)},"proxifyEvent"),x=["load","error"];for(let y of x)t.addEventListener(y,u)}get img(){return this.hasPreviewImage||(this._setupConfigForImage({elNode:this._img}),this.appendChild(this._img)),this._img}get currentImg(){return this.hasPreviewImage?{type:Bo.PREVIEW,img:this._imgPreview}:{type:Bo.MAIN,img:this.img}}get hasPreviewImage(){return this.$$("is-preview-blur")}get bgSelector(){return this.$$("is-background-for")}get breakpoints(){if(this.$$("breakpoints")){let t=Ve(this.$$("breakpoints"));return mh(t.map(u=>parseInt(u,10)))}else return null}get hasFormatJPG(){return this.$$("format").toLowerCase()==="jpeg"}renderBg(t){let u=new Set;u.add(`url("${this._getUrlBase(this._getElSize(t))}") 1x`),this.$$("hi-res-support")&&u.add(`url("${this._getUrlBase(this._getElSize(t,2))}") ${2}x`),this.$$("ultra-res-support")&&u.add(`url("${this._getUrlBase(this._getElSize(t,3))}") ${3}x`);let x=`image-set(${[...u].join(", ")})`;t.style.setProperty("background-image",x),t.style.setProperty("background-image","-webkit-"+x)}getSrcset(){let t=new Set;return this.breakpoints?this.breakpoints.forEach(u=>{t.add(this._getUrlBase(u+"x")+` ${this._validateSize(u+"w")}`),this.$$("hi-res-support")&&t.add(this._getUrlBase(u*2+"x")+` ${this._validateSize(u*2+"w")}`),this.$$("ultra-res-support")&&t.add(this._getUrlBase(u*3+"x")+` ${this._validateSize(u*3+"w")}`)}):(t.add(this._getUrlBase(this._getElSize(this.currentImg.img))+" 1x"),this.$$("hi-res-support")&&t.add(this._getUrlBase(this._getElSize(this.currentImg.img,2))+" 2x"),this.$$("ultra-res-support")&&t.add(this._getUrlBase(this._getElSize(this.currentImg.img,3))+" 3x")),[...t].join()}getSrc(){return this._getUrlBase()}get srcUrlPreview(){return this._getUrlBase("100x","100")}renderBackground(){[...document.querySelectorAll(this.bgSelector)].forEach(t=>{this.$$("intersection")?this.initIntersection(t,()=>{this.renderBg(t)}):this.renderBg(t)})}_appendURL({elNode:t,src:u,srcset:x}){u&&(t.src=u),x&&(t.srcset=x)}_setupConfigForImage({elNode:t}){this._setupEventProxy(t),this.initAttributes(t)}loaderImage({src:t,srcset:u,elNode:x}){return new Promise((y,I)=>{this._setupConfigForImage({elNode:x}),x.setAttribute(Ro,""),x.addEventListener("load",()=>{x.removeAttribute(Ro),y(x)}),x.addEventListener("error",()=>{I(!1)}),this._appendURL({elNode:x,src:t,srcset:u})})}async renderImage(){var t,u;if(this.$$("intersection")){this.hasPreviewImage&&(this._setupConfigForImage({elNode:this._imgPreview}),this.appendChild(this._imgPreview)),this.initIntersection(this.currentImg.img,async()=>{var x;this.hasPreviewImage&&(this._imgPreview.src=this.srcUrlPreview);try{await this.loaderImage({src:this.getSrc(),srcset:this.getSrcset(),elNode:this._img}),this.hasPreviewImage&&await this._imgPreview.remove(),this.appendChild(this._img)}catch{this.hasPreviewImage&&await((x=this._imgPreview)==null?void 0:x.remove()),this.appendChild(this._img)}});return}try{this.hasPreviewImage&&(await this.loaderImage({src:this.srcUrlPreview,elNode:this._imgPreview}),this.appendChild(this._imgPreview)),await this.loaderImage({src:this.getSrc(),srcset:this.getSrcset(),elNode:this._img}),this.hasPreviewImage&&await((t=this._imgPreview)==null?void 0:t.remove()),this.appendChild(this._img)}catch{this.hasPreviewImage&&await((u=this._imgPreview)==null?void 0:u.remove()),this.appendChild(this._img)}}init(){this.bgSelector?this.renderBackground():this.renderImage()}};e(Ho,"ImgBase");var na=Ho;var Wo=class Wo extends na{initCallback(){super.initCallback(),this.sub$$("src",()=>{this.init()}),this.sub$$("uuid",()=>{this.init()}),this.sub$$("lazy",v=>{!this.$$("is-background-for")&&!this.$$("is-preview-blur")&&(this.img.loading=v?"lazy":"eager")})}};e(Wo,"Img");var sa=Wo;var Sr=class Sr extends pe{constructor(){super();st(this,"couldBeCtxOwner",!0);this.init$={...this.init$,withDropZone:!0,onClick:()=>{this.api.initFlow()},"button-text":""}}initCallback(){super.initCallback(),this.defineAccessor("dropzone",t=>{typeof t!="undefined"&&(this.$.withDropZone=Te(t))}),this.subConfigValue("multiple",t=>{this.$["button-text"]=t?"upload-files":"upload-file"})}};e(Sr,"SimpleBtn"),st(Sr,"styleAttrs",[...qe(Sr,Sr,"styleAttrs"),"uc-simple-btn"]);var Ir=Sr;Ir.template=`<uc-drop-area set="@disabled: !withDropZone"><button type="button" set="onclick: onClick"><uc-icon name="upload"></uc-icon><span l10n="button-text"></span><slot></slot><div class="uc-visual-drop-area" l10n="drop-files-here"></div></button></uc-drop-area>`;Ir.bindAttributes({dropzone:null});var Yo=class Yo extends te{constructor(){super(...arguments);st(this,"historyTracked",!0);st(this,"activityType","start-from")}initCallback(){super.initCallback(),this.registerActivity(this.activityType)}};e(Yo,"StartFrom");var mn=Yo;mn.template='<div class="uc-content"><slot></slot></div>';function Oy(S){return new Promise(v=>{typeof window.FileReader!="function"&&v(!1);try{let t=new FileReader;t.onerror=()=>{v(!0)};let u=e(x=>{x.type!=="loadend"&&t.abort(),v(!1)},"onLoad");t.onloadend=u,t.onprogress=u,t.readAsDataURL(S)}catch{v(!1)}})}e(Oy,"checkIsDirectory");function Dy(S,v){return new Promise(t=>{let u=0,x=[],y=e(l=>{l||(console.warn("Unexpectedly received empty content entry",{scope:"drag-and-drop"}),t(null)),l.isFile?(u++,l.file(c=>{u--;let T=new File([c],c.name,{type:c.type||v});x.push({type:"file",file:T,fullPath:l.fullPath}),u===0&&t(x)})):l.isDirectory&&I(l.createReader())},"readEntry"),I=e(l=>{u++,l.readEntries(c=>{u--;for(let T of c)y(T);u===0&&t(x)})},"readReaderContent");y(S)})}e(Dy,"readEntryContentAsync");function _h(S){let v=[],t=[];for(let u=0;u<S.items.length;u++){let x=S.items[u];if(x)if(x.kind==="file"){let y=x.type;if(typeof x.webkitGetAsEntry=="function"||typeof x.getAsEntry=="function"){let l=typeof x.webkitGetAsEntry=="function"?x.webkitGetAsEntry():x.getAsEntry();t.push(Dy(l,y).then(c=>{c&&v.push(...c)}));continue}let I=x.getAsFile();I&&t.push(Oy(I).then(l=>{l||v.push({type:"file",file:I})}))}else x.kind==="string"&&x.type.match("^text/uri-list")&&t.push(new Promise(y=>{x.getAsString(I=>{v.push({type:"url",url:I}),y(void 0)})}))}return Promise.all(t).then(()=>v)}e(_h,"getDropItems");var Ze={ACTIVE:0,INACTIVE:1,NEAR:2,OVER:3},xh=["focus"],ky=100,Go=new Map;function Py(S,v){let t=Math.max(Math.min(S[0],v.x+v.width),v.x),u=Math.max(Math.min(S[1],v.y+v.height),v.y);return Math.sqrt((S[0]-t)*(S[0]-t)+(S[1]-u)*(S[1]-u))}e(Py,"distance");function Xo(S){let v=0,t=document.body,u=new Set,x=e(b=>u.add(b),"handleSwitch"),y=Ze.INACTIVE,I=e(b=>{S.shouldIgnore()&&b!==Ze.INACTIVE||(y!==b&&u.forEach(r=>r(b)),y=b)},"setState"),l=e(()=>v>0,"isDragging");x(b=>S.onChange(b));let c=e(()=>{v=0,I(Ze.INACTIVE)},"onResetEvent"),T=e(()=>{v+=1,y===Ze.INACTIVE&&I(Ze.ACTIVE)},"onDragEnter"),P=e(()=>{v-=1,l()||I(Ze.INACTIVE)},"onDragLeave"),L=e(b=>{b.preventDefault(),v=0,I(Ze.INACTIVE)},"onDrop"),N=e(b=>{if(S.shouldIgnore())return;l()||(v+=1);let r=[b.x,b.y],m=S.element.getBoundingClientRect(),p=Math.floor(Py(r,m)),i=p<ky,a=b.composedPath().includes(S.element);Go.set(S.element,p);let n=Math.min(...Go.values())===p;a&&n?(b.preventDefault(),I(Ze.OVER)):I(i&&n?Ze.NEAR:Ze.ACTIVE)},"onDragOver"),j=e(async b=>{if(S.shouldIgnore())return;b.preventDefault();let r=await _h(b.dataTransfer);S.onItems(r),I(Ze.INACTIVE)},"onElementDrop");return t.addEventListener("drop",L),t.addEventListener("dragleave",P),t.addEventListener("dragenter",T),t.addEventListener("dragover",N),S.element.addEventListener("drop",j),xh.forEach(b=>{window.addEventListener(b,c)}),()=>{Go.delete(S.element),t.removeEventListener("drop",L),t.removeEventListener("dragleave",P),t.removeEventListener("dragenter",T),t.removeEventListener("dragover",N),S.element.removeEventListener("drop",j),xh.forEach(b=>{window.removeEventListener(b,c)})}}e(Xo,"addDropzone");var Sh="uc-drop-area",Er=`${Sh}/registry`,wr=class wr extends pe{constructor(){super(),this.init$={...this.init$,state:Ze.INACTIVE,withIcon:!1,isClickable:!1,isFullscreen:!1,isEnabled:!0,isVisible:!0,text:"",[Er]:null}}isActive(){if(!this.$.isEnabled)return!1;let v=this.getBoundingClientRect(),t=v.width>0&&v.height>0,u=v.top>=0&&v.left>=0&&v.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&v.right<=(window.innerWidth||document.documentElement.clientWidth),x=window.getComputedStyle(this),y=x.visibility!=="hidden"&&x.display!=="none";return t&&y&&u}initCallback(){super.initCallback(),this.bindL10n("text",()=>this.l10n("drop-files-here")),this.$[Er]||(this.$[Er]=new Set),this.$[Er].add(this),this.defineAccessor("disabled",t=>{this.set$({isEnabled:!Te(t)})}),this.defineAccessor("clickable",t=>{this.set$({isClickable:Te(t)})}),this.defineAccessor("with-icon",t=>{this.set$({withIcon:Te(t)})}),this.defineAccessor("fullscreen",t=>{this.set$({isFullscreen:Te(t)})}),this.defineAccessor("text",t=>{typeof t=="string"?this.bindL10n("text",()=>this.l10n(t)||t):this.bindL10n("text",()=>this.l10n("drop-files-here"))}),this._destroyDropzone=Xo({element:this,shouldIgnore:()=>this._shouldIgnore(),onChange:t=>{this.$.state=t},onItems:t=>{t.length&&(t.forEach(u=>{u.type==="url"?this.api.addFileFromUrl(u.url,{source:ke.DROP_AREA}):u.type==="file"&&this.api.addFileFromObject(u.file,{source:ke.DROP_AREA,fullPath:u.fullPath})}),this.uploadCollection.size&&(this.set$({"*currentActivity":te.activities.UPLOAD_LIST}),this.setOrAddState("*modalActive",!0)))}});let v=this.ref["content-wrapper"];v&&(this._destroyContentWrapperDropzone=Xo({element:v,onChange:t=>{var x;let u=(x=Object.entries(Ze).find(([,y])=>y===t))==null?void 0:x[0].toLowerCase();u&&v.setAttribute("drag-state",u)},onItems:()=>{},shouldIgnore:()=>this._shouldIgnore()})),this.sub("state",t=>{var x;let u=(x=Object.entries(Ze).find(([,y])=>y===t))==null?void 0:x[0].toLowerCase();u&&this.setAttribute("drag-state",u)}),this.subConfigValue("sourceList",t=>{let u=Ve(t);this.$.isEnabled=u.includes(ke.LOCAL),this.$.isVisible=this.$.isEnabled||!this.querySelector("[data-default-slot]")}),this.sub("isVisible",t=>{this.toggleAttribute("hidden",!t)}),this.sub("isClickable",t=>{this.toggleAttribute("clickable",t)}),this.$.isClickable&&(this._onAreaClicked=t=>{t.type==="keydown"?(t.code==="Space"||t.code==="Enter")&&this.api.openSystemDialog():t.type==="click"&&this.api.openSystemDialog()},this.addEventListener("keydown",this._onAreaClicked),this.addEventListener("click",this._onAreaClicked))}_shouldIgnore(){return!this.$.isEnabled||!this._couldHandleFiles()?!0:this.$.isFullscreen?[...this.$[Er]].filter(u=>u!==this).filter(u=>u.isActive()).length>0:!1}_couldHandleFiles(){let v=this.cfg.multiple,t=this.cfg.multipleMax,u=this.uploadCollection.size;return!(v&&t&&u>=t||!v&&u>0)}destroyCallback(){var t,u;super.destroyCallback();let v=this.$[Er];v&&(v.delete(this),v.size===0&&ce.deleteCtx(Sh)),(t=this._destroyDropzone)==null||t.call(this),(u=this._destroyContentWrapperDropzone)==null||u.call(this),this._onAreaClicked&&(this.removeEventListener("keydown",this._onAreaClicked),this.removeEventListener("click",this._onAreaClicked))}};e(wr,"DropArea"),st(wr,"styleAttrs",[...qe(wr,wr,"styleAttrs"),"uc-drop-area"]);var Mr=wr;Mr.template=`<slot><div data-default-slot hidden></div><div ref="content-wrapper" class="uc-content-wrapper" set="@hidden: !isVisible"><div class="uc-icon-container" set="@hidden: !withIcon"><uc-icon name="default"></uc-icon><uc-icon name="arrow-down"></uc-icon></div><span class="uc-text">{{text}}</span></div></slot>`;Mr.bindAttributes({"with-icon":null,clickable:null,text:null,fullscreen:null,disabled:null});var Ly="src-type-",Vo=class Vo extends pe{constructor(){super();st(this,"couldBeCtxOwner",!0);st(this,"type");st(this,"_registeredTypes",{});this.init$={...this.init$,iconName:"default","src-type":""}}initTypes(){this.registerType({type:ke.LOCAL,activate:()=>(this.api.openSystemDialog(),!1)}),this.registerType({type:ke.URL,activity:te.activities.URL,textKey:"from-url"}),this.registerType({type:ke.CAMERA,activity:te.activities.CAMERA,activate:()=>{let t="capture"in document.createElement("input");return t&&this.api.openSystemDialog({captureCamera:!0}),!t}}),this.registerType({type:"draw",activity:te.activities.DRAW,icon:"edit-draw"});for(let t of Object.values(rr))this.registerType({type:t,activity:te.activities.EXTERNAL,activityParams:{externalSourceType:t}})}initCallback(){super.initCallback(),this.initTypes(),this.defineAccessor("type",t=>{t&&this.applyType(t)})}registerType(t){this._registeredTypes[t.type]=t}getType(t){return this._registeredTypes[t]}activate(){if(!this.type)return;let t=this._registeredTypes[this.type],{activity:u,activate:x,activityParams:y={}}=t;(x?x():!!u)&&this.set$({"*currentActivityParams":y,"*currentActivity":u})}applyType(t){let u=this._registeredTypes[t];if(!u){console.warn("Unsupported source type: "+t);return}let{textKey:x=t,icon:y=t}=u;this.$["src-type"]=`${Ly}${x}`,this.$.iconName=y,this.onclick=()=>{this.activate()}}};e(Vo,"SourceBtn");var Tr=Vo;Tr.template=`<button type="button"><uc-icon set="@name: iconName"></uc-icon><div class="uc-txt" l10n="src-type"></div></button>`;Tr.bindAttributes({type:null});var $o=class $o extends ne{initCallback(){super.initCallback(),this.subConfigValue("sourceList",v=>{let t=Ve(v),u="";t.forEach(x=>{u+=`<uc-source-btn type="${x}"></uc-source-btn>`}),this.cfg.sourceListWrap?this.innerHTML=u:this.outerHTML=u})}};e($o,"SourceList");var aa=$o;var la=e(()=>{let S=[];return{stack:S,promiseReadJpegChunks:e(t=>new Promise((u,x)=>{let y=2,I=e((T,P)=>{let L=new FileReader;L.addEventListener("load",()=>{P(new DataView(L.result))}),L.addEventListener("error",N=>{x(`Reader error: ${N}`)}),L.readAsArrayBuffer(T)},"readToView"),l=e(()=>I(t.slice(y,y+128),T=>{let P,L,N;for(P=L=0,N=T.byteLength;N>=0?L<N:L>N;P=N>=0?++L:--L)if(T.getUint8(P)===255){y+=P;break}c()}),"readNext"),c=e(()=>{let T=y;return I(t.slice(y,y+=4),P=>{if(P.byteLength!==4||P.getUint8(0)!==255){x("Corrupted");return}let L=P.getUint8(1);if(L===218){u(!0);return}let N=P.getUint16(2)-2;return I(t.slice(y,y+=N),j=>{if(j.byteLength!==N){x("Corrupted");return}S.push({startPos:T,length:N,marker:L,view:j}),l()})})},"readNextChunk");FileReader&&DataView||x("Not Support"),I(t.slice(0,2),T=>{T.getUint16(0)!==65496&&x("Not jpeg"),l()})}),"promiseReadJpegChunks")}},"readJpegChunks"),Ny=e(async S=>{let v=[],{promiseReadJpegChunks:t,stack:u}=la();return await t(S),u.forEach(({marker:x,view:y})=>{x===226&&y.getUint32(0)===1229144927&&y.getUint32(4)===1347571526&&y.getUint32(8)===1229735168&&v.push(y)}),v},"getIccProfile"),Eh=e(async(S,v,t)=>{{let u=[],x=[],{promiseReadJpegChunks:y,stack:I}=la();await y(S),I.forEach(T=>{if(T.marker===v)return u.push(T.startPos),x.push(T.length)});let l=[S.slice(0,2)];for(let T of t){let P=new DataView(new ArrayBuffer(4));P.setUint16(0,65280+v),P.setUint16(2,T.byteLength+2),l.push(P.buffer),l.push(T)}let c=2;for(let T=0;T<u.length;T++)u[T]>c&&l.push(S.slice(c,u[T])),c=u[T]+x[T]+4;return l.push(S.slice(c,S.size)),new Blob(l,{type:S.type})}},"replaceJpegChunk"),Ry=226,wh=e((S,v)=>Eh(S,Ry,v.map(t=>t.buffer)),"replaceIccProfile"),jy=e(async S=>{try{return await wh(S,[])}catch(v){throw new Error(`Failed to strip ICC profile: ${v}`)}},"stripIccProfile"),Fy=e((S,v,t)=>new Promise((u,x)=>{let y=e(I=>{if(!I){x("Failed to convert canvas to blob");return}u(I)},"callback");S.toBlob(y,v,t),S.width=S.height=1}),"canvasToBlob"),yn=e(()=>{let S=document.createElement("canvas"),v=S.getContext("2d");return{canvas:S,ctx:v}},"createCanvas"),zy=e(S=>{let{ctx:t,canvas:u}=yn();u.width=u.height=50,t.drawImage(S,0,0,50,50);let x=t.getImageData(0,0,50,50).data;u.width=u.height=1;for(let y=3;y<x.length;y+=4)if(x[y]<254)return!0;return!1},"hasTransparency"),By=e(async S=>{let v=null,{promiseReadJpegChunks:t,stack:u}=la();return await t(S),u.forEach(({marker:x,view:y})=>{if(!v&&x===225&&y.byteLength>=14&&y.getUint32(0)===1165519206&&y.getUint16(4)===0){v=y;return}}),v},"getExif"),Uy="data:image/jpg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/4QA6RXhpZgAATU0AKgAAAAgAAwESAAMAAAABAAYAAAEoAAMAAAABAAIAAAITAAMAAAABAAEAAAAAAAD/2wBDAP//////////////////////////////////////////////////////////////////////////////////////wAALCAABAAIBASIA/8QAJgABAAAAAAAAAAAAAAAAAAAAAxABAAAAAAAAAAAAAAAAAAAAAP/aAAgBAQAAPwBH/9k=",oa,Hy=e(()=>new Promise(S=>{if(oa!==void 0)S(oa);else{let v=new Image;v.addEventListener("load",()=>{oa=v.naturalWidth<v.naturalHeight,v.src="//:0",S(oa)}),v.src=Uy}}),"isBrowserApplyExifOrientation"),Wy=e((S,v)=>{let t,u,x,y;if(!S||S.byteLength<14||S.getUint32(0)!==1165519206||S.getUint16(4)!==0)return;if(S.getUint16(6)===18761)u=!0;else if(S.getUint16(6)===19789)u=!1;else return;if(S.getUint16(8,u)!==42)return;x=8+S.getUint32(10,u);let I=S.getUint16(x-2,u);for(t=0,y=I;y>=0?t<y:t>y;y>=0?++t:--t){if(S.byteLength<x+10)return;S.getUint16(x,u)===274&&v(x+8,u),x+=12}},"findExifOrientation"),Yy=e((S,v)=>{Wy(S,(t,u)=>S.setUint16(t,v,u))},"setExifOrientation"),Gy=e(async(S,v,t)=>(t&&Yy(v,1),Eh(S,225,[v.buffer])),"replaceExif"),Xy=e((S,v)=>new Promise((t,u)=>{v&&(S.src=v),S.complete?t(S):(S.addEventListener("load",()=>{t(S)}),S.addEventListener("error",()=>{u(new Error("Failed to load image. Probably not an image."))}))}),"processImage"),Vy=e(S=>Xy(new Image,S),"imageLoader"),$y=[1,3],Zy=[192,193,194,195,197,198,199,201,202,203,205,206,207],Ih={squareSide:[Math.floor(Math.sqrt(5*1e3*1e3)),4096,8192,11180,10836,11402,14188,16384],dimension:[4096,8192,16384,32767,65535]},Jy=e(async S=>{let v=!1,{promiseReadJpegChunks:t,stack:u}=la();return await t(S).then(()=>(u.forEach(({marker:x,view:y})=>{if(!v&&Zy.indexOf(x)>=0){let I=y.getUint8(5);$y.indexOf(I)<0&&(v=!0)}}),v)).catch(()=>v)},"shouldSkipShrink"),Mh=e((S,v)=>{let t={};return(...u)=>{let x=v(u,t);return x in t?t[x]:t[x]=S(...u)}},"memoize"),Th=e((S,v)=>{let[t]=S,u=Object.keys(v).map(x=>parseInt(x,10)).sort((x,y)=>x-y);for(let x=0;x<u.length;x++){let y=u[x],I=!!v[y];if(y>t&&I||y<t&&!I)return y}return t},"memoKeySerializer"),Vi={R:55,G:110,B:165,A:255},Ky=`rgba(${Vi.R}, ${Vi.G}, ${Vi.B}, ${Vi.A/255})`,Ah=e((S,v)=>{try{let t=[S-1,v-1,1,1],{canvas:u,ctx:x}=yn();u.width=1,u.height=1;let{canvas:y,ctx:I}=yn();y.width=S,y.height=v,I&&(I.fillStyle=Ky,I.fillRect(...t),x.drawImage(y,S-1,v-1,1,1,0,0,1,1));let l=x&&x.getImageData(0,0,1,1).data,c=!1;return l&&(c=l[0]===Vi.R&&l[1]===Vi.G&&l[2]===Vi.B&&l[3]===Vi.A),y.width=y.height=1,c}catch{return console.error(`Failed to test for max canvas size of ${S}x${v}.`),!1}},"canvasTest");function Oh(S){return(...v)=>new Promise(t=>{setTimeout(()=>{let u=S(...v);t(u)},0)})}e(Oh,"wrapAsync");var Qy=Oh(Mh(Ah,Th)),qy=Oh(Mh(Ah,Th)),Dh=e(async(S,v)=>{let t=Ih.squareSide.find(I=>I*I>=S*v),u=Ih.dimension.find(I=>I>=S&&I>=v);if(!t||!u)throw new Error("Not supported");let[x,y]=await Promise.all([Qy(t,t),qy(u,1)]);if(x&&y)return!0;throw new Error("Not supported")},"testCanvasSize"),kh=e(async(S,v,t)=>{try{let{ctx:u,canvas:x}=yn();return x.width=v,x.height=t,u.imageSmoothingQuality="high",u.drawImage(S,0,0,v,t),S instanceof HTMLImageElement&&(S.src="//:0"),S instanceof HTMLCanvasElement&&(S.width=S.height=1),x}catch(u){throw new Error("Canvas resize error",{cause:u})}},"canvasResize"),t1=e(({img:S,targetW:v,targetH:t})=>kh(S,v,t),"native"),e1=e(function({sourceW:S,targetW:v,targetH:t,step:u}){let x=[],y=v,I=t;do x.push([y,I]),y=Math.round(y/u),I=Math.round(I/u);while(y<S*u);return x.reverse()},"calcShrinkSteps"),i1=e(({img:S,sourceW:v,targetW:t,targetH:u,step:x})=>e1({sourceW:v,targetW:t,targetH:u,step:x}).reduce((I,[l,c])=>I.then(T=>Dh(l,c).then(()=>kh(T,l,c)).catch(()=>T)),Promise.resolve(S)),"fallback"),r1=e(()=>/iPad|iPhone|iPod/.test(navigator.platform)?!0:navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform),"isIOS"),n1=navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform),Zo=.71,s1=e((S,v)=>{if(S.width*Zo*S.height*Zo<v.size)throw new Error("Not required");let t=S.width,u=S.height,x=t/u,y=Math.floor(Math.sqrt(v.size*x)),I=Math.floor(v.size/Math.sqrt(v.size*x));return Dh(y,I).then(()=>{let{ctx:l}=yn();return"imageSmoothingQuality"in l&&!r1()&&!n1?t1({img:S,targetW:y,targetH:I}):i1({img:S,sourceW:t,targetW:y,targetH:I,step:Zo})}).catch(()=>Promise.reject("Not supported"))},"shrinkImage"),Ph=e(async(S,v)=>{try{if(await Jy(S))throw new Error("Should skipped");let u=await Promise.allSettled([By(S),Hy(),Ny(S)]),y=!u.some(r=>r.status==="rejected"),[I,l,c]=u,T=await jy(S).catch(()=>S),P=await Vy(URL.createObjectURL(T));URL.revokeObjectURL(P.src);let L=await s1(P,v),N="image/jpeg",j=(v==null?void 0:v.quality)||.8;!y&&zy(L)&&(N="image/png",j=void 0);let b=await Fy(L,N,j);if(y&&I.status==="fulfilled"&&I.value){let r=I.value,m=l.status==="fulfilled"?l.value:!1;b=await Gy(b,r,m)}return y&&c.status==="fulfilled"&&c.value.length>0&&(b=await wh(b,c.value)),b}catch(t){let u;throw t instanceof Error&&(u=t.message),typeof t=="string"&&(u=t),new Error(`Failed to shrink image. ${u?`Message: "${u}".`:""}`,{cause:t})}},"shrinkFile");function a1(S){let v=new Blob([S],{type:"image/svg+xml"});return URL.createObjectURL(v)}e(a1,"createSvgBlobUrl");function Jo(S="hsl(209, 21%, 65%)",v=32,t=32){return a1(`<svg width="${v}" height="${t}" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" fill="${S}" d="M9.68848 8.70068C9.68848 8.42454 9.91233 8.20068 10.1885 8.20068H15.0885C15.2211 8.20068 15.3483 8.25336 15.442 8.34713L20.342 13.2471C20.4358 13.3409 20.4885 13.4681 20.4885 13.6007V21.3007C20.4885 21.5768 20.2646 21.8007 19.9885 21.8007H10.1885C9.91233 21.8007 9.68848 21.5768 9.68848 21.3007V8.70068ZM10.6885 9.20068V20.8007H19.4885V14.1007L15.0885 14.1007C14.8123 14.1007 14.5885 13.8768 14.5885 13.6007L14.5885 9.20068H10.6885ZM15.5885 9.90779L18.7814 13.1007L15.5885 13.1007L15.5885 9.90779Z"/></svg>`)}e(Jo,"fileCssBg");function Lh(S,v=40){if(S.type==="image/svg+xml")return URL.createObjectURL(S);let t=document.createElement("canvas"),u=t.getContext("2d"),x=new Image,y=new Promise((I,l)=>{x.onload=()=>{let c=x.height/x.width;c>1?(t.width=v,t.height=v*c):(t.height=v,t.width=v/c),u.fillStyle="rgb(240, 240, 240)",u.fillRect(0,0,t.width,t.height),u.drawImage(x,0,0,t.width,t.height),t.toBlob(T=>{if(!T){l();return}let P=URL.createObjectURL(T);I(P)})},x.onerror=c=>{l(c)}});return x.src=URL.createObjectURL(S),y}e(Lh,"generateThumb");var o1=/^([0-9]+)x([0-9]+)(?:\s+(\d{1,2}|100)%)?$/i,Nh=e(S=>{let v=o1.exec(S==null?void 0:S.toLocaleLowerCase())||[];if(!v.length)return!1;let t=v[1]*v[2],u=16384*16384;return t>u?(console.warn(`Shrinked size can not be larger than ${Math.floor(u/1e3/1e3)}MP. You have set ${v[1]}x${v[2]} (${Math.ceil(t/1e3/100)/10}MP).`),!1):{quality:v[3]?v[3]/100:void 0,size:t}},"parseShrink");var ci=Object.freeze({FINISHED:Symbol("FINISHED"),FAILED:Symbol("FAILED"),UPLOADING:Symbol("UPLOADING"),IDLE:Symbol("IDLE")}),Ar=class Ar extends pe{constructor(){super();st(this,"couldBeCtxOwner",!0);st(this,"pauseRender",!0);st(this,"_entrySubs",new Set);st(this,"_entry",null);st(this,"_isIntersecting",!1);st(this,"_debouncedGenerateThumb",Ne(this._generateThumbnail.bind(this),100));st(this,"_debouncedCalculateState",Ne(this._calculateState.bind(this),100));st(this,"_renderedOnce",!1);this.init$={...this.init$,uid:"",itemName:"",errorText:"",thumbUrl:"",progressValue:0,progressVisible:!1,badgeIcon:"",isFinished:!1,isFailed:!1,isUploading:!1,isFocused:!1,isEditable:!1,state:ci.IDLE,ariaLabelStatusFile:"",onEdit:()=>{this.$["*currentActivityParams"]={internalId:this._entry.uid},this.cfg.useLocalImageEditor?this.$["*currentActivity"]=te.activities.LOCAL_IMAGE_EDITOR:this.$["*currentActivity"]=te.activities.CLOUD_IMG_EDIT},onRemove:()=>{this.uploadCollection.remove(this.$.uid)},onUpload:()=>{this.upload()}}}_reset(){for(let t of this._entrySubs)t.remove();this._debouncedGenerateThumb.cancel(),this._debouncedCalculateState.cancel(),this._entrySubs=new Set,this._entry=null}_observerCallback(t){let[u]=t;this._isIntersecting=u.isIntersecting,u.isIntersecting&&!this._renderedOnce&&(this.render(),this._renderedOnce=!0),u.intersectionRatio===0?this._debouncedGenerateThumb.cancel():this._debouncedGenerateThumb()}_calculateState(){if(!this._entry)return;let t=this._entry,u=ci.IDLE;t.getValue("errors").length>0?u=ci.FAILED:t.getValue("isUploading")?u=ci.UPLOADING:t.getValue("fileInfo")&&(u=ci.FINISHED),this.$.state=u}async _generateThumbnail(){var u;if(!this._entry)return;let t=this._entry;if(!this.cfg.useLocalImageEditor&&t.getValue("fileInfo")&&t.getValue("isImage")){let x=this.cfg.thumbSize,y=await this.proxyUrl(ze(Ui(this.cfg.cdnCname,this._entry.getValue("uuid")),Xe(t.getValue("cdnUrlModifiers"),`scale_crop/${x}x${x}/center`))),I=t.getValue("thumbUrl");I!==y&&(t.setValue("thumbUrl",y),I!=null&&I.startsWith("blob:")&&URL.revokeObjectURL(I));return}if(!(!this.cfg.useLocalImageEditor&&t.getValue("thumbUrl")))if((u=t.getValue("file"))!=null&&u.type.includes("image"))try{let x=await Lh(t.getValue("file"),this.cfg.thumbSize);t.setValue("thumbUrl",x)}catch{let y=window.getComputedStyle(this).getPropertyValue("--uc-muted-foreground");t.setValue("thumbUrl",Jo(y))}else{let x=window.getComputedStyle(this).getPropertyValue("--uc-muted-foreground");t.setValue("thumbUrl",Jo(x))}}_subEntry(t,u){let x=this._entry.subscribe(t,y=>{this.isConnected&&u(y)});this._entrySubs.add(x)}_handleEntryId(t){var x;this._reset();let u=(x=this.uploadCollection)==null?void 0:x.read(t);this._entry=u,u&&(this._subEntry("uploadProgress",y=>{this.$.progressValue=y}),this._subEntry("fileName",y=>{this.$.itemName=y||u.getValue("externalUrl")||this.l10n("file-no-name"),this._debouncedCalculateState()}),this._subEntry("externalUrl",y=>{this.$.itemName=u.getValue("fileName")||y||this.l10n("file-no-name")}),this._subEntry("fileInfo",y=>{this._debouncedCalculateState(),y&&this._isIntersecting&&this._debouncedGenerateThumb()}),this._subEntry("cdnUrlModifiers",()=>{this._isIntersecting&&this._debouncedGenerateThumb()}),this._subEntry("thumbUrl",y=>{this.$.thumbUrl=y?`url(${y})`:""}),this._subEntry("errors",()=>this._debouncedCalculateState()),this._subEntry("isUploading",()=>this._debouncedCalculateState()),this._subEntry("fileSize",()=>this._debouncedCalculateState()),this._subEntry("mimeType",()=>this._debouncedCalculateState()),this._subEntry("isImage",()=>this._debouncedCalculateState()),this._isIntersecting&&this._debouncedGenerateThumb())}initCallback(){super.initCallback(),this.sub("uid",t=>{this._handleEntryId(t)}),this.sub("state",t=>{this._handleState(t)}),this.subConfigValue("useCloudImageEditor",()=>this._debouncedCalculateState()),this.onclick=()=>{Ar.activeInstances.forEach(t=>{t===this?t.setAttribute("focused",""):t.removeAttribute("focused")})},this.sub("*uploadTrigger",t=>{t.has(this._entry.uid)&&setTimeout(()=>this.isConnected&&this.upload())}),Ar.activeInstances.add(this)}_handleState(t){var u,x,y,I,l,c,T;t===ci.FAILED?this.$.badgeIcon="badge-error":t===ci.FINISHED&&(this.$.badgeIcon="badge-success"),t===ci.UPLOADING?this.$.isFocused=!1:this.$.progressValue=0,this.set$({isFailed:t===ci.FAILED,isUploading:t===ci.UPLOADING,isFinished:t===ci.FINISHED,progressVisible:t===ci.UPLOADING,isEditable:this.cfg.useLocalImageEditor||this.cfg.useCloudImageEditor&&((u=this._entry)==null?void 0:u.getValue("isImage"))&&((x=this._entry)==null?void 0:x.getValue("cdnUrl")),errorText:(I=(y=this._entry.getValue("errors"))==null?void 0:y[0])==null?void 0:I.message,ariaLabelStatusFile:this.l10n("a11y-file-item-status",{fileName:(l=this._entry)==null?void 0:l.getValue("fileName"),status:this.l10n((T=(c=t==null?void 0:t.description)==null?void 0:c.toLocaleLowerCase())!=null?T:"").toLocaleLowerCase()})})}destroyCallback(){super.destroyCallback(),Ar.activeInstances.delete(this),this._reset()}connectedCallback(){super.connectedCallback(),this._observer=new window.IntersectionObserver(this._observerCallback.bind(this),{threshold:[0,1]}),this._observer.observe(this)}disconnectedCallback(){var t;super.disconnectedCallback(),this._debouncedGenerateThumb.cancel(),(t=this._observer)==null||t.disconnect()}_settingsOfShrink(){return Nh(this.cfg.imageShrink)}_processShrink(t){return Ph(t,this._settingsOfShrink())}async upload(){var x,y,I,l,c,T;let t=this._entry;if(!this.uploadCollection.read(t.uid)||t.getValue("fileInfo")||t.getValue("isUploading")||t.getValue("errors").length>0)return;let u=this.cfg.multiple?this.cfg.multipleMax:1;if(!(u&&this.uploadCollection.size>u)){this._debouncedCalculateState(),t.setValue("isUploading",!0),t.setValue("errors",[]);try{let P=new AbortController;t.setValue("abortController",P);let L=e(async()=>{let j=t.getValue("file");j&&this.cfg.imageShrink&&(j=await this._processShrink(j).catch(()=>j));let b=j||t.getValue("externalUrl")||t.getValue("uuid"),m={...await this.getUploadClientOptions(),fileName:t.getValue("fileName"),source:t.getValue("source"),onProgress:p=>{if(p.isComputable){let i=p.value*100;t.setValue("uploadProgress",i)}},signal:P.signal,metadata:await this.getMetadataFor(t.uid)};return this.debugPrint("upload options",b,m),eo(b,m)},"uploadTask"),N=await this.$["*uploadQueue"].add(L);t.setMultipleValues({fileInfo:N,isUploading:!1,fileName:N.originalFilename,fileSize:N.size,isImage:N.isImage,mimeType:(I=(y=(x=N.contentInfo)==null?void 0:x.mime)==null?void 0:y.mime)!=null?I:N.mimeType,uuid:N.uuid,cdnUrl:(l=t.getValue("cdnUrl"))!=null?l:N.cdnUrl,cdnUrlModifiers:(c=t.getValue("cdnUrlModifiers"))!=null?c:"",uploadProgress:100,source:(T=t.getValue("source"))!=null?T:null}),t===this._entry&&this._debouncedCalculateState()}catch(P){P instanceof Wi&&P.isCancel?t.setMultipleValues({isUploading:!1,uploadProgress:0}):t.setMultipleValues({isUploading:!1,uploadProgress:0,uploadError:P}),t===this._entry&&this._debouncedCalculateState()}}}};e(Ar,"FileItem");var Or=Ar;Or.template=`<div class="uc-inner" set="@finished: isFinished; @uploading: isUploading; @failed: isFailed; @focused: isFocused"><div class="uc-thumb" set="style.backgroundImage: thumbUrl"><div class="uc-badge"><uc-icon set="@name: badgeIcon"></uc-icon></div></div><div aria-live="polite" class="uc-file-name-wrapper" set="@aria-label:ariaLabelStatusFile;"><span class="uc-file-name" set="@title: itemName">{{itemName}}</span><span class="uc-file-error" set="@hidden: !errorText">{{errorText}}</span></div><div class="uc-file-actions"><button type="button" l10n="@title:file-item-edit-button" class="uc-edit-btn uc-mini-btn" set="onclick: onEdit; @hidden: !isEditable" ><uc-icon name="edit-file"></uc-icon></button><button type="button" l10n="@title:file-item-remove-button" class="uc-remove-btn uc-mini-btn" set="onclick: onRemove;" ><uc-icon name="remove-file"></uc-icon></button><button type="button" class="uc-upload-btn uc-mini-btn" set="onclick: onUpload;"><uc-icon name="upload"></uc-icon></button></div><uc-progress-bar class="uc-progress-bar" set="value: progressValue; visible: progressVisible;"></uc-progress-bar></div>`;Or.activeInstances=new Set;var sr=class sr extends ne{constructor(){super();st(this,"_handleBackdropClick",e(()=>{this._closeDialog()},"_handleBackdropClick"));st(this,"_closeDialog",e(()=>{this.setOrAddState("*modalActive",!1)},"_closeDialog"));st(this,"_handleDialogClose",e(()=>{this._closeDialog()},"_handleDialogClose"));st(this,"_handleDialogMouseDown",e(t=>{this._mouseDownTarget=t.target},"_handleDialogMouseDown"));st(this,"_handleDialogMouseUp",e(t=>{t.target===this.ref.dialog&&t.target===this._mouseDownTarget&&this._closeDialog()},"_handleDialogMouseUp"));this.init$={...this.init$,"*modalActive":!1,isOpen:!1,closeClicked:this._handleDialogClose}}show(){this.ref.dialog.showModal?this.ref.dialog.showModal():this.ref.dialog.setAttribute("open","")}hide(){this.ref.dialog.close?this.ref.dialog.close():this.ref.dialog.removeAttribute("open")}initCallback(){if(super.initCallback(),typeof HTMLDialogElement=="function")this.ref.dialog.addEventListener("close",this._handleDialogClose),this.ref.dialog.addEventListener("mousedown",this._handleDialogMouseDown),this.ref.dialog.addEventListener("mouseup",this._handleDialogMouseUp);else{this.setAttribute("dialog-fallback","");let t=document.createElement("div");t.className="uc-backdrop",this.appendChild(t),t.addEventListener("click",this._handleBackdropClick)}this.sub("*modalActive",t=>{this.$.isOpen!==t&&(this.$.isOpen=t),t&&this.cfg.modalScrollLock?document.body.style.overflow="hidden":document.body.style.overflow=""}),this.subConfigValue("modalBackdropStrokes",t=>{t?this.setAttribute("strokes",""):this.removeAttribute("strokes")}),this.sub("isOpen",t=>{t?(this.show(),this.setAttribute("aria-modal","true")):(this.hide(),this.setAttribute("aria-modal","false"))})}destroyCallback(){super.destroyCallback(),document.body.style.overflow="",this._mouseDownTarget=void 0,this.ref.dialog.removeEventListener("close",this._handleDialogClose),this.ref.dialog.removeEventListener("mousedown",this._handleDialogMouseDown),this.ref.dialog.removeEventListener("mouseup",this._handleDialogMouseUp)}};e(sr,"Modal"),st(sr,"styleAttrs",[...qe(sr,sr,"styleAttrs"),"uc-modal"]),st(sr,"StateConsumerScope","modal");var bn=sr;bn.template=`<dialog ref="dialog"><slot></slot></dialog>`;var ca=e((S,v)=>{let t,u,x,y=e((...I)=>{t?(clearTimeout(u),u=setTimeout(()=>{Date.now()-x>=v&&(S(...I),x=Date.now())},Math.max(v-(Date.now()-x),0))):(S(...I),x=Date.now(),t=!0)},"throttled");return Object.defineProperty(y,"cancel",{configurable:!1,writable:!1,enumerable:!1,value:()=>{clearTimeout(u)}}),y},"throttle");var Ko=class Ko extends pe{constructor(){super();st(this,"couldBeCtxOwner",!0);st(this,"historyTracked",!0);st(this,"activityType",te.activities.UPLOAD_LIST);st(this,"_throttledHandleCollectionUpdate",ca(()=>{this.isConnected&&(this._updateUploadsState(),!this.couldOpenActivity&&this.$["*currentActivity"]===this.activityType&&this.historyBack())},300));this.init$={...this.init$,doneBtnVisible:!1,doneBtnEnabled:!1,uploadBtnVisible:!1,addMoreBtnVisible:!1,addMoreBtnEnabled:!1,headerText:"",commonErrorMessage:"",hasFiles:!1,onAdd:()=>{this.api.initFlow(!0)},onUpload:()=>{this.emit(Se.UPLOAD_CLICK),this.api.uploadAll(),this._throttledHandleCollectionUpdate()},onDone:()=>{this.emit(Se.DONE_CLICK,this.api.getOutputCollectionState()),this.api.doneFlow()},onCancel:()=>{this.uploadCollection.clearAll()}}}_updateUploadsState(){let t=this.api.getOutputCollectionState(),u={total:t.totalCount,succeed:t.successCount,uploading:t.uploadingCount,failed:t.failedCount},x=!t.errors.some(N=>N.type==="TOO_MANY_FILES"||N.type==="TOO_FEW_FILES"),y=t.errors.some(N=>N.type==="TOO_MANY_FILES"),I=t.totalCount===(this.cfg.multiple?this.cfg.multipleMax:1),l=u.failed===0&&t.errors.length===0,c=!1,T=!1,P=!1;if(u.total-u.succeed-u.uploading-u.failed>0&&x)c=!0;else{T=!0;let N=this.cfg.groupOutput?!!t.group:!0;P=u.total===u.succeed&&x&&l&&N}this.set$({doneBtnVisible:T,doneBtnEnabled:P,uploadBtnVisible:c,addMoreBtnEnabled:u.total===0||!y&&!I,addMoreBtnVisible:!I||this.cfg.multiple}),this.bindL10n("headerText",()=>this._getHeaderText(u))}_getHeaderText(t){let u=e(x=>{let y=t[x];return this.l10n(`header-${x}`,{count:y})},"localizedText");return t.uploading>0?u("uploading"):t.failed>0?u("failed"):t.succeed>0?u("succeed"):u("total")}get couldOpenActivity(){return this.cfg.showEmptyList||this.uploadCollection.size>0}initCallback(){super.initCallback(),this.registerActivity(this.activityType),this.subConfigValue("multiple",this._throttledHandleCollectionUpdate),this.subConfigValue("multipleMin",this._throttledHandleCollectionUpdate),this.subConfigValue("multipleMax",this._throttledHandleCollectionUpdate),this.sub("*groupInfo",t=>{t&&this._throttledHandleCollectionUpdate()}),this.sub("*currentActivity",t=>{!this.couldOpenActivity&&t===this.activityType&&(this.$["*currentActivity"]=this.initActivity)}),this.uploadCollection.observeProperties(this._throttledHandleCollectionUpdate),this.sub("*uploadList",t=>{this._throttledHandleCollectionUpdate(),this.set$({hasFiles:t.length>0}),this.cfg.confirmUpload||this.api.uploadAll()},!1),this.sub("*collectionErrors",t=>{let u=t.filter(x=>x.type!=="SOME_FILES_HAS_ERRORS")[0];if(!u){this.set$({commonErrorMessage:null});return}this.set$({commonErrorMessage:u.message})})}destroyCallback(){super.destroyCallback(),this.uploadCollection.unobserveProperties(this._throttledHandleCollectionUpdate)}};e(Ko,"UploadList");var Cn=Ko;Cn.template=`<uc-activity-header><span aria-live="polite" class="uc-header-text">{{headerText}}</span><button type="button" class="uc-mini-btn uc-close-btn" set="onclick: *closeModal" l10n="@title:a11y-activity-header-button-close" ><uc-icon name="close"></uc-icon></button></uc-activity-header><div class="uc-no-files" set="@hidden: hasFiles"><slot name="empty"><span l10n="no-files"></span></slot></div><div class="uc-files" repeat="*uploadList" repeat-item-tag="uc-file-item"></div><div class="uc-common-error" set="@hidden: !commonErrorMessage; textContent: commonErrorMessage;"></div><div class="uc-toolbar"><button type="button" class="uc-cancel-btn uc-secondary-btn" set="onclick: onCancel;" l10n="clear"></button><div class="uc-toolbar-spacer"></div><button type="button" class="uc-add-more-btn uc-secondary-btn" set="onclick: onAdd; @disabled: !addMoreBtnEnabled; @hidden: !addMoreBtnVisible" ><uc-icon name="add"></uc-icon><span l10n="add-more"></span></button><button type="button" class="uc-upload-btn uc-primary-btn" set="@hidden: !uploadBtnVisible; onclick: onUpload;" l10n="upload" ></button><button type="button" class="uc-done-btn uc-primary-btn" set="@hidden: !doneBtnVisible; onclick: onDone; @disabled: !doneBtnEnabled" l10n="done" ></button></div><uc-drop-area ghost></uc-drop-area>`;var Qo=class Qo extends pe{constructor(){super(...arguments);st(this,"couldBeCtxOwner",!0);st(this,"activityType",te.activities.URL);st(this,"init$",{...this.init$,importDisabled:!0,onUpload:t=>{t.preventDefault();let u=this.ref.input.value;this.api.addFileFromUrl(u,{source:ke.URL}),this.$["*currentActivity"]=te.activities.UPLOAD_LIST},onCancel:()=>{this.historyBack()},onInput:t=>{let u=t.target.value;this.set$({importDisabled:!u})}})}initCallback(){super.initCallback(),this.registerActivity(this.activityType,{onActivate:()=>{this.ref.input.value="",this.ref.input.focus()}})}};e(Qo,"UrlSource");var _n=Qo;_n.template=`<uc-activity-header><button type="button" class="uc-mini-btn" set="onclick: *historyBack"><uc-icon name="back"></uc-icon></button><div><uc-icon name="url"></uc-icon><span l10n="caption-from-url"></span></div><button type="button" class="uc-mini-btn uc-close-btn" set="onclick: *closeModal"><uc-icon name="close"></uc-icon></button></uc-activity-header><form class="uc-content"><input placeholder="https://" class="uc-url-input" type="text" ref="input" set="oninput: onInput" /><button type="submit" class="uc-url-upload-btn uc-primary-btn" set="onclick: onUpload; @disabled: importDisabled" l10n="upload-url" ></button></form>`;var qo=e(()=>typeof navigator.permissions!="undefined","canUsePermissionsApi");var tl=class tl extends pe{constructor(){super(...arguments);st(this,"couldBeCtxOwner",!0);st(this,"activityType",te.activities.CAMERA);st(this,"_unsubPermissions",null);st(this,"init$",{...this.init$,video:null,videoTransformCss:null,shotBtnDisabled:!0,videoHidden:!0,messageHidden:!0,requestBtnHidden:qo(),cameraSelectOptions:null,cameraSelectHidden:!0,l10nMessage:"",onCameraSelectChange:t=>{this._selectedCameraId=t.target.value,this._capture()},onCancel:()=>{this.historyBack()},onShot:()=>{this._shot()},onRequestPermissions:()=>{this._capture()}});st(this,"_onActivate",e(()=>{qo()&&this._subscribePermissions(),this._capture()},"_onActivate"));st(this,"_onDeactivate",e(()=>{this._unsubPermissions&&this._unsubPermissions(),this._stopCapture()},"_onDeactivate"));st(this,"_handlePermissionsChange",e(()=>{this._capture()},"_handlePermissionsChange"));st(this,"_setPermissionsState",Ne(t=>{this.classList.toggle("uc-initialized",t==="granted"),t==="granted"?this.set$({videoHidden:!1,shotBtnDisabled:!1,messageHidden:!0}):t==="prompt"?(this.$.l10nMessage="camera-permissions-prompt",this.set$({videoHidden:!0,shotBtnDisabled:!0,messageHidden:!1}),this._stopCapture()):(this.$.l10nMessage="camera-permissions-denied",this.set$({videoHidden:!0,shotBtnDisabled:!0,messageHidden:!1}),this._stopCapture())},300))}async _subscribePermissions(){try{(await navigator.permissions.query({name:"camera"})).addEventListener("change",this._handlePermissionsChange)}catch(t){console.log("Failed to use permissions API. Fallback to manual request mode.",t),this._capture()}}async _capture(){let t={video:{width:{ideal:1920},height:{ideal:1080},frameRate:{ideal:30}},audio:!1};this._selectedCameraId&&(t.video.deviceId={exact:this._selectedCameraId}),this._canvas=document.createElement("canvas"),this._ctx=this._canvas.getContext("2d");try{this._setPermissionsState("prompt");let u=await navigator.mediaDevices.getUserMedia(t);u.addEventListener("inactive",()=>{this._setPermissionsState("denied")}),this.$.video=u,this._capturing=!0,this._setPermissionsState("granted")}catch(u){this._setPermissionsState("denied"),console.error("Failed to capture camera",u)}}_stopCapture(){var t;this._capturing&&((t=this.$.video)==null||t.getTracks()[0].stop(),this.$.video=null,this._capturing=!1)}_shot(){this._canvas.height=this.ref.video.videoHeight,this._canvas.width=this.ref.video.videoWidth,this._ctx.drawImage(this.ref.video,0,0);let t=Date.now(),u=`camera-${t}.jpeg`,x="image/jpeg";this._canvas.toBlob(y=>{let I=new File([y],u,{lastModified:t,type:x});this.api.addFileFromObject(I,{source:ke.CAMERA}),this.set$({"*currentActivity":te.activities.UPLOAD_LIST})},x)}async initCallback(){var t;super.initCallback(),this.registerActivity(this.activityType,{onActivate:this._onActivate,onDeactivate:this._onDeactivate}),this.subConfigValue("cameraMirror",u=>{this.$.videoTransformCss=u?"scaleX(-1)":null});try{let x=(await navigator.mediaDevices.enumerateDevices()).filter(y=>y.kind==="videoinput").map((y,I)=>({text:y.label.trim()||`${this.l10n("caption-camera")} ${I+1}`,value:y.deviceId}));x.length>1&&(this.$.cameraSelectOptions=x,this.$.cameraSelectHidden=!1),this._selectedCameraId=(t=x[0])==null?void 0:t.value}catch{}}};e(tl,"CameraSource");var xn=tl;xn.template=`<uc-activity-header><button type="button" class="uc-mini-btn" set="onclick: *historyBack"><uc-icon name="back"></uc-icon></button><div set="@hidden: !cameraSelectHidden"><uc-icon name="camera"></uc-icon><span l10n="caption-camera"></span></div><uc-select class="uc-camera-select" set="$.options: cameraSelectOptions; @hidden: cameraSelectHidden; onchange: onCameraSelectChange" ></uc-select><button type="button" class="uc-mini-btn uc-close-btn" set="onclick: *closeModal"><uc-icon name="close"></uc-icon></button></uc-activity-header><div class="uc-content"><video autoplay playsinline set="srcObject: video; style.transform: videoTransformCss; @hidden: videoHidden" ref="video" ></video><div class="uc-message-box" set="@hidden: messageHidden"><span l10n="l10nMessage"></span><button type="button" set="onclick: onRequestPermissions; @hidden: requestBtnHidden" l10n="camera-permissions-request" ></button></div><button type="button" class="uc-shot-btn" set="onclick: onShot; @disabled: shotBtnDisabled"><uc-icon name="camera"></uc-icon></button></div>`;var el=class el extends pe{constructor(){super(...arguments);st(this,"requireCtxName",!0)}initCallback(){super.initCallback(),this.$["*eventEmitter"].bindTarget(this)}destroyCallback(){super.destroyCallback(),this.$["*eventEmitter"].unbindTarget(this)}};e(el,"UploadCtxProviderClass");var ua=el;ua.EventType=Se;var Rh=ua;var il=class il extends pe{constructor(){super(...arguments);st(this,"init$",{...this.init$,visible:!1,value:0,"*commonProgress":0})}initCallback(){super.initCallback(),this._unobserveCollection=this.uploadCollection.observeProperties(()=>{let t=this.uploadCollection.items().some(u=>this.uploadCollection.read(u).getValue("isUploading"));this.$.visible=t}),this.sub("visible",t=>{t?this.setAttribute("active",""):this.removeAttribute("active")}),this.sub("*commonProgress",t=>{this.$.value=t})}destroyCallback(){var t;super.destroyCallback(),(t=this._unobserveCollection)==null||t.call(this)}};e(il,"ProgressBarCommon");var Sn=il;Sn.template='<uc-progress-bar set="visible: visible; value: value"></uc-progress-bar>';var rl=class rl extends ne{constructor(){super(...arguments);st(this,"_value",0);st(this,"init$",{...this.init$,width:0,opacity:0})}initCallback(){super.initCallback(),this.defineAccessor("value",t=>{if(t===void 0)return;let u=this._value;if(this._value=t,t===0&&u>0){this.ref.line.addEventListener("transitionend",()=>{this.style.setProperty("--l-width",this._value.toString())});return}this.style.setProperty("--l-width",this._value.toString())}),this.defineAccessor("visible",t=>{this.ref.line.classList.toggle("uc-progress--hidden",!t)})}};e(rl,"ProgressBar");var In=rl;In.template='<div ref="line" class="uc-progress"></div>';var Si="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=";function jh(...S){return S.reduce((v,t)=>{if(typeof t=="string")return v[t]=!0,v;for(let u of Object.keys(t))v[u]=t[u];return v},{})}e(jh,"normalize");function He(...S){let v=jh(...S);return Object.keys(v).reduce((t,u)=>(v[u]&&t.push(u),t),[]).join(" ")}e(He,"classNames");function Fh(S,...v){let t=jh(...v);for(let u of Object.keys(t))S.classList.toggle(u,t[u])}e(Fh,"applyClassNames");var zh=e(S=>{if(!S)return ti;let v=gu(S).filter(t=>ti.includes(t));return v.length===0?ti:v},"parseTabs");function Bh(S){return{"*originalUrl":null,"*faderEl":null,"*cropperEl":null,"*imgEl":null,"*imgContainerEl":null,"*networkProblems":!1,"*imageSize":null,"*editorTransformations":{},"*cropPresetList":[],"*tabList":ti,"*tabId":De.CROP,entry:null,extension:null,editorMode:!1,modalCaption:"",isImage:!1,msg:"",src:Si,fileType:"",showLoader:!1,uuid:null,cdnUrl:null,cropPreset:"",tabs:fr(ti),"presence.networkProblems":!1,"presence.modalCaption":!0,"presence.editorToolbar":!1,"presence.viewerToolbar":!0,"*on.retryNetwork":()=>{let v=S.querySelectorAll("img");for(let t of v){let u=t.src;t.src=Si,t.src=u}S.$["*networkProblems"]=!1},"*on.apply":v=>{if(!v)return;let t=S.$["*originalUrl"],u=Xe(Hi(v),"preview"),x=ze(t,u),y={originalUrl:t,cdnUrlModifiers:u,cdnUrl:x,transformations:v};S.dispatchEvent(new CustomEvent("apply",{detail:y,bubbles:!0,composed:!0})),S.remove()},"*on.cancel":()=>{S.remove(),S.dispatchEvent(new CustomEvent("cancel",{bubbles:!0,composed:!0}))}}}e(Bh,"initState");var Uh="<svg width='0' height='0' style='position:absolute'><symbol viewBox='0 0 20 20' id='uc-icon-brightness' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M15 10a5 5 0 0 1-5 5m5-5a5 5 0 0 0-5-5m5 5h-5m0 5a5 5 0 0 1 0-10m0 10V5m0 15v-3M2.93 2.929 5.05 5.05M0 10h3m-.07 7.071 2.12-2.121M10 0v3m7.07 14.071-2.12-2.121M20 10h-3m.07-7.071L14.95 5.05m-.626 2.45H10m4.324 5H10'/></symbol><symbol fill='currentColor' viewBox='0 0 20 20' id='uc-icon-closeMax' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' d='M8.232 10 3.585 5.353l1.768-1.768L10 8.232l4.648-4.647 1.767 1.768L11.768 10l4.647 4.648-1.767 1.767L10 11.768l-4.647 4.647-1.768-1.767L8.232 10Z' clip-rule='evenodd'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-contrast' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M2 10a8 8 0 1 0 16 0 8 8 0 1 0-16 0m8-8v16m8-8h-8m7.598 2.5H10m6.24 2.5H10m7.6-7.5H10M16.242 5H10'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-crop' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M20 14H7.005C6.45 14 6 13.55 6 12.995V0M0 6h13.067c.515 0 .933.418.933.933V20M14.5.4 13 2l1.5 1.6M13 2h2a3 3 0 0 1 3 3v2M5.5 19.6 7 18l-1.5-1.6M7 18H5a3 3 0 0 1-3-3v-2'/></symbol><symbol fill='currentColor' viewBox='0 0 20 20' id='uc-icon-done' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' d='m18.057 6.333-9.365 9.125a1.25 1.25 0 0 1-1.768-.023L1.92 10.296l1.791-1.744 4.132 4.243 8.47-8.253 1.744 1.79Z' clip-rule='evenodd'/></symbol><symbol fill='currentColor' viewBox='0 0 25 24' id='uc-icon-edit-file' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' d='M18.558 2.804a.78.78 0 0 0-.557.235l-.008.007-2.472 2.46 3.847 3.848 2.46-2.473.004-.003a.78.78 0 0 0 0-1.108l-.004-.003-2.712-2.728a.78.78 0 0 0-.558-.235Zm-.248 7.613-3.852-3.852-8.93 8.887-1.516 5.41 5.41-1.515 8.888-8.93Zm-.636-8.934a2.28 2.28 0 0 1 2.512.505l2.702 2.717.002.002a2.278 2.278 0 0 1 0 3.234l-.002.002-12.541 12.602a.75.75 0 0 1-.33.193l-6.884 1.928a.75.75 0 0 1-.925-.924l1.928-6.885a.75.75 0 0 1 .193-.33l12.603-12.54a2.28 2.28 0 0 1 .742-.504Z' clip-rule='evenodd'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-enhance' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M19 13h-2m0 0a4 4 0 0 1-4-4m4 4a4 4 0 0 0-4 4m0-8V7m0 2a4 4 0 0 1-4 4m-2 0h2m0 0a4 4 0 0 1 4 4m0 0v2M8 8.5H6.5m0 0a2 2 0 0 1-2-2m2 2a2 2 0 0 0-2 2m0-4V5m0 1.5a2 2 0 0 1-2 2M1 8.5h1.5m0 0a2 2 0 0 1 2 2m0 0V12M12 3h-1m0 0a1 1 0 0 1-1-1m1 1a1 1 0 0 0-1 1m0-2V1m0 1a1 1 0 0 1-1 1M8 3h1m0 0a1 1 0 0 1 1 1m0 0v1'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-exposure' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M10 20v-3M2.93 2.929 5.05 5.05M0 10h3m-.07 7.071 2.12-2.121M10 0v3m7.07 14.071-2.12-2.121M20 10h-3m.07-7.071L14.95 5.05M5 10a5 5 0 1 0 10 0 5 5 0 1 0-10 0'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-filters' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M4.5 6.5a5.5 5.5 0 1 0 11 0 5.5 5.5 0 1 0-11 0m-3.5 6a5.5 5.5 0 1 0 11 0 5.5 5.5 0 1 0-11 0m7 0a5.5 5.5 0 1 0 11 0 5.5 5.5 0 1 0-11 0'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-flip' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M19.6 5 18 3.5 16.4 5m3.2 10L18 16.5 16.4 15M18 3.523v12.954M3.3 8.5h10.654c.301 0 .415-.395.159-.554L3.459 1.286A.3.3 0 0 0 3 1.542V8.2a.3.3 0 0 0 .3.3zm0 3h10.654c.301 0 .415.395.159.554l-10.654 6.66A.3.3 0 0 1 3 18.458v-6.66a.3.3 0 0 1 .3-.3z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-gamma' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M17 3C9 6 2.5 11.5 2.5 17.5m0 0h1m-1 0v-1m14 1h1m-3 0h1m-3 0h1m-3 0h1m-3 0h1m-3 0h1m-3 0h1m-3-14v-1m0 3v-1m0 3v-1m0 3v-1m0 3v-1m0 3v-1m0 3v-1'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-mirror' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M5 .4 3.5 2 5 3.6M15 .4 16.5 2 15 3.6M3.52 2h12.957M8.5 16.7V6.046c0-.301-.394-.415-.554-.159L1.287 16.541a.3.3 0 0 0 .255.459H8.2a.3.3 0 0 0 .3-.3zm3 0V6.046c0-.301.395-.415.555-.159l6.659 10.654a.3.3 0 0 1-.255.459H11.8a.3.3 0 0 1-.3-.3z'/></symbol><symbol viewBox='0 0 40 40' id='uc-icon-original' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.5' d='M0 40 40 0'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-rotate' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M13.5.4 12 2l1.5 1.6M12.023 2H14.4A3.6 3.6 0 0 1 18 5.6V8M4 17h9a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v9a1 1 0 0 0 1 1z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-sad' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M2 17c4.418-4 11.582-4 16 0M16.5 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm-11 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-saturation' xmlns='http://www.w3.org/2000/svg'><defs><linearGradient id='puc-icon-id__a' x1='10.001' y1='1' x2='10.001' y2='19' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient></defs><circle cx='10.001' cy='10' r='9' transform='rotate(90 10 10)' fill='url(#puc-icon-id__a)'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-slider' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M0 10h11m0 0a2 2 0 1 0 4 0m-4 0a2 2 0 1 1 4 0m0 0h5'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-tuning' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M8 10h11M1 10h4M1 4.5h11m3 0h4m-18 11h11m3 0h4m-7-11a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0M5 10a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0m7 5.5a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-vibrance' xmlns='http://www.w3.org/2000/svg'><path d='M2.125 5.64A8.96 8.96 0 0 0 1.001 10a8.96 8.96 0 0 0 1.124 4.36V5.64z' fill='url(#suc-icon-id__a)'/><path d='M2.875 15.499V4.502a9.053 9.053 0 0 1 1.75-1.72v14.437a9.05 9.05 0 0 1-1.75-1.72z' fill='url(#suc-icon-id__b)'/><path d='M5.375 17.722c.548.33 1.134.601 1.75.809V1.469a8.956 8.956 0 0 0-1.75.81v15.443z' fill='url(#suc-icon-id__c)'/><path d='M7.875 1.253v17.495c.564.136 1.15.22 1.75.244V1.008a9 9 0 0 0-1.75.245z' fill='url(#suc-icon-id__d)'/><path d='M10.375 1.008v17.984a9 9 0 0 0 1.75-.244V1.252a9 9 0 0 0-1.75-.244z' fill='url(#suc-icon-id__e)'/><path d='M12.875 1.469V18.53a8.957 8.957 0 0 0 1.75-.808V2.277a8.957 8.957 0 0 0-1.75-.808z' fill='url(#suc-icon-id__f)'/><path d='M15.375 2.78v14.44a9.053 9.053 0 0 0 1.75-1.72v-11a9.054 9.054 0 0 0-1.75-1.72z' fill='url(#suc-icon-id__g)'/><path d='M17.875 5.638v8.724A8.959 8.959 0 0 0 19.001 10a8.96 8.96 0 0 0-1.126-4.362z' fill='url(#suc-icon-id__h)'/><defs><linearGradient id='suc-icon-id__a' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='suc-icon-id__b' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='suc-icon-id__c' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='suc-icon-id__d' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='suc-icon-id__e' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='suc-icon-id__f' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='suc-icon-id__g' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='suc-icon-id__h' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient></defs></symbol><symbol viewBox='0 0 20 20' id='uc-icon-warmth' xmlns='http://www.w3.org/2000/svg'><path d='m7.5 13.05.429.42.171-.175v-.244h-.6zm5 0h-.6v.245l.172.175.428-.42zM8.1 3.5c0-1.05.85-1.9 1.9-1.9V.4a3.1 3.1 0 0 0-3.1 3.1h1.2zm0 9.55V3.5H6.9v9.55h1.2zm-1 2.45c0-.79.315-1.506.829-2.03l-.858-.84A4.088 4.088 0 0 0 5.9 15.5h1.2zm2.9 2.9a2.9 2.9 0 0 1-2.9-2.9H5.9a4.1 4.1 0 0 0 4.1 4.1v-1.2zm2.9-2.9a2.9 2.9 0 0 1-2.9 2.9v1.2a4.1 4.1 0 0 0 4.1-4.1h-1.2zm-.829-2.03c.514.524.829 1.24.829 2.03h1.2c0-1.117-.447-2.13-1.171-2.87l-.858.84zM11.9 3.5v9.55h1.2V3.5h-1.2zM10 1.6c1.05 0 1.9.85 1.9 1.9h1.2A3.1 3.1 0 0 0 10 .4v1.2z' fill='currentColor'/><path d='M10 14V8' stroke='currentColor' stroke-width='1.2' stroke-linecap='round'/><path d='M14 3h3m-3 3h3m-3 3h3m-8 6.5a1 1 0 1 0 2 0 1 1 0 1 0-2 0' stroke='currentColor' stroke-width='1.2'/></symbol></svg>";var Hh=`${Uh} <div class="uc-wrapper uc-wrapper_desktop"><uc-presence-toggle class="uc-network_problems_splash" set="visible: presence.networkProblems;"><div class="uc-network_problems_content"><div class="uc-network_problems_icon"><uc-icon name="sad"></uc-icon></div><div class="uc-network_problems_text">Network error</div></div><div class="uc-network_problems_footer"><uc-btn-ui theme="primary" text="Retry" set="onclick: *on.retryNetwork"></uc-btn-ui></div></uc-presence-toggle><div class="uc-viewport"><div class="uc-file_type_outer"><div class="uc-file_type">{{fileType}}</div></div><div class="uc-image_container" ref="img-container-el"><img src="${Si}" class="uc-image uc-image_visible_from_editor" ref="img-el" /><uc-editor-image-cropper ref="cropper-el"></uc-editor-image-cropper><uc-editor-image-fader ref="fader-el"></uc-editor-image-fader></div><div class="uc-info_pan">{{msg}}</div></div><div class="uc-toolbar"><uc-line-loader-ui set="active: showLoader"></uc-line-loader-ui><div class="uc-toolbar_content uc-toolbar_content__editor"><uc-editor-toolbar></uc-editor-toolbar></div></div></div>`;var ha=class ha extends ne{constructor(){super();st(this,"ctxOwner",!0);st(this,"_debouncedShowLoader",Ne(this._showLoader.bind(this),300));this.init$={...this.init$,...Bh(this)}}_showLoader(t){this.$.showLoader=t}_waitForSize(){return new Promise((u,x)=>{let y=setTimeout(()=>{x(new Error("[cloud-image-editor] timeout waiting for non-zero container size"))},3e3),I=new ResizeObserver(([l])=>{l.contentRect.width>0&&l.contentRect.height>0&&(u(),clearTimeout(y),I.disconnect())});I.observe(this)})}initCallback(){super.initCallback(),this.$["*faderEl"]=this.ref["fader-el"],this.$["*cropperEl"]=this.ref["cropper-el"],this.$["*imgContainerEl"]=this.ref["img-container-el"],this.initEditor()}async updateImage(){if(this.isConnected){if(await this._waitForSize(),this.$.cdnUrl){let t=ws(this.$.cdnUrl),u=Ui(this.$.cdnUrl,t);if(u===this.$["*originalUrl"])return;this.$["*originalUrl"]=u;let x=nu(this.$.cdnUrl),y=uu(x);this.$["*editorTransformations"]=y}else if(this.$.uuid){let t=Ui(this.cfg.cdnCname,this.$.uuid);if(t===this.$["*originalUrl"])return;this.$["*originalUrl"]=t,this.$["*editorTransformations"]={}}else throw new Error("No UUID nor CDN URL provided");this.$["*tabId"]===De.CROP?this.$["*cropperEl"].deactivate({reset:!0}):this.$["*faderEl"].deactivate();try{let t=await this.proxyUrl(ze(this.$["*originalUrl"],Xe("json"))),u=await fetch(t).then(I=>I.json()),{width:x,height:y}=u;this.$["*imageSize"]={width:x,height:y},this.$["*tabId"]===De.CROP?this.$["*cropperEl"].activate(this.$["*imageSize"]):this.$["*faderEl"].activate({url:this.$["*originalUrl"]})}catch(t){t&&console.error("Failed to load image info",t)}}}async initEditor(){try{await this._waitForSize()}catch(t){this.isConnected&&console.error(t.message);return}this.ref["img-el"].addEventListener("load",()=>{this._imgLoading=!1,this._debouncedShowLoader(!1),this.$.src!==Si&&(this.$["*networkProblems"]=!1)}),this.ref["img-el"].addEventListener("error",()=>{this._imgLoading=!1,this._debouncedShowLoader(!1),this.$["*networkProblems"]=!0}),this.sub("src",t=>{let u=this.ref["img-el"];u.src!==t&&(this._imgLoading=!0,u.src=t||Si)}),this.sub("cropPreset",t=>{this.$["*cropPresetList"]=Xs(t)}),this.sub("tabs",t=>{this.$["*tabList"]=zh(t)}),this.sub("*tabId",t=>{this.ref["img-el"].className=He("uc-image",{"uc-image_hidden_to_cropper":t===De.CROP,"uc-image_hidden_effects":t!==De.CROP})}),this.classList.add("uc-editor_ON"),this.sub("*networkProblems",t=>{this.$["presence.networkProblems"]=t,this.$["presence.modalCaption"]=!t}),this.sub("*editorTransformations",t=>{if(Object.keys(t).length===0)return;let u=this.$["*originalUrl"],x=Xe(Hi(t),"preview"),y=ze(u,x),I={originalUrl:u,cdnUrlModifiers:x,cdnUrl:y,transformations:t};this.dispatchEvent(new CustomEvent("change",{detail:I,bubbles:!0,composed:!0}))},!1),this.sub("uuid",t=>t&&this.updateImage()),this.sub("cdnUrl",t=>t&&this.updateImage())}};e(ha,"CloudImageEditorBlock"),st(ha,"styleAttrs",["uc-cloud-image-editor"]);var Ii=ha;Ii.template=Hh;Ii.bindAttributes({uuid:"uuid","cdn-url":"cdnUrl","crop-preset":"cropPreset",tabs:"tabs"});var nl=class nl extends ne{constructor(){super(),this.init$={...this.init$,dragging:!1},this._handlePointerUp=this._handlePointerUp_.bind(this),this._handlePointerMove=this._handlePointerMove_.bind(this),this._handleSvgPointerMove=this._handleSvgPointerMove_.bind(this)}_shouldThumbBeDisabled(v){let t=this.$["*imageBox"];if(!t)return;if(v===""&&t.height<=oe&&t.width<=oe)return!0;let u=t.height<=oe&&(v.includes("n")||v.includes("s")),x=t.width<=oe&&(v.includes("e")||v.includes("w"));return u||x}_createBackdrop(){let v=this.$["*cropBox"];if(!v)return;let{x:t,y:u,width:x,height:y}=v,I=this.ref["svg-el"],l=li("mask",{id:"backdrop-mask"}),c=li("rect",{x:0,y:0,width:"100%",height:"100%",fill:"white"}),T=li("rect",{x:t,y:u,width:x,height:y,fill:"black"});l.appendChild(c),l.appendChild(T);let P=li("rect",{x:0,y:0,width:"100%",height:"100%",fill:"var(--color-image-background)","fill-opacity":.85,mask:"url(#backdrop-mask)"});I.appendChild(P),I.appendChild(l),this._backdropMask=l,this._backdropMaskInner=T}_resizeBackdrop(){this._backdropMask&&(this._backdropMask.style.display="none",window.requestAnimationFrame(()=>{this._backdropMask&&(this._backdropMask.style.display="block")}))}_updateBackdrop(){let v=this.$["*cropBox"];if(!v)return;let{x:t,y:u,width:x,height:y}=v;this._backdropMaskInner&&tr(this._backdropMaskInner,{x:t,y:u,width:x,height:y})}_updateFrame(){let v=this.$["*cropBox"];if(!(!v||!this._frameGuides||!this._frameThumbs)){for(let t of Object.values(this._frameThumbs)){let{direction:u,pathNode:x,interactionNode:y,groupNode:I}=t,l=u==="",c=u.length===2,{x:T,y:P,width:L,height:N}=v;if(l)tr(y,{x:T,y:P,width:L,height:N});else{let b=Xi(Math.min(L,N)/(24*2+34)/2,0,1),{d:r,center:m}=c?Gu(v,u,b):Xu(v,u,b),p=Math.max(bo*Xi(Math.min(L,N)/bo/3,0,1),Yu);tr(y,{x:m[0]-p,y:m[1]-p,width:p*2,height:p*2}),tr(x,{d:r})}let j=this._shouldThumbBeDisabled(u);I.setAttribute("class",He("uc-thumb",{"uc-thumb--hidden":j,"uc-thumb--visible":!j}))}tr(this._frameGuides,{x:v.x-1*.5,y:v.y-1*.5,width:v.width+1,height:v.height+1})}}_createThumb(v,t){let u=li("g");u.classList.add("uc-thumb"),u.setAttribute("with-effects","");let x=li("rect",{fill:"transparent"}),y=li("path",{stroke:"currentColor",fill:"none","stroke-width":3});u.appendChild(y),u.appendChild(x),v[t]={direction:t,pathNode:y,interactionNode:x,groupNode:u},t===""&&(u.style.cursor="move"),x.addEventListener("pointerdown",this._handlePointerDown.bind(this,t))}_createThumbs(){let v={};for(let t=0;t<3;t++)for(let u=0;u<3;u++){let x=`${["n","","s"][t]}${["w","","e"][u]}`;x!==""&&this._createThumb(v,x)}return this._createThumb(v,""),v}_createGuides(){let v=li("svg"),t=li("rect",{x:0,y:0,width:"100%",height:"100%",fill:"none",stroke:"currentColor","stroke-width":1,"stroke-opacity":.5});v.appendChild(t);for(let u=1;u<=2;u++){let x=li("line",{x1:`${fn*u}%`,y1:"0%",x2:`${fn*u}%`,y2:"100%",stroke:"currentColor","stroke-width":1,"stroke-opacity":.3});v.appendChild(x)}for(let u=1;u<=2;u++){let x=li("line",{x1:"0%",y1:`${fn*u}%`,x2:"100%",y2:`${fn*u}%`,stroke:"currentColor","stroke-width":1,"stroke-opacity":.3});v.appendChild(x)}return v.classList.add("uc-guides","uc-guides--semi-hidden"),v}_createFrame(){let v=this.ref["svg-el"],t=document.createDocumentFragment(),u=this._createGuides();t.appendChild(u);let x=this._createThumbs();for(let{groupNode:y}of Object.values(x))t.appendChild(y);v.appendChild(t),this._frameThumbs=x,this._frameGuides=u}_handlePointerDown(v,t){if(!this._frameThumbs)return;let u=this._frameThumbs[v];if(this._shouldThumbBeDisabled(v))return;let x=this.$["*cropBox"],{x:y,y:I}=this.ref["svg-el"].getBoundingClientRect(),l=t.x-y,c=t.y-I;this.$.dragging=!0,this._draggingThumb=u,this._dragStartPoint=[l,c],this._dragStartCrop={...x}}_handlePointerUp_(v){this._updateCursor(),this.$.dragging&&(v.stopPropagation(),v.preventDefault(),this.$.dragging=!1)}_handlePointerMove_(v){if(!this.$.dragging||!this._dragStartPoint||!this._draggingThumb)return;v.stopPropagation(),v.preventDefault();let t=this.ref["svg-el"],{x:u,y:x}=t.getBoundingClientRect(),y=v.x-u,I=v.y-x,l=y-this._dragStartPoint[0],c=I-this._dragStartPoint[1],{direction:T}=this._draggingThumb,P=this._calcCropBox(T,[l,c]);P&&(this.$["*cropBox"]=P)}_calcCropBox(v,t){var T,P;let[u,x]=t,y=this.$["*imageBox"],I=(T=this._dragStartCrop)!=null?T:this.$["*cropBox"],l=(P=this.$["*cropPresetList"])==null?void 0:P[0],c=l?l.width/l.height:void 0;if(v===""?I=$u({rect:I,delta:[u,x],imageBox:y}):I=Zu({rect:I,delta:[u,x],direction:v,aspectRatio:c,imageBox:y}),!Object.values(I).every(L=>Number.isFinite(L)&&L>=0)){console.error("CropFrame is trying to create invalid rectangle",{payload:I});return}return pr(yr(I),this.$["*imageBox"])}_handleSvgPointerMove_(v){if(!this._frameThumbs)return;let t=Object.values(this._frameThumbs).find(u=>{if(this._shouldThumbBeDisabled(u.direction))return!1;let y=u.interactionNode.getBoundingClientRect(),I={x:y.x,y:y.y,width:y.width,height:y.height};return Ju(I,[v.x,v.y])});this._hoverThumb=t,this._updateCursor()}_updateCursor(){let v=this._hoverThumb;this.ref["svg-el"].style.cursor=v?Vu(v.direction):"initial"}_render(){this._updateBackdrop(),this._updateFrame()}toggleThumbs(v){this._frameThumbs&&Object.values(this._frameThumbs).map(({groupNode:t})=>t).forEach(t=>{t.setAttribute("class",He("uc-thumb",{"uc-thumb--hidden":!v,"uc-thumb--visible":v}))})}initCallback(){super.initCallback(),this._createBackdrop(),this._createFrame(),this.sub("*imageBox",()=>{this._resizeBackdrop(),window.requestAnimationFrame(()=>{this._render()})}),this.sub("*cropBox",v=>{v&&(this._guidesHidden=v.height<=oe||v.width<=oe,window.requestAnimationFrame(()=>{this._render()}))}),this.sub("dragging",v=>{this._frameGuides&&this._frameGuides.setAttribute("class",He({"uc-guides--hidden":this._guidesHidden,"uc-guides--visible":!this._guidesHidden&&v,"uc-guides--semi-hidden":!this._guidesHidden&&!v}))}),this.ref["svg-el"].addEventListener("pointermove",this._handleSvgPointerMove,!0),document.addEventListener("pointermove",this._handlePointerMove,!0),document.addEventListener("pointerup",this._handlePointerUp,!0)}destroyCallback(){super.destroyCallback(),document.removeEventListener("pointermove",this._handlePointerMove),document.removeEventListener("pointerup",this._handlePointerUp)}};e(nl,"CropFrame");var En=nl;En.template='<svg class="uc-svg" ref="svg-el" xmlns="http://www.w3.org/2000/svg"></svg>';var sl=class sl extends ne{constructor(){super(...arguments);st(this,"init$",{...this.init$,active:!1,title:"",icon:"","on.click":null,"title-prop":""})}initCallback(){super.initCallback(),this._titleEl=this.ref["title-el"],this._iconEl=this.ref["icon-el"],this.sub("title",t=>{this._titleEl&&(this._titleEl.style.display=t?"block":"none")}),this.sub("active",t=>{this.className=He({"uc-active":t,"uc-not_active":!t})}),this.sub("on.click",t=>{this.onclick=t})}};e(sl,"EditorButtonControl");var Li=sl;Li.template=`<button type="button" role="option" l10n="@title:title-prop"><uc-icon set="@name: icon;"></uc-icon><div class="uc-title" ref="title-el">{{title}}</div></button>`;function c1(S){let v=S+90;return v=v>=360?0:v,v}e(c1,"nextAngle");function u1(S,v){return S==="rotate"?c1(v):["mirror","flip"].includes(S)?!v:null}e(u1,"nextValue");var al=class al extends Li{initCallback(){super.initCallback(),this.defineAccessor("operation",v=>{v&&(this._operation=v,this.$.icon=v,this.bindL10n("title-prop",()=>this.l10n("a11y-cloud-editor-apply-crop",{name:this.l10n(v).toLowerCase()})))}),this.$["on.click"]=()=>{let v=this.$["*cropperEl"].getValue(this._operation),t=u1(this._operation,v);this.$["*cropperEl"].setValue(this._operation,t)}}};e(al,"EditorCropButtonControl");var Dr=al;var wn={FILTER:"filter",COLOR_OPERATION:"color_operation"},Ei="original",ol=class ol extends ne{constructor(){super(...arguments);st(this,"init$",{...this.init$,disabled:!1,min:0,max:100,value:0,defaultValue:0,zero:0,"on.input":t=>{this.$["*faderEl"].set(t),this.$.value=t}})}setOperation(t,u){this._controlType=t==="filter"?wn.FILTER:wn.COLOR_OPERATION,this._operation=t,this._iconName=t,this._title=t.toUpperCase(),this._filter=u,this._initializeValues(),this.$["*faderEl"].activate({url:this.$["*originalUrl"],operation:this._operation,value:this._filter===Ei?void 0:this.$.value,filter:this._filter===Ei?void 0:this._filter,fromViewer:!1})}_initializeValues(){let{range:t,zero:u}=yi[this._operation],[x,y]=t;this.$.min=x,this.$.max=y,this.$.zero=u;let I=this.$["*editorTransformations"][this._operation];if(this._controlType===wn.FILTER){let l=y;if(I){let{name:c,amount:T}=I;l=c===this._filter?T:y}this.$.value=l,this.$.defaultValue=l}if(this._controlType===wn.COLOR_OPERATION){let l=typeof I!="undefined"?I:u;this.$.value=l,this.$.defaultValue=l}}apply(){let t;this._controlType===wn.FILTER?this._filter===Ei?t=null:t={name:this._filter,amount:this.$.value}:t=this.$.value;let u={...this.$["*editorTransformations"],[this._operation]:t};this.$["*editorTransformations"]=u}cancel(){this.$["*faderEl"].deactivate({hide:!1})}initCallback(){super.initCallback(),this.sub("*originalUrl",t=>{this._originalUrl=t}),this.sub("value",t=>{let u=`${this._filter||this._operation} ${t}`;this.$["*operationTooltip"]=u})}};e(ol,"EditorSlider");var Mn=ol;Mn.template=`<uc-slider-ui ref="slider-el" set="disabled: disabled; min: min; max: max; defaultValue: defaultValue; zero: zero; onInput: on.input;" ></uc-slider-ui>`;function Tn(S){let v=new Image;return{promise:new Promise((x,y)=>{v.src=S,v.onload=x,v.onerror=y}),image:v,cancel:e(()=>{v.naturalWidth===0&&(v.src=Si)},"cancel")}}e(Tn,"preloadImage");function An(S){let v=[];for(let y of S){let I=Tn(y);v.push(I)}let t=v.map(y=>y.image);return{promise:Promise.allSettled(v.map(y=>y.promise)),images:t,cancel:e(()=>{v.forEach(y=>{y.cancel()})},"cancel")}}e(An,"batchPreloadImages");var ll=class ll extends Li{constructor(){super(),this.init$={...this.init$,active:!1,title:"",icon:"",isOriginal:!1,iconSize:"20","on.click":null}}_previewSrc(){let v=parseInt(window.getComputedStyle(this).getPropertyValue("--l-base-min-width"),10),t=window.devicePixelRatio,u=Math.ceil(t*v),x=t>=2?"lightest":"normal",y=100,I={...this.$["*editorTransformations"]};return I[this._operation]=this._filter!==Ei?{name:this._filter,amount:y}:void 0,ze(this._originalUrl,Xe(Ms,Hi(I),`quality/${x}`,`scale_crop/${u}x${u}/center`))}async _observerCallback(v,t){var x;if(v[0].isIntersecting){let y=await this.proxyUrl(this._previewSrc()),I=this.ref["preview-el"],{promise:l,cancel:c}=Tn(y);this._cancelPreload=c,l.catch(T=>{this.$["*networkProblems"]=!0,console.error("Failed to load image",{error:T})}).finally(()=>{I.style.backgroundImage=`url(${y})`,I.setAttribute("loaded",""),t.unobserve(this)})}else(x=this._cancelPreload)==null||x.call(this)}initCallback(){super.initCallback(),this.$["on.click"]=()=>{this.$.active?this.$.isOriginal||(this.$["*sliderEl"].setOperation(this._operation,this._filter),this.$["*showSlider"]=!0):(this.$["*sliderEl"].setOperation(this._operation,this._filter),this.$["*sliderEl"].apply()),this.$["*currentFilter"]=this._filter},this.defineAccessor("filter",t=>{this._operation="filter",this._filter=t,this.$.isOriginal=t===Ei,this.$.icon=this.$.isOriginal?"original":"slider",this.bindL10n("title-prop",()=>this.l10n("a11y-cloud-editor-apply-filter",{name:t.toLowerCase()}))}),this._observer=new window.IntersectionObserver(this._observerCallback.bind(this),{threshold:[0,1]});let v=this.$["*originalUrl"];this._originalUrl=v,this.$.isOriginal?this.ref["icon-el"].classList.add("uc-original-icon"):this._observer.observe(this),this.sub("*currentFilter",t=>{this.$.active=t&&t===this._filter}),this.sub("isOriginal",t=>{this.$.iconSize=t?40:20}),this.sub("active",t=>{if(this.$.isOriginal)return;let u=this.ref["icon-el"];u.style.opacity=t?"1":"0";let x=this.ref["preview-el"];t?x.style.opacity="0":x.style.backgroundImage&&(x.style.opacity="1")}),this.sub("*networkProblems",async t=>{if(!t){let u=await this.proxyUrl(this._previewSrc()),x=this.ref["preview-el"];x.style.backgroundImage&&(x.style.backgroundImage="none",x.style.backgroundImage=`url(${u})`)}})}destroyCallback(){var v,t;super.destroyCallback(),(v=this._observer)==null||v.disconnect(),(t=this._cancelPreload)==null||t.call(this)}};e(ll,"EditorFilterControl");var or=ll;or.template=`<button type="button" role="option" l10n="@title:title-prop"><div class="uc-preview" ref="preview-el"></div><uc-icon ref="icon-el" set="@name: icon; @size: iconSize;"></uc-icon></button>`;var cl=class cl extends Li{constructor(){super(...arguments);st(this,"_operation","")}initCallback(){super.initCallback(),this.$["on.click"]=t=>{this.$["*sliderEl"].setOperation(this._operation),this.$["*showSlider"]=!0,this.$["*currentOperation"]=this._operation},this.defineAccessor("operation",t=>{t&&(this._operation=t,this.$.icon=t,this.bindL10n("title-prop",()=>this.l10n("a11y-cloud-editor-apply-tuning",{name:this.l10n(t).toLowerCase()})),this.bindL10n("title",()=>this.l10n(t)))}),this.sub("*editorTransformations",t=>{if(!this._operation)return;let{zero:u}=yi[this._operation],x=t[this._operation],y=typeof x!="undefined"?x!==u:!1;this.$.active=y})}};e(cl,"EditorOperationControl");var kr=cl;function Wh(S,v){let t={};for(let u of v){let x=S[u];(S.hasOwnProperty(u)||x!==void 0)&&(t[u]=x)}return t}e(Wh,"pick");function Pr(S,v,t){let x=window.devicePixelRatio,y=Math.min(Math.ceil(v*x),3e3),I=x>=2?"lightest":"normal";return ze(S,Xe(Ms,Hi(t),`quality/${I}`,`stretch/off/-/resize/${y}x`,`@clib/${er}/${ir}/uc-cloud-image-editor/`))}e(Pr,"viewerImageSrc");function h1(S){return S?[({dimensions:t,coords:u})=>[...t,...u].every(x=>Number.isInteger(x)&&Number.isFinite(x)),({dimensions:t,coords:u})=>t.every(x=>x>0)&&u.every(x=>x>=0)].every(t=>t(S)):!0}e(h1,"validateCrop");var ul=class ul extends ne{constructor(){super();st(this,"ctxOwner",!0);this.init$={...this.init$,image:null,"*padding":20,"*operations":{rotate:0,mirror:!1,flip:!1},"*imageBox":{x:0,y:0,width:0,height:0},"*cropBox":{x:0,y:0,width:0,height:0}},this._commitDebounced=Ne(this._commit.bind(this),300),this._handleResizeThrottled=ca(this._handleResize.bind(this),100),this._imageSize={width:0,height:0}}_handleResize(){!this.isConnected||!this._isActive||(this._initCanvas(),this._syncTransformations(),this._alignImage(),this._alignCrop(),this._draw())}_syncTransformations(){let t=this.$["*editorTransformations"],u=Wh(t,Object.keys(this.$["*operations"])),x={...this.$["*operations"],...u};this.$["*operations"]=x}_initCanvas(){let t=this.ref["canvas-el"],u=t.getContext("2d"),x=this.offsetWidth,y=this.offsetHeight,I=window.devicePixelRatio;t.style.width=`${x}px`,t.style.height=`${y}px`,t.width=x*I,t.height=y*I,u==null||u.scale(I,I),this._canvas=t,this._ctx=u}_alignImage(){if(!this._isActive||!this.$.image)return;let t=this.$.image,u=this.$["*padding"],x=this.$["*operations"],{rotate:y}=x,I={width:this.offsetWidth,height:this.offsetHeight},l=mr({width:t.naturalWidth,height:t.naturalHeight},y),c;if(l.width>I.width-u*2||l.height>I.height-u*2){let T=l.width/l.height,P=I.width/I.height;if(T>P){let L=I.width-u*2,N=L/T,j=0+u,b=u+(I.height-u*2)/2-N/2;c={x:j,y:b,width:L,height:N}}else{let L=I.height-u*2,N=L*T,j=u+(I.width-u*2)/2-N/2,b=0+u;c={x:j,y:b,width:N,height:L}}}else{let{width:T,height:P}=l,L=u+(I.width-u*2)/2-T/2,N=u+(I.height-u*2)/2-P/2;c={x:L,y:N,width:T,height:P}}this.$["*imageBox"]=yr(c)}_alignCrop(){var N;let t=this.$["*cropBox"],u=this.$["*imageBox"],x=this.$["*operations"],{rotate:y}=x,I=this.$["*editorTransformations"].crop,{width:l,x:c,y:T}=this.$["*imageBox"];if(I){let{dimensions:[j,b],coords:[r,m]}=I,{width:p}=mr(this._imageSize,y),i=l/p;t=pr(yr({x:c+r*i,y:T+m*i,width:j*i,height:b*i}),this.$["*imageBox"])}let P=(N=this.$["*cropPresetList"])==null?void 0:N[0],L=P?P.width/P.height:void 0;if(!Ku(t,u)||L&&!Qu(t,L)){let j=u.width/u.height,b=u.width,r=u.height;L&&(j>L?b=Math.min(u.height*L,u.width):r=Math.min(u.width/L,u.height)),t={x:u.x+u.width/2-b/2,y:u.y+u.height/2-r/2,width:b,height:r}}this.$["*cropBox"]=pr(yr(t),this.$["*imageBox"])}_drawImage(){let t=this._ctx;if(!t)return;let u=this.$.image,x=this.$["*imageBox"],y=this.$["*operations"],{mirror:I,flip:l,rotate:c}=y,T=mr({width:x.width,height:x.height},c);t.save(),t.translate(x.x+x.width/2,x.y+x.height/2),t.rotate(c*Math.PI*-1/180),t.scale(I?-1:1,l?-1:1),t.drawImage(u,-T.width/2,-T.height/2,T.width,T.height),t.restore()}_draw(){if(!this._isActive||!this.$.image||!this._canvas||!this._ctx)return;let t=this._canvas;this._ctx.clearRect(0,0,t.width,t.height),this._drawImage()}_animateIn({fromViewer:t}){this.$.image&&(this.ref["frame-el"].toggleThumbs(!0),this._transitionToImage(),setTimeout(()=>{this.className=He({"uc-active_from_viewer":t,"uc-active_from_editor":!t,"uc-inactive_to_editor":!1})}))}_getCropDimensions(){let t=this.$["*cropBox"],u=this.$["*imageBox"],x=this.$["*operations"],{rotate:y}=x,{width:I,height:l}=u,{width:c,height:T}=mr(this._imageSize,y),{width:P,height:L}=t,N=I/c,j=l/T;return[Xi(Math.round(P/N),1,c),Xi(Math.round(L/j),1,T)]}_getCropTransformation(){let t=this.$["*cropBox"],u=this.$["*imageBox"],x=this.$["*operations"],{rotate:y}=x,{width:I,height:l,x:c,y:T}=u,{width:P,height:L}=mr(this._imageSize,y),{x:N,y:j}=t,b=I/P,r=l/L,m=this._getCropDimensions(),p={dimensions:m,coords:[Xi(Math.round((N-c)/b),0,P-m[0]),Xi(Math.round((j-T)/r),0,L-m[1])]};if(!h1(p)){console.error("Cropper is trying to create invalid crop object",{payload:p});return}if(!(m[0]===P&&m[1]===L))return p}_commit(){if(!this.isConnected||!this._imageSize)return;let t=this.$["*operations"],{rotate:u,mirror:x,flip:y}=t,I=this._getCropTransformation(),c={...this.$["*editorTransformations"],crop:I,rotate:u,mirror:x,flip:y};this.$["*editorTransformations"]=c}setValue(t,u){this.$["*operations"]={...this.$["*operations"],[t]:u},this._isActive&&(this._alignImage(),this._alignCrop(),this._draw())}getValue(t){return this.$["*operations"][t]}async activate(t,{fromViewer:u}={}){if(!this._isActive){this._isActive=!0,this._imageSize=t,this.removeEventListener("transitionend",this._reset);try{this.$.image=await this._waitForImage(this.$["*originalUrl"],this.$["*editorTransformations"]),this._syncTransformations(),this._animateIn({fromViewer:u})}catch(x){console.error("Failed to activate cropper",{error:x})}this._observer=new ResizeObserver(([x])=>{x.contentRect.width>0&&x.contentRect.height>0&&this._isActive&&this.$.image&&this._handleResizeThrottled()}),this._observer.observe(this)}}deactivate({reset:t=!1}={}){var u;this._isActive&&(!t&&this._commit(),this._isActive=!1,this._transitionToCrop(),this.className=He({"uc-active_from_viewer":!1,"uc-active_from_editor":!1,"uc-inactive_to_editor":!0}),this.ref["frame-el"].toggleThumbs(!1),this.addEventListener("transitionend",this._reset,{once:!0}),(u=this._observer)==null||u.disconnect())}_transitionToCrop(){let t=this._getCropDimensions(),u=Math.min(this.offsetWidth,t[0])/this.$["*cropBox"].width,x=Math.min(this.offsetHeight,t[1])/this.$["*cropBox"].height,y=Math.min(u,x),I=this.$["*cropBox"].x+this.$["*cropBox"].width/2,l=this.$["*cropBox"].y+this.$["*cropBox"].height/2;this.style.transform=`scale(${y}) translate(${(this.offsetWidth/2-I)/y}px, ${(this.offsetHeight/2-l)/y}px)`,this.style.transformOrigin=`${I}px ${l}px`}_transitionToImage(){let t=this.$["*cropBox"].x+this.$["*cropBox"].width/2,u=this.$["*cropBox"].y+this.$["*cropBox"].height/2;this.style.transform="scale(1)",this.style.transformOrigin=`${t}px ${u}px`}_reset(){this._isActive||(this.$.image=null)}async _waitForImage(t,u){var P;let x=this.offsetWidth;u={...u,crop:void 0,rotate:void 0,flip:void 0,mirror:void 0};let y=await this.proxyUrl(Pr(t,x,u)),{promise:I,cancel:l,image:c}=Tn(y),T=this._handleImageLoading(y);return c.addEventListener("load",T,{once:!0}),c.addEventListener("error",T,{once:!0}),(P=this._cancelPreload)==null||P.call(this),this._cancelPreload=l,I.then(()=>c).catch(L=>(console.error("Failed to load image",{error:L}),this.$["*networkProblems"]=!0,Promise.resolve(c)))}_handleImageLoading(t){let u="crop",x=this.$["*loadingOperations"];return x.get(u)||x.set(u,new Map),x.get(u).get(t)||(x.set(u,x.get(u).set(t,!0)),this.$["*loadingOperations"]=x),()=>{var y;(y=x==null?void 0:x.get(u))!=null&&y.has(t)&&(x.get(u).delete(t),this.$["*loadingOperations"]=x)}}initCallback(){super.initCallback(),this.sub("*imageBox",()=>{this._draw()}),this.sub("*cropBox",()=>{this.$.image&&this._commitDebounced()}),this.sub("*cropPresetList",()=>{this._alignCrop()}),setTimeout(()=>{this.sub("*networkProblems",t=>{t||this._isActive&&this.activate(this._imageSize,{fromViewer:!1})})},0)}destroyCallback(){var t;super.destroyCallback(),(t=this._observer)==null||t.disconnect()}};e(ul,"EditorImageCropper");var On=ul;On.template=`<canvas class="uc-canvas" ref="canvas-el"></canvas><uc-crop-frame ref="frame-el"></uc-crop-frame>`;function hl(S,v,t){let u=Array(t);t--;for(let x=t;x>=0;x--)u[x]=Math.ceil((x*v+(t-x)*S)/t);return u}e(hl,"linspace");function f1(S){return S.reduce((v,t,u)=>u<S.length-1?[...v,[t,S[u+1]]]:v,[])}e(f1,"splitBySections");function d1(S,v,t){let u=f1(S).find(([x,y])=>x<=v&&v<=y);return S.map(x=>{let y=Math.abs(u[0]-u[1]),I=Math.abs(v-u[0])/y;return u[0]===x?v>t?1:1-I:u[1]===x?v>=t?I:1:0})}e(d1,"calculateOpacities");function g1(S,v){return S.map((t,u)=>t<v?S.length-u:u)}e(g1,"calculateZIndices");function Yh(S,v){let t=yi[S].keypointsNumber,{range:u,zero:x}=yi[S];return[...new Set([...hl(u[0],x,t+1),...hl(x,u[1],t+1),x,v])].sort((y,I)=>y-I)}e(Yh,"keypointsRange");var fl=class fl extends ne{constructor(){super(),this._isActive=!1,this._hidden=!0,this._addKeypointDebounced=Ne(this._addKeypoint.bind(this),600),this.classList.add("uc-inactive_to_cropper")}_handleImageLoading(v){let t=this._operation,u=this.$["*loadingOperations"];return u.get(t)||u.set(t,new Map),u.get(t).get(v)||(u.set(t,u.get(t).set(v,!0)),this.$["*loadingOperations"]=u),()=>{var x;(x=u==null?void 0:u.get(t))!=null&&x.has(v)&&(u.get(t).delete(v),this.$["*loadingOperations"]=u)}}_flush(){window.cancelAnimationFrame(this._raf),this._raf=window.requestAnimationFrame(()=>{for(let v of this._keypoints){let{image:t}=v;t&&(t.style.opacity=v.opacity.toString(),t.style.zIndex=v.zIndex.toString())}})}async _imageSrc({url:v=this._url,filter:t=this._filter,operation:u,value:x}={}){let y={...this._transformations};u&&(y[u]=t?{name:t,amount:x}:x);let I=this.offsetWidth;return await this.proxyUrl(Pr(v,I,y))}async _constructKeypoint(v,t){return{src:await this._imageSrc({operation:v,value:t}),image:null,opacity:0,zIndex:0,value:t}}_isSame(v,t){return this._operation===v&&this._filter===t}async _addKeypoint(v,t,u){let x=e(()=>!this._isSame(v,t)||this._value!==u||!!this._keypoints.find(c=>c.value===u),"shouldSkip");if(x())return;let y=await this._constructKeypoint(v,u),I=new Image;I.src=y.src;let l=this._handleImageLoading(y.src);I.addEventListener("load",l,{once:!0}),I.addEventListener("error",l,{once:!0}),y.image=I,I.classList.add("uc-fader-image"),I.addEventListener("load",()=>{if(x())return;let c=this._keypoints,T=c.findIndex(L=>L.value>u),P=T<c.length?c[T].image:null;!this._container||P&&!this._container.contains(P)||(c.splice(T,0,y),this._container.insertBefore(I,P),this._update(v,u))},{once:!0}),I.addEventListener("error",()=>{this.$["*networkProblems"]=!0},{once:!0})}set(v){v=typeof v=="string"?parseInt(v,10):v,this._update(this._operation,v),this._addKeypointDebounced(this._operation,this._filter,v)}_update(v,t){this._operation=v,this._value=t;let{zero:u}=yi[v],x=this._keypoints.map(l=>l.value),y=d1(x,t,u),I=g1(x,u);for(let[l,c]of Object.entries(this._keypoints))c.opacity=y[l],c.zIndex=I[l];this._flush()}_createPreviewImage(){let v=new Image;return v.classList.add("uc-fader-image","uc-fader-image--preview"),v.style.opacity="0",v}async _initNodes(){let v=document.createDocumentFragment();this._previewImage=this._previewImage||this._createPreviewImage(),!this.contains(this._previewImage)&&v.appendChild(this._previewImage);let t=document.createElement("div");v.appendChild(t);let u=this._keypoints.map(T=>T.src),{images:x,promise:y,cancel:I}=An(u);x.forEach(T=>{let P=this._handleImageLoading(T.src);T.addEventListener("load",P),T.addEventListener("error",P)}),this._cancelLastImages=()=>{I(),this._cancelLastImages=void 0};let l=this._operation,c=this._filter;await y,this._isActive&&this._isSame(l,c)&&(this._container&&this._container.remove(),this._container=t,this._keypoints.forEach((T,P)=>{let L=x[P];L.classList.add("uc-fader-image"),T.image=L,this._container.appendChild(L)}),this.appendChild(v),this._flush())}async setTransformations(v){if(this._transformations=v,this._previewImage){let t=await this._imageSrc(),u=this._handleImageLoading(t);this._previewImage.src=t,this._previewImage.addEventListener("load",u,{once:!0}),this._previewImage.addEventListener("error",u,{once:!0}),this._previewImage.style.opacity="1",this._previewImage.addEventListener("error",()=>{this.$["*networkProblems"]=!0},{once:!0})}}async preload({url:v,filter:t,operation:u,value:x}){this._cancelBatchPreload&&this._cancelBatchPreload();let y=Yh(u,x),I=await Promise.all(y.map(c=>this._imageSrc({url:v,filter:t,operation:u,value:c}))),{cancel:l}=An(I);this._cancelBatchPreload=l}_setOriginalSrc(v){let t=this._previewImage||this._createPreviewImage();if(!this.contains(t)&&this.appendChild(t),this._previewImage=t,t.src===v){t.style.opacity="1",t.style.transform="scale(1)",this.className=He({"uc-active_from_viewer":this._fromViewer,"uc-active_from_cropper":!this._fromViewer,"uc-inactive_to_cropper":!1});return}t.style.opacity="0";let u=this._handleImageLoading(v);t.addEventListener("error",u,{once:!0}),t.src=v,t.addEventListener("load",()=>{u(),t&&(t.style.opacity="1",t.style.transform="scale(1)",this.className=He({"uc-active_from_viewer":this._fromViewer,"uc-active_from_cropper":!this._fromViewer,"uc-inactive_to_cropper":!1}))},{once:!0}),t.addEventListener("error",()=>{this.$["*networkProblems"]=!0},{once:!0})}async activate({url:v,operation:t,value:u,filter:x,fromViewer:y}){if(this._isActive=!0,this._hidden=!1,this._url=v,this._operation=t||"initial",this._value=u,this._filter=x,this._fromViewer=y,typeof u!="number"&&!x){let l=await this._imageSrc({operation:t,value:u});this._setOriginalSrc(l),this._container&&this._container.remove();return}this._keypoints=await Promise.all(Yh(t,u).map(l=>this._constructKeypoint(t,l))),this._update(t,u),this._initNodes()}deactivate({hide:v=!0}={}){this._isActive=!1,this._cancelLastImages&&this._cancelLastImages(),this._cancelBatchPreload&&this._cancelBatchPreload(),v&&!this._hidden?(this._hidden=!0,this._previewImage&&(this._previewImage.style.transform="scale(1)"),this.className=He({"uc-active_from_viewer":!1,"uc-active_from_cropper":!1,"uc-inactive_to_cropper":!0}),this.addEventListener("transitionend",()=>{this._container&&this._container.remove()},{once:!0})):this._container&&this._container.remove()}};e(fl,"EditorImageFader");var fa=fl;var v1=1,dl=class dl extends ne{initCallback(){super.initCallback(),this.addEventListener("wheel",v=>{v.preventDefault();let{deltaY:t,deltaX:u}=v;Math.abs(u)>v1?this.scrollLeft+=u:this.scrollLeft+=t},{passive:!1}),this.addEventListener("scroll",()=>{},{passive:!0})}};e(dl,"EditorScroller");var Dn=dl;Dn.template=" <slot></slot> ";function p1(S){return`<uc-presence-toggle class="uc-tab-toggle" set="visible: presence.tabToggle.${S}; styles: presence.tabToggleStyles;" ><uc-btn-ui theme="tab" ref="tab-toggle-${S}" data-id="${S}" icon="${S}" set="onclick: on.clickTab; aria-role:tab_role; aria-controls:tab_${S}; title-prop: a11y-editor-tab-${S}" ></uc-btn-ui></uc-presence-toggle>`}e(p1,"renderTabToggle");function m1(S){return`<uc-presence-toggle id="tab_${S}" class="uc-tab-content" set="visible: presence.tabContent.${S}; styles: presence.tabContentStyles" ><uc-editor-scroller hidden-scrollbar><div class="uc-controls-list_align"><div role="listbox" aria-orientation="horizontal" class="uc-controls-list_inner" ref="controls-list-${S}" ></div></div></uc-editor-scroller></uc-presence-toggle>`}e(m1,"renderTabContent");var gl=class gl extends ne{constructor(){super();st(this,"_updateInfoTooltip",Ne(()=>{var I,l;let t=this.$["*editorTransformations"],u=this.$["*currentOperation"],x="",y=!1;if(this.$["*tabId"]===De.FILTERS)if(y=!0,this.$["*currentFilter"]&&((I=t==null?void 0:t.filter)==null?void 0:I.name)===this.$["*currentFilter"]){let c=((l=t==null?void 0:t.filter)==null?void 0:l.amount)||100;x=this.$["*currentFilter"]+" "+c}else x=this.l10n(Ei);else if(this.$["*tabId"]===De.TUNING&&u){y=!0;let c=(t==null?void 0:t[u])||yi[u].zero;x=this.l10n(u)+" "+c}y&&(this.$["*operationTooltip"]=x),this.ref["tooltip-el"].classList.toggle("uc-info-tooltip_visible",y)},0));this.init$={...this.init$,"*sliderEl":null,"*loadingOperations":new Map,"*showSlider":!1,"*currentFilter":Ei,"*currentOperation":null,showLoader:!1,filters:fu,colorOperations:hu,cropOperations:du,"*operationTooltip":null,"presence.mainToolbar":!0,"presence.subToolbar":!1,"presence.tabToggles":!0,"presence.tabContent.crop":!1,"presence.tabContent.tuning":!1,"presence.tabContent.filters":!1,"presence.tabToggle.crop":!0,"presence.tabToggle.tuning":!0,"presence.tabToggle.filters":!0,"presence.subTopToolbarStyles":{hidden:"uc-sub-toolbar--top-hidden",visible:"uc-sub-toolbar--visible"},"presence.subBottomToolbarStyles":{hidden:"uc-sub-toolbar--bottom-hidden",visible:"uc-sub-toolbar--visible"},"presence.tabContentStyles":{hidden:"uc-tab-content--hidden",visible:"uc-tab-content--visible"},"presence.tabToggleStyles":{hidden:"uc-tab-toggle--hidden",visible:"uc-tab-toggle--visible"},"presence.tabTogglesStyles":{hidden:"uc-tab-toggles--hidden",visible:"uc-tab-toggles--visible"},"on.cancel":()=>{var t;(t=this._cancelPreload)==null||t.call(this),this.$["*on.cancel"]()},"on.apply":()=>{this.$["*on.apply"](this.$["*editorTransformations"])},"on.applySlider":()=>{this.ref["slider-el"].apply(),this._onSliderClose()},"on.cancelSlider":()=>{this.ref["slider-el"].cancel(),this._onSliderClose()},"on.clickTab":t=>{let u=t.currentTarget.getAttribute("data-id");u&&this._activateTab(u,{fromViewer:!1})},tab_role:"tab",[`tab_${De.TUNING}`]:`tab_${De.TUNING}`,[`tab_${De.CROP}`]:`tab_${De.CROP}`,[`tab_${De.FILTERS}`]:`tab_${De.FILTERS}`,cancel:"cancel",apply:"apply","a11y-editor-tab-filters":"a11y-editor-tab-filters","a11y-editor-tab-tuning":"a11y-editor-tab-tuning","a11y-editor-tab-crop":"a11y-editor-tab-crop"},this._debouncedShowLoader=Ne(this._showLoader.bind(this),500)}_onSliderClose(){this.$["*showSlider"]=!1,this.$["*tabId"]===De.TUNING&&this.ref["tooltip-el"].classList.toggle("uc-info-tooltip_visible",!1)}_createOperationControl(t){let u=new kr;return u.operation=t,u}_createFilterControl(t){let u=new or;return u.filter=t,u}_createToggleControl(t){let u=new Dr;return u.operation=t,u}_renderControlsList(t){let u=this.ref[`controls-list-${t}`],x=document.createDocumentFragment();t===De.CROP?this.$.cropOperations.forEach(y=>{let I=this._createToggleControl(y);x.appendChild(I)}):t===De.FILTERS?[Ei,...this.$.filters].forEach(y=>{let I=this._createFilterControl(y);x.appendChild(I)}):t===De.TUNING&&this.$.colorOperations.forEach(y=>{let I=this._createOperationControl(y);x.appendChild(I)}),[...x.children].forEach((y,I)=>{I===x.childNodes.length-1&&y.classList.add("uc-controls-list_last-item")}),u.innerHTML="",u.appendChild(x)}_activateTab(t,{fromViewer:u}){this.$["*tabId"]=t,t===De.CROP?(this.$["*faderEl"].deactivate(),this.$["*cropperEl"].activate(this.$["*imageSize"],{fromViewer:u})):(this.$["*faderEl"].activate({url:this.$["*originalUrl"],fromViewer:u}),this.$["*cropperEl"].deactivate());for(let x of ti){let y=x===t,I=this.ref[`tab-toggle-${x}`];I.active=y,y?(this._renderControlsList(t),this._syncTabIndicator()):this._unmountTabControls(x),this.$[`presence.tabContent.${x}`]=y}}_unmountTabControls(t){let u=this.ref[`controls-list-${t}`];u&&(u.innerHTML="")}_syncTabIndicator(){let t=this.ref[`tab-toggle-${this.$["*tabId"]}`],u=this.ref["tabs-indicator"];u.style.transform=`translateX(${t.offsetLeft}px)`}async _preloadEditedImage(){var t;if(this.$["*imgContainerEl"]&&this.$["*originalUrl"]){let u=this.$["*imgContainerEl"].offsetWidth,x=await this.proxyUrl(Pr(this.$["*originalUrl"],u,this.$["*editorTransformations"]));(t=this._cancelPreload)==null||t.call(this);let{cancel:y}=An([x]);this._cancelPreload=()=>{y(),this._cancelPreload=void 0}}}_showLoader(t){this.$.showLoader=t}initCallback(){super.initCallback(),this.$["*sliderEl"]=this.ref["slider-el"],this.sub("*imageSize",t=>{t&&setTimeout(()=>{this._activateTab(this.$["*tabId"],{fromViewer:!0})},0)}),this.sub("*editorTransformations",t=>{var x;let u=(x=t==null?void 0:t.filter)==null?void 0:x.name;this.$["*currentFilter"]!==u&&(this.$["*currentFilter"]=u)}),this.sub("*currentFilter",()=>{this._updateInfoTooltip()}),this.sub("*currentOperation",()=>{this._updateInfoTooltip()}),this.sub("*tabId",()=>{this._updateInfoTooltip()}),this.sub("*originalUrl",()=>{this.$["*faderEl"]&&this.$["*faderEl"].deactivate()}),this.sub("*editorTransformations",t=>{this._preloadEditedImage(),this.$["*faderEl"]&&this.$["*faderEl"].setTransformations(t)}),this.sub("*loadingOperations",t=>{let u=!1;for(let[,x]of t.entries()){if(u)break;for(let[,y]of x.entries())if(y){u=!0;break}}this._debouncedShowLoader(u)}),this.sub("*showSlider",t=>{this.$["presence.subToolbar"]=t,this.$["presence.mainToolbar"]=!t}),this.sub("*tabList",t=>{this.$["presence.tabToggles"]=t.length>1;for(let u of ti){this.$[`presence.tabToggle.${u}`]=t.includes(u);let x=this.ref[`tab-toggle-${u}`];x.style.gridColumn=t.indexOf(u)+1}t.includes(this.$["*tabId"])||this._activateTab(t[0],{fromViewer:!1})}),this._updateInfoTooltip()}};e(gl,"EditorToolbar");var kn=gl;kn.template=`<uc-line-loader-ui set="active: showLoader"></uc-line-loader-ui><div class="uc-info-tooltip_container"><div class="uc-info-tooltip_wrapper"><div ref="tooltip-el" class="uc-info-tooltip uc-info-tooltip_hidden">{{*operationTooltip}}</div></div></div><div class="uc-toolbar-container"><uc-presence-toggle role="tablist" class="uc-sub-toolbar" set="visible: presence.mainToolbar; styles: presence.subTopToolbarStyles" ><div class="uc-tab-content-row">${ti.map(m1).join("")}</div><div class="uc-controls-row"><uc-presence-toggle class="uc-tab-toggles" set="visible: presence.tabToggles; styles: presence.tabTogglesStyles" ><div ref="tabs-indicator" class="uc-tab-toggles_indicator"></div> ${ti.map(p1).join("")} </uc-presence-toggle><uc-btn-ui style="order: -1" theme="secondary-icon" icon="closeMax" set="onclick: on.cancel; title-prop:cancel"></uc-btn-ui><uc-btn-ui theme="primary-icon" icon="done" set="onclick: on.apply; title-prop:apply"></uc-btn-ui></div></uc-presence-toggle><uc-presence-toggle class="uc-sub-toolbar" set="visible: presence.subToolbar; styles: presence.subBottomToolbarStyles" ><div class="uc-slider"><uc-editor-slider ref="slider-el"></uc-editor-slider></div><div class="uc-controls-row"><uc-btn-ui theme="secondary" set="onclick: on.cancelSlider" l10n="@text:cancel"></uc-btn-ui><uc-btn-ui theme="primary" set="onclick: on.applySlider" l10n="@text:apply"></uc-btn-ui></div></uc-presence-toggle></div>`;var vl=class vl extends ne{constructor(){super(),this._iconReversed=!1,this._iconSingle=!1,this._iconHidden=!1,this.init$={...this.init$,text:"",icon:"",iconCss:this._iconCss(),theme:null,"aria-role":"","aria-controls":"","title-prop":""},this.defineAccessor("active",v=>{v?this.setAttribute("active",""):this.removeAttribute("active")})}_iconCss(){return He("uc-icon",{"uc-icon_left":!this._iconReversed,"uc-icon_right":this._iconReversed,"uc-icon_hidden":this._iconHidden,"uc-icon_single":this._iconSingle})}initCallback(){super.initCallback(),this.sub("icon",v=>{this._iconSingle=!this.$.text,this._iconHidden=!v,this.$.iconCss=this._iconCss()}),this.sub("theme",v=>{v!=="custom"&&(this.className=`uc-${v}`)}),this.sub("text",v=>{this._iconSingle=!1}),this.hasAttribute("theme")||this.setAttribute("theme","default"),this.defineAccessor("aria-role",v=>{this.$["aria-role"]=v||""}),this.defineAccessor("aria-controls",v=>{this.$["aria-controls"]=v||""}),this.defineAccessor("title-prop",v=>{this.$["title-prop"]=v||""})}set reverse(v){this.hasAttribute("reverse")?(this.style.flexDirection="row-reverse",this._iconReversed=!0):(this._iconReversed=!1,this.style.flexDirection=null)}};e(vl,"BtnUi");var Lr=vl;Lr.bindAttributes({text:"text",icon:"icon",reverse:"reverse",theme:"theme"});Lr.template=`<button type="button" set="@role:aria-role; @aria-controls: aria-controls;" l10n="@title:title-prop"><uc-icon set="className: iconCss; @name: icon; @hidden: !icon"></uc-icon><div class="uc-text">{{text}}</div></button>`;var pl=class pl extends ne{constructor(){super(),this._active=!1,this._handleTransitionEndRight=()=>{let v=this.ref["line-el"];v.style.transition="initial",v.style.opacity="0",v.style.transform="translateX(-101%)",this._active&&this._start()}}initCallback(){super.initCallback(),this.defineAccessor("active",v=>{typeof v=="boolean"&&(v?this._start():this._stop())})}_start(){this._active=!0;let{width:v}=this.getBoundingClientRect(),t=this.ref["line-el"];t.style.transition="transform 1s",t.style.opacity="1",t.style.transform=`translateX(${v}px)`,t.addEventListener("transitionend",this._handleTransitionEndRight,{once:!0})}_stop(){this._active=!1}};e(pl,"LineLoaderUi");var Pn=pl;Pn.template=`<div class="uc-inner"><div class="uc-line" ref="line-el"></div></div>`;var da={transition:"uc-transition",visible:"uc-visible",hidden:"uc-hidden"},ml=class ml extends ne{constructor(){super(),this._visible=!1,this._visibleStyle=da.visible,this._hiddenStyle=da.hidden,this._externalTransitions=!1,this.defineAccessor("styles",v=>{v&&(this._externalTransitions=!0,this._visibleStyle=v.visible,this._hiddenStyle=v.hidden)}),this.defineAccessor("visible",v=>{typeof v=="boolean"&&(this._visible=v,this._handleVisible())})}_handleVisible(){this.style.visibility=this._visible?"inherit":"hidden",Fh(this,{[da.transition]:!this._externalTransitions,[this._visibleStyle]:this._visible,[this._hiddenStyle]:!this._visible}),this.setAttribute("aria-hidden",this._visible?"false":"true")}initCallback(){super.initCallback(),this.classList.toggle("uc-initial",!0),this._externalTransitions||this.classList.add(da.transition),this._handleVisible(),setTimeout(()=>{this.classList.toggle("uc-initial",!1)},0)}};e(ml,"PresenceToggle");var Ln=ml;Ln.template="<slot></slot> ";var yl=class yl extends ne{constructor(){super();st(this,"init$",{...this.init$,disabled:!1,min:0,max:100,onInput:null,onChange:null,defaultValue:null,"on.sliderInput":()=>{let t=parseInt(this.ref["input-el"].value,10);this._updateValue(t),this.$.onInput&&this.$.onInput(t)},"on.sliderChange":()=>{let t=parseInt(this.ref["input-el"].value,10);this.$.onChange&&this.$.onChange(t)}});this.setAttribute("with-effects","")}initCallback(){super.initCallback(),this.defineAccessor("disabled",u=>{this.$.disabled=u}),this.defineAccessor("min",u=>{this.$.min=u}),this.defineAccessor("max",u=>{this.$.max=u}),this.defineAccessor("defaultValue",u=>{this.$.defaultValue=u,this.ref["input-el"].value=u,this._updateValue(u)}),this.defineAccessor("zero",u=>{this._zero=u}),this.defineAccessor("onInput",u=>{u&&(this.$.onInput=u)}),this.defineAccessor("onChange",u=>{u&&(this.$.onChange=u)}),this._updateSteps(),this._observer=new ResizeObserver(()=>{this._updateSteps();let u=parseInt(this.ref["input-el"].value,10);this._updateValue(u)}),this._observer.observe(this),this._thumbSize=parseInt(window.getComputedStyle(this).getPropertyValue("--l-thumb-size"),10),setTimeout(()=>{let u=parseInt(this.ref["input-el"].value,10);this._updateValue(u)},0),this.sub("disabled",u=>{let x=this.ref["input-el"];u?x.setAttribute("disabled","disabled"):x.removeAttribute("disabled")});let t=this.ref["input-el"];t.addEventListener("focus",()=>{this.style.setProperty("--color-effect","var(--hover-color-rgb)")}),t.addEventListener("blur",()=>{this.style.setProperty("--color-effect","var(--idle-color-rgb)")})}_updateValue(t){this._updateZeroDot(t);let{width:u}=this.getBoundingClientRect(),I=100/(this.$.max-this.$.min)*(t-this.$.min)*(u-this._thumbSize)/100;window.requestAnimationFrame(()=>{this.ref["thumb-el"].style.transform=`translateX(${I}px)`})}_updateZeroDot(t){if(!this._zeroDotEl)return;t===this._zero?this._zeroDotEl.style.opacity="0":this._zeroDotEl.style.opacity="1";let{width:u}=this.getBoundingClientRect(),I=100/(this.$.max-this.$.min)*(this._zero-this.$.min)*(u-this._thumbSize)/100;window.requestAnimationFrame(()=>{this._zeroDotEl.style.transform=`translateX(${I}px)`})}_updateSteps(){let u=this.ref["steps-el"],{width:x}=u.getBoundingClientRect(),y=Math.ceil(x/2),I=Math.ceil(y/15)-2;if(this._stepsCount===I)return;let l=document.createDocumentFragment(),c=document.createElement("div"),T=document.createElement("div");c.className="uc-minor-step",T.className="uc-border-step",l.appendChild(T);for(let L=0;L<I;L++)l.appendChild(c.cloneNode());l.appendChild(T.cloneNode());for(let L=0;L<I;L++)l.appendChild(c.cloneNode());l.appendChild(T.cloneNode());let P=document.createElement("div");P.className="uc-zero-dot",l.appendChild(P),this._zeroDotEl=P,u.innerHTML="",u.appendChild(l),this._stepsCount=I}destroyCallback(){var t;super.destroyCallback(),(t=this._observer)==null||t.disconnect()}};e(yl,"SliderUi");var Nn=yl;Nn.template=`<div class="uc-steps" ref="steps-el"></div><div ref="thumb-el" class="uc-thumb"></div><input class="uc-input" type="range" ref="input-el" set="oninput: on.sliderInput; onchange: on.sliderChange; @min: min; @max: max; @value: defaultValue;" />`;var bl=class bl extends pe{constructor(){super(...arguments);st(this,"couldBeCtxOwner",!0);st(this,"activityType",te.activities.CLOUD_IMG_EDIT);st(this,"_entry");st(this,"_instance")}get activityParams(){let t=super.activityParams;if("internalId"in t)return t;throw new Error("Cloud Image Editor activity params not found")}initCallback(){super.initCallback(),this.registerActivity(this.activityType,{onActivate:()=>this.mountEditor(),onDeactivate:()=>this.unmountEditor()}),this.subConfigValue("cropPreset",t=>{this._instance&&this._instance.getAttribute("crop-preset")!==t&&this._instance.setAttribute("crop-preset",t)}),this.subConfigValue("cloudImageEditorTabs",t=>{this._instance&&this._instance.getAttribute("tabs")!==t&&this._instance.setAttribute("tabs",t)})}handleApply(t){if(!this._entry)return;let u=t.detail;this._entry.setMultipleValues({cdnUrl:u.cdnUrl,cdnUrlModifiers:u.cdnUrlModifiers}),this.historyBack()}handleCancel(){this.historyBack()}mountEditor(){let{internalId:t}=this.activityParams;if(this._entry=this.uploadCollection.read(t),!this._entry)throw new Error(`Entry with internalId "${t}" not found`);let u=this._entry.getValue("cdnUrl");if(!u)throw new Error(`Entry with internalId "${t}" hasn't uploaded yet`);let x=new Ii,y=this.cfg.cropPreset,I=this.cfg.cloudImageEditorTabs;x.setAttribute("ctx-name",this.ctxName),x.setAttribute("cdn-url",u),y&&x.setAttribute("crop-preset",y),I&&x.setAttribute("tabs",I),x.addEventListener("apply",l=>{let c=l;this.handleApply(c),this.debugPrint('editor event "apply"',c.detail)}),x.addEventListener("cancel",l=>{let c=l;this.handleCancel(),this.debugPrint('editor event "cancel"',c.detail)}),x.addEventListener("change",l=>{let c=l;this.debugPrint('editor event "change"',c.detail)}),this.innerHTML="",this.appendChild(x),this._instance=x}unmountEditor(){this._instance=void 0,this._entry=void 0,this.innerHTML=""}};e(bl,"CloudImageEditorActivity");var ga=bl;var y1=e(function(S){return S.replace(/[\\-\\[]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},"escapeRegExp"),Gh=e(function(S,v="i"){let t=S.split("*").map(y1);return new RegExp("^"+t.join(".+")+"$",v)},"wildcardRegexp");var b1=e(S=>Object.keys(S).reduce((t,u)=>{let x=S[u],y=Object.keys(x).reduce((I,l)=>{let c=x[l];return I+`${l}: ${c};`},"");return t+`${u}{${y}}`},""),"styleToCss");function Xh({textColor:S,backgroundColor:v,linkColor:t,linkColorHover:u,secondaryColor:x,secondaryHover:y,secondaryForegroundColor:I,fontFamily:l,fontSize:c,radius:T}){let P=`solid 1px ${x}`;return b1({body:{color:S,"background-color":v,"font-family":l,"font-size":c},".side-bar":{background:"inherit","border-right":P},".main-content":{background:"inherit"},".main-content-header":{background:"inherit"},".main-content-footer":{background:"inherit"},".list-table-row":{color:"inherit"},".list-table-row:hover":{background:x},".list-table-row .list-table-cell-a, .list-table-row .list-table-cell-b":{"border-top":P},".list-table-body .list-items":{"border-bottom":P},".bread-crumbs a":{color:t},".bread-crumbs a:hover":{color:u},".main-content.loading":{background:`${v} url(/static/images/loading_spinner.gif) center no-repeat`,"background-size":"25px 25px"},".list-icons-item":{"background-color":x},".source-gdrive .side-bar-menu a, .source-gphotos .side-bar-menu a":{color:t},".source-gdrive .side-bar-menu a, .source-gphotos .side-bar-menu a:hover":{color:u},".side-bar-menu a":{color:t},".side-bar-menu a:hover":{color:u},".source-gdrive .side-bar-menu .current, .source-gdrive .side-bar-menu a:hover, .source-gphotos .side-bar-menu .current, .source-gphotos .side-bar-menu a:hover":{color:u},".source-vk .side-bar-menu a":{color:t},".source-vk .side-bar-menu a:hover":{color:u,background:"none"},"input[type=submit], .button, button":{color:I,background:x,"box-shadow":"none",border:"none","border-radius":T},"input[type=submit]:hover, .button:hover, button:hover":{background:y},".text-field, input[type=search], input[type=text], input[type=url], textarea":{color:I,"border-radius":T,background:x,border:P}})}e(Xh,"buildStyles");var $i={};window.addEventListener("message",S=>{let v;try{v=JSON.parse(S.data)}catch{return}if((v==null?void 0:v.type)in $i){let t=$i[v.type];for(let[u,x]of t)S.source===u&&x(v)}});var Vh=e(function(S,v,t){S in $i||($i[S]=[]),$i[S].push([v,t])},"registerMessage"),$h=e(function(S,v){S in $i&&($i[S]=$i[S].filter(t=>t[0]!==v))},"unregisterMessage");function Zh(S){let v=[];for(let[t,u]of Object.entries(S))u==null||typeof u=="string"&&u.length===0||v.push(`${t}=${encodeURIComponent(u)}`);return v.join("&")}e(Zh,"queryString");var Cl=class Cl extends pe{constructor(){super();st(this,"couldBeCtxOwner",!0);st(this,"activityType",te.activities.EXTERNAL);st(this,"_iframe",null);this.init$={...this.init$,activityIcon:"",activityCaption:"",selectedList:[],counter:0,multiple:!1,onDone:()=>{for(let t of this.$.selectedList){let u=this.extractUrlFromMessage(t),{filename:x}=t,{externalSourceType:y}=this.activityParams;this.api.addFileFromUrl(u,{fileName:x,source:y})}this.$["*currentActivity"]=te.activities.UPLOAD_LIST},onCancel:()=>{this.historyBack()}}}get activityParams(){let t=super.activityParams;if("externalSourceType"in t)return t;throw new Error("External Source activity params not found")}initCallback(){super.initCallback(),this.registerActivity(this.activityType,{onActivate:()=>{let{externalSourceType:t}=this.activityParams;if(!t){this.$["*currentActivity"]=null,this.setOrAddState("*modalActive",!1),console.error(`Param "externalSourceType" is required for activity "${this.activityType}"`);return}this.set$({activityCaption:`${t==null?void 0:t[0].toUpperCase()}${t==null?void 0:t.slice(1)}`,activityIcon:t}),this.mountIframe()}}),this.sub("*currentActivityParams",t=>{this.isActivityActive&&(this.unmountIframe(),this.mountIframe())}),this.sub("*currentActivity",t=>{t!==this.activityType&&this.unmountIframe()}),this.sub("selectedList",t=>{this.$.counter=t.length}),this.subConfigValue("multiple",t=>{this.$.multiple=t})}extractUrlFromMessage(t){if(t.alternatives){let u=Ve(this.cfg.externalSourcesPreferredTypes);for(let x of u){let y=Gh(x);for(let[I,l]of Object.entries(t.alternatives))if(y.test(I))return l}}return t.url}sendMessage(t){var u,x;(x=(u=this._iframe)==null?void 0:u.contentWindow)==null||x.postMessage(JSON.stringify(t),"*")}async handleFileSelected(t){!this.$.multiple&&this.$.selectedList.length||(this.$.selectedList=[...this.$.selectedList,t],this.$.multiple||this.$.onDone())}handleIframeLoad(){this.applyStyles()}getCssValue(t){return window.getComputedStyle(this).getPropertyValue(t).trim()}applyStyles(){let t={radius:this.getCssValue("--uc-radius"),backgroundColor:this.getCssValue("--uc-background"),textColor:this.getCssValue("--uc-foreground"),secondaryColor:this.getCssValue("--uc-secondary"),secondaryForegroundColor:this.getCssValue("--uc-secondary-foreground"),secondaryHover:this.getCssValue("--uc-secondary-hover"),linkColor:this.getCssValue("--uc-primary"),linkColorHover:this.getCssValue("--uc-primary-hover"),fontFamily:this.getCssValue("--uc-font-family"),fontSize:this.getCssValue("--uc-font-size")};this.sendMessage({type:"embed-css",style:Xh(t)})}remoteUrl(){var T,P;let{pubkey:t,remoteTabSessionKey:u,socialBaseUrl:x}=this.cfg,{externalSourceType:y}=this.activityParams,l={lang:((P=(T=this.l10n("social-source-lang"))==null?void 0:T.split("-"))==null?void 0:P[0])||"en",public_key:t,images_only:"false",pass_window_open:!1,session_key:u},c=new URL(`/window3/${y}`,x);return c.search=Zh(l),c.toString()}mountIframe(){let t=Ba({tag:"iframe",attributes:{src:this.remoteUrl(),marginheight:0,marginwidth:0,frameborder:0,allowTransparency:!0}});t.addEventListener("load",this.handleIframeLoad.bind(this)),this.ref.iframeWrapper.innerHTML="",this.ref.iframeWrapper.appendChild(t),Vh("file-selected",t.contentWindow,this.handleFileSelected.bind(this)),this._iframe=t,this.$.selectedList=[]}unmountIframe(){this._iframe&&$h("file-selected",this._iframe.contentWindow),this.ref.iframeWrapper.innerHTML="",this._iframe=null,this.$.selectedList=[],this.$.counter=0}};e(Cl,"ExternalSource");var Rn=Cl;Rn.template=`<uc-activity-header><button type="button" class="uc-mini-btn" set="onclick: *historyBack"><uc-icon name="back"></uc-icon></button><div><uc-icon set="@name: activityIcon"></uc-icon><span>{{activityCaption}}</span></div><button type="button" class="uc-mini-btn uc-close-btn" set="onclick: *historyBack"><uc-icon name="close"></uc-icon></button></uc-activity-header><div class="uc-content"><div ref="iframeWrapper" class="uc-iframe-wrapper"></div><div class="uc-toolbar"><button type="button" class="uc-cancel-btn uc-secondary-btn" set="onclick: onCancel" l10n="cancel"></button><div></div><div set="@hidden: !multiple" class="uc-selected-counter"><span l10n="selected-count"></span>{{counter}}</div><button type="button" class="uc-done-btn uc-primary-btn" set="onclick: onDone; @disabled: !counter" l10n="done" ></button></div></div>`;var _l=class _l extends pe{constructor(){super(...arguments);st(this,"requireCtxName",!0)}_createValidationInput(){let t=document.createElement("input");return t.type="text",t.name=this.ctxName,t.required=this.cfg.multipleMin>0,t.tabIndex=-1,rn(t,{opacity:0,height:0,width:0}),t}initCallback(){super.initCallback(),this._validationInputElement=this._createValidationInput(),this.appendChild(this._validationInputElement),this.sub("*collectionState",t=>{var u;{if(this._dynamicInputsContainer||(this._dynamicInputsContainer=document.createElement("div"),this.appendChild(this._dynamicInputsContainer)),!this._validationInputElement){let l=this._createValidationInput();this.appendChild(l),this._validationInputElement=l}if(this._dynamicInputsContainer.innerHTML="",t.status==="uploading"||t.status==="idle"){this._validationInputElement.value="",this._validationInputElement.setCustomValidity("");return}if(t.status==="failed"){let l=(u=t.errors[0])==null?void 0:u.message;this._validationInputElement.value="",this._validationInputElement.setCustomValidity(l);return}let x=t.group?t.group:null;if(x){this._validationInputElement.value=x.cdnUrl,this._validationInputElement.setCustomValidity("");return}let y=t.allEntries.map(l=>l.cdnUrl);if(!this.cfg.multiple&&y.length===1){this._validationInputElement.value=y[0],this._validationInputElement.setCustomValidity("");return}this._validationInputElement.remove(),this._validationInputElement=null;let I=new DocumentFragment;for(let l of y){let c=document.createElement("input");c.type="hidden",c.name=`${this.ctxName}[]`,c.value=l,I.appendChild(c)}this._dynamicInputsContainer.replaceChildren(I)}},!1)}};e(_l,"FormInput");var va=_l;var xl=class xl extends te{};e(xl,"ActivityHeader");var pa=xl;var Sl=class Sl extends ne{constructor(){super(...arguments);st(this,"init$",{...this.init$,currentText:"",options:[],selectHtml:"",onSelect:t=>{var u;t.preventDefault(),t.stopPropagation(),this.value=this.ref.select.value,this.$.currentText=((u=this.$.options.find(x=>x.value==this.value))==null?void 0:u.text)||"",this.dispatchEvent(new Event("change"))}})}initCallback(){super.initCallback(),this.sub("options",t=>{var x;this.$.currentText=((x=t==null?void 0:t[0])==null?void 0:x.text)||"";let u="";t==null||t.forEach(y=>{u+=`<option value="${y.value}">${y.text}</option>`}),this.$.selectHtml=u})}};e(Sl,"Select");var jn=Sl;jn.template='<select ref="select" set="innerHTML: selectHtml; onchange: onSelect"></select>';var ya=class ya extends ne{initCallback(){super.initCallback(),this.subConfigValue("removeCopyright",v=>{this.toggleAttribute("hidden",!!v)})}};e(ya,"Copyright"),st(ya,"template",`<a href="https://uploadcare.com/?utm_source=copyright&utm_medium=referral&utm_campaign=v4" target="_blank noopener" class="uc-credits" >Powered by Uploadcare</a >`);var ma=ya;var eM=Jc(Ca(),1),iM=Jc(Jh(),1);var C1=/data:(image\/.+);base64,/;function _1(S){var v="",t,u,x,y;for(t=S.replace(C1,function(I,l){return v=l,""}),t=atob(t),y=t.length,u=new Uint8Array(y),x=0;x<y;x+=1)u[x]=t.charCodeAt(x);return new Blob([u],{type:v})}e(_1,"base64ToBlob");var xa=class xa extends pe{constructor(){super(...arguments);st(this,"couldBeCtxOwner",!0);st(this,"activityType",te.activities.LOCAL_IMAGE_EDITOR);st(this,"_entry");st(this,"_instance")}get activityParams(){let t=super.activityParams;if("internalId"in t)return t;throw new Error("Cloud Image Editor activity params not found")}initCallback(){super.initCallback(),this.registerActivity(this.activityType,{onActivate:()=>this.mounted(),onDeactivate:()=>this.unmounted()})}mounted(){var I;let{internalId:t}=this.activityParams;if(this._entry=this.uploadCollection.read(t),!this._entry)throw new Error(`Entry with internalId "${t}" not found`);let u=this._entry.getValue("file"),x=this._entry.getValue("cdnUrl"),y=new tui.ImageEditor(document.querySelector("#tui-image-editor-container"),{includeUI:{loadImage:{path:x||URL.createObjectURL(u),name:(I=u==null?void 0:u.name)!=null?I:"cdnUrl"}},cssMaxWidth:600,cssMaxHeight:300,usageStatistics:!1});this._applyButton(),this._instance=y}_applyButton(){var u;let t=document.createElement("button");t.setAttribute("class","tui-image-editor-download-btn-save"),t.textContent="Save",(u=document.querySelector(".tui-image-editor-header-buttons"))==null||u.appendChild(t),t.addEventListener("click",async x=>{if(x.preventDefault(),x.stopPropagation(),!this._entry)return;let y=this._instance.toDataURL(),I=_1(y);this._entry.setMultipleValues({file:new File([I],"image.jpeg",{lastModified:new Date().getTime(),type:I.type})}),this.historyBack()})}unmounted(){this._instance=void 0,this._entry=void 0,document.querySelector("#tui-image-editor-container").innerHTML=""}};e(xa,"LocalEditorImage"),st(xa,"styleAttrs",["uc-editor-image"]);var Fn=xa;Fn.template='<div id="tui-image-editor-container"></div>';var Nr=class Nr extends bi{constructor(){super(),this.init$={...this.init$,isHidden:!1}}initCallback(){super.initCallback(),this.defineAccessor("headless",v=>{this.set$({isHidden:Te(v)})}),this.sub("*modalActive",v=>{this._lastModalActive!==v&&this.emit(v?Se.MODAL_OPEN:Se.MODAL_CLOSE,void 0,{debounce:!0}),this._lastModalActive=v},!1)}};e(Nr,"FileUploaderRegular"),st(Nr,"styleAttrs",[...qe(Nr,Nr,"styleAttrs"),"uc-file-uploader-regular"]);var Rr=Nr;Rr.template=`<uc-simple-btn set="@hidden: isHidden"></uc-simple-btn><uc-modal strokes block-body-scrolling><uc-start-from><uc-drop-area with-icon clickable></uc-drop-area><uc-source-list wrap></uc-source-list><button type="button" l10n="start-from-cancel" class="uc-secondary-btn" set="onclick: *historyBack"></button><uc-copyright></uc-copyright></uc-start-from><uc-upload-list></uc-upload-list><uc-camera-source></uc-camera-source><uc-url-source></uc-url-source><uc-external-source></uc-external-source><uc-cloud-image-editor-activity></uc-cloud-image-editor-activity><uc-local-editor-image></uc-local-editor-image></uc-modal>`;Rr.bindAttributes({headless:null});var jr=class jr extends bi{initCallback(){super.initCallback();let v=this.ref.uBlock;this.sub("*currentActivity",t=>{t||(this.$["*currentActivity"]=v.initActivity||te.activities.START_FROM)}),this.sub("*uploadList",t=>{(t==null?void 0:t.length)>0?this.$["*currentActivity"]=te.activities.UPLOAD_LIST:this.$["*currentActivity"]=v.initActivity||te.activities.START_FROM}),this.subConfigValue("sourceList",t=>{t!=="local"&&(this.cfg.sourceList="local")}),this.subConfigValue("confirmUpload",t=>{t!==!1&&(this.cfg.confirmUpload=!1)})}};e(jr,"FileUploaderMinimal"),st(jr,"styleAttrs",[...qe(jr,jr,"styleAttrs"),"uc-file-uploader-minimal"]);var zn=jr;zn.template=`<uc-start-from><uc-drop-area tabindex="0" clickable l10n="choose-file"></uc-drop-area><uc-copyright></uc-copyright></uc-start-from><uc-upload-list ref="uBlock"></uc-upload-list>`;var Fr=class Fr extends bi{constructor(){super(),this.init$={...this.init$,couldCancel:!1,cancel:()=>{this.couldHistoryBack?this.$["*historyBack"]():this.couldShowList&&(this.$["*currentActivity"]=te.activities.UPLOAD_LIST)}}}get couldHistoryBack(){let v=this.$["*history"];return v.length>1&&v[v.length-1]!==te.activities.START_FROM}get couldShowList(){return this.cfg.showEmptyList||this.$["*uploadList"].length>0}initCallback(){super.initCallback();let v=this.ref.uBlock;this.sub("*currentActivity",t=>{t||(this.$["*currentActivity"]=v.initActivity||te.activities.START_FROM)}),this.sub("*uploadList",t=>{(t==null?void 0:t.length)>0&&this.$["*currentActivity"]===(v.initActivity||te.activities.START_FROM)&&(this.$["*currentActivity"]=te.activities.UPLOAD_LIST)}),this.sub("*history",()=>{this.$.couldCancel=this.couldHistoryBack||this.couldShowList})}};e(Fr,"FileUploaderInline"),st(Fr,"styleAttrs",[...qe(Fr,Fr,"styleAttrs"),"uc-file-uploader-inline"]);var Bn=Fr;Bn.template=`<uc-start-from><uc-drop-area with-icon clickable></uc-drop-area><uc-source-list wrap></uc-source-list><button type="button" l10n="start-from-cancel" class="uc-cancel-btn uc-secondary-btn" set="onclick: cancel; @hidden: !couldCancel" ></button><uc-copyright></uc-copyright></uc-start-from><uc-upload-list ref="uBlock"></uc-upload-list><uc-camera-source></uc-camera-source><uc-url-source></uc-url-source><uc-external-source></uc-external-source><uc-cloud-image-editor-activity></uc-cloud-image-editor-activity>`;var zr=class zr extends Ii{initCallback(){var v;super.initCallback(),(v=this.a11y)==null||v.registerBlock(this)}};e(zr,"CloudImageEditor"),st(zr,"styleAttrs",[...qe(zr,zr,"styleAttrs"),"uc-wgt-common"]);var Sa=zr;function Ia(S){for(let v in S){let t=[...v].reduce((u,x)=>(x.toUpperCase()===x&&(x="-"+x.toLowerCase()),u+=x),"");t.startsWith("-")&&(t=t.replace("-","")),t.startsWith("uc-")||(t="uc-"+t),S[v].reg&&S[v].reg(t)}}e(Ia,"defineComponents");var wl="UC";async function Kh(S,v=!1){return new Promise((t,u)=>{if(typeof document!="object"){t(null);return}if(typeof window=="object"&&window[wl]){t(window[wl]);return}let x=document.createElement("script");x.async=!0,x.src=S,x.onerror=()=>{u()},x.onload=()=>{let y=window[wl];v&&Ia(y),t(y)},document.head.appendChild(x)})}e(Kh,"loadFileUploaderFrom");return Om(x1);})(); /*! Bundled license information: tui-color-picker/dist/tui-color-picker.js: (*! * TOAST UI Color Picker * @version 2.2.8 * @author NHN Cloud FE Development Team <dl_javascript@nhn.com> * @license MIT *) tui-image-editor/dist/tui-image-editor.js: (*! * TOAST UI ImageEditor * @version 3.15.3 * @license MIT *) (*! Fabric.js Copyright 2008-2015, Printio (Juriy Zaytsev, Maxim Chernyak) *) (*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js *) (*! * @copyright Copyright (c) 2017 IcoMoon.io * @license Licensed under MIT license * See https://github.com/Keyamoon/svgxuse * @version 1.2.6 *) */
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* MIT License
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) 2022 Uploadcare (hello@uploadcare.com). All rights reserved.
|
|
6
|
+
*
|
|
7
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
* in the Software without restriction, including without limitation the rights
|
|
10
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
* furnished to do so, subject to the following conditions:
|
|
13
|
+
*
|
|
14
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
15
|
+
* copies or substantial portions of the Software.
|
|
16
|
+
*
|
|
17
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
+
* SOFTWARE.
|
|
24
|
+
*
|
|
25
|
+
*/
|
|
26
|
+
"use strict";var UC=(()=>{var me=Object.defineProperty;var Kn=Object.getOwnPropertyDescriptor;var Zn=Object.getOwnPropertyNames;var Yn=Object.getPrototypeOf,Jn=Object.prototype.hasOwnProperty;var Qn=Reflect.get;var ta=(r,e,t)=>e in r?me(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var a=(r,e)=>me(r,"name",{value:e,configurable:!0});var ea=(r,e)=>{for(var t in e)me(r,t,{get:e[t],enumerable:!0})},ia=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Zn(e))!Jn.call(r,s)&&s!==t&&me(r,s,{get:()=>e[s],enumerable:!(i=Kn(e,s))||i.enumerable});return r};var ra=r=>ia(me({},"__esModule",{value:!0}),r);var h=(r,e,t)=>(ta(r,typeof e!="symbol"?e+"":e,t),t);var H=(r,e,t)=>Qn(Yn(r),t,e);var Xc={};ea(Xc,{ActivityBlock:()=>_,ActivityHeader:()=>tr,BaseComponent:()=>kt,Block:()=>y,BtnUi:()=>ce,CameraSource:()=>Be,CloudImageEditor:()=>rr,CloudImageEditorActivity:()=>Ji,CloudImageEditorBlock:()=>ct,Config:()=>pn,Copyright:()=>er,CropFrame:()=>Ge,Data:()=>T,DropArea:()=>ie,EditorCropButtonControl:()=>ne,EditorFilterControl:()=>Ft,EditorImageCropper:()=>Ze,EditorImageFader:()=>Zi,EditorOperationControl:()=>ae,EditorScroller:()=>Ye,EditorSlider:()=>Xe,EditorToolbar:()=>Je,ExternalSource:()=>ii,ExternalUploadSource:()=>Pt,FileItem:()=>oe,FileUploaderInline:()=>oi,FileUploaderMinimal:()=>si,FileUploaderRegular:()=>he,FormInput:()=>Qi,Icon:()=>Zt,Img:()=>ji,LineLoaderUi:()=>Qe,Modal:()=>Ne,PACKAGE_NAME:()=>Lt,PACKAGE_VERSION:()=>Ut,PresenceToggle:()=>ti,ProgressBar:()=>He,ProgressBarCommon:()=>je,Select:()=>ri,SimpleBtn:()=>Qt,SliderUi:()=>ei,SolutionBlock:()=>st,SourceBtn:()=>re,SourceList:()=>Hi,StartFrom:()=>De,UID:()=>$t,UploadCtxProvider:()=>Un,UploadList:()=>ze,UploadSource:()=>L,UploaderBlock:()=>$,UrlSource:()=>Ve,defineComponents:()=>sr,defineLocale:()=>Ur,loadFileUploaderFrom:()=>Xn,toKebabCase:()=>qt});var sa=Object.defineProperty,oa=a((r,e,t)=>e in r?sa(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,"__defNormalProp"),ar=a((r,e,t)=>(oa(r,typeof e!="symbol"?e+"":e,t),t),"__publicField");function na(r){let e=a(t=>{var i;for(let s in t)((i=t[s])==null?void 0:i.constructor)===Object&&(t[s]=e(t[s]));return{...t}},"clone");return e(r)}a(na,"cloneObj");var be,T=(be=class{constructor(e){e.constructor===Object?this.store=na(e):(this._storeIsProxy=!0,this.store=e),this.callbackMap=Object.create(null)}static warn(e,t){console.warn(`Symbiote Data: cannot ${e}. Prop name: `+t)}read(e){return!this._storeIsProxy&&!this.store.hasOwnProperty(e)?(T.warn("read",e),null):this.store[e]}has(e){return this._storeIsProxy?this.store[e]!==void 0:this.store.hasOwnProperty(e)}add(e,t,i=!1){!i&&Object.keys(this.store).includes(e)||(this.store[e]=t,this.notify(e))}pub(e,t){if(!this._storeIsProxy&&!this.store.hasOwnProperty(e)){T.warn("publish",e);return}this.store[e]=t,this.notify(e)}multiPub(e){for(let t in e)this.pub(t,e[t])}notify(e){this.callbackMap[e]&&this.callbackMap[e].forEach(t=>{t(this.store[e])})}sub(e,t,i=!0){return!this._storeIsProxy&&!this.store.hasOwnProperty(e)?(T.warn("subscribe",e),null):(this.callbackMap[e]||(this.callbackMap[e]=new Set),this.callbackMap[e].add(t),i&&t(this.store[e]),{remove:()=>{this.callbackMap[e].delete(t),this.callbackMap[e].size||delete this.callbackMap[e]},callback:t})}static registerCtx(e,t=Symbol()){let i=T.globalStore.get(t);return i?console.warn('State: context UID "'+t+'" already in use'):(i=new T(e),T.globalStore.set(t,i)),i}static deleteCtx(e){T.globalStore.delete(e)}static getCtx(e,t=!0){return T.globalStore.get(e)||(t&&console.warn('State: wrong context UID - "'+e+'"'),null)}},a(be,"Data"),be);T.globalStore=new Map;var E=Object.freeze({BIND_ATTR:"set",ATTR_BIND_PRFX:"@",EXT_DATA_CTX_PRFX:"*",NAMED_DATA_CTX_SPLTR:"/",CTX_NAME_ATTR:"ctx-name",CTX_OWNER_ATTR:"ctx-owner",CSS_CTX_PROP:"--ctx-name",EL_REF_ATTR:"ref",AUTO_TAG_PRFX:"sym",REPEAT_ATTR:"repeat",REPEAT_ITEM_TAG_ATTR:"repeat-item-tag",SET_LATER_KEY:"__toSetLater__",USE_TPL:"use-template",ROOT_STYLE_ATTR_NAME:"sym-component"}),qs="1234567890QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm",aa=qs.length-1,_e,$t=(_e=class{static generate(e="XXXXXXXXX-XXX"){let t="";for(let i=0;i<e.length;i++)t+=e[i]==="-"?e[i]:qs.charAt(Math.random()*aa);return t}},a(_e,"UID"),_e);function Ks(r,e,t){let i=!0,s,o=e.split(".");return o.forEach((n,l)=>{l<o.length-1?r=r[n]:s=n}),r?r[s]=t:i=!1,i}a(Ks,"setNestedProp");function la(r){return r.split("-").map((e,t)=>e&&t?e[0].toUpperCase()+e.slice(1):e).join("").split("_").map((e,t)=>e&&t?e.toUpperCase():e).join("")}a(la,"kebabToCamel");function ca(r,e){[...r.querySelectorAll(`[${E.REPEAT_ATTR}]`)].forEach(t=>{var n;let i=t.getAttribute(E.REPEAT_ITEM_TAG_ATTR),s;if(i&&(s=window.customElements.get(i)),!s){s=(n=class extends e.BaseComponent{constructor(){super(),i||(this.style.display="contents")}},a(n,"itemClass"),n);let l=t.innerHTML;s.template=l,s.reg(i)}for(;t.firstChild;)t.firstChild.remove();let o=t.getAttribute(E.REPEAT_ATTR);e.sub(o,l=>{if(!l){for(;t.firstChild;)t.firstChild.remove();return}let c=[...t.children],u,d=a(p=>{p.forEach((m,g)=>{if(c[g])if(c[g].set$)setTimeout(()=>{c[g].set$(m)});else for(let b in m)c[g][b]=m[b];else{u||(u=new DocumentFragment);let b=new s;Object.assign(b.init$,m),u.appendChild(b)}}),u&&t.appendChild(u);let f=c.slice(p.length,c.length);for(let m of f)m.remove()},"fillItems");if(l.constructor===Array)d(l);else if(l.constructor===Object){let p=[];for(let f in l){let m=l[f];Object.defineProperty(m,"_KEY_",{value:f,enumerable:!0}),p.push(m)}d(p)}else console.warn("Symbiote repeat data type error:"),console.log(l)}),t.removeAttribute(E.REPEAT_ATTR),t.removeAttribute(E.REPEAT_ITEM_TAG_ATTR)})}a(ca,"repeatProcessor");var Ws="__default__";function ua(r,e){if(e.shadowRoot)return;let t=[...r.querySelectorAll("slot")];if(!t.length)return;let i={};t.forEach(s=>{let o=s.getAttribute("name")||Ws;i[o]={slot:s,fr:document.createDocumentFragment()}}),e.initChildren.forEach(s=>{var o;let n=Ws;s instanceof Element&&s.hasAttribute("slot")&&(n=s.getAttribute("slot"),s.removeAttribute("slot")),(o=i[n])==null||o.fr.appendChild(s)}),Object.values(i).forEach(s=>{if(s.fr.childNodes.length)s.slot.parentNode.replaceChild(s.fr,s.slot);else if(s.slot.childNodes.length){let o=document.createDocumentFragment();o.append(...s.slot.childNodes),s.slot.parentNode.replaceChild(o,s.slot)}else s.slot.remove()})}a(ua,"slotProcessor");function ha(r,e){[...r.querySelectorAll(`[${E.EL_REF_ATTR}]`)].forEach(t=>{let i=t.getAttribute(E.EL_REF_ATTR);e.ref[i]=t,t.removeAttribute(E.EL_REF_ATTR)})}a(ha,"refProcessor");function da(r,e){[...r.querySelectorAll(`[${E.BIND_ATTR}]`)].forEach(t=>{let s=t.getAttribute(E.BIND_ATTR).split(";");[...t.attributes].forEach(o=>{if(o.name.startsWith("-")&&o.value){let n=la(o.name.replace("-",""));s.push(n+":"+o.value),t.removeAttribute(o.name)}}),s.forEach(o=>{if(!o)return;let n=o.split(":").map(d=>d.trim()),l=n[0],c;l.indexOf(E.ATTR_BIND_PRFX)===0&&(c=!0,l=l.replace(E.ATTR_BIND_PRFX,""));let u=n[1].split(",").map(d=>d.trim());for(let d of u){let p;d.startsWith("!!")?(p="double",d=d.replace("!!","")):d.startsWith("!")&&(p="single",d=d.replace("!","")),e.sub(d,f=>{p==="double"?f=!!f:p==="single"&&(f=!f),c?(f==null?void 0:f.constructor)===Boolean?f?t.setAttribute(l,""):t.removeAttribute(l):t.setAttribute(l,f):Ks(t,l,f)||(t[E.SET_LATER_KEY]||(t[E.SET_LATER_KEY]=Object.create(null)),t[E.SET_LATER_KEY][l]=f)})}}),t.removeAttribute(E.BIND_ATTR)})}a(da,"domSetProcessor");var ni="{{",ge="}}",pa="skip-text";function fa(r){let e,t=[],i=document.createTreeWalker(r,NodeFilter.SHOW_TEXT,{acceptNode:s=>{var o;return!((o=s.parentElement)!=null&&o.hasAttribute(pa))&&s.textContent.includes(ni)&&s.textContent.includes(ge)&&1}});for(;e=i.nextNode();)t.push(e);return t}a(fa,"getTextNodesWithTokens");var ma=a(function(r,e){fa(r).forEach(i=>{let s=[],o;for(;i.textContent.includes(ge);)i.textContent.startsWith(ni)?(o=i.textContent.indexOf(ge)+ge.length,i.splitText(o),s.push(i)):(o=i.textContent.indexOf(ni),i.splitText(o)),i=i.nextSibling;s.forEach(n=>{let l=n.textContent.replace(ni,"").replace(ge,"");n.textContent="",e.sub(l,c=>{n.textContent=c})})})},"txtNodesProcessor"),ga=[ca,ua,ha,da,ma],ai="'",zt='"',ba=/\\([0-9a-fA-F]{1,6} ?)/g;function _a(r){return(r[0]===zt||r[0]===ai)&&(r[r.length-1]===zt||r[r.length-1]===ai)}a(_a,"hasLeadingTrailingQuotes");function ya(r){return(r[0]===zt||r[0]===ai)&&(r=r.slice(1)),(r[r.length-1]===zt||r[r.length-1]===ai)&&(r=r.slice(0,-1)),r}a(ya,"trimQuotes");function va(r){let e="",t="";for(var i=0;i<r.length;i++){let s=r[i+1];r[i]==="\\"&&s==='"'?(e+='\\"',i++):r[i]==='"'&&t!=="\\"?e+='\\"':e+=r[i],t=r[i]}return e}a(va,"escapeQuotes");function wa(r){let e=r;_a(r)&&(e=ya(e),e=e.replace(ba,(t,i)=>String.fromCodePoint(parseInt(i.trim(),16))),e=e.replaceAll(`\\
|
|
27
|
+
`,"\\n"),e=va(e),e=zt+e+zt);try{return JSON.parse(e)}catch{throw new Error(`Failed to parse CSS property value: ${e}. Original input: ${r}`)}}a(wa,"parseCssPropertyValue");var Xs=0,Nt=null,dt=null,ye,yt=(ye=class extends HTMLElement{constructor(){super(),ar(this,"updateCssData",()=>{var e;this.dropCssDataCache(),(e=this.__boundCssProps)==null||e.forEach(t=>{let i=this.getCssData(this.__extractCssName(t),!0);i!==null&&this.$[t]!==i&&(this.$[t]=i)})}),this.init$=Object.create(null),this.cssInit$=Object.create(null),this.tplProcessors=new Set,this.ref=Object.create(null),this.allSubs=new Set,this.pauseRender=!1,this.renderShadow=!1,this.readyToDestroy=!0,this.processInnerHtml=!1,this.allowCustomTemplate=!1,this.ctxOwner=!1}get BaseComponent(){return yt}initCallback(){}__initCallback(){var e;this.__initialized||(this.__initialized=!0,(e=this.initCallback)==null||e.call(this))}render(e,t=this.renderShadow){let i;if((t||this.constructor.__shadowStylesUrl)&&!this.shadowRoot&&this.attachShadow({mode:"open"}),this.allowCustomTemplate){let o=this.getAttribute(E.USE_TPL);if(o){let n=this.getRootNode(),l=(n==null?void 0:n.querySelector(o))||document.querySelector(o);l?e=l.content.cloneNode(!0):console.warn(`Symbiote template "${o}" is not found...`)}}if(this.processInnerHtml)for(let o of this.tplProcessors)o(this,this);if(e||this.constructor.template){if(this.constructor.template&&!this.constructor.__tpl&&(this.constructor.__tpl=document.createElement("template"),this.constructor.__tpl.innerHTML=this.constructor.template),(e==null?void 0:e.constructor)===DocumentFragment)i=e;else if((e==null?void 0:e.constructor)===String){let o=document.createElement("template");o.innerHTML=e,i=o.content.cloneNode(!0)}else this.constructor.__tpl&&(i=this.constructor.__tpl.content.cloneNode(!0));for(let o of this.tplProcessors)o(i,this)}let s=a(()=>{i&&(t&&this.shadowRoot.appendChild(i)||this.appendChild(i)),this.__initCallback()},"addFr");if(this.constructor.__shadowStylesUrl){t=!0;let o=document.createElement("link");o.rel="stylesheet",o.href=this.constructor.__shadowStylesUrl,o.onload=s,this.shadowRoot.prepend(o)}else s()}addTemplateProcessor(e){this.tplProcessors.add(e)}get autoCtxName(){return this.__autoCtxName||(this.__autoCtxName=$t.generate(),this.style.setProperty(E.CSS_CTX_PROP,`'${this.__autoCtxName}'`)),this.__autoCtxName}get cssCtxName(){return this.getCssData(E.CSS_CTX_PROP,!0)}get ctxName(){var e;let t=((e=this.getAttribute(E.CTX_NAME_ATTR))==null?void 0:e.trim())||this.cssCtxName||this.__cachedCtxName||this.autoCtxName;return this.__cachedCtxName=t,t}get localCtx(){return this.__localCtx||(this.__localCtx=T.registerCtx({},this)),this.__localCtx}get nodeCtx(){return T.getCtx(this.ctxName,!1)||T.registerCtx({},this.ctxName)}static __parseProp(e,t){let i,s;if(e.startsWith(E.EXT_DATA_CTX_PRFX))i=t.nodeCtx,s=e.replace(E.EXT_DATA_CTX_PRFX,"");else if(e.includes(E.NAMED_DATA_CTX_SPLTR)){let o=e.split(E.NAMED_DATA_CTX_SPLTR);i=T.getCtx(o[0]),s=o[1]}else i=t.localCtx,s=e;return{ctx:i,name:s}}sub(e,t,i=!0){let s=a(n=>{this.isConnected&&t(n)},"subCb"),o=yt.__parseProp(e,this);o.ctx.has(o.name)?this.allSubs.add(o.ctx.sub(o.name,s,i)):window.setTimeout(()=>{this.allSubs.add(o.ctx.sub(o.name,s,i))})}notify(e){let t=yt.__parseProp(e,this);t.ctx.notify(t.name)}has(e){let t=yt.__parseProp(e,this);return t.ctx.has(t.name)}add(e,t,i=!1){let s=yt.__parseProp(e,this);s.ctx.add(s.name,t,i)}add$(e,t=!1){for(let i in e)this.add(i,e[i],t)}get $(){if(!this.__stateProxy){let e=Object.create(null);this.__stateProxy=new Proxy(e,{set:(t,i,s)=>{let o=yt.__parseProp(i,this);return o.ctx.pub(o.name,s),!0},get:(t,i)=>{let s=yt.__parseProp(i,this);return s.ctx.read(s.name)}})}return this.__stateProxy}set$(e,t=!1){for(let i in e){let s=e[i];t||![String,Number,Boolean].includes(s==null?void 0:s.constructor)?this.$[i]=s:this.$[i]!==s&&(this.$[i]=s)}}get __ctxOwner(){return this.ctxOwner||this.hasAttribute(E.CTX_OWNER_ATTR)&&this.getAttribute(E.CTX_OWNER_ATTR)!=="false"}__initDataCtx(){let e=this.constructor.__attrDesc;if(e)for(let t of Object.values(e))Object.keys(this.init$).includes(t)||(this.init$[t]="");for(let t in this.init$)if(t.startsWith(E.EXT_DATA_CTX_PRFX))this.nodeCtx.add(t.replace(E.EXT_DATA_CTX_PRFX,""),this.init$[t],this.__ctxOwner);else if(t.includes(E.NAMED_DATA_CTX_SPLTR)){let i=t.split(E.NAMED_DATA_CTX_SPLTR),s=i[0].trim(),o=i[1].trim();if(s&&o){let n=T.getCtx(s,!1);n||(n=T.registerCtx({},s)),n.add(o,this.init$[t])}}else this.localCtx.add(t,this.init$[t]);for(let t in this.cssInit$)this.bindCssData(t,this.cssInit$[t]);this.__dataCtxInitialized=!0}connectedCallback(){var e;if(this.isConnected){if(this.__disconnectTimeout&&window.clearTimeout(this.__disconnectTimeout),!this.connectedOnce){let t=(e=this.getAttribute(E.CTX_NAME_ATTR))==null?void 0:e.trim();if(t&&this.style.setProperty(E.CSS_CTX_PROP,`'${t}'`),this.__initDataCtx(),this[E.SET_LATER_KEY]){for(let i in this[E.SET_LATER_KEY])Ks(this,i,this[E.SET_LATER_KEY][i]);delete this[E.SET_LATER_KEY]}this.initChildren=[...this.childNodes];for(let i of ga)this.addTemplateProcessor(i);if(this.pauseRender)this.__initCallback();else if(this.constructor.__rootStylesLink){let i=this.getRootNode();if(!i)return;if(i==null?void 0:i.querySelector(`link[${E.ROOT_STYLE_ATTR_NAME}="${this.constructor.is}"]`)){this.render();return}let o=this.constructor.__rootStylesLink.cloneNode(!0);o.setAttribute(E.ROOT_STYLE_ATTR_NAME,this.constructor.is),o.onload=()=>{this.render()},i.nodeType===Node.DOCUMENT_NODE?i.head.appendChild(o):i.prepend(o)}else this.render()}this.connectedOnce=!0}}destroyCallback(){}disconnectedCallback(){this.connectedOnce&&(this.dropCssDataCache(),this.readyToDestroy&&(this.__disconnectTimeout&&window.clearTimeout(this.__disconnectTimeout),this.__disconnectTimeout=window.setTimeout(()=>{this.destroyCallback();for(let e of this.allSubs)e.remove(),this.allSubs.delete(e);for(let e of this.tplProcessors)this.tplProcessors.delete(e);dt==null||dt.delete(this.updateCssData),dt!=null&&dt.size||(Nt==null||Nt.disconnect(),Nt=null,dt=null)},100)))}static reg(e,t=!1){e||(Xs++,e=`${E.AUTO_TAG_PRFX}-${Xs}`),this.__tag=e;let i=window.customElements.get(e);if(i){!t&&i!==this&&console.warn([`Element with tag name "${e}" already registered.`,`You're trying to override it with another class "${this.name}".`,"This is most likely a mistake.","New element will not be registered."].join(`
|
|
28
|
+
`));return}window.customElements.define(e,t?class extends this{}:this)}static get is(){return this.__tag||this.reg(),this.__tag}static bindAttributes(e){this.observedAttributes=Object.keys(e),this.__attrDesc=e}attributeChangedCallback(e,t,i){var s;if(t===i)return;let o=(s=this.constructor.__attrDesc)==null?void 0:s[e];o?this.__dataCtxInitialized?this.$[o]=i:this.init$[o]=i:this[e]=i}getCssData(e,t=!1){if(this.__cssDataCache||(this.__cssDataCache=Object.create(null)),!Object.keys(this.__cssDataCache).includes(e)){this.__computedStyle||(this.__computedStyle=window.getComputedStyle(this));let i=this.__computedStyle.getPropertyValue(e).trim();try{this.__cssDataCache[e]=wa(i)}catch{!t&&console.warn(`CSS Data error: ${e}`),this.__cssDataCache[e]=null}}return this.__cssDataCache[e]}__extractCssName(e){return e.split("--").map((t,i)=>i===0?"":t).join("--")}__initStyleAttrObserver(){dt||(dt=new Set),dt.add(this.updateCssData),Nt||(Nt=new MutationObserver(e=>{e[0].type==="attributes"&&dt.forEach(t=>{t()})}),Nt.observe(document,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style"]}))}bindCssData(e,t=""){this.__boundCssProps||(this.__boundCssProps=new Set),this.__boundCssProps.add(e);let i=this.getCssData(this.__extractCssName(e),!0);i===null&&(i=t),this.add(e,i),this.__initStyleAttrObserver()}dropCssDataCache(){this.__cssDataCache=null,this.__computedStyle=null}defineAccessor(e,t,i){let s="__"+e;this[s]=this[e],Object.defineProperty(this,e,{set:o=>{this[s]=o,i?window.setTimeout(()=>{t==null||t(o)}):t==null||t(o)},get:()=>this[s]}),this[e]=this[s]}static set shadowStyles(e){let t=new Blob([e],{type:"text/css"});this.__shadowStylesUrl=URL.createObjectURL(t)}static set rootStyles(e){if(!this.__rootStylesLink){let t=new Blob([e],{type:"text/css"}),i=URL.createObjectURL(t),s=document.createElement("link");s.href=i,s.rel="stylesheet",this.__rootStylesLink=s}}},a(ye,"_BaseComponent"),ye),kt=yt;ar(kt,"template");var ve,nr=(ve=class{static _print(e){console.warn(e)}static setDefaultTitle(e){this.defaultTitle=e}static setRoutingMap(e){Object.assign(this.appMap,e);for(let t in this.appMap)!this.defaultRoute&&this.appMap[t].default===!0?this.defaultRoute=t:!this.errorRoute&&this.appMap[t].error===!0&&(this.errorRoute=t)}static set routingEventName(e){this.__routingEventName=e}static get routingEventName(){return this.__routingEventName||"sym-on-route"}static readAddressBar(){let e={route:null,options:{}};return window.location.search.split(this.separator).forEach(i=>{if(i.includes("?"))e.route=i.replace("?","");else if(i.includes("=")){let s=i.split("=");e.options[s[0]]=decodeURI(s[1])}else e.options[i]=!0}),e}static notify(){let e=this.readAddressBar(),t=this.appMap[e.route];if(t&&t.title&&(document.title=t.title),e.route===null&&this.defaultRoute){this.applyRoute(this.defaultRoute);return}else if(!t&&this.errorRoute){this.applyRoute(this.errorRoute);return}else if(!t&&this.defaultRoute){this.applyRoute(this.defaultRoute);return}else if(!t){this._print(`Route "${e.route}" not found...`);return}let i=new CustomEvent(nr.routingEventName,{detail:{route:e.route,options:Object.assign(t||{},e.options)}});window.dispatchEvent(i)}static reflect(e,t={}){let i=this.appMap[e];if(!i){this._print("Wrong route: "+e);return}let s="?"+e;for(let n in t)t[n]===!0?s+=this.separator+n:s+=this.separator+n+`=${t[n]}`;let o=i.title||this.defaultTitle||"";window.history.pushState(null,o,s),document.title=o}static applyRoute(e,t={}){this.reflect(e,t),this.notify()}static setSeparator(e){this._separator=e}static get separator(){return this._separator||"&"}static createRouterData(e,t){this.setRoutingMap(t);let i=T.registerCtx({route:null,options:null,title:null},e);return window.addEventListener(this.routingEventName,s=>{var o;i.multiPub({route:s.detail.route,options:s.detail.options,title:((o=s.detail.options)==null?void 0:o.title)||this.defaultTitle||""})}),nr.notify(),this.initPopstateListener(),i}static initPopstateListener(){this.__onPopstate||(this.__onPopstate=()=>{this.notify()},window.addEventListener("popstate",this.__onPopstate))}static removePopstateListener(){window.removeEventListener("popstate",this.__onPopstate),this.__onPopstate=null}},a(ve,"AppRouter"),ve);nr.appMap=Object.create(null);function xe(r,e){for(let t in e)t.includes("-")?r.style.setProperty(t,e[t]):r.style[t]=e[t]}a(xe,"applyStyles");function Ca(r,e){for(let t in e)e[t].constructor===Boolean?e[t]?r.setAttribute(t,""):r.removeAttribute(t):r.setAttribute(t,e[t])}a(Ca,"applyAttributes");function lr(r={tag:"div"}){let e=document.createElement(r.tag);if(r.attributes&&Ca(e,r.attributes),r.styles&&xe(e,r.styles),r.properties)for(let t in r.properties)e[t]=r.properties[t];return r.processors&&r.processors.forEach(t=>{t(e)}),r.children&&r.children.forEach(t=>{let i=lr(t);e.appendChild(i)}),e}a(lr,"create");var Zs="idb-store-ready",xa="symbiote-db",Aa="symbiote-idb-update_",we,Ea=(we=class{_notifyWhenReady(e=null){window.dispatchEvent(new CustomEvent(Zs,{detail:{dbName:this.name,storeName:this.storeName,event:e}}))}get _updEventName(){return Aa+this.name}_getUpdateEvent(e){return new CustomEvent(this._updEventName,{detail:{key:this.name,newValue:e}})}_notifySubscribers(e){window.localStorage.removeItem(this.name),window.localStorage.setItem(this.name,e),window.dispatchEvent(this._getUpdateEvent(e))}constructor(e,t){this.name=e,this.storeName=t,this.version=1,this.request=window.indexedDB.open(this.name,this.version),this.request.onupgradeneeded=i=>{this.db=i.target.result,this.objStore=this.db.createObjectStore(t,{keyPath:"_key"}),this.objStore.transaction.oncomplete=s=>{this._notifyWhenReady(s)}},this.request.onsuccess=i=>{this.db=i.target.result,this._notifyWhenReady(i)},this.request.onerror=i=>{console.error(i)},this._subscriptionsMap={},this._updateHandler=i=>{i.key===this.name&&this._subscriptionsMap[i.newValue]&&this._subscriptionsMap[i.newValue].forEach(async o=>{o(await this.read(i.newValue))})},this._localUpdateHandler=i=>{this._updateHandler(i.detail)},window.addEventListener("storage",this._updateHandler),window.addEventListener(this._updEventName,this._localUpdateHandler)}read(e){let i=this.db.transaction(this.storeName,"readwrite").objectStore(this.storeName).get(e);return new Promise((s,o)=>{i.onsuccess=n=>{var l;(l=n.target.result)!=null&&l._value?s(n.target.result._value):(s(null),console.warn(`IDB: cannot read "${e}"`))},i.onerror=n=>{o(n)}})}write(e,t,i=!1){let s={_key:e,_value:t},n=this.db.transaction(this.storeName,"readwrite").objectStore(this.storeName).put(s);return new Promise((l,c)=>{n.onsuccess=u=>{i||this._notifySubscribers(e),l(u.target.result)},n.onerror=u=>{c(u)}})}delete(e,t=!1){let s=this.db.transaction(this.storeName,"readwrite").objectStore(this.storeName).delete(e);return new Promise((o,n)=>{s.onsuccess=l=>{t||this._notifySubscribers(e),o(l)},s.onerror=l=>{n(l)}})}getAll(){let t=this.db.transaction(this.storeName,"readwrite").objectStore(this.storeName).getAll();return new Promise((i,s)=>{t.onsuccess=o=>{let n=o.target.result;i(n.map(l=>l._value))},t.onerror=o=>{s(o)}})}subscribe(e,t){this._subscriptionsMap[e]||(this._subscriptionsMap[e]=new Set);let i=this._subscriptionsMap[e];return i.add(t),{remove:()=>{i.delete(t),i.size||delete this._subscriptionsMap[e]}}}stop(){window.removeEventListener("storage",this._updateHandler),this._subscriptionsMap=null,Ys.clear(this.name)}},a(we,"DbInstance"),we),Ce,Ys=(Ce=class{static get readyEventName(){return Zs}static open(e=xa,t="store"){let i=e+"/"+t;return this._reg[i]||(this._reg[i]=new Ea(e,t)),this._reg[i]}static clear(e){window.indexedDB.deleteDatabase(e);for(let t in this._reg)t.split("/")[0]===e&&delete this._reg[t]}},a(Ce,"IDB"),Ce);ar(Ys,"_reg",Object.create(null));var Js=a(r=>{if(typeof r!="string"||!r)return"";let e=r.trim();return e.startsWith("-/")?e=e.slice(2):e.startsWith("/")&&(e=e.slice(1)),e.endsWith("/")&&(e=e.slice(0,e.length-1)),e},"normalizeCdnOperation"),li=a((...r)=>r.filter(e=>typeof e=="string"&&e).map(e=>Js(e)).join("/-/"),"joinCdnOperations"),N=a((...r)=>{let e=li(...r);return e?`-/${e}/`:""},"createCdnUrlModifiers");function ci(r){let e=new URL(r),t=e.pathname+e.search+e.hash,i=t.lastIndexOf("http"),s=t.lastIndexOf("/"),o="";return i>=0?o=t.slice(i):s>=0&&(o=t.slice(s+1)),o}a(ci,"extractFilename");function ui(r){let e=new URL(r),{pathname:t}=e,i=t.indexOf("/"),s=t.indexOf("/",i+1);return t.substring(i+1,s)}a(ui,"extractUuid");function cr(r){let e=to(r),t=new URL(e),i=t.pathname.indexOf("/-/");return i===-1?"":t.pathname.substring(i).slice(1)}a(cr,"extractCdnUrlModifiers");function Qs(r){return cr(r).split("/-/").filter(Boolean).map(t=>Js(t))}a(Qs,"extractOperations");function to(r){let e=new URL(r),t=ci(r),i=eo(t)?io(t).pathname:t;return e.pathname=e.pathname.replace(i,""),e.search="",e.hash="",e.toString()}a(to,"trimFilename");function eo(r){return r.startsWith("http")}a(eo,"isFileUrl");function io(r){let e=new URL(r);return{pathname:e.origin+e.pathname||"",search:e.search||"",hash:e.hash||""}}a(io,"splitFileUrl");var P=a((r,e,t)=>{let i=new URL(to(r));if(t=t||ci(r),i.pathname.startsWith("//")&&(i.pathname=i.pathname.replace("//","/")),eo(t)){let s=io(t);i.pathname=i.pathname+(e||"")+(s.pathname||""),i.search=s.search,i.hash=s.hash}else i.pathname=i.pathname+(e||"")+(t||"");return i.toString()},"createCdnUrl"),vt=a((r,e)=>{let t=new URL(r);return t.pathname=e+"/",t.toString()},"createOriginalUrl");var z=a((r,e=",")=>r.trim().split(e).map(t=>t.trim()).filter(t=>t.length>0),"stringToArray");var q=Object.freeze({brightness:0,exposure:0,gamma:100,contrast:0,saturation:0,vibrance:0,warmth:0,enhance:0,filter:0,rotate:0,mirror:!1,flip:!1,crop:void 0}),so=["enhance","brightness","exposure","gamma","contrast","saturation","vibrance","warmth","filter","mirror","flip","rotate","crop"];function Ta(r,e){if(typeof e=="number"){let t=e;return q[r]!==t?`${r}/${t}`:""}if(typeof e=="boolean"){let t=e;return q[r]!==t?`${r}`:""}if(r==="filter"&&e){let{name:t,amount:i}=e;return q.filter===i?"":`${r}/${t}/${i}`}if(r==="crop"&&e){let{dimensions:t,coords:i}=e;return`${r}/${t.join("x")}/${i.join(",")}`}return""}a(Ta,"transformationToStr");function wt(r){return li(...so.filter(e=>typeof r[e]!="undefined"&&r[e]!==null).map(e=>{let t=r[e];return Ta(e,t)}).filter(e=>!!e))}a(wt,"transformationsToOperations");var hi=li("format/auto","progressive/yes"),pt=a(([r])=>typeof r!="undefined"?Number(r):void 0,"asNumber"),ro=a(()=>!0,"asBoolean"),Sa=a(([r,e])=>({name:r,amount:typeof e!="undefined"?Number(e):100}),"asFilter"),$a=a(([r,e])=>{if(!/\d+x\d+/.test(r)||!/\d+,\d+/.test(e))throw new Error("Crop by aspect ratio, percentage or alignment shortcuts is not supported.");return{dimensions:z(r,"x").map(Number),coords:z(e).map(Number)}},"asCrop"),ka=Object.freeze({enhance:pt,brightness:pt,exposure:pt,gamma:pt,contrast:pt,saturation:pt,vibrance:pt,warmth:pt,filter:Sa,mirror:ro,flip:ro,rotate:pt,crop:$a});function oo(r){let e={};for(let t of r){let[i,...s]=t.split("/");if(!so.includes(i))continue;let o=i,n=ka[o];try{let l=n(s);e[o]=l}catch(l){console.warn([`Failed to parse URL operation "${t}". It will be ignored.`,l instanceof Error?`Error message: "${l.message}"`:l,"If you need this functionality, please feel free to open an issue at https://github.com/uploadcare/blocks/issues/new"].join(`
|
|
29
|
+
`))}}return e}a(oo,"operationsToTransformations");var O=Object.freeze({CROP:"crop",TUNING:"tuning",FILTERS:"filters"}),G=[O.CROP,O.TUNING,O.FILTERS],no=["brightness","exposure","gamma","contrast","saturation","vibrance","warmth","enhance"],ao=["adaris","briaril","calarel","carris","cynarel","cyren","elmet","elonni","enzana","erydark","fenralan","ferand","galen","gavin","gethriel","iorill","iothari","iselva","jadis","lavra","misiara","namala","nerion","nethari","pamaya","sarnar","sedis","sewen","sorahel","sorlen","tarian","thellassan","varriel","varven","vevera","virkas","yedis","yllara","zatvel","zevcen"],lo=["rotate","mirror","flip"],rt=Object.freeze({brightness:{zero:q.brightness,range:[-100,100],keypointsNumber:2},exposure:{zero:q.exposure,range:[-500,500],keypointsNumber:2},gamma:{zero:q.gamma,range:[0,1e3],keypointsNumber:2},contrast:{zero:q.contrast,range:[-100,500],keypointsNumber:2},saturation:{zero:q.saturation,range:[-100,500],keypointsNumber:1},vibrance:{zero:q.vibrance,range:[-100,500],keypointsNumber:1},warmth:{zero:q.warmth,range:[-100,100],keypointsNumber:1},enhance:{zero:q.enhance,range:[0,100],keypointsNumber:1},filter:{zero:q.filter,range:[0,100],keypointsNumber:1}});var co=a(r=>r?r.split(",").map(e=>e.trim()):[],"deserealizeCsv"),Vt=a(r=>r?r.join(","):"","serializeCsv");var Ia="https://ucarecdn.com",Oa="https://upload.uploadcare.com",La="https://social.uploadcare.com",Q={pubkey:"",multiple:!0,multipleMin:0,multipleMax:Number.MAX_SAFE_INTEGER,confirmUpload:!1,imgOnly:!1,accept:"",externalSourcesPreferredTypes:"",store:"auto",cameraMirror:!1,cameraCapture:"",sourceList:"local, url, camera, dropbox, gdrive",cloudImageEditorTabs:Vt(G),maxLocalFileSizeBytes:0,thumbSize:76,showEmptyList:!1,useLocalImageEditor:!1,useCloudImageEditor:!0,removeCopyright:!1,cropPreset:"",imageShrink:"",modalScrollLock:!0,modalBackdropStrokes:!1,sourceListWrap:!0,remoteTabSessionKey:"",cdnCname:Ia,baseUrl:Oa,socialBaseUrl:La,secureSignature:"",secureExpire:"",secureDeliveryProxy:"",retryThrottledRequestMaxTimes:1,multipartMinFileSize:26214400,multipartChunkSize:5242880,maxConcurrentRequests:10,multipartMaxConcurrentRequests:4,multipartMaxAttempts:3,checkForUrlDuplicates:!1,saveUrlForRecurrentUploads:!1,groupOutput:!1,userAgentIntegration:"",debug:!1,metadata:null,localeName:"en",localeDefinitionOverride:null,secureUploadsExpireThreshold:10*60*1e3,secureUploadsSignatureResolver:null,secureDeliveryProxyUrlResolver:null,iconHrefResolver:null,fileValidators:[],collectionValidators:[]};var k=Object.freeze({FILE_ADDED:"file-added",FILE_REMOVED:"file-removed",FILE_UPLOAD_START:"file-upload-start",FILE_UPLOAD_PROGRESS:"file-upload-progress",FILE_UPLOAD_SUCCESS:"file-upload-success",FILE_UPLOAD_FAILED:"file-upload-failed",FILE_URL_CHANGED:"file-url-changed",MODAL_OPEN:"modal-open",MODAL_CLOSE:"modal-close",DONE_CLICK:"done-click",UPLOAD_CLICK:"upload-click",ACTIVITY_CHANGE:"activity-change",COMMON_UPLOAD_START:"common-upload-start",COMMON_UPLOAD_PROGRESS:"common-upload-progress",COMMON_UPLOAD_SUCCESS:"common-upload-success",COMMON_UPLOAD_FAILED:"common-upload-failed",CHANGE:"change",GROUP_CREATED:"group-created"}),ur=class ur{constructor(e){h(this,"_timeoutStore",new Map);h(this,"_targets",new Set);h(this,"_debugPrint",null);this._debugPrint=e}bindTarget(e){this._targets.add(e)}unbindTarget(e){this._targets.delete(e)}_dispatch(e,t){var i;for(let s of this._targets)s.dispatchEvent(new CustomEvent(e,{detail:t}));(i=this._debugPrint)==null||i.call(this,()=>{let s=t&&typeof t=="object"?{...t}:t;return[`event "${e}"`,s]})}emit(e,t,{debounce:i}={}){if(typeof i!="number"&&!i){this._dispatch(e,typeof t=="function"?t():t);return}this._timeoutStore.has(e)&&window.clearTimeout(this._timeoutStore.get(e));let s=typeof i=="number"?i:20,o=window.setTimeout(()=>{this._dispatch(e,typeof t=="function"?t():t),this._timeoutStore.delete(e)},s);this._timeoutStore.set(e,o)}};a(ur,"EventEmitter");var di=ur;function U(r,e){let t,i=a((...s)=>{clearTimeout(t),t=setTimeout(()=>r(...s),e)},"debounced");return i.cancel=()=>{clearTimeout(t)},i}a(U,"debounce");var uo="--uploadcare-blocks-window-height",Ae=class Ae{static registerClient(e){this.clientsRegistry.size===0&&this.attachTracker(),this.clientsRegistry.add(e)}static unregisterClient(e){this.clientsRegistry.delete(e),this.clientsRegistry.size===0&&this.detachTracker()}static attachTracker(){window.addEventListener("resize",this.flush,{passive:!0,capture:!0}),this.flush()}static detachTracker(){window.removeEventListener("resize",this.flush,{capture:!0}),document.documentElement.style.removeProperty(uo)}};a(Ae,"WindowHeightTracker"),h(Ae,"clientsRegistry",new Set),h(Ae,"flush",U(()=>{document.documentElement.style.setProperty(uo,`${window.innerHeight}px`)},100));var Ee=Ae;var ho=a(r=>{var i;let e=new Intl.Locale(r),t="ltr";return typeof e.getTextInfo=="function"&&e.getTextInfo().direction?t=e.getTextInfo().direction:"textInfo"in e&&((i=e.textInfo)!=null&&i.direction)&&(t=e.textInfo.direction),t},"getLocaleDirection");var pi=a((r,e)=>new Intl.PluralRules(r).select(e),"getPluralForm");var Ua=a(r=>r,"DEFAULT_TRANSFORMER"),hr="{{",fo="}}",po="plural:";function Te(r,e,t={}){var n;let{openToken:i=hr,closeToken:s=fo,transform:o=Ua}=t;for(let l in e){let c=(n=e[l])==null?void 0:n.toString();r=r.replaceAll(i+l+s,typeof c=="string"?o(c):c)}return r}a(Te,"applyTemplateData");function mo(r){let e=[],t=r.indexOf(hr);for(;t!==-1;){let i=r.indexOf(fo,t),s=r.substring(t+2,i);if(s.startsWith(po)){let o=r.substring(t+2,i).replace(po,""),n=o.substring(0,o.indexOf("(")),l=o.substring(o.indexOf("(")+1,o.indexOf(")"));e.push({variable:s,pluralKey:n,countVariable:l})}t=r.indexOf(hr,i)}return e}a(mo,"getPluralObjects");var go=a(({element:r,attribute:e,onSuccess:t,onTimeout:i,timeout:s=300})=>{let o=r.getAttribute(e);if(o!==null){t(o);return}let n=new MutationObserver(u=>{let d=u[u.length-1];c(d)});n.observe(r,{attributes:!0,attributeFilter:[e]});let l=setTimeout(()=>{n.disconnect(),i()},s),c=a(u=>{let d=r.getAttribute(e);u.type==="attributes"&&u.attributeName===e&&d!==null&&(clearTimeout(l),n.disconnect(),t(d))},"handleMutation")},"waitForAttribute");function bo(r){return Object.prototype.toString.call(r)==="[object Object]"}a(bo,"isObject");var Pa=/\W|_/g;function Ma(r){return r.split(Pa).map((e,t)=>e.charAt(0)[t>0?"toUpperCase":"toLowerCase"]()+e.slice(1)).join("")}a(Ma,"camelizeString");function _o(r,{ignoreKeys:e}={ignoreKeys:[]}){return Array.isArray(r)?r.map(t=>gt(t,{ignoreKeys:e})):r}a(_o,"camelizeArrayItems");function gt(r,{ignoreKeys:e}={ignoreKeys:[]}){if(Array.isArray(r))return _o(r,{ignoreKeys:e});if(!bo(r))return r;let t={};for(let i of Object.keys(r)){let s=r[i];if(e.includes(i)){t[i]=s;continue}bo(s)?s=gt(s,{ignoreKeys:e}):Array.isArray(s)&&(s=_o(s,{ignoreKeys:e})),t[Ma(i)]=s}return t}a(gt,"camelizeKeys");var Ra=a(r=>new Promise(e=>setTimeout(e,r)),"delay");function _r({libraryName:r,libraryVersion:e,userAgent:t,publicKey:i="",integration:s=""}){let o="JavaScript";if(typeof t=="string")return t;if(typeof t=="function")return t({publicKey:i,libraryName:r,libraryVersion:e,languageName:o,integration:s});let n=[r,e,i].filter(Boolean).join("/"),l=[o,s].filter(Boolean).join("; ");return`${n} (${l})`}a(_r,"getUserAgent$1");var Da={factor:2,time:100};function Fa(r,e=Da){let t=0;function i(s){let o=Math.round(e.time*e.factor**t);return s({attempt:t,retry:a(l=>Ra(l!=null?l:o).then(()=>(t+=1,i(s))),"retry")})}return a(i,"runAttempt"),i(r)}a(Fa,"retrier");var Ar=class Ar extends Error{};a(Ar,"UploadcareError");var Se=Ar,mi=class mi extends Se{constructor(t){super();h(this,"originalProgressEvent");this.name="NetworkError",this.message="Network error",Object.setPrototypeOf(this,mi.prototype),this.originalProgressEvent=t}};a(mi,"NetworkError");var Bt=mi,_i=a((r,e)=>{r&&(r.aborted?Promise.resolve().then(e):r.addEventListener("abort",()=>e(),{once:!0}))},"onCancel"),gi=class gi extends Se{constructor(t="Request canceled"){super(t);h(this,"isCancel",!0);this.name="CancelError",Object.setPrototypeOf(this,gi.prototype)}};a(gi,"CancelError");var Ct=gi,Na=500,vo=a(({check:r,interval:e=Na,timeout:t,signal:i})=>new Promise((s,o)=>{let n,l;_i(i,()=>{n&&clearTimeout(n),o(new Ct("Poll cancelled"))}),t&&(l=setTimeout(()=>{n&&clearTimeout(n),o(new Ct("Timed out"))},t));let c=a(()=>{try{Promise.resolve(r(i)).then(u=>{u?(l&&clearTimeout(l),s(u)):n=setTimeout(c,e)}).catch(u=>{l&&clearTimeout(l),o(u)})}catch(u){l&&clearTimeout(l),o(u)}},"tick");n=setTimeout(c,0)}),"poll"),S={baseCDN:"https://ucarecdn.com",baseURL:"https://upload.uploadcare.com",maxContentLength:50*1024*1024,retryThrottledRequestMaxTimes:1,retryNetworkErrorMaxTimes:3,multipartMinFileSize:25*1024*1024,multipartChunkSize:5*1024*1024,multipartMinLastPartSize:1024*1024,maxConcurrentRequests:4,pollingTimeoutMilliseconds:1e4,pusherKey:"79ae88bd931ea68464d9"},yi="application/octet-stream",wo="original",xt=a(({method:r,url:e,data:t,headers:i={},signal:s,onProgress:o})=>new Promise((n,l)=>{let c=new XMLHttpRequest,u=(r==null?void 0:r.toUpperCase())||"GET",d=!1;c.open(u,e,!0),i&&Object.entries(i).forEach(p=>{let[f,m]=p;typeof m!="undefined"&&!Array.isArray(m)&&c.setRequestHeader(f,m)}),c.responseType="text",_i(s,()=>{d=!0,c.abort(),l(new Ct)}),c.onload=()=>{if(c.status!=200)l(new Error(`Error ${c.status}: ${c.statusText}`));else{let p={method:u,url:e,data:t,headers:i||void 0,signal:s,onProgress:o},f=c.getAllResponseHeaders().trim().split(/[\r\n]+/),m={};f.forEach(function(w){let C=w.split(": "),v=C.shift(),x=C.join(": ");v&&typeof v!="undefined"&&(m[v]=x)});let g=c.response,b=c.status;n({request:p,data:g,headers:m,status:b})}},c.onerror=p=>{d||l(new Bt(p))},o&&typeof o=="function"&&(c.upload.onprogress=p=>{p.lengthComputable?o({isComputable:!0,value:p.loaded/p.total}):o({isComputable:!1})}),t?c.send(t):c.send()}),"request");function za(r,...e){return r}a(za,"identity");var Va=a(({name:r})=>r?[r]:[],"getFileOptions"),Ba=za,ja=a(()=>new FormData,"getFormData"),Co=a(r=>!1,"isBuffer"),vi=a(r=>typeof Blob!="undefined"&&r instanceof Blob,"isBlob"),wi=a(r=>typeof File!="undefined"&&r instanceof File,"isFile"),Ci=a(r=>!!r&&typeof r=="object"&&!Array.isArray(r)&&"uri"in r&&typeof r.uri=="string","isReactNativeAsset"),jt=a(r=>vi(r)||wi(r)||Co()||Ci(r),"isFileData"),Ha=a(r=>typeof r=="string"||typeof r=="number"||typeof r=="undefined","isSimpleValue"),Ga=a(r=>!!r&&typeof r=="object"&&!Array.isArray(r),"isObjectValue"),Wa=a(r=>!!r&&typeof r=="object"&&"data"in r&&jt(r.data),"isFileValue");function xo(r,e,t){if(Array.isArray(t))for(let i of t)xo(r,`${e}[]`,i);else if(Wa(t)){let{name:i,contentType:s}=t,o=Ba(t.data,i,s!=null?s:yi),n=Va({name:i,contentType:s});r.push([e,o,...n])}else if(Ga(t))for(let[i,s]of Object.entries(t))typeof s!="undefined"&&r.push([`${e}[${i}]`,String(s)]);else Ha(t)&&t&&r.push([e,t.toString()])}a(xo,"collectParams");function Xa(r){let e=[];for(let[t,i]of Object.entries(r))xo(e,t,i);return e}a(Xa,"getFormDataParams");function xi(r){let e=ja(),t=Xa(r);for(let i of t){let[s,o,...n]=i;e.append(s,o,...n)}return e}a(xi,"buildFormData");var bi=class bi extends Se{constructor(t,i,s,o,n){super();h(this,"code");h(this,"request");h(this,"response");h(this,"headers");this.name="UploadError",this.message=t,this.code=i,this.request=s,this.response=o,this.headers=n,Object.setPrototypeOf(this,bi.prototype)}};a(bi,"UploadError");var V=bi,qa=a(r=>{let e=new URLSearchParams;for(let[t,i]of Object.entries(r))i&&typeof i=="object"&&!Array.isArray(i)?Object.entries(i).filter(s=>{var o;return(o=s[1])!=null?o:!1}).forEach(s=>e.set(`${t}[${s[0]}]`,String(s[1]))):Array.isArray(i)?i.forEach(s=>{e.append(`${t}[]`,s)}):typeof i=="string"&&i?e.set(t,i):typeof i=="number"&&e.set(t,i.toString());return e.toString()},"buildSearchParams"),ft=a((r,e,t)=>{let i=new URL(r);return i.pathname=(i.pathname+e).replace("//","/"),t&&(i.search=qa(t)),i.toString()},"getUrl"),Ka="6.14.1",Za="UploadcareUploadClient",Ya=Ka;function It(r){return _r({libraryName:Za,libraryVersion:Ya,...r})}a(It,"getUserAgent");var Ja="RequestThrottledError",yo=15e3,Qa=1e3;function tl(r){let{headers:e}=r||{};if(!e||typeof e["retry-after"]!="string")return yo;let t=parseInt(e["retry-after"],10);return Number.isFinite(t)?t*1e3:yo}a(tl,"getTimeoutFromThrottledRequest");function At(r,e){let{retryThrottledRequestMaxTimes:t,retryNetworkErrorMaxTimes:i}=e;return Fa(({attempt:s,retry:o})=>r().catch(n=>{if("response"in n&&(n==null?void 0:n.code)===Ja&&s<t)return o(tl(n));if(n instanceof Bt&&s<i)return o((s+1)*Qa);throw n}))}a(At,"retryIfFailed");var Ao=a(r=>{let e="";return(vi(r)||wi(r)||Ci(r))&&(e=r.type),e||yi},"getContentType"),Eo=a(r=>{let e="";return wi(r)&&r.name?e=r.name:vi(r)||Co()?e="":Ci(r)&&r.name&&(e=r.name),e||wo},"getFileName");function yr(r){return typeof r=="undefined"||r==="auto"?"auto":r?"1":"0"}a(yr,"getStoreValue");function el(r,{publicKey:e,fileName:t,contentType:i,baseURL:s=S.baseURL,secureSignature:o,secureExpire:n,store:l,signal:c,onProgress:u,source:d="local",integration:p,userAgent:f,retryThrottledRequestMaxTimes:m=S.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:g=S.retryNetworkErrorMaxTimes,metadata:b}){return At(()=>xt({method:"POST",url:ft(s,"/base/",{jsonerrors:1}),headers:{"X-UC-User-Agent":It({publicKey:e,integration:p,userAgent:f})},data:xi({file:{data:r,name:t||Eo(r),contentType:i||Ao(r)},UPLOADCARE_PUB_KEY:e,UPLOADCARE_STORE:yr(l),signature:o,expire:n,source:d,metadata:b}),signal:c,onProgress:u}).then(({data:w,headers:C,request:v})=>{let x=gt(JSON.parse(w));if("error"in x)throw new V(x.error.content,x.error.errorCode,v,x,C);return x}),{retryNetworkErrorMaxTimes:g,retryThrottledRequestMaxTimes:m})}a(el,"base");var fr;(function(r){r.Token="token",r.FileInfo="file_info"})(fr||(fr={}));function il(r,{publicKey:e,baseURL:t=S.baseURL,store:i,fileName:s,checkForUrlDuplicates:o,saveUrlForRecurrentUploads:n,secureSignature:l,secureExpire:c,source:u="url",signal:d,integration:p,userAgent:f,retryThrottledRequestMaxTimes:m=S.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:g=S.retryNetworkErrorMaxTimes,metadata:b}){return At(()=>xt({method:"POST",headers:{"X-UC-User-Agent":It({publicKey:e,integration:p,userAgent:f})},url:ft(t,"/from_url/",{jsonerrors:1,pub_key:e,source_url:r,store:yr(i),filename:s,check_URL_duplicates:o?1:void 0,save_URL_duplicates:n?1:void 0,signature:l,expire:c,source:u,metadata:b}),signal:d}).then(({data:w,headers:C,request:v})=>{let x=gt(JSON.parse(w));if("error"in x)throw new V(x.error.content,x.error.errorCode,v,x,C);return x}),{retryNetworkErrorMaxTimes:g,retryThrottledRequestMaxTimes:m})}a(il,"fromUrl");var W;(function(r){r.Unknown="unknown",r.Waiting="waiting",r.Progress="progress",r.Error="error",r.Success="success"})(W||(W={}));var rl=a(r=>"status"in r&&r.status===W.Error,"isErrorResponse");function sl(r,{publicKey:e,baseURL:t=S.baseURL,signal:i,integration:s,userAgent:o,retryThrottledRequestMaxTimes:n=S.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:l=S.retryNetworkErrorMaxTimes}={}){return At(()=>xt({method:"GET",headers:e?{"X-UC-User-Agent":It({publicKey:e,integration:s,userAgent:o})}:void 0,url:ft(t,"/from_url/status/",{jsonerrors:1,token:r}),signal:i}).then(({data:c,headers:u,request:d})=>{let p=gt(JSON.parse(c));if("error"in p&&!rl(p))throw new V(p.error.content,p.error.errorCode,d,p,u);return p}),{retryNetworkErrorMaxTimes:l,retryThrottledRequestMaxTimes:n})}a(sl,"fromUrlStatus");function ol(r,{publicKey:e,baseURL:t=S.baseURL,jsonpCallback:i,secureSignature:s,secureExpire:o,signal:n,source:l,integration:c,userAgent:u,retryThrottledRequestMaxTimes:d=S.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:p=S.retryNetworkErrorMaxTimes}){return At(()=>xt({method:"POST",headers:{"X-UC-User-Agent":It({publicKey:e,integration:c,userAgent:u})},url:ft(t,"/group/",{jsonerrors:1}),data:xi({files:r,callback:i,pub_key:e,signature:s,expire:o,source:l}),signal:n}).then(({data:f,headers:m,request:g})=>{let b=gt(JSON.parse(f));if("error"in b)throw new V(b.error.content,b.error.errorCode,g,b,m);return b}),{retryNetworkErrorMaxTimes:p,retryThrottledRequestMaxTimes:d})}a(ol,"group");function To(r,{publicKey:e,baseURL:t=S.baseURL,signal:i,source:s,integration:o,userAgent:n,retryThrottledRequestMaxTimes:l=S.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:c=S.retryNetworkErrorMaxTimes}){return At(()=>xt({method:"GET",headers:{"X-UC-User-Agent":It({publicKey:e,integration:o,userAgent:n})},url:ft(t,"/info/",{jsonerrors:1,pub_key:e,file_id:r,source:s}),signal:i}).then(({data:u,headers:d,request:p})=>{let f=gt(JSON.parse(u));if("error"in f)throw new V(f.error.content,f.error.errorCode,p,f,d);return f}),{retryThrottledRequestMaxTimes:l,retryNetworkErrorMaxTimes:c})}a(To,"info");function nl(r,{publicKey:e,contentType:t,fileName:i,multipartChunkSize:s=S.multipartChunkSize,baseURL:o="",secureSignature:n,secureExpire:l,store:c,signal:u,source:d="local",integration:p,userAgent:f,retryThrottledRequestMaxTimes:m=S.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:g=S.retryNetworkErrorMaxTimes,metadata:b}){return At(()=>xt({method:"POST",url:ft(o,"/multipart/start/",{jsonerrors:1}),headers:{"X-UC-User-Agent":It({publicKey:e,integration:p,userAgent:f})},data:xi({filename:i||wo,size:r,content_type:t||yi,part_size:s,UPLOADCARE_STORE:yr(c),UPLOADCARE_PUB_KEY:e,signature:n,expire:l,source:d,metadata:b}),signal:u}).then(({data:w,headers:C,request:v})=>{let x=gt(JSON.parse(w));if("error"in x)throw new V(x.error.content,x.error.errorCode,v,x,C);return x.parts=Object.keys(x.parts).map(M=>x.parts[Number(M)]),x}),{retryThrottledRequestMaxTimes:m,retryNetworkErrorMaxTimes:g})}a(nl,"multipartStart");function al(r,e,{contentType:t,signal:i,onProgress:s,retryThrottledRequestMaxTimes:o=S.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:n=S.retryNetworkErrorMaxTimes}){return At(()=>xt({method:"PUT",url:e,data:r,onProgress:s,signal:i,headers:{"Content-Type":t||yi}}).then(l=>(s&&s({isComputable:!0,value:1}),l)).then(({status:l})=>({code:l})),{retryThrottledRequestMaxTimes:o,retryNetworkErrorMaxTimes:n})}a(al,"multipartUpload");function ll(r,{publicKey:e,baseURL:t=S.baseURL,source:i="local",signal:s,integration:o,userAgent:n,retryThrottledRequestMaxTimes:l=S.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:c=S.retryNetworkErrorMaxTimes}){return At(()=>xt({method:"POST",url:ft(t,"/multipart/complete/",{jsonerrors:1}),headers:{"X-UC-User-Agent":It({publicKey:e,integration:o,userAgent:n})},data:xi({uuid:r,UPLOADCARE_PUB_KEY:e,source:i}),signal:s}).then(({data:u,headers:d,request:p})=>{let f=gt(JSON.parse(u));if("error"in f)throw new V(f.error.content,f.error.errorCode,p,f,d);return f}),{retryThrottledRequestMaxTimes:l,retryNetworkErrorMaxTimes:c})}a(ll,"multipartComplete");function vr(r,{publicKey:e,baseURL:t,source:i,integration:s,userAgent:o,retryThrottledRequestMaxTimes:n,retryNetworkErrorMaxTimes:l,signal:c,onProgress:u}){return vo({check:d=>To(r,{publicKey:e,baseURL:t,signal:d,source:i,integration:s,userAgent:o,retryThrottledRequestMaxTimes:n,retryNetworkErrorMaxTimes:l}).then(p=>p.isReady?p:(u&&u({isComputable:!0,value:1}),!1)),signal:c})}a(vr,"isReadyPoll");function cl(r){return"defaultEffects"in r}a(cl,"isGroupFileInfo");var Er=class Er{constructor(e,{baseCDN:t=S.baseCDN,fileName:i}={}){h(this,"uuid");h(this,"name",null);h(this,"size",null);h(this,"isStored",null);h(this,"isImage",null);h(this,"mimeType",null);h(this,"cdnUrl",null);h(this,"s3Url",null);h(this,"originalFilename",null);h(this,"imageInfo",null);h(this,"videoInfo",null);h(this,"contentInfo",null);h(this,"metadata",null);h(this,"s3Bucket",null);h(this,"defaultEffects",null);let{uuid:s,s3Bucket:o}=e,n=ft(t,`${s}/`),l=o?ft(`https://${o}.s3.amazonaws.com/`,`${s}/${e.filename}`):null;this.uuid=s,this.name=i||e.filename,this.size=e.size,this.isStored=e.isStored,this.isImage=e.isImage,this.mimeType=e.mimeType,this.cdnUrl=n,this.originalFilename=e.originalFilename,this.imageInfo=e.imageInfo,this.videoInfo=e.videoInfo,this.contentInfo=e.contentInfo,this.metadata=e.metadata||null,this.s3Bucket=o||null,this.s3Url=l,cl(e)&&(this.defaultEffects=e.defaultEffects)}};a(Er,"UploadcareFile");var mt=Er,ul=a((r,{publicKey:e,fileName:t,baseURL:i,secureSignature:s,secureExpire:o,store:n,contentType:l,signal:c,onProgress:u,source:d,integration:p,userAgent:f,retryThrottledRequestMaxTimes:m,retryNetworkErrorMaxTimes:g,baseCDN:b,metadata:w})=>el(r,{publicKey:e,fileName:t,contentType:l,baseURL:i,secureSignature:s,secureExpire:o,store:n,signal:c,onProgress:u,source:d,integration:p,userAgent:f,retryThrottledRequestMaxTimes:m,retryNetworkErrorMaxTimes:g,metadata:w}).then(({file:C})=>vr(C,{publicKey:e,baseURL:i,source:d,integration:p,userAgent:f,retryThrottledRequestMaxTimes:m,retryNetworkErrorMaxTimes:g,onProgress:u,signal:c})).then(C=>new mt(C,{baseCDN:b})),"uploadDirect"),hl=a((r,{publicKey:e,fileName:t,baseURL:i,signal:s,onProgress:o,source:n,integration:l,userAgent:c,retryThrottledRequestMaxTimes:u,retryNetworkErrorMaxTimes:d,baseCDN:p})=>To(r,{publicKey:e,baseURL:i,signal:s,source:n,integration:l,userAgent:c,retryThrottledRequestMaxTimes:u,retryNetworkErrorMaxTimes:d}).then(f=>new mt(f,{baseCDN:p,fileName:t})).then(f=>(o&&o({isComputable:!0,value:1}),f)),"uploadFromUploaded"),dl=a((r,{signal:e}={})=>{let t=null,i=null,s=r.map(()=>new AbortController),o=a(n=>()=>{i=n,s.forEach((l,c)=>c!==n&&l.abort())},"createStopRaceCallback");return _i(e,()=>{s.forEach(n=>n.abort())}),Promise.all(r.map((n,l)=>{let c=o(l);return Promise.resolve().then(()=>n({stopRace:c,signal:s[l].signal})).then(u=>(c(),u)).catch(u=>(t=u,null))})).then(n=>{if(i===null)throw t;return n[i]})},"race"),pl=window.WebSocket,Tr=class Tr{constructor(){h(this,"events",Object.create({}))}emit(e,t){var i;(i=this.events[e])==null||i.forEach(s=>s(t))}on(e,t){this.events[e]=this.events[e]||[],this.events[e].push(t)}off(e,t){t?this.events[e]=this.events[e].filter(i=>i!==t):this.events[e]=[]}};a(Tr,"Events");var mr=Tr,fl=a((r,e)=>r==="success"?{status:W.Success,...e}:r==="progress"?{status:W.Progress,...e}:{status:W.Error,...e},"response"),Sr=class Sr{constructor(e,t=3e4){h(this,"key");h(this,"disconnectTime");h(this,"ws");h(this,"queue",[]);h(this,"isConnected",!1);h(this,"subscribers",0);h(this,"emmitter",new mr);h(this,"disconnectTimeoutId",null);this.key=e,this.disconnectTime=t}connect(){if(this.disconnectTimeoutId&&clearTimeout(this.disconnectTimeoutId),!this.isConnected&&!this.ws){let e=`wss://ws.pusherapp.com/app/${this.key}?protocol=5&client=js&version=1.12.2`;this.ws=new pl(e),this.ws.addEventListener("error",t=>{this.emmitter.emit("error",new Error(t.message))}),this.emmitter.on("connected",()=>{this.isConnected=!0,this.queue.forEach(t=>this.send(t.event,t.data)),this.queue=[]}),this.ws.addEventListener("message",t=>{let i=JSON.parse(t.data.toString());switch(i.event){case"pusher:connection_established":{this.emmitter.emit("connected",void 0);break}case"pusher:ping":{this.send("pusher:pong",{});break}case"progress":case"success":case"fail":this.emmitter.emit(i.channel,fl(i.event,JSON.parse(i.data)))}})}}disconnect(){let e=a(()=>{var t;(t=this.ws)==null||t.close(),this.ws=void 0,this.isConnected=!1},"actualDisconect");this.disconnectTime?this.disconnectTimeoutId=setTimeout(()=>{e()},this.disconnectTime):e()}send(e,t){var s;let i=JSON.stringify({event:e,data:t});(s=this.ws)==null||s.send(i)}subscribe(e,t){this.subscribers+=1,this.connect();let i=`task-status-${e}`,s={event:"pusher:subscribe",data:{channel:i}};this.emmitter.on(i,t),this.isConnected?this.send(s.event,s.data):this.queue.push(s)}unsubscribe(e){this.subscribers-=1;let t=`task-status-${e}`,i={event:"pusher:unsubscribe",data:{channel:t}};this.emmitter.off(t),this.isConnected?this.send(i.event,i.data):this.queue=this.queue.filter(s=>s.data.channel!==t),this.subscribers===0&&this.disconnect()}onError(e){return this.emmitter.on("error",e),()=>this.emmitter.off("error",e)}};a(Sr,"Pusher");var gr=Sr,dr=null,wr=a(r=>{if(!dr){let e=typeof window=="undefined"?0:3e4;dr=new gr(r,e)}return dr},"getPusher"),ml=a(r=>{wr(r).connect()},"preconnect");function gl({token:r,publicKey:e,baseURL:t,integration:i,userAgent:s,retryThrottledRequestMaxTimes:o,retryNetworkErrorMaxTimes:n,onProgress:l,signal:c}){return vo({check:u=>sl(r,{publicKey:e,baseURL:t,integration:i,userAgent:s,retryThrottledRequestMaxTimes:o,retryNetworkErrorMaxTimes:n,signal:u}).then(d=>{switch(d.status){case W.Error:return new V(d.error,d.errorCode);case W.Waiting:return!1;case W.Unknown:return new V(`Token "${r}" was not found.`);case W.Progress:return l&&(d.total==="unknown"?l({isComputable:!1}):l({isComputable:!0,value:d.done/d.total})),!1;case W.Success:return l&&l({isComputable:!0,value:d.done/d.total}),d;default:throw new Error("Unknown status")}}),signal:c})}a(gl,"pollStrategy");var bl=a(({token:r,pusherKey:e,signal:t,onProgress:i})=>new Promise((s,o)=>{let n=wr(e),l=n.onError(o),c=a(()=>{l(),n.unsubscribe(r)},"destroy");_i(t,()=>{c(),o(new Ct("pusher cancelled"))}),n.subscribe(r,u=>{switch(u.status){case W.Progress:{i&&(u.total==="unknown"?i({isComputable:!1}):i({isComputable:!0,value:u.done/u.total}));break}case W.Success:{c(),i&&i({isComputable:!0,value:u.done/u.total}),s(u);break}case W.Error:c(),o(new V(u.msg,u.error_code))}})}),"pushStrategy"),_l=a((r,{publicKey:e,fileName:t,baseURL:i,baseCDN:s,checkForUrlDuplicates:o,saveUrlForRecurrentUploads:n,secureSignature:l,secureExpire:c,store:u,signal:d,onProgress:p,source:f,integration:m,userAgent:g,retryThrottledRequestMaxTimes:b,pusherKey:w=S.pusherKey,metadata:C})=>Promise.resolve(ml(w)).then(()=>il(r,{publicKey:e,fileName:t,baseURL:i,checkForUrlDuplicates:o,saveUrlForRecurrentUploads:n,secureSignature:l,secureExpire:c,store:u,signal:d,source:f,integration:m,userAgent:g,retryThrottledRequestMaxTimes:b,metadata:C})).catch(v=>{let x=wr(w);return x==null||x.disconnect(),Promise.reject(v)}).then(v=>v.type===fr.FileInfo?v:dl([({signal:x})=>gl({token:v.token,publicKey:e,baseURL:i,integration:m,userAgent:g,retryThrottledRequestMaxTimes:b,onProgress:p,signal:x}),({signal:x})=>bl({token:v.token,pusherKey:w,signal:x,onProgress:p})],{signal:d})).then(v=>{if(v instanceof V)throw v;return v}).then(v=>vr(v.uuid,{publicKey:e,baseURL:i,integration:m,userAgent:g,retryThrottledRequestMaxTimes:b,onProgress:p,signal:d})).then(v=>new mt(v,{baseCDN:s})),"uploadFromUrl"),pr=new WeakMap,yl=a(async r=>{if(pr.has(r))return pr.get(r);let e=await fetch(r.uri).then(t=>t.blob());return pr.set(r,e),e},"getBlobFromReactNativeAsset"),So=a(async r=>{if(wi(r)||vi(r))return r.size;if(Ci(r))return(await yl(r)).size;throw new Error("Unknown file type. Cannot determine file size.")},"getFileSize"),vl=a((r,e=S.multipartMinFileSize)=>r>=e,"isMultipart"),$o=a(r=>{let e="[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}",t=new RegExp(e);return!jt(r)&&t.test(r)},"isUuid"),Cr=a(r=>{let e="^(?:\\w+:)?\\/\\/([^\\s\\.]+\\.\\S{2}|localhost[\\:?\\d]*)\\S*$",t=new RegExp(e);return!jt(r)&&t.test(r)},"isUrl"),wl=a((r,e)=>new Promise((t,i)=>{let s=[],o=!1,n=e.length,l=[...e],c=a(()=>{let u=e.length-l.length,d=l.shift();d&&d().then(p=>{o||(s[u]=p,n-=1,n?c():t(s))}).catch(p=>{o=!0,i(p)})},"run");for(let u=0;u<r;u++)c()}),"runWithConcurrency"),Cl=a((r,e,t,i)=>{let s=i*e,o=Math.min(s+i,t);return r.slice(s,o)},"sliceChunk"),xl=a(async(r,e,t)=>i=>Cl(r,i,e,t),"prepareChunks"),Al=a((r,e,{publicKey:t,contentType:i,onProgress:s,signal:o,integration:n,retryThrottledRequestMaxTimes:l,retryNetworkErrorMaxTimes:c})=>al(r,e,{publicKey:t,contentType:i,onProgress:s,signal:o,integration:n,retryThrottledRequestMaxTimes:l,retryNetworkErrorMaxTimes:c}),"uploadPart"),El=a(async(r,{publicKey:e,fileName:t,fileSize:i,baseURL:s,secureSignature:o,secureExpire:n,store:l,signal:c,onProgress:u,source:d,integration:p,userAgent:f,retryThrottledRequestMaxTimes:m,retryNetworkErrorMaxTimes:g,contentType:b,multipartChunkSize:w=S.multipartChunkSize,maxConcurrentRequests:C=S.maxConcurrentRequests,baseCDN:v,metadata:x})=>{let M=i!=null?i:await So(r),K,et=a((R,j)=>{if(!u)return;K||(K=Array(R).fill(0));let J=a(it=>it.reduce((ht,or)=>ht+or,0),"sum");return it=>{it.isComputable&&(K[j]=it.value,u({isComputable:!0,value:J(K)/R}))}},"createProgressHandler");return b||(b=Ao(r)),nl(M,{publicKey:e,contentType:b,fileName:t||Eo(r),baseURL:s,secureSignature:o,secureExpire:n,store:l,signal:c,source:d,integration:p,userAgent:f,retryThrottledRequestMaxTimes:m,retryNetworkErrorMaxTimes:g,metadata:x}).then(async({uuid:R,parts:j})=>{let J=await xl(r,M,w);return Promise.all([R,wl(C,j.map((it,ht)=>()=>Al(J(ht),it,{publicKey:e,contentType:b,onProgress:et(j.length,ht),signal:c,integration:p,retryThrottledRequestMaxTimes:m,retryNetworkErrorMaxTimes:g})))])}).then(([R])=>ll(R,{publicKey:e,baseURL:s,source:d,integration:p,userAgent:f,retryThrottledRequestMaxTimes:m,retryNetworkErrorMaxTimes:g})).then(R=>R.isReady?R:vr(R.uuid,{publicKey:e,baseURL:s,source:d,integration:p,userAgent:f,retryThrottledRequestMaxTimes:m,retryNetworkErrorMaxTimes:g,onProgress:u,signal:c})).then(R=>new mt(R,{baseCDN:v}))},"uploadMultipart");async function xr(r,{publicKey:e,fileName:t,baseURL:i=S.baseURL,secureSignature:s,secureExpire:o,store:n,signal:l,onProgress:c,source:u,integration:d,userAgent:p,retryThrottledRequestMaxTimes:f,retryNetworkErrorMaxTimes:m,contentType:g,multipartMinFileSize:b,multipartChunkSize:w,maxConcurrentRequests:C,baseCDN:v=S.baseCDN,checkForUrlDuplicates:x,saveUrlForRecurrentUploads:M,pusherKey:K,metadata:et}){if(jt(r)){let R=await So(r);return vl(R,b)?El(r,{publicKey:e,contentType:g,multipartChunkSize:w,fileSize:R,fileName:t,baseURL:i,secureSignature:s,secureExpire:o,store:n,signal:l,onProgress:c,source:u,integration:d,userAgent:p,maxConcurrentRequests:C,retryThrottledRequestMaxTimes:f,retryNetworkErrorMaxTimes:m,baseCDN:v,metadata:et}):ul(r,{publicKey:e,fileName:t,contentType:g,baseURL:i,secureSignature:s,secureExpire:o,store:n,signal:l,onProgress:c,source:u,integration:d,userAgent:p,retryThrottledRequestMaxTimes:f,retryNetworkErrorMaxTimes:m,baseCDN:v,metadata:et})}if(Cr(r))return _l(r,{publicKey:e,fileName:t,baseURL:i,baseCDN:v,checkForUrlDuplicates:x,saveUrlForRecurrentUploads:M,secureSignature:s,secureExpire:o,store:n,signal:l,onProgress:c,source:u,integration:d,userAgent:p,retryThrottledRequestMaxTimes:f,retryNetworkErrorMaxTimes:m,pusherKey:K,metadata:et});if($o(r))return hl(r,{publicKey:e,fileName:t,baseURL:i,signal:l,onProgress:c,source:u,integration:d,userAgent:p,retryThrottledRequestMaxTimes:f,retryNetworkErrorMaxTimes:m,baseCDN:v});throw new TypeError(`File uploading from "${r}" is not supported`)}a(xr,"uploadFile");var $r=class $r{constructor(e,{baseCDN:t=S.baseCDN}={}){h(this,"uuid");h(this,"filesCount");h(this,"totalSize");h(this,"isStored");h(this,"isImage");h(this,"cdnUrl");h(this,"files");h(this,"createdAt");h(this,"storedAt",null);this.uuid=e.id,this.filesCount=e.filesCount;let i=e.files.filter(Boolean);this.totalSize=Object.values(i).reduce((s,o)=>s+o.size,0),this.isStored=!!e.datetimeStored,this.isImage=!!Object.values(i).filter(s=>s.isImage).length,this.cdnUrl=e.cdnUrl,this.files=i.map(s=>new mt(s,{baseCDN:t})),this.createdAt=e.datetimeCreated,this.storedAt=e.datetimeStored}};a($r,"UploadcareGroup");var br=$r,Tl=a(r=>{for(let e of r)if(!jt(e))return!1;return!0},"isFileDataArray"),Sl=a(r=>{for(let e of r)if(!$o(e))return!1;return!0},"isUuidArray"),$l=a(r=>{for(let e of r)if(!Cr(e))return!1;return!0},"isUrlArray");function ko(r,{publicKey:e,fileName:t,baseURL:i=S.baseURL,secureSignature:s,secureExpire:o,store:n,signal:l,onProgress:c,source:u,integration:d,userAgent:p,retryThrottledRequestMaxTimes:f,retryNetworkErrorMaxTimes:m,contentType:g,multipartChunkSize:b=S.multipartChunkSize,baseCDN:w=S.baseCDN,checkForUrlDuplicates:C,saveUrlForRecurrentUploads:v,jsonpCallback:x}){if(!Tl(r)&&!$l(r)&&!Sl(r))throw new TypeError(`Group uploading from "${r}" is not supported`);let M,K=!0,et=r.length,R=a((j,J)=>{if(!c)return;M||(M=Array(j).fill(0));let it=a(ht=>ht.reduce((or,qn)=>or+qn)/j,"normalize");return ht=>{if(!ht.isComputable||!K){K=!1,c({isComputable:!1});return}M[J]=ht.value,c({isComputable:!0,value:it(M)})}},"createProgressHandler");return Promise.all(r.map((j,J)=>jt(j)||Cr(j)?xr(j,{publicKey:e,fileName:t,baseURL:i,secureSignature:s,secureExpire:o,store:n,signal:l,onProgress:R(et,J),source:u,integration:d,userAgent:p,retryThrottledRequestMaxTimes:f,retryNetworkErrorMaxTimes:m,contentType:g,multipartChunkSize:b,baseCDN:w,checkForUrlDuplicates:C,saveUrlForRecurrentUploads:v}).then(it=>it.uuid):j)).then(j=>ol(j,{publicKey:e,baseURL:i,jsonpCallback:x,secureSignature:s,secureExpire:o,signal:l,source:u,integration:d,userAgent:p,retryThrottledRequestMaxTimes:f,retryNetworkErrorMaxTimes:m}).then(J=>new br(J,{baseCDN:w})).then(J=>(c&&c({isComputable:!0,value:1}),J)))}a(ko,"uploadFileGroup");var kr=class kr{constructor(e){h(this,"_concurrency",1);h(this,"_pending",[]);h(this,"_running",0);h(this,"_resolvers",new Map);h(this,"_rejectors",new Map);this._concurrency=e}_run(){let e=this._concurrency-this._running;for(let t=0;t<e;t++){let i=this._pending.shift();if(!i)return;let s=this._resolvers.get(i),o=this._rejectors.get(i);if(!s||!o)throw new Error("Unexpected behavior: resolver or rejector is undefined");this._running+=1,i().finally(()=>{this._resolvers.delete(i),this._rejectors.delete(i),this._running-=1,this._run()}).then(n=>s(n)).catch(n=>o(n))}}add(e){return new Promise((t,i)=>{this._resolvers.set(e,t),this._rejectors.set(e,i),this._pending.push(e),this._run()})}get pending(){return this._pending.length}get running(){return this._running}set concurrency(e){this._concurrency=e,this._run()}get concurrency(){return this._concurrency}};a(kr,"Queue");var fi=kr;var Ir=a(()=>({}),"blockCtx"),Or=a(r=>({...Ir(),"*currentActivity":null,"*currentActivityParams":{},"*history":[],"*historyBack":null,"*closeModal":()=>{r.set$({"*currentActivity":null,"*modalActive":!1})}}),"activityBlockCtx"),Ai=a(r=>({...Or(r),"*commonProgress":0,"*uploadList":[],"*uploadQueue":new fi(1),"*collectionErrors":[],"*collectionState":null,"*groupInfo":null,"*uploadTrigger":new Set,"*secureUploadsManager":null}),"uploaderBlockCtx");var $e={"locale-id":"en","social-source-lang":"en","upload-file":"Upload file","upload-files":"Upload files","choose-file":"Choose file","choose-files":"Choose files","drop-files-here":"Drop files here","select-file-source":"Select file source",selected:"Selected",upload:"Upload","add-more":"Add more",cancel:"Cancel","start-from-cancel":"Cancel",clear:"Clear","camera-shot":"Shot","upload-url":"Import","upload-url-placeholder":"Paste link here","edit-image":"Edit image","edit-detail":"Details",back:"Back",done:"Done",ok:"Ok","remove-from-list":"Remove",no:"No",yes:"Yes","confirm-your-action":"Confirm your action","are-you-sure":"Are you sure?","selected-count":"Selected:","upload-error":"Upload error","validation-error":"Validation error","no-files":"No files selected",browse:"Browse","not-uploaded-yet":"Not uploaded yet...",file__one:"file",file__other:"files",error__one:"error",error__other:"errors","header-uploading":"Uploading {{count}} {{plural:file(count)}}","header-failed":"{{count}} {{plural:error(count)}}","header-succeed":"{{count}} {{plural:file(count)}} uploaded","header-total":"{{count}} {{plural:file(count)}} selected","src-type-local":"From device","src-type-from-url":"From link","src-type-camera":"Camera","src-type-draw":"Draw","src-type-facebook":"Facebook","src-type-dropbox":"Dropbox","src-type-gdrive":"Google Drive","src-type-gphotos":"Google Photos","src-type-instagram":"Instagram","src-type-flickr":"Flickr","src-type-vk":"VK","src-type-evernote":"Evernote","src-type-box":"Box","src-type-onedrive":"Onedrive","src-type-huddle":"Huddle","src-type-other":"Other","caption-from-url":"Import from link","caption-camera":"Camera","caption-draw":"Draw","caption-edit-file":"Edit file","file-no-name":"No name...","toggle-fullscreen":"Toggle fullscreen","toggle-guides":"Toggle guides",rotate:"Rotate","flip-vertical":"Flip vertical","flip-horizontal":"Flip horizontal",apply:"Apply",brightness:"Brightness",contrast:"Contrast",saturation:"Saturation",exposure:"Exposure",gamma:"Gamma",vibrance:"Vibrance",warmth:"Warmth",enhance:"Enhance",original:"Original",resize:"Resize image",crop:"Crop","select-color":"Select color",text:"Text",draw:"Draw","cancel-edit":"Cancel edit","tab-view":"Preview","tab-details":"Details","file-name":"Name","file-size":"Size","cdn-url":"CDN URL","file-size-unknown":"Unknown","camera-permissions-denied":"Camera access denied","camera-permissions-prompt":"Please allow access to the camera","camera-permissions-request":"Request access","files-count-limit-error-title":"Files count limit overflow","files-count-limit-error-too-few":"You\u2019ve chosen {{total}} {{plural:file(total)}}. At least {{min}} {{plural:file(min)}} required.","files-count-limit-error-too-many":"You\u2019ve chosen too many files. {{max}} {{plural:file(max)}} is maximum.","files-max-size-limit-error":"File is too big. Max file size is {{maxFileSize}}.","has-validation-errors":"File validation error ocurred. Please, check your files before upload.","images-only-accepted":"Only image files are accepted.","file-type-not-allowed":"Uploading of these file types is not allowed.","some-files-were-not-uploaded":"Some files were not uploaded.","file-item-edit-button":"Edit","file-item-remove-button":"Remove","a11y-editor-tab-filters":"Filters","a11y-editor-tab-tuning":"Tuning","a11y-editor-tab-crop":"Crop","a11y-activity-header-button-close":"Close",flip:"Flip",mirror:"Mirror","a11y-cloud-editor-apply-filter":"Apply {{name}} filter","a11y-cloud-editor-apply-crop":"Apply {{name}} operation","a11y-cloud-editor-apply-tuning":"Apply {{name}} tuning",finished:"Finished",failed:"Failed",uploading:"Uploading",idle:"Idle","a11y-file-item-status":"File {{fileName}} in status {{status}}"};var Ei=new Map,Lr=new Map,Io=a((r,e)=>{Ei.has(r)&&console.log(`Locale ${r} is already defined. Overwriting...`),Ei.set(r,{...$e,...e})},"defineLocaleSync"),kl=a((r,e)=>{Lr.set(r,e)},"defineLocaleAsync"),Ur=a((r,e)=>{typeof e=="function"?kl(r,e):Io(r,e)},"defineLocale"),Oo=a(async r=>{if(!Ei.has(r)){if(!Lr.has(r))throw new Error(`Locale ${r} is not defined`);let t=await Lr.get(r)();Io(r,t)}return Ei.get(r)},"resolveLocaleDefinition");Ur("en",$e);var bt=a(r=>`*l10n/${r}`,"localeStateKey"),Il="en",Pr=class Pr{constructor(e){h(this,"_blockInstance",null);h(this,"_localeName","");h(this,"_callbacks",new Set);h(this,"_boundBlocks",new Map);this._blockInstance=e;for(let[t,i]of Object.entries($e))this._blockInstance.add(bt(t),i,!1);setTimeout(()=>{e.subConfigValue("localeName",async t=>{var o;if(!this._blockInstance||!t)return;this._localeName=t;let i=await Oo(t);if(t!==Il&&this._localeName!==t)return;let s=(o=this._blockInstance.cfg.localeDefinitionOverride)==null?void 0:o[t];for(let[n,l]of Object.entries(i)){let c=s==null?void 0:s[n];this._blockInstance.add(bt(n),c!=null?c:l,!0);for(let u of this._callbacks)u()}}),e.subConfigValue("localeDefinitionOverride",t=>{var s;if(!t)return;let i=t[this._localeName];if(i)for(let[o,n]of Object.entries(i)){(s=this._blockInstance)==null||s.add(bt(o),n,!0);for(let l of this._callbacks)l()}})})}onLocaleChange(e){let t=U(e,0);return this._callbacks.add(t),()=>{this._callbacks.delete(t)}}bindL10n(e,t,i){var o,n,l;e.$[t]=i(),this._boundBlocks.has(e)||this._boundBlocks.set(e,new Map),(n=(o=this._boundBlocks.get(e))==null?void 0:o.get(t))==null||n();let s=this.onLocaleChange(()=>{e.$[t]=i()});(l=this._boundBlocks.get(e))==null||l.set(t,s)}destroyL10nBindings(e){let t=this._boundBlocks.get(e);if(t){for(let i of t.values())i();this._boundBlocks.delete(e)}}destroy(){this._callbacks.clear()}};a(Pr,"LocaleManager");var Ti=Pr;function Lo(r,e){[...r.querySelectorAll("[l10n]")].forEach(t=>{let i=t.getAttribute("l10n");if(!i)return;let s="textContent",o=!1;if(i.includes(":")){let c=i.split(":");s=c[0],i=c[1],s.startsWith("@")&&(s=s.slice(1),o=!0)}let n=i;e.has(n)&&e.sub(n,c=>{if(!c)return;e.l10nProcessorSubs.has(n)||e.l10nProcessorSubs.set(n,new Set);let u=e.l10nProcessorSubs.get(n);u==null||u.forEach(f=>{f.remove(),u.delete(f),e.allSubs.delete(f)});let d=bt(c).replace("*","");e.nodeCtx.has(d)||e.nodeCtx.add(d,c);let p=e.nodeCtx.sub(d,()=>{t[s]=e.l10n(c)});u==null||u.add(p),e.allSubs.add(p),t.removeAttribute("l10n")});let l=bt(i);e.has(l)||e.add(l,""),e.sub(l,()=>{i=i,o?t.setAttribute(s,e.l10n(i)):t[s]=e.l10n(i)}),t.removeAttribute("l10n")})}a(Lo,"l10nProcessor");var X=a(r=>`*cfg/${r}`,"sharedConfigKey");var Ol={button:["toolbar"],checkbox:["toolbar"],menuitem:["menu","menubar"],option:["listbox"],tab:["tablist"]};function ke(r,e){e.tabIndex=0,e.focus(),r.tabIndex=-1}a(ke,"focus");function Mr(r){let e=r.role||r.type||r.tagName;if(!e)return null;let t=Ol[e.toLowerCase()];if(!t)return null;for(let i of t){let s=r.closest(`[role=${i}]`);if(s)return s}}a(Mr,"findGroupNodeByEventTarget");function Rr(r,e){return e.role==="toolbar"?Ll(e):e.querySelectorAll(`[role=${r.role}]`)}a(Rr,"getItems");function Ll(r){return[...r.querySelectorAll("*")].filter(t=>t.role==="button"||t.type==="button"||t.role==="checkbox"||t.type==="checkbox")}a(Ll,"getToolbarItems");function Ul(r){let e=r.getAttribute("aria-orientation");if(e==="vertical")return!1;if(e==="horizontal")return!0;let t=r.role;return t==="menubar"||t==="tablist"||t==="toolbar"}a(Ul,"isHorizontalOrientation");function Uo(r){return e=>{let t=!1,i=(r==null?void 0:r.searchDelayMs)||300,s=0,o="";function n(p){let f=Mr(p.target);if(!f){l();return}let m=Rr(p.target,f),g=Array.from(m).indexOf(p.target),b="ArrowDown",w="ArrowUp";if(Ul(f)&&(e.document.dir==="rtl"?(b="ArrowLeft",w="ArrowRight"):(b="ArrowRight",w="ArrowLeft")),p.key===b)p.preventDefault(),ke(p.target,m[g+1]||m[0]);else if(p.key===w)p.preventDefault(),ke(p.target,m[g-1]||m[m.length-1]);else if(p.key==="Home")p.preventDefault(),ke(p.target,m[0]);else if(p.key==="End")p.preventDefault(),ke(p.target,m[m.length-1]);else if(p.key.length===1&&f.role!=="tablist"){let C=Date.now();C-s<=i?o+=p.key.toLowerCase():o=p.key.toLowerCase(),s=C;let v=Array.from(m).find(x=>{var M,K,et;return(et=(K=(M=x.textContent)==null?void 0:M.trim())==null?void 0:K.toLowerCase())==null?void 0:et.startsWith(o)});v&&(p.preventDefault(),ke(p.target,v))}}a(n,"keyDown");function l(){t=!1,e.removeEventListener("keydown",n)}a(l,"stop");function c(p){let f=Mr(p.target);if(f){t||(t=!0,e.addEventListener("keydown",n));let m=Rr(p.target,f);for(let g of m)g!==p.target&&g.setAttribute("tabindex",-1)}else t&&l()}a(c,"focusIn");function u(p){(!p.relatedTarget||p.relatedTarget===e.document)&&l()}a(u,"focusOut");function d(p){let f=Mr(p.target);if(f){let m=Rr(p.target,f);for(let g of m)g!==p.target&&g.setAttribute("tabindex",-1);p.target.setAttribute("tabindex",0)}}return a(d,"click"),e.addEventListener("click",d),e.addEventListener("focusin",c),e.addEventListener("focusout",u),()=>{l(),e.removeEventListener("click",d),e.removeEventListener("focusin",c),e.removeEventListener("focusout",u)}}}a(Uo,"focusGroupKeyUX");function Po(){return r=>{let e,t;function i(o){if(o.target.getAttribute("aria-hidden")==="true"){e=o.target,e.setAttribute("aria-hidden","false"),t=e.hidden,t&&(e.hidden=!1);let n=o.target.querySelector('a, button, select, textarea, input:not([type=radio]), [type=radio]:checked, [tabindex]:not([tabindex="-1"])');n&&(n.tabIndex=0)}}a(i,"jump");function s(o){e&&e.contains(o.target)&&(!o.relatedTarget||!e.contains(o.relatedTarget))&&(o.target.tabIndex=-1,e.setAttribute("aria-hidden","true"),t&&(e.hidden=!0),e=null)}return a(s,"focusOut"),r.addEventListener("keyuxJump",i),r.addEventListener("focusout",s),()=>{r.removeEventListener("keyuxJump",i),r.removeEventListener("focusout",s)}}}a(Po,"hiddenKeyUX");function Mo(){return r=>{let e=[];function t(u){let d=r.document.activeElement;d&&d!==r.document.body&&e.push(new WeakRef(d)),u.focus({focusVisible:!0})}a(t,"focus");function i(){let u=e.pop();if(!u){r.document.activeElement.blur();return}let d=u.deref();d&&d.isConnected?d.focus():i()}a(i,"back");let s=0,o;function n(u){clearInterval(o);let d=u.getAttribute("aria-controls");d&&(o=setInterval(()=>{if(s++>50){clearInterval(o);return}let p=r.document.getElementById(d);if(p){let f=p.querySelector('a, button, select, textarea, input:not([type=radio]), [type=radio]:checked, [tabindex]:not([tabindex="-1"])');f&&(clearInterval(o),p.dispatchEvent(new r.CustomEvent("keyuxJump",{bubbles:!0})),t(f))}},50))}a(n,"jump");function l(u){u.clientX===0&&u.clientY===0&&n(u.target)}a(l,"click");function c(u){u.target.tagName==="INPUT"&&u.key==="Enter"&&n(u.target),u.key==="Escape"&&i()}return a(c,"keyDown"),r.addEventListener("click",l),r.addEventListener("keydown",c),()=>{r.removeEventListener("click",l),r.removeEventListener("keydown",c)}}}a(Mo,"jumpKeyUX");function Ro(r){let e,t=r.split(" ");function i(){e&&e.classList.remove(...t)}a(i,"keyUp");function s(o){o.clientX===0&&o.clientY===0&&(i(),o.target.classList.add(...t),e=o.target)}return a(s,"click"),o=>(o.addEventListener("keyup",i),o.addEventListener("click",s),()=>{o.removeEventListener("keyup",i),o.removeEventListener("click",s)})}a(Ro,"pressKeyUX");function Do(r,e){let t=e.map(i=>i(r));return()=>{t.forEach(i=>i())}}a(Do,"startKeyUX");var Fr=class Fr{constructor(){h(this,"_listeners",new Map);h(this,"_scope",[])}addEventListener(e,t){let i=a(s=>{let o=s.target;o&&this._scope.some(n=>n===s.target||n.contains(o))&&t(s)},"wrappedListener");this._listeners.set(t,i),window.addEventListener(e,i)}removeEventListener(e,t){let i=this._listeners.get(t);i&&window.removeEventListener(e,i),this._listeners.delete(t)}get CustomEvent(){return window.CustomEvent}get document(){return window.document}get navigator(){return window.navigator}registerScope(e){this._scope.push(e)}destroy(){this._scope=[],this._listeners.forEach((e,t)=>{window.removeEventListener("keydown",e),window.removeEventListener("keyup",e),this._listeners.delete(t)})}};a(Fr,"ScopedMinimalWindow");var Dr=Fr,Nr=class Nr{constructor(){h(this,"_destroyKeyUX");h(this,"_scopedWindow");this._scopedWindow=new Dr,this._destroyKeyUX=Do(this._scopedWindow,[Uo(),Ro("is-pressed"),Mo(),Po()])}registerBlock(e){this._scopedWindow.registerScope(e)}destroy(){var e;(e=this._destroyKeyUX)==null||e.call(this),this._scopedWindow.destroy()}};a(Nr,"A11y");var Si=Nr;var Pl="uc-",Ie=class Ie extends kt{constructor(){super();h(this,"requireCtxName",!1);h(this,"activityType",null);h(this,"init$",Ir());this.l10nProcessorSubs=new Map,this.addTemplateProcessor(Lo)}l10n(t,i={}){if(!t)return"";let s=this.$[bt(t)]||t,o=mo(s);for(let l of o)i[l.variable]=this.pluralize(l.pluralKey,Number(i[l.countVariable]));return Te(s,i)}pluralize(t,i){let s=this.l10n("locale-id")||"en",o=pi(s,i);return this.l10n(`${t}__${o}`)}bindL10n(t,i){var s;(s=this.localeManager)==null||s.bindL10n(this,t,i)}emit(t,i,s){let o=this.has("*eventEmitter")&&this.$["*eventEmitter"];o&&o.emit(t,i,s)}hasBlockInCtx(t){for(let i of this.blocksRegistry)if(t(i))return!0;return!1}setOrAddState(t,i){this.add$({[t]:i},!0)}connectedCallback(){this.constructor.styleAttrs.forEach(i=>{this.setAttribute(i,"")}),this.hasAttribute("retpl")&&(this.constructor.template=null,this.processInnerHtml=!0),this.requireCtxName?go({element:this,attribute:"ctx-name",onSuccess:()=>{super.connectedCallback()},onTimeout:()=>{console.error("Attribute `ctx-name` is required and it is not set.")}}):super.connectedCallback(),Ee.registerClient(this)}disconnectedCallback(){super.disconnectedCallback(),Ee.unregisterClient(this)}initCallback(){this.has("*blocksRegistry")||this.add("*blocksRegistry",new Set),this.$["*blocksRegistry"].add(this),this.has("*eventEmitter")||this.add("*eventEmitter",new di(this.debugPrint.bind(this))),this.has("*localeManager")||this.add("*localeManager",new Ti(this)),this.has("*a11y")||this.add("*a11y",new Si),this.sub(bt("locale-id"),i=>{let s=ho(i);this.style.direction=s==="ltr"?"":s})}get localeManager(){return this.has("*localeManager")?this.$["*localeManager"]:null}get a11y(){return this.has("*a11y")?this.$["*a11y"]:null}get blocksRegistry(){return this.$["*blocksRegistry"]}destroyCallback(){var i;super.destroyCallback();let t=this.blocksRegistry;t==null||t.delete(this),(i=this.localeManager)==null||i.destroyL10nBindings(this),this.l10nProcessorSubs=new Map,T.deleteCtx(this),(t==null?void 0:t.size)===0&&setTimeout(()=>{this.destroyCtxCallback()},0)}destroyCtxCallback(){var t;T.deleteCtx(this.ctxName),(t=this.localeManager)==null||t.destroy()}async proxyUrl(t){if(this.cfg.secureDeliveryProxy&&this.cfg.secureDeliveryProxyUrlResolver&&console.warn("Both secureDeliveryProxy and secureDeliveryProxyUrlResolver are set. The secureDeliveryProxyUrlResolver will be used."),this.cfg.secureDeliveryProxyUrlResolver)try{return await this.cfg.secureDeliveryProxyUrlResolver(t,{uuid:ui(t),cdnUrlModifiers:cr(t),fileName:ci(t)})}catch(i){return console.error("Failed to resolve secure delivery proxy URL. Falling back to the default URL.",i),t}return this.cfg.secureDeliveryProxy?Te(this.cfg.secureDeliveryProxy,{previewUrl:t},{transform:i=>window.encodeURIComponent(i)}):t}get cfg(){if(!this.__cfgProxy){let t=Object.create(null);this.__cfgProxy=new Proxy(t,{set:(i,s,o)=>{if(typeof s!="string")return!1;let n=X(s);return this.has(n)||this.add(n,Q[s]),this.$[n]=o,!0},get:(i,s)=>{let o=X(s);return this.has(o)||this.add(o,Q[s]),this.$[X(s)]}})}return this.__cfgProxy}subConfigValue(t,i){let s=X(t);this.has(s)||this.add(s,Q[t]),this.sub(s,i)}debugPrint(...t){if(!this.cfg.debug)return;let i=t;if(typeof(t==null?void 0:t[0])=="function"){let s=t[0];i=s()}console.log(`[${this.ctxName}]`,...i)}static reg(t){if(!t){super.reg();return}t.startsWith(Pl)&&super.reg(t)}};a(Ie,"Block"),h(Ie,"StateConsumerScope",null),h(Ie,"styleAttrs",[]);var y=Ie;var Fo="<svg width='0' height='0' style='position:absolute'><symbol viewBox='0 0 24 24' id='uc-icon-about' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11.152 14.12v.1h1.523v-.1c.007-.409.053-.752.138-1.028.086-.277.22-.517.405-.72.188-.202.434-.397.735-.586.32-.191.593-.412.82-.66.232-.249.41-.531.533-.847.125-.32.187-.678.187-1.076 0-.579-.137-1.085-.41-1.518a2.717 2.717 0 0 0-1.14-1.018c-.49-.245-1.062-.367-1.715-.367-.597 0-1.142.114-1.636.34-.49.228-.884.564-1.182 1.008-.299.44-.46.98-.485 1.619h1.62c.024-.377.118-.684.282-.922a1.48 1.48 0 0 1 .617-.532c.25-.114.51-.17.784-.17.301 0 .575.063.82.191.248.124.447.302.597.533.149.23.223.504.223.82 0 .263-.05.502-.149.72a1.91 1.91 0 0 1-.405.574 3.48 3.48 0 0 1-.575.453 4.22 4.22 0 0 0-.847.66c-.234.242-.415.558-.543.949-.125.39-.19.916-.197 1.577Zm.053 3.03c.21.206.46.31.75.31.196 0 .374-.049.534-.144a1.1 1.1 0 0 0 .383-.384c.1-.163.15-.343.15-.538a1 1 0 0 0-.32-.746 1.019 1.019 0 0 0-.746-.314c-.291 0-.542.105-.751.314-.21.206-.314.455-.314.746 0 .295.104.547.314.756ZM24 12c0 6.627-5.373 12-12 12S0 18.627 0 12 5.373 0 12 0s12 5.373 12 12Zm-1.5 0c0 5.799-4.701 10.5-10.5 10.5S1.5 17.799 1.5 12 6.201 1.5 12 1.5 22.5 6.201 22.5 12Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-add' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M12.75 21a.75.75 0 0 1-1.5 0v-8.25H3a.75.75 0 0 1 0-1.5h8.25V3a.75.75 0 0 1 1.5 0v8.25H21a.75.75 0 0 1 0 1.5h-8.25V21Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-arrow-down' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11.5 23.03a.75.75 0 0 0 .999 0l9.29-8.276a.75.75 0 0 0-.998-1.12l-8.042 7.164V1.53a.75.75 0 0 0-1.5 0v19.267l-8.04-7.163a.75.75 0 0 0-.998 1.12z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-back' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M20.251 12a.75.75 0 0 1-.75.75H6.067l5.72 5.85a.75.75 0 1 1-1.072 1.05L4.136 12.92a1.292 1.292 0 0 1 0-1.842l6.579-6.728a.75.75 0 1 1 1.072 1.048l-5.72 5.851H19.5a.75.75 0 0 1 .75.75Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-badge-error' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M13.6 18.4a1.6 1.6 0 1 1-3.2 0 1.6 1.6 0 0 1 3.2 0zM12 4.5A1.5 1.5 0 0 1 13.5 6v7a1.5 1.5 0 0 1-3 0V6A1.5 1.5 0 0 1 12 4.5z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-badge-success' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='m10.5 18.204 7.6-8.183a1.5 1.5 0 0 0-2.2-2.042l-5.4 5.817-2.4-2.586a1.5 1.5 0 1 0-2.2 2.041l4.6 4.953Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-box' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M1.01 4.148a.75.75 0 0 1 .75.75v4.348a4.437 4.437 0 0 1 2.988-1.153c1.734 0 3.23.992 3.978 2.438a4.478 4.478 0 0 1 3.978-2.438c2.49 0 4.488 2.044 4.488 4.543 0 2.5-1.999 4.544-4.488 4.544a4.478 4.478 0 0 1-3.978-2.438 4.478 4.478 0 0 1-3.978 2.438C2.26 17.18.26 15.135.26 12.636V4.898a.75.75 0 0 1 .75-.75Zm.75 8.488c0 1.692 1.348 3.044 2.988 3.044s2.989-1.352 2.989-3.044c0-1.691-1.349-3.043-2.989-3.043S1.76 10.945 1.76 12.636Zm10.944-3.043c-1.64 0-2.988 1.352-2.988 3.043 0 1.692 1.348 3.044 2.988 3.044s2.988-1.352 2.988-3.044c0-1.69-1.348-3.043-2.988-3.043Zm4.328-1.23a.75.75 0 0 1 1.052.128l2.333 2.983 2.333-2.983a.75.75 0 0 1 1.181.924l-2.562 3.277 2.562 3.276a.75.75 0 1 1-1.181.924l-2.333-2.983-2.333 2.983a.75.75 0 1 1-1.181-.924l2.562-3.276-2.562-3.277a.75.75 0 0 1 .129-1.052Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-camera' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M7.65 2.55a.75.75 0 0 1 .6-.3h7.5a.75.75 0 0 1 .6.3l2.025 2.7H21a3 3 0 0 1 3 3v10.5a3 3 0 0 1-3 3H3a3 3 0 0 1-3-3V8.25a3 3 0 0 1 3-3h2.625zm.975 1.2L6.6 6.45a.75.75 0 0 1-.6.3H3a1.5 1.5 0 0 0-1.5 1.5v10.5a1.5 1.5 0 0 0 1.5 1.5h18a1.5 1.5 0 0 0 1.5-1.5V8.25a1.5 1.5 0 0 0-1.5-1.5h-3a.75.75 0 0 1-.6-.3l-2.025-2.7zm3.375 6a3.375 3.375 0 1 0 0 6.75 3.375 3.375 0 0 0 0-6.75zm-4.875 3.375a4.875 4.875 0 1 1 9.75 0 4.875 4.875 0 0 1-9.75 0z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-close' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M4.604 4.604a.75.75 0 0 1 1.06 0L12 10.939l6.335-6.335a.75.75 0 1 1 1.061 1.06L13.061 12l6.335 6.335a.75.75 0 1 1-1.06 1.061L12 13.061l-6.335 6.335a.75.75 0 0 1-1.061-1.06L10.939 12 4.604 5.665a.75.75 0 0 1 0-1.061z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-collapse' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M3.116 12a.75.75 0 0 1 .75-.75h16.268a.75.75 0 0 1 0 1.5H3.866a.75.75 0 0 1-.75-.75Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-default' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11.501.392a.75.75 0 0 1 .998 0l6.704 5.972a.75.75 0 0 1-.998 1.12l-5.455-4.86v13.439a.75.75 0 0 1-1.5 0V2.625l-5.454 4.86a.75.75 0 1 1-.998-1.12zM.857 16.73a.75.75 0 0 1 .75.75v4.914h20.786v-4.914a.75.75 0 0 1 1.5 0v5.664a.75.75 0 0 1-.75.75H.857a.75.75 0 0 1-.75-.75v-5.664a.75.75 0 0 1 .75-.75z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-dropbox' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M6.019 1.92a.75.75 0 0 1 .806 0L12 5.219l5.176-3.297a.75.75 0 0 1 .806 0l5.577 3.553a.75.75 0 0 1 0 1.265l-4.574 2.914 4.574 2.914a.75.75 0 0 1 0 1.265l-5.577 3.554a.75.75 0 0 1-.806 0L12 14.089l-5.175 3.297a.75.75 0 0 1-.806 0L.44 13.833a.75.75 0 0 1 0-1.266l4.575-2.914L.44 6.74a.75.75 0 0 1 0-1.265zm.403 8.616L2.24 13.2l4.182 2.664 4.181-2.664zm6.975 2.664 4.182 2.664L21.76 13.2l-4.181-2.664zm2.776-3.547L12 12.311 7.828 9.653 12 6.995zm1.406-.882 4.181-2.664-4.181-2.664-4.182 2.664zm-6.976-2.664L6.422 3.443 2.24 6.107 6.422 8.77zM5.791 18.544a.75.75 0 0 1 1.035-.23l5.175 3.297 5.175-3.297a.75.75 0 1 1 .806 1.265l-5.578 3.554a.75.75 0 0 1-.806 0L6.02 19.579a.75.75 0 0 1-.23-1.035z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-edit-file' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M18.558 2.804a.78.78 0 0 0-.557.235l-.008.007-2.472 2.46 3.847 3.848 2.46-2.473.004-.003a.78.78 0 0 0 0-1.108l-.004-.003-2.712-2.728a.78.78 0 0 0-.558-.235Zm-.248 7.613-3.852-3.852-8.93 8.887-1.516 5.41 5.41-1.515 8.888-8.93Zm-.636-8.934a2.28 2.28 0 0 1 2.512.505l2.702 2.717.002.002a2.278 2.278 0 0 1 0 3.234l-.002.002-12.541 12.602a.75.75 0 0 1-.33.193l-6.884 1.928a.75.75 0 0 1-.925-.924l1.928-6.885a.75.75 0 0 1 .193-.33l12.603-12.54a2.28 2.28 0 0 1 .742-.504Z' clip-rule='evenodd'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-error' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M13 13h-2V7h2m0 10h-2v-2h2M12 2A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-evernote' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M9.804 2.27v-.048c.055-.263.313-.562.85-.562h.44c.142 0 .325.014.526.033.066.009.124.023.267.06l.13.032h.002c.319.079.515.275.644.482a1.461 1.461 0 0 1 .16.356l.004.012a.75.75 0 0 0 .603.577l1.191.207a1988.512 1988.512 0 0 0 2.332.402c.512.083 1.1.178 1.665.442.64.3 1.19.795 1.376 1.77.548 2.931.657 5.829.621 8a39.233 39.233 0 0 1-.125 2.602 17.518 17.518 0 0 1-.092.849.735.735 0 0 0-.024.112c-.378 2.705-1.269 3.796-2.04 4.27-.746.457-1.53.451-2.217.447h-.192c-.46 0-1.073-.23-1.581-.635-.518-.412-.763-.87-.763-1.217 0-.45.188-.688.355-.786.161-.095.436-.137.796.087a.75.75 0 1 0 .792-1.274c-.766-.476-1.64-.52-2.345-.108-.7.409-1.098 1.188-1.098 2.08 0 .996.634 1.84 1.329 2.392.704.56 1.638.96 2.515.96l.185.002c.667.009 1.874.025 3.007-.67 1.283-.786 2.314-2.358 2.733-5.276a4.213 4.213 0 0 0 .056-.335c.023-.184.051-.445.079-.772.055-.655.111-1.585.13-2.704.037-2.234-.074-5.239-.647-8.301v-.002c-.294-1.544-1.233-2.391-2.215-2.85-.777-.363-1.623-.496-2.129-.576a8.872 8.872 0 0 1-.25-.041l-.006-.001-1.99-.345-.761-.132a2.93 2.93 0 0 0-.182-.338A2.532 2.532 0 0 0 12.379.329l-.091-.023a3.967 3.967 0 0 0-.493-.103L11.769.2a7.846 7.846 0 0 0-.675-.04h-.44c-.733 0-1.368.284-1.795.742L2.416 7.431c-.468.428-.751 1.071-.751 1.81 0 .02 0 .041.003.062l.003.034c.017.21.038.468.096.796.107.715.275 1.47.391 1.994.029.13.055.245.075.342l.002.008c.258 1.141.641 1.94.978 2.466.168.263.323.456.444.589a2.808 2.808 0 0 0 .192.194c1.536 1.562 3.713 2.196 5.731 2.08.13-.005.35-.032.537-.073a2.627 2.627 0 0 0 .652-.24c.425-.26.75-.661.992-1.046.184-.294.342-.61.473-.915a3.8 3.8 0 0 0 .627.493 5.022 5.022 0 0 0 1.97.709l.023.002.018.003.11.016c.088.014.205.035.325.058l.056.014c.088.022.164.04.235.061a1.736 1.736 0 0 1 .145.048l.03.014c.765.34 1.302 1.09 1.302 1.871a.75.75 0 0 0 1.5 0c0-1.456-.964-2.69-2.18-3.235a3.595 3.595 0 0 0-.679-.217l-.063-.015a10.616 10.616 0 0 0-.606-.105l-.02-.003-.03-.003h-.002a3.542 3.542 0 0 1-1.331-.485c-.471-.298-.788-.692-.828-1.234a.75.75 0 0 0-1.48-.106l-.001.003-.004.017a8.23 8.23 0 0 1-.092.352 9.963 9.963 0 0 1-.298.892c-.132.34-.29.68-.47.966-.174.276-.339.454-.478.549a1.178 1.178 0 0 1-.221.072 1.949 1.949 0 0 1-.241.036h-.013l-.032.002c-1.684.1-3.423-.437-4.604-1.65a.746.746 0 0 0-.053-.05L4.84 14.6a1.348 1.348 0 0 1-.07-.073 2.99 2.99 0 0 1-.293-.392c-.242-.379-.558-1.014-.778-1.985a54.1 54.1 0 0 0-.083-.376 27.494 27.494 0 0 1-.367-1.872l-.003-.02a6.791 6.791 0 0 1-.08-.67c.004-.277.086-.475.2-.609l.067-.067a.63.63 0 0 1 .292-.145h.05c.18 0 1.095.055 2.013.115l1.207.08.534.037a.747.747 0 0 0 .052.002c.782 0 1.349-.206 1.759-.585l.005-.005c.553-.52.622-1.225.622-1.76V6.24l-.026-.565A774.97 774.97 0 0 1 9.885 4.4c-.042-.961-.081-1.939-.081-2.13ZM4.995 6.953a251.126 251.126 0 0 1 2.102.137l.508.035c.48-.004.646-.122.715-.185.07-.068.146-.209.147-.649l-.024-.548a791.69 791.69 0 0 1-.095-2.187L4.995 6.953Zm16.122 9.996Zm-5.479-5.323a.75.75 0 0 0 1.014.31 2.04 2.04 0 0 1 .304-.089 1.84 1.84 0 0 1 .544-.039c.215.023.321.06.37.085.033.016.039.026.047.04a.75.75 0 0 0 1.289-.767c-.337-.567-.906-.783-1.552-.85a3.334 3.334 0 0 0-1.002.062c-.27.056-.531.14-.705.234a.75.75 0 0 0-.31 1.014Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-expand' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='m12 8.337-8.47 8.47a.75.75 0 0 1-1.06-1.06l8.605-8.606a1.29 1.29 0 0 1 1.85 0l8.605 8.605a.75.75 0 1 1-1.06 1.06L12 8.338Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-external-source-placeholder' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M6.341 3.27a10.5 10.5 0 0 1 5.834-1.77.75.75 0 0 0 0-1.5 12 12 0 1 0 12 12 .75.75 0 0 0-1.5 0A10.5 10.5 0 1 1 6.34 3.27Zm14.145 1.48a.75.75 0 1 0-1.06-1.062L9.925 13.19V7.95a.75.75 0 1 0-1.5 0V15c0 .414.336.75.75.75h7.05a.75.75 0 0 0 0-1.5h-5.24l9.501-9.5Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-facebook' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M12 1.5C6.201 1.5 1.5 6.201 1.5 12c0 4.943 3.416 9.089 8.016 10.204v-6.108H7.383a.75.75 0 0 1-.75-.75v-3.281a.75.75 0 0 1 .75-.75h2.133V9.393c0-.958.225-2.511 1.38-3.65 1.194-1.177 3.174-1.718 6.254-1.056a.75.75 0 0 1 .592.733v2.754a.75.75 0 0 1-.75.75c-.692 0-1.203.026-1.584.082-.387.057-.578.137-.675.202-.109.073-.237.205-.237 1.029v1.078h2.39a.75.75 0 0 1 .742.866l-.516 3.281a.75.75 0 0 1-.74.634h-1.876v6.106C19.09 21.082 22.5 16.939 22.5 12c0-5.799-4.701-10.5-10.5-10.5zM0 12C0 5.373 5.373 0 12 0s12 5.373 12 12c0 5.995-4.395 10.961-10.138 11.856a.75.75 0 0 1-.866-.74v-7.77a.75.75 0 0 1 .75-.75h1.984l.28-1.781h-2.264a.75.75 0 0 1-.75-.75v-1.828c0-.829.089-1.729.9-2.274.363-.244.807-.37 1.293-.441a9.623 9.623 0 0 1 1.053-.086V6.04c-2.41-.405-3.645.132-4.293.771-.737.728-.933 1.793-.933 2.582v2.672a.75.75 0 0 1-.75.75H8.133v1.78h2.133a.75.75 0 0 1 .75.75v7.772a.75.75 0 0 1-.865.741C4.4 22.968 0 18 0 12z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-file' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M2.895 1.201c0-.473.383-.857.857-.857h8.4c.227 0 .445.09.606.251l8.4 8.4c.16.16.25.379.25.606v13.2a.857.857 0 0 1-.856.857h-16.8a.857.857 0 0 1-.857-.857zm1.714.857v19.886h15.085V10.458h-7.542a.857.857 0 0 1-.858-.857V2.058zm8.4 1.213 5.473 5.473H13.01z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-flickr' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M5.959 7.926c-2.298 0-4.14 1.834-4.14 4.073 0 2.241 1.842 4.075 4.14 4.075 2.302 0 4.145-1.834 4.145-4.075 0-2.238-1.843-4.073-4.145-4.073Zm-5.64 4.073c0-3.086 2.533-5.573 5.64-5.573 3.11 0 5.645 2.486 5.645 5.573 0 3.089-2.535 5.575-5.645 5.575-3.107 0-5.64-2.487-5.64-5.575Zm18.07-4.073c-2.301 0-4.144 1.835-4.144 4.073 0 2.24 1.843 4.075 4.145 4.075 2.299 0 4.141-1.834 4.141-4.075 0-2.239-1.842-4.073-4.141-4.073Zm-5.644 4.073c0-3.087 2.535-5.573 5.645-5.573 3.108 0 5.641 2.487 5.641 5.573 0 3.088-2.533 5.575-5.641 5.575-3.11 0-5.645-2.486-5.645-5.575Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-gdrive' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M7.736 1.818a.75.75 0 0 1 .647-.37h7.587a.75.75 0 0 1 .655.383l7.233 12.946a.75.75 0 0 1-.003.737l-3.794 6.66a.75.75 0 0 1-.651.378H4.59a.75.75 0 0 1-.651-.378l-3.794-6.66a.75.75 0 0 1 .005-.75zm.64 1.876L1.663 15.148l2.93 5.145 6.655-11.581zm3.736 6.526-2.398 4.173H14.5zm4.116 4.173h5.697L15.53 2.947H9.677zm5.685 1.5H8.852l-2.966 5.16h13.088z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-gphotos' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M12.51 0c-.702 0-1.272.57-1.272 1.273V7.35A6.381 6.381 0 0 0 0 11.489c0 .703.57 1.273 1.273 1.273H7.35A6.381 6.381 0 0 0 11.488 24c.704 0 1.274-.57 1.274-1.273V16.65A6.381 6.381 0 0 0 24 12.51c0-.703-.57-1.273-1.273-1.273H16.65A6.381 6.381 0 0 0 12.511 0Zm.252 11.232V1.53a4.857 4.857 0 0 1 0 9.702Zm-1.53.006H1.53a4.857 4.857 0 0 1 9.702 0Zm1.536 1.524a4.857 4.857 0 0 0 9.702 0h-9.702Zm-6.136 4.857c0-2.598 2.04-4.72 4.606-4.85v9.7a4.857 4.857 0 0 1-4.606-4.85Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-huddle' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M6.204 2.002c-.252.23-.357.486-.357.67V21.07c0 .15.084.505.313.812.208.28.499.477.929.477.519 0 .796-.174.956-.365.178-.212.286-.535.286-.924v-.013l.117-6.58c.004-1.725 1.419-3.883 3.867-3.883 1.33 0 2.332.581 2.987 1.364.637.762.95 1.717.95 2.526v6.47c0 .392.11.751.305.995.175.22.468.41 1.008.41.52 0 .816-.198 1.002-.437.207-.266.31-.633.31-.969V14.04c0-2.81-1.943-5.108-4.136-5.422a5.971 5.971 0 0 0-3.183.41c-.912.393-1.538.96-1.81 1.489a.75.75 0 0 1-1.417-.344v-7.5c0-.587-.47-1.031-1.242-1.031-.315 0-.638.136-.885.36ZM5.194.892A2.844 2.844 0 0 1 7.09.142c1.328 0 2.742.867 2.742 2.53v5.607a6.358 6.358 0 0 1 1.133-.629 7.47 7.47 0 0 1 3.989-.516c3.056.436 5.425 3.482 5.425 6.906v6.914c0 .602-.177 1.313-.627 1.89-.47.605-1.204 1.016-2.186 1.016-.96 0-1.698-.37-2.179-.973-.46-.575-.633-1.294-.633-1.933v-6.469c0-.456-.19-1.071-.602-1.563-.394-.471-.986-.827-1.836-.827-1.447 0-2.367 1.304-2.367 2.39v.014l-.117 6.58c-.001.64-.177 1.333-.637 1.881-.48.57-1.2.9-2.105.9-.995 0-1.7-.5-2.132-1.081-.41-.552-.61-1.217-.61-1.708V2.672c0-.707.366-1.341.847-1.78Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-info' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11 9h2V7h-2m1 13c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-18A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2m-1 15h2v-6h-2v6Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-instagram' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M6.225 12a5.775 5.775 0 1 1 11.55 0 5.775 5.775 0 0 1-11.55 0zM12 7.725a4.275 4.275 0 1 0 0 8.55 4.275 4.275 0 0 0 0-8.55zm6.425-.75a1.4 1.4 0 1 0 0-2.8 1.4 1.4 0 0 0 0 2.8zm-6.467-6.8h.084c2.152 0 3.823 0 5.152.132 1.35.134 2.427.41 3.362 1.013a7.15 7.15 0 0 1 2.124 2.124c.604.935.88 2.012 1.013 3.362.132 1.329.132 3 .132 5.152v.084c0 2.152 0 3.823-.132 5.152-.134 1.35-.41 2.427-1.013 3.362a7.15 7.15 0 0 1-2.124 2.124c-.935.604-2.012.88-3.362 1.013-1.329.132-3 .132-5.152.132h-.084c-2.152 0-3.824 0-5.153-.132-1.35-.134-2.427-.409-3.36-1.013a7.15 7.15 0 0 1-2.125-2.124C.716 19.62.44 18.544.307 17.194c-.132-1.329-.132-3-.132-5.152v-.084c0-2.152 0-3.823.132-5.152.133-1.35.409-2.427 1.013-3.362A7.15 7.15 0 0 1 3.444 1.32C4.378.716 5.456.44 6.805.307c1.33-.132 3-.132 5.153-.132zM6.953 1.799c-1.234.123-2.043.36-2.695.78A5.65 5.65 0 0 0 2.58 4.26c-.42.65-.657 1.46-.78 2.695C1.676 8.2 1.675 9.797 1.675 12s0 3.8.124 5.046c.123 1.235.36 2.044.78 2.696a5.649 5.649 0 0 0 1.68 1.678c.65.421 1.46.658 2.694.78 1.247.124 2.844.125 5.047.125s3.8 0 5.046-.124c1.235-.123 2.044-.36 2.695-.78a5.648 5.648 0 0 0 1.68-1.68c.42-.65.657-1.46.78-2.694.123-1.247.124-2.844.124-5.047s-.001-3.8-.125-5.046c-.122-1.235-.359-2.044-.78-2.695a5.65 5.65 0 0 0-1.679-1.68c-.651-.42-1.46-.657-2.695-.78-1.246-.123-2.843-.124-5.046-.124-2.203 0-3.8 0-5.047.124z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-local' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M3 3.75a1.5 1.5 0 0 0-1.5 1.5v13.5a1.5 1.5 0 0 0 1.5 1.5h18a1.5 1.5 0 0 0 1.5-1.5V9A1.5 1.5 0 0 0 21 7.5h-9a.75.75 0 0 1-.643-.364L9.325 3.75zm-3 1.5a3 3 0 0 1 3-3h6.75a.75.75 0 0 1 .643.364L12.425 6H21a3 3 0 0 1 3 3v9.75a3 3 0 0 1-3 3H3a3 3 0 0 1-3-3z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-onedrive' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M13.616 4.147a7.689 7.689 0 0 0-7.642 3.285A6.299 6.299 0 0 0 1.455 17.3c.684.894 2.473 2.658 5.17 2.658h12.141c.95 0 1.882-.256 2.697-.743.815-.486 1.514-1.247 1.964-2.083a5.26 5.26 0 0 0-3.713-7.612 7.69 7.69 0 0 0-6.098-5.373ZM3.34 17.15c.674.63 1.761 1.308 3.284 1.308h12.142a3.76 3.76 0 0 0 2.915-1.383l-7.494-4.489L3.34 17.15Zm10.875-6.25 2.47-1.038a5.239 5.239 0 0 1 1.427-.389 6.19 6.19 0 0 0-10.3-1.952 6.338 6.338 0 0 1 2.118.813l4.285 2.567Zm4.55.033c-.512 0-1.019.104-1.489.307l-.006.003-1.414.594 6.521 3.906a3.76 3.76 0 0 0-3.357-4.8l-.254-.01ZM4.097 9.617A4.799 4.799 0 0 1 6.558 8.9c.9 0 1.84.25 2.587.713l3.4 2.037-10.17 4.28a4.799 4.799 0 0 1 1.721-6.312Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-remove-file' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11.955 3.3A2.969 2.969 0 0 0 8.998 6h5.914a2.97 2.97 0 0 0-2.957-2.7zM16.416 6a4.47 4.47 0 0 0-8.922 0h-2.32a.755.755 0 0 0-.111.008H3.075a.75.75 0 1 0 0 1.5h1.35V19.35a2.85 2.85 0 0 0 2.85 2.85h9.45a2.85 2.85 0 0 0 2.85-2.85V7.508h1.35a.75.75 0 0 0 0-1.5h-1.989A.754.754 0 0 0 18.825 6zM5.925 7.508V19.35a1.35 1.35 0 0 0 1.35 1.35h9.45a1.35 1.35 0 0 0 1.35-1.35V7.508z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-select' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='m7 10 5 5 5-5H7Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-upload' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11.501.392a.75.75 0 0 1 .998 0l6.704 5.972a.75.75 0 0 1-.998 1.12l-5.455-4.86v13.439a.75.75 0 0 1-1.5 0V2.625l-5.454 4.86a.75.75 0 1 1-.998-1.12zM.857 16.73a.75.75 0 0 1 .75.75v4.914h20.786v-4.914a.75.75 0 0 1 1.5 0v5.664a.75.75 0 0 1-.75.75H.857a.75.75 0 0 1-.75-.75v-5.664a.75.75 0 0 1 .75-.75z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-upload-error' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M13 13h-2V7h2m0 10h-2v-2h2M12 2A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-url' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M19.11 3.67c-1.71-1.709-4.578-1.682-6.408.148l-2.22 2.22a.75.75 0 0 1-1.062-1.06l2.222-2.221C14.018.381 17.836.276 20.17 2.61l1.22 1.22c2.335 2.334 2.23 6.153-.147 8.529l-2.22 2.22a.75.75 0 0 1-1.062-1.06l2.222-2.221c1.83-1.83 1.856-4.698.147-6.408zm-3.36 4.58a.75.75 0 0 1 0 1.06l-6.439 6.44a.75.75 0 0 1-1.06-1.06l6.439-6.44a.75.75 0 0 1 1.06 0zM6.04 9.42a.75.75 0 0 1 0 1.061l-2.222 2.222c-1.83 1.83-1.856 4.698-.147 6.407l1.22 1.22c1.71 1.71 4.578 1.683 6.408-.147l2.221-2.221a.75.75 0 1 1 1.06 1.06l-2.22 2.222c-2.377 2.376-6.195 2.481-8.53.147l-1.22-1.22c-2.334-2.334-2.228-6.153.148-8.53l2.221-2.22a.75.75 0 0 1 1.06 0z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-vk' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M6.341 3.27a10.5 10.5 0 0 1 5.834-1.77.75.75 0 0 0 0-1.5 12 12 0 1 0 12 12 .75.75 0 0 0-1.5 0A10.5 10.5 0 1 1 6.34 3.27Zm14.145 1.48a.75.75 0 1 0-1.06-1.062L9.925 13.19V7.95a.75.75 0 1 0-1.5 0V15c0 .414.336.75.75.75h7.05a.75.75 0 0 0 0-1.5h-5.24l9.501-9.5Z'/></symbol></svg>";var $i=class $i extends y{constructor(){super(...arguments);h(this,"requireCtxName",!0);h(this,"init$",Ai(this));h(this,"_template",null)}initCallback(){var t;super.initCallback(),(t=this.a11y)==null||t.registerBlock(this)}static set template(t){this._template=Fo+t+"<slot></slot>"}static get template(){return this._template}};a($i,"SolutionBlock"),h($i,"styleAttrs",["uc-wgt-common"]);var st=$i;var No="active",Oe="___ACTIVITY_IS_ACTIVE___",ot=class ot extends y{constructor(){super(...arguments);h(this,"historyTracked",!1);h(this,"init$",Or(this));h(this,"_debouncedHistoryFlush",U(this._historyFlush.bind(this),10))}_deactivate(){var i;let t=ot._activityCallbacks.get(this);this[Oe]=!1,this.removeAttribute(No),(i=t==null?void 0:t.deactivateCallback)==null||i.call(t)}_activate(){var i;let t=ot._activityCallbacks.get(this);this.$["*historyBack"]=this.historyBack.bind(this),this[Oe]=!0,this.setAttribute(No,""),(i=t==null?void 0:t.activateCallback)==null||i.call(t),this._debouncedHistoryFlush(),this.emit(k.ACTIVITY_CHANGE,{activity:this.activityType})}initCallback(){super.initCallback(),this.hasAttribute("current-activity")&&this.sub("*currentActivity",t=>{this.setAttribute("current-activity",t)}),this.activityType&&(this.hasAttribute("activity")||this.setAttribute("activity",this.activityType),this.sub("*currentActivity",t=>{var i;try{this.activityType!==t&&this[Oe]?this._deactivate():this.activityType===t&&!this[Oe]&&this._activate()}catch(s){console.error(`Error in activity "${this.activityType}". `,s),this.$["*currentActivity"]=(i=this.$["*history"][this.$["*history"].length-1])!=null?i:null}t||(this.$["*history"]=[])}),this.has("*modalActive")&&this.sub("*modalActive",t=>{!t&&this.activityType===this.$["*currentActivity"]&&(this.$["*currentActivity"]=null)}))}_historyFlush(){let t=this.$["*history"];t&&(t.length>10&&(t=t.slice(t.length-11,t.length-1)),this.historyTracked&&t[t.length-1]!==this.activityType&&t.push(this.activityType),this.$["*history"]=t)}_isActivityRegistered(){return this.activityType&&ot._activityCallbacks.has(this)}get isActivityActive(){return this[Oe]}get couldOpenActivity(){return!0}registerActivity(t,i={}){let{onActivate:s,onDeactivate:o}=i;ot._activityCallbacks.set(this,{activateCallback:s,deactivateCallback:o})}unregisterActivity(){this.isActivityActive&&this._deactivate(),ot._activityCallbacks.delete(this)}destroyCallback(){super.destroyCallback(),this._isActivityRegistered()&&this.unregisterActivity();let t=this.$["*currentActivity"];!![...this.blocksRegistry].find(s=>s instanceof ot&&s.activityType===t)||(this.$["*currentActivity"]=null,this.setOrAddState("*modalActive",!1))}get activityKey(){return this.ctxName+this.activityType}get activityParams(){return this.$["*currentActivityParams"]}get initActivity(){return this.getCssData("--cfg-init-activity")}get doneActivity(){return this.getCssData("--cfg-done-activity")}historyBack(){var i;let t=this.$["*history"];if(t){let s=t.pop();for(;s===this.activityType;)s=t.pop();let o=!!s;if(s){let n=[...this.blocksRegistry].find(l=>l.activityType===s);o=(i=n==null?void 0:n.couldOpenActivity)!=null?i:!1}s=o?s:void 0,this.$["*currentActivity"]=s,this.$["*history"]=t,s||this.setOrAddState("*modalActive",!1)}}};a(ot,"ActivityBlock"),h(ot,"_activityCallbacks",new Map);var _=ot;_.activities=Object.freeze({START_FROM:"start-from",CAMERA:"camera",DRAW:"draw",UPLOAD_LIST:"upload-list",URL:"url",CLOUD_IMG_EDIT:"cloud-image-edit",EXTERNAL:"external"});var Le=33.333333333333336,A=1,zr=24,zo=6;function Ot(r,e){for(let t in e)r.setAttributeNS(null,t,e[t].toString())}a(Ot,"setSvgNodeAttrs");function Z(r,e={}){let t=document.createElementNS("http://www.w3.org/2000/svg",r);return Ot(t,e),t}a(Z,"createSvgNode");function Vo(r,e,t){let{x:i,y:s,width:o,height:n}=r,l=e.includes("w")?0:1,c=e.includes("n")?0:1,u=[-1,1][l],d=[-1,1][c],p=[i+l*o+1.5*u,s+c*n+1.5*d-24*t*d],f=[i+l*o+1.5*u,s+c*n+1.5*d],m=[i+l*o-24*t*u+1.5*u,s+c*n+1.5*d];return{d:`M ${p[0]} ${p[1]} L ${f[0]} ${f[1]} L ${m[0]} ${m[1]}`,center:f}}a(Vo,"cornerPath");function Bo(r,e,t){let{x:i,y:s,width:o,height:n}=r,l=["n","s"].includes(e)?.5:{w:0,e:1}[e],c=["w","e"].includes(e)?.5:{n:0,s:1}[e],u=[-1,1][l],d=[-1,1][c],p,f;["n","s"].includes(e)?(p=[i+l*o-34*t/2,s+c*n+1.5*d],f=[i+l*o+34*t/2,s+c*n+1.5*d]):(p=[i+l*o+1.5*u,s+c*n-34*t/2],f=[i+l*o+1.5*u,s+c*n+34*t/2]);let m=`M ${p[0]} ${p[1]} L ${f[0]} ${f[1]}`,g=[f[0]-(f[0]-p[0])/2,f[1]-(f[1]-p[1])/2];return{d:m,center:g}}a(Bo,"sidePath");function jo(r){return r===""?"move":["e","w"].includes(r)?"ew-resize":["n","s"].includes(r)?"ns-resize":["nw","se"].includes(r)?"nwse-resize":"nesw-resize"}a(jo,"thumbCursor");function Ho({rect:r,delta:[e,t],imageBox:i}){return Gt({...r,x:r.x+e,y:r.y+t},i)}a(Ho,"moveRect");function Gt(r,e){let{x:t}=r,{y:i}=r;return r.x<e.x?t=e.x:r.x+r.width>e.x+e.width&&(t=e.x+e.width-r.width),r.y<e.y?i=e.y:r.y+r.height>e.y+e.height&&(i=e.y+e.height-r.height),{...r,x:t,y:i}}a(Gt,"constraintRect");function Ml({rect:r,delta:e,aspectRatio:t,imageBox:i}){let[,s]=e,{y:o,width:n,height:l}=r;o+=s,l-=s,t&&(n=l*t);let c=r.x+r.width/2-n/2;return o<=i.y&&(o=i.y,l=r.y+r.height-o,t&&(n=l*t,c=r.x+r.width/2-n/2)),c<=i.x&&(c=i.x,o=r.y+r.height-l),c+n>=i.x+i.width&&(c=Math.max(i.x,i.x+i.width-n),n=i.x+i.width-c,t&&(l=n/t),o=r.y+r.height-l),l<A&&(l=A,t&&(n=l*t,c=r.x+r.width/2-n/2),o=r.y+r.height-l),n<A&&(n=A,t&&(l=n/t,c=r.x+r.width/2-n/2),o=r.y+r.height-l),{x:c,y:o,width:n,height:l}}a(Ml,"resizeNorth");function Rl({rect:r,delta:e,aspectRatio:t,imageBox:i}){let[s]=e,{x:o,width:n,height:l}=r;o+=s,n-=s,t&&(l=n/t);let c=r.y+r.height/2-l/2;return o<=i.x&&(o=i.x,n=r.x+r.width-o,t&&(l=n/t,c=r.y+r.height/2-l/2)),c<=i.y&&(c=i.y,o=r.x+r.width-n),c+l>=i.y+i.height&&(c=Math.max(i.y,i.y+i.height-l),l=i.y+i.height-c,t&&(n=l*t),o=r.x+r.width-n),l<A&&(l=A,t&&(n=l*t),c=r.y+r.height/2-l/2,o=r.x+r.width-n),n<A&&(n=A,t&&(l=n/t),c=r.y+r.height/2-l/2,o=r.x+r.width-n),{x:o,y:c,width:n,height:l}}a(Rl,"resizeWest");function Dl({rect:r,delta:e,aspectRatio:t,imageBox:i}){let[,s]=e,{y:o,width:n,height:l}=r;l+=s,t&&(n=l*t);let c=r.x+r.width/2-n/2;return o+l>=i.y+i.height&&(l=i.y+i.height-o,t&&(n=l*t),c=r.x+r.width/2-n/2),c<=i.x&&(c=i.x,o=r.y),c+n>=i.x+i.width&&(c=Math.max(i.x,i.x+i.width-n),n=i.x+i.width-c,t&&(l=n/t),o=r.y),l<A&&(l=A,t&&(n=l*t),c=r.x+r.width/2-n/2),n<A&&(n=A,t&&(l=n/t),c=r.x+r.width/2-n/2),{x:c,y:o,width:n,height:l}}a(Dl,"resizeSouth");function Fl({rect:r,delta:e,aspectRatio:t,imageBox:i}){let[s]=e,{x:o,width:n,height:l}=r;n+=s,t&&(l=n/t);let c=r.y+r.height/2-l/2;return o+n>=i.x+i.width&&(n=i.x+i.width-o,t&&(l=n/t),c=r.y+r.height/2-l/2),c<=i.y&&(c=i.y,o=r.x),c+l>=i.y+i.height&&(c=Math.max(i.y,i.y+i.height-l),l=i.y+i.height-c,t&&(n=l*t),o=r.x),l<A&&(l=A,t&&(n=l*t),c=r.y+r.height/2-l/2),n<A&&(n=A,t&&(l=n/t),c=r.y+r.height/2-l/2),{x:o,y:c,width:n,height:l}}a(Fl,"resizeEast");function Nl({rect:r,delta:e,aspectRatio:t,imageBox:i}){let[s,o]=e,{x:n,y:l,width:c,height:u}=r;return n+s<i.x&&(s=i.x-n),l+o<i.y&&(o=i.y-l),n+=s,c-=s,l+=o,u-=o,t&&Math.abs(c/u)>t?(o=c/t-u,u+=o,l-=o,l<=i.y&&(u=u-(i.y-l),c=u*t,n=r.x+r.width-c,l=i.y)):t&&(s=u*t-c,c=c+s,n-=s,n<=i.x&&(c=c-(i.x-n),u=c/t,n=i.x,l=r.y+r.height-u)),u<A&&(u=A,t&&(c=u*t),n=r.x+r.width-c,l=r.y+r.height-u),c<A&&(c=A,t&&(u=c/t),n=r.x+r.width-c,l=r.y+r.height-u),{x:n,y:l,width:c,height:u}}a(Nl,"resizeNorthWest");function zl({rect:r,delta:e,aspectRatio:t,imageBox:i}){let[s,o]=e,{x:n,y:l,width:c,height:u}=r;return n+c+s>i.x+i.width&&(s=i.x+i.width-n-c),l+o<i.y&&(o=i.y-l),c+=s,l+=o,u-=o,t&&Math.abs(c/u)>t?(o=c/t-u,u+=o,l-=o,l<=i.y&&(u=u-(i.y-l),c=u*t,n=r.x,l=i.y)):t&&(s=u*t-c,c+=s,n+c>=i.x+i.width&&(c=i.x+i.width-n,u=c/t,n=i.x+i.width-c,l=r.y+r.height-u)),u<A&&(u=A,t&&(c=u*t),l=r.y+r.height-u),c<A&&(c=A,t&&(u=c/t),l=r.y+r.height-u),{x:n,y:l,width:c,height:u}}a(zl,"resizeNorthEast");function Vl({rect:r,delta:e,aspectRatio:t,imageBox:i}){let[s,o]=e,{x:n,y:l,width:c,height:u}=r;return n+s<i.x&&(s=i.x-n),l+u+o>i.y+i.height&&(o=i.y+i.height-l-u),n+=s,c-=s,u+=o,t&&Math.abs(c/u)>t?(o=c/t-u,u+=o,l+u>=i.y+i.height&&(u=i.y+i.height-l,c=u*t,n=r.x+r.width-c,l=i.y+i.height-u)):t&&(s=u*t-c,c+=s,n-=s,n<=i.x&&(c=c-(i.x-n),u=c/t,n=i.x,l=r.y)),u<A&&(u=A,t&&(c=u*t),n=r.x+r.width-c),c<A&&(c=A,t&&(u=c/t),n=r.x+r.width-c),{x:n,y:l,width:c,height:u}}a(Vl,"resizeSouthWest");function Bl({rect:r,delta:e,aspectRatio:t,imageBox:i}){let[s,o]=e,{x:n,y:l,width:c,height:u}=r;return n+c+s>i.x+i.width&&(s=i.x+i.width-n-c),l+u+o>i.y+i.height&&(o=i.y+i.height-l-u),c+=s,u+=o,t&&Math.abs(c/u)>t?(o=c/t-u,u+=o,l+u>=i.y+i.height&&(u=i.y+i.height-l,c=u*t,n=r.x,l=i.y+i.height-u)):t&&(s=u*t-c,c+=s,n+c>=i.x+i.width&&(c=i.x+i.width-n,u=c/t,n=i.x+i.width-c,l=r.y)),u<A&&(u=A,t&&(c=u*t)),c<A&&(c=A,t&&(u=c/t)),{x:n,y:l,width:c,height:u}}a(Bl,"resizeSouthEast");function Go({direction:r,...e}){switch(r){case"n":return Ml(e);case"w":return Rl(e);case"s":return Dl(e);case"e":return Fl(e);case"nw":return Nl(e);case"ne":return zl(e);case"sw":return Vl(e);case"se":return Bl(e);default:return e.rect}}a(Go,"resizeRect");function Wo(r,[e,t]){return r.x<=e&&e<=r.x+r.width&&r.y<=t&&t<=r.y+r.height}a(Wo,"rectContainsPoint");function Xo(r,e){return r.x>=e.x&&r.y>=e.y&&r.x+r.width<=e.x+e.width&&r.y+r.height<=e.y+e.height}a(Xo,"isRectInsideRect");function qo(r,e){return Math.abs(r.width/r.height-e)<.1}a(qo,"isRectMatchesAspectRatio");function Wt({width:r,height:e},t){let i=t/90%2!==0;return{width:i?e:r,height:i?r:e}}a(Wt,"rotateSize");function Ko(r,e,t){let i=r/e,s,o;i>t?(s=Math.round(e*t),o=e):(s=r,o=Math.round(r/t));let n=Math.round((r-s)/2),l=Math.round((e-o)/2);return n+s>r&&(s=r-n),l+o>e&&(o=e-l),{x:n,y:l,width:s,height:o}}a(Ko,"calculateMaxCenteredCropFrame");function Xt(r){return{x:Math.round(r.x),y:Math.round(r.y),width:Math.round(r.width),height:Math.round(r.height)}}a(Xt,"roundRect");function Et(r,e,t){return Math.min(Math.max(r,e),t)}a(Et,"clamp");var Ii=a(r=>{if(!r)return[];let[e,t]=r.split(":").map(Number);if(!Number.isFinite(e)||!Number.isFinite(t)){console.error(`Invalid crop preset: ${r}`);return}return[{type:"aspect-ratio",width:e,height:t}]},"parseCropPreset");var Lt="blocks",Ut="1.9.0";function Zo(r){return _r({...r,libraryName:Lt,libraryVersion:Ut})}a(Zo,"customUserAgent");var Yo=a(r=>Math.floor(r/1e3),"msToUnixTimestamp"),Jo=a((r,{threshold:e})=>{let{secureExpire:t}=r,i=Yo(Date.now()),s=Number(t),o=Yo(e);return i+o>=s},"isSecureTokenExpired");var Vr=class Vr{constructor(e){h(this,"_block");h(this,"_secureToken",null);this._block=e}_debugPrint(...e){this._block.debugPrint("[secure-uploads]",...e)}async getSecureToken(){let{secureSignature:e,secureExpire:t,secureUploadsSignatureResolver:i}=this._block.cfg;if((e||t)&&i&&console.warn("Both secureSignature/secureExpire and secureUploadsSignatureResolver are set. secureUploadsSignatureResolver will be used."),i){if(!this._secureToken||Jo(this._secureToken,{threshold:this._block.cfg.secureUploadsExpireThreshold})){this._secureToken?this._debugPrint("Secure signature is expired. Resolving a new one..."):this._debugPrint("Secure signature is not set yet.");try{let s=await i();s?!s.secureSignature||!s.secureExpire?console.error("Secure signature resolver returned an invalid result:",s):(this._debugPrint("Secure signature resolved:",s),this._debugPrint("Secure signature will expire in",new Date(Number(s.secureExpire)*1e3).toISOString()),this._secureToken=s):(this._debugPrint("Secure signature resolver returned nothing."),this._secureToken=null)}catch(s){console.error("Secure signature resolving failed. Falling back to the previous one.",s)}}return this._secureToken}return e&&t?(this._debugPrint("Secure signature and expire are set. Using them...",{secureSignature:e,secureExpire:t}),{secureSignature:e,secureExpire:t}):null}};a(Vr,"SecureUploadsManager");var Oi=Vr;var Qo="[Typed State] Wrong property name: ",jl="[Typed State] Wrong property type: ",Br=class Br{constructor(e,t){this.__typedSchema=e,this.__ctxId=t||$t.generate(),this.__schema=Object.keys(e).reduce((i,s)=>(i[s]=e[s].value,i),{}),this.__data=T.registerCtx(this.__schema,this.__ctxId)}get uid(){return this.__ctxId}setValue(e,t){if(!this.__typedSchema.hasOwnProperty(e)){console.warn(Qo+e);return}let i=this.__typedSchema[e];if((t==null?void 0:t.constructor)===i.type||t instanceof i.type||i.nullable&&t===null){this.__data.pub(e,t);return}console.warn(jl+e)}setMultipleValues(e){for(let t in e)this.setValue(t,e[t])}getValue(e){if(!this.__typedSchema.hasOwnProperty(e)){console.warn(Qo+e);return}return this.__data.read(e)}subscribe(e,t){return this.__data.sub(e,t)}remove(){T.deleteCtx(this.__ctxId)}};a(Br,"TypedData");var Li=Br;var jr=class jr{constructor(e){this.__typedSchema=e.typedSchema,this.__ctxId=e.ctxName||$t.generate(),this.__data=T.registerCtx({},this.__ctxId),this.__watchList=e.watchList||[],this.__subsMap=Object.create(null),this.__propertyObservers=new Set,this.__collectionObservers=new Set,this.__items=new Set,this.__removed=new Set,this.__added=new Set;let t=Object.create(null);this.__notifyObservers=(i,s)=>{this.__observeTimeout&&window.clearTimeout(this.__observeTimeout),t[i]||(t[i]=new Set),t[i].add(s),this.__observeTimeout=window.setTimeout(()=>{Object.keys(t).length!==0&&(this.__propertyObservers.forEach(o=>{o({...t})}),t=Object.create(null))})}}notify(){this.__notifyTimeout&&window.clearTimeout(this.__notifyTimeout),this.__notifyTimeout=window.setTimeout(()=>{let e=new Set(this.__added),t=new Set(this.__removed);this.__added.clear(),this.__removed.clear();for(let i of this.__collectionObservers)i==null||i([...this.__items],e,t)})}observeCollection(e){return this.__collectionObservers.add(e),this.__items.size>0&&this.notify(),()=>{this.unobserveCollection(e)}}unobserveCollection(e){var t;(t=this.__collectionObservers)==null||t.delete(e)}add(e){let t=new Li(this.__typedSchema);for(let i in e)t.setValue(i,e[i]);return this.__items.add(t.uid),this.notify(),this.__data.add(t.uid,t),this.__added.add(t),this.__watchList.forEach(i=>{this.__subsMap[t.uid]||(this.__subsMap[t.uid]=[]),this.__subsMap[t.uid].push(t.subscribe(i,()=>{this.__notifyObservers(i,t.uid)}))}),t.uid}read(e){return this.__data.read(e)}readProp(e,t){return this.read(e).getValue(t)}publishProp(e,t,i){this.read(e).setValue(t,i)}remove(e){this.__removed.add(this.__data.read(e)),this.__items.delete(e),this.notify(),this.__data.pub(e,null),delete this.__subsMap[e]}clearAll(){this.__items.forEach(e=>{this.remove(e)})}observeProperties(e){return this.__propertyObservers.add(e),()=>{this.unobserveProperties(e)}}unobserveProperties(e){var t;(t=this.__propertyObservers)==null||t.delete(e)}findItems(e){let t=[];return this.__items.forEach(i=>{let s=this.read(i);e(s)&&t.push(i)}),t}items(){return[...this.__items]}get size(){return this.__items.size}destroy(){T.deleteCtx(this.__ctxId),this.__propertyObservers=null,this.__collectionObservers=null;for(let e in this.__subsMap)this.__subsMap[e].forEach(t=>{t.remove()}),delete this.__subsMap[e]}};a(jr,"TypedCollection");var Ui=jr;var Pt=Object.freeze({FACEBOOK:"facebook",DROPBOX:"dropbox",GDRIVE:"gdrive",GPHOTOS:"gphotos",INSTAGRAM:"instagram",FLICKR:"flickr",VK:"vk",EVERNOTE:"evernote",BOX:"box",ONEDRIVE:"onedrive",HUDDLE:"huddle"}),L=Object.freeze({LOCAL:"local",DROP_AREA:"drop-area",CAMERA:"camera",EXTERNAL:"external",API:"js-api",URL:"url",DRAW:"draw",...Pt});var Ue=["image/*","image/heif","image/heif-sequence","image/heic","image/heic-sequence","image/avif","image/avif-sequence",".heif",".heifs",".heic",".heics",".avif",".avifs"],Pi=a(r=>r?r.filter(e=>typeof e=="string").map(e=>z(e)).flat():[],"mergeFileTypes"),Hr=a((r,e)=>e.some(t=>t.endsWith("*")?(t=t.replace("*",""),r.startsWith(t)):r===t),"matchMimeType"),tn=a((r,e)=>e.some(t=>t.startsWith(".")?r.toLowerCase().endsWith(t.toLowerCase()):!1),"matchExtension"),en=a(r=>{let e=r==null?void 0:r.type;return e?Hr(e,Ue):!1},"fileIsImage");var Hl=/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/i,Gl=new RegExp(`^/?(${Hl.source})(?:/(-/(?:[^/]+/)+)?([^/]*))?$`,"i"),rn=a(({url:r,cdnBase:e})=>{let t=new URL(e),i=new URL(r);if(t.host!==i.host)return null;let[,s,o,n]=Gl.exec(i.pathname);return{uuid:s,cdnUrlModifiers:o||"",filename:n||null}},"parseCdnUrl");var sn=a(r=>{let e=new Map;return(...t)=>{let i=JSON.stringify(t);if(e.has(i))return e.get(i);let s=r(...t);return e.set(i,s),s}},"memoize");var on=new Set;function nn(r){on.has(r)||(on.add(r),console.warn(r))}a(nn,"warnOnce");function Wl(r){let e=!1;return setTimeout(()=>{e=!0},0),a(i=>(...s)=>(e&&nn(r),i(...s)),"withAssert")}a(Wl,"createAsyncAssertWrapper");function an(r){let e={progress:()=>r.$["*commonProgress"],errors:()=>r.$["*collectionErrors"],group:()=>r.$["*groupInfo"],totalCount:()=>r.uploadCollection.size,failedCount:()=>t.failedEntries.length,successCount:()=>t.successEntries.length,uploadingCount:()=>t.uploadingEntries.length,status:()=>t.isFailed?"failed":t.isUploading?"uploading":t.isSuccess?"success":"idle",isSuccess:()=>t.allEntries.length>0&&t.errors.length===0&&t.successEntries.length===t.allEntries.length,isUploading:()=>t.allEntries.some(s=>s.status==="uploading"),isFailed:()=>t.errors.length>0||t.failedEntries.length>0,allEntries:()=>r.getOutputData(),successEntries:()=>t.allEntries.filter(s=>s.status==="success"),failedEntries:()=>t.allEntries.filter(s=>s.status==="failed"),uploadingEntries:()=>t.allEntries.filter(s=>s.status==="uploading"),idleEntries:()=>t.allEntries.filter(s=>s.status==="idle")},t={},i=Wl("You're trying to access the OutputCollectionState asynchronously. In this case, the data you retrieve will be newer than it was when the OutputCollectionState was created or when the event was dispatched. If you want to retain the state at a specific moment in time, you should use the spread operator like this: `{...outputCollectionState}` or `{...e.detail}`");for(let[s,o]of Object.entries(e)){let n=s,c=sn(i(o));Object.defineProperty(t,n,{get:c,enumerable:!0})}return t}a(an,"buildOutputCollectionState");var Gr=class Gr{constructor(e){h(this,"_ctx");h(this,"addFileFromUrl",a((e,{silent:t,fileName:i,source:s}={})=>{let o=this._uploadCollection.add({externalUrl:e,fileName:i!=null?i:null,silent:t!=null?t:!1,source:s!=null?s:L.API});return this.getOutputItem(o)},"addFileFromUrl"));h(this,"addFileFromUuid",a((e,{silent:t,fileName:i,source:s}={})=>{let o=this._uploadCollection.add({uuid:e,fileName:i!=null?i:null,silent:t!=null?t:!1,source:s!=null?s:L.API});return this.getOutputItem(o)},"addFileFromUuid"));h(this,"addFileFromCdnUrl",a((e,{silent:t,fileName:i,source:s}={})=>{var l;let o=rn({url:e,cdnBase:this.cfg.cdnCname});if(!o)throw new Error("Invalid CDN URL");let n=this._uploadCollection.add({uuid:o.uuid,cdnUrl:e,cdnUrlModifiers:o.cdnUrlModifiers,fileName:(l=i!=null?i:o.filename)!=null?l:null,silent:t!=null?t:!1,source:s!=null?s:L.API});return this.getOutputItem(n)},"addFileFromCdnUrl"));h(this,"addFileFromObject",a((e,{silent:t,fileName:i,source:s,fullPath:o}={})=>{let n=this._uploadCollection.add({file:e,isImage:en(e),mimeType:e.type,fileName:i!=null?i:e.name,fileSize:e.size,silent:t!=null?t:!1,source:s!=null?s:L.API,fullPath:o!=null?o:null});return this.getOutputItem(n)},"addFileFromObject"));h(this,"removeFileByInternalId",a(e=>{if(!this._uploadCollection.read(e))throw new Error(`File with internalId ${e} not found`);this._uploadCollection.remove(e)},"removeFileByInternalId"));h(this,"uploadAll",a(()=>{let e=this._uploadCollection.items().filter(t=>{let i=this._uploadCollection.read(t);return!i.getValue("isRemoved")&&!i.getValue("isUploading")&&!i.getValue("fileInfo")});e.length!==0&&(this._ctx.$["*uploadTrigger"]=new Set(e),this._ctx.emit(k.COMMON_UPLOAD_START,this.getOutputCollectionState()))},"uploadAll"));h(this,"openSystemDialog",a((e={})=>{var o;let t=Vt(Pi([(o=this.cfg.accept)!=null?o:"",...this.cfg.imgOnly?Ue:[]]));this.cfg.accept&&this.cfg.imgOnly&&console.warn("There could be a mistake.\nBoth `accept` and `imgOnly` parameters are set.\nThe value of `accept` will be concatenated with the internal image mime types list.");let i="uploadcare-file-input",s=document.createElement("input");s.setAttribute(i,""),xe(s,{opacity:0,height:0,width:0,visibility:"hidden"}),s.type="file",s.multiple=this.cfg.multiple,e.captureCamera?(s.capture=this.cfg.cameraCapture,s.accept="image/*"):s.accept=t,s.addEventListener("change",()=>{s.files&&([...s.files].forEach(n=>this.addFileFromObject(n,{source:e.captureCamera?L.CAMERA:L.LOCAL})),this._ctx.$["*currentActivity"]=_.activities.UPLOAD_LIST,this._ctx.setOrAddState("*modalActive",!0),s.remove())},{once:!0}),document.querySelectorAll(`[${i}]`).forEach(n=>n.remove()),document.body.appendChild(s),s.dispatchEvent(new MouseEvent("click"))},"openSystemDialog"));h(this,"getOutputItem",a(e=>{var n,l,c,u,d,p,f,m,g,b;let t=T.getCtx(e).store,i=t.fileInfo,s=t.isRemoved?"removed":t.errors.length>0?"failed":t.fileInfo?"success":t.isUploading?"uploading":"idle";return{uuid:(l=(n=i==null?void 0:i.uuid)!=null?n:t.uuid)!=null?l:null,internalId:e,name:(c=i==null?void 0:i.originalFilename)!=null?c:t.fileName,size:(u=i==null?void 0:i.size)!=null?u:t.fileSize,isImage:(d=i==null?void 0:i.isImage)!=null?d:t.isImage,mimeType:(p=i==null?void 0:i.mimeType)!=null?p:t.mimeType,file:t.file,externalUrl:t.externalUrl,cdnUrlModifiers:t.cdnUrlModifiers,cdnUrl:(m=(f=t.cdnUrl)!=null?f:i==null?void 0:i.cdnUrl)!=null?m:null,fullPath:t.fullPath,uploadProgress:t.uploadProgress,fileInfo:i!=null?i:null,metadata:(b=(g=t.metadata)!=null?g:i==null?void 0:i.metadata)!=null?b:null,isSuccess:s==="success",isUploading:s==="uploading",isFailed:s==="failed",isRemoved:s==="removed",errors:t.errors,status:s,source:t==null?void 0:t.source}},"getOutputItem"));h(this,"getOutputCollectionState",a(()=>an(this._ctx),"getOutputCollectionState"));h(this,"initFlow",a((e=!1)=>{var t;if(this._uploadCollection.size>0&&!e)this._ctx.set$({"*currentActivity":_.activities.UPLOAD_LIST}),this._ctx.setOrAddState("*modalActive",!0);else if(((t=this._sourceList)==null?void 0:t.length)===1){let i=this._sourceList[0];if(i==="local"){this._ctx.$["*currentActivity"]=_.activities.UPLOAD_LIST,this.openSystemDialog();return}let s=this._ctx.$["*blocksRegistry"],o=a(l=>"type"in l&&l.type===i,"isSourceBtn"),n=[...s].find(o);n==null||n.activate(),this._ctx.$["*currentActivity"]&&this._ctx.setOrAddState("*modalActive",!0)}else this._ctx.set$({"*currentActivity":_.activities.START_FROM}),this._ctx.setOrAddState("*modalActive",!0)},"initFlow"));h(this,"doneFlow",a(()=>{this._ctx.set$({"*currentActivity":this._ctx.doneActivity,"*history":this._ctx.doneActivity?[this._ctx.doneActivity]:[]}),this._ctx.$["*currentActivity"]||this._ctx.setOrAddState("*modalActive",!1)},"doneFlow"));h(this,"setCurrentActivity",a((e,t=void 0)=>{if(this._ctx.hasBlockInCtx(i=>i.activityType===e)){this._ctx.set$({"*currentActivityParams":t!=null?t:{},"*currentActivity":e});return}console.warn(`Activity type "${e}" not found in the context`)},"setCurrentActivity"));h(this,"getCurrentActivity",a(()=>this._ctx.$["*currentActivity"],"getCurrentActivity"));h(this,"setModalState",a(e=>{if(e&&!this._ctx.$["*currentActivity"]){console.warn(`Can't open modal without current activity. Please use "setCurrentActivity" method first.`);return}this._ctx.setOrAddState("*modalActive",e)},"setModalState"));this._ctx=e}get _uploadCollection(){return this._ctx.uploadCollection}get cfg(){return this._ctx.cfg}get l10n(){return this._ctx.l10n.bind(this._ctx)}removeAllFiles(){this._uploadCollection.clearAll()}get _sourceList(){let e=[];return this.cfg.sourceList&&(e=z(this.cfg.sourceList)),e}};a(Gr,"UploaderPublicApi");var Mi=Gr;var Wr=a((r,e)=>{let t=e.cfg.imgOnly,i=r.isImage;if(!(!t||i)&&!(!r.fileInfo&&r.externalUrl)&&!(!r.fileInfo&&!r.mimeType))return{type:"NOT_AN_IMAGE",message:e.l10n("images-only-accepted"),payload:{entry:r}}},"validateIsImage");var Xr=a((r,e)=>{let t=e.cfg.imgOnly,i=e.cfg.accept,s=Pi([...t?Ue:[],i]);if(!s.length)return;let o=r.mimeType,n=r.name;if(!o||!n)return;let l=Hr(o,s),c=tn(n,s);if(!l&&!c)return{type:"FORBIDDEN_FILE_TYPE",message:e.l10n("file-type-not-allowed"),payload:{entry:r}}},"validateFileType");var at=1e3,Mt=Object.freeze({AUTO:"auto",BYTE:"byte",KB:"kb",MB:"mb",GB:"gb",TB:"tb",PB:"pb"}),Pe=a(r=>Math.ceil(r*100)/100,"round"),ln=a((r,e=Mt.AUTO)=>{let t=e===Mt.AUTO;if(e===Mt.BYTE||t&&r<at**1){let i=pi("en-US",r),s={one:"byte",other:"bytes"}[i];return`${r} ${s}`}return e===Mt.KB||t&&r<at**2?`${Pe(r/at**1)} KB`:e===Mt.MB||t&&r<at**3?`${Pe(r/at**2)} MB`:e===Mt.GB||t&&r<at**4?`${Pe(r/at**3)} GB`:e===Mt.TB||t&&r<at**5?`${Pe(r/at**4)} TB`:`${Pe(r/at**5)} PB`},"prettyBytes");var qr=a((r,e)=>{let t=e.cfg.maxLocalFileSizeBytes,i=r.size;if(t&&i&&i>t)return{type:"FILE_SIZE_EXCEEDED",message:e.l10n("files-max-size-limit-error",{maxFileSize:ln(t)}),payload:{entry:r}}},"validateMaxSizeLimit");var Kr=a((r,e)=>{let{internalId:t}=r,i=e._uploadCollection.read(t),s=i==null?void 0:i.getValue("uploadError");if(!s)return;if(s instanceof V)return{type:"UPLOAD_ERROR",message:s.message,payload:{entry:r,error:s}};if(s instanceof Bt)return{type:"NETWORK_ERROR",message:s.message,payload:{entry:r,error:s}};let o=s instanceof Error?s:new Error("Unknown error",{cause:s});return{type:"UNKNOWN_ERROR",message:o.message,payload:{entry:r,error:o}}},"validateUploadError");var Zr=a((r,e)=>{if(r.failedCount>0)return{type:"SOME_FILES_HAS_ERRORS",message:e.l10n("some-files-were-not-uploaded")}},"validateCollectionUploadError");var Yr=a((r,e)=>{let t=r.totalCount,i=e.cfg.multiple?e.cfg.multipleMin:0,s=e.cfg.multiple?e.cfg.multipleMax:1;if(i&&t<i)return{type:"TOO_FEW_FILES",message:e.l10n("files-count-limit-error-too-few",{min:i,max:s,total:t}),payload:{total:t,min:i,max:s}};if(s&&t>s)return{type:"TOO_MANY_FILES",message:e.l10n("files-count-limit-error-too-many",{min:i,max:s,total:t}),payload:{total:t,min:i,max:s}}},"validateMultiple");var Ri={file:"File validator execution has failed",collection:"Collection validator execution has failed",message:"Missing message. We recommend adding message: value."},Jr=class Jr{constructor(e){h(this,"_blockInstance");h(this,"_fileValidators",[Wr,Xr,qr,Kr]);h(this,"_collectionValidators",[Yr,Zr]);this._blockInstance=e,this._uploadCollection=this._blockInstance.uploadCollection;let t=a(()=>{this.runFileValidators(),this.runCollectionValidators()},"runAllValidators");this._blockInstance.subConfigValue("maxLocalFileSizeBytes",t),this._blockInstance.subConfigValue("multipleMin",t),this._blockInstance.subConfigValue("multipleMax",t),this._blockInstance.subConfigValue("multiple",t),this._blockInstance.subConfigValue("imgOnly",t),this._blockInstance.subConfigValue("accept",t)}runFileValidators(e){let t=e!=null?e:this._uploadCollection.items();for(let i of t){let s=this._uploadCollection.read(i);s&&this._runFileValidatorsForEntry(s)}}runCollectionValidators(){let e=this._blockInstance.api.getOutputCollectionState(),t=[];for(let i of[...this._collectionValidators,...this._addCustomTypeToValidators(this._blockInstance.cfg.collectionValidators)])try{let s=i(e,this._blockInstance.api);if(!s)continue;s&&(t.push(s),s.message||console.warn(Ri.message))}catch(s){console.warn(Ri.collection,s)}this._blockInstance.$["*collectionErrors"]=t,t.length>0&&this._blockInstance.emit(k.COMMON_UPLOAD_FAILED,()=>this._blockInstance.api.getOutputCollectionState(),{debounce:!0})}_runFileValidatorsForEntry(e){let t=this._blockInstance.api.getOutputItem(e.uid),i=[];for(let s of[...this._fileValidators,...this._addCustomTypeToValidators(this._blockInstance.cfg.fileValidators)])try{let o=s(t,this._blockInstance.api);if(!o)continue;o&&(i.push(o),o.message||console.warn(Ri.message))}catch(o){console.warn(Ri.file,o)}e.setValue("errors",i)}_addCustomTypeToValidators(e){return e.map(t=>(...i)=>{let s=t(...i);return s?{...s,type:"CUSTOM_ERROR"}:void 0})}};a(Jr,"ValidationManager");var Di=Jr;var cn=Object.freeze({file:{type:File,value:null},externalUrl:{type:String,value:null},fileName:{type:String,value:null,nullable:!0},fileSize:{type:Number,value:null,nullable:!0},lastModified:{type:Number,value:Date.now()},uploadProgress:{type:Number,value:0},uuid:{type:String,value:null},isImage:{type:Boolean,value:!1},mimeType:{type:String,value:null,nullable:!0},ctxName:{type:String,value:null},cdnUrl:{type:String,value:null},cdnUrlModifiers:{type:String,value:null},fileInfo:{type:mt,value:null},isUploading:{type:Boolean,value:!1},abortController:{type:AbortController,value:null,nullable:!0},thumbUrl:{type:String,value:null,nullable:!0},silent:{type:Boolean,value:!1},source:{type:String,value:!1,nullable:!0},fullPath:{type:String,value:null,nullable:!0},metadata:{type:Object,value:null,nullable:!0},errors:{type:Array,value:[]},uploadError:{type:Error,value:null,nullable:!0},isRemoved:{type:Boolean,value:!1}});var Fi=class Fi extends _{constructor(){super(...arguments);h(this,"couldBeCtxOwner",!1);h(this,"isCtxOwner",!1);h(this,"init$",Ai(this));h(this,"_flushOutputItems",U(async()=>{if(this.getOutputData().length!==this.uploadCollection.size)return;let i=this.api.getOutputCollectionState();this.$["*collectionState"]=i,this.emit(k.CHANGE,()=>this.api.getOutputCollectionState(),{debounce:!0}),this.cfg.groupOutput&&i.totalCount>0&&i.status==="success"&&this._createGroup(i)},300));h(this,"_handleCollectionUpdate",a((t,i,s)=>{var o;(i.size||s.size)&&(this.$["*groupInfo"]=null),this.validationManager.runFileValidators(),this.validationManager.runCollectionValidators();for(let n of i)n.getValue("silent")||this.emit(k.FILE_ADDED,this.api.getOutputItem(n.uid));for(let n of s)this.$["*uploadTrigger"].delete(n.uid),(o=n.getValue("abortController"))==null||o.abort(),n.setMultipleValues({isRemoved:!0,abortController:null,isUploading:!1,uploadProgress:0}),URL.revokeObjectURL(n==null?void 0:n.getValue("thumbUrl")),this.emit(k.FILE_REMOVED,this.api.getOutputItem(n.uid));this.$["*uploadList"]=t.map(n=>({uid:n})),this._flushCommonUploadProgress(),this._flushOutputItems()},"_handleCollectionUpdate"));h(this,"_handleCollectionPropertiesUpdate",a(t=>{this._flushOutputItems();let i=this.uploadCollection,s=[...new Set(Object.entries(t).filter(([o])=>["uploadError","fileInfo"].includes(o)).map(([,o])=>[...o]).flat())];if(s.length>0&&setTimeout(()=>{this.validationManager.runFileValidators(s)}),t.uploadProgress){for(let o of t.uploadProgress){let{isUploading:n,silent:l}=T.getCtx(o).store;n&&!l&&this.emit(k.FILE_UPLOAD_PROGRESS,this.api.getOutputItem(o))}this._flushCommonUploadProgress()}if(t.isUploading)for(let o of t.isUploading){let{isUploading:n,silent:l}=T.getCtx(o).store;n&&!l&&this.emit(k.FILE_UPLOAD_START,this.api.getOutputItem(o))}if(t.fileInfo){for(let o of t.fileInfo){let{fileInfo:n,silent:l}=T.getCtx(o).store;n&&!l&&this.emit(k.FILE_UPLOAD_SUCCESS,this.api.getOutputItem(o))}this.cfg.cropPreset&&this.setInitialCrop()}if(t.errors){for(let l of t.errors){let{errors:c}=T.getCtx(l).store;c.length>0&&(this.emit(k.FILE_UPLOAD_FAILED,this.api.getOutputItem(l)),this.emit(k.COMMON_UPLOAD_FAILED,()=>this.api.getOutputCollectionState(),{debounce:!0}))}let o=i.findItems(l=>!!l.getValue("fileInfo")),n=i.findItems(l=>l.getValue("errors").length>0);i.size>0&&n.length===0&&i.size===o.length&&this.$["*collectionErrors"].length===0&&this.emit(k.COMMON_UPLOAD_SUCCESS,this.api.getOutputCollectionState())}t.cdnUrl&&([...t.cdnUrl].filter(n=>{var l;return!!((l=this.uploadCollection.read(n))!=null&&l.getValue("cdnUrl"))}).forEach(n=>{this.emit(k.FILE_URL_CHANGED,this.api.getOutputItem(n))}),this.$["*groupInfo"]=null)},"_handleCollectionPropertiesUpdate"));h(this,"_flushCommonUploadProgress",a(()=>{let t=0,s=[...this.$["*uploadTrigger"]].filter(n=>!!this.uploadCollection.read(n));s.forEach(n=>{let l=this.uploadCollection.readProp(n,"uploadProgress");t+=l});let o=s.length?Math.round(t/s.length):0;this.$["*commonProgress"]!==o&&(this.$["*commonProgress"]=o,this.emit(k.COMMON_UPLOAD_PROGRESS,this.api.getOutputCollectionState()))},"_flushCommonUploadProgress"))}get hasCtxOwner(){return this.hasBlockInCtx(t=>t instanceof Fi?t.isCtxOwner&&t.isConnected&&t!==this:!1)}initCallback(){if(super.initCallback(),!this.has("*uploadCollection")){let t=new Ui({typedSchema:cn,watchList:["uploadProgress","uploadError","fileInfo","errors","cdnUrl","isUploading"]});this.add("*uploadCollection",t)}this.has("*publicApi")||this.add("*publicApi",new Mi(this)),this.has("*validationManager")||this.add("*validationManager",new Di(this)),!this.hasCtxOwner&&this.couldBeCtxOwner&&this.initCtxOwner()}get validationManager(){if(!this.has("*validationManager"))throw new Error("Unexpected error: ValidationManager is not initialized");return this.$["*validationManager"]}get api(){if(!this.has("*publicApi"))throw new Error("Unexpected error: UploaderPublicApi is not initialized");return this.$["*publicApi"]}getAPI(){return this.api}get uploadCollection(){if(!this.has("*uploadCollection"))throw new Error("Unexpected error: TypedCollection is not initialized");return this.$["*uploadCollection"]}destroyCtxCallback(){var t,i;(t=this._unobserveCollectionProperties)==null||t.call(this),(i=this._unobserveCollection)==null||i.call(this),this.uploadCollection.destroy(),this.$["*uploadCollection"]=null,super.destroyCtxCallback()}initCtxOwner(){this.isCtxOwner=!0,this._unobserveCollection=this.uploadCollection.observeCollection(this._handleCollectionUpdate),this._unobserveCollectionProperties=this.uploadCollection.observeProperties(this._handleCollectionPropertiesUpdate),this.subConfigValue("maxConcurrentRequests",t=>{this.$["*uploadQueue"].concurrency=Number(t)||1}),this.$["*secureUploadsManager"]||(this.$["*secureUploadsManager"]=new Oi(this)),this.has("*modalActive")&&this.sub("*modalActive",t=>{t&&!this.$["*currentActivity"]&&(this.$["*modalActive"]=!1)})}async _createGroup(t){let i=await this.getUploadClientOptions(),s=t.allEntries.map(c=>c.uuid+(c.cdnUrlModifiers?`/${c.cdnUrlModifiers}`:"")),o=new AbortController,n=await ko(s,{...i,signal:o.signal});if(this.$["*collectionState"]!==t){o.abort();return}this.$["*groupInfo"]=n;let l=this.api.getOutputCollectionState();this.emit(k.GROUP_CREATED,l),this.emit(k.CHANGE,()=>this.api.getOutputCollectionState(),{debounce:!0}),this.$["*collectionState"]=l}setInitialCrop(){let t=Ii(this.cfg.cropPreset);if(t){let[i]=t,s=this.uploadCollection.findItems(o=>{var n;return o.getValue("fileInfo")&&o.getValue("isImage")&&!((n=o.getValue("cdnUrlModifiers"))!=null&&n.includes("/crop/"))}).map(o=>this.uploadCollection.read(o));for(let o of s){let n=o.getValue("fileInfo"),{width:l,height:c}=n.imageInfo,u=i.width/i.height,d=Ko(l,c,u),p=N(`crop/${d.width}x${d.height}/${d.x},${d.y}`,"preview");o.setMultipleValues({cdnUrlModifiers:p,cdnUrl:P(o.getValue("cdnUrl"),p)}),this.uploadCollection.size===1&&this.cfg.useCloudImageEditor&&this.hasBlockInCtx(f=>f.activityType===_.activities.CLOUD_IMG_EDIT)&&(this.$["*currentActivityParams"]={internalId:o.uid},this.$["*currentActivity"]=_.activities.CLOUD_IMG_EDIT)}}}async getMetadataFor(t){let i=this.cfg.metadata||void 0;if(typeof i=="function"){let s=this.api.getOutputItem(t);return await i(s)}return i}async getUploadClientOptions(){let i=await this.$["*secureUploadsManager"].getSecureToken().catch(()=>null);return{store:this.cfg.store,publicKey:this.cfg.pubkey,baseCDN:this.cfg.cdnCname,baseURL:this.cfg.baseUrl,userAgent:Zo,integration:this.cfg.userAgentIntegration,secureSignature:i==null?void 0:i.secureSignature,secureExpire:i==null?void 0:i.secureExpire,retryThrottledRequestMaxTimes:this.cfg.retryThrottledRequestMaxTimes,multipartMinFileSize:this.cfg.multipartMinFileSize,multipartChunkSize:this.cfg.multipartChunkSize,maxConcurrentRequests:this.cfg.multipartMaxConcurrentRequests,multipartMaxAttempts:this.cfg.multipartMaxAttempts,checkForUrlDuplicates:!!this.cfg.checkForUrlDuplicates,saveUrlForRecurrentUploads:!!this.cfg.saveUrlForRecurrentUploads}}getOutputData(){return this.uploadCollection.items().map(s=>this.api.getOutputItem(s))}};a(Fi,"UploaderBlock");var $=Fi;$.extSrcList=Object.freeze({...Pt});$.sourceTypes=Object.freeze({...L});var qt=a(r=>{var e;return(e=r.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g))==null?void 0:e.map(t=>t.toLowerCase()).join("-")},"toKebabCase");var D=a(r=>String(r),"asString"),tt=a(r=>{let e=Number(r);if(Number.isNaN(e))throw new Error(`Invalid number: "${r}"`);return e},"asNumber"),I=a(r=>{if(typeof r=="undefined"||r===null)return!1;if(typeof r=="boolean")return r;if(r==="true"||r==="")return!0;if(r==="false")return!1;throw new Error(`Invalid boolean: "${r}"`)},"asBoolean"),Xl=a(r=>r==="auto"?r:I(r),"asStore"),ql=a(r=>{let e=D(r);if(e!=="user"&&e!=="environment"&&e!=="")throw new Error(`Invalid "cameraCapture" value: "${e}"`);return e},"asCameraCapture"),Kl=a(r=>{if(typeof r=="object"&&!Array.isArray(r)||typeof r=="function")return r;throw new Error("Invalid metadata value. Must be an object or function.")},"asMetadata"),Zl=a(r=>{if(typeof r=="object")return r;throw new Error("Invalid value. Must be an object.")},"asObject"),Qr=a(r=>{if(typeof r=="function")return r;throw new Error("Invalid value. Must be a function.")},"asFunction"),un=a(r=>{if(Array.isArray(r))return r;throw new Error("Must be an array.")},"asArray"),Yl={pubkey:D,multiple:I,multipleMin:tt,multipleMax:tt,confirmUpload:I,imgOnly:I,accept:D,externalSourcesPreferredTypes:D,store:Xl,cameraMirror:I,cameraCapture:ql,sourceList:D,maxLocalFileSizeBytes:tt,thumbSize:tt,showEmptyList:I,useLocalImageEditor:I,useCloudImageEditor:I,cloudImageEditorTabs:D,removeCopyright:I,cropPreset:D,imageShrink:D,modalScrollLock:I,modalBackdropStrokes:I,sourceListWrap:I,remoteTabSessionKey:D,cdnCname:D,baseUrl:D,socialBaseUrl:D,secureSignature:D,secureExpire:D,secureDeliveryProxy:D,retryThrottledRequestMaxTimes:tt,multipartMinFileSize:tt,multipartChunkSize:tt,maxConcurrentRequests:tt,multipartMaxConcurrentRequests:tt,multipartMaxAttempts:tt,checkForUrlDuplicates:I,saveUrlForRecurrentUploads:I,groupOutput:I,userAgentIntegration:D,debug:I,localeName:D,metadata:Kl,secureUploadsExpireThreshold:tt,localeDefinitionOverride:Zl,secureUploadsSignatureResolver:Qr,secureDeliveryProxyUrlResolver:Qr,iconHrefResolver:Qr,fileValidators:un,collectionValidators:un},hn=a((r,e)=>{if(!(typeof e=="undefined"||e===null))try{return Yl[r](e)}catch(t){return console.error(`Invalid value for config key "${r}".`,t),Q[r]}},"normalizeConfigValue");var ts=[...new Set(["debug",...Object.keys(Q)])],Jl=["metadata","localeDefinitionOverride","secureUploadsSignatureResolver","secureDeliveryProxyUrlResolver","iconHrefResolver","fileValidators","collectionValidators"],Ql=a(r=>Jl.includes(r),"isComplexKey"),Kt=ts.filter(r=>!Ql(r)),tc={...Object.fromEntries(Kt.map(r=>[qt(r),r])),...Object.fromEntries(Kt.map(r=>[r.toLowerCase(),r]))},ec={...Object.fromEntries(Kt.map(r=>[qt(r),X(r)])),...Object.fromEntries(Kt.map(r=>[r.toLowerCase(),X(r)]))},dn=a(r=>"__"+r,"getLocalPropName"),es=class es extends y{constructor(){super();h(this,"requireCtxName",!0);this.init$={...this.init$,...Object.fromEntries(Object.entries(Q).map(([t,i])=>[X(t),i]))}}_flushValueToAttribute(t,i){if(Kt.includes(t)){let s=[...new Set([qt(t),t.toLowerCase()])];for(let o of s)typeof i=="undefined"||i===null?this.removeAttribute(o):this.getAttribute(o)!==i.toString()&&this.setAttribute(o,i.toString())}}_flushValueToState(t,i){this.$[X(t)]!==i&&(typeof i=="undefined"||i===null?this.$[X(t)]=Q[t]:this.$[X(t)]=i)}_setValue(t,i){let s=this,o=hn(t,i),n=dn(t);s[n]!==o&&(this._assertSameValueDifferentReference(t,s[n],o),s[n]=o,this._flushValueToAttribute(t,o),this._flushValueToState(t,o),this.debugPrint(`[uc-config] "${t}"`,o))}_getValue(t){let i=this,s=dn(t);return i[s]}_assertSameValueDifferentReference(t,i,s){this.cfg.debug&&s!==i&&typeof s=="object"&&typeof i=="object"&&JSON.stringify(s)===JSON.stringify(i)&&(console.warn(`[uc-config] Option "${t}" value is the same as the previous one but the reference is different`),console.warn("[uc-config] You should avoid changing the reference of the object to prevent unnecessary calculations"),console.warn(`[uc-config] "${t}" previous value:`,i),console.warn(`[uc-config] "${t}" new value:`,s))}initCallback(){var i;super.initCallback();let t=this;for(let s of Kt)this.sub(X(s),o=>{this._setValue(s,o)},!1);for(let s of ts){let o=(i=t[s])!=null?i:this.$[X(s)];o!==Q[s]&&this._setValue(s,o),Object.defineProperty(this,s,{set:n=>{this._setValue(s,n)},get:()=>this._getValue(s)})}}attributeChangedCallback(t,i,s){if(i===s)return;let o=this,n=tc[t];o[n]=s}};a(es,"ConfigClass");var Me=es;Me.bindAttributes(ec);for(let r of ts)Me.prototype[r]=void 0;var pn=Me;var is=class is extends y{constructor(){super(),this.init$={...this.init$,name:"",href:""}}initCallback(){super.initCallback(),this.sub("name",e=>{if(!e)return;let t=`#uc-icon-${e}`;this.subConfigValue("iconHrefResolver",i=>{if(i){let s=i(e);t=s!=null?s:t}this.$.href=t})})}};a(is,"Icon");var Zt=is;Zt.template=`<svg ref="svg" xmlns="http://www.w3.org/2000/svg"><use set="@href: href;"></use></svg>`;Zt.bindAttributes({name:"name"});var fn=a(r=>[...new Set(r)],"uniqueArray");var mn=a(r=>Object.entries(r).filter(([e,t])=>t!==void 0&&t!=="").map(([e,t])=>e==="cdn-operations"||e==="analytics"?t:`${e}/${t}`),"parseObjectToString");var ic="https://ucarecdn.com",Re=Object.freeze({"dev-mode":{},pubkey:{},uuid:{},src:{},lazy:{default:1},intersection:{},breakpoints:{},"cdn-cname":{default:ic},"proxy-cname":{},"secure-delivery-proxy":{},"hi-res-support":{default:1},"ultra-res-support":{},format:{},"cdn-operations":{},progressive:{},quality:{},"is-background-for":{},"is-preview-blur":{default:1}});var Yt="--uc-img-",rs="unresolved";var ss=!window.location.host.trim()||window.location.host.includes(":")||window.location.hostname.includes("localhost"),os=3e3,ns=5e3,as=Object.freeze({PREVIEW:"PREVIEW",MAIN:"MAIN"});var bn=Object.create(null),gn;for(let r in Re)bn[Yt+r]=((gn=Re[r])==null?void 0:gn.default)||"";var ls=class ls extends kt{constructor(){super(...arguments);h(this,"cssInit$",bn)}$$(t){return this.$[Yt+t]}set$$(t){for(let i in t)this.$[Yt+i]=t[i]}sub$$(t,i){this.sub(Yt+t,s=>{s===null||s===""||i(s)})}analyticsParams(){return`-/@clib/${Lt}/${Ut}/uc-img/`}initAttributes(t){[...this.attributes].forEach(i=>{Re[i.name]||t.setAttribute(i.name,i.value)})}initIntersection(t,i){let s={root:null,rootMargin:"0px"};this._isnObserver=new IntersectionObserver(o=>{o.forEach(n=>{n.isIntersecting&&(i(),this._isnObserver.unobserve(t))})},s),this._isnObserver.observe(t),this._observed||(this._observed=new Set),this._observed.add(t)}destroyCallback(){super.destroyCallback(),this._isnObserver&&(this._observed.forEach(t=>{this._isnObserver.unobserve(t)}),this._isnObserver=null),T.deleteCtx(this)}static get observedAttributes(){return Object.keys(Re)}attributeChangedCallback(t,i,s){window.setTimeout(()=>{this.$[Yt+t]=s})}};a(ls,"ImgConfig");var Ni=ls;var cs=class cs extends Ni{constructor(){super(...arguments);h(this,"_img",new Image);h(this,"_imgPreview",new Image)}_fmtAbs(t){return!t.includes("//")&&!ss&&(t=new URL(t,document.baseURI).href),t}_validateSize(t){if((t==null?void 0:t.trim())!==""){let i=t.match(/\d+/)[0],s=t.match(/[a-zA-Z]+/)[0],o=parseInt(i,10);if(Number(o)>ns&&this.hasFormatJPG)return ns+s;if(Number(o)>os&&!this.hasFormatJPG)return os+s}return t}_getCdnModifiers(t,i){let s={format:this.$$("format"),quality:this.$$("quality"),resize:this._validateSize(t),blur:i,"cdn-operations":this.$$("cdn-operations"),analytics:this.analyticsParams()};return N(...mn(s))}_getUrlBase(t="",i=""){if(this.$$("src").startsWith("data:")||this.$$("src").startsWith("blob:"))return this.$$("src");if(ss&&this.$$("src")&&!this.$$("src").includes("//"))return this._proxyUrl(this.$$("src"));let s=this._getCdnModifiers(t,i);if(this.$$("src").startsWith(this.$$("cdn-cname")))return P(this.$$("src"),s);if(this.$$("cdn-cname")&&this.$$("uuid"))return this._proxyUrl(P(vt(this.$$("cdn-cname"),this.$$("uuid")),s));if(this.$$("uuid"))return this._proxyUrl(P(vt(this.$$("cdn-cname"),this.$$("uuid")),s));if(this.$$("proxy-cname"))return this._proxyUrl(P(this.$$("proxy-cname"),s,this._fmtAbs(this.$$("src"))));if(this.$$("pubkey"))return this._proxyUrl(P(`https://${this.$$("pubkey")}.ucr.io/`,s,this._fmtAbs(this.$$("src"))))}_proxyUrl(t){return this.$$("secure-delivery-proxy")?Te(this.$$("secure-delivery-proxy"),{previewUrl:t},{transform:s=>window.encodeURIComponent(s)}):t}_getElSize(t,i=1,s=!0){let o=t.getBoundingClientRect(),n=i*Math.round(o.width),l=s?"":i*Math.round(o.height);return n||l?`${n||""}x${l||""}`:null}_setupEventProxy(t){let i=a(o=>{o.stopPropagation();let n=new Event(o.type,o);this.dispatchEvent(n)},"proxifyEvent"),s=["load","error"];for(let o of s)t.addEventListener(o,i)}get img(){return this.hasPreviewImage||(this._setupConfigForImage({elNode:this._img}),this.appendChild(this._img)),this._img}get currentImg(){return this.hasPreviewImage?{type:as.PREVIEW,img:this._imgPreview}:{type:as.MAIN,img:this.img}}get hasPreviewImage(){return this.$$("is-preview-blur")}get bgSelector(){return this.$$("is-background-for")}get breakpoints(){if(this.$$("breakpoints")){let t=z(this.$$("breakpoints"));return fn(t.map(i=>parseInt(i,10)))}else return null}get hasFormatJPG(){return this.$$("format").toLowerCase()==="jpeg"}renderBg(t){let i=new Set;i.add(`url("${this._getUrlBase(this._getElSize(t))}") 1x`),this.$$("hi-res-support")&&i.add(`url("${this._getUrlBase(this._getElSize(t,2))}") ${2}x`),this.$$("ultra-res-support")&&i.add(`url("${this._getUrlBase(this._getElSize(t,3))}") ${3}x`);let s=`image-set(${[...i].join(", ")})`;t.style.setProperty("background-image",s),t.style.setProperty("background-image","-webkit-"+s)}getSrcset(){let t=new Set;return this.breakpoints?this.breakpoints.forEach(i=>{t.add(this._getUrlBase(i+"x")+` ${this._validateSize(i+"w")}`),this.$$("hi-res-support")&&t.add(this._getUrlBase(i*2+"x")+` ${this._validateSize(i*2+"w")}`),this.$$("ultra-res-support")&&t.add(this._getUrlBase(i*3+"x")+` ${this._validateSize(i*3+"w")}`)}):(t.add(this._getUrlBase(this._getElSize(this.currentImg.img))+" 1x"),this.$$("hi-res-support")&&t.add(this._getUrlBase(this._getElSize(this.currentImg.img,2))+" 2x"),this.$$("ultra-res-support")&&t.add(this._getUrlBase(this._getElSize(this.currentImg.img,3))+" 3x")),[...t].join()}getSrc(){return this._getUrlBase()}get srcUrlPreview(){return this._getUrlBase("100x","100")}renderBackground(){[...document.querySelectorAll(this.bgSelector)].forEach(t=>{this.$$("intersection")?this.initIntersection(t,()=>{this.renderBg(t)}):this.renderBg(t)})}_appendURL({elNode:t,src:i,srcset:s}){i&&(t.src=i),s&&(t.srcset=s)}_setupConfigForImage({elNode:t}){this._setupEventProxy(t),this.initAttributes(t)}loaderImage({src:t,srcset:i,elNode:s}){return new Promise((o,n)=>{this._setupConfigForImage({elNode:s}),s.setAttribute(rs,""),s.addEventListener("load",()=>{s.removeAttribute(rs),o(s)}),s.addEventListener("error",()=>{n(!1)}),this._appendURL({elNode:s,src:t,srcset:i})})}async renderImage(){var t,i;if(this.$$("intersection")){this.hasPreviewImage&&(this._setupConfigForImage({elNode:this._imgPreview}),this.appendChild(this._imgPreview)),this.initIntersection(this.currentImg.img,async()=>{var s;this.hasPreviewImage&&(this._imgPreview.src=this.srcUrlPreview);try{await this.loaderImage({src:this.getSrc(),srcset:this.getSrcset(),elNode:this._img}),this.hasPreviewImage&&await this._imgPreview.remove(),this.appendChild(this._img)}catch{this.hasPreviewImage&&await((s=this._imgPreview)==null?void 0:s.remove()),this.appendChild(this._img)}});return}try{this.hasPreviewImage&&(await this.loaderImage({src:this.srcUrlPreview,elNode:this._imgPreview}),this.appendChild(this._imgPreview)),await this.loaderImage({src:this.getSrc(),srcset:this.getSrcset(),elNode:this._img}),this.hasPreviewImage&&await((t=this._imgPreview)==null?void 0:t.remove()),this.appendChild(this._img)}catch{this.hasPreviewImage&&await((i=this._imgPreview)==null?void 0:i.remove()),this.appendChild(this._img)}}init(){this.bgSelector?this.renderBackground():this.renderImage()}};a(cs,"ImgBase");var Bi=cs;var us=class us extends Bi{initCallback(){super.initCallback(),this.sub$$("src",()=>{this.init()}),this.sub$$("uuid",()=>{this.init()}),this.sub$$("lazy",e=>{!this.$$("is-background-for")&&!this.$$("is-preview-blur")&&(this.img.loading=e?"lazy":"eager")})}};a(us,"Img");var ji=us;var Jt=class Jt extends ${constructor(){super();h(this,"couldBeCtxOwner",!0);this.init$={...this.init$,withDropZone:!0,onClick:()=>{this.api.initFlow()},"button-text":""}}initCallback(){super.initCallback(),this.defineAccessor("dropzone",t=>{typeof t!="undefined"&&(this.$.withDropZone=I(t))}),this.subConfigValue("multiple",t=>{this.$["button-text"]=t?"upload-files":"upload-file"})}};a(Jt,"SimpleBtn"),h(Jt,"styleAttrs",[...H(Jt,Jt,"styleAttrs"),"uc-simple-btn"]);var Qt=Jt;Qt.template=`<uc-drop-area set="@disabled: !withDropZone"><button type="button" set="onclick: onClick"><uc-icon name="upload"></uc-icon><span l10n="button-text"></span><slot></slot><div class="uc-visual-drop-area" l10n="drop-files-here"></div></button></uc-drop-area>`;Qt.bindAttributes({dropzone:null});var hs=class hs extends _{constructor(){super(...arguments);h(this,"historyTracked",!0);h(this,"activityType","start-from")}initCallback(){super.initCallback(),this.registerActivity(this.activityType)}};a(hs,"StartFrom");var De=hs;De.template='<div class="uc-content"><slot></slot></div>';function rc(r){return new Promise(e=>{typeof window.FileReader!="function"&&e(!1);try{let t=new FileReader;t.onerror=()=>{e(!0)};let i=a(s=>{s.type!=="loadend"&&t.abort(),e(!1)},"onLoad");t.onloadend=i,t.onprogress=i,t.readAsDataURL(r)}catch{e(!1)}})}a(rc,"checkIsDirectory");function sc(r,e){return new Promise(t=>{let i=0,s=[],o=a(l=>{l||(console.warn("Unexpectedly received empty content entry",{scope:"drag-and-drop"}),t(null)),l.isFile?(i++,l.file(c=>{i--;let u=new File([c],c.name,{type:c.type||e});s.push({type:"file",file:u,fullPath:l.fullPath}),i===0&&t(s)})):l.isDirectory&&n(l.createReader())},"readEntry"),n=a(l=>{i++,l.readEntries(c=>{i--;for(let u of c)o(u);i===0&&t(s)})},"readReaderContent");o(r)})}a(sc,"readEntryContentAsync");function _n(r){let e=[],t=[];for(let i=0;i<r.items.length;i++){let s=r.items[i];if(s)if(s.kind==="file"){let o=s.type;if(typeof s.webkitGetAsEntry=="function"||typeof s.getAsEntry=="function"){let l=typeof s.webkitGetAsEntry=="function"?s.webkitGetAsEntry():s.getAsEntry();t.push(sc(l,o).then(c=>{c&&e.push(...c)}));continue}let n=s.getAsFile();n&&t.push(rc(n).then(l=>{l||e.push({type:"file",file:n})}))}else s.kind==="string"&&s.type.match("^text/uri-list")&&t.push(new Promise(o=>{s.getAsString(n=>{e.push({type:"url",url:n}),o(void 0)})}))}return Promise.all(t).then(()=>e)}a(_n,"getDropItems");var B={ACTIVE:0,INACTIVE:1,NEAR:2,OVER:3},yn=["focus"],oc=100,ds=new Map;function nc(r,e){let t=Math.max(Math.min(r[0],e.x+e.width),e.x),i=Math.max(Math.min(r[1],e.y+e.height),e.y);return Math.sqrt((r[0]-t)*(r[0]-t)+(r[1]-i)*(r[1]-i))}a(nc,"distance");function ps(r){let e=0,t=document.body,i=new Set,s=a(g=>i.add(g),"handleSwitch"),o=B.INACTIVE,n=a(g=>{r.shouldIgnore()&&g!==B.INACTIVE||(o!==g&&i.forEach(b=>b(g)),o=g)},"setState"),l=a(()=>e>0,"isDragging");s(g=>r.onChange(g));let c=a(()=>{e=0,n(B.INACTIVE)},"onResetEvent"),u=a(()=>{e+=1,o===B.INACTIVE&&n(B.ACTIVE)},"onDragEnter"),d=a(()=>{e-=1,l()||n(B.INACTIVE)},"onDragLeave"),p=a(g=>{g.preventDefault(),e=0,n(B.INACTIVE)},"onDrop"),f=a(g=>{if(r.shouldIgnore())return;l()||(e+=1);let b=[g.x,g.y],w=r.element.getBoundingClientRect(),C=Math.floor(nc(b,w)),v=C<oc,x=g.composedPath().includes(r.element);ds.set(r.element,C);let M=Math.min(...ds.values())===C;x&&M?(g.preventDefault(),n(B.OVER)):n(v&&M?B.NEAR:B.ACTIVE)},"onDragOver"),m=a(async g=>{if(r.shouldIgnore())return;g.preventDefault();let b=await _n(g.dataTransfer);r.onItems(b),n(B.INACTIVE)},"onElementDrop");return t.addEventListener("drop",p),t.addEventListener("dragleave",d),t.addEventListener("dragenter",u),t.addEventListener("dragover",f),r.element.addEventListener("drop",m),yn.forEach(g=>{window.addEventListener(g,c)}),()=>{ds.delete(r.element),t.removeEventListener("drop",p),t.removeEventListener("dragleave",d),t.removeEventListener("dragenter",u),t.removeEventListener("dragover",f),r.element.removeEventListener("drop",m),yn.forEach(g=>{window.removeEventListener(g,c)})}}a(ps,"addDropzone");var vn="uc-drop-area",te=`${vn}/registry`,ee=class ee extends ${constructor(){super(),this.init$={...this.init$,state:B.INACTIVE,withIcon:!1,isClickable:!1,isFullscreen:!1,isEnabled:!0,isVisible:!0,text:"",[te]:null}}isActive(){if(!this.$.isEnabled)return!1;let e=this.getBoundingClientRect(),t=e.width>0&&e.height>0,i=e.top>=0&&e.left>=0&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth),s=window.getComputedStyle(this),o=s.visibility!=="hidden"&&s.display!=="none";return t&&o&&i}initCallback(){super.initCallback(),this.bindL10n("text",()=>this.l10n("drop-files-here")),this.$[te]||(this.$[te]=new Set),this.$[te].add(this),this.defineAccessor("disabled",t=>{this.set$({isEnabled:!I(t)})}),this.defineAccessor("clickable",t=>{this.set$({isClickable:I(t)})}),this.defineAccessor("with-icon",t=>{this.set$({withIcon:I(t)})}),this.defineAccessor("fullscreen",t=>{this.set$({isFullscreen:I(t)})}),this.defineAccessor("text",t=>{typeof t=="string"?this.bindL10n("text",()=>this.l10n(t)||t):this.bindL10n("text",()=>this.l10n("drop-files-here"))}),this._destroyDropzone=ps({element:this,shouldIgnore:()=>this._shouldIgnore(),onChange:t=>{this.$.state=t},onItems:t=>{t.length&&(t.forEach(i=>{i.type==="url"?this.api.addFileFromUrl(i.url,{source:L.DROP_AREA}):i.type==="file"&&this.api.addFileFromObject(i.file,{source:L.DROP_AREA,fullPath:i.fullPath})}),this.uploadCollection.size&&(this.set$({"*currentActivity":_.activities.UPLOAD_LIST}),this.setOrAddState("*modalActive",!0)))}});let e=this.ref["content-wrapper"];e&&(this._destroyContentWrapperDropzone=ps({element:e,onChange:t=>{var s;let i=(s=Object.entries(B).find(([,o])=>o===t))==null?void 0:s[0].toLowerCase();i&&e.setAttribute("drag-state",i)},onItems:()=>{},shouldIgnore:()=>this._shouldIgnore()})),this.sub("state",t=>{var s;let i=(s=Object.entries(B).find(([,o])=>o===t))==null?void 0:s[0].toLowerCase();i&&this.setAttribute("drag-state",i)}),this.subConfigValue("sourceList",t=>{let i=z(t);this.$.isEnabled=i.includes(L.LOCAL),this.$.isVisible=this.$.isEnabled||!this.querySelector("[data-default-slot]")}),this.sub("isVisible",t=>{this.toggleAttribute("hidden",!t)}),this.sub("isClickable",t=>{this.toggleAttribute("clickable",t)}),this.$.isClickable&&(this._onAreaClicked=t=>{t.type==="keydown"?(t.code==="Space"||t.code==="Enter")&&this.api.openSystemDialog():t.type==="click"&&this.api.openSystemDialog()},this.addEventListener("keydown",this._onAreaClicked),this.addEventListener("click",this._onAreaClicked))}_shouldIgnore(){return!this.$.isEnabled||!this._couldHandleFiles()?!0:this.$.isFullscreen?[...this.$[te]].filter(i=>i!==this).filter(i=>i.isActive()).length>0:!1}_couldHandleFiles(){let e=this.cfg.multiple,t=this.cfg.multipleMax,i=this.uploadCollection.size;return!(e&&t&&i>=t||!e&&i>0)}destroyCallback(){var t,i;super.destroyCallback();let e=this.$[te];e&&(e.delete(this),e.size===0&&T.deleteCtx(vn)),(t=this._destroyDropzone)==null||t.call(this),(i=this._destroyContentWrapperDropzone)==null||i.call(this),this._onAreaClicked&&(this.removeEventListener("keydown",this._onAreaClicked),this.removeEventListener("click",this._onAreaClicked))}};a(ee,"DropArea"),h(ee,"styleAttrs",[...H(ee,ee,"styleAttrs"),"uc-drop-area"]);var ie=ee;ie.template=`<slot><div data-default-slot hidden></div><div ref="content-wrapper" class="uc-content-wrapper" set="@hidden: !isVisible"><div class="uc-icon-container" set="@hidden: !withIcon"><uc-icon name="default"></uc-icon><uc-icon name="arrow-down"></uc-icon></div><span class="uc-text">{{text}}</span></div></slot>`;ie.bindAttributes({"with-icon":null,clickable:null,text:null,fullscreen:null,disabled:null});var ac="src-type-",fs=class fs extends ${constructor(){super();h(this,"couldBeCtxOwner",!0);h(this,"type");h(this,"_registeredTypes",{});this.init$={...this.init$,iconName:"default","src-type":""}}initTypes(){this.registerType({type:L.LOCAL,activate:()=>(this.api.openSystemDialog(),!1)}),this.registerType({type:L.URL,activity:_.activities.URL,textKey:"from-url"}),this.registerType({type:L.CAMERA,activity:_.activities.CAMERA,activate:()=>{let t="capture"in document.createElement("input");return t&&this.api.openSystemDialog({captureCamera:!0}),!t}}),this.registerType({type:"draw",activity:_.activities.DRAW,icon:"edit-draw"});for(let t of Object.values(Pt))this.registerType({type:t,activity:_.activities.EXTERNAL,activityParams:{externalSourceType:t}})}initCallback(){super.initCallback(),this.initTypes(),this.defineAccessor("type",t=>{t&&this.applyType(t)})}registerType(t){this._registeredTypes[t.type]=t}getType(t){return this._registeredTypes[t]}activate(){if(!this.type)return;let t=this._registeredTypes[this.type],{activity:i,activate:s,activityParams:o={}}=t;(s?s():!!i)&&this.set$({"*currentActivityParams":o,"*currentActivity":i})}applyType(t){let i=this._registeredTypes[t];if(!i){console.warn("Unsupported source type: "+t);return}let{textKey:s=t,icon:o=t}=i;this.$["src-type"]=`${ac}${s}`,this.$.iconName=o,this.onclick=()=>{this.activate()}}};a(fs,"SourceBtn");var re=fs;re.template=`<button type="button"><uc-icon set="@name: iconName"></uc-icon><div class="uc-txt" l10n="src-type"></div></button>`;re.bindAttributes({type:null});var ms=class ms extends y{initCallback(){super.initCallback(),this.subConfigValue("sourceList",e=>{let t=z(e),i="";t.forEach(s=>{i+=`<uc-source-btn type="${s}"></uc-source-btn>`}),this.cfg.sourceListWrap?this.innerHTML=i:this.outerHTML=i})}};a(ms,"SourceList");var Hi=ms;var Wi=a(()=>{let r=[];return{stack:r,promiseReadJpegChunks:a(t=>new Promise((i,s)=>{let o=2,n=a((u,d)=>{let p=new FileReader;p.addEventListener("load",()=>{d(new DataView(p.result))}),p.addEventListener("error",f=>{s(`Reader error: ${f}`)}),p.readAsArrayBuffer(u)},"readToView"),l=a(()=>n(t.slice(o,o+128),u=>{let d,p,f;for(d=p=0,f=u.byteLength;f>=0?p<f:p>f;d=f>=0?++p:--p)if(u.getUint8(d)===255){o+=d;break}c()}),"readNext"),c=a(()=>{let u=o;return n(t.slice(o,o+=4),d=>{if(d.byteLength!==4||d.getUint8(0)!==255){s("Corrupted");return}let p=d.getUint8(1);if(p===218){i(!0);return}let f=d.getUint16(2)-2;return n(t.slice(o,o+=f),m=>{if(m.byteLength!==f){s("Corrupted");return}r.push({startPos:u,length:f,marker:p,view:m}),l()})})},"readNextChunk");FileReader&&DataView||s("Not Support"),n(t.slice(0,2),u=>{u.getUint16(0)!==65496&&s("Not jpeg"),l()})}),"promiseReadJpegChunks")}},"readJpegChunks"),lc=a(async r=>{let e=[],{promiseReadJpegChunks:t,stack:i}=Wi();return await t(r),i.forEach(({marker:s,view:o})=>{s===226&&o.getUint32(0)===1229144927&&o.getUint32(4)===1347571526&&o.getUint32(8)===1229735168&&e.push(o)}),e},"getIccProfile"),Cn=a(async(r,e,t)=>{{let i=[],s=[],{promiseReadJpegChunks:o,stack:n}=Wi();await o(r),n.forEach(u=>{if(u.marker===e)return i.push(u.startPos),s.push(u.length)});let l=[r.slice(0,2)];for(let u of t){let d=new DataView(new ArrayBuffer(4));d.setUint16(0,65280+e),d.setUint16(2,u.byteLength+2),l.push(d.buffer),l.push(u)}let c=2;for(let u=0;u<i.length;u++)i[u]>c&&l.push(r.slice(c,i[u])),c=i[u]+s[u]+4;return l.push(r.slice(c,r.size)),new Blob(l,{type:r.type})}},"replaceJpegChunk"),cc=226,xn=a((r,e)=>Cn(r,cc,e.map(t=>t.buffer)),"replaceIccProfile"),uc=a(async r=>{try{return await xn(r,[])}catch(e){throw new Error(`Failed to strip ICC profile: ${e}`)}},"stripIccProfile"),hc=a((r,e,t)=>new Promise((i,s)=>{let o=a(n=>{if(!n){s("Failed to convert canvas to blob");return}i(n)},"callback");r.toBlob(o,e,t),r.width=r.height=1}),"canvasToBlob"),Fe=a(()=>{let r=document.createElement("canvas"),e=r.getContext("2d");return{canvas:r,ctx:e}},"createCanvas"),dc=a(r=>{let{ctx:t,canvas:i}=Fe();i.width=i.height=50,t.drawImage(r,0,0,50,50);let s=t.getImageData(0,0,50,50).data;i.width=i.height=1;for(let o=3;o<s.length;o+=4)if(s[o]<254)return!0;return!1},"hasTransparency"),pc=a(async r=>{let e=null,{promiseReadJpegChunks:t,stack:i}=Wi();return await t(r),i.forEach(({marker:s,view:o})=>{if(!e&&s===225&&o.byteLength>=14&&o.getUint32(0)===1165519206&&o.getUint16(4)===0){e=o;return}}),e},"getExif"),fc="data:image/jpg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/4QA6RXhpZgAATU0AKgAAAAgAAwESAAMAAAABAAYAAAEoAAMAAAABAAIAAAITAAMAAAABAAEAAAAAAAD/2wBDAP//////////////////////////////////////////////////////////////////////////////////////wAALCAABAAIBASIA/8QAJgABAAAAAAAAAAAAAAAAAAAAAxABAAAAAAAAAAAAAAAAAAAAAP/aAAgBAQAAPwBH/9k=",Gi,mc=a(()=>new Promise(r=>{if(Gi!==void 0)r(Gi);else{let e=new Image;e.addEventListener("load",()=>{Gi=e.naturalWidth<e.naturalHeight,e.src="//:0",r(Gi)}),e.src=fc}}),"isBrowserApplyExifOrientation"),gc=a((r,e)=>{let t,i,s,o;if(!r||r.byteLength<14||r.getUint32(0)!==1165519206||r.getUint16(4)!==0)return;if(r.getUint16(6)===18761)i=!0;else if(r.getUint16(6)===19789)i=!1;else return;if(r.getUint16(8,i)!==42)return;s=8+r.getUint32(10,i);let n=r.getUint16(s-2,i);for(t=0,o=n;o>=0?t<o:t>o;o>=0?++t:--t){if(r.byteLength<s+10)return;r.getUint16(s,i)===274&&e(s+8,i),s+=12}},"findExifOrientation"),bc=a((r,e)=>{gc(r,(t,i)=>r.setUint16(t,e,i))},"setExifOrientation"),_c=a(async(r,e,t)=>(t&&bc(e,1),Cn(r,225,[e.buffer])),"replaceExif"),yc=a((r,e)=>new Promise((t,i)=>{e&&(r.src=e),r.complete?t(r):(r.addEventListener("load",()=>{t(r)}),r.addEventListener("error",()=>{i(new Error("Failed to load image. Probably not an image."))}))}),"processImage"),vc=a(r=>yc(new Image,r),"imageLoader"),wc=[1,3],Cc=[192,193,194,195,197,198,199,201,202,203,205,206,207],wn={squareSide:[Math.floor(Math.sqrt(5*1e3*1e3)),4096,8192,11180,10836,11402,14188,16384],dimension:[4096,8192,16384,32767,65535]},xc=a(async r=>{let e=!1,{promiseReadJpegChunks:t,stack:i}=Wi();return await t(r).then(()=>(i.forEach(({marker:s,view:o})=>{if(!e&&Cc.indexOf(s)>=0){let n=o.getUint8(5);wc.indexOf(n)<0&&(e=!0)}}),e)).catch(()=>e)},"shouldSkipShrink"),An=a((r,e)=>{let t={};return(...i)=>{let s=e(i,t);return s in t?t[s]:t[s]=r(...i)}},"memoize"),En=a((r,e)=>{let[t]=r,i=Object.keys(e).map(s=>parseInt(s,10)).sort((s,o)=>s-o);for(let s=0;s<i.length;s++){let o=i[s],n=!!e[o];if(o>t&&n||o<t&&!n)return o}return t},"memoKeySerializer"),Tt={R:55,G:110,B:165,A:255},Ac=`rgba(${Tt.R}, ${Tt.G}, ${Tt.B}, ${Tt.A/255})`,Tn=a((r,e)=>{try{let t=[r-1,e-1,1,1],{canvas:i,ctx:s}=Fe();i.width=1,i.height=1;let{canvas:o,ctx:n}=Fe();o.width=r,o.height=e,n&&(n.fillStyle=Ac,n.fillRect(...t),s.drawImage(o,r-1,e-1,1,1,0,0,1,1));let l=s&&s.getImageData(0,0,1,1).data,c=!1;return l&&(c=l[0]===Tt.R&&l[1]===Tt.G&&l[2]===Tt.B&&l[3]===Tt.A),o.width=o.height=1,c}catch{return console.error(`Failed to test for max canvas size of ${r}x${e}.`),!1}},"canvasTest");function Sn(r){return(...e)=>new Promise(t=>{setTimeout(()=>{let i=r(...e);t(i)},0)})}a(Sn,"wrapAsync");var Ec=Sn(An(Tn,En)),Tc=Sn(An(Tn,En)),$n=a(async(r,e)=>{let t=wn.squareSide.find(n=>n*n>=r*e),i=wn.dimension.find(n=>n>=r&&n>=e);if(!t||!i)throw new Error("Not supported");let[s,o]=await Promise.all([Ec(t,t),Tc(i,1)]);if(s&&o)return!0;throw new Error("Not supported")},"testCanvasSize"),kn=a(async(r,e,t)=>{try{let{ctx:i,canvas:s}=Fe();return s.width=e,s.height=t,i.imageSmoothingQuality="high",i.drawImage(r,0,0,e,t),r instanceof HTMLImageElement&&(r.src="//:0"),r instanceof HTMLCanvasElement&&(r.width=r.height=1),s}catch(i){throw new Error("Canvas resize error",{cause:i})}},"canvasResize"),Sc=a(({img:r,targetW:e,targetH:t})=>kn(r,e,t),"native"),$c=a(function({sourceW:r,targetW:e,targetH:t,step:i}){let s=[],o=e,n=t;do s.push([o,n]),o=Math.round(o/i),n=Math.round(n/i);while(o<r*i);return s.reverse()},"calcShrinkSteps"),kc=a(({img:r,sourceW:e,targetW:t,targetH:i,step:s})=>$c({sourceW:e,targetW:t,targetH:i,step:s}).reduce((n,[l,c])=>n.then(u=>$n(l,c).then(()=>kn(u,l,c)).catch(()=>u)),Promise.resolve(r)),"fallback"),Ic=a(()=>/iPad|iPhone|iPod/.test(navigator.platform)?!0:navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform),"isIOS"),Oc=navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform),gs=.71,Lc=a((r,e)=>{if(r.width*gs*r.height*gs<e.size)throw new Error("Not required");let t=r.width,i=r.height,s=t/i,o=Math.floor(Math.sqrt(e.size*s)),n=Math.floor(e.size/Math.sqrt(e.size*s));return $n(o,n).then(()=>{let{ctx:l}=Fe();return"imageSmoothingQuality"in l&&!Ic()&&!Oc?Sc({img:r,targetW:o,targetH:n}):kc({img:r,sourceW:t,targetW:o,targetH:n,step:gs})}).catch(()=>Promise.reject("Not supported"))},"shrinkImage"),In=a(async(r,e)=>{try{if(await xc(r))throw new Error("Should skipped");let i=await Promise.allSettled([pc(r),mc(),lc(r)]),o=!i.some(b=>b.status==="rejected"),[n,l,c]=i,u=await uc(r).catch(()=>r),d=await vc(URL.createObjectURL(u));URL.revokeObjectURL(d.src);let p=await Lc(d,e),f="image/jpeg",m=(e==null?void 0:e.quality)||.8;!o&&dc(p)&&(f="image/png",m=void 0);let g=await hc(p,f,m);if(o&&n.status==="fulfilled"&&n.value){let b=n.value,w=l.status==="fulfilled"?l.value:!1;g=await _c(g,b,w)}return o&&c.status==="fulfilled"&&c.value.length>0&&(g=await xn(g,c.value)),g}catch(t){let i;throw t instanceof Error&&(i=t.message),typeof t=="string"&&(i=t),new Error(`Failed to shrink image. ${i?`Message: "${i}".`:""}`,{cause:t})}},"shrinkFile");function Uc(r){let e=new Blob([r],{type:"image/svg+xml"});return URL.createObjectURL(e)}a(Uc,"createSvgBlobUrl");function bs(r="hsl(209, 21%, 65%)",e=32,t=32){return Uc(`<svg width="${e}" height="${t}" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" fill="${r}" d="M9.68848 8.70068C9.68848 8.42454 9.91233 8.20068 10.1885 8.20068H15.0885C15.2211 8.20068 15.3483 8.25336 15.442 8.34713L20.342 13.2471C20.4358 13.3409 20.4885 13.4681 20.4885 13.6007V21.3007C20.4885 21.5768 20.2646 21.8007 19.9885 21.8007H10.1885C9.91233 21.8007 9.68848 21.5768 9.68848 21.3007V8.70068ZM10.6885 9.20068V20.8007H19.4885V14.1007L15.0885 14.1007C14.8123 14.1007 14.5885 13.8768 14.5885 13.6007L14.5885 9.20068H10.6885ZM15.5885 9.90779L18.7814 13.1007L15.5885 13.1007L15.5885 9.90779Z"/></svg>`)}a(bs,"fileCssBg");function On(r,e=40){if(r.type==="image/svg+xml")return URL.createObjectURL(r);let t=document.createElement("canvas"),i=t.getContext("2d"),s=new Image,o=new Promise((n,l)=>{s.onload=()=>{let c=s.height/s.width;c>1?(t.width=e,t.height=e*c):(t.height=e,t.width=e/c),i.fillStyle="rgb(240, 240, 240)",i.fillRect(0,0,t.width,t.height),i.drawImage(s,0,0,t.width,t.height),t.toBlob(u=>{if(!u){l();return}let d=URL.createObjectURL(u);n(d)})},s.onerror=c=>{l(c)}});return s.src=URL.createObjectURL(r),o}a(On,"generateThumb");var Pc=/^([0-9]+)x([0-9]+)(?:\s+(\d{1,2}|100)%)?$/i,Ln=a(r=>{let e=Pc.exec(r==null?void 0:r.toLocaleLowerCase())||[];if(!e.length)return!1;let t=e[1]*e[2],i=16384*16384;return t>i?(console.warn(`Shrinked size can not be larger than ${Math.floor(i/1e3/1e3)}MP. You have set ${e[1]}x${e[2]} (${Math.ceil(t/1e3/100)/10}MP).`),!1):{quality:e[3]?e[3]/100:void 0,size:t}},"parseShrink");var Y=Object.freeze({FINISHED:Symbol("FINISHED"),FAILED:Symbol("FAILED"),UPLOADING:Symbol("UPLOADING"),IDLE:Symbol("IDLE")}),se=class se extends ${constructor(){super();h(this,"couldBeCtxOwner",!0);h(this,"pauseRender",!0);h(this,"_entrySubs",new Set);h(this,"_entry",null);h(this,"_isIntersecting",!1);h(this,"_debouncedGenerateThumb",U(this._generateThumbnail.bind(this),100));h(this,"_debouncedCalculateState",U(this._calculateState.bind(this),100));h(this,"_renderedOnce",!1);this.init$={...this.init$,uid:"",itemName:"",errorText:"",thumbUrl:"",progressValue:0,progressVisible:!1,badgeIcon:"",isFinished:!1,isFailed:!1,isUploading:!1,isFocused:!1,isEditable:!1,state:Y.IDLE,ariaLabelStatusFile:"",onEdit:()=>{this.$["*currentActivityParams"]={internalId:this._entry.uid},this.$["*currentActivity"]=_.activities.CLOUD_IMG_EDIT},onRemove:()=>{this.uploadCollection.remove(this.$.uid)},onUpload:()=>{this.upload()}}}_reset(){for(let t of this._entrySubs)t.remove();this._debouncedGenerateThumb.cancel(),this._debouncedCalculateState.cancel(),this._entrySubs=new Set,this._entry=null}_observerCallback(t){let[i]=t;this._isIntersecting=i.isIntersecting,i.isIntersecting&&!this._renderedOnce&&(this.render(),this._renderedOnce=!0),i.intersectionRatio===0?this._debouncedGenerateThumb.cancel():this._debouncedGenerateThumb()}_calculateState(){if(!this._entry)return;let t=this._entry,i=Y.IDLE;t.getValue("errors").length>0?i=Y.FAILED:t.getValue("isUploading")?i=Y.UPLOADING:t.getValue("fileInfo")&&(i=Y.FINISHED),this.$.state=i}async _generateThumbnail(){var i;if(!this._entry)return;let t=this._entry;if(t.getValue("fileInfo")&&t.getValue("isImage")){let s=this.cfg.thumbSize,o=await this.proxyUrl(P(vt(this.cfg.cdnCname,this._entry.getValue("uuid")),N(t.getValue("cdnUrlModifiers"),`scale_crop/${s}x${s}/center`))),n=t.getValue("thumbUrl");n!==o&&(t.setValue("thumbUrl",o),n!=null&&n.startsWith("blob:")&&URL.revokeObjectURL(n));return}if(!t.getValue("thumbUrl"))if((i=t.getValue("file"))!=null&&i.type.includes("image"))try{let s=await On(t.getValue("file"),this.cfg.thumbSize);t.setValue("thumbUrl",s)}catch{let o=window.getComputedStyle(this).getPropertyValue("--uc-muted-foreground");t.setValue("thumbUrl",bs(o))}else{let s=window.getComputedStyle(this).getPropertyValue("--uc-muted-foreground");t.setValue("thumbUrl",bs(s))}}_subEntry(t,i){let s=this._entry.subscribe(t,o=>{this.isConnected&&i(o)});this._entrySubs.add(s)}_handleEntryId(t){var s;this._reset();let i=(s=this.uploadCollection)==null?void 0:s.read(t);this._entry=i,i&&(this._subEntry("uploadProgress",o=>{this.$.progressValue=o}),this._subEntry("fileName",o=>{this.$.itemName=o||i.getValue("externalUrl")||this.l10n("file-no-name"),this._debouncedCalculateState()}),this._subEntry("externalUrl",o=>{this.$.itemName=i.getValue("fileName")||o||this.l10n("file-no-name")}),this._subEntry("fileInfo",o=>{this._debouncedCalculateState(),o&&this._isIntersecting&&this._debouncedGenerateThumb()}),this._subEntry("cdnUrlModifiers",()=>{this._isIntersecting&&this._debouncedGenerateThumb()}),this._subEntry("thumbUrl",o=>{this.$.thumbUrl=o?`url(${o})`:""}),this._subEntry("errors",()=>this._debouncedCalculateState()),this._subEntry("isUploading",()=>this._debouncedCalculateState()),this._subEntry("fileSize",()=>this._debouncedCalculateState()),this._subEntry("mimeType",()=>this._debouncedCalculateState()),this._subEntry("isImage",()=>this._debouncedCalculateState()),this._isIntersecting&&this._debouncedGenerateThumb())}initCallback(){super.initCallback(),this.sub("uid",t=>{this._handleEntryId(t)}),this.sub("state",t=>{this._handleState(t)}),this.subConfigValue("useCloudImageEditor",()=>this._debouncedCalculateState()),this.onclick=()=>{se.activeInstances.forEach(t=>{t===this?t.setAttribute("focused",""):t.removeAttribute("focused")})},this.sub("*uploadTrigger",t=>{t.has(this._entry.uid)&&setTimeout(()=>this.isConnected&&this.upload())}),se.activeInstances.add(this)}_handleState(t){var i,s,o,n,l,c,u;t===Y.FAILED?this.$.badgeIcon="badge-error":t===Y.FINISHED&&(this.$.badgeIcon="badge-success"),t===Y.UPLOADING?this.$.isFocused=!1:this.$.progressValue=0,this.set$({isFailed:t===Y.FAILED,isUploading:t===Y.UPLOADING,isFinished:t===Y.FINISHED,progressVisible:t===Y.UPLOADING,isEditable:this.cfg.useCloudImageEditor&&((i=this._entry)==null?void 0:i.getValue("isImage"))&&((s=this._entry)==null?void 0:s.getValue("cdnUrl")),errorText:(n=(o=this._entry.getValue("errors"))==null?void 0:o[0])==null?void 0:n.message,ariaLabelStatusFile:this.l10n("a11y-file-item-status",{fileName:(l=this._entry)==null?void 0:l.getValue("fileName"),status:this.l10n((u=(c=t==null?void 0:t.description)==null?void 0:c.toLocaleLowerCase())!=null?u:"").toLocaleLowerCase()})})}destroyCallback(){super.destroyCallback(),se.activeInstances.delete(this),this._reset()}connectedCallback(){super.connectedCallback(),this._observer=new window.IntersectionObserver(this._observerCallback.bind(this),{threshold:[0,1]}),this._observer.observe(this)}disconnectedCallback(){var t;super.disconnectedCallback(),this._debouncedGenerateThumb.cancel(),(t=this._observer)==null||t.disconnect()}_settingsOfShrink(){return Ln(this.cfg.imageShrink)}_processShrink(t){return In(t,this._settingsOfShrink())}async upload(){var s,o,n,l,c,u;let t=this._entry;if(!this.uploadCollection.read(t.uid)||t.getValue("fileInfo")||t.getValue("isUploading")||t.getValue("errors").length>0)return;let i=this.cfg.multiple?this.cfg.multipleMax:1;if(!(i&&this.uploadCollection.size>i)){this._debouncedCalculateState(),t.setValue("isUploading",!0),t.setValue("errors",[]);try{let d=new AbortController;t.setValue("abortController",d);let p=a(async()=>{let m=t.getValue("file");m&&this.cfg.imageShrink&&(m=await this._processShrink(m).catch(()=>m));let g=m||t.getValue("externalUrl")||t.getValue("uuid"),w={...await this.getUploadClientOptions(),fileName:t.getValue("fileName"),source:t.getValue("source"),onProgress:C=>{if(C.isComputable){let v=C.value*100;t.setValue("uploadProgress",v)}},signal:d.signal,metadata:await this.getMetadataFor(t.uid)};return this.debugPrint("upload options",g,w),xr(g,w)},"uploadTask"),f=await this.$["*uploadQueue"].add(p);t.setMultipleValues({fileInfo:f,isUploading:!1,fileName:f.originalFilename,fileSize:f.size,isImage:f.isImage,mimeType:(n=(o=(s=f.contentInfo)==null?void 0:s.mime)==null?void 0:o.mime)!=null?n:f.mimeType,uuid:f.uuid,cdnUrl:(l=t.getValue("cdnUrl"))!=null?l:f.cdnUrl,cdnUrlModifiers:(c=t.getValue("cdnUrlModifiers"))!=null?c:"",uploadProgress:100,source:(u=t.getValue("source"))!=null?u:null}),t===this._entry&&this._debouncedCalculateState()}catch(d){d instanceof Ct&&d.isCancel?t.setMultipleValues({isUploading:!1,uploadProgress:0}):t.setMultipleValues({isUploading:!1,uploadProgress:0,uploadError:d}),t===this._entry&&this._debouncedCalculateState()}}}};a(se,"FileItem");var oe=se;oe.template=`<div class="uc-inner" set="@finished: isFinished; @uploading: isUploading; @failed: isFailed; @focused: isFocused"><div class="uc-thumb" set="style.backgroundImage: thumbUrl"><div class="uc-badge"><uc-icon set="@name: badgeIcon"></uc-icon></div></div><div aria-live="polite" class="uc-file-name-wrapper" set="@aria-label:ariaLabelStatusFile;"><span class="uc-file-name" set="@title: itemName">{{itemName}}</span><span class="uc-file-error" set="@hidden: !errorText">{{errorText}}</span></div><div class="uc-file-actions"><button type="button" l10n="@title:file-item-edit-button" class="uc-edit-btn uc-mini-btn" set="onclick: onEdit; @hidden: !isEditable" ><uc-icon name="edit-file"></uc-icon></button><button type="button" l10n="@title:file-item-remove-button" class="uc-remove-btn uc-mini-btn" set="onclick: onRemove;" ><uc-icon name="remove-file"></uc-icon></button><button type="button" class="uc-upload-btn uc-mini-btn" set="onclick: onUpload;"><uc-icon name="upload"></uc-icon></button></div><uc-progress-bar class="uc-progress-bar" set="value: progressValue; visible: progressVisible;"></uc-progress-bar></div>`;oe.activeInstances=new Set;var Rt=class Rt extends y{constructor(){super();h(this,"_handleBackdropClick",a(()=>{this._closeDialog()},"_handleBackdropClick"));h(this,"_closeDialog",a(()=>{this.setOrAddState("*modalActive",!1)},"_closeDialog"));h(this,"_handleDialogClose",a(()=>{this._closeDialog()},"_handleDialogClose"));h(this,"_handleDialogMouseDown",a(t=>{this._mouseDownTarget=t.target},"_handleDialogMouseDown"));h(this,"_handleDialogMouseUp",a(t=>{t.target===this.ref.dialog&&t.target===this._mouseDownTarget&&this._closeDialog()},"_handleDialogMouseUp"));this.init$={...this.init$,"*modalActive":!1,isOpen:!1,closeClicked:this._handleDialogClose}}show(){this.ref.dialog.showModal?this.ref.dialog.showModal():this.ref.dialog.setAttribute("open","")}hide(){this.ref.dialog.close?this.ref.dialog.close():this.ref.dialog.removeAttribute("open")}initCallback(){if(super.initCallback(),typeof HTMLDialogElement=="function")this.ref.dialog.addEventListener("close",this._handleDialogClose),this.ref.dialog.addEventListener("mousedown",this._handleDialogMouseDown),this.ref.dialog.addEventListener("mouseup",this._handleDialogMouseUp);else{this.setAttribute("dialog-fallback","");let t=document.createElement("div");t.className="uc-backdrop",this.appendChild(t),t.addEventListener("click",this._handleBackdropClick)}this.sub("*modalActive",t=>{this.$.isOpen!==t&&(this.$.isOpen=t),t&&this.cfg.modalScrollLock?document.body.style.overflow="hidden":document.body.style.overflow=""}),this.subConfigValue("modalBackdropStrokes",t=>{t?this.setAttribute("strokes",""):this.removeAttribute("strokes")}),this.sub("isOpen",t=>{t?(this.show(),this.setAttribute("aria-modal","true")):(this.hide(),this.setAttribute("aria-modal","false"))})}destroyCallback(){super.destroyCallback(),document.body.style.overflow="",this._mouseDownTarget=void 0,this.ref.dialog.removeEventListener("close",this._handleDialogClose),this.ref.dialog.removeEventListener("mousedown",this._handleDialogMouseDown),this.ref.dialog.removeEventListener("mouseup",this._handleDialogMouseUp)}};a(Rt,"Modal"),h(Rt,"styleAttrs",[...H(Rt,Rt,"styleAttrs"),"uc-modal"]),h(Rt,"StateConsumerScope","modal");var Ne=Rt;Ne.template=`<dialog ref="dialog"><slot></slot></dialog>`;var Xi=a((r,e)=>{let t,i,s,o=a((...n)=>{t?(clearTimeout(i),i=setTimeout(()=>{Date.now()-s>=e&&(r(...n),s=Date.now())},Math.max(e-(Date.now()-s),0))):(r(...n),s=Date.now(),t=!0)},"throttled");return Object.defineProperty(o,"cancel",{configurable:!1,writable:!1,enumerable:!1,value:()=>{clearTimeout(i)}}),o},"throttle");var _s=class _s extends ${constructor(){super();h(this,"couldBeCtxOwner",!0);h(this,"historyTracked",!0);h(this,"activityType",_.activities.UPLOAD_LIST);h(this,"_throttledHandleCollectionUpdate",Xi(()=>{this.isConnected&&(this._updateUploadsState(),!this.couldOpenActivity&&this.$["*currentActivity"]===this.activityType&&this.historyBack())},300));this.init$={...this.init$,doneBtnVisible:!1,doneBtnEnabled:!1,uploadBtnVisible:!1,addMoreBtnVisible:!1,addMoreBtnEnabled:!1,headerText:"",commonErrorMessage:"",hasFiles:!1,onAdd:()=>{this.api.initFlow(!0)},onUpload:()=>{this.emit(k.UPLOAD_CLICK),this.api.uploadAll(),this._throttledHandleCollectionUpdate()},onDone:()=>{this.emit(k.DONE_CLICK,this.api.getOutputCollectionState()),this.api.doneFlow()},onCancel:()=>{this.uploadCollection.clearAll()}}}_updateUploadsState(){let t=this.api.getOutputCollectionState(),i={total:t.totalCount,succeed:t.successCount,uploading:t.uploadingCount,failed:t.failedCount},s=!t.errors.some(f=>f.type==="TOO_MANY_FILES"||f.type==="TOO_FEW_FILES"),o=t.errors.some(f=>f.type==="TOO_MANY_FILES"),n=t.totalCount===(this.cfg.multiple?this.cfg.multipleMax:1),l=i.failed===0&&t.errors.length===0,c=!1,u=!1,d=!1;if(i.total-i.succeed-i.uploading-i.failed>0&&s)c=!0;else{u=!0;let f=this.cfg.groupOutput?!!t.group:!0;d=i.total===i.succeed&&s&&l&&f}this.set$({doneBtnVisible:u,doneBtnEnabled:d,uploadBtnVisible:c,addMoreBtnEnabled:i.total===0||!o&&!n,addMoreBtnVisible:!n||this.cfg.multiple}),this.bindL10n("headerText",()=>this._getHeaderText(i))}_getHeaderText(t){let i=a(s=>{let o=t[s];return this.l10n(`header-${s}`,{count:o})},"localizedText");return t.uploading>0?i("uploading"):t.failed>0?i("failed"):t.succeed>0?i("succeed"):i("total")}get couldOpenActivity(){return this.cfg.showEmptyList||this.uploadCollection.size>0}initCallback(){super.initCallback(),this.registerActivity(this.activityType),this.subConfigValue("multiple",this._throttledHandleCollectionUpdate),this.subConfigValue("multipleMin",this._throttledHandleCollectionUpdate),this.subConfigValue("multipleMax",this._throttledHandleCollectionUpdate),this.sub("*groupInfo",t=>{t&&this._throttledHandleCollectionUpdate()}),this.sub("*currentActivity",t=>{!this.couldOpenActivity&&t===this.activityType&&(this.$["*currentActivity"]=this.initActivity)}),this.uploadCollection.observeProperties(this._throttledHandleCollectionUpdate),this.sub("*uploadList",t=>{this._throttledHandleCollectionUpdate(),this.set$({hasFiles:t.length>0}),this.cfg.confirmUpload||this.api.uploadAll()},!1),this.sub("*collectionErrors",t=>{let i=t.filter(s=>s.type!=="SOME_FILES_HAS_ERRORS")[0];if(!i){this.set$({commonErrorMessage:null});return}this.set$({commonErrorMessage:i.message})})}destroyCallback(){super.destroyCallback(),this.uploadCollection.unobserveProperties(this._throttledHandleCollectionUpdate)}};a(_s,"UploadList");var ze=_s;ze.template=`<uc-activity-header><span aria-live="polite" class="uc-header-text">{{headerText}}</span><button type="button" class="uc-mini-btn uc-close-btn" set="onclick: *closeModal" l10n="@title:a11y-activity-header-button-close" ><uc-icon name="close"></uc-icon></button></uc-activity-header><div class="uc-no-files" set="@hidden: hasFiles"><slot name="empty"><span l10n="no-files"></span></slot></div><div class="uc-files" repeat="*uploadList" repeat-item-tag="uc-file-item"></div><div class="uc-common-error" set="@hidden: !commonErrorMessage; textContent: commonErrorMessage;"></div><div class="uc-toolbar"><button type="button" class="uc-cancel-btn uc-secondary-btn" set="onclick: onCancel;" l10n="clear"></button><div class="uc-toolbar-spacer"></div><button type="button" class="uc-add-more-btn uc-secondary-btn" set="onclick: onAdd; @disabled: !addMoreBtnEnabled; @hidden: !addMoreBtnVisible" ><uc-icon name="add"></uc-icon><span l10n="add-more"></span></button><button type="button" class="uc-upload-btn uc-primary-btn" set="@hidden: !uploadBtnVisible; onclick: onUpload;" l10n="upload" ></button><button type="button" class="uc-done-btn uc-primary-btn" set="@hidden: !doneBtnVisible; onclick: onDone; @disabled: !doneBtnEnabled" l10n="done" ></button></div><uc-drop-area ghost></uc-drop-area>`;var ys=class ys extends ${constructor(){super(...arguments);h(this,"couldBeCtxOwner",!0);h(this,"activityType",_.activities.URL);h(this,"init$",{...this.init$,importDisabled:!0,onUpload:t=>{t.preventDefault();let i=this.ref.input.value;this.api.addFileFromUrl(i,{source:L.URL}),this.$["*currentActivity"]=_.activities.UPLOAD_LIST},onCancel:()=>{this.historyBack()},onInput:t=>{let i=t.target.value;this.set$({importDisabled:!i})}})}initCallback(){super.initCallback(),this.registerActivity(this.activityType,{onActivate:()=>{this.ref.input.value="",this.ref.input.focus()}})}};a(ys,"UrlSource");var Ve=ys;Ve.template=`<uc-activity-header><button type="button" class="uc-mini-btn" set="onclick: *historyBack" l10n="@title:back"><uc-icon name="back"></uc-icon></button><div><uc-icon name="url"></uc-icon><span l10n="caption-from-url"></span></div><button type="button" class="uc-mini-btn uc-close-btn" set="onclick: *closeModal" l10n="@title:a11y-activity-header-button-close" ><uc-icon name="close"></uc-icon></button></uc-activity-header><form class="uc-content"><input placeholder="https://" class="uc-url-input" type="text" ref="input" set="oninput: onInput" /><button type="submit" class="uc-url-upload-btn uc-primary-btn" set="onclick: onUpload; @disabled: importDisabled" l10n="upload-url" ></button></form>`;var vs=a(()=>typeof navigator.permissions!="undefined","canUsePermissionsApi");var ws=class ws extends ${constructor(){super(...arguments);h(this,"couldBeCtxOwner",!0);h(this,"activityType",_.activities.CAMERA);h(this,"_unsubPermissions",null);h(this,"init$",{...this.init$,video:null,videoTransformCss:null,shotBtnDisabled:!0,videoHidden:!0,messageHidden:!0,requestBtnHidden:vs(),cameraSelectOptions:null,cameraSelectHidden:!0,l10nMessage:"",onCameraSelectChange:t=>{this._selectedCameraId=t.target.value,this._capture()},onCancel:()=>{this.historyBack()},onShot:()=>{this._shot()},onRequestPermissions:()=>{this._capture()}});h(this,"_onActivate",a(()=>{vs()&&this._subscribePermissions(),this._capture()},"_onActivate"));h(this,"_onDeactivate",a(()=>{this._unsubPermissions&&this._unsubPermissions(),this._stopCapture()},"_onDeactivate"));h(this,"_handlePermissionsChange",a(()=>{this._capture()},"_handlePermissionsChange"));h(this,"_setPermissionsState",U(t=>{this.classList.toggle("uc-initialized",t==="granted"),t==="granted"?this.set$({videoHidden:!1,shotBtnDisabled:!1,messageHidden:!0}):t==="prompt"?(this.$.l10nMessage="camera-permissions-prompt",this.set$({videoHidden:!0,shotBtnDisabled:!0,messageHidden:!1}),this._stopCapture()):(this.$.l10nMessage="camera-permissions-denied",this.set$({videoHidden:!0,shotBtnDisabled:!0,messageHidden:!1}),this._stopCapture())},300))}async _subscribePermissions(){try{(await navigator.permissions.query({name:"camera"})).addEventListener("change",this._handlePermissionsChange)}catch(t){console.log("Failed to use permissions API. Fallback to manual request mode.",t),this._capture()}}async _capture(){let t={video:{width:{ideal:1920},height:{ideal:1080},frameRate:{ideal:30}},audio:!1};this._selectedCameraId&&(t.video.deviceId={exact:this._selectedCameraId}),this._canvas=document.createElement("canvas"),this._ctx=this._canvas.getContext("2d");try{this._setPermissionsState("prompt");let i=await navigator.mediaDevices.getUserMedia(t);i.addEventListener("inactive",()=>{this._setPermissionsState("denied")}),this.$.video=i,this._capturing=!0,this._setPermissionsState("granted")}catch(i){this._setPermissionsState("denied"),console.error("Failed to capture camera",i)}}_stopCapture(){var t;this._capturing&&((t=this.$.video)==null||t.getTracks()[0].stop(),this.$.video=null,this._capturing=!1)}_shot(){this._canvas.height=this.ref.video.videoHeight,this._canvas.width=this.ref.video.videoWidth,this._ctx.drawImage(this.ref.video,0,0);let t=Date.now(),i=`camera-${t}.jpeg`,s="image/jpeg";this._canvas.toBlob(o=>{let n=new File([o],i,{lastModified:t,type:s});this.api.addFileFromObject(n,{source:L.CAMERA}),this.set$({"*currentActivity":_.activities.UPLOAD_LIST})},s)}async initCallback(){var t;super.initCallback(),this.registerActivity(this.activityType,{onActivate:this._onActivate,onDeactivate:this._onDeactivate}),this.subConfigValue("cameraMirror",i=>{this.$.videoTransformCss=i?"scaleX(-1)":null});try{let s=(await navigator.mediaDevices.enumerateDevices()).filter(o=>o.kind==="videoinput").map((o,n)=>({text:o.label.trim()||`${this.l10n("caption-camera")} ${n+1}`,value:o.deviceId}));s.length>1&&(this.$.cameraSelectOptions=s,this.$.cameraSelectHidden=!1),this._selectedCameraId=(t=s[0])==null?void 0:t.value}catch{}}};a(ws,"CameraSource");var Be=ws;Be.template=`<uc-activity-header><button type="button" class="uc-mini-btn" set="onclick: *historyBack" l10n="@title:back"><uc-icon name="back"></uc-icon></button><div set="@hidden: !cameraSelectHidden"><uc-icon name="camera"></uc-icon><span l10n="caption-camera"></span></div><uc-select class="uc-camera-select" set="$.options: cameraSelectOptions; @hidden: cameraSelectHidden; onchange: onCameraSelectChange" ></uc-select><button type="button" class="uc-mini-btn uc-close-btn" set="onclick: *closeModal" l10n="@title:a11y-activity-header-button-close" ><uc-icon name="close"></uc-icon></button></uc-activity-header><div class="uc-content"><video autoplay playsinline set="srcObject: video; style.transform: videoTransformCss; @hidden: videoHidden" ref="video" ></video><div class="uc-message-box" set="@hidden: messageHidden"><span l10n="l10nMessage"></span><button type="button" set="onclick: onRequestPermissions; @hidden: requestBtnHidden" l10n="camera-permissions-request" ></button></div><button type="button" class="uc-shot-btn" set="onclick: onShot; @disabled: shotBtnDisabled"><uc-icon name="camera"></uc-icon></button></div>`;var Cs=class Cs extends ${constructor(){super(...arguments);h(this,"requireCtxName",!0)}initCallback(){super.initCallback(),this.$["*eventEmitter"].bindTarget(this)}destroyCallback(){super.destroyCallback(),this.$["*eventEmitter"].unbindTarget(this)}};a(Cs,"UploadCtxProviderClass");var qi=Cs;qi.EventType=k;var Un=qi;var xs=class xs extends ${constructor(){super(...arguments);h(this,"init$",{...this.init$,visible:!1,value:0,"*commonProgress":0})}initCallback(){super.initCallback(),this._unobserveCollection=this.uploadCollection.observeProperties(()=>{let t=this.uploadCollection.items().some(i=>this.uploadCollection.read(i).getValue("isUploading"));this.$.visible=t}),this.sub("visible",t=>{t?this.setAttribute("active",""):this.removeAttribute("active")}),this.sub("*commonProgress",t=>{this.$.value=t})}destroyCallback(){var t;super.destroyCallback(),(t=this._unobserveCollection)==null||t.call(this)}};a(xs,"ProgressBarCommon");var je=xs;je.template='<uc-progress-bar set="visible: visible; value: value"></uc-progress-bar>';var As=class As extends y{constructor(){super(...arguments);h(this,"_value",0);h(this,"init$",{...this.init$,width:0,opacity:0})}initCallback(){super.initCallback(),this.defineAccessor("value",t=>{if(t===void 0)return;let i=this._value;if(this._value=t,t===0&&i>0){this.ref.line.addEventListener("transitionend",()=>{this.style.setProperty("--l-width",this._value.toString())});return}this.style.setProperty("--l-width",this._value.toString())}),this.defineAccessor("visible",t=>{this.ref.line.classList.toggle("uc-progress--hidden",!t)})}};a(As,"ProgressBar");var He=As;He.template='<div ref="line" class="uc-progress"></div>';var lt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=";function Pn(...r){return r.reduce((e,t)=>{if(typeof t=="string")return e[t]=!0,e;for(let i of Object.keys(t))e[i]=t[i];return e},{})}a(Pn,"normalize");function F(...r){let e=Pn(...r);return Object.keys(e).reduce((t,i)=>(e[i]&&t.push(i),t),[]).join(" ")}a(F,"classNames");function Mn(r,...e){let t=Pn(...e);for(let i of Object.keys(t))r.classList.toggle(i,t[i])}a(Mn,"applyClassNames");var Rn=a(r=>{if(!r)return G;let e=co(r).filter(t=>G.includes(t));return e.length===0?G:e},"parseTabs");function Dn(r){return{"*originalUrl":null,"*faderEl":null,"*cropperEl":null,"*imgEl":null,"*imgContainerEl":null,"*networkProblems":!1,"*imageSize":null,"*editorTransformations":{},"*cropPresetList":[],"*tabList":G,"*tabId":O.CROP,entry:null,extension:null,editorMode:!1,modalCaption:"",isImage:!1,msg:"",src:lt,fileType:"",showLoader:!1,uuid:null,cdnUrl:null,cropPreset:"",tabs:Vt(G),"presence.networkProblems":!1,"presence.modalCaption":!0,"presence.editorToolbar":!1,"presence.viewerToolbar":!0,"*on.retryNetwork":()=>{let e=r.querySelectorAll("img");for(let t of e){let i=t.src;t.src=lt,t.src=i}r.$["*networkProblems"]=!1},"*on.apply":e=>{if(!e)return;let t=r.$["*originalUrl"],i=N(wt(e),"preview"),s=P(t,i),o={originalUrl:t,cdnUrlModifiers:i,cdnUrl:s,transformations:e};r.dispatchEvent(new CustomEvent("apply",{detail:o,bubbles:!0,composed:!0})),r.remove()},"*on.cancel":()=>{r.remove(),r.dispatchEvent(new CustomEvent("cancel",{bubbles:!0,composed:!0}))}}}a(Dn,"initState");var Fn="<svg width='0' height='0' style='position:absolute'><symbol viewBox='0 0 20 20' id='uc-icon-brightness' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M15 10a5 5 0 0 1-5 5m5-5a5 5 0 0 0-5-5m5 5h-5m0 5a5 5 0 0 1 0-10m0 10V5m0 15v-3M2.93 2.929 5.05 5.05M0 10h3m-.07 7.071 2.12-2.121M10 0v3m7.07 14.071-2.12-2.121M20 10h-3m.07-7.071L14.95 5.05m-.626 2.45H10m4.324 5H10'/></symbol><symbol fill='currentColor' viewBox='0 0 20 20' id='uc-icon-closeMax' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' d='M8.232 10 3.585 5.353l1.768-1.768L10 8.232l4.648-4.647 1.767 1.768L11.768 10l4.647 4.648-1.767 1.767L10 11.768l-4.647 4.647-1.768-1.767L8.232 10Z' clip-rule='evenodd'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-contrast' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M2 10a8 8 0 1 0 16 0 8 8 0 1 0-16 0m8-8v16m8-8h-8m7.598 2.5H10m6.24 2.5H10m7.6-7.5H10M16.242 5H10'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-crop' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M20 14H7.005C6.45 14 6 13.55 6 12.995V0M0 6h13.067c.515 0 .933.418.933.933V20M14.5.4 13 2l1.5 1.6M13 2h2a3 3 0 0 1 3 3v2M5.5 19.6 7 18l-1.5-1.6M7 18H5a3 3 0 0 1-3-3v-2'/></symbol><symbol fill='currentColor' viewBox='0 0 20 20' id='uc-icon-done' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' d='m18.057 6.333-9.365 9.125a1.25 1.25 0 0 1-1.768-.023L1.92 10.296l1.791-1.744 4.132 4.243 8.47-8.253 1.744 1.79Z' clip-rule='evenodd'/></symbol><symbol fill='currentColor' viewBox='0 0 25 24' id='uc-icon-edit-file' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' d='M18.558 2.804a.78.78 0 0 0-.557.235l-.008.007-2.472 2.46 3.847 3.848 2.46-2.473.004-.003a.78.78 0 0 0 0-1.108l-.004-.003-2.712-2.728a.78.78 0 0 0-.558-.235Zm-.248 7.613-3.852-3.852-8.93 8.887-1.516 5.41 5.41-1.515 8.888-8.93Zm-.636-8.934a2.28 2.28 0 0 1 2.512.505l2.702 2.717.002.002a2.278 2.278 0 0 1 0 3.234l-.002.002-12.541 12.602a.75.75 0 0 1-.33.193l-6.884 1.928a.75.75 0 0 1-.925-.924l1.928-6.885a.75.75 0 0 1 .193-.33l12.603-12.54a2.28 2.28 0 0 1 .742-.504Z' clip-rule='evenodd'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-enhance' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M19 13h-2m0 0a4 4 0 0 1-4-4m4 4a4 4 0 0 0-4 4m0-8V7m0 2a4 4 0 0 1-4 4m-2 0h2m0 0a4 4 0 0 1 4 4m0 0v2M8 8.5H6.5m0 0a2 2 0 0 1-2-2m2 2a2 2 0 0 0-2 2m0-4V5m0 1.5a2 2 0 0 1-2 2M1 8.5h1.5m0 0a2 2 0 0 1 2 2m0 0V12M12 3h-1m0 0a1 1 0 0 1-1-1m1 1a1 1 0 0 0-1 1m0-2V1m0 1a1 1 0 0 1-1 1M8 3h1m0 0a1 1 0 0 1 1 1m0 0v1'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-exposure' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M10 20v-3M2.93 2.929 5.05 5.05M0 10h3m-.07 7.071 2.12-2.121M10 0v3m7.07 14.071-2.12-2.121M20 10h-3m.07-7.071L14.95 5.05M5 10a5 5 0 1 0 10 0 5 5 0 1 0-10 0'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-filters' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M4.5 6.5a5.5 5.5 0 1 0 11 0 5.5 5.5 0 1 0-11 0m-3.5 6a5.5 5.5 0 1 0 11 0 5.5 5.5 0 1 0-11 0m7 0a5.5 5.5 0 1 0 11 0 5.5 5.5 0 1 0-11 0'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-flip' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M19.6 5 18 3.5 16.4 5m3.2 10L18 16.5 16.4 15M18 3.523v12.954M3.3 8.5h10.654c.301 0 .415-.395.159-.554L3.459 1.286A.3.3 0 0 0 3 1.542V8.2a.3.3 0 0 0 .3.3zm0 3h10.654c.301 0 .415.395.159.554l-10.654 6.66A.3.3 0 0 1 3 18.458v-6.66a.3.3 0 0 1 .3-.3z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-gamma' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M17 3C9 6 2.5 11.5 2.5 17.5m0 0h1m-1 0v-1m14 1h1m-3 0h1m-3 0h1m-3 0h1m-3 0h1m-3 0h1m-3 0h1m-3-14v-1m0 3v-1m0 3v-1m0 3v-1m0 3v-1m0 3v-1m0 3v-1'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-mirror' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M5 .4 3.5 2 5 3.6M15 .4 16.5 2 15 3.6M3.52 2h12.957M8.5 16.7V6.046c0-.301-.394-.415-.554-.159L1.287 16.541a.3.3 0 0 0 .255.459H8.2a.3.3 0 0 0 .3-.3zm3 0V6.046c0-.301.395-.415.555-.159l6.659 10.654a.3.3 0 0 1-.255.459H11.8a.3.3 0 0 1-.3-.3z'/></symbol><symbol viewBox='0 0 40 40' id='uc-icon-original' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.5' d='M0 40 40 0'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-rotate' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M13.5.4 12 2l1.5 1.6M12.023 2H14.4A3.6 3.6 0 0 1 18 5.6V8M4 17h9a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v9a1 1 0 0 0 1 1z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-sad' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M2 17c4.418-4 11.582-4 16 0M16.5 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm-11 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-saturation' xmlns='http://www.w3.org/2000/svg'><defs><linearGradient id='puc-icon-id__a' x1='10.001' y1='1' x2='10.001' y2='19' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient></defs><circle cx='10.001' cy='10' r='9' transform='rotate(90 10 10)' fill='url(#puc-icon-id__a)'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-slider' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M0 10h11m0 0a2 2 0 1 0 4 0m-4 0a2 2 0 1 1 4 0m0 0h5'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-tuning' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M8 10h11M1 10h4M1 4.5h11m3 0h4m-18 11h11m3 0h4m-7-11a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0M5 10a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0m7 5.5a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-vibrance' xmlns='http://www.w3.org/2000/svg'><path d='M2.125 5.64A8.96 8.96 0 0 0 1.001 10a8.96 8.96 0 0 0 1.124 4.36V5.64z' fill='url(#suc-icon-id__a)'/><path d='M2.875 15.499V4.502a9.053 9.053 0 0 1 1.75-1.72v14.437a9.05 9.05 0 0 1-1.75-1.72z' fill='url(#suc-icon-id__b)'/><path d='M5.375 17.722c.548.33 1.134.601 1.75.809V1.469a8.956 8.956 0 0 0-1.75.81v15.443z' fill='url(#suc-icon-id__c)'/><path d='M7.875 1.253v17.495c.564.136 1.15.22 1.75.244V1.008a9 9 0 0 0-1.75.245z' fill='url(#suc-icon-id__d)'/><path d='M10.375 1.008v17.984a9 9 0 0 0 1.75-.244V1.252a9 9 0 0 0-1.75-.244z' fill='url(#suc-icon-id__e)'/><path d='M12.875 1.469V18.53a8.957 8.957 0 0 0 1.75-.808V2.277a8.957 8.957 0 0 0-1.75-.808z' fill='url(#suc-icon-id__f)'/><path d='M15.375 2.78v14.44a9.053 9.053 0 0 0 1.75-1.72v-11a9.054 9.054 0 0 0-1.75-1.72z' fill='url(#suc-icon-id__g)'/><path d='M17.875 5.638v8.724A8.959 8.959 0 0 0 19.001 10a8.96 8.96 0 0 0-1.126-4.362z' fill='url(#suc-icon-id__h)'/><defs><linearGradient id='suc-icon-id__a' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='suc-icon-id__b' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='suc-icon-id__c' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='suc-icon-id__d' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='suc-icon-id__e' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='suc-icon-id__f' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='suc-icon-id__g' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='suc-icon-id__h' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient></defs></symbol><symbol viewBox='0 0 20 20' id='uc-icon-warmth' xmlns='http://www.w3.org/2000/svg'><path d='m7.5 13.05.429.42.171-.175v-.244h-.6zm5 0h-.6v.245l.172.175.428-.42zM8.1 3.5c0-1.05.85-1.9 1.9-1.9V.4a3.1 3.1 0 0 0-3.1 3.1h1.2zm0 9.55V3.5H6.9v9.55h1.2zm-1 2.45c0-.79.315-1.506.829-2.03l-.858-.84A4.088 4.088 0 0 0 5.9 15.5h1.2zm2.9 2.9a2.9 2.9 0 0 1-2.9-2.9H5.9a4.1 4.1 0 0 0 4.1 4.1v-1.2zm2.9-2.9a2.9 2.9 0 0 1-2.9 2.9v1.2a4.1 4.1 0 0 0 4.1-4.1h-1.2zm-.829-2.03c.514.524.829 1.24.829 2.03h1.2c0-1.117-.447-2.13-1.171-2.87l-.858.84zM11.9 3.5v9.55h1.2V3.5h-1.2zM10 1.6c1.05 0 1.9.85 1.9 1.9h1.2A3.1 3.1 0 0 0 10 .4v1.2z' fill='currentColor'/><path d='M10 14V8' stroke='currentColor' stroke-width='1.2' stroke-linecap='round'/><path d='M14 3h3m-3 3h3m-3 3h3m-8 6.5a1 1 0 1 0 2 0 1 1 0 1 0-2 0' stroke='currentColor' stroke-width='1.2'/></symbol></svg>";var Nn=`${Fn} <div class="uc-wrapper uc-wrapper_desktop"><uc-presence-toggle class="uc-network_problems_splash" set="visible: presence.networkProblems;"><div class="uc-network_problems_content"><div class="uc-network_problems_icon"><uc-icon name="sad"></uc-icon></div><div class="uc-network_problems_text">Network error</div></div><div class="uc-network_problems_footer"><uc-btn-ui theme="primary" text="Retry" set="onclick: *on.retryNetwork"></uc-btn-ui></div></uc-presence-toggle><div class="uc-viewport"><div class="uc-file_type_outer"><div class="uc-file_type">{{fileType}}</div></div><div class="uc-image_container" ref="img-container-el"><img src="${lt}" class="uc-image uc-image_visible_from_editor" ref="img-el" /><uc-editor-image-cropper ref="cropper-el"></uc-editor-image-cropper><uc-editor-image-fader ref="fader-el"></uc-editor-image-fader></div><div class="uc-info_pan">{{msg}}</div></div><div class="uc-toolbar"><uc-line-loader-ui set="active: showLoader"></uc-line-loader-ui><div class="uc-toolbar_content uc-toolbar_content__editor"><uc-editor-toolbar></uc-editor-toolbar></div></div></div>`;var Ki=class Ki extends y{constructor(){super();h(this,"ctxOwner",!0);h(this,"_debouncedShowLoader",U(this._showLoader.bind(this),300));this.init$={...this.init$,...Dn(this)}}_showLoader(t){this.$.showLoader=t}_waitForSize(){return new Promise((i,s)=>{let o=setTimeout(()=>{s(new Error("[cloud-image-editor] timeout waiting for non-zero container size"))},3e3),n=new ResizeObserver(([l])=>{l.contentRect.width>0&&l.contentRect.height>0&&(i(),clearTimeout(o),n.disconnect())});n.observe(this)})}initCallback(){super.initCallback(),this.$["*faderEl"]=this.ref["fader-el"],this.$["*cropperEl"]=this.ref["cropper-el"],this.$["*imgContainerEl"]=this.ref["img-container-el"],this.initEditor()}async updateImage(){if(this.isConnected){if(await this._waitForSize(),this.$.cdnUrl){let t=ui(this.$.cdnUrl),i=vt(this.$.cdnUrl,t);if(i===this.$["*originalUrl"])return;this.$["*originalUrl"]=i;let s=Qs(this.$.cdnUrl),o=oo(s);this.$["*editorTransformations"]=o}else if(this.$.uuid){let t=vt(this.cfg.cdnCname,this.$.uuid);if(t===this.$["*originalUrl"])return;this.$["*originalUrl"]=t,this.$["*editorTransformations"]={}}else throw new Error("No UUID nor CDN URL provided");this.$["*tabId"]===O.CROP?this.$["*cropperEl"].deactivate({reset:!0}):this.$["*faderEl"].deactivate();try{let t=await this.proxyUrl(P(this.$["*originalUrl"],N("json"))),i=await fetch(t).then(n=>n.json()),{width:s,height:o}=i;this.$["*imageSize"]={width:s,height:o},this.$["*tabId"]===O.CROP?this.$["*cropperEl"].activate(this.$["*imageSize"]):this.$["*faderEl"].activate({url:this.$["*originalUrl"]})}catch(t){t&&console.error("Failed to load image info",t)}}}async initEditor(){try{await this._waitForSize()}catch(t){this.isConnected&&console.error(t.message);return}this.ref["img-el"].addEventListener("load",()=>{this._imgLoading=!1,this._debouncedShowLoader(!1),this.$.src!==lt&&(this.$["*networkProblems"]=!1)}),this.ref["img-el"].addEventListener("error",()=>{this._imgLoading=!1,this._debouncedShowLoader(!1),this.$["*networkProblems"]=!0}),this.sub("src",t=>{let i=this.ref["img-el"];i.src!==t&&(this._imgLoading=!0,i.src=t||lt)}),this.sub("cropPreset",t=>{this.$["*cropPresetList"]=Ii(t)}),this.sub("tabs",t=>{this.$["*tabList"]=Rn(t)}),this.sub("*tabId",t=>{this.ref["img-el"].className=F("uc-image",{"uc-image_hidden_to_cropper":t===O.CROP,"uc-image_hidden_effects":t!==O.CROP})}),this.classList.add("uc-editor_ON"),this.sub("*networkProblems",t=>{this.$["presence.networkProblems"]=t,this.$["presence.modalCaption"]=!t}),this.sub("*editorTransformations",t=>{if(Object.keys(t).length===0)return;let i=this.$["*originalUrl"],s=N(wt(t),"preview"),o=P(i,s),n={originalUrl:i,cdnUrlModifiers:s,cdnUrl:o,transformations:t};this.dispatchEvent(new CustomEvent("change",{detail:n,bubbles:!0,composed:!0}))},!1),this.sub("uuid",t=>t&&this.updateImage()),this.sub("cdnUrl",t=>t&&this.updateImage())}};a(Ki,"CloudImageEditorBlock"),h(Ki,"styleAttrs",["uc-cloud-image-editor"]);var ct=Ki;ct.template=Nn;ct.bindAttributes({uuid:"uuid","cdn-url":"cdnUrl","crop-preset":"cropPreset",tabs:"tabs"});var Es=class Es extends y{constructor(){super(),this.init$={...this.init$,dragging:!1},this._handlePointerUp=this._handlePointerUp_.bind(this),this._handlePointerMove=this._handlePointerMove_.bind(this),this._handleSvgPointerMove=this._handleSvgPointerMove_.bind(this)}_shouldThumbBeDisabled(e){let t=this.$["*imageBox"];if(!t)return;if(e===""&&t.height<=A&&t.width<=A)return!0;let i=t.height<=A&&(e.includes("n")||e.includes("s")),s=t.width<=A&&(e.includes("e")||e.includes("w"));return i||s}_createBackdrop(){let e=this.$["*cropBox"];if(!e)return;let{x:t,y:i,width:s,height:o}=e,n=this.ref["svg-el"],l=Z("mask",{id:"backdrop-mask"}),c=Z("rect",{x:0,y:0,width:"100%",height:"100%",fill:"white"}),u=Z("rect",{x:t,y:i,width:s,height:o,fill:"black"});l.appendChild(c),l.appendChild(u);let d=Z("rect",{x:0,y:0,width:"100%",height:"100%",fill:"var(--color-image-background)","fill-opacity":.85,mask:"url(#backdrop-mask)"});n.appendChild(d),n.appendChild(l),this._backdropMask=l,this._backdropMaskInner=u}_resizeBackdrop(){this._backdropMask&&(this._backdropMask.style.display="none",window.requestAnimationFrame(()=>{this._backdropMask&&(this._backdropMask.style.display="block")}))}_updateBackdrop(){let e=this.$["*cropBox"];if(!e)return;let{x:t,y:i,width:s,height:o}=e;this._backdropMaskInner&&Ot(this._backdropMaskInner,{x:t,y:i,width:s,height:o})}_updateFrame(){let e=this.$["*cropBox"];if(!(!e||!this._frameGuides||!this._frameThumbs)){for(let t of Object.values(this._frameThumbs)){let{direction:i,pathNode:s,interactionNode:o,groupNode:n}=t,l=i==="",c=i.length===2,{x:u,y:d,width:p,height:f}=e;if(l)Ot(o,{x:u,y:d,width:p,height:f});else{let g=Et(Math.min(p,f)/(24*2+34)/2,0,1),{d:b,center:w}=c?Vo(e,i,g):Bo(e,i,g),C=Math.max(zr*Et(Math.min(p,f)/zr/3,0,1),zo);Ot(o,{x:w[0]-C,y:w[1]-C,width:C*2,height:C*2}),Ot(s,{d:b})}let m=this._shouldThumbBeDisabled(i);n.setAttribute("class",F("uc-thumb",{"uc-thumb--hidden":m,"uc-thumb--visible":!m}))}Ot(this._frameGuides,{x:e.x-1*.5,y:e.y-1*.5,width:e.width+1,height:e.height+1})}}_createThumb(e,t){let i=Z("g");i.classList.add("uc-thumb"),i.setAttribute("with-effects","");let s=Z("rect",{fill:"transparent"}),o=Z("path",{stroke:"currentColor",fill:"none","stroke-width":3});i.appendChild(o),i.appendChild(s),e[t]={direction:t,pathNode:o,interactionNode:s,groupNode:i},t===""&&(i.style.cursor="move"),s.addEventListener("pointerdown",this._handlePointerDown.bind(this,t))}_createThumbs(){let e={};for(let t=0;t<3;t++)for(let i=0;i<3;i++){let s=`${["n","","s"][t]}${["w","","e"][i]}`;s!==""&&this._createThumb(e,s)}return this._createThumb(e,""),e}_createGuides(){let e=Z("svg"),t=Z("rect",{x:0,y:0,width:"100%",height:"100%",fill:"none",stroke:"currentColor","stroke-width":1,"stroke-opacity":.5});e.appendChild(t);for(let i=1;i<=2;i++){let s=Z("line",{x1:`${Le*i}%`,y1:"0%",x2:`${Le*i}%`,y2:"100%",stroke:"currentColor","stroke-width":1,"stroke-opacity":.3});e.appendChild(s)}for(let i=1;i<=2;i++){let s=Z("line",{x1:"0%",y1:`${Le*i}%`,x2:"100%",y2:`${Le*i}%`,stroke:"currentColor","stroke-width":1,"stroke-opacity":.3});e.appendChild(s)}return e.classList.add("uc-guides","uc-guides--semi-hidden"),e}_createFrame(){let e=this.ref["svg-el"],t=document.createDocumentFragment(),i=this._createGuides();t.appendChild(i);let s=this._createThumbs();for(let{groupNode:o}of Object.values(s))t.appendChild(o);e.appendChild(t),this._frameThumbs=s,this._frameGuides=i}_handlePointerDown(e,t){if(!this._frameThumbs)return;let i=this._frameThumbs[e];if(this._shouldThumbBeDisabled(e))return;let s=this.$["*cropBox"],{x:o,y:n}=this.ref["svg-el"].getBoundingClientRect(),l=t.x-o,c=t.y-n;this.$.dragging=!0,this._draggingThumb=i,this._dragStartPoint=[l,c],this._dragStartCrop={...s}}_handlePointerUp_(e){this._updateCursor(),this.$.dragging&&(e.stopPropagation(),e.preventDefault(),this.$.dragging=!1)}_handlePointerMove_(e){if(!this.$.dragging||!this._dragStartPoint||!this._draggingThumb)return;e.stopPropagation(),e.preventDefault();let t=this.ref["svg-el"],{x:i,y:s}=t.getBoundingClientRect(),o=e.x-i,n=e.y-s,l=o-this._dragStartPoint[0],c=n-this._dragStartPoint[1],{direction:u}=this._draggingThumb,d=this._calcCropBox(u,[l,c]);d&&(this.$["*cropBox"]=d)}_calcCropBox(e,t){var u,d;let[i,s]=t,o=this.$["*imageBox"],n=(u=this._dragStartCrop)!=null?u:this.$["*cropBox"],l=(d=this.$["*cropPresetList"])==null?void 0:d[0],c=l?l.width/l.height:void 0;if(e===""?n=Ho({rect:n,delta:[i,s],imageBox:o}):n=Go({rect:n,delta:[i,s],direction:e,aspectRatio:c,imageBox:o}),!Object.values(n).every(p=>Number.isFinite(p)&&p>=0)){console.error("CropFrame is trying to create invalid rectangle",{payload:n});return}return Gt(Xt(n),this.$["*imageBox"])}_handleSvgPointerMove_(e){if(!this._frameThumbs)return;let t=Object.values(this._frameThumbs).find(i=>{if(this._shouldThumbBeDisabled(i.direction))return!1;let o=i.interactionNode.getBoundingClientRect(),n={x:o.x,y:o.y,width:o.width,height:o.height};return Wo(n,[e.x,e.y])});this._hoverThumb=t,this._updateCursor()}_updateCursor(){let e=this._hoverThumb;this.ref["svg-el"].style.cursor=e?jo(e.direction):"initial"}_render(){this._updateBackdrop(),this._updateFrame()}toggleThumbs(e){this._frameThumbs&&Object.values(this._frameThumbs).map(({groupNode:t})=>t).forEach(t=>{t.setAttribute("class",F("uc-thumb",{"uc-thumb--hidden":!e,"uc-thumb--visible":e}))})}initCallback(){super.initCallback(),this._createBackdrop(),this._createFrame(),this.sub("*imageBox",()=>{this._resizeBackdrop(),window.requestAnimationFrame(()=>{this._render()})}),this.sub("*cropBox",e=>{e&&(this._guidesHidden=e.height<=A||e.width<=A,window.requestAnimationFrame(()=>{this._render()}))}),this.sub("dragging",e=>{this._frameGuides&&this._frameGuides.setAttribute("class",F({"uc-guides--hidden":this._guidesHidden,"uc-guides--visible":!this._guidesHidden&&e,"uc-guides--semi-hidden":!this._guidesHidden&&!e}))}),this.ref["svg-el"].addEventListener("pointermove",this._handleSvgPointerMove,!0),document.addEventListener("pointermove",this._handlePointerMove,!0),document.addEventListener("pointerup",this._handlePointerUp,!0)}destroyCallback(){super.destroyCallback(),document.removeEventListener("pointermove",this._handlePointerMove),document.removeEventListener("pointerup",this._handlePointerUp)}};a(Es,"CropFrame");var Ge=Es;Ge.template='<svg class="uc-svg" ref="svg-el" xmlns="http://www.w3.org/2000/svg"></svg>';var Ts=class Ts extends y{constructor(){super(...arguments);h(this,"init$",{...this.init$,active:!1,title:"",icon:"","on.click":null,"title-prop":""})}initCallback(){super.initCallback(),this._titleEl=this.ref["title-el"],this._iconEl=this.ref["icon-el"],this.sub("title",t=>{this._titleEl&&(this._titleEl.style.display=t?"block":"none")}),this.sub("active",t=>{this.className=F({"uc-active":t,"uc-not_active":!t})}),this.sub("on.click",t=>{this.onclick=t})}};a(Ts,"EditorButtonControl");var _t=Ts;_t.template=`<button type="button" role="option" l10n="@title:title-prop"><uc-icon set="@name: icon;"></uc-icon><div class="uc-title" ref="title-el">{{title}}</div></button>`;function Rc(r){let e=r+90;return e=e>=360?0:e,e}a(Rc,"nextAngle");function Dc(r,e){return r==="rotate"?Rc(e):["mirror","flip"].includes(r)?!e:null}a(Dc,"nextValue");var Ss=class Ss extends _t{initCallback(){super.initCallback(),this.defineAccessor("operation",e=>{e&&(this._operation=e,this.$.icon=e,this.bindL10n("title-prop",()=>this.l10n("a11y-cloud-editor-apply-crop",{name:this.l10n(e).toLowerCase()})))}),this.$["on.click"]=()=>{let e=this.$["*cropperEl"].getValue(this._operation),t=Dc(this._operation,e);this.$["*cropperEl"].setValue(this._operation,t)}}};a(Ss,"EditorCropButtonControl");var ne=Ss;var We={FILTER:"filter",COLOR_OPERATION:"color_operation"},ut="original",$s=class $s extends y{constructor(){super(...arguments);h(this,"init$",{...this.init$,disabled:!1,min:0,max:100,value:0,defaultValue:0,zero:0,"on.input":t=>{this.$["*faderEl"].set(t),this.$.value=t}})}setOperation(t,i){this._controlType=t==="filter"?We.FILTER:We.COLOR_OPERATION,this._operation=t,this._iconName=t,this._title=t.toUpperCase(),this._filter=i,this._initializeValues(),this.$["*faderEl"].activate({url:this.$["*originalUrl"],operation:this._operation,value:this._filter===ut?void 0:this.$.value,filter:this._filter===ut?void 0:this._filter,fromViewer:!1})}_initializeValues(){let{range:t,zero:i}=rt[this._operation],[s,o]=t;this.$.min=s,this.$.max=o,this.$.zero=i;let n=this.$["*editorTransformations"][this._operation];if(this._controlType===We.FILTER){let l=o;if(n){let{name:c,amount:u}=n;l=c===this._filter?u:o}this.$.value=l,this.$.defaultValue=l}if(this._controlType===We.COLOR_OPERATION){let l=typeof n!="undefined"?n:i;this.$.value=l,this.$.defaultValue=l}}apply(){let t;this._controlType===We.FILTER?this._filter===ut?t=null:t={name:this._filter,amount:this.$.value}:t=this.$.value;let i={...this.$["*editorTransformations"],[this._operation]:t};this.$["*editorTransformations"]=i}cancel(){this.$["*faderEl"].deactivate({hide:!1})}initCallback(){super.initCallback(),this.sub("*originalUrl",t=>{this._originalUrl=t}),this.sub("value",t=>{let i=`${this._filter||this._operation} ${t}`;this.$["*operationTooltip"]=i})}};a($s,"EditorSlider");var Xe=$s;Xe.template=`<uc-slider-ui ref="slider-el" set="disabled: disabled; min: min; max: max; defaultValue: defaultValue; zero: zero; onInput: on.input;" ></uc-slider-ui>`;function qe(r){let e=new Image;return{promise:new Promise((s,o)=>{e.src=r,e.onload=s,e.onerror=o}),image:e,cancel:a(()=>{e.naturalWidth===0&&(e.src=lt)},"cancel")}}a(qe,"preloadImage");function Ke(r){let e=[];for(let o of r){let n=qe(o);e.push(n)}let t=e.map(o=>o.image);return{promise:Promise.allSettled(e.map(o=>o.promise)),images:t,cancel:a(()=>{e.forEach(o=>{o.cancel()})},"cancel")}}a(Ke,"batchPreloadImages");var ks=class ks extends _t{constructor(){super(),this.init$={...this.init$,active:!1,title:"",icon:"",isOriginal:!1,iconSize:"20","on.click":null}}_previewSrc(){let e=parseInt(window.getComputedStyle(this).getPropertyValue("--l-base-min-width"),10),t=window.devicePixelRatio,i=Math.ceil(t*e),s=t>=2?"lightest":"normal",o=100,n={...this.$["*editorTransformations"]};return n[this._operation]=this._filter!==ut?{name:this._filter,amount:o}:void 0,P(this._originalUrl,N(hi,wt(n),`quality/${s}`,`scale_crop/${i}x${i}/center`))}async _observerCallback(e,t){var s;if(e[0].isIntersecting){let o=await this.proxyUrl(this._previewSrc()),n=this.ref["preview-el"],{promise:l,cancel:c}=qe(o);this._cancelPreload=c,l.catch(u=>{this.$["*networkProblems"]=!0,console.error("Failed to load image",{error:u})}).finally(()=>{n.style.backgroundImage=`url(${o})`,n.setAttribute("loaded",""),t.unobserve(this)})}else(s=this._cancelPreload)==null||s.call(this)}initCallback(){super.initCallback(),this.$["on.click"]=()=>{this.$.active?this.$.isOriginal||(this.$["*sliderEl"].setOperation(this._operation,this._filter),this.$["*showSlider"]=!0):(this.$["*sliderEl"].setOperation(this._operation,this._filter),this.$["*sliderEl"].apply()),this.$["*currentFilter"]=this._filter},this.defineAccessor("filter",t=>{this._operation="filter",this._filter=t,this.$.isOriginal=t===ut,this.$.icon=this.$.isOriginal?"original":"slider",this.bindL10n("title-prop",()=>this.l10n("a11y-cloud-editor-apply-filter",{name:t.toLowerCase()}))}),this._observer=new window.IntersectionObserver(this._observerCallback.bind(this),{threshold:[0,1]});let e=this.$["*originalUrl"];this._originalUrl=e,this.$.isOriginal?this.ref["icon-el"].classList.add("uc-original-icon"):this._observer.observe(this),this.sub("*currentFilter",t=>{this.$.active=t&&t===this._filter}),this.sub("isOriginal",t=>{this.$.iconSize=t?40:20}),this.sub("active",t=>{if(this.$.isOriginal)return;let i=this.ref["icon-el"];i.style.opacity=t?"1":"0";let s=this.ref["preview-el"];t?s.style.opacity="0":s.style.backgroundImage&&(s.style.opacity="1")}),this.sub("*networkProblems",async t=>{if(!t){let i=await this.proxyUrl(this._previewSrc()),s=this.ref["preview-el"];s.style.backgroundImage&&(s.style.backgroundImage="none",s.style.backgroundImage=`url(${i})`)}})}destroyCallback(){var e,t;super.destroyCallback(),(e=this._observer)==null||e.disconnect(),(t=this._cancelPreload)==null||t.call(this)}};a(ks,"EditorFilterControl");var Ft=ks;Ft.template=`<button type="button" role="option" l10n="@title:title-prop"><div class="uc-preview" ref="preview-el"></div><uc-icon ref="icon-el" set="@name: icon; @size: iconSize;"></uc-icon></button>`;var Is=class Is extends _t{constructor(){super(...arguments);h(this,"_operation","")}initCallback(){super.initCallback(),this.$["on.click"]=t=>{this.$["*sliderEl"].setOperation(this._operation),this.$["*showSlider"]=!0,this.$["*currentOperation"]=this._operation},this.defineAccessor("operation",t=>{t&&(this._operation=t,this.$.icon=t,this.bindL10n("title-prop",()=>this.l10n("a11y-cloud-editor-apply-tuning",{name:this.l10n(t).toLowerCase()})),this.bindL10n("title",()=>this.l10n(t)))}),this.sub("*editorTransformations",t=>{if(!this._operation)return;let{zero:i}=rt[this._operation],s=t[this._operation],o=typeof s!="undefined"?s!==i:!1;this.$.active=o})}};a(Is,"EditorOperationControl");var ae=Is;function zn(r,e){let t={};for(let i of e){let s=r[i];(r.hasOwnProperty(i)||s!==void 0)&&(t[i]=s)}return t}a(zn,"pick");function le(r,e,t){let s=window.devicePixelRatio,o=Math.min(Math.ceil(e*s),3e3),n=s>=2?"lightest":"normal";return P(r,N(hi,wt(t),`quality/${n}`,`stretch/off/-/resize/${o}x`,`@clib/${Lt}/${Ut}/uc-cloud-image-editor/`))}a(le,"viewerImageSrc");function Fc(r){return r?[({dimensions:t,coords:i})=>[...t,...i].every(s=>Number.isInteger(s)&&Number.isFinite(s)),({dimensions:t,coords:i})=>t.every(s=>s>0)&&i.every(s=>s>=0)].every(t=>t(r)):!0}a(Fc,"validateCrop");var Os=class Os extends y{constructor(){super();h(this,"ctxOwner",!0);this.init$={...this.init$,image:null,"*padding":20,"*operations":{rotate:0,mirror:!1,flip:!1},"*imageBox":{x:0,y:0,width:0,height:0},"*cropBox":{x:0,y:0,width:0,height:0}},this._commitDebounced=U(this._commit.bind(this),300),this._handleResizeThrottled=Xi(this._handleResize.bind(this),100),this._imageSize={width:0,height:0}}_handleResize(){!this.isConnected||!this._isActive||(this._initCanvas(),this._syncTransformations(),this._alignImage(),this._alignCrop(),this._draw())}_syncTransformations(){let t=this.$["*editorTransformations"],i=zn(t,Object.keys(this.$["*operations"])),s={...this.$["*operations"],...i};this.$["*operations"]=s}_initCanvas(){let t=this.ref["canvas-el"],i=t.getContext("2d"),s=this.offsetWidth,o=this.offsetHeight,n=window.devicePixelRatio;t.style.width=`${s}px`,t.style.height=`${o}px`,t.width=s*n,t.height=o*n,i==null||i.scale(n,n),this._canvas=t,this._ctx=i}_alignImage(){if(!this._isActive||!this.$.image)return;let t=this.$.image,i=this.$["*padding"],s=this.$["*operations"],{rotate:o}=s,n={width:this.offsetWidth,height:this.offsetHeight},l=Wt({width:t.naturalWidth,height:t.naturalHeight},o),c;if(l.width>n.width-i*2||l.height>n.height-i*2){let u=l.width/l.height,d=n.width/n.height;if(u>d){let p=n.width-i*2,f=p/u,m=0+i,g=i+(n.height-i*2)/2-f/2;c={x:m,y:g,width:p,height:f}}else{let p=n.height-i*2,f=p*u,m=i+(n.width-i*2)/2-f/2,g=0+i;c={x:m,y:g,width:f,height:p}}}else{let{width:u,height:d}=l,p=i+(n.width-i*2)/2-u/2,f=i+(n.height-i*2)/2-d/2;c={x:p,y:f,width:u,height:d}}this.$["*imageBox"]=Xt(c)}_alignCrop(){var f;let t=this.$["*cropBox"],i=this.$["*imageBox"],s=this.$["*operations"],{rotate:o}=s,n=this.$["*editorTransformations"].crop,{width:l,x:c,y:u}=this.$["*imageBox"];if(n){let{dimensions:[m,g],coords:[b,w]}=n,{width:C}=Wt(this._imageSize,o),v=l/C;t=Gt(Xt({x:c+b*v,y:u+w*v,width:m*v,height:g*v}),this.$["*imageBox"])}let d=(f=this.$["*cropPresetList"])==null?void 0:f[0],p=d?d.width/d.height:void 0;if(!Xo(t,i)||p&&!qo(t,p)){let m=i.width/i.height,g=i.width,b=i.height;p&&(m>p?g=Math.min(i.height*p,i.width):b=Math.min(i.width/p,i.height)),t={x:i.x+i.width/2-g/2,y:i.y+i.height/2-b/2,width:g,height:b}}this.$["*cropBox"]=Gt(Xt(t),this.$["*imageBox"])}_drawImage(){let t=this._ctx;if(!t)return;let i=this.$.image,s=this.$["*imageBox"],o=this.$["*operations"],{mirror:n,flip:l,rotate:c}=o,u=Wt({width:s.width,height:s.height},c);t.save(),t.translate(s.x+s.width/2,s.y+s.height/2),t.rotate(c*Math.PI*-1/180),t.scale(n?-1:1,l?-1:1),t.drawImage(i,-u.width/2,-u.height/2,u.width,u.height),t.restore()}_draw(){if(!this._isActive||!this.$.image||!this._canvas||!this._ctx)return;let t=this._canvas;this._ctx.clearRect(0,0,t.width,t.height),this._drawImage()}_animateIn({fromViewer:t}){this.$.image&&(this.ref["frame-el"].toggleThumbs(!0),this._transitionToImage(),setTimeout(()=>{this.className=F({"uc-active_from_viewer":t,"uc-active_from_editor":!t,"uc-inactive_to_editor":!1})}))}_getCropDimensions(){let t=this.$["*cropBox"],i=this.$["*imageBox"],s=this.$["*operations"],{rotate:o}=s,{width:n,height:l}=i,{width:c,height:u}=Wt(this._imageSize,o),{width:d,height:p}=t,f=n/c,m=l/u;return[Et(Math.round(d/f),1,c),Et(Math.round(p/m),1,u)]}_getCropTransformation(){let t=this.$["*cropBox"],i=this.$["*imageBox"],s=this.$["*operations"],{rotate:o}=s,{width:n,height:l,x:c,y:u}=i,{width:d,height:p}=Wt(this._imageSize,o),{x:f,y:m}=t,g=n/d,b=l/p,w=this._getCropDimensions(),C={dimensions:w,coords:[Et(Math.round((f-c)/g),0,d-w[0]),Et(Math.round((m-u)/b),0,p-w[1])]};if(!Fc(C)){console.error("Cropper is trying to create invalid crop object",{payload:C});return}if(!(w[0]===d&&w[1]===p))return C}_commit(){if(!this.isConnected||!this._imageSize)return;let t=this.$["*operations"],{rotate:i,mirror:s,flip:o}=t,n=this._getCropTransformation(),c={...this.$["*editorTransformations"],crop:n,rotate:i,mirror:s,flip:o};this.$["*editorTransformations"]=c}setValue(t,i){this.$["*operations"]={...this.$["*operations"],[t]:i},this._isActive&&(this._alignImage(),this._alignCrop(),this._draw())}getValue(t){return this.$["*operations"][t]}async activate(t,{fromViewer:i}={}){if(!this._isActive){this._isActive=!0,this._imageSize=t,this.removeEventListener("transitionend",this._reset);try{this.$.image=await this._waitForImage(this.$["*originalUrl"],this.$["*editorTransformations"]),this._syncTransformations(),this._animateIn({fromViewer:i})}catch(s){console.error("Failed to activate cropper",{error:s})}this._observer=new ResizeObserver(([s])=>{s.contentRect.width>0&&s.contentRect.height>0&&this._isActive&&this.$.image&&this._handleResizeThrottled()}),this._observer.observe(this)}}deactivate({reset:t=!1}={}){var i;this._isActive&&(!t&&this._commit(),this._isActive=!1,this._transitionToCrop(),this.className=F({"uc-active_from_viewer":!1,"uc-active_from_editor":!1,"uc-inactive_to_editor":!0}),this.ref["frame-el"].toggleThumbs(!1),this.addEventListener("transitionend",this._reset,{once:!0}),(i=this._observer)==null||i.disconnect())}_transitionToCrop(){let t=this._getCropDimensions(),i=Math.min(this.offsetWidth,t[0])/this.$["*cropBox"].width,s=Math.min(this.offsetHeight,t[1])/this.$["*cropBox"].height,o=Math.min(i,s),n=this.$["*cropBox"].x+this.$["*cropBox"].width/2,l=this.$["*cropBox"].y+this.$["*cropBox"].height/2;this.style.transform=`scale(${o}) translate(${(this.offsetWidth/2-n)/o}px, ${(this.offsetHeight/2-l)/o}px)`,this.style.transformOrigin=`${n}px ${l}px`}_transitionToImage(){let t=this.$["*cropBox"].x+this.$["*cropBox"].width/2,i=this.$["*cropBox"].y+this.$["*cropBox"].height/2;this.style.transform="scale(1)",this.style.transformOrigin=`${t}px ${i}px`}_reset(){this._isActive||(this.$.image=null)}async _waitForImage(t,i){var d;let s=this.offsetWidth;i={...i,crop:void 0,rotate:void 0,flip:void 0,mirror:void 0};let o=await this.proxyUrl(le(t,s,i)),{promise:n,cancel:l,image:c}=qe(o),u=this._handleImageLoading(o);return c.addEventListener("load",u,{once:!0}),c.addEventListener("error",u,{once:!0}),(d=this._cancelPreload)==null||d.call(this),this._cancelPreload=l,n.then(()=>c).catch(p=>(console.error("Failed to load image",{error:p}),this.$["*networkProblems"]=!0,Promise.resolve(c)))}_handleImageLoading(t){let i="crop",s=this.$["*loadingOperations"];return s.get(i)||s.set(i,new Map),s.get(i).get(t)||(s.set(i,s.get(i).set(t,!0)),this.$["*loadingOperations"]=s),()=>{var o;(o=s==null?void 0:s.get(i))!=null&&o.has(t)&&(s.get(i).delete(t),this.$["*loadingOperations"]=s)}}initCallback(){super.initCallback(),this.sub("*imageBox",()=>{this._draw()}),this.sub("*cropBox",()=>{this.$.image&&this._commitDebounced()}),this.sub("*cropPresetList",()=>{this._alignCrop()}),setTimeout(()=>{this.sub("*networkProblems",t=>{t||this._isActive&&this.activate(this._imageSize,{fromViewer:!1})})},0)}destroyCallback(){var t;super.destroyCallback(),(t=this._observer)==null||t.disconnect()}};a(Os,"EditorImageCropper");var Ze=Os;Ze.template=`<canvas class="uc-canvas" ref="canvas-el"></canvas><uc-crop-frame ref="frame-el"></uc-crop-frame>`;function Ls(r,e,t){let i=Array(t);t--;for(let s=t;s>=0;s--)i[s]=Math.ceil((s*e+(t-s)*r)/t);return i}a(Ls,"linspace");function Nc(r){return r.reduce((e,t,i)=>i<r.length-1?[...e,[t,r[i+1]]]:e,[])}a(Nc,"splitBySections");function zc(r,e,t){let i=Nc(r).find(([s,o])=>s<=e&&e<=o);return r.map(s=>{let o=Math.abs(i[0]-i[1]),n=Math.abs(e-i[0])/o;return i[0]===s?e>t?1:1-n:i[1]===s?e>=t?n:1:0})}a(zc,"calculateOpacities");function Vc(r,e){return r.map((t,i)=>t<e?r.length-i:i)}a(Vc,"calculateZIndices");function Vn(r,e){let t=rt[r].keypointsNumber,{range:i,zero:s}=rt[r];return[...new Set([...Ls(i[0],s,t+1),...Ls(s,i[1],t+1),s,e])].sort((o,n)=>o-n)}a(Vn,"keypointsRange");var Us=class Us extends y{constructor(){super(),this._isActive=!1,this._hidden=!0,this._addKeypointDebounced=U(this._addKeypoint.bind(this),600),this.classList.add("uc-inactive_to_cropper")}_handleImageLoading(e){let t=this._operation,i=this.$["*loadingOperations"];return i.get(t)||i.set(t,new Map),i.get(t).get(e)||(i.set(t,i.get(t).set(e,!0)),this.$["*loadingOperations"]=i),()=>{var s;(s=i==null?void 0:i.get(t))!=null&&s.has(e)&&(i.get(t).delete(e),this.$["*loadingOperations"]=i)}}_flush(){window.cancelAnimationFrame(this._raf),this._raf=window.requestAnimationFrame(()=>{for(let e of this._keypoints){let{image:t}=e;t&&(t.style.opacity=e.opacity.toString(),t.style.zIndex=e.zIndex.toString())}})}async _imageSrc({url:e=this._url,filter:t=this._filter,operation:i,value:s}={}){let o={...this._transformations};i&&(o[i]=t?{name:t,amount:s}:s);let n=this.offsetWidth;return await this.proxyUrl(le(e,n,o))}async _constructKeypoint(e,t){return{src:await this._imageSrc({operation:e,value:t}),image:null,opacity:0,zIndex:0,value:t}}_isSame(e,t){return this._operation===e&&this._filter===t}async _addKeypoint(e,t,i){let s=a(()=>!this._isSame(e,t)||this._value!==i||!!this._keypoints.find(c=>c.value===i),"shouldSkip");if(s())return;let o=await this._constructKeypoint(e,i),n=new Image;n.src=o.src;let l=this._handleImageLoading(o.src);n.addEventListener("load",l,{once:!0}),n.addEventListener("error",l,{once:!0}),o.image=n,n.classList.add("uc-fader-image"),n.addEventListener("load",()=>{if(s())return;let c=this._keypoints,u=c.findIndex(p=>p.value>i),d=u<c.length?c[u].image:null;!this._container||d&&!this._container.contains(d)||(c.splice(u,0,o),this._container.insertBefore(n,d),this._update(e,i))},{once:!0}),n.addEventListener("error",()=>{this.$["*networkProblems"]=!0},{once:!0})}set(e){e=typeof e=="string"?parseInt(e,10):e,this._update(this._operation,e),this._addKeypointDebounced(this._operation,this._filter,e)}_update(e,t){this._operation=e,this._value=t;let{zero:i}=rt[e],s=this._keypoints.map(l=>l.value),o=zc(s,t,i),n=Vc(s,i);for(let[l,c]of Object.entries(this._keypoints))c.opacity=o[l],c.zIndex=n[l];this._flush()}_createPreviewImage(){let e=new Image;return e.classList.add("uc-fader-image","uc-fader-image--preview"),e.style.opacity="0",e}async _initNodes(){let e=document.createDocumentFragment();this._previewImage=this._previewImage||this._createPreviewImage(),!this.contains(this._previewImage)&&e.appendChild(this._previewImage);let t=document.createElement("div");e.appendChild(t);let i=this._keypoints.map(u=>u.src),{images:s,promise:o,cancel:n}=Ke(i);s.forEach(u=>{let d=this._handleImageLoading(u.src);u.addEventListener("load",d),u.addEventListener("error",d)}),this._cancelLastImages=()=>{n(),this._cancelLastImages=void 0};let l=this._operation,c=this._filter;await o,this._isActive&&this._isSame(l,c)&&(this._container&&this._container.remove(),this._container=t,this._keypoints.forEach((u,d)=>{let p=s[d];p.classList.add("uc-fader-image"),u.image=p,this._container.appendChild(p)}),this.appendChild(e),this._flush())}async setTransformations(e){if(this._transformations=e,this._previewImage){let t=await this._imageSrc(),i=this._handleImageLoading(t);this._previewImage.src=t,this._previewImage.addEventListener("load",i,{once:!0}),this._previewImage.addEventListener("error",i,{once:!0}),this._previewImage.style.opacity="1",this._previewImage.addEventListener("error",()=>{this.$["*networkProblems"]=!0},{once:!0})}}async preload({url:e,filter:t,operation:i,value:s}){this._cancelBatchPreload&&this._cancelBatchPreload();let o=Vn(i,s),n=await Promise.all(o.map(c=>this._imageSrc({url:e,filter:t,operation:i,value:c}))),{cancel:l}=Ke(n);this._cancelBatchPreload=l}_setOriginalSrc(e){let t=this._previewImage||this._createPreviewImage();if(!this.contains(t)&&this.appendChild(t),this._previewImage=t,t.src===e){t.style.opacity="1",t.style.transform="scale(1)",this.className=F({"uc-active_from_viewer":this._fromViewer,"uc-active_from_cropper":!this._fromViewer,"uc-inactive_to_cropper":!1});return}t.style.opacity="0";let i=this._handleImageLoading(e);t.addEventListener("error",i,{once:!0}),t.src=e,t.addEventListener("load",()=>{i(),t&&(t.style.opacity="1",t.style.transform="scale(1)",this.className=F({"uc-active_from_viewer":this._fromViewer,"uc-active_from_cropper":!this._fromViewer,"uc-inactive_to_cropper":!1}))},{once:!0}),t.addEventListener("error",()=>{this.$["*networkProblems"]=!0},{once:!0})}async activate({url:e,operation:t,value:i,filter:s,fromViewer:o}){if(this._isActive=!0,this._hidden=!1,this._url=e,this._operation=t||"initial",this._value=i,this._filter=s,this._fromViewer=o,typeof i!="number"&&!s){let l=await this._imageSrc({operation:t,value:i});this._setOriginalSrc(l),this._container&&this._container.remove();return}this._keypoints=await Promise.all(Vn(t,i).map(l=>this._constructKeypoint(t,l))),this._update(t,i),this._initNodes()}deactivate({hide:e=!0}={}){this._isActive=!1,this._cancelLastImages&&this._cancelLastImages(),this._cancelBatchPreload&&this._cancelBatchPreload(),e&&!this._hidden?(this._hidden=!0,this._previewImage&&(this._previewImage.style.transform="scale(1)"),this.className=F({"uc-active_from_viewer":!1,"uc-active_from_cropper":!1,"uc-inactive_to_cropper":!0}),this.addEventListener("transitionend",()=>{this._container&&this._container.remove()},{once:!0})):this._container&&this._container.remove()}};a(Us,"EditorImageFader");var Zi=Us;var Bc=1,Ps=class Ps extends y{initCallback(){super.initCallback(),this.addEventListener("wheel",e=>{e.preventDefault();let{deltaY:t,deltaX:i}=e;Math.abs(i)>Bc?this.scrollLeft+=i:this.scrollLeft+=t},{passive:!1}),this.addEventListener("scroll",()=>{},{passive:!0})}};a(Ps,"EditorScroller");var Ye=Ps;Ye.template=" <slot></slot> ";function jc(r){return`<uc-presence-toggle class="uc-tab-toggle" set="visible: presence.tabToggle.${r}; styles: presence.tabToggleStyles;" ><uc-btn-ui theme="tab" ref="tab-toggle-${r}" data-id="${r}" icon="${r}" set="onclick: on.clickTab; aria-role:tab_role; aria-controls:tab_${r}; title-prop: a11y-editor-tab-${r}" ></uc-btn-ui></uc-presence-toggle>`}a(jc,"renderTabToggle");function Hc(r){return`<uc-presence-toggle id="tab_${r}" class="uc-tab-content" set="visible: presence.tabContent.${r}; styles: presence.tabContentStyles" ><uc-editor-scroller hidden-scrollbar><div class="uc-controls-list_align"><div role="listbox" aria-orientation="horizontal" class="uc-controls-list_inner" ref="controls-list-${r}" ></div></div></uc-editor-scroller></uc-presence-toggle>`}a(Hc,"renderTabContent");var Ms=class Ms extends y{constructor(){super();h(this,"_updateInfoTooltip",U(()=>{var n,l;let t=this.$["*editorTransformations"],i=this.$["*currentOperation"],s="",o=!1;if(this.$["*tabId"]===O.FILTERS)if(o=!0,this.$["*currentFilter"]&&((n=t==null?void 0:t.filter)==null?void 0:n.name)===this.$["*currentFilter"]){let c=((l=t==null?void 0:t.filter)==null?void 0:l.amount)||100;s=this.$["*currentFilter"]+" "+c}else s=this.l10n(ut);else if(this.$["*tabId"]===O.TUNING&&i){o=!0;let c=(t==null?void 0:t[i])||rt[i].zero;s=this.l10n(i)+" "+c}o&&(this.$["*operationTooltip"]=s),this.ref["tooltip-el"].classList.toggle("uc-info-tooltip_visible",o)},0));this.init$={...this.init$,"*sliderEl":null,"*loadingOperations":new Map,"*showSlider":!1,"*currentFilter":ut,"*currentOperation":null,showLoader:!1,filters:ao,colorOperations:no,cropOperations:lo,"*operationTooltip":null,"presence.mainToolbar":!0,"presence.subToolbar":!1,"presence.tabToggles":!0,"presence.tabContent.crop":!1,"presence.tabContent.tuning":!1,"presence.tabContent.filters":!1,"presence.tabToggle.crop":!0,"presence.tabToggle.tuning":!0,"presence.tabToggle.filters":!0,"presence.subTopToolbarStyles":{hidden:"uc-sub-toolbar--top-hidden",visible:"uc-sub-toolbar--visible"},"presence.subBottomToolbarStyles":{hidden:"uc-sub-toolbar--bottom-hidden",visible:"uc-sub-toolbar--visible"},"presence.tabContentStyles":{hidden:"uc-tab-content--hidden",visible:"uc-tab-content--visible"},"presence.tabToggleStyles":{hidden:"uc-tab-toggle--hidden",visible:"uc-tab-toggle--visible"},"presence.tabTogglesStyles":{hidden:"uc-tab-toggles--hidden",visible:"uc-tab-toggles--visible"},"on.cancel":()=>{var t;(t=this._cancelPreload)==null||t.call(this),this.$["*on.cancel"]()},"on.apply":()=>{this.$["*on.apply"](this.$["*editorTransformations"])},"on.applySlider":()=>{this.ref["slider-el"].apply(),this._onSliderClose()},"on.cancelSlider":()=>{this.ref["slider-el"].cancel(),this._onSliderClose()},"on.clickTab":t=>{let i=t.currentTarget.getAttribute("data-id");i&&this._activateTab(i,{fromViewer:!1})},tab_role:"tab",[`tab_${O.TUNING}`]:`tab_${O.TUNING}`,[`tab_${O.CROP}`]:`tab_${O.CROP}`,[`tab_${O.FILTERS}`]:`tab_${O.FILTERS}`,cancel:"cancel",apply:"apply","a11y-editor-tab-filters":"a11y-editor-tab-filters","a11y-editor-tab-tuning":"a11y-editor-tab-tuning","a11y-editor-tab-crop":"a11y-editor-tab-crop"},this._debouncedShowLoader=U(this._showLoader.bind(this),500)}_onSliderClose(){this.$["*showSlider"]=!1,this.$["*tabId"]===O.TUNING&&this.ref["tooltip-el"].classList.toggle("uc-info-tooltip_visible",!1)}_createOperationControl(t){let i=new ae;return i.operation=t,i}_createFilterControl(t){let i=new Ft;return i.filter=t,i}_createToggleControl(t){let i=new ne;return i.operation=t,i}_renderControlsList(t){let i=this.ref[`controls-list-${t}`],s=document.createDocumentFragment();t===O.CROP?this.$.cropOperations.forEach(o=>{let n=this._createToggleControl(o);s.appendChild(n)}):t===O.FILTERS?[ut,...this.$.filters].forEach(o=>{let n=this._createFilterControl(o);s.appendChild(n)}):t===O.TUNING&&this.$.colorOperations.forEach(o=>{let n=this._createOperationControl(o);s.appendChild(n)}),[...s.children].forEach((o,n)=>{n===s.childNodes.length-1&&o.classList.add("uc-controls-list_last-item")}),i.innerHTML="",i.appendChild(s)}_activateTab(t,{fromViewer:i}){this.$["*tabId"]=t,t===O.CROP?(this.$["*faderEl"].deactivate(),this.$["*cropperEl"].activate(this.$["*imageSize"],{fromViewer:i})):(this.$["*faderEl"].activate({url:this.$["*originalUrl"],fromViewer:i}),this.$["*cropperEl"].deactivate());for(let s of G){let o=s===t,n=this.ref[`tab-toggle-${s}`];n.active=o,o?(this._renderControlsList(t),this._syncTabIndicator()):this._unmountTabControls(s),this.$[`presence.tabContent.${s}`]=o}}_unmountTabControls(t){let i=this.ref[`controls-list-${t}`];i&&(i.innerHTML="")}_syncTabIndicator(){let t=this.ref[`tab-toggle-${this.$["*tabId"]}`],i=this.ref["tabs-indicator"];i.style.transform=`translateX(${t.offsetLeft}px)`}async _preloadEditedImage(){var t;if(this.$["*imgContainerEl"]&&this.$["*originalUrl"]){let i=this.$["*imgContainerEl"].offsetWidth,s=await this.proxyUrl(le(this.$["*originalUrl"],i,this.$["*editorTransformations"]));(t=this._cancelPreload)==null||t.call(this);let{cancel:o}=Ke([s]);this._cancelPreload=()=>{o(),this._cancelPreload=void 0}}}_showLoader(t){this.$.showLoader=t}initCallback(){super.initCallback(),this.$["*sliderEl"]=this.ref["slider-el"],this.sub("*imageSize",t=>{t&&setTimeout(()=>{this._activateTab(this.$["*tabId"],{fromViewer:!0})},0)}),this.sub("*editorTransformations",t=>{var s;let i=(s=t==null?void 0:t.filter)==null?void 0:s.name;this.$["*currentFilter"]!==i&&(this.$["*currentFilter"]=i)}),this.sub("*currentFilter",()=>{this._updateInfoTooltip()}),this.sub("*currentOperation",()=>{this._updateInfoTooltip()}),this.sub("*tabId",()=>{this._updateInfoTooltip()}),this.sub("*originalUrl",()=>{this.$["*faderEl"]&&this.$["*faderEl"].deactivate()}),this.sub("*editorTransformations",t=>{this._preloadEditedImage(),this.$["*faderEl"]&&this.$["*faderEl"].setTransformations(t)}),this.sub("*loadingOperations",t=>{let i=!1;for(let[,s]of t.entries()){if(i)break;for(let[,o]of s.entries())if(o){i=!0;break}}this._debouncedShowLoader(i)}),this.sub("*showSlider",t=>{this.$["presence.subToolbar"]=t,this.$["presence.mainToolbar"]=!t}),this.sub("*tabList",t=>{this.$["presence.tabToggles"]=t.length>1;for(let i of G){this.$[`presence.tabToggle.${i}`]=t.includes(i);let s=this.ref[`tab-toggle-${i}`];s.style.gridColumn=t.indexOf(i)+1}t.includes(this.$["*tabId"])||this._activateTab(t[0],{fromViewer:!1})}),this._updateInfoTooltip()}};a(Ms,"EditorToolbar");var Je=Ms;Je.template=`<uc-line-loader-ui set="active: showLoader"></uc-line-loader-ui><div class="uc-info-tooltip_container"><div class="uc-info-tooltip_wrapper"><div ref="tooltip-el" class="uc-info-tooltip uc-info-tooltip_hidden">{{*operationTooltip}}</div></div></div><div class="uc-toolbar-container"><uc-presence-toggle role="tablist" class="uc-sub-toolbar" set="visible: presence.mainToolbar; styles: presence.subTopToolbarStyles" ><div class="uc-tab-content-row">${G.map(Hc).join("")}</div><div class="uc-controls-row"><uc-presence-toggle class="uc-tab-toggles" set="visible: presence.tabToggles; styles: presence.tabTogglesStyles" ><div ref="tabs-indicator" class="uc-tab-toggles_indicator"></div> ${G.map(jc).join("")} </uc-presence-toggle><uc-btn-ui style="order: -1" theme="secondary-icon" icon="closeMax" set="onclick: on.cancel; title-prop:cancel"></uc-btn-ui><uc-btn-ui theme="primary-icon" icon="done" set="onclick: on.apply; title-prop:apply"></uc-btn-ui></div></uc-presence-toggle><uc-presence-toggle class="uc-sub-toolbar" set="visible: presence.subToolbar; styles: presence.subBottomToolbarStyles" ><div class="uc-slider"><uc-editor-slider ref="slider-el"></uc-editor-slider></div><div class="uc-controls-row"><uc-btn-ui theme="secondary" set="onclick: on.cancelSlider" l10n="@text:cancel"></uc-btn-ui><uc-btn-ui theme="primary" set="onclick: on.applySlider" l10n="@text:apply"></uc-btn-ui></div></uc-presence-toggle></div>`;var Rs=class Rs extends y{constructor(){super(),this._iconReversed=!1,this._iconSingle=!1,this._iconHidden=!1,this.init$={...this.init$,text:"",icon:"",iconCss:this._iconCss(),theme:null,"aria-role":"","aria-controls":"","title-prop":""},this.defineAccessor("active",e=>{e?this.setAttribute("active",""):this.removeAttribute("active")})}_iconCss(){return F("uc-icon",{"uc-icon_left":!this._iconReversed,"uc-icon_right":this._iconReversed,"uc-icon_hidden":this._iconHidden,"uc-icon_single":this._iconSingle})}initCallback(){super.initCallback(),this.sub("icon",e=>{this._iconSingle=!this.$.text,this._iconHidden=!e,this.$.iconCss=this._iconCss()}),this.sub("theme",e=>{e!=="custom"&&(this.className=`uc-${e}`)}),this.sub("text",e=>{this._iconSingle=!1}),this.hasAttribute("theme")||this.setAttribute("theme","default"),this.defineAccessor("aria-role",e=>{this.$["aria-role"]=e||""}),this.defineAccessor("aria-controls",e=>{this.$["aria-controls"]=e||""}),this.defineAccessor("title-prop",e=>{this.$["title-prop"]=e||""})}set reverse(e){this.hasAttribute("reverse")?(this.style.flexDirection="row-reverse",this._iconReversed=!0):(this._iconReversed=!1,this.style.flexDirection=null)}};a(Rs,"BtnUi");var ce=Rs;ce.bindAttributes({text:"text",icon:"icon",reverse:"reverse",theme:"theme"});ce.template=`<button type="button" set="@role:aria-role; @aria-controls: aria-controls;" l10n="@title:title-prop"><uc-icon set="className: iconCss; @name: icon; @hidden: !icon"></uc-icon><div class="uc-text">{{text}}</div></button>`;var Ds=class Ds extends y{constructor(){super(),this._active=!1,this._handleTransitionEndRight=()=>{let e=this.ref["line-el"];e.style.transition="initial",e.style.opacity="0",e.style.transform="translateX(-101%)",this._active&&this._start()}}initCallback(){super.initCallback(),this.defineAccessor("active",e=>{typeof e=="boolean"&&(e?this._start():this._stop())})}_start(){this._active=!0;let{width:e}=this.getBoundingClientRect(),t=this.ref["line-el"];t.style.transition="transform 1s",t.style.opacity="1",t.style.transform=`translateX(${e}px)`,t.addEventListener("transitionend",this._handleTransitionEndRight,{once:!0})}_stop(){this._active=!1}};a(Ds,"LineLoaderUi");var Qe=Ds;Qe.template=`<div class="uc-inner"><div class="uc-line" ref="line-el"></div></div>`;var Yi={transition:"uc-transition",visible:"uc-visible",hidden:"uc-hidden"},Fs=class Fs extends y{constructor(){super(),this._visible=!1,this._visibleStyle=Yi.visible,this._hiddenStyle=Yi.hidden,this._externalTransitions=!1,this.defineAccessor("styles",e=>{e&&(this._externalTransitions=!0,this._visibleStyle=e.visible,this._hiddenStyle=e.hidden)}),this.defineAccessor("visible",e=>{typeof e=="boolean"&&(this._visible=e,this._handleVisible())})}_handleVisible(){this.style.visibility=this._visible?"inherit":"hidden",Mn(this,{[Yi.transition]:!this._externalTransitions,[this._visibleStyle]:this._visible,[this._hiddenStyle]:!this._visible}),this.setAttribute("aria-hidden",this._visible?"false":"true")}initCallback(){super.initCallback(),this.classList.toggle("uc-initial",!0),this._externalTransitions||this.classList.add(Yi.transition),this._handleVisible(),setTimeout(()=>{this.classList.toggle("uc-initial",!1)},0)}};a(Fs,"PresenceToggle");var ti=Fs;ti.template="<slot></slot> ";var Ns=class Ns extends y{constructor(){super();h(this,"init$",{...this.init$,disabled:!1,min:0,max:100,onInput:null,onChange:null,defaultValue:null,"on.sliderInput":()=>{let t=parseInt(this.ref["input-el"].value,10);this._updateValue(t),this.$.onInput&&this.$.onInput(t)},"on.sliderChange":()=>{let t=parseInt(this.ref["input-el"].value,10);this.$.onChange&&this.$.onChange(t)}});this.setAttribute("with-effects","")}initCallback(){super.initCallback(),this.defineAccessor("disabled",i=>{this.$.disabled=i}),this.defineAccessor("min",i=>{this.$.min=i}),this.defineAccessor("max",i=>{this.$.max=i}),this.defineAccessor("defaultValue",i=>{this.$.defaultValue=i,this.ref["input-el"].value=i,this._updateValue(i)}),this.defineAccessor("zero",i=>{this._zero=i}),this.defineAccessor("onInput",i=>{i&&(this.$.onInput=i)}),this.defineAccessor("onChange",i=>{i&&(this.$.onChange=i)}),this._updateSteps(),this._observer=new ResizeObserver(()=>{this._updateSteps();let i=parseInt(this.ref["input-el"].value,10);this._updateValue(i)}),this._observer.observe(this),this._thumbSize=parseInt(window.getComputedStyle(this).getPropertyValue("--l-thumb-size"),10),setTimeout(()=>{let i=parseInt(this.ref["input-el"].value,10);this._updateValue(i)},0),this.sub("disabled",i=>{let s=this.ref["input-el"];i?s.setAttribute("disabled","disabled"):s.removeAttribute("disabled")});let t=this.ref["input-el"];t.addEventListener("focus",()=>{this.style.setProperty("--color-effect","var(--hover-color-rgb)")}),t.addEventListener("blur",()=>{this.style.setProperty("--color-effect","var(--idle-color-rgb)")})}_updateValue(t){this._updateZeroDot(t);let{width:i}=this.getBoundingClientRect(),n=100/(this.$.max-this.$.min)*(t-this.$.min)*(i-this._thumbSize)/100;window.requestAnimationFrame(()=>{this.ref["thumb-el"].style.transform=`translateX(${n}px)`})}_updateZeroDot(t){if(!this._zeroDotEl)return;t===this._zero?this._zeroDotEl.style.opacity="0":this._zeroDotEl.style.opacity="1";let{width:i}=this.getBoundingClientRect(),n=100/(this.$.max-this.$.min)*(this._zero-this.$.min)*(i-this._thumbSize)/100;window.requestAnimationFrame(()=>{this._zeroDotEl.style.transform=`translateX(${n}px)`})}_updateSteps(){let i=this.ref["steps-el"],{width:s}=i.getBoundingClientRect(),o=Math.ceil(s/2),n=Math.ceil(o/15)-2;if(this._stepsCount===n)return;let l=document.createDocumentFragment(),c=document.createElement("div"),u=document.createElement("div");c.className="uc-minor-step",u.className="uc-border-step",l.appendChild(u);for(let p=0;p<n;p++)l.appendChild(c.cloneNode());l.appendChild(u.cloneNode());for(let p=0;p<n;p++)l.appendChild(c.cloneNode());l.appendChild(u.cloneNode());let d=document.createElement("div");d.className="uc-zero-dot",l.appendChild(d),this._zeroDotEl=d,i.innerHTML="",i.appendChild(l),this._stepsCount=n}destroyCallback(){var t;super.destroyCallback(),(t=this._observer)==null||t.disconnect()}};a(Ns,"SliderUi");var ei=Ns;ei.template=`<div class="uc-steps" ref="steps-el"></div><div ref="thumb-el" class="uc-thumb"></div><input class="uc-input" type="range" ref="input-el" set="oninput: on.sliderInput; onchange: on.sliderChange; @min: min; @max: max; @value: defaultValue;" />`;var zs=class zs extends ${constructor(){super(...arguments);h(this,"couldBeCtxOwner",!0);h(this,"activityType",_.activities.CLOUD_IMG_EDIT);h(this,"_entry");h(this,"_instance")}get activityParams(){let t=super.activityParams;if("internalId"in t)return t;throw new Error("Cloud Image Editor activity params not found")}initCallback(){super.initCallback(),this.registerActivity(this.activityType,{onActivate:()=>this.mountEditor(),onDeactivate:()=>this.unmountEditor()}),this.subConfigValue("cropPreset",t=>{this._instance&&this._instance.getAttribute("crop-preset")!==t&&this._instance.setAttribute("crop-preset",t)}),this.subConfigValue("cloudImageEditorTabs",t=>{this._instance&&this._instance.getAttribute("tabs")!==t&&this._instance.setAttribute("tabs",t)})}handleApply(t){if(!this._entry)return;let i=t.detail;this._entry.setMultipleValues({cdnUrl:i.cdnUrl,cdnUrlModifiers:i.cdnUrlModifiers}),this.historyBack()}handleCancel(){this.historyBack()}mountEditor(){let{internalId:t}=this.activityParams;if(this._entry=this.uploadCollection.read(t),!this._entry)throw new Error(`Entry with internalId "${t}" not found`);let i=this._entry.getValue("cdnUrl");if(!i)throw new Error(`Entry with internalId "${t}" hasn't uploaded yet`);let s=new ct,o=this.cfg.cropPreset,n=this.cfg.cloudImageEditorTabs;s.setAttribute("ctx-name",this.ctxName),s.setAttribute("cdn-url",i),o&&s.setAttribute("crop-preset",o),n&&s.setAttribute("tabs",n),s.addEventListener("apply",l=>{let c=l;this.handleApply(c),this.debugPrint('editor event "apply"',c.detail)}),s.addEventListener("cancel",l=>{let c=l;this.handleCancel(),this.debugPrint('editor event "cancel"',c.detail)}),s.addEventListener("change",l=>{let c=l;this.debugPrint('editor event "change"',c.detail)}),this.innerHTML="",this.appendChild(s),this._instance=s}unmountEditor(){this._instance=void 0,this._entry=void 0,this.innerHTML=""}};a(zs,"CloudImageEditorActivity");var Ji=zs;var Gc=a(function(r){return r.replace(/[\\-\\[]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},"escapeRegExp"),Bn=a(function(r,e="i"){let t=r.split("*").map(Gc);return new RegExp("^"+t.join(".+")+"$",e)},"wildcardRegexp");var Wc=a(r=>Object.keys(r).reduce((t,i)=>{let s=r[i],o=Object.keys(s).reduce((n,l)=>{let c=s[l];return n+`${l}: ${c};`},"");return t+`${i}{${o}}`},""),"styleToCss");function jn({textColor:r,backgroundColor:e,linkColor:t,linkColorHover:i,secondaryColor:s,secondaryHover:o,secondaryForegroundColor:n,fontFamily:l,fontSize:c,radius:u}){let d=`solid 1px ${s}`;return Wc({body:{color:r,"background-color":e,"font-family":l,"font-size":c},".side-bar":{background:"inherit","border-right":d},".main-content":{background:"inherit"},".main-content-header":{background:"inherit"},".main-content-footer":{background:"inherit"},".list-table-row":{color:"inherit"},".list-table-row:hover":{background:s},".list-table-row .list-table-cell-a, .list-table-row .list-table-cell-b":{"border-top":d},".list-table-body .list-items":{"border-bottom":d},".bread-crumbs a":{color:t},".bread-crumbs a:hover":{color:i},".main-content.loading":{background:`${e} url(/static/images/loading_spinner.gif) center no-repeat`,"background-size":"25px 25px"},".list-icons-item":{"background-color":s},".source-gdrive .side-bar-menu a, .source-gphotos .side-bar-menu a":{color:t},".source-gdrive .side-bar-menu a, .source-gphotos .side-bar-menu a:hover":{color:i},".side-bar-menu a":{color:t},".side-bar-menu a:hover":{color:i},".source-gdrive .side-bar-menu .current, .source-gdrive .side-bar-menu a:hover, .source-gphotos .side-bar-menu .current, .source-gphotos .side-bar-menu a:hover":{color:i},".source-vk .side-bar-menu a":{color:t},".source-vk .side-bar-menu a:hover":{color:i,background:"none"},"input[type=submit], .button, button":{color:n,background:s,"box-shadow":"none",border:"none","border-radius":u},"input[type=submit]:hover, .button:hover, button:hover":{background:o},".text-field, input[type=search], input[type=text], input[type=url], textarea":{color:n,"border-radius":u,background:s,border:d}})}a(jn,"buildStyles");var St={};window.addEventListener("message",r=>{let e;try{e=JSON.parse(r.data)}catch{return}if((e==null?void 0:e.type)in St){let t=St[e.type];for(let[i,s]of t)r.source===i&&s(e)}});var Hn=a(function(r,e,t){r in St||(St[r]=[]),St[r].push([e,t])},"registerMessage"),Gn=a(function(r,e){r in St&&(St[r]=St[r].filter(t=>t[0]!==e))},"unregisterMessage");function Wn(r){let e=[];for(let[t,i]of Object.entries(r))i==null||typeof i=="string"&&i.length===0||e.push(`${t}=${encodeURIComponent(i)}`);return e.join("&")}a(Wn,"queryString");var Vs=class Vs extends ${constructor(){super();h(this,"couldBeCtxOwner",!0);h(this,"activityType",_.activities.EXTERNAL);h(this,"_iframe",null);this.init$={...this.init$,activityIcon:"",activityCaption:"",selectedList:[],counter:0,multiple:!1,onDone:()=>{for(let t of this.$.selectedList){let i=this.extractUrlFromMessage(t),{filename:s}=t,{externalSourceType:o}=this.activityParams;this.api.addFileFromUrl(i,{fileName:s,source:o})}this.$["*currentActivity"]=_.activities.UPLOAD_LIST},onCancel:()=>{this.historyBack()}}}get activityParams(){let t=super.activityParams;if("externalSourceType"in t)return t;throw new Error("External Source activity params not found")}initCallback(){super.initCallback(),this.registerActivity(this.activityType,{onActivate:()=>{let{externalSourceType:t}=this.activityParams;if(!t){this.$["*currentActivity"]=null,this.setOrAddState("*modalActive",!1),console.error(`Param "externalSourceType" is required for activity "${this.activityType}"`);return}this.set$({activityCaption:`${t==null?void 0:t[0].toUpperCase()}${t==null?void 0:t.slice(1)}`,activityIcon:t}),this.mountIframe()}}),this.sub("*currentActivityParams",t=>{this.isActivityActive&&(this.unmountIframe(),this.mountIframe())}),this.sub("*currentActivity",t=>{t!==this.activityType&&this.unmountIframe()}),this.sub("selectedList",t=>{this.$.counter=t.length}),this.subConfigValue("multiple",t=>{this.$.multiple=t})}extractUrlFromMessage(t){if(t.alternatives){let i=z(this.cfg.externalSourcesPreferredTypes);for(let s of i){let o=Bn(s);for(let[n,l]of Object.entries(t.alternatives))if(o.test(n))return l}}return t.url}sendMessage(t){var i,s;(s=(i=this._iframe)==null?void 0:i.contentWindow)==null||s.postMessage(JSON.stringify(t),"*")}async handleFileSelected(t){!this.$.multiple&&this.$.selectedList.length||(this.$.selectedList=[...this.$.selectedList,t],this.$.multiple||this.$.onDone())}handleIframeLoad(){this.applyStyles()}getCssValue(t){return window.getComputedStyle(this).getPropertyValue(t).trim()}applyStyles(){let t={radius:this.getCssValue("--uc-radius"),backgroundColor:this.getCssValue("--uc-background"),textColor:this.getCssValue("--uc-foreground"),secondaryColor:this.getCssValue("--uc-secondary"),secondaryForegroundColor:this.getCssValue("--uc-secondary-foreground"),secondaryHover:this.getCssValue("--uc-secondary-hover"),linkColor:this.getCssValue("--uc-primary"),linkColorHover:this.getCssValue("--uc-primary-hover"),fontFamily:this.getCssValue("--uc-font-family"),fontSize:this.getCssValue("--uc-font-size")};this.sendMessage({type:"embed-css",style:jn(t)})}remoteUrl(){var u,d;let{pubkey:t,remoteTabSessionKey:i,socialBaseUrl:s}=this.cfg,{externalSourceType:o}=this.activityParams,l={lang:((d=(u=this.l10n("social-source-lang"))==null?void 0:u.split("-"))==null?void 0:d[0])||"en",public_key:t,images_only:"false",pass_window_open:!1,session_key:i},c=new URL(`/window3/${o}`,s);return c.search=Wn(l),c.toString()}mountIframe(){let t=lr({tag:"iframe",attributes:{src:this.remoteUrl(),marginheight:0,marginwidth:0,frameborder:0,allowTransparency:!0}});t.addEventListener("load",this.handleIframeLoad.bind(this)),this.ref.iframeWrapper.innerHTML="",this.ref.iframeWrapper.appendChild(t),Hn("file-selected",t.contentWindow,this.handleFileSelected.bind(this)),this._iframe=t,this.$.selectedList=[]}unmountIframe(){this._iframe&&Gn("file-selected",this._iframe.contentWindow),this.ref.iframeWrapper.innerHTML="",this._iframe=null,this.$.selectedList=[],this.$.counter=0}};a(Vs,"ExternalSource");var ii=Vs;ii.template=`<uc-activity-header><button type="button" class="uc-mini-btn" set="onclick: *historyBack" l10n="@title:back"><uc-icon name="back"></uc-icon></button><div><uc-icon set="@name: activityIcon"></uc-icon><span>{{activityCaption}}</span></div><button type="button" class="uc-mini-btn uc-close-btn" set="onclick: *historyBack" l10n="@title:a11y-activity-header-button-close" ><uc-icon name="close"></uc-icon></button></uc-activity-header><div class="uc-content"><div ref="iframeWrapper" class="uc-iframe-wrapper"></div><div class="uc-toolbar"><button type="button" class="uc-cancel-btn uc-secondary-btn" set="onclick: onCancel" l10n="cancel"></button><div></div><div set="@hidden: !multiple" class="uc-selected-counter"><span l10n="selected-count"></span>{{counter}}</div><button type="button" class="uc-done-btn uc-primary-btn" set="onclick: onDone; @disabled: !counter" l10n="done" ></button></div></div>`;var Bs=class Bs extends ${constructor(){super(...arguments);h(this,"requireCtxName",!0)}_createValidationInput(){let t=document.createElement("input");return t.type="text",t.name=this.ctxName,t.required=this.cfg.multipleMin>0,t.tabIndex=-1,xe(t,{opacity:0,height:0,width:0}),t}initCallback(){super.initCallback(),this._validationInputElement=this._createValidationInput(),this.appendChild(this._validationInputElement),this.sub("*collectionState",t=>{var i;{if(this._dynamicInputsContainer||(this._dynamicInputsContainer=document.createElement("div"),this.appendChild(this._dynamicInputsContainer)),!this._validationInputElement){let l=this._createValidationInput();this.appendChild(l),this._validationInputElement=l}if(this._dynamicInputsContainer.innerHTML="",t.status==="uploading"||t.status==="idle"){this._validationInputElement.value="",this._validationInputElement.setCustomValidity("");return}if(t.status==="failed"){let l=(i=t.errors[0])==null?void 0:i.message;this._validationInputElement.value="",this._validationInputElement.setCustomValidity(l);return}let s=t.group?t.group:null;if(s){this._validationInputElement.value=s.cdnUrl,this._validationInputElement.setCustomValidity("");return}let o=t.allEntries.map(l=>l.cdnUrl);if(!this.cfg.multiple&&o.length===1){this._validationInputElement.value=o[0],this._validationInputElement.setCustomValidity("");return}this._validationInputElement.remove(),this._validationInputElement=null;let n=new DocumentFragment;for(let l of o){let c=document.createElement("input");c.type="hidden",c.name=`${this.ctxName}[]`,c.value=l,n.appendChild(c)}this._dynamicInputsContainer.replaceChildren(n)}},!1)}};a(Bs,"FormInput");var Qi=Bs;var js=class js extends _{};a(js,"ActivityHeader");var tr=js;var Hs=class Hs extends y{constructor(){super(...arguments);h(this,"init$",{...this.init$,currentText:"",options:[],selectHtml:"",onSelect:t=>{var i;t.preventDefault(),t.stopPropagation(),this.value=this.ref.select.value,this.$.currentText=((i=this.$.options.find(s=>s.value==this.value))==null?void 0:i.text)||"",this.dispatchEvent(new Event("change"))}})}initCallback(){super.initCallback(),this.sub("options",t=>{var s;this.$.currentText=((s=t==null?void 0:t[0])==null?void 0:s.text)||"";let i="";t==null||t.forEach(o=>{i+=`<option value="${o.value}">${o.text}</option>`}),this.$.selectHtml=i})}};a(Hs,"Select");var ri=Hs;ri.template='<select ref="select" set="innerHTML: selectHtml; onchange: onSelect"></select>';var ir=class ir extends y{initCallback(){super.initCallback(),this.subConfigValue("removeCopyright",e=>{this.toggleAttribute("hidden",!!e)})}};a(ir,"Copyright"),h(ir,"template",`<a href="https://uploadcare.com/?utm_source=copyright&utm_medium=referral&utm_campaign=v4" target="_blank noopener" class="uc-credits" >Powered by Uploadcare</a >`);var er=ir;var ue=class ue extends st{constructor(){super(),this.init$={...this.init$,isHidden:!1}}initCallback(){super.initCallback(),this.defineAccessor("headless",e=>{this.set$({isHidden:I(e)})}),this.sub("*modalActive",e=>{this._lastModalActive!==e&&this.emit(e?k.MODAL_OPEN:k.MODAL_CLOSE,void 0,{debounce:!0}),this._lastModalActive=e},!1)}};a(ue,"FileUploaderRegular"),h(ue,"styleAttrs",[...H(ue,ue,"styleAttrs"),"uc-file-uploader-regular"]);var he=ue;he.template=`<uc-simple-btn set="@hidden: isHidden"></uc-simple-btn><uc-modal strokes block-body-scrolling><uc-start-from><uc-drop-area with-icon clickable></uc-drop-area><uc-source-list wrap></uc-source-list><button type="button" l10n="start-from-cancel" class="uc-secondary-btn" set="onclick: *historyBack"></button><uc-copyright></uc-copyright></uc-start-from><uc-upload-list></uc-upload-list><uc-camera-source></uc-camera-source><uc-url-source></uc-url-source><uc-external-source></uc-external-source><uc-cloud-image-editor-activity></uc-cloud-image-editor-activity></uc-modal>`;he.bindAttributes({headless:null});var de=class de extends st{initCallback(){super.initCallback();let e=this.ref.uBlock;this.sub("*currentActivity",t=>{t||(this.$["*currentActivity"]=e.initActivity||_.activities.START_FROM)}),this.sub("*uploadList",t=>{(t==null?void 0:t.length)>0?this.$["*currentActivity"]=_.activities.UPLOAD_LIST:this.$["*currentActivity"]=e.initActivity||_.activities.START_FROM}),this.subConfigValue("sourceList",t=>{t!=="local"&&(this.cfg.sourceList="local")}),this.subConfigValue("confirmUpload",t=>{t!==!1&&(this.cfg.confirmUpload=!1)})}};a(de,"FileUploaderMinimal"),h(de,"styleAttrs",[...H(de,de,"styleAttrs"),"uc-file-uploader-minimal"]);var si=de;si.template=`<uc-start-from><uc-drop-area tabindex="0" clickable l10n="choose-file"></uc-drop-area><uc-copyright></uc-copyright></uc-start-from><uc-upload-list ref="uBlock"></uc-upload-list>`;var pe=class pe extends st{constructor(){super(),this.init$={...this.init$,couldCancel:!1,cancel:()=>{this.couldHistoryBack?this.$["*historyBack"]():this.couldShowList&&(this.$["*currentActivity"]=_.activities.UPLOAD_LIST)}}}get couldHistoryBack(){let e=this.$["*history"];return e.length>1&&e[e.length-1]!==_.activities.START_FROM}get couldShowList(){return this.cfg.showEmptyList||this.$["*uploadList"].length>0}initCallback(){super.initCallback();let e=this.ref.uBlock;this.sub("*currentActivity",t=>{t||(this.$["*currentActivity"]=e.initActivity||_.activities.START_FROM)}),this.sub("*uploadList",t=>{(t==null?void 0:t.length)>0&&this.$["*currentActivity"]===(e.initActivity||_.activities.START_FROM)&&(this.$["*currentActivity"]=_.activities.UPLOAD_LIST)}),this.sub("*history",()=>{this.$.couldCancel=this.couldHistoryBack||this.couldShowList})}};a(pe,"FileUploaderInline"),h(pe,"styleAttrs",[...H(pe,pe,"styleAttrs"),"uc-file-uploader-inline"]);var oi=pe;oi.template=`<uc-start-from><uc-drop-area with-icon clickable></uc-drop-area><uc-source-list wrap></uc-source-list><button type="button" l10n="start-from-cancel" class="uc-cancel-btn uc-secondary-btn" set="onclick: cancel; @hidden: !couldCancel" ></button><uc-copyright></uc-copyright></uc-start-from><uc-upload-list ref="uBlock"></uc-upload-list><uc-camera-source></uc-camera-source><uc-url-source></uc-url-source><uc-external-source></uc-external-source><uc-cloud-image-editor-activity></uc-cloud-image-editor-activity>`;var fe=class fe extends ct{initCallback(){var e;super.initCallback(),(e=this.a11y)==null||e.registerBlock(this)}};a(fe,"CloudImageEditor"),h(fe,"styleAttrs",[...H(fe,fe,"styleAttrs"),"uc-wgt-common"]);var rr=fe;function sr(r){for(let e in r){let t=[...e].reduce((i,s)=>(s.toUpperCase()===s&&(s="-"+s.toLowerCase()),i+=s),"");t.startsWith("-")&&(t=t.replace("-","")),t.startsWith("uc-")||(t="uc-"+t),r[e].reg&&r[e].reg(t)}}a(sr,"defineComponents");var Gs="UC";async function Xn(r,e=!1){return new Promise((t,i)=>{if(typeof document!="object"){t(null);return}if(typeof window=="object"&&window[Gs]){t(window[Gs]);return}let s=document.createElement("script");s.async=!0,s.src=r,s.onerror=()=>{i()},s.onload=()=>{let o=window[Gs];e&&sr(o),t(o)},document.head.appendChild(s)})}a(Xn,"loadFileUploaderFrom");return ra(Xc);})();
|