@emailmaker/emailmaker 1.0.108 → 1.0.109-alpha.2
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/README.md +1 -1
- package/asset-manifest.json +31 -31
- package/emailmaker-esm.js +1 -1
- package/emailmaker.d.ts +2 -0
- package/emailmaker.js +1 -1
- package/iframe/429.js +1 -1
- package/iframe/766.js +1 -1
- package/iframe/iframe-eblock.fecd609b7217947f3d0a.html +1 -1
- package/iframe/iframe.fecd609b7217947f3d0a.html +1 -1
- package/iframe/js/174.d4af3f31.js +1 -0
- package/iframe/js/525.7b9b34e7.js +1 -0
- package/iframe/js/882.cbc0a3a7.js +1 -0
- package/iframe/sandbox-eblock.js +1 -1
- package/images/integrations/activecampaign.svg +4 -0
- package/images/integrations/bento.svg +9 -0
- package/images/integrations/brevo.svg +7 -0
- package/images/integrations/campaign_monitor.svg +10 -0
- package/images/integrations/constant_contact.svg +24 -0
- package/images/integrations/dotdigital.svg +144 -0
- package/images/integrations/getresponse.svg +23 -0
- package/images/integrations/hubspot.svg +3 -0
- package/images/integrations/klaviyo.svg +10 -0
- package/images/integrations/mailchimp.svg +9 -0
- package/images/integrations/salesforce.svg +20 -0
- package/package.json +1 -1
- package/static/css/5102.6eeeac5b.chunk.css +2 -0
- package/static/css/{1670.f8c845ea.chunk.css → 7282.739c0d6e.chunk.css} +2 -2
- package/static/css/{main.25b3e7b7.css → main.3086b5d9.css} +2 -2
- package/static/js/{1117.dd23feb7.js → 1117.0b254a6b.js} +3 -3
- package/static/js/{1902.335b625b.js → 1902.96d10b03.js} +2 -2
- package/static/js/3628.e132c341.js +3 -0
- package/static/js/5102.af181f78.js +2 -0
- package/static/js/{1670.7a8f2159.js → 7282.0e0350e2.js} +3 -3
- package/static/js/8017.2b02b271.js +2 -0
- package/static/js/8559.c810e5fe.js +2 -0
- package/static/js/{emailmaker_core.0aec900a.js → emailmaker_core.23ddf597.js} +3 -3
- package/iframe/js/174.41368e21.js +0 -1
- package/iframe/js/525.cced8800.js +0 -1
- package/iframe/js/882.2789a6d3.js +0 -1
- package/static/css/5102.197af245.chunk.css +0 -2
- package/static/js/3628.6cd4be31.js +0 -3
- package/static/js/5102.bac7dbe0.js +0 -2
- package/static/js/775.54e5750c.js +0 -2
- package/static/js/9372.2d480663.js +0 -2
- /package/iframe/js/{174.41368e21.js.LICENSE.txt → 174.d4af3f31.js.LICENSE.txt} +0 -0
- /package/iframe/js/{525.cced8800.js.LICENSE.txt → 525.7b9b34e7.js.LICENSE.txt} +0 -0
- /package/iframe/js/{882.2789a6d3.js.LICENSE.txt → 882.cbc0a3a7.js.LICENSE.txt} +0 -0
- /package/static/js/{1117.dd23feb7.js.LICENSE.txt → 1117.0b254a6b.js.LICENSE.txt} +0 -0
- /package/static/js/{3628.6cd4be31.js.LICENSE.txt → 3628.e132c341.js.LICENSE.txt} +0 -0
- /package/static/js/{1670.7a8f2159.js.LICENSE.txt → 7282.0e0350e2.js.LICENSE.txt} +0 -0
- /package/static/js/{emailmaker_core.0aec900a.js.LICENSE.txt → emailmaker_core.23ddf597.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! For license information please see 3628.e132c341.js.LICENSE.txt */
|
|
2
|
+
"use strict";(globalThis.webpackChunkemail_maker=globalThis.webpackChunkemail_maker||[]).push([[3628],{93628:(e,t,n)=>{var r;n.d(t,{BC:()=>IM,KG:()=>EM});var i=n(81516),o=n(1936),a=n(55054),s=n(6691),l=n(18021),c=n(2938),u=n(32101),d=n(6143),h=n(84226),f=n(84138),p=n(5464),g=n(236),m=n(90176),v=n(88610),y=n(90947),b=n(77550),w=n(94533),x=n(94035),C=n(7494),_=n(32380),S=n(14516),A=n(60369),k=n(8900),E=n(62329),I=n(58986),j=n(51114),T=n(89773),F=n(76728),O=n(54760),M=n(3636),P=n(70906),R=n(41904),L=n(56893),N=n(16566),D=n(92828),z=n(88259),B=n(30130),U=n(41387),V=n(33486),H=n(86331),W=n(58937),$=n(82026),G=n(63481),q=n(8647),Y=n(26281),X=n(21986),K=n(5199),Z=n(12471),J=n(50295),Q=n(90669),ee=n(77478),te=n(24259),ne=n(52853),re=n(52433),ie=n(53082),oe=n(60222),ae=n(9438),se=n(78811),le=n(86588),ce=n(91796),ue=n(25228),de=n(18005),he=n(91691).Buffer;function fe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function pe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return fe(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?fe(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ge(e){return ge="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ge(e)}function me(e){var t=function(e,t){if("object"!=ge(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=ge(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==ge(t)?t:t+""}function ve(e,t,n){return(t=me(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ye(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function be(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ye(Object(n),!0).forEach(function(t){ve(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ye(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var we={},xe=[];function Ce(e,t){}function _e(e,t){}function Se(e,t,n){t||we[n]||(e(!1,n),we[n]=!0)}function Ae(e,t){Se(Ce,e,t)}function ke(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=new Set;return function e(t,i){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=r.has(t);if(Ae(!a,"Warning: There may be circular references"),a)return!1;if(t===i)return!0;if(n&&o>1)return!1;r.add(t);var s=o+1;if(Array.isArray(t)){if(!Array.isArray(i)||t.length!==i.length)return!1;for(var l=0;l<t.length;l++)if(!e(t[l],i[l],s))return!1;return!0}if(t&&i&&"object"===ge(t)&&"object"===ge(i)){var c=Object.keys(t);return c.length===Object.keys(i).length&&c.every(function(n){return e(t[n],i[n],s)})}return!1}(e,t)}function Ee(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ie(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,me(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function je(e){return e.join("%")}Ae.preMessage=function(e){xe.push(e)},Ae.resetWarned=function(){we={}},Ae.noteOnce=function(e,t){Se(_e,e,t)};var Te=function(){function e(t){Ee(this,e),ve(this,"instanceId",void 0),ve(this,"cache",new Map),ve(this,"extracted",new Set),this.instanceId=t}return Ie(e,[{key:"get",value:function(e){return this.opGet(je(e))}},{key:"opGet",value:function(e){return this.cache.get(e)||null}},{key:"update",value:function(e,t){return this.opUpdate(je(e),t)}},{key:"opUpdate",value:function(e,t){var n=t(this.cache.get(e));null===n?this.cache.delete(e):this.cache.set(e,n)}}]),e}(),Fe=["children"],Oe="data-css-hash",Me="__cssinjs_instance__";function Pe(){var e=Math.random().toString(12).slice(2);if("undefined"!=typeof document&&document.head&&document.body){var t=document.body.querySelectorAll("style[".concat(Oe,"]"))||[],n=document.head.firstChild;Array.from(t).forEach(function(t){t[Me]=t[Me]||e,t[Me]===e&&document.head.insertBefore(t,n)});var r={};Array.from(document.querySelectorAll("style[".concat(Oe,"]"))).forEach(function(t){var n,i=t.getAttribute(Oe);r[i]?t[Me]===e&&(null===(n=t.parentNode)||void 0===n||n.removeChild(t)):r[i]=!0})}return new Te(e)}var Re=o.createContext({hashPriority:"low",cache:Pe(),defaultCache:!0}),Le=function(e){var t,n,r,i,a=e.children,s=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,Fe),l=o.useContext(Re),c=(t=function(){var e=be({},l);Object.keys(s).forEach(function(t){var n=s[t];void 0!==s[t]&&(e[t]=n)});var t=s.cache;return e.cache=e.cache||Pe(),e.defaultCache=!t&&l.defaultCache,e},n=[l,s],r=function(e,t){return!ke(e[0],t[0],!0)||!ke(e[1],t[1],!0)},"value"in(i=o.useRef({})).current&&!r(i.current.condition,n)||(i.current.value=t(),i.current.condition=n),i.current.value);return o.createElement(Re.Provider,{value:c},a)},Ne=function(){function e(){Ee(this,e),ve(this,"cache",void 0),ve(this,"keys",void 0),ve(this,"cacheCallTimes",void 0),this.cache=new Map,this.keys=[],this.cacheCallTimes=0}return Ie(e,[{key:"size",value:function(){return this.keys.length}},{key:"internalGet",value:function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i={map:this.cache};return e.forEach(function(e){var t;i=i?null===(t=i)||void 0===t||null===(t=t.map)||void 0===t?void 0:t.get(e):void 0}),null!==(t=i)&&void 0!==t&&t.value&&r&&(i.value[1]=this.cacheCallTimes++),null===(n=i)||void 0===n?void 0:n.value}},{key:"get",value:function(e){var t;return null===(t=this.internalGet(e,!0))||void 0===t?void 0:t[0]}},{key:"has",value:function(e){return!!this.internalGet(e)}},{key:"set",value:function(t,n){var r=this;if(!this.has(t)){if(this.size()+1>e.MAX_CACHE_SIZE+e.MAX_CACHE_OFFSET){var i=this.keys.reduce(function(e,t){var n=pe(e,2)[1];return r.internalGet(t)[1]<n?[t,r.internalGet(t)[1]]:e},[this.keys[0],this.cacheCallTimes]),o=pe(i,1)[0];this.delete(o)}this.keys.push(t)}var a=this.cache;t.forEach(function(e,i){if(i===t.length-1)a.set(e,{value:[n,r.cacheCallTimes++]});else{var o=a.get(e);o?o.map||(o.map=new Map):a.set(e,{map:new Map}),a=a.get(e).map}})}},{key:"deleteByPath",value:function(e,t){var n,r=e.get(t[0]);if(1===t.length)return r.map?e.set(t[0],{map:r.map}):e.delete(t[0]),null===(n=r.value)||void 0===n?void 0:n[0];var i=this.deleteByPath(r.map,t.slice(1));return r.map&&0!==r.map.size||r.value||e.delete(t[0]),i}},{key:"delete",value:function(e){if(this.has(e))return this.keys=this.keys.filter(function(t){return!function(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(t,e)}),this.deleteByPath(this.cache,e)}}]),e}();function De(e,t,n){if(arguments.length>4&&void 0!==arguments[4]&&arguments[4])return e;var r=be(be({},arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}),{},ve(ve({},"data-token-hash",t),Oe,n)),i=Object.keys(r).map(function(e){var t=r[e];return t?"".concat(e,'="').concat(t,'"'):null}).filter(function(e){return e}).join(" ");return"<style ".concat(i,">").concat(e,"</style>")}ve(Ne,"MAX_CACHE_SIZE",20),ve(Ne,"MAX_CACHE_OFFSET",5),new Ne,"undefined"!=typeof window&&window.document&&window.document.createElement?o.useLayoutEffect:o.useEffect,be({},r||(r=n.t(o,2))).useInsertionEffect,be({},r||(r=n.t(o,2))).useInsertionEffect;var ze="comm",Be="rule",Ue="decl",Ve=Math.abs,He=String.fromCharCode;function We(e){return e.trim()}function $e(e,t,n){return e.replace(t,n)}function Ge(e,t,n){return e.indexOf(t,n)}function qe(e,t){return 0|e.charCodeAt(t)}function Ye(e,t,n){return e.slice(t,n)}function Xe(e){return e.length}function Ke(e,t){return t.push(e),e}var Ze=1,Je=1,Qe=0,et=0,tt=0,nt="";function rt(e,t,n,r,i,o,a,s){return{value:e,root:t,parent:n,type:r,props:i,children:o,line:Ze,column:Je,length:a,return:"",siblings:s}}function it(){return tt=et>0?qe(nt,--et):0,Je--,10===tt&&(Je=1,Ze--),tt}function ot(){return tt=et<Qe?qe(nt,et++):0,Je++,10===tt&&(Je=1,Ze++),tt}function at(){return qe(nt,et)}function st(){return et}function lt(e,t){return Ye(nt,e,t)}function ct(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function ut(e){return We(lt(et-1,ft(91===e?e+2:40===e?e+1:e)))}function dt(e){for(;(tt=at())&&tt<33;)ot();return ct(e)>2||ct(tt)>3?"":" "}function ht(e,t){for(;--t&&ot()&&!(tt<48||tt>102||tt>57&&tt<65||tt>70&&tt<97););return lt(e,st()+(t<6&&32==at()&&32==ot()))}function ft(e){for(;ot();)switch(tt){case e:return et;case 34:case 39:34!==e&&39!==e&&ft(tt);break;case 40:41===e&&ft(e);break;case 92:ot()}return et}function pt(e,t){for(;ot()&&e+tt!==57&&(e+tt!==84||47!==at()););return"/*"+lt(t,et-1)+"*"+He(47===e?e:ot())}function gt(e){for(;!ct(at());)ot();return lt(e,et)}function mt(e){return function(e){return nt="",e}(vt("",null,null,null,[""],e=function(e){return Ze=Je=1,Qe=Xe(nt=e),et=0,[]}(e),0,[0],e))}function vt(e,t,n,r,i,o,a,s,l){for(var c=0,u=0,d=a,h=0,f=0,p=0,g=1,m=1,v=1,y=0,b="",w=i,x=o,C=r,_=b;m;)switch(p=y,y=ot()){case 40:if(108!=p&&58==qe(_,d-1)){-1!=Ge(_+=$e(ut(y),"&","&\f"),"&\f",Ve(c?s[c-1]:0))&&(v=-1);break}case 34:case 39:case 91:_+=ut(y);break;case 9:case 10:case 13:case 32:_+=dt(p);break;case 92:_+=ht(st()-1,7);continue;case 47:switch(at()){case 42:case 47:Ke(bt(pt(ot(),st()),t,n,l),l),5!=ct(p||1)&&5!=ct(at()||1)||!Xe(_)||" "===Ye(_,-1,void 0)||(_+=" ");break;default:_+="/"}break;case 123*g:s[c++]=Xe(_)*v;case 125*g:case 59:case 0:switch(y){case 0:case 125:m=0;case 59+u:-1==v&&(_=$e(_,/\f/g,"")),f>0&&(Xe(_)-d||0===g&&47===p)&&Ke(f>32?wt(_+";",r,n,d-1,l):wt($e(_," ","")+";",r,n,d-2,l),l);break;case 59:_+=";";default:if(Ke(C=yt(_,t,n,c,u,i,s,b,w=[],x=[],d,o),o),123===y)if(0===u)vt(_,t,C,C,w,o,d,s,x);else{switch(h){case 99:if(110===qe(_,3))break;case 108:if(97===qe(_,2))break;default:u=0;case 100:case 109:case 115:}u?vt(e,C,C,r&&Ke(yt(e,C,C,0,0,i,s,b,i,w=[],d,x),x),i,x,d,s,r?w:x):vt(_,C,C,C,[""],x,0,s,x)}}c=u=f=0,g=v=1,b=_="",d=a;break;case 58:d=1+Xe(_),f=p;default:if(g<1)if(123==y)--g;else if(125==y&&0==g++&&125==it())continue;switch(_+=He(y),y*g){case 38:v=u>0?1:(_+="\f",-1);break;case 44:s[c++]=(Xe(_)-1)*v,v=1;break;case 64:45===at()&&(_+=ut(ot())),h=at(),u=d=Xe(b=_+=gt(st())),y++;break;case 45:45===p&&2==Xe(_)&&(g=0)}}return o}function yt(e,t,n,r,i,o,a,s,l,c,u,d){for(var h=i-1,f=0===i?o:[""],p=function(e){return e.length}(f),g=0,m=0,v=0;g<r;++g)for(var y=0,b=Ye(e,h+1,h=Ve(m=a[g])),w=e;y<p;++y)(w=We(m>0?f[y]+" "+b:$e(b,/&\f/g,f[y])))&&(l[v++]=w);return rt(e,t,n,0===i?Be:s,l,c,u,d)}function bt(e,t,n,r){return rt(e,t,n,ze,He(tt),Ye(e,2,-2),0,r)}function wt(e,t,n,r,i){return rt(e,t,n,Ue,Ye(e,0,r),Ye(e,r+1,-1),r,i)}function xt(e,t){for(var n="",r=0;r<e.length;r++)n+=t(e[r],r,e,t)||"";return n}function Ct(e,t,n,r){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case"@namespace":case Ue:return e.return=e.return||e.value;case ze:return"";case"@keyframes":return e.return=e.value+"{"+xt(e.children,r)+"}";case Be:if(!Xe(e.value=e.props.join(",")))return""}return Xe(n=xt(e.children,r))?e.return=e.value+"{"+n+"}":""}function _t(e){return e.notSplit=!0,e}ve(ve(ve({},"style",function(e,t,n){var r=pe(e,6),i=r[0],o=r[1],a=r[2],s=r[3],l=r[4],c=r[5],u=(n||{}).plain;if(l)return null;var d=i,h={"data-rc-order":"prependQueue","data-rc-priority":"".concat(c)};return d=De(i,o,a,h,u),s&&Object.keys(s).forEach(function(e){if(!t[e]){t[e]=!0;var n=function(e){return xt(mt(e),Ct).replace(/\{%%%\:[^;];}/g,";")}(s[e]),r=De(n,o,"_effect-".concat(e),h,u);e.startsWith("@layer")?d=r+d:d+=r}}),[c,a,d]}),"token",function(e,t,n){var r=pe(e,5),i=r[2],o=r[3],a=r[4],s=(n||{}).plain;if(!o)return null;var l=i._tokenKey;return[-999,l,De(o,a,l,{"data-rc-order":"prependQueue","data-rc-priority":"".concat(-999)},s)]}),"cssVar",function(e,t,n){var r=pe(e,4),i=r[1],o=r[2],a=r[3],s=(n||{}).plain;return i?[-999,o,De(i,a,o,{"data-rc-order":"prependQueue","data-rc-priority":"".concat(-999)},s)]:null}),_t(["borderTop","borderBottom"]),_t(["borderTop"]),_t(["borderBottom"]),_t(["borderLeft","borderRight"]),_t(["borderLeft"]),_t(["borderRight"]);const St={defaultMerge:Symbol("deepmerge-ts: default merge"),skip:Symbol("deepmerge-ts: skip")};function At(e,t){return t}function kt(e,t){return e.filter(e=>void 0!==e)}var Et,It;function jt(e){return"object"!=typeof e||null===e?0:Array.isArray(e)?2:function(e){if(!Ot.includes(Object.prototype.toString.call(e)))return!1;const{constructor:t}=e;if(void 0===t)return!0;const n=t.prototype;return!(null===n||"object"!=typeof n||!Ot.includes(Object.prototype.toString.call(n)))&&!!n.hasOwnProperty("isPrototypeOf")}(e)?1:e instanceof Set?3:e instanceof Map?4:5}function Tt(e,t){return"object"==typeof e&&Object.prototype.propertyIsEnumerable.call(e,t)}function Ft(e){let t=0,n=e[0]?.[Symbol.iterator]();return{[Symbol.iterator]:()=>({next(){for(;;){if(void 0===n)return{done:!0,value:void 0};const r=n.next();if(!0!==r.done)return{done:!1,value:r.value};t+=1,n=e[t]?.[Symbol.iterator]()}}})}}(It=Et||(Et={}))[It.NOT=0]="NOT",It[It.RECORD=1]="RECORD",It[It.ARRAY=2]="ARRAY",It[It.SET=3]="SET",It[It.MAP=4]="MAP",It[It.OTHER=5]="OTHER";const Ot=["[object Object]","[object Module]"],Mt={mergeRecords:function(e,t,n){const r={};for(const i of function(e){const t=new Set;for(const n of e)for(const e of[...Object.keys(n),...Object.getOwnPropertySymbols(n)])t.add(e);return t}(e)){const o=[];for(const t of e)Tt(t,i)&&o.push(t[i]);if(0===o.length)continue;const a=t.metaDataUpdater(n,{key:i,parents:e}),s=Pt(o,t,a);s!==St.skip&&("__proto__"===i?Object.defineProperty(r,i,{value:s,configurable:!0,enumerable:!0,writable:!0}):r[i]=s)}return r},mergeArrays:function(e){return e.flat()},mergeSets:function(e){return new Set(Ft(e))},mergeMaps:function(e){return new Map(Ft(e))},mergeOthers:function(e){return e.at(-1)}};function Pt(e,t,n){const r=t.filterValues?.(e,n)??e;if(0===r.length)return;if(1===r.length)return Rt(r,t,n);const i=jt(r[0]);if(0!==i&&5!==i)for(let o=1;o<r.length;o++)if(jt(r[o])!==i)return Rt(r,t,n);switch(i){case 1:return function(e,t,n){const r=t.mergeFunctions.mergeRecords(e,t,n);return r===St.defaultMerge||t.useImplicitDefaultMerging&&void 0===r&&t.mergeFunctions.mergeRecords!==t.defaultMergeFunctions.mergeRecords?t.defaultMergeFunctions.mergeRecords(e,t,n):r}(r,t,n);case 2:return function(e,t,n){const r=t.mergeFunctions.mergeArrays(e,t,n);return r===St.defaultMerge||t.useImplicitDefaultMerging&&void 0===r&&t.mergeFunctions.mergeArrays!==t.defaultMergeFunctions.mergeArrays?t.defaultMergeFunctions.mergeArrays(e):r}(r,t,n);case 3:return function(e,t,n){const r=t.mergeFunctions.mergeSets(e,t,n);return r===St.defaultMerge||t.useImplicitDefaultMerging&&void 0===r&&t.mergeFunctions.mergeSets!==t.defaultMergeFunctions.mergeSets?t.defaultMergeFunctions.mergeSets(e):r}(r,t,n);case 4:return function(e,t,n){const r=t.mergeFunctions.mergeMaps(e,t,n);return r===St.defaultMerge||t.useImplicitDefaultMerging&&void 0===r&&t.mergeFunctions.mergeMaps!==t.defaultMergeFunctions.mergeMaps?t.defaultMergeFunctions.mergeMaps(e):r}(r,t,n);default:return Rt(r,t,n)}}function Rt(e,t,n){const r=t.mergeFunctions.mergeOthers(e,t,n);return r===St.defaultMerge||t.useImplicitDefaultMerging&&void 0===r&&t.mergeFunctions.mergeOthers!==t.defaultMergeFunctions.mergeOthers?t.defaultMergeFunctions.mergeOthers(e):r}const Lt="my_files",Nt="gif",Dt="stock_images",zt="icons",Bt="ai",Ut="editor",Vt="Trash",Ht="light",Wt="dark",$t="system",Gt="(prefers-color-scheme: dark)",qt="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iODAiIGhlaWdodD0iODAiIHZpZXdCb3g9IjAgMCA4MCA4MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjgwIiBoZWlnaHQ9IjgwIiBmaWxsPSIjRjVGNUY1Ii8+CjxwYXRoIGQ9Ik0yNCAzMkw0MCA0OEw1NiAzMkw2NCA0MEw2NCA2NEgyNFYzMloiIGZpbGw9IiNEOUQ5RDkiLz4KPC9zdmc+",Yt=["jpg","jpeg","png","bmp","webp","svg","ico","tiff","tif"],Xt=["jpg","jpeg","png","bmp","webp","svg","ico","tiff","tif","gif"],Kt="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQABLAEsAAD/4QCMRXhpZgAATU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAIdpAAQAAAABAAAAWgAAAAAAAAEsAAAAAQAAASwAAAABAAOgAQADAAAAAQABAACgAgAEAAAAAQAAAQOgAwAEAAAAAQAAAMoAAAAA/+EJ2Wh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8APD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNi4wLjAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1wTU06RG9jdW1lbnRJRD0iYWRvYmU6ZG9jaWQ6c3RvY2s6Mzk2MmU4NTQtNjA1NC00MGZmLWEwYzMtYjJkNjcwMzQ2OWFhIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOmE5M2NiZTgyLWI5NjEtNGUzNS1iYmQ0LWJjZWE1Zjc1YTQwZiIvPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDw/eHBhY2tldCBlbmQ9InciPz4A/+0AOFBob3Rvc2hvcCAzLjAAOEJJTQQEAAAAAAAAOEJJTQQlAAAAAAAQ1B2M2Y8AsgTpgAmY7PhCfv/AABEIAMoBAwMBIgACEQADEQD/xAAfAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgv/xAC1EAACAQMDAgQDBQUEBAAAAX0BAgMABBEFEiExQQYTUWEHInEUMoGRoQgjQrHBFVLR8CQzYnKCCQoWFxgZGiUmJygpKjQ1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4eLj5OXm5+jp6vHy8/T19vf4+fr/xAAfAQADAQEBAQEBAQEBAAAAAAAAAQIDBAUGBwgJCgv/xAC1EQACAQIEBAMEBwUEBAABAncAAQIDEQQFITEGEkFRB2FxEyIygQgUQpGhscEJIzNS8BVictEKFiQ04SXxFxgZGiYnKCkqNTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqCg4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2dri4+Tl5ufo6ery8/T19vf4+fr/2wBDAAUDBAQEAwUEBAQFBQUGBwwIBwcHBw8LCwkMEQ8SEhEPERETFhwXExQaFRERGCEYGh0dHx8fExciJCIeJBweHx7/3QAEABH/2gAMAwEAAhEDEQA/APsuiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAoqG7uIbWB55nCooyTS208VxCssLh0boRQBLRRRQAUUUUAFFFFAH/9D7LooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAqG7uIrWBppnCoo5Jou7iK1gaaZwqKM5NcRq2oXOsXqxQq2wnEcYPX3NABq2oXOr3qwxK3l5xHGO/ua6nw7pzadZ7ZJGaR+WBPA9hUfh7R49Pi82TDXDDkkfd9hWxQAUUUUAFFFFABRRRQB//9H7LooooAKKKKACiiuOv/EOpQX88KNDsSQqMp6H60AdjRXD/wDCTapn70P/AH7/APr0f8JPqn96H/v3/wDXoA7iiuH/AOEn1T+9D/37/wDr0f8ACT6p/eh/79//AF6AO4orh/8AhJ9U/vQ/9+//AK9H/CT6p/eh/wC/f/16AO4orh/+En1T+9D/AN+//r0f8JPqn96H/v3/APXoA7iiuH/4SfVP70P/AH7/APr0f8JPqn96H/v3/wDXoA7iiuH/AOEn1T+9D/37/wDr0f8ACT6p/eh/79//AF6AO4orh/8AhJ9U/vQ/9+//AK9H/CT6p/eh/wC/f/16AO4orh/+En1T+9D/AN+//r0f8JPqn96H/v3/APXoA7iobq4itYHmncIijJJrE0jUdQlt2v8AUJIYrNVyMJgv9Oaw9X1C51e8WGJWMecRxr39zQAatqNzq94kUasELYjjB6/Wul8P6NHp8Qlkw1ww5P8Ad9hWRmDw9bfwTajIv4Riqw8Tap6wf98f/XoA7elrh/8AhJtU/vQ/9+//AK9avhnWL3UL94bgx7BGWG1cdwPX3oA6OiiigAooooAKKKKAP//S+y6KKKACiiigArgHAbxSVYAg3mCD3+eu/rgT/wAjV/2+f+z0Adt9jtMf8esH/fsUfY7T/n1g/wC/Yqeh2CIWY4AGSaAK7WlmqktbQADkkxr/AIVUe50JJPLZ7EN6YWuX17WJr+dkRylurYVQfve5rKJoA9Ghh0+Zd0MVtIvqqKaf9jtP+fWD/v2K89sry4sphLbyFD3HY/Wu+0e9TULFLhQATww9DQBJ9jtP+fWD/v2KattZM7ILe3LL94bF4p99cx2lpJcS/dRc/X2rjdG1eSLWmuZ2Oy4bEnoPQ/hQB2P2O0/59YP+/Yo+x2n/AD6wf9+xU4IPSloAr/Y7T/n1g/79ij7Haf8APrB/37FWKKAK/wBjtP8An1g/79ij7Haf8+sH/fsVYooAr/Y7T/n1g/79ioruPTrWBppoLdUUckxj/Cp7u4itYGnmcKijJJriNX1C61i9EUKtsziOMHr7mgBNVv7jVrxYII/3YOIYl/ma6bw9o8enxCSTD3DDkn+H2FHh/R49Pi8yTDXDDkkfd9hWxQBC9rbOxZ7eJmPUlATTfsdp/wA+sH/fsVYooAztXtbVdLumW3hBELkEIOPlNc74H/5Csv8A1xP8xXUaz/yCbz/ri/8A6Ca5fwP/AMhaX/rif5igDs6KKKACiiigAooooA//0/suiiigAooooAK4E/8AI1f9vn/s9d9XAn/kav8At8/9noA72s/xI7R6HdMpwdmPzODWhUN/ALqymt26SIVoA816UlS3ML207wSrtdCQai+lAC11HgN2xdx4+XKH6Hn/AArl++K6jSv+JN4flvJhiWfBRe/Tj+ZNAEHjLUfOnFjEw2R/NJju3Yfl/Oudp0jtJIzucsxJJ96bQB2/hLUftdkLeRh50OF+q9jW3XnOkXrWF/HcDJUHDjPUV6HDIssSSIQVYAg0APooooAKhu7iK1gaeZwqKM5NF3cQ2sDTTOFRRk5riNW1C51i9WKJW8vOI4x39zQAavqF1rF6IYVbZnEcYPX3NdL4e0ePT4hLIA1w45JH3fYUeHtHj0+LzJcNcMOTj7vsK2KACiiigAooooAqaz/yCbz/AK4v/wCgmuX8D/8AIWl/64n+YrqNZ/5BN5/1xf8A9BNcv4H/AOQtL/1xP8xQB2dFFFABRRRQAUUUUAf/1PsuiiigAooooAK4E/8AI1f9vn/s9d9XAn/kav8At8/9noA72lpKWgDO1bSLXUQDKCsg6OvX/wCvWFJ4Tn3fJdxFc8FkOa66igDC0zw3a2riadzPIOeRhR+FYXinUPtl+Yoz+5h+VcdCe5/p+FdH4n1H7DYFYziaX5U9vU1wn40AFFFFABXW+DNR3xtp8x+ZPmjyeo7j/PrXJVNZzva3UdxG2HjbP/1qAPTKhu7iK2gaaZwqKOSahTULf+zFv3bZEybsmuP1XULnV70QxK3l7sRxr39zQAmrahc6xerFEreXnEcY7+5rpfD2jx6fF5suGuGHJx932FHh7R49PiEkuGuGHJ/u+wrYoAKKKKACiiigAooooAqaz/yCbz/ri/8A6Ca5fwP/AMhaX/rif5iuo1n/AJBN5/1xf/0E1y/gf/kLS/8AXE/zFAHZ0UUUAFFFFABRRRQB/9X7LooooAKKKKACuBP/ACNX/b5/7PXfVwJ/5Gr/ALfP/Z6AO9paSloAKazBVZicBRkmnVz3jHUfs9qLOJsSy/ex2XvQBzuu351DUXlDfu1+WMewqhRRQAUUUv40AFbGi6ZG8TahqB8uzTkA9ZP/AK1Gi6ZG8TajqJ2WcfIB/wCWn/1qi1W+uNWu0hhQiIHbFEv86ADU7+fVbpIIU2xZ2xRL/M103h7R00+LzZcPcMOTj7vsKyCYfD9sQNsupSr+EY/z+ddDot8uoWCTj7/Rx6N3oAvUUUUAFZ17rFta6jDZydZPvNnhPTNSaxqEWn2bTv8AM3RF9TXntxLJPK8sp3O5yx9TQB6dmlrA8Kar9qg+yzt+/jHBP8QrfoAKKKKAKms/8gm8/wCuL/8AoJrl/A//ACFpf+uJ/mK6jWf+QTef9cX/APQTXL+B/wDkLS/9cT/MUAdnRRRQAUUUUAFFFFAH/9b7LooooAKKKKACuBP/ACNX/b5/7PXfVwJ/5Gr/ALfP/Z6AO9paSloAjuZo7eB5pThEGSa851G6e9vJLl+rngeg7Ct/xpqOWXT4m6fNLj9B/X8q5mgBKKKO9AADzWzoumRvEdQ1A7LOPkA/8tP/AK1JoulxvE2oagQlnHyAf+Wn/wBaotVv59WukhhjIizthiX+dABql/catdJBDGRHnbDEv86vkweH7bHyy6jKv4Rj/P8An0UmDw/bEfLLqMq/hGP8/n/Ln5JHlkaSRi7scsx70AEkjySNLIxd2OWY961fCuo/Y78RSNiGY7T7Hsax6WgD1EGmyuscbSOwVVBJPoKy/DGofbrABzmaLCvk9fQ1k+MNU3MdPgY4X/WkevpQBla7qLajel84iTiMe3rWdS0lAEtrPJbXMdxC2HQ5HvXoWlXsd/ZpPGevDD0PevOK0/D2pHTr0FiTBJgOP60Ad/RTUYOoZSCCMg06gCprP/IJvP8Ari//AKCa5fwP/wAhaX/rif5iuo1n/kE3n/XF/wD0E1y/gf8A5C0v/XE/zFAHZ0UUUAFFFFABRRRQB//X+y6KKKACiiigArgT/wAjV/2+f+z131cCf+Rq/wC3z/2egDvarapeJY2Mlw/8I+UZ6nsKs1xni7UftN39ljb91Eecd2/z/WgDFnlknmeaRsu5JJqOigdeKAFrX0XS43iOoagQlnHyAf8Alp/9al0XTI3ibUNQISzj5Ab/AJaf/WqHVb+41a6SGGMrEDtiiX+dAC6rfT6tdJBChEWdsMS/zq+TB4ftj92XUZV/CMf5/P8AkhMPh+2x8suoyr+EY/z+f8sCSR5ZGlkYu7HLMe9ABJI8sjSSMXdjlmPemUUUAFLSUUAWtOvp7CZ5YD8zIVOenNVmJZixJJPUmkooAKKKKAClFJRQB1Pg/VOBp87Dj/VEn9K6jPFeYRs0bh0JDqQQR2Nd7oGpJqNkGJxKnEg/rQBY1n/kE3n/AFxf/wBBNcv4H/5C0v8A1xP8xXUaz/yCbz/ri/8A6Ca5fwP/AMhaX/rif5igDs6KKKACiiigAooooA//0PsuiiigAooooAK4E/8AI1f9vn/s9d8a89u5RB4hlnYEiO5LkDvhs0Adtq808Ni7W0TyTEbUCjkE964c6TqhJJspyTySVroB4stsY+xzf99Cj/hK7X/nzl/76FAHPnSdTx/x4z/981d0zRvL33eqr5NtFztbq5/wro7PVo5rF72SB7eBfutIcbvpXLatqFzq94IokYpnEca859zQAmq31xq12sEEZEQOIol/nWxBYzaPZeZBavc30oxlVyIxUVsbLw6i+epuL1wCyp/AP6VY/wCEstv+fSb/AL6FAGBLpmrSyNJJZ3DuxyzFetN/sjU/+fGf/vmug/4Su1/585f++hR/wldr/wA+cv8A30KAOf8A7I1P/nxn/wC+aP7I1P8A58Z/++a6D/hK7X/nzl/76FH/AAldr/z5y/8AfQoA5/8AsjU/+fGf/vmj+yNT/wCfGf8A75roP+Ertf8Anzl/76FH/CV2v/PnL/30KAOf/sjU/wDnxn/75o/sjU/+fGf/AL5roP8AhK7X/nzl/wC+hR/wldr/AM+cv/fQoA5/+yNT/wCfGf8A75o/sjU/+fGf/vmug/4Su1/585f++hR/wldr/wA+cv8A30KAOf8A7I1P/nxn/wC+aP7I1P8A58Z/++a6D/hK7X/nzl/76FH/AAldr/z5y/8AfQoA5/8AsjU/+fGf/vmrmkW+r6ferOllPtzh12n5hWp/wldr/wA+cv8A30KP+Ertf+fOX/voUAa+rNu0a6bBGYGOD1HymuZ8D/8AIWl/64n+YqzfeJre4spoBayqZI2UEkcZGKreB/8AkKyn/pif5igDs6KKKACiiigAooooA//R+y6KKKACiiigArHn8OadPO80nm73YscNjknNbFFAGJ/wjGmf9N/+/lRXGg6NZxG4nMnlpyQ0mQfatq7uIrWBppnCoozk1xGrajdaxeLFCh2E4jjHf3NACapfT6tdpBDGfKU4hjUfrXTeH9HTT4vNkw1yw5JH3fYUeHtHj0+LzZMNcMOSR932FbFAGNL4b0+WRpJXuHdjks0nJNN/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTPSf/v5VrTNGs9PnM1v5m4qVO5s8ZB/pWjRQAUUUUAFFFFABRRRQB//0vsuiiigAooooAKhu7mK1t2nmYKijkmpq5fxda6jNcReXukgYgBVHQ+9AGVq2oXOsXqxRK2zdiNB39zXS+H9Hj0+ISSYa4Ycn+77Cjw/o8enxebLhrhhySPu+wrYoAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKAP/9P7LooooAKKKKACkxS0UAFFFFABRRTW6D6igB1FN7n8KQE+YRQA+iiigAopsnEZI64pR90UALRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFAH//2Q==",Zt={keywords:"",color:"",orientation:""};s.A.setDefaultIndicator((0,i.jsx)(()=>(0,i.jsx)(H.A,{style:{fontSize:48,height:"100%"},spin:!0}),{}));const Jt={hashed:!1,algorithm:l.A.defaultAlgorithm,token:{colorLink:"#1677ff",colorInfo:"#722ed1",colorTextBase:"#000000",colorBgLayout:"#f0f2f5",borderRadiusXL:16,borderRadiusLG:12,borderRadius:8,borderRadiusSM:6,colorDarken1:"rgba(0, 0, 0, 0.08)",colorFillSecondaryDarken:"rgba(0, 0, 0, 0.1)",formControlHeight:34,borderWidth:1,borderColorHover:"#C5C5C5",formItemMarginBottomMD:20,formItemMarginBottomXS:8,colorSecondaryH:265.03,colorSecondaryS:"63.92%",colorSecondaryL:"50%",colorSecondaryBgH:273,colorSecondaryBgS:"100%",colorSecondaryBgL:"93%",appZoom:1},components:{Progress:{colorFillSecondary:"#ffffff"},Tabs:{titleFontSize:16,titleFontSizeSM:16,fontSize:16,fontSizeLG:16}}},Qt={hashed:!1,algorithm:l.A.darkAlgorithm,token:{colorBgBase:"#1F1F1F",colorInfo:"#9254de",colorLink:"#1890ff",colorLinkHover:"#69c0ff",wireframe:!1,borderRadiusXL:16,borderRadiusLG:12,borderRadius:8,borderRadiusSM:6,borderWidth:1,colorDarken1:"rgba(0, 0, 0, 0.9)",colorFillSecondaryDarken:"rgba(255, 255, 255, 0.16)",formControlHeight:34,borderColorHover:"rgba(255, 255, 255, 0.3)",formItemMarginBottomMD:20,formItemMarginBottomXS:8,appZoom:1},components:{Tabs:{titleFontSize:16,titleFontSizeSM:16,fontSize:16,fontSizeLG:16}}},en=({externalTheme:e=Ht,children:t,customThemeToken:n})=>{const r=matchMedia(Gt).matches?Wt:Ht,a=e===$t?r:e,[s,l]=(0,o.useState)(a),[d,h]=(0,o.useState)("light"===s?Jt:Qt);return(0,o.useEffect)(()=>{l(a)},[a]),(0,o.useEffect)(()=>{const e="light"===s?Jt:Qt,t=n?function(...e){return function(){const e=function(e,t){return{defaultMergeFunctions:Mt,mergeFunctions:{...Mt,...Object.fromEntries(Object.entries(e).filter(([e,t])=>Object.hasOwn(Mt,e)).map(([e,t])=>!1===t?[e,Mt.mergeOthers]:[e,t]))},metaDataUpdater:e.metaDataUpdater??At,deepmerge:t,useImplicitDefaultMerging:e.enableImplicitDefaultMerging??!1,filterValues:!1===e.filterValues?void 0:e.filterValues??kt,actions:St}}({},t);function t(...t){return Pt(t,e,void 0)}return t}()(...e)}(e.token,n):e.token;h(Object.assign(Object.assign({},e),{token:t}))},[h,s,n]),(0,i.jsx)("div",{id:"file-manager-element-id",style:{height:"100%"},children:(0,i.jsx)(c.Ay,{theme:d,children:(0,i.jsx)(Le,{transformers:[],children:(0,i.jsx)(u.A,{style:{height:"100%"},children:t})})})})};let tn=!1;const nn=()=>{if(tn)return;window.addEventListener("error",e=>!(!e.message||!e.message.includes("ResizeObserver loop completed with undelivered notifications"))&&(e.stopImmediatePropagation(),e.preventDefault(),!0),!0);const e=window.onerror;window.onerror=(t,n,r,i,o)=>!("string"!=typeof t||!t.includes("ResizeObserver loop completed with undelivered notifications"))||!!e&&e(t,n,r,i,o),window.addEventListener("unhandledrejection",e=>{var t,n;(null===(n=null===(t=e.reason)||void 0===t?void 0:t.message)||void 0===n?void 0:n.includes("ResizeObserver loop completed with undelivered notifications"))&&e.preventDefault()});const t=console.error;if(console.error=(...e)=>{var n;((null===(n=e[0])||void 0===n?void 0:n.toString())||"").includes("ResizeObserver loop completed with undelivered notifications")||t.apply(console,e)},"undefined"!=typeof window){const e=()=>{try{["webpackHotUpdate","__webpack_require__","__webpack_hash__"].forEach(e=>{if(window[e]){window.__webpack_require__}})}catch(e){}};e(),setTimeout(e,1e3)}tn=!0},rn=e=>{if(!e)return"image/png";const t=e.toLowerCase();return t.includes("jpeg")||t.includes("jpg")||t.includes("pjpeg")?"image/jpeg":t.includes("png")?"image/png":t.includes("gif")?"image/gif":t.includes("webp")?"image/webp":t.includes("svg")?"image/svg+xml":"image/png"},on=e=>{if(!e.startsWith("data:"))return null;const t=e.match(/^data:([^;,]+)/);return t?t[1]:null},an=(e,t="image/png")=>{let n=t;if(e.startsWith("data:")){const t=on(e);t&&t.startsWith("image/")&&(n=t)}return rn(n)},sn=e=>{const t=rn(e).split("/")[1];return"svg+xml"===t?"svg":t||"png"},ln=/^data:(.+?);base64,(.+)$/i,cn=(e,t)=>{const n=(e=>{const t=(e=>{if("function"!=typeof globalThis.atob)throw new Error("Base64 decoding is not supported in the current environment.");return globalThis.atob(e)})(e),n=t.length,r=new Uint8Array(n);for(let i=0;i<n;i++)r[i]=t.charCodeAt(i);return r})(e.replace(/\s/g,"")),r=new ArrayBuffer(n.length);return new Uint8Array(r).set(n),new Blob([r],{type:t})},un=(e,t="application/octet-stream")=>{if(e instanceof Blob)return e;if("string"==typeof e){const n=e.trim(),r=n.match(ln);if(r){const[,e,t]=r;return cn(t,e)}return cn(n,t)}throw new Error("Unsupported data type. Expected Blob or base64 string.")};var dn="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof n.g?n.g:"undefined"!=typeof self?self:{};const hn={},fn=(e,t,n,r)=>{vn(n)&&hn[n]||(vn(n)&&(hn[n]=new Date),((e,t,n,r)=>{const i=[n,{code:t,...r||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(i,"warn","react-i18next::",!0);vn(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...i):console})(e,t,n,r))},pn=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},gn=(e,t,n)=>{e.loadNamespaces(t,pn(e,n))},mn=(e,t,n,r)=>{if(vn(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return gn(e,n,r);n.forEach(t=>{e.options.ns.indexOf(t)<0&&e.options.ns.push(t)}),e.loadLanguages(t,pn(e,r))},vn=e=>"string"==typeof e,yn=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,bn={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"\xa9","©":"\xa9","®":"\xae","®":"\xae","…":"\u2026","…":"\u2026","/":"/","/":"/"},wn=e=>bn[e];let xn,Cn={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:e=>e.replace(yn,wn)};const _n={type:"3rdParty",init(e){((e={})=>{Cn={...Cn,...e}})(e.options.react),(e=>{xn=e})(e)}},Sn=(0,o.createContext)();class An{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(e=>{this.usedNamespaces[e]||(this.usedNamespaces[e]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const kn=(e,t,n,r)=>e.getFixedT(t,n,r),En=(e,t={})=>{const{i18n:n}=t,{i18n:r,defaultNS:i}=(0,o.useContext)(Sn)||{},a=n||r||xn;if(a&&!a.reportNamespaces&&(a.reportNamespaces=new An),!a){fn(a,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const e=(e,t)=>{return vn(t)?t:"object"==typeof(n=t)&&null!==n&&vn(t.defaultValue)?t.defaultValue:Array.isArray(e)?e[e.length-1]:e;var n},t=[e,{},!1];return t.t=e,t.i18n={},t.ready=!1,t}a.options.react?.wait&&fn(a,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const s={...Cn,...a.options.react,...t},{useSuspense:l,keyPrefix:c}=s;let u=i||a.options?.defaultNS;u=vn(u)?[u]:u||["translation"],a.reportNamespaces.addUsedNamespaces?.(u);const d=(a.isInitialized||a.initializedStoreOnce)&&u.every(e=>((e,t,n={})=>t.languages&&t.languages.length?t.hasLoadedNamespace(e,{lng:n.lng,precheck:(t,r)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!r(t.isLanguageChangingTo,e))return!1}}):(fn(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0))(e,a,s)),h=((e,t,n,r)=>(0,o.useCallback)(kn(e,t,n,r),[e,t,n,r]))(a,t.lng||null,"fallback"===s.nsMode?u:u[0],c),f=()=>h,p=()=>kn(a,t.lng||null,"fallback"===s.nsMode?u:u[0],c),[g,m]=(0,o.useState)(f);let v=u.join();t.lng&&(v=`${t.lng}${v}`);const y=(e=>{const t=(0,o.useRef)();return(0,o.useEffect)(()=>{t.current=e},[e,void 0]),t.current})(v),b=(0,o.useRef)(!0);(0,o.useEffect)(()=>{const{bindI18n:e,bindI18nStore:n}=s;b.current=!0,d||l||(t.lng?mn(a,t.lng,u,()=>{b.current&&m(p)}):gn(a,u,()=>{b.current&&m(p)})),d&&y&&y!==v&&b.current&&m(p);const r=()=>{b.current&&m(p)};return e&&a?.on(e,r),n&&a?.store.on(n,r),()=>{b.current=!1,a&&e&&e?.split(" ").forEach(e=>a.off(e,r)),n&&a&&n.split(" ").forEach(e=>a.store.off(e,r))}},[a,v]),(0,o.useEffect)(()=>{b.current&&d&&m(f)},[a,c,d]);const w=[g,a,d];if(w.t=g,w.i18n=a,w.ready=d,d)return w;if(!d&&!l)return w;throw new Promise(e=>{t.lng?mn(a,t.lng,u,()=>e()):gn(a,u,()=>e())})};function In({i18n:e,defaultNS:t,children:n}){const r=(0,o.useMemo)(()=>({i18n:e,defaultNS:t}),[e,t]);return(0,o.createElement)(Sn.Provider,{value:r},n)}const jn=e=>"string"==typeof e,Tn=()=>{let e,t;const n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},Fn=e=>null==e?"":""+e,On=/###/g,Mn=e=>e&&e.indexOf("###")>-1?e.replace(On,"."):e,Pn=e=>!e||jn(e),Rn=(e,t,n)=>{const r=jn(t)?t.split("."):t;let i=0;for(;i<r.length-1;){if(Pn(e))return{};const t=Mn(r[i]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return Pn(e)?{}:{obj:e,k:Mn(r[i])}},Ln=(e,t,n)=>{const{obj:r,k:i}=Rn(e,t,Object);if(void 0!==r||1===t.length)return void(r[i]=n);let o=t[t.length-1],a=t.slice(0,t.length-1),s=Rn(e,a,Object);for(;void 0===s.obj&&a.length;)o=`${a[a.length-1]}.${o}`,a=a.slice(0,a.length-1),s=Rn(e,a,Object),s?.obj&&void 0!==s.obj[`${s.k}.${o}`]&&(s.obj=void 0);s.obj[`${s.k}.${o}`]=n},Nn=(e,t)=>{const{obj:n,k:r}=Rn(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},Dn=(e,t,n)=>{for(const r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?jn(e[r])||e[r]instanceof String||jn(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):Dn(e[r],t[r],n):e[r]=t[r]);return e},zn=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Bn={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const Un=e=>jn(e)?e.replace(/[&<>"'\/]/g,e=>Bn[e]):e,Vn=[" ",",","?","!",";"],Hn=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(void 0!==t)return t;const n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}(20),Wn=(e,t,n=".")=>{if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}const r=t.split(n);let i=e;for(let o=0;o<r.length;){if(!i||"object"!=typeof i)return;let e,t="";for(let a=o;a<r.length;++a)if(a!==o&&(t+=n),t+=r[a],e=i[t],void 0!==e){if(["string","number","boolean"].indexOf(typeof e)>-1&&a<r.length-1)continue;o+=a-o+1;break}i=e}return i},$n=e=>e?.replace("_","-"),Gn={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){}};class qn{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||Gn,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,n,r){return r&&!this.debug?null:(jn(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new qn(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new qn(this.logger,e)}}var Yn=new qn;class Xn{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(e=>{this.observers[e]||(this.observers[e]=new Map);const n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){this.observers[e]&&(t?this.observers[e].delete(t):delete this.observers[e])}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([e,n])=>{for(let r=0;r<n;r++)e(...t)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([n,r])=>{for(let i=0;i<r;i++)n.apply(n,[e,...t])})}}class Kn extends Xn{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,r={}){const i=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,o=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;e.indexOf(".")>-1?a=e.split("."):(a=[e,t],n&&(Array.isArray(n)?a.push(...n):jn(n)&&i?a.push(...n.split(i)):a.push(n)));const s=Nn(this.data,a);return!s&&!t&&!n&&e.indexOf(".")>-1&&(e=a[0],t=a[1],n=a.slice(2).join(".")),!s&&o&&jn(n)?Wn(this.data?.[e]?.[t],n,i):s}addResource(e,t,n,r,i={silent:!1}){const o=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator;let a=[e,t];n&&(a=a.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(a=e.split("."),r=t,t=a[1]),this.addNamespaces(t),Ln(this.data,a,r),i.silent||this.emit("added",e,t,n,r)}addResources(e,t,n,r={silent:!1}){for(const i in n)(jn(n[i])||Array.isArray(n[i]))&&this.addResource(e,t,i,n[i],{silent:!0});r.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,r,i,o={silent:!1,skipCopy:!1}){let a=[e,t];e.indexOf(".")>-1&&(a=e.split("."),r=n,n=t,t=a[1]),this.addNamespaces(t);let s=Nn(this.data,a)||{};o.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?Dn(s,n,i):s={...s,...n},Ln(this.data,a,s),o.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}}var Zn={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(e=>{t=this.processors[e]?.process(t,n,r,i)??t}),t}};const Jn=Symbol("i18next/PATH_KEY");function Qn(e,t){const{[Jn]:n}=e(function(){const e=[],t=Object.create(null);let n;return t.get=(r,i)=>(n?.revoke?.(),i===Jn?e:(e.push(i),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}());return n.join(t?.keySeparator??".")}const er={},tr=e=>!jn(e)&&"boolean"!=typeof e&&"number"!=typeof e;class nr extends Xn{constructor(e,t={}){super(),((e,t,n)=>{["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"].forEach(e=>{t[e]&&(n[e]=t[e])})})(0,e,this),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=Yn.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const n={...t};if(null==e)return!1;const r=this.resolve(e,n);return void 0!==r?.res}extractFromKey(e,t){let n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");const r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator;let i=t.ns||this.options.defaultNS||[];const o=n&&e.indexOf(n)>-1,a=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||((e,t,n)=>{t=t||"",n=n||"";const r=Vn.filter(e=>t.indexOf(e)<0&&n.indexOf(e)<0);if(0===r.length)return!0;const i=Hn.getRegExp(`(${r.map(e=>"?"===e?"\\?":e).join("|")})`);let o=!i.test(e);if(!o){const t=e.indexOf(n);t>0&&!i.test(e.substring(0,t))&&(o=!0)}return o})(e,n,r));if(o&&!a){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:jn(i)?[i]:i};const o=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(o[0])>-1)&&(i=o.shift()),e=o.join(r)}return{key:e,namespaces:jn(i)?[i]:i}}translate(e,t,n){let r="object"==typeof t?{...t}:t;if("object"!=typeof r&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof r&&(r={...r}),r||(r={}),null==e)return"";"function"==typeof e&&(e=Qn(e,{...this.options,...r})),Array.isArray(e)||(e=[String(e)]);const i=void 0!==r.returnDetails?r.returnDetails:this.options.returnDetails,o=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,{key:a,namespaces:s}=this.extractFromKey(e[e.length-1],r),l=s[s.length-1];let c=void 0!==r.nsSeparator?r.nsSeparator:this.options.nsSeparator;void 0===c&&(c=":");const u=r.lng||this.language,d=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if("cimode"===u?.toLowerCase())return d?i?{res:`${l}${c}${a}`,usedKey:a,exactUsedKey:a,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(r)}:`${l}${c}${a}`:i?{res:a,usedKey:a,exactUsedKey:a,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(r)}:a;const h=this.resolve(e,r);let f=h?.res;const p=h?.usedKey||a,g=h?.exactUsedKey||a,m=void 0!==r.joinArrays?r.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject,y=void 0!==r.count&&!jn(r.count),b=nr.hasDefaultValue(r),w=y?this.pluralResolver.getSuffix(u,r.count,r):"",x=r.ordinal&&y?this.pluralResolver.getSuffix(u,r.count,{ordinal:!1}):"",C=y&&!r.ordinal&&0===r.count,_=C&&r[`defaultValue${this.options.pluralSeparator}zero`]||r[`defaultValue${w}`]||r[`defaultValue${x}`]||r.defaultValue;let S=f;v&&!f&&b&&(S=_);const A=tr(S),k=Object.prototype.toString.apply(S);if(!(v&&S&&A&&["[object Number]","[object Function]","[object RegExp]"].indexOf(k)<0)||jn(m)&&Array.isArray(S))if(v&&jn(m)&&Array.isArray(f))f=f.join(m),f&&(f=this.extendTranslation(f,e,r,n));else{let t=!1,i=!1;!this.isValidLookup(f)&&b&&(t=!0,f=_),this.isValidLookup(f)||(i=!0,f=a);const s=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&i?void 0:f,d=b&&_!==f&&this.options.updateMissing;if(i||t||d){if(this.logger.log(d?"updateKey":"missingKey",u,l,a,d?_:f),o){const e=this.resolve(a,{...r,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[];const t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if("fallback"===this.options.saveMissingTo&&t&&t[0])for(let r=0;r<t.length;r++)e.push(t[r]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(r.lng||this.language):e.push(r.lng||this.language);const n=(e,t,n)=>{const i=b&&n!==f?n:s;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,i,d,r):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,i,d,r),this.emit("missingKey",e,l,t,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&y?e.forEach(e=>{const t=this.pluralResolver.getSuffixes(e,r);C&&r[`defaultValue${this.options.pluralSeparator}zero`]&&t.indexOf(`${this.options.pluralSeparator}zero`)<0&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{n([e],a+t,r[`defaultValue${t}`]||_)})}):n(e,a,_))}f=this.extendTranslation(f,e,r,h,n),i&&f===a&&this.options.appendNamespaceToMissingKey&&(f=`${l}${c}${a}`),(i||t)&&this.options.parseMissingKeyHandler&&(f=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${c}${a}`:a,t?f:void 0,r))}else{if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(p,S,{...r,ns:s}):`key '${a} (${this.language})' returned an object instead of string.`;return i?(h.res=e,h.usedParams=this.getUsedParamsDetails(r),h):e}if(o){const e=Array.isArray(S),t=e?[]:{},n=e?g:p;for(const i in S)if(Object.prototype.hasOwnProperty.call(S,i)){const e=`${n}${o}${i}`;t[i]=b&&!f?this.translate(e,{...r,defaultValue:tr(_)?_[i]:void 0,joinArrays:!1,ns:s}):this.translate(e,{...r,joinArrays:!1,ns:s}),t[i]===e&&(t[i]=S[i])}f=t}}return i?(h.res=f,h.usedParams=this.getUsedParamsDetails(r),h):f}extendTranslation(e,t,n,r,i){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const o=jn(e)&&(void 0!==n?.interpolation?.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let a;if(o){const t=e.match(this.interpolator.nestingRegexp);a=t&&t.length}let s=n.replace&&!jn(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,n.lng||this.language||r.usedLng,n),o){const t=e.match(this.interpolator.nestingRegexp);a<(t&&t.length)&&(n.nest=!1)}!n.lng&&r&&r.res&&(n.lng=this.language||r.usedLng),!1!==n.nest&&(e=this.interpolator.nest(e,(...e)=>i?.[0]!==e[0]||n.context?this.translate(...e,t):(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null),n)),n.interpolation&&this.interpolator.reset()}const o=n.postProcess||this.options.postProcess,a=jn(o)?[o]:o;return null!=e&&a?.length&&!1!==n.applyPostProcessor&&(e=Zn.handle(a,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,r,i,o,a;return jn(e)&&(e=[e]),e.forEach(e=>{if(this.isValidLookup(n))return;const s=this.extractFromKey(e,t),l=s.key;r=l;let c=s.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));const u=void 0!==t.count&&!jn(t.count),d=u&&!t.ordinal&&0===t.count,h=void 0!==t.context&&(jn(t.context)||"number"==typeof t.context)&&""!==t.context,f=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);c.forEach(e=>{this.isValidLookup(n)||(a=e,er[`${f[0]}-${e}`]||!this.utils?.hasLoadedNamespace||this.utils?.hasLoadedNamespace(a)||(er[`${f[0]}-${e}`]=!0,this.logger.warn(`key "${r}" for languages "${f.join(", ")}" won't get resolved as namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),f.forEach(r=>{if(this.isValidLookup(n))return;o=r;const a=[l];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(a,l,r,e,t);else{let e;u&&(e=this.pluralResolver.getSuffix(r,t.count,t));const n=`${this.options.pluralSeparator}zero`,i=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(t.ordinal&&0===e.indexOf(i)&&a.push(l+e.replace(i,this.options.pluralSeparator)),a.push(l+e),d&&a.push(l+n)),h){const r=`${l}${this.options.contextSeparator||"_"}${t.context}`;a.push(r),u&&(t.ordinal&&0===e.indexOf(i)&&a.push(r+e.replace(i,this.options.pluralSeparator)),a.push(r+e),d&&a.push(r+n))}}let s;for(;s=a.pop();)this.isValidLookup(n)||(i=s,n=this.getResource(r,e,s,t))}))})}),{res:n,usedKey:r,exactUsedKey:i,usedLng:o,usedNS:a}}isValidLookup(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}getResource(e,t,n,r={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!jn(e.replace);let r=n?e.replace:e;if(n&&void 0!==e.count&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(const e of t)delete r[e]}return r}static hasDefaultValue(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&"defaultValue"===t.substring(0,12)&&void 0!==e[t])return!0;return!1}}class rr{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Yn.create("languageUtils")}getScriptPartFromCode(e){if(!(e=$n(e))||e.indexOf("-")<0)return null;const t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}getLanguagePartFromCode(e){if(!(e=$n(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(jn(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch(e){}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;const n=this.formatLanguageCode(e);this.options.supportedLngs&&!this.isSupportedCode(n)||(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;const n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;const r=this.getLanguagePartFromCode(e);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(e=>e===r?e:e.indexOf("-")<0&&r.indexOf("-")<0?void 0:e.indexOf("-")>0&&r.indexOf("-")<0&&e.substring(0,e.indexOf("-"))===r||0===e.indexOf(r)&&r.length>1?e:void 0)}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),jn(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){const n=this.getFallbackCodes((!1===t?[]:t)||this.options.fallbackLng||[],e),r=[],i=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return jn(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&i(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&i(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&i(this.getLanguagePartFromCode(e))):jn(e)&&i(this.formatLanguageCode(e)),n.forEach(e=>{r.indexOf(e)<0&&i(this.formatLanguageCode(e))}),r}}const ir={zero:0,one:1,two:2,few:3,many:4,other:5},or={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class ar{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=Yn.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const n=$n("dev"===e?"en":e),r=t.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:n,type:r});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let o;try{o=new Intl.PluralRules(n,{type:r})}catch(n){if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),or;if(!e.match(/-|_/))return or;const r=this.languageUtils.getLanguagePartFromCode(e);o=this.getRule(r,t)}return this.pluralRulesCache[i]=o,o}needsPlural(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?n.resolvedOptions().pluralCategories.sort((e,t)=>ir[e]-ir[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`):[]}getSuffix(e,t,n={}){const r=this.getRule(e,n);return r?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,n))}}const sr=(e,t,n,r=".",i=!0)=>{let o=((e,t,n)=>{const r=Nn(e,n);return void 0!==r?r:Nn(t,n)})(e,t,n);return!o&&i&&jn(n)&&(o=Wn(e,n,r),void 0===o&&(o=Wn(t,n,r))),o},lr=e=>e.replace(/\$/g,"$$$$");class cr{constructor(e={}){this.logger=Yn.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:i,prefixEscaped:o,suffix:a,suffixEscaped:s,formatSeparator:l,unescapeSuffix:c,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:h,nestingSuffix:f,nestingSuffixEscaped:p,nestingOptionsSeparator:g,maxReplaces:m,alwaysFormat:v}=e.interpolation;this.escape=void 0!==t?t:Un,this.escapeValue=void 0===n||n,this.useRawValueToEscape=void 0!==r&&r,this.prefix=i?zn(i):o||"{{",this.suffix=a?zn(a):s||"}}",this.formatSeparator=l||",",this.unescapePrefix=c?"":u||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=d?zn(d):h||zn("$t("),this.nestingSuffix=f?zn(f):p||zn(")"),this.nestingOptionsSeparator=g||",",this.maxReplaces=m||1e3,this.alwaysFormat=void 0!==v&&v,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let i,o,a;const s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=e=>{if(e.indexOf(this.formatSeparator)<0){const i=sr(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,n,{...r,...t,interpolationkey:e}):i}const i=e.split(this.formatSeparator),o=i.shift().trim(),a=i.join(this.formatSeparator).trim();return this.format(sr(t,s,o,this.options.keySeparator,this.options.ignoreJSONStructure),a,n,{...r,...t,interpolationkey:o})};this.resetRegExp();const c=r?.missingInterpolationHandler||this.options.missingInterpolationHandler,u=void 0!==r?.interpolation?.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>lr(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?lr(this.escape(e)):lr(e)}].forEach(t=>{for(a=0;i=t.regex.exec(e);){const n=i[1].trim();if(o=l(n),void 0===o)if("function"==typeof c){const t=c(e,i,r);o=jn(t)?t:""}else if(r&&Object.prototype.hasOwnProperty.call(r,n))o="";else{if(u){o=i[0];continue}this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),o=""}else jn(o)||this.useRawValueToEscape||(o=Fn(o));const s=t.safeValue(o);if(e=e.replace(i[0],s),u?(t.regex.lastIndex+=o.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),e}nest(e,t,n={}){let r,i,o;const a=(e,t)=>{const n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;const r=e.split(new RegExp(`${n}[ ]*{`));let i=`{${r[1]}`;e=r[0],i=this.interpolate(i,o);const a=i.match(/'/g),s=i.match(/"/g);((a?.length??0)%2==0&&!s||s.length%2!=0)&&(i=i.replace(/'/g,'"'));try{o=JSON.parse(i),t&&(o={...t,...o})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${i}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,e};for(;r=this.nestingRegexp.exec(e);){let s=[];o={...n},o=o.replace&&!jn(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;const l=/{.*}/.test(r[1])?r[1].lastIndexOf("}")+1:r[1].indexOf(this.formatSeparator);if(-1!==l&&(s=r[1].slice(l).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),r[1]=r[1].slice(0,l)),i=t(a.call(this,r[1].trim(),o),o),i&&r[0]===e&&!jn(i))return i;jn(i)||(i=Fn(i)),i||(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),i=""),s.length&&(i=s.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:r[1].trim()}),i.trim())),e=e.replace(r[0],i),this.regexp.lastIndex=0}return e}}const ur=e=>{const t={};return(n,r,i)=>{let o=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(o={...o,[i.interpolationkey]:void 0});const a=r+JSON.stringify(o);let s=t[a];return s||(s=e($n(r),i),t[a]=s),s(n)}},dr=e=>(t,n,r)=>e($n(n),r)(t);class hr{constructor(e={}){this.logger=Yn.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const n=t.cacheInBuiltFormats?ur:dr;this.formats={number:n((e,t)=>{const n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:n((e,t)=>{const n=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>n.format(e)}),datetime:n((e,t)=>{const n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:n((e,t)=>{const n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||"day")}),list:n((e,t)=>{const n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=ur(t)}format(e,t,n,r={}){const i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf("(")>1&&i[0].indexOf(")")<0&&i.find(e=>e.indexOf(")")>-1)){const e=i.findIndex(e=>e.indexOf(")")>-1);i[0]=[i[0],...i.splice(1,e)].join(this.formatSeparator)}const o=i.reduce((e,t)=>{const{formatName:i,formatOptions:o}=(e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const i=r[1].substring(0,r[1].length-1);"currency"===t&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):"relativetime"===t&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach(e=>{if(e){const[t,...r]=e.split(":"),i=r.join(":").trim().replace(/^'+|'+$/g,""),o=t.trim();n[o]||(n[o]=i),"false"===i&&(n[o]=!1),"true"===i&&(n[o]=!0),isNaN(i)||(n[o]=parseInt(i,10))}})}return{formatName:t,formatOptions:n}})(t);if(this.formats[i]){let t=e;try{const a=r?.formatParams?.[r.interpolationkey]||{},s=a.locale||a.lng||r.locale||r.lng||n;t=this.formats[i](e,s,{...o,...r,...a})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${i}`),e},e);return o}}class fr extends Xn{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=Yn.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,r.backend,r)}queueLoad(e,t,n,r){const i={},o={},a={},s={};return e.forEach(e=>{let r=!0;t.forEach(t=>{const a=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[a]=2:this.state[a]<0||(1===this.state[a]?void 0===o[a]&&(o[a]=!0):(this.state[a]=1,r=!1,void 0===o[a]&&(o[a]=!0),void 0===i[a]&&(i[a]=!0),void 0===s[t]&&(s[t]=!0)))}),r||(a[e]=!0)}),(Object.keys(i).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(o),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){const r=e.split("|"),i=r[0],o=r[1];t&&this.emit("failedLoading",i,o,t),!t&&n&&this.store.addResourceBundle(i,o,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);const a={};this.queue.forEach(n=>{((e,t,n)=>{const{obj:r,k:i}=Rn(e,t,Object);r[i]=r[i]||[],r[i].push(n)})(n.loaded,[i],o),((e,t)=>{void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)})(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach(e=>{a[e]||(a[e]={});const t=n.loaded[e];t.length&&t.forEach(t=>{void 0===a[e][t]&&(a[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n,r=0,i=this.retryTimeout,o){if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:i,callback:o});this.readingCalls++;const a=(a,s)=>{if(this.readingCalls--,this.waitingReads.length>0){const e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}a&&s&&r<this.maxRetries?setTimeout(()=>{this.read.call(this,e,t,n,r+1,2*i,o)},i):o(a,s)},s=this.backend[n].bind(this.backend);if(2!==s.length)return s(e,t,a);try{const n=s(e,t);n&&"function"==typeof n.then?n.then(e=>a(null,e)).catch(a):a(null,n)}catch(e){a(e)}}prepareLoading(e,t,n={},r){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();jn(e)&&(e=this.languageUtils.toResolveHierarchy(e)),jn(t)&&(t=[t]);const i=this.queueLoad(e,t,n,r);if(!i.toLoad.length)return i.pending.length||r(),null;i.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=""){const n=e.split("|"),r=n[0],i=n[1];this.read(r,i,"read",void 0,void 0,(n,o)=>{n&&this.logger.warn(`${t}loading namespace ${i} for language ${r} failed`,n),!n&&o&&this.logger.log(`${t}loaded namespace ${i} for language ${r}`,o),this.loaded(e,n,o)})}saveMissing(e,t,n,r,i,o={},a=()=>{}){if(!this.services?.utils?.hasLoadedNamespace||this.services?.utils?.hasLoadedNamespace(t)){if(null!=n&&""!==n){if(this.backend?.create){const s={...o,isUpdate:i},l=this.backend.create.bind(this.backend);if(l.length<6)try{let i;i=5===l.length?l(e,t,n,r,s):l(e,t,n,r),i&&"function"==typeof i.then?i.then(e=>a(null,e)).catch(a):a(null,i)}catch(e){a(e)}else l(e,t,n,r,a,s)}e&&e[0]&&this.store.addResource(e[0],t,n,r)}}else this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")}}const pr=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if("object"==typeof e[1]&&(t=e[1]),jn(e[1])&&(t.defaultValue=e[1]),jn(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){const n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),gr=e=>(jn(e.ns)&&(e.ns=[e.ns]),jn(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),jn(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),"boolean"==typeof e.initImmediate&&(e.initAsync=e.initImmediate),e),mr=()=>{};class vr extends Xn{constructor(e={},t){var n;if(super(),this.options=gr(e),this.services={},this.logger=Yn,this.modules={external:[]},n=this,Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach(e=>{"function"==typeof n[e]&&(n[e]=n[e].bind(n))}),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,"function"==typeof e&&(t=e,e={}),null==e.defaultNS&&e.ns&&(jn(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const n=pr();this.options={...n,...this.options,...gr(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},void 0!==e.keySeparator&&(this.options.userDefinedKeySeparator=e.keySeparator),void 0!==e.nsSeparator&&(this.options.userDefinedNsSeparator=e.nsSeparator);const r=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let e;this.modules.logger?Yn.init(r(this.modules.logger),this.options):Yn.init(null,this.options),e=this.modules.formatter?this.modules.formatter:hr;const t=new rr(this.options);this.store=new Kn(this.options.resources,this.options);const i=this.services;i.logger=Yn,i.resourceStore=this.store,i.languageUtils=t,i.pluralResolver=new ar(t,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),!e||this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format||(i.formatter=r(e),i.formatter.init&&i.formatter.init(i,this.options),this.options.interpolation.format=i.formatter.format.bind(i.formatter)),i.interpolator=new cr(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new fr(r(this.modules.backend),i.resourceStore,i,this.options),i.backendConnector.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(i.languageDetector=r(this.modules.languageDetector),i.languageDetector.init&&i.languageDetector.init(i,this.options.detection,this.options)),this.modules.i18nFormat&&(i.i18nFormat=r(this.modules.i18nFormat),i.i18nFormat.init&&i.i18nFormat.init(this)),this.translator=new nr(this.services,this.options),this.translator.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||(t=mr),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(e=>{this[e]=(...t)=>this.store[e](...t)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});const i=Tn(),o=()=>{const e=(e,n)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),i.resolve(n),t(e,n)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?o():setTimeout(o,0),i}loadResources(e,t=mr){let n=t;const r=jn(e)?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if("cimode"===r?.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return n();const e=[],t=t=>{t&&"cimode"!==t&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{"cimode"!==t&&e.indexOf(t)<0&&e.push(t)})};r?t(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e)),this.options.preload?.forEach?.(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),n(e)})}else n(null)}reloadResources(e,t,n){const r=Tn();return"function"==typeof e&&(n=e,e=void 0),"function"==typeof t&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=mr),this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&Zn.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1)){for(let e=0;e<this.languages.length;e++){const t=this.languages[e];if(!(["cimode","dev"].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;const n=Tn();this.emit("languageChanging",e);const r=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(i,o)=>{o?this.isLanguageChangingTo===e&&(r(o),this.translator.changeLanguage(o),this.isLanguageChangingTo=void 0,this.emit("languageChanged",o),this.logger.log("languageChanged",o)):this.isLanguageChangingTo=void 0,n.resolve((...e)=>this.t(...e)),t&&t(i,(...e)=>this.t(...e))},o=t=>{e||t||!this.services.languageDetector||(t=[]);const n=jn(t)?t:t&&t[0],o=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(jn(t)?[t]:t);o&&(this.language||r(o),this.translator.language||this.translator.changeLanguage(o),this.services.languageDetector?.cacheUserLanguage?.(o)),this.loadResources(o,e=>{i(e,o)})};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(e):o(this.services.languageDetector.detect()),n}getFixedT(e,t,n){const r=(e,t,...i)=>{let o;o="object"!=typeof t?this.options.overloadTranslationOptionHandler([e,t].concat(i)):{...t},o.lng=o.lng||r.lng,o.lngs=o.lngs||r.lngs,o.ns=o.ns||r.ns,""!==o.keyPrefix&&(o.keyPrefix=o.keyPrefix||n||r.keyPrefix);const a=this.options.keySeparator||".";let s;return o.keyPrefix&&Array.isArray(e)?s=e.map(e=>("function"==typeof e&&(e=Qn(e,{...this.options,...t})),`${o.keyPrefix}${a}${e}`)):("function"==typeof e&&(e=Qn(e,{...this.options,...t})),s=o.keyPrefix?`${o.keyPrefix}${a}${e}`:e),this.t(s,o)};return jn(e)?r.lng=e:r.lngs=e,r.ns=t,r.keyPrefix=n,r}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=t.lng||this.resolvedLanguage||this.languages[0],r=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;const o=(e,t)=>{const n=this.services.backendConnector.state[`${e}|${t}`];return-1===n||0===n||2===n};if(t.precheck){const e=t.precheck(this,o);if(void 0!==e)return e}return!!this.hasResourceBundle(n,e)||!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!o(n,e)||r&&!o(i,e))}loadNamespaces(e,t){const n=Tn();return this.options.ns?(jn(e)&&(e=[e]),e.forEach(e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){const n=Tn();jn(e)&&(e=[e]);const r=this.options.preload||[],i=e.filter(e=>r.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e));return i.length?(this.options.preload=r.concat(i),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";try{const t=new Intl.Locale(e);if(t&&t.getTextInfo){const e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch(e){}const t=this.services?.languageUtils||new rr(pr());return e.toLowerCase().indexOf("-latn")>1?"ltr":["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){return new vr(e,t)}cloneInstance(e={},t=mr){const n=e.forkResourceStore;n&&delete e.forkResourceStore;const r={...this.options,...e,isClone:!0},i=new vr(r);if(void 0===e.debug&&void 0===e.prefix||(i.logger=i.logger.clone(e)),["store","services","language"].forEach(e=>{i[e]=this[e]}),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},n){const e=Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((n,r)=>(n[r]={...e[t][r]},n),e[t]),e),{});i.store=new Kn(e,r),i.services.resourceStore=i.store}return i.translator=new nr(i.services,r),i.translator.on("*",(e,...t)=>{i.emit(e,...t)}),i.init(r,t),i.translator.options=r,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const yr=vr.createInstance();yr.createInstance=vr.createInstance,yr.createInstance,yr.dir,yr.init,yr.loadResources,yr.reloadResources,yr.use,yr.changeLanguage,yr.getFixedT,yr.t,yr.exists,yr.setDefaultNamespace,yr.hasLoadedNamespace,yr.loadNamespaces,yr.loadLanguages;var br,wr,xr,Cr,_r,Sr={};!function(){if(_r)return Sr;_r=1;var e=function(){if(Cr)return xr;function e(e,t){return t.forEach(function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach(function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}})}),Object.freeze(e)}Cr=1;var t=function(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}(function(){if(wr)return br;function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,n(i.key),i)}}function n(e){var t=function(e){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}function r(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,o(e,t,"get"))}function i(e,t,n){return function(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}(e,o(e,t,"set"),n),n}function o(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function a(e,t,n){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,n)}wr=1;var s=function(t){if(!t)return[];Array.isArray(t)||(t=[t]);for(var n={},r=0;r<t.length;++r){var i,o=t[r];if(o&&"object"===e(o)&&(o=String(o)),"string"!=typeof o){var a="Locales should be strings, ".concat(JSON.stringify(o)," isn't.");throw new TypeError(a)}var s=o.split("-");if(!s.every(function(e){return/[a-z0-9]+/i.test(e)})){var l=JSON.stringify(o),c="The locale ".concat(l," is not a structurally valid BCP 47 language tag.");throw new RangeError(c)}var u=s[0].toLowerCase();s[0]=null!==(i={in:"id",iw:"he",ji:"yi"}[u])&&void 0!==i?i:u,n[s.join("-")]=!0}return Object.keys(n)};function l(t){switch(e(t)){case"number":return t;case"bigint":throw new TypeError("Cannot convert a BigInt value to a number");default:return Number(t)}}return br=function(e,n,o,c){var u=function(e){do{if(n(e))return e;e=e.replace(/-?[^-]*$/,"")}while(e);return null},d=new WeakMap,h=new WeakMap,f=new WeakMap,p=new WeakMap,g=new WeakMap,m=function(){function m(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,m),a(this,d,{writable:!0,value:void 0}),a(this,h,{writable:!0,value:void 0}),a(this,f,{writable:!0,value:void 0}),a(this,p,{writable:!0,value:void 0}),a(this,g,{writable:!0,value:void 0}),i(this,d,function(t){for(var n=s(t),r=0;r<n.length;++r){var i=u(n[r]);if(i)return i}var o=(new e).resolvedOptions().locale;return u(o)}(t)),i(this,f,n(r(this,d))),i(this,h,c(r(this,d))),i(this,p,function(e){var t=Object.prototype.hasOwnProperty.call(e,"type")&&e.type;if(!t)return"cardinal";if("cardinal"===t||"ordinal"===t)return t;throw new RangeError("Not a valid plural type: "+JSON.stringify(t))}(o)),i(this,g,new e("en",o))}var v,y,b;return v=m,b=[{key:"supportedLocalesOf",value:function(e){return s(e).filter(u)}}],(y=[{key:"resolvedOptions",value:function(){var e=r(this,g).resolvedOptions(),t=e.minimumIntegerDigits,n=e.minimumFractionDigits,i=e.maximumFractionDigits,a=e.minimumSignificantDigits,s=e.maximumSignificantDigits,l=e.roundingPriority,c={locale:r(this,d),type:r(this,p),minimumIntegerDigits:t,minimumFractionDigits:n,maximumFractionDigits:i};return"number"==typeof a&&(c.minimumSignificantDigits=a,c.maximumSignificantDigits=s),c.pluralCategories=o(r(this,d),"ordinal"===r(this,p)).slice(0),c.roundingPriority=l||"auto",c}},{key:"select",value:function(e){if(!(this instanceof m))throw new TypeError("select() called on incompatible ".concat(this));if("number"!=typeof e&&(e=Number(e)),!isFinite(e))return"other";var t=r(this,g).format(Math.abs(e));return r(this,f).call(this,t,"ordinal"===r(this,p))}},{key:"selectRange",value:function(e,t){if(!(this instanceof m))throw new TypeError("selectRange() called on incompatible ".concat(this));if(void 0===e)throw new TypeError("start is undefined");if(void 0===t)throw new TypeError("end is undefined");var n=l(e),i=l(t);if(!isFinite(n))throw new RangeError("start must be finite");if(!isFinite(i))throw new RangeError("end must be finite");return r(this,h).call(this,this.select(n),this.select(i))}}])&&t(v.prototype,y),b&&t(v,b),Object.defineProperty(v,"prototype",{writable:!1}),m}();return"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(m.prototype,Symbol.toStringTag,{value:"Intl.PluralRules",writable:!1,configurable:!0}),Object.defineProperty(m,"prototype",{writable:!1}),m},br}());function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==dn||"undefined"!=typeof self&&self;var r={exports:{}};!function(e){var t=function(e,t){return t?"other":1==e?"one":"other"},n=function(e,t){return t?"other":0==e||1==e?"one":"other"},r=function(e,t){return t?"other":e>=0&&e<=1?"one":"other"},i=function(e,t){var n=!String(e).split(".")[1];return t?"other":1==e&&n?"one":"other"},o=function(e,t){return"other"},a=function(e,t){return t?"other":1==e?"one":2==e?"two":"other"};!function(t,n){Object.defineProperty(n,"__esModule",{value:!0}),e.exports=n}(0,{af:t,ak:n,am:r,an:t,ar:function(e,t){var n=String(e).split("."),r=Number(n[0])==e&&n[0].slice(-2);return t?"other":0==e?"zero":1==e?"one":2==e?"two":r>=3&&r<=10?"few":r>=11&&r<=99?"many":"other"},ars:function(e,t){var n=String(e).split("."),r=Number(n[0])==e&&n[0].slice(-2);return t?"other":0==e?"zero":1==e?"one":2==e?"two":r>=3&&r<=10?"few":r>=11&&r<=99?"many":"other"},as:function(e,t){return t?1==e||5==e||7==e||8==e||9==e||10==e?"one":2==e||3==e?"two":4==e?"few":6==e?"many":"other":e>=0&&e<=1?"one":"other"},asa:t,ast:i,az:function(e,t){var n=String(e).split(".")[0],r=n.slice(-1),i=n.slice(-2),o=n.slice(-3);return t?1==r||2==r||5==r||7==r||8==r||20==i||50==i||70==i||80==i?"one":3==r||4==r||100==o||200==o||300==o||400==o||500==o||600==o||700==o||800==o||900==o?"few":0==n||6==r||40==i||60==i||90==i?"many":"other":1==e?"one":"other"},bal:function(e,t){return 1==e?"one":"other"},be:function(e,t){var n=String(e).split("."),r=Number(n[0])==e,i=r&&n[0].slice(-1),o=r&&n[0].slice(-2);return t?2!=i&&3!=i||12==o||13==o?"other":"few":1==i&&11!=o?"one":i>=2&&i<=4&&(o<12||o>14)?"few":r&&0==i||i>=5&&i<=9||o>=11&&o<=14?"many":"other"},bem:t,bez:t,bg:t,bho:n,bm:o,bn:function(e,t){return t?1==e||5==e||7==e||8==e||9==e||10==e?"one":2==e||3==e?"two":4==e?"few":6==e?"many":"other":e>=0&&e<=1?"one":"other"},bo:o,br:function(e,t){var n=String(e).split("."),r=Number(n[0])==e,i=r&&n[0].slice(-1),o=r&&n[0].slice(-2),a=r&&n[0].slice(-6);return t?"other":1==i&&11!=o&&71!=o&&91!=o?"one":2==i&&12!=o&&72!=o&&92!=o?"two":(3==i||4==i||9==i)&&(o<10||o>19)&&(o<70||o>79)&&(o<90||o>99)?"few":0!=e&&r&&0==a?"many":"other"},brx:t,bs:function(e,t){var n=String(e).split("."),r=n[0],i=n[1]||"",o=!n[1],a=r.slice(-1),s=r.slice(-2),l=i.slice(-1),c=i.slice(-2);return t?"other":o&&1==a&&11!=s||1==l&&11!=c?"one":o&&a>=2&&a<=4&&(s<12||s>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"},ca:function(e,t){var n=String(e).split("."),r=n[0],i=!n[1],o=r.slice(-6);return t?1==e||3==e?"one":2==e?"two":4==e?"few":"other":1==e&&i?"one":0!=r&&0==o&&i?"many":"other"},ce:t,ceb:function(e,t){var n=String(e).split("."),r=n[0],i=n[1]||"",o=!n[1],a=r.slice(-1),s=i.slice(-1);return t?"other":o&&(1==r||2==r||3==r)||o&&4!=a&&6!=a&&9!=a||!o&&4!=s&&6!=s&&9!=s?"one":"other"},cgg:t,chr:t,ckb:t,cs:function(e,t){var n=String(e).split("."),r=n[0],i=!n[1];return t?"other":1==e&&i?"one":r>=2&&r<=4&&i?"few":i?"other":"many"},cy:function(e,t){return t?0==e||7==e||8==e||9==e?"zero":1==e?"one":2==e?"two":3==e||4==e?"few":5==e||6==e?"many":"other":0==e?"zero":1==e?"one":2==e?"two":3==e?"few":6==e?"many":"other"},da:function(e,t){var n=String(e).split("."),r=n[0],i=Number(n[0])==e;return t||1!=e&&(i||0!=r&&1!=r)?"other":"one"},de:i,doi:r,dsb:function(e,t){var n=String(e).split("."),r=n[0],i=n[1]||"",o=!n[1],a=r.slice(-2),s=i.slice(-2);return t?"other":o&&1==a||1==s?"one":o&&2==a||2==s?"two":o&&(3==a||4==a)||3==s||4==s?"few":"other"},dv:t,dz:o,ee:t,el:t,en:function(e,t){var n=String(e).split("."),r=!n[1],i=Number(n[0])==e,o=i&&n[0].slice(-1),a=i&&n[0].slice(-2);return t?1==o&&11!=a?"one":2==o&&12!=a?"two":3==o&&13!=a?"few":"other":1==e&&r?"one":"other"},eo:t,es:function(e,t){var n=String(e).split("."),r=n[0],i=!n[1],o=r.slice(-6);return t?"other":1==e?"one":0!=r&&0==o&&i?"many":"other"},et:i,eu:t,fa:r,ff:function(e,t){return t?"other":e>=0&&e<2?"one":"other"},fi:i,fil:function(e,t){var n=String(e).split("."),r=n[0],i=n[1]||"",o=!n[1],a=r.slice(-1),s=i.slice(-1);return t?1==e?"one":"other":o&&(1==r||2==r||3==r)||o&&4!=a&&6!=a&&9!=a||!o&&4!=s&&6!=s&&9!=s?"one":"other"},fo:t,fr:function(e,t){var n=String(e).split("."),r=n[0],i=!n[1],o=r.slice(-6);return t?1==e?"one":"other":e>=0&&e<2?"one":0!=r&&0==o&&i?"many":"other"},fur:t,fy:i,ga:function(e,t){var n=String(e).split("."),r=Number(n[0])==e;return t?1==e?"one":"other":1==e?"one":2==e?"two":r&&e>=3&&e<=6?"few":r&&e>=7&&e<=10?"many":"other"},gd:function(e,t){var n=String(e).split("."),r=Number(n[0])==e;return t?1==e||11==e?"one":2==e||12==e?"two":3==e||13==e?"few":"other":1==e||11==e?"one":2==e||12==e?"two":r&&e>=3&&e<=10||r&&e>=13&&e<=19?"few":"other"},gl:i,gsw:t,gu:function(e,t){return t?1==e?"one":2==e||3==e?"two":4==e?"few":6==e?"many":"other":e>=0&&e<=1?"one":"other"},guw:n,gv:function(e,t){var n=String(e).split("."),r=n[0],i=!n[1],o=r.slice(-1),a=r.slice(-2);return t?"other":i&&1==o?"one":i&&2==o?"two":!i||0!=a&&20!=a&&40!=a&&60!=a&&80!=a?i?"other":"many":"few"},ha:t,haw:t,he:function(e,t){var n=String(e).split("."),r=n[0],i=!n[1];return t?"other":1==r&&i||0==r&&!i?"one":2==r&&i?"two":"other"},hi:function(e,t){return t?1==e?"one":2==e||3==e?"two":4==e?"few":6==e?"many":"other":e>=0&&e<=1?"one":"other"},hnj:o,hr:function(e,t){var n=String(e).split("."),r=n[0],i=n[1]||"",o=!n[1],a=r.slice(-1),s=r.slice(-2),l=i.slice(-1),c=i.slice(-2);return t?"other":o&&1==a&&11!=s||1==l&&11!=c?"one":o&&a>=2&&a<=4&&(s<12||s>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"},hsb:function(e,t){var n=String(e).split("."),r=n[0],i=n[1]||"",o=!n[1],a=r.slice(-2),s=i.slice(-2);return t?"other":o&&1==a||1==s?"one":o&&2==a||2==s?"two":o&&(3==a||4==a)||3==s||4==s?"few":"other"},hu:function(e,t){return t?1==e||5==e?"one":"other":1==e?"one":"other"},hy:function(e,t){return t?1==e?"one":"other":e>=0&&e<2?"one":"other"},ia:i,id:o,ig:o,ii:o,io:i,is:function(e,t){var n=String(e).split("."),r=n[0],i=(n[1]||"").replace(/0+$/,""),o=Number(n[0])==e,a=r.slice(-1),s=r.slice(-2);return t?"other":o&&1==a&&11!=s||i%10==1&&i%100!=11?"one":"other"},it:function(e,t){var n=String(e).split("."),r=n[0],i=!n[1],o=r.slice(-6);return t?11==e||8==e||80==e||800==e?"many":"other":1==e&&i?"one":0!=r&&0==o&&i?"many":"other"},iu:a,ja:o,jbo:o,jgo:t,jmc:t,jv:o,jw:o,ka:function(e,t){var n=String(e).split(".")[0],r=n.slice(-2);return t?1==n?"one":0==n||r>=2&&r<=20||40==r||60==r||80==r?"many":"other":1==e?"one":"other"},kab:function(e,t){return t?"other":e>=0&&e<2?"one":"other"},kaj:t,kcg:t,kde:o,kea:o,kk:function(e,t){var n=String(e).split("."),r=Number(n[0])==e,i=r&&n[0].slice(-1);return t?6==i||9==i||r&&0==i&&0!=e?"many":"other":1==e?"one":"other"},kkj:t,kl:t,km:o,kn:r,ko:o,ks:t,ksb:t,ksh:function(e,t){return t?"other":0==e?"zero":1==e?"one":"other"},ku:t,kw:function(e,t){var n=String(e).split("."),r=Number(n[0])==e,i=r&&n[0].slice(-2),o=r&&n[0].slice(-3),a=r&&n[0].slice(-5),s=r&&n[0].slice(-6);return t?r&&e>=1&&e<=4||i>=1&&i<=4||i>=21&&i<=24||i>=41&&i<=44||i>=61&&i<=64||i>=81&&i<=84?"one":5==e||5==i?"many":"other":0==e?"zero":1==e?"one":2==i||22==i||42==i||62==i||82==i||r&&0==o&&(a>=1e3&&a<=2e4||4e4==a||6e4==a||8e4==a)||0!=e&&1e5==s?"two":3==i||23==i||43==i||63==i||83==i?"few":1==e||1!=i&&21!=i&&41!=i&&61!=i&&81!=i?"other":"many"},ky:t,lag:function(e,t){var n=String(e).split(".")[0];return t?"other":0==e?"zero":0!=n&&1!=n||0==e?"other":"one"},lb:t,lg:t,lij:function(e,t){var n=String(e).split("."),r=!n[1],i=Number(n[0])==e;return t?11==e||8==e||i&&e>=80&&e<=89||i&&e>=800&&e<=899?"many":"other":1==e&&r?"one":"other"},lkt:o,ln:n,lo:function(e,t){return t&&1==e?"one":"other"},lt:function(e,t){var n=String(e).split("."),r=n[1]||"",i=Number(n[0])==e,o=i&&n[0].slice(-1),a=i&&n[0].slice(-2);return t?"other":1==o&&(a<11||a>19)?"one":o>=2&&o<=9&&(a<11||a>19)?"few":0!=r?"many":"other"},lv:function(e,t){var n=String(e).split("."),r=n[1]||"",i=r.length,o=Number(n[0])==e,a=o&&n[0].slice(-1),s=o&&n[0].slice(-2),l=r.slice(-2),c=r.slice(-1);return t?"other":o&&0==a||s>=11&&s<=19||2==i&&l>=11&&l<=19?"zero":1==a&&11!=s||2==i&&1==c&&11!=l||2!=i&&1==c?"one":"other"},mas:t,mg:n,mgo:t,mk:function(e,t){var n=String(e).split("."),r=n[0],i=n[1]||"",o=!n[1],a=r.slice(-1),s=r.slice(-2),l=i.slice(-1),c=i.slice(-2);return t?1==a&&11!=s?"one":2==a&&12!=s?"two":7!=a&&8!=a||17==s||18==s?"other":"many":o&&1==a&&11!=s||1==l&&11!=c?"one":"other"},ml:t,mn:t,mo:function(e,t){var n=String(e).split("."),r=!n[1],i=Number(n[0])==e&&n[0].slice(-2);return t?1==e?"one":"other":1==e&&r?"one":!r||0==e||1!=e&&i>=1&&i<=19?"few":"other"},mr:function(e,t){return t?1==e?"one":2==e||3==e?"two":4==e?"few":"other":1==e?"one":"other"},ms:function(e,t){return t&&1==e?"one":"other"},mt:function(e,t){var n=String(e).split("."),r=Number(n[0])==e&&n[0].slice(-2);return t?"other":1==e?"one":2==e?"two":0==e||r>=3&&r<=10?"few":r>=11&&r<=19?"many":"other"},my:o,nah:t,naq:a,nb:t,nd:t,ne:function(e,t){var n=String(e).split("."),r=Number(n[0])==e;return t?r&&e>=1&&e<=4?"one":"other":1==e?"one":"other"},nl:i,nn:t,nnh:t,no:t,nqo:o,nr:t,nso:n,ny:t,nyn:t,om:t,or:function(e,t){var n=String(e).split("."),r=Number(n[0])==e;return t?1==e||5==e||r&&e>=7&&e<=9?"one":2==e||3==e?"two":4==e?"few":6==e?"many":"other":1==e?"one":"other"},os:t,osa:o,pa:n,pap:t,pcm:r,pl:function(e,t){var n=String(e).split("."),r=n[0],i=!n[1],o=r.slice(-1),a=r.slice(-2);return t?"other":1==e&&i?"one":i&&o>=2&&o<=4&&(a<12||a>14)?"few":i&&1!=r&&(0==o||1==o)||i&&o>=5&&o<=9||i&&a>=12&&a<=14?"many":"other"},prg:function(e,t){var n=String(e).split("."),r=n[1]||"",i=r.length,o=Number(n[0])==e,a=o&&n[0].slice(-1),s=o&&n[0].slice(-2),l=r.slice(-2),c=r.slice(-1);return t?"other":o&&0==a||s>=11&&s<=19||2==i&&l>=11&&l<=19?"zero":1==a&&11!=s||2==i&&1==c&&11!=l||2!=i&&1==c?"one":"other"},ps:t,pt:function(e,t){var n=String(e).split("."),r=n[0],i=!n[1],o=r.slice(-6);return t?"other":0==r||1==r?"one":0!=r&&0==o&&i?"many":"other"},pt_PT:function(e,t){var n=String(e).split("."),r=n[0],i=!n[1],o=r.slice(-6);return t?"other":1==e&&i?"one":0!=r&&0==o&&i?"many":"other"},rm:t,ro:function(e,t){var n=String(e).split("."),r=!n[1],i=Number(n[0])==e&&n[0].slice(-2);return t?1==e?"one":"other":1==e&&r?"one":!r||0==e||1!=e&&i>=1&&i<=19?"few":"other"},rof:t,ru:function(e,t){var n=String(e).split("."),r=n[0],i=!n[1],o=r.slice(-1),a=r.slice(-2);return t?"other":i&&1==o&&11!=a?"one":i&&o>=2&&o<=4&&(a<12||a>14)?"few":i&&0==o||i&&o>=5&&o<=9||i&&a>=11&&a<=14?"many":"other"},rwk:t,sah:o,saq:t,sat:a,sc:function(e,t){var n=!String(e).split(".")[1];return t?11==e||8==e||80==e||800==e?"many":"other":1==e&&n?"one":"other"},scn:function(e,t){var n=!String(e).split(".")[1];return t?11==e||8==e||80==e||800==e?"many":"other":1==e&&n?"one":"other"},sd:t,sdh:t,se:a,seh:t,ses:o,sg:o,sh:function(e,t){var n=String(e).split("."),r=n[0],i=n[1]||"",o=!n[1],a=r.slice(-1),s=r.slice(-2),l=i.slice(-1),c=i.slice(-2);return t?"other":o&&1==a&&11!=s||1==l&&11!=c?"one":o&&a>=2&&a<=4&&(s<12||s>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"},shi:function(e,t){var n=String(e).split("."),r=Number(n[0])==e;return t?"other":e>=0&&e<=1?"one":r&&e>=2&&e<=10?"few":"other"},si:function(e,t){var n=String(e).split("."),r=n[0],i=n[1]||"";return t?"other":0==e||1==e||0==r&&1==i?"one":"other"},sk:function(e,t){var n=String(e).split("."),r=n[0],i=!n[1];return t?"other":1==e&&i?"one":r>=2&&r<=4&&i?"few":i?"other":"many"},sl:function(e,t){var n=String(e).split("."),r=n[0],i=!n[1],o=r.slice(-2);return t?"other":i&&1==o?"one":i&&2==o?"two":i&&(3==o||4==o)||!i?"few":"other"},sma:a,smi:a,smj:a,smn:a,sms:a,sn:t,so:t,sq:function(e,t){var n=String(e).split("."),r=Number(n[0])==e,i=r&&n[0].slice(-1),o=r&&n[0].slice(-2);return t?1==e?"one":4==i&&14!=o?"many":"other":1==e?"one":"other"},sr:function(e,t){var n=String(e).split("."),r=n[0],i=n[1]||"",o=!n[1],a=r.slice(-1),s=r.slice(-2),l=i.slice(-1),c=i.slice(-2);return t?"other":o&&1==a&&11!=s||1==l&&11!=c?"one":o&&a>=2&&a<=4&&(s<12||s>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"},ss:t,ssy:t,st:t,su:o,sv:function(e,t){var n=String(e).split("."),r=!n[1],i=Number(n[0])==e,o=i&&n[0].slice(-1),a=i&&n[0].slice(-2);return t?1!=o&&2!=o||11==a||12==a?"other":"one":1==e&&r?"one":"other"},sw:i,syr:t,ta:t,te:t,teo:t,th:o,ti:n,tig:t,tk:function(e,t){var n=String(e).split("."),r=Number(n[0])==e&&n[0].slice(-1);return t?6==r||9==r||10==e?"few":"other":1==e?"one":"other"},tl:function(e,t){var n=String(e).split("."),r=n[0],i=n[1]||"",o=!n[1],a=r.slice(-1),s=i.slice(-1);return t?1==e?"one":"other":o&&(1==r||2==r||3==r)||o&&4!=a&&6!=a&&9!=a||!o&&4!=s&&6!=s&&9!=s?"one":"other"},tn:t,to:o,tpi:o,tr:t,ts:t,tzm:function(e,t){var n=String(e).split("."),r=Number(n[0])==e;return t?"other":0==e||1==e||r&&e>=11&&e<=99?"one":"other"},ug:t,uk:function(e,t){var n=String(e).split("."),r=n[0],i=!n[1],o=Number(n[0])==e,a=o&&n[0].slice(-1),s=o&&n[0].slice(-2),l=r.slice(-1),c=r.slice(-2);return t?3==a&&13!=s?"few":"other":i&&1==l&&11!=c?"one":i&&l>=2&&l<=4&&(c<12||c>14)?"few":i&&0==l||i&&l>=5&&l<=9||i&&c>=11&&c<=14?"many":"other"},und:o,ur:i,uz:t,ve:t,vec:function(e,t){var n=String(e).split("."),r=n[0],i=!n[1],o=r.slice(-6);return t?11==e||8==e||80==e||800==e?"many":"other":1==e&&i?"one":0!=r&&0==o&&i?"many":"other"},vi:function(e,t){return t&&1==e?"one":"other"},vo:t,vun:t,wa:n,wae:t,wo:o,xh:t,xog:t,yi:i,yo:o,yue:o,zh:o,zu:r})}(r);var i=n(r.exports),o=e({__proto__:null,default:i},[r.exports]),a={exports:{}};!function(e){var t="zero",n="one",r="two",i="few",o="many",a="other",s={cardinal:[n,a],ordinal:[a]},l={cardinal:[n,a],ordinal:[n,a]},c={cardinal:[a],ordinal:[a]},u={cardinal:[n,r,a],ordinal:[a]};!function(t,n){Object.defineProperty(n,"__esModule",{value:!0}),e.exports=n}(0,{af:s,ak:s,am:s,an:s,ar:{cardinal:[t,n,r,i,o,a],ordinal:[a]},ars:{cardinal:[t,n,r,i,o,a],ordinal:[a]},as:{cardinal:[n,a],ordinal:[n,r,i,o,a]},asa:s,ast:s,az:{cardinal:[n,a],ordinal:[n,i,o,a]},bal:l,be:{cardinal:[n,i,o,a],ordinal:[i,a]},bem:s,bez:s,bg:s,bho:s,bm:c,bn:{cardinal:[n,a],ordinal:[n,r,i,o,a]},bo:c,br:{cardinal:[n,r,i,o,a],ordinal:[a]},brx:s,bs:{cardinal:[n,i,a],ordinal:[a]},ca:{cardinal:[n,o,a],ordinal:[n,r,i,a]},ce:s,ceb:s,cgg:s,chr:s,ckb:s,cs:{cardinal:[n,i,o,a],ordinal:[a]},cy:{cardinal:[t,n,r,i,o,a],ordinal:[t,n,r,i,o,a]},da:s,de:s,doi:s,dsb:{cardinal:[n,r,i,a],ordinal:[a]},dv:s,dz:c,ee:s,el:s,en:{cardinal:[n,a],ordinal:[n,r,i,a]},eo:s,es:{cardinal:[n,o,a],ordinal:[a]},et:s,eu:s,fa:s,ff:s,fi:s,fil:l,fo:s,fr:{cardinal:[n,o,a],ordinal:[n,a]},fur:s,fy:s,ga:{cardinal:[n,r,i,o,a],ordinal:[n,a]},gd:{cardinal:[n,r,i,a],ordinal:[n,r,i,a]},gl:s,gsw:s,gu:{cardinal:[n,a],ordinal:[n,r,i,o,a]},guw:s,gv:{cardinal:[n,r,i,o,a],ordinal:[a]},ha:s,haw:s,he:u,hi:{cardinal:[n,a],ordinal:[n,r,i,o,a]},hnj:c,hr:{cardinal:[n,i,a],ordinal:[a]},hsb:{cardinal:[n,r,i,a],ordinal:[a]},hu:l,hy:l,ia:s,id:c,ig:c,ii:c,io:s,is:s,it:{cardinal:[n,o,a],ordinal:[o,a]},iu:u,ja:c,jbo:c,jgo:s,jmc:s,jv:c,jw:c,ka:{cardinal:[n,a],ordinal:[n,o,a]},kab:s,kaj:s,kcg:s,kde:c,kea:c,kk:{cardinal:[n,a],ordinal:[o,a]},kkj:s,kl:s,km:c,kn:s,ko:c,ks:s,ksb:s,ksh:{cardinal:[t,n,a],ordinal:[a]},ku:s,kw:{cardinal:[t,n,r,i,o,a],ordinal:[n,o,a]},ky:s,lag:{cardinal:[t,n,a],ordinal:[a]},lb:s,lg:s,lij:{cardinal:[n,a],ordinal:[o,a]},lkt:c,ln:s,lo:{cardinal:[a],ordinal:[n,a]},lt:{cardinal:[n,i,o,a],ordinal:[a]},lv:{cardinal:[t,n,a],ordinal:[a]},mas:s,mg:s,mgo:s,mk:{cardinal:[n,a],ordinal:[n,r,o,a]},ml:s,mn:s,mo:{cardinal:[n,i,a],ordinal:[n,a]},mr:{cardinal:[n,a],ordinal:[n,r,i,a]},ms:{cardinal:[a],ordinal:[n,a]},mt:{cardinal:[n,r,i,o,a],ordinal:[a]},my:c,nah:s,naq:u,nb:s,nd:s,ne:l,nl:s,nn:s,nnh:s,no:s,nqo:c,nr:s,nso:s,ny:s,nyn:s,om:s,or:{cardinal:[n,a],ordinal:[n,r,i,o,a]},os:s,osa:c,pa:s,pap:s,pcm:s,pl:{cardinal:[n,i,o,a],ordinal:[a]},prg:{cardinal:[t,n,a],ordinal:[a]},ps:s,pt:{cardinal:[n,o,a],ordinal:[a]},pt_PT:{cardinal:[n,o,a],ordinal:[a]},rm:s,ro:{cardinal:[n,i,a],ordinal:[n,a]},rof:s,ru:{cardinal:[n,i,o,a],ordinal:[a]},rwk:s,sah:c,saq:s,sat:u,sc:{cardinal:[n,a],ordinal:[o,a]},scn:{cardinal:[n,a],ordinal:[o,a]},sd:s,sdh:s,se:u,seh:s,ses:c,sg:c,sh:{cardinal:[n,i,a],ordinal:[a]},shi:{cardinal:[n,i,a],ordinal:[a]},si:s,sk:{cardinal:[n,i,o,a],ordinal:[a]},sl:{cardinal:[n,r,i,a],ordinal:[a]},sma:u,smi:u,smj:u,smn:u,sms:u,sn:s,so:s,sq:{cardinal:[n,a],ordinal:[n,o,a]},sr:{cardinal:[n,i,a],ordinal:[a]},ss:s,ssy:s,st:s,su:c,sv:l,sw:s,syr:s,ta:s,te:s,teo:s,th:c,ti:s,tig:s,tk:{cardinal:[n,a],ordinal:[i,a]},tl:l,tn:s,to:c,tpi:c,tr:s,ts:s,tzm:s,ug:s,uk:{cardinal:[n,i,o,a],ordinal:[i,a]},und:c,ur:s,uz:s,ve:s,vec:{cardinal:[n,o,a],ordinal:[o,a]},vi:{cardinal:[a],ordinal:[n,a]},vo:s,vun:s,wa:s,wae:s,wo:c,xh:s,xog:s,yi:s,yo:c,yue:c,zh:c,zu:s})}(a);var s=n(a.exports),l=e({__proto__:null,default:s},[a.exports]),c={exports:{}};!function(e){var t,n=function(e,t){return"other"},r=function(e,t){return"other"===e&&"one"===t?"one":"other"},i=function(e,t){return t||"other"};t={af:n,ak:r,am:i,an:n,ar:function(e,t){return"few"===t?"few":"many"===t?"many":"zero"===e&&"one"===t||"zero"===e&&"two"===t?"zero":"other"},as:i,az:i,be:i,bg:n,bn:i,bs:i,ca:n,cs:i,cy:i,da:i,de:i,el:i,en:n,es:n,et:n,eu:n,fa:r,fi:n,fil:i,fr:i,ga:i,gl:i,gsw:i,gu:i,he:n,hi:i,hr:i,hu:i,hy:i,ia:n,id:n,io:n,is:i,it:i,ja:n,ka:function(e,t){return e||"other"},kk:i,km:n,kn:i,ko:n,ky:i,lij:i,lo:n,lt:i,lv:function(e,t){return"one"===t?"one":"other"},mk:n,ml:i,mn:i,mr:i,ms:n,my:n,nb:n,ne:i,nl:i,no:n,or:r,pa:i,pcm:n,pl:i,ps:i,pt:i,ro:function(e,t){return"few"===t||"one"===t?"few":"other"},ru:i,sc:i,scn:i,sd:r,si:function(e,t){return"one"===e&&"one"===t?"one":"other"},sk:i,sl:function(e,t){return"few"===t||"one"===t?"few":"two"===t?"two":"other"},sq:i,sr:i,sv:n,sw:i,ta:i,te:i,th:n,tk:i,tr:i,ug:i,uk:i,ur:n,uz:i,vi:n,yue:n,zh:n,zu:i},Object.defineProperty(t,"__esModule",{value:!0}),e.exports=t}(c);var u=n(c.exports),d=i||o,h=s||l,f=u||e({__proto__:null,default:u},[c.exports]),p=function(e){return"pt-PT"===e?"pt_PT":e},g=t.default(Intl.NumberFormat,function(e){return d[p(e)]},function(e,t){return h[p(e)][t?"ordinal":"cardinal"]},function(e){return f[p(e)]});return xr=g}();var t=function(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}(e);if("undefined"==typeof Intl)void 0!==dn?dn.Intl={PluralRules:t.default}:"undefined"!=typeof window?window.Intl={PluralRules:t.default}:Sr.Intl={PluralRules:t.default},t.default.polyfill=!0;else if(Intl.PluralRules&&Intl.PluralRules.prototype.selectRange){var n=["en","es","ru","zh"];Intl.PluralRules.supportedLocalesOf(n).length<n.length&&(Intl.PluralRules=t.default,t.default.polyfill=!0)}else Intl.PluralRules=t.default,t.default.polyfill=!0}();var Ar={Files:"Arquivos",selected:"selecionado(s)",Deselected:"Desmarcar",Refresh:"Atualizar","Select all":"Selecionar tudo",Rename:"Renomear","Rename file":"Renomear arquivo {{currentFileName}}","Select the destination folder":"Selecionar a pasta de destino","Selected files:":"Arquivos selecionados:","Selected files":"Arquivos selecionados: {{count}}",selected_files_one:"{{count}} arquivo selecionado",selected_files_few:"{{count}} arquivos selecionados",selected_files_many:"{{count}} arquivos selecionados",selected_files_other:"{{count}} arquivos selecionados",Copy:"Duplicar",Edit:"Editar",Move:"Mover","Move to":"Mover para",Delete:"Excluir","New folder":"Nova pasta","Image search...":"Busca de imagens...","Search icons":"Encontrar \xedcones","By name":"Por nome","By size":"Por tamanho","By date":"Por data",List:"Lista",Grid:"Grade",Main:"Principal",Folders:"Pastas","total pages":"Total de {{total}} itens",Name:"Nome",Untitled:"Sem t\xedtulo",Size:"Tamanho",Dimensions:"Dimens\xf5es",Date:"Data",error:"erro",Folder:"Pasta",created:"criada","Failed to create folder":"Falha ao criar pasta","File deleted":"Arquivo exclu\xeddo","Error when deleting a file":"Erro ao excluir arquivo","Folder deleted":"Pasta exclu\xedda","Error when deleting a folder":"Erro ao excluir pasta","Delete folder":"Excluir pasta","Are you sure you want to delete this folder? This action will also delete all files and subfolders.":"Tem certeza que deseja excluir esta pasta? Esta a\xe7\xe3o tamb\xe9m excluir\xe1 todos os arquivos e subpastas.","API-endpoint for file upload is not configured":"Endpoint da API para upload de arquivos n\xe3o est\xe1 configurado","Please select an image file":"Por favor, selecione um arquivo de imagem",File:"Arquivo","has been successfully uploaded":"foi carregado com sucesso","The URL must point to an image":"A URL deve apontar para uma imagem","Image upload...":"Carregando imagem...",Unknown:"Desconhecido","Error downloading file by URL":"Erro ao baixar arquivo por URL","successfully uploaded":"carregado com sucesso","Error when downloading a file by URL":"Erro ao baixar arquivo por URL","Error when uploading a file":"Erro ao enviar arquivo","Error loading files":"Erro ao carregar arquivos","File not found":"Arquivo n\xe3o encontrado","File renamed to":"Arquivo renomeado para","Failed to rename the file":"Falha ao renomear o arquivo","Folder renamed to":"Pasta renomeada para","Rename folder":"Renomear pasta","New folder name":"Novo nome da pasta","Enter a new folder name":"Digite um novo nome para a pasta","Please drag and drop image files only":"Por favor, arraste e solte apenas arquivos de imagem","Upload file by URL":"Carregar arquivo por URL","Upload file":"Carregar arquivo","Creating a new folder":"Criando uma nova pasta",Create:"Criar",Cancel:"Cancelar","Folder name":"Nome da pasta","Enter the name of the folder":"Digite o nome da pasta","Enter the name":"Digite o nome","A folder will be created inside:":"A pasta ser\xe1 criada dentro de:","selected folder":"pasta selecionada","The folder will be created in the root directory":"A pasta ser\xe1 criada no diret\xf3rio raiz","Failed to load folders":"N\xe3o foi poss\xedvel carregar as pastas","Folder name cannot be empty":"O nome da pasta n\xe3o pode estar vazio","Folder creation provider is not configured":"O provedor de cria\xe7\xe3o de pastas n\xe3o est\xe1 configurado","Folder created":"Pasta criada","Folder rename is disabled by config":"Renomear pastas est\xe1 desabilitado pela configura\xe7\xe3o","Folder rename provider is not configured":"O provedor de renomea\xe7\xe3o de pastas n\xe3o est\xe1 configurado","Unexpected response when renaming folder":"Resposta inesperada ao renomear a pasta","Folder renamed":"Pasta renomeada","Failed to rename folder":"N\xe3o foi poss\xedvel renomear a pasta","Failed to load folder items count":"N\xe3o foi poss\xedvel obter a contagem de itens da pasta","Failed to load subfolders":"N\xe3o foi poss\xedvel carregar as subpastas",Download:"Baixar","image URL":"URL da imagem","Enter the URL of the image":"Digite a URL da imagem","Supported formats: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP":"Formatos suportados: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP","New file name":"Novo nome do arquivo","Enter a new file name":"Digite um novo nome para o arquivo","Copy to folder":"Copiar para pasta",Added:"Adicionado em {{date}}","File uploaded successfully":"Arquivo {{fileName}} carregado com sucesso","Successfully uploaded":"{{successCount}} de {{count}} arquivo carregado com sucesso","Successfully uploaded files":"{{successCount}} de {{count}} arquivos carregados com sucesso",uploads_success_summary:"Enviados {{successCount}} de {{totalCount}} arquivos",uploads_fail_summary:"Falhou ao enviar {{failCount}} de {{totalCount}} arquivos","File with this name already exists.":"J\xe1 existe um arquivo com esse nome.","File not found or no longer available.":"O arquivo n\xe3o foi encontrado ou j\xe1 foi exclu\xeddo.","You don't have permission to access this file.":"Voc\xea n\xe3o tem permiss\xe3o para acessar este arquivo.","File is too large to upload.":"O arquivo \xe9 grande demais para ser enviado.","File is too large ({{fileSize}}). Maximum allowed size: {{maxSize}}.":"O arquivo \xe9 grande demais ({{fileSize}}). Tamanho m\xe1ximo permitido: {{maxSize}}.","Maximum number of files exceeded. Allowed: {{allowed}}, received: {{received}}":"N\xfamero m\xe1ximo de arquivos excedido. Permitido: {{allowed}}, recebido: {{received}}","This file type is not allowed.":"Este tipo de arquivo n\xe3o \xe9 permitido.","File name is not valid.":"O nome do arquivo n\xe3o \xe9 v\xe1lido.","File name is not valid. Allowed characters: {{allowedChars}}":"O nome do arquivo n\xe3o \xe9 v\xe1lido. Caracteres permitidos: {{allowedChars}}","Failed to read the file.":"N\xe3o foi poss\xedvel ler o arquivo.","Failed to write the file.":"N\xe3o foi poss\xedvel gravar o arquivo.","The file appears to be corrupted.":"O arquivo parece estar corrompido.","File integrity check failed.":"A verifica\xe7\xe3o de integridade do arquivo falhou.","Folder not found or no longer available.":"A pasta n\xe3o foi encontrada ou j\xe1 foi exclu\xedda.","Folder with this name already exists.":"J\xe1 existe uma pasta com esse nome.","A folder with that name already exists. Please enter a different folder name.":"J\xe1 existe uma pasta com esse nome. Digite um nome diferente para a pasta.","You don't have permission to access this folder.":"Voc\xea n\xe3o tem permiss\xe3o para acessar esta pasta.","Folder name is not valid.":"O nome da pasta n\xe3o \xe9 v\xe1lido.","Folder name is not valid. Allowed characters: {{allowedChars}}":"N\xe3o foi poss\xedvel criar a pasta. Caracteres permitidos no nome: {{allowedChars}}","Failed to read the folder contents.":"N\xe3o foi poss\xedvel ler o conte\xfado da pasta.","Failed to write to the folder.":"N\xe3o foi poss\xedvel gravar na pasta.","Folder storage quota exceeded.":"A cota de armazenamento da pasta foi excedida.","Folder is not empty.":"A pasta n\xe3o est\xe1 vazia.","Server error while processing the folder.":"Erro do servidor ao processar a pasta.","Folder operation took too long.":"A opera\xe7\xe3o com a pasta demorou demais.","Network error. Please check your connection and try again.":"Erro de rede. Verifique sua conex\xe3o e tente novamente.","The operation took too long. Please try again.":"A opera\xe7\xe3o demorou demais. Tente novamente.","Server error. Please try again later.":"Erro no servidor. Tente novamente mais tarde.","Service is temporarily unavailable. Please try again later.":"O servi\xe7o est\xe1 temporariamente indispon\xedvel. Tente novamente mais tarde.","Too many requests. Please try again a bit later.":"Muitas solicita\xe7\xf5es. Tente novamente mais tarde.","Authentication failed. Please sign in again.":"Falha na autentica\xe7\xe3o. Fa\xe7a login novamente.","You are not allowed to perform this action.":"Voc\xea n\xe3o tem permiss\xe3o para executar esta a\xe7\xe3o.","Some of the provided data is invalid.":"Alguns dos dados fornecidos s\xe3o inv\xe1lidos.","This operation is not supported.":"Esta opera\xe7\xe3o n\xe3o \xe9 suportada.","Request payload is too large.":"O corpo da requisi\xe7\xe3o \xe9 grande demais.","This media type is not supported.":"Este tipo de m\xeddia n\xe3o \xe9 suportado.","You have exceeded the upload quota.":"Voc\xea excedeu a cota de upload de arquivos.","Network error while uploading the file.":"Erro de rede ao enviar o arquivo.","File upload took too long.":"O envio do arquivo demorou demais.","Server error while uploading the file.":"Erro do servidor ao enviar o arquivo.","The specified URL is not valid.":"A URL especificada n\xe3o \xe9 v\xe1lida.","The specified URL is not reachable.":"A URL especificada n\xe3o est\xe1 acess\xedvel.","Content type at the URL is not allowed.":"O tipo de conte\xfado na URL n\xe3o \xe9 permitido.","Failed to download file from the URL.":"N\xe3o foi poss\xedvel baixar o arquivo da URL.","Network error while downloading the file.":"Erro de rede ao baixar o arquivo.","File download took too long.":"O download do arquivo demorou demais.","Server error while downloading the file.":"Erro do servidor ao baixar o arquivo.","Some items could not be processed.":"Nem todos os itens foram processados com sucesso.","Failed to process all items in the batch.":"Nenhum item do lote p\xf4de ser processado.","Some items in the batch are in a conflicting state.":"Alguns itens do lote est\xe3o em estado de conflito.","Some items in the batch did not pass validation.":"Alguns itens do lote n\xe3o passaram na valida\xe7\xe3o.","AI service returned an invalid response.":"O servi\xe7o de IA retornou uma resposta inv\xe1lida.","Failed to generate image using AI.":"Falha ao gerar imagem usando IA.","You have reached the AI image generation limit.":"Voc\xea atingiu o limite de gera\xe7\xe3o de imagens por IA.","Error in external integration.":"Erro em uma integra\xe7\xe3o externa.","Error in a third-party service.":"Erro em um servi\xe7o de terceiros.","An unknown error occurred.":"Ocorreu um erro desconhecido.","Renaming is not allowed for this item.":"Renomear n\xe3o \xe9 permitido para este item.","Moving is not allowed for this item.":"Mover n\xe3o \xe9 permitido para este item.","Copying is not allowed for this item.":"Copiar n\xe3o \xe9 permitido para este item.","Deleting is not allowed for this item.":"Excluir n\xe3o \xe9 permitido para este item.","Cannot move an item into itself.":"N\xe3o \xe9 poss\xedvel mover um item para dentro de si mesmo.","Cannot move an item into its descendant folder.":"N\xe3o \xe9 poss\xedvel mover um item para sua pasta descendente.","Cannot copy an item into itself.":"N\xe3o \xe9 poss\xedvel copiar um item para dentro de si mesmo.","Configuration error occurred.":"Ocorreu um erro de configura\xe7\xe3o.","Storage quota exceeded. Please free up space.":"Cota de armazenamento excedida. Libere espa\xe7o.","File is locked by another process or user.":"O arquivo est\xe1 bloqueado por outro processo ou usu\xe1rio.","File version conflict. Please refresh and try again.":"Conflito de vers\xe3o do arquivo. Atualize a p\xe1gina e tente novamente.","Batch operation exceeds the maximum number of items allowed.":"A opera\xe7\xe3o em lote excede o n\xfamero m\xe1ximo de itens permitidos.",Moved:"Movidos: {{names}}",move_success_summary:"Movidos {{successCount}} de {{totalCount}} itens",move_fail_summary:"Falhou ao mover {{failCount}} de {{totalCount}} itens",Copied:"Copiados: {{names}}",copy_success_summary:"Copiados {{successCount}} de {{totalCount}} itens",copy_fail_summary:"Falhou ao copiar {{failCount}} de {{totalCount}} itens",Uploaded:"Arquivos enviados: {{names}}",Failed:"Falha ao enviar: {{names}}","Failed to upload":"Falha ao carregar {{failCount}} de {{count}} arquivo","Failed to upload files":"Falha ao carregar {{failCount}} de {{count}} arquivos",months:{january:"janeiro",february:"fevereiro",march:"mar\xe7o",april:"abril",may:"maio",june:"junho",july:"julho",august:"agosto",september:"setembro",october:"outubro",november:"novembro",december:"dezembro"},files:"arquivos","No available folders":"Nenhuma pasta dispon\xedvel","My files":"Meus arquivos",GIF:"GIF","Stock images":"Imagens de stock",AI:"IA","AI image generation":"Gera\xe7\xe3o de imagens por IA","Search GIFs":"Buscar GIFs","That`s all we could find.":"Isso \xe9 tudo que conseguimos encontrar.","Search image":"Buscar imagem",All:"Todos",Landscape:"Paisagem",Portrait:"Retrato",Squarish:"Quadrados",Black:"Preto","Black and White":"Preto e branco",White:"Branco",Orange:"Laranja",Red:"Vermelho",Purple:"Roxo",Magenta:"Magenta",Green:"Verde",Teal:"Verde-azulado",Blue:"Azul","Photo by":"Foto por",on:"em","File Manager":"Gerenciador de arquivos","File Manager not configured":"Gerenciador de arquivos n\xe3o configurado","Filter by type":"Filtrar por tipo","All types":"Todos os tipos","File name":"Nome do arquivo",Actions:"A\xe7\xf5es","Add file":"Adicionar arquivo","Add folder":"Adicionar pasta","Add file by URL":"Adicionar arquivo por URL","File moved":"Arquivo movido","Error when moving a file":"Erro ao mover arquivo","Failed to download file":"N\xe3o foi poss\xedvel baixar o arquivo","Failed to load JSON data":"N\xe3o foi poss\xedvel carregar os dados JSON","Invalid file URL":"URL de arquivo inv\xe1lida","Unable to validate file URL":"N\xe3o foi poss\xedvel validar a URL do arquivo","Type to search...":"Digite para buscar...",Submit:"Enviar","No folders yet":"Nenhuma pasta ainda","Drag files to upload":"Arraste arquivos para carregar","Drop files here to upload":"Solte os arquivos aqui para carreg\xe1-los","Newest first":"Mais recentes primeiro","Oldest first":"Mais antigos primeiro","Largest first":"Maiores primeiro","Smallest first":"Menores primeiro","A-Z":"A-Z","Z-A":"Z-A","By type":"Por tipo","Evaluating the task":"Avaliando a tarefa","Something went wrong, please try again":"Algo deu errado, por favor tente novamente","Sort by":"Ordenar por","preview text":"Carregando imagem...","Use this variant":"Usar esta variante","Confirm deletion":"Confirmar exclus\xe3o","Are you sure you want to delete the selected items?":"Tem certeza que deseja excluir os itens selecionados?","Move to Trash":"Mover para lixeira","Are you sure you want to move the selected items to the Trash?":"Tem certeza que deseja mover os itens selecionados para a lixeira?","Permanently delete":"Exclus\xe3o permanente","Delete permanently":"Excluir permanentemente","Are you sure you want to permanently delete the selected items? This action cannot be undone.":"Tem certeza que deseja excluir permanentemente os itens selecionados? Esta a\xe7\xe3o n\xe3o pode ser desfeita.",Clear:"Limpar","Clear Trash":"Limpar lixeira","Are you sure you want to permanently delete all items from Trash?":"Tem certeza que deseja excluir permanentemente todos os itens da lixeira?","Trash cleared successfully":"Lixeira limpa com sucesso","{{count}} items permanently deleted":"{{count}} itens exclu\xeddos permanentemente","Trash partially cleared":"Lixeira parcialmente limpa","{{succeeded}} items deleted, {{failed}} items failed":"{{succeeded}} itens exclu\xeddos, {{failed}} falharam","Failed to clear trash":"Falha ao limpar lixeira","Error clearing trash":"Erro ao limpar lixeira","Deleting items...":"Excluindo itens...",delete_files_permanent_one:"Esta a\xe7\xe3o excluir\xe1 permanentemente {{count}} arquivo",delete_files_permanent_few:"Esta a\xe7\xe3o excluir\xe1 permanentemente {{count}} arquivos",delete_files_permanent_many:"Esta a\xe7\xe3o excluir\xe1 permanentemente {{count}} arquivos",delete_files_permanent_other:"Esta a\xe7\xe3o excluir\xe1 permanentemente {{count}} arquivos",delete_folder_permanent:"Esta a\xe7\xe3o excluir\xe1 permanentemente a pasta \xab{{name}}\xbb e todo seu conte\xfado, incluindo {{count}} itens.",delete_mixed_permanent:"Esta a\xe7\xe3o excluir\xe1 permanentemente {{total}} itens selecionados, incluindo {{folders}} pastas e todas as {{images}} imagens dentro delas.",permanent_delete_warning:"Excluir arquivos que foram usados em e-mails causar\xe1 problemas na exibi\xe7\xe3o de imagens em e-mails antigos. Tem certeza de que deseja excluir permanentemente a sele\xe7\xe3o?",move_files_to_trash_one:"Esta a\xe7\xe3o mover\xe1 {{count}} arquivo para a lixeira.",move_files_to_trash_few:"Esta a\xe7\xe3o mover\xe1 {{count}} arquivos para a lixeira.",move_files_to_trash_many:"Esta a\xe7\xe3o mover\xe1 {{count}} arquivos para a lixeira.",move_files_to_trash_other:"Esta a\xe7\xe3o mover\xe1 {{count}} arquivos para a lixeira.",move_folder_to_trash:"Esta a\xe7\xe3o mover\xe1 a pasta \xab{{name}}\xbb e todo seu conte\xfado ({{count}} itens) para a lixeira.",move_mixed_to_trash:"Esta a\xe7\xe3o mover\xe1 {{total}} itens selecionados para a lixeira, incluindo {{folders}} pastas e {{images}} imagens.",delete_count_confirm_trash_one:"Mover {{count}} arquivo para a lixeira?",delete_count_confirm_trash_few:"Mover {{count}} arquivos para a lixeira?",delete_count_confirm_trash_many:"Mover {{count}} arquivos para a lixeira?",delete_count_confirm_trash_other:"Mover {{count}} arquivos para a lixeira?",delete_count_confirm_permanent_one:"Excluir permanentemente {{count}} arquivo?",delete_count_confirm_permanent_few:"Excluir permanentemente {{count}} arquivos?",delete_count_confirm_permanent_many:"Excluir permanentemente {{count}} arquivos?",delete_count_confirm_permanent_other:"Excluir permanentemente {{count}} arquivos?",delete_count_confirm_one:"Excluir {{count}} arquivo?",delete_count_confirm_few:"Excluir {{count}} arquivos?",delete_count_confirm_many:"Excluir {{count}} arquivos?",delete_count_confirm_other:"Excluir {{count}} arquivos?",item:"arquivo",items:"arquivos",Trash:"Lixeira",Choose:"Escolher",Stock:"Banco de imagens","Select an image from our library":"Selecione uma imagem da nossa biblioteca","AI generation":"Gera\xe7\xe3o por IA","Creating an image on demand":"Criando uma imagem sob demanda","Search file or folder":"Buscar arquivo ou pasta","Click here to select a file":"Clique aqui para selecionar um arquivo","Supported files:":"Arquivos suportados:","Create folder":"Criar pasta",Done:"Conclu\xeddo","Move here":"Mover aqui","Copy here":"Copiar aqui","File URL":"URL do arquivo","There's nothing here":"N\xe3o h\xe1 nada aqui","Try using a different search query.":"Tente usar uma consulta de pesquisa diferente.","Millions of free stock images":"Milh\xf5es de imagens de stock gratuitas","Enter a search query and we'll find the perfect image for you":"Digite uma consulta de busca e encontraremos a imagem perfeita para voc\xea","Millions of icons":"Milh\xf5es de \xedcones","Enter a search query and we'll find the perfect icon for you":"Digite uma consulta de busca e encontraremos o \xedcone perfeito para voc\xea","Enter your query and we will find the right one for you":"Digite sua consulta e n\xf3s encontraremos a ideal para voc\xea","Over 350,000 live images":"Mais de 350.000 imagens ao vivo","The folder will be created in the root directory.":"A pasta ser\xe1 criada no diret\xf3rio raiz.",undo:"DESFAZER",moved_to_trash_one:"{{count}} item movido para a lixeira",moved_to_trash_few:"{{count}} itens movidos para a lixeira",moved_to_trash_many:"{{count}} itens movidos para a lixeira",moved_to_trash_other:"{{count}} itens movidos para a lixeira",restored_items_one:"{{count}} item restaurado",restored_items_few:"{{count}} itens restaurados",restored_items_many:"{{count}} itens restaurados",restored_items_other:"{{count}} itens restaurados",Type:"Tipo","Generate image":"Gerar imagem","A beautiful image of a sunset over a calm ocean.":"Uma imagem bonita de um p\xf4r do sol sobre um oceano tranquilo.","For example:":"Por exemplo:",Insert:"Inserir",Error:"Erro","Upload progress":"Enviando {{completed}}/{{total}}","Uploading files":"Enviando {{completed}}/{{total}} arquivos","Uploaded files":"Enviados {{success}} de {{total}} arquivos","Upload error files":"Erro ao enviar {{errorCount}} arquivos","Applies to all {{count}} files":"(aplica-se a todos os {{count}} arquivos)","Some files failed to upload":"Alguns arquivos n\xe3o puderam ser enviados. Verifique o tamanho e o formato dos arquivos.",upload_error_hint_invalid_name:"Renomeie o arquivo: use apenas letras, n\xfameros, h\xedfens e sublinhados.",upload_error_hint_size:"Reduza o tamanho do arquivo ou escolha outro.",upload_error_hint_format:"Use um formato permitido: JPG, PNG ou GIF.",upload_error_hint_exists:"J\xe1 existe um arquivo com este nome na pasta. Renomeie o arquivo.","Images generated successfully":"Imagens geradas com sucesso","Choose for template":"Selecionar para carregar no modelo","Trash is empty":"A lixeira est\xe1 vazia","Deleted files will be displayed here":"Os arquivos exclu\xeddos ser\xe3o exibidos aqui","Editing: {{name}}":"Editando: {{name}}","Editing image":"Editando imagem",Save:"Salvar","Loading editor...":"Carregando editor...","Error loading image":"Erro ao carregar a imagem","Error saving image":"Erro ao salvar a imagem","Error initializing editor":"Erro ao inicializar o editor","Close File Manager":"Fechar gerenciador de arquivos","Are you sure you want to close? Unsaved changes will be lost.":"Tem certeza de que deseja fechar? As altera\xe7\xf5es n\xe3o salvas ser\xe3o perdidas.","Are you sure you want to close the file manager?":"Tem certeza de que deseja fechar o gerenciador de arquivos?",Close:"Fechar",KB:"KB","No files":"Nenhum arquivo","Folder is empty or files not found":"A pasta est\xe1 vazia ou os arquivos n\xe3o foram encontrados","Search files...":"Buscar arquivos...",Success:"Sucesso","Image updated successfully":"Imagem atualizada com sucesso","Failed to save changes":"Falha ao salvar altera\xe7\xf5es: {{error}}","Unknown error":"Erro desconhecido","Select destination folder":"Selecione a pasta de destino","Error moving":"Erro ao mover","Error deleting":"Erro ao excluir","Error copying":"Erro ao copiar","Error renaming":"Erro ao renomear","Failed to refresh folder tree":"Falha ao atualizar a \xe1rvore de pastas","Failed to refresh file list":"Falha ao atualizar a lista de arquivos","Errors occurred while moving":"Ocorreram erros ao mover","Errors occurred while copying":"Ocorreram erros ao copiar","(error)":"(erro)","(circular reference)":"(refer\xeancia circular)","File too large. Maximum size: {{size}}":"Arquivo muito grande. Tamanho m\xe1ximo: {{size}}","File too small. Minimum size: {{size}}":"Arquivo muito pequeno. Tamanho m\xednimo: {{size}}","Unsupported file type":"Tipo de arquivo n\xe3o suportado","Unsupported file type: {{type}}":"Tipo de arquivo n\xe3o suportado: {{type}}",unknown:"desconhecido","Failed to load files":"Falha ao carregar arquivos","DataProvider for folder deletion is not configured":"DataProvider para exclus\xe3o de pastas n\xe3o est\xe1 configurado","DataProvider for file upload is not configured":"DataProvider para upload de arquivos n\xe3o est\xe1 configurado","Error uploading file {{fileName}}":"Erro ao carregar o arquivo {{fileName}}","Error uploading file":"Erro ao carregar o arquivo","Cannot upload files to Trash":"N\xe3o \xe9 poss\xedvel carregar arquivos para a lixeira","Please fill in all fields":"Por favor, preencha todos os campos","URL too long":"URL muito longa","Only http and https URLs are supported":"Apenas URLs com protocolo http e https s\xe3o suportadas","Private and local URLs are not allowed":"URLs locais e privadas n\xe3o s\xe3o permitidas","Upload by URL is not supported":"Upload por URL n\xe3o \xe9 suportado","File name is too long. Maximum {{max}} characters":"O nome do arquivo \xe9 muito longo. M\xe1ximo de {{max}} caracteres","File name contains invalid characters":"O nome do arquivo cont\xe9m caracteres inv\xe1lidos","Large file may take a long time to upload":"Um arquivo grande pode demorar muito para ser carregado","File unavailable: {{status}} {{statusText}}":"Arquivo indispon\xedvel: {{status}} {{statusText}}","File too large: {{size}}":"Arquivo muito grande: {{size}}","Unsupported file type: {{contentType}}":"Tipo de arquivo n\xe3o suportado: {{contentType}}","Invalid server response: folder ID is missing":"Resposta do servidor inv\xe1lida: ID da pasta ausente","Error: folder cannot be its own parent":"Erro: a pasta n\xe3o pode ser seu pr\xf3prio pai","Upload to Trash is forbidden":"Enviar para a lixeira \xe9 proibido","renameFolder is not implemented in dataProviders":"renameFolder n\xe3o est\xe1 implementado em dataProviders","renameFile is not implemented in dataProviders":"renameFile n\xe3o est\xe1 implementado em dataProviders",Clean:"Limpar","Circular dependency detected: folder cannot be its own parent":"Depend\xeancia circular detectada: a pasta n\xe3o pode ser seu pr\xf3prio pai","Save as copy and choose":"Salvar como c\xf3pia e escolher","Save and choose":"Salvar e escolher",pixie:{"added drawing":"Desenho adicionado","added frame":"Moldura adicionada","added image":"Imagem adicionada","added shape":"Forma adicionada","added sticker":"Adesivo adicionado","added text":"Texto adicionado","applied filters":"Filtros aplicados",apply:"Aplicar",background:"Fundo","background color":"Cor de fundo",beach:"Praia","brush color":"Cor do pincel","brush size":"Tamanho do pincel","brush type":"Tipo de pincel",bubbles:"Bolhas",Cancel:"Cancelar","changed style":"Estilo alterado","Circle Brush":"C\xedrculo",close:"Fechar",color:"Cor",corners:"Cantos",crop:"Cortar",Custom:"Personalizado","deleted object":"Objeto exclu\xeddo","Diamond Brush":"Diamante",doodles:"Rabiscos",draw:"Desenhar",emoticons:"Emoticons","Eraser Brush":"Borracha",filter:"Filtro",font:"Fonte","font size":"Tamanho da fonte",frame:"Moldura",gradient:"Gradiente",height:"Altura",history:"Hist\xf3rico","H Line Brush":"Linha H",image:"Imagem",initial:"Inicial",landmarks:"Pontos tur\xedsticos","loaded state":"Estado carregado","loading canvas":"Carregando tela","loading image":"Carregando imagem","loading state":"Carregando estado","maintain aspect ratio":"Manter propor\xe7\xe3o",merge:"Mesclar","merged objects":"Objetos mesclados","new text":"Novo texto",objects:"Objetos",opacity:"Opacidade",outline:"Contorno","outline color":"Cor do contorno","Pencil Brush":"L\xe1pis","processing image":"Processando imagem",quality:"Qualidade",radius:"Raio","replace image":"Substituir imagem","replaced background image":"Imagem de fundo substitu\xedda",resize:"Redimensionar","resized image":"Imagem redimensionada","rounded corner":"Canto arredondado",save:"Salvar",shadow:"Sombra","shadow color":"Cor da sombra",shapes:"Formas","Spray Brush":"Spray",square:"Quadrado","Square Brush":"Quadrado",stickers:"Adesivos",text:"Texto",texture:"Textura",transportation:"Transporte","V Line Brush":"Linha V",width:"Largura",grayscale:"Tons de cinza","black & White":"Preto e branco",sharpen:"Nitidez",invert:"Inverter",vintage:"Vintage",polaroid:"Polaroid",kodachrome:"Kodachrome",technicolor:"Technicolor",brownie:"S\xe9pia quente",sepia:"S\xe9pia","remove Color":"Remover cor",brightness:"Brilho",gamma:"Gamma",noise:"Ru\xeddo",pixelate:"Pixelar",blur:"Desfocar",emboss:"Relevo","blend Color":"Misturar cor",distance:"Dist\xe2ncia",red:"Vermelho",green:"Verde",blue:"Azul",blocksize:"Tamanho do bloco",alpha:"Alfa",add:"Adicionar",multiply:"Multiplicar",subtract:"Subtrair",diff:"Diferen\xe7a",screen:"Tela",lighten:"Clarear",darken:"Escurecer","select an option...":"Selecione uma op\xe7\xe3o..."}};const kr={en:{translation:{Folder:"Folder",Folders:"Folders",Files:"Files",File:"File","Select the destination folder":"Select the destination folder","Filter by type":"Filter by type","All types":"All types","File name":"File name",Size:"Size",Date:"Date",Actions:"Actions",Delete:"Delete",Move:"Move",Copy:"Copy",Refresh:"Refresh","Add folder":"Add folder","Add file":"Add file","Add file by URL":"Add file by URL","Please select an image file":"Please select an image file","File deleted":"File deleted","Error when deleting a file":"Error when deleting a file","Folder deleted":"Folder deleted","Error when deleting a folder":"Error when deleting a folder","Delete folder":"Delete folder","Are you sure you want to delete this folder? This action will also delete all files and subfolders.":"Are you sure you want to delete this folder? This action will also delete all files and subfolders.","File moved":"File moved","Error when moving a file":"Error when moving a file","has been successfully uploaded":"has been successfully uploaded","Failed to download file":"Failed to download file","Failed to load JSON data":"Failed to load JSON data","Invalid file URL":"Invalid file URL","Unable to validate file URL":"Unable to validate file URL","Error when uploading a file":"Error when uploading a file","successfully uploaded":"successfully uploaded","Error when downloading a file by URL":"Error when downloading a file by URL","Error loading files":"Error loading files","File Manager not configured":"File Manager not configured","Type to search...":"Type to search...","Failed to create folder":"Failed to create folder",Cancel:"Cancel",Submit:"Submit",months:{january:"January",february:"February",march:"March",april:"April",may:"May",june:"June",july:"July",august:"August",september:"September",october:"October",november:"November",december:"December"},files:"files","No available folders":"No available folders","My files":"My files",GIF:"GIF","Stock images":"Stock images",Icons:"Icons",AI:"AI","AI image generation":"AI image generation","Search GIFs":"Search GIFs","That`s all we could find.":"That`s all we could find.","Search image":"Search image",All:"All",Landscape:"Landscape",Portrait:"Portrait",Squarish:"Squarish",Black:"Black","Black and White":"Black and White",White:"White",Orange:"Orange",Red:"Red",Purple:"Purple",Magenta:"Magenta",Green:"Green",Teal:"Teal",Blue:"Blue","Photo by":"Photo by",on:"on",selected:"selected",Deselected:"Deselected","Select all":"Select all",Rename:"Rename","Rename file":"Rename file {{currentFileName}}","Selected files":"Selected files: {{count}}",selected_files_one:"Selected {{count}} file",selected_files_other:"Selected {{count}} files",Edit:"Edit","Move to":"Move to","New folder":"New folder","Image search...":"Image search...","Search icons":"Search icons","By name":"By name","By size":"By size","By date":"By date",List:"List",Grid:"Grid",Main:"Main","total pages":"Total {{total}} items",Name:"Name",Untitled:"Untitled",Dimensions:"Dimensions",error:"error",created:"created","API-endpoint for file upload is not configured":"API-endpoint for file upload is not configured","The URL must point to an image":"The URL must point to an image","Image upload...":"Image upload...",Unknown:"Unknown","Error downloading file by URL":"Error downloading file by URL","File not found":"File not found","File renamed to":"File renamed to ","Failed to rename the file":"Failed to rename the file","Folder renamed to":"Folder renamed to","Rename folder":"Rename folder","New folder name":"New folder name","Enter a new folder name":"Enter a new folder name","Please drag and drop image files only":"Please drag and drop image files only","Upload file by URL":"Upload file by URL","Upload file":"Upload file","Creating a new folder":"Creating a new folder",Create:"Create","Folder name":"Folder name","Enter the name of the folder":"Enter the name of the folder","Enter the name":"Enter the name","A folder will be created inside:":"A folder will be created inside:","selected folder":"selected folder","The folder will be created in the root directory":"The folder will be created in the root directory","Failed to load folders":"Failed to load folders","Folder name cannot be empty":"Folder name cannot be empty","Folder creation provider is not configured":"Folder creation provider is not configured","Folder created":"Folder created","Folder rename is disabled by config":"Folder rename is disabled by config","Folder rename provider is not configured":"Folder rename provider is not configured","Unexpected response when renaming folder":"Unexpected response when renaming folder","Folder renamed":"Folder renamed","Failed to rename folder":"Failed to rename folder","Failed to load folder items count":"Failed to load folder items count","Failed to load subfolders":"Failed to load subfolders",Download:"Download","image URL":"image URL","Enter the URL of the image":"Enter the URL of the image","URL too long":"URL is too long","Only http and https URLs are supported":"Only http and https URLs are supported","Private and local URLs are not allowed":"Private and local URLs are not allowed","Supported formats: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP":"Supported formats: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP","New file name":"New file name","Enter a new file name":"Enter a new file name","Copy to folder":"Copy to folder",Added:"Added {{date}}","File uploaded successfully":"File {{fileName}} uploaded successfully","Successfully uploaded":"Successfully uploaded {{successCount}} of {{count}} file","Successfully uploaded files":"Successfully uploaded {{successCount}} of {{count}} files",Uploaded:"Uploaded: {{names}}",uploads_success_summary:"Uploaded {{successCount}} of {{totalCount}} files",Failed:"Failed: {{names}}",uploads_fail_summary:"Failed to upload {{failCount}} of {{totalCount}} files","File with this name already exists.":"File with this name already exists.","File not found or no longer available.":"File not found or no longer available.","You don't have permission to access this file.":"You don't have permission to access this file.","File is too large to upload.":"File is too large to upload.","File is too large ({{fileSize}}). Maximum allowed size: {{maxSize}}.":"File is too large ({{fileSize}}). Maximum allowed size: {{maxSize}}.","Maximum number of files exceeded. Allowed: {{allowed}}, received: {{received}}":"Maximum number of files exceeded. Allowed: {{allowed}}, received: {{received}}","This file type is not allowed.":"This file type is not allowed.","File name is not valid.":"File name is not valid.","File name is not valid. Allowed characters: {{allowedChars}}":"File name is not valid. Allowed characters: {{allowedChars}}","Failed to read the file.":"Failed to read the file.","Failed to write the file.":"Failed to write the file.","The file appears to be corrupted.":"The file appears to be corrupted.","File integrity check failed.":"File integrity check failed.","Folder not found or no longer available.":"Folder not found or no longer available.","Folder with this name already exists.":"Folder with this name already exists.","A folder with that name already exists. Please enter a different folder name.":"A folder with that name already exists. Please enter a different folder name.","You don't have permission to access this folder.":"You don't have permission to access this folder.","Folder name is not valid.":"Folder name is not valid.","Folder name is not valid. Allowed characters: {{allowedChars}}":"Folder name is not valid. Allowed characters: {{allowedChars}}","Failed to read the folder contents.":"Failed to read the folder contents.","Failed to write to the folder.":"Failed to write to the folder.","Folder storage quota exceeded.":"Folder storage quota exceeded.","Folder is not empty.":"Folder is not empty.","Server error while processing the folder.":"Server error while processing the folder.","Folder operation took too long.":"Folder operation took too long.","Network error. Please check your connection and try again.":"Network error. Please check your connection and try again.","The operation took too long. Please try again.":"The operation took too long. Please try again.","Server error. Please try again later.":"Server error. Please try again later.","Service is temporarily unavailable. Please try again later.":"Service is temporarily unavailable. Please try again later.","Too many requests. Please try again a bit later.":"Too many requests. Please try again a bit later.","Authentication failed. Please sign in again.":"Authentication failed. Please sign in again.","You are not allowed to perform this action.":"You are not allowed to perform this action.","Some of the provided data is invalid.":"Some of the provided data is invalid.","This operation is not supported.":"This operation is not supported.","Request payload is too large.":"Request payload is too large.","This media type is not supported.":"This media type is not supported.","You have exceeded the upload quota.":"You have exceeded the upload quota.","Network error while uploading the file.":"Network error while uploading the file.","File upload took too long.":"File upload took too long.","Server error while uploading the file.":"Server error while uploading the file.","The specified URL is not valid.":"The specified URL is not valid.","The specified URL is not reachable.":"The specified URL is not reachable.","Content type at the URL is not allowed.":"Content type at the URL is not allowed.","Failed to download file from the URL.":"Failed to download file from the URL.","Network error while downloading the file.":"Network error while downloading the file.","File download took too long.":"File download took too long.","Server error while downloading the file.":"Server error while downloading the file.","Some items could not be processed.":"Some items could not be processed.","Failed to process all items in the batch.":"Failed to process all items in the batch.","Some items in the batch are in a conflicting state.":"Some items in the batch are in a conflicting state.","Some items in the batch did not pass validation.":"Some items in the batch did not pass validation.","AI service returned an invalid response.":"AI service returned an invalid response.","Failed to generate image using AI.":"Failed to generate image using AI.","You have reached the AI image generation limit.":"You have reached the AI image generation limit.","Error in external integration.":"Error in external integration.","Error in a third-party service.":"Error in a third-party service.","An unknown error occurred.":"An unknown error occurred.","Renaming is not allowed for this item.":"Renaming is not allowed for this item.","Moving is not allowed for this item.":"Moving is not allowed for this item.","Copying is not allowed for this item.":"Copying is not allowed for this item.","Deleting is not allowed for this item.":"Deleting is not allowed for this item.","Cannot move an item into itself.":"Cannot move an item into itself.","Cannot move an item into its descendant folder.":"Cannot move an item into its descendant folder.","Cannot copy an item into itself.":"Cannot copy an item into itself.","Configuration error occurred.":"Configuration error occurred.","Storage quota exceeded. Please free up space.":"Storage quota exceeded. Please free up space.","File is locked by another process or user.":"File is locked by another process or user.","File version conflict. Please refresh and try again.":"File version conflict. Please refresh and try again.","Batch operation exceeds the maximum number of items allowed.":"Batch operation exceeds the maximum number of items allowed.",Moved:"Moved: {{names}}",move_success_summary:"Moved {{successCount}} of {{totalCount}} items",move_fail_summary:"Failed to move {{failCount}} of {{totalCount}} items",Copied:"Copied: {{names}}",copy_success_summary:"Copied {{successCount}} of {{totalCount}} items",copy_fail_summary:"Failed to copy {{failCount}} of {{totalCount}} items","Failed to upload":"Failed to upload {{failCount}} of {{count}} file","Failed to upload files":"Failed to upload {{failCount}} of {{count}} files","No folders yet":"No folders yet","Drag files to upload":"Drag files to upload","Drop files here to upload":"Drop files here to upload","Newest first":"Newest first","Oldest first":"Oldest first","Largest first":"Largest first","Smallest first":"Smallest first","A-Z":"A-Z","Z-A":"Z-A","By type":"By type","Evaluating the task":"Evaluating the task","Something went wrong, please try again":"Something went wrong, please try again","Sort by":"Sort by","preview text":"The image preview is trying to load ...","Use this variant":"Use this variant","Confirm deletion":"Confirm deletion","Are you sure you want to delete the selected items?":"Are you sure you want to delete the selected items?","Move to Trash":"Move to Trash","Are you sure you want to move the selected items to the Trash?":"Are you sure you want to move the selected items to the Trash?","Permanently delete":"Permanently delete","Delete permanently":"Delete permanently","Are you sure you want to permanently delete the selected items? This action cannot be undone.":"Are you sure you want to permanently delete the selected items? This action cannot be undone.",Clear:"Clear","Clear Trash":"Clear Trash","Are you sure you want to permanently delete all items from Trash?":"Are you sure you want to permanently delete all items from Trash?","Trash cleared successfully":"Trash cleared successfully","{{count}} items permanently deleted":"{{count}} items permanently deleted","Trash partially cleared":"Trash partially cleared","{{succeeded}} items deleted, {{failed}} items failed":"{{succeeded}} items deleted, {{failed}} items failed","Failed to clear trash":"Failed to clear trash","Error clearing trash":"Error clearing trash","Deleting items...":"Deleting items...",delete_files_permanent_one:"This action will permanently delete {{count}} file",delete_files_permanent_other:"This action will permanently delete {{count}} files",delete_folder_permanent:"This action will permanently delete the folder '{{name}}' and all its contents, including {{count}} items.",delete_mixed_permanent:"This action will permanently delete {{total}} selected items, including {{folders}} folders and all {{images}} images within them.",permanent_delete_warning:"Deleting files that were used in emails will cause problems with displaying images in old emails. Are you sure you want to permanently delete the selection?",move_files_to_trash_one:"This will move {{count}} file to the Trash.",move_files_to_trash_other:"This will move {{count}} files to the Trash.",move_folder_to_trash:"This will move the folder '{{name}}' and all its contents ({{count}} items) to the Trash.",move_mixed_to_trash:"This will move {{total}} selected items to the Trash, including {{folders}} folders and {{images}} images.",delete_count_confirm_trash_one:"Move {{count}} file to Trash?",delete_count_confirm_trash_other:"Move {{count}} files to Trash?",delete_count_confirm_permanent_one:"Permanently delete {{count}} file?",delete_count_confirm_permanent_other:"Permanently delete {{count}} files?",delete_count_confirm_one:"Delete {{count}} file?",delete_count_confirm_other:"Delete {{count}} files?",item:"item",items:"items",Trash:"Deleted",Choose:"Choose",Stock:"Stock","Select an image from our library":"Select an image from our library","AI generation":"AI generation","Creating an image on demand":"Creating an image on demand","Search file or folder":"Search file or folder","Click here to select a file":"Click here to select a file","Create folder":"Create folder",Done:"Done","Move here":"Move here","Copy here":"Copy here","File URL":"File URL","There's nothing here":"There's nothing here","Try using a different search query.":"Try using a different search query.","Millions of free stock images":"Millions of free stock images","Enter a search query and we'll find the perfect image for you":"Enter a search query and we'll find the perfect image for you","Millions of icons":"Millions of icons","Enter a search query and we'll find the perfect icon for you":"Enter a search query and we'll find the perfect icon for you","Enter your query and we will find the right one for you":"Enter your query and we will find the right one for you","Over 350,000 live images":"Over 350,000 live images","The folder will be created in the root directory.":"The folder will be created in the root directory.",undo:"UNDO",moved_to_trash_one:"Moved {{count}} item to Trash",moved_to_trash_other:"Moved {{count}} items to Trash",restored_items_one:"Restored {{count}} item",restored_items_other:"Restored {{count}} items",Type:"Type","Generate image":"Generate image","For example:":"For example:","A beautiful image of a sunset over a calm ocean.":"A beautiful image of a sunset over a calm ocean.",Insert:"Insert",Error:"Error","Upload progress":"Upload {{completed}}/{{total}}","Uploading files":"Uploading {{completed}}/{{total}} files","Uploaded files":"Uploaded {{success}} of {{total}} files","Upload error files":"Upload error {{errorCount}} files","Applies to all {{count}} files":"(applies to all {{count}} files)","Some files failed to upload":"Some files failed to upload. Please check file size and format.",upload_error_hint_invalid_name:"Rename the file: use only letters, numbers, hyphens and underscores.",upload_error_hint_size:"Reduce the file size or choose a different file.",upload_error_hint_format:"Use an allowed format: JPG, PNG, or GIF.",upload_error_hint_exists:"A file with this name already exists in the folder. Rename the file.","Images generated successfully":"Images generated successfully","Trash is empty":"Trash is empty","Deleted files will be displayed here":"Deleted files will be displayed here","Supported files:":"Supported files:","Stroke width":"Stroke thickness:",Color1:"Color1:",Color2:"Color2:",Color3:"Color3: ","Global search":"Global search","Family search":"Family search","Choose for template":"Choose for template",Back:"Back","Editing: {{name}}":"Editing: {{name}}","Editing image":"Editing image",Save:"Save","Loading editor...":"Loading editor...","Error loading image":"Error loading image","Error saving image":"Error saving image","Error initializing editor":"Error initializing editor","Close File Manager":"Close File Manager","Are you sure you want to close? Unsaved changes will be lost.":"Are you sure you want to close? Unsaved changes will be lost.","Are you sure you want to close the file manager?":"Are you sure you want to close the file manager?",Close:"Close",KB:"KB","No files":"No files","Folder is empty or files not found":"Folder is empty or files not found","Search files...":"Search files...",Success:"Success","Image updated successfully":"Image updated successfully","Failed to save changes":"Failed to save changes: {{error}}","Unknown error":"Unknown error","Select destination folder":"Select destination folder","Error moving":"Error moving","Error deleting":"Error deleting","Error copying":"Error copying","Error renaming":"Error renaming","Failed to refresh folder tree":"Failed to refresh folder tree","Failed to refresh file list":"Failed to refresh file list","Errors occurred while moving":"Errors occurred while moving","Errors occurred while copying":"Errors occurred while copying","(error)":"(error)","(circular reference)":"(circular reference)","File too large. Maximum size: {{size}}":"File too large. Maximum size: {{size}}","File too small. Minimum size: {{size}}":"File too small. Minimum size: {{size}}","Unsupported file type":"Unsupported file type","Unsupported file type: {{type}}":"Unsupported file type: {{type}}",unknown:"unknown","Failed to load files":"Failed to load files","DataProvider for folder deletion is not configured":"DataProvider for folder deletion is not configured","DataProvider for file upload is not configured":"DataProvider for file upload is not configured","Error uploading file {{fileName}}":"Error uploading file {{fileName}}","Error uploading file":"Error uploading file","Cannot upload files to Trash":"Cannot upload files to Trash","Please fill in all fields":"Please fill in all fields","Upload by URL is not supported":"Upload by URL is not supported","File name is too long. Maximum {{max}} characters":"File name is too long. Maximum {{max}} characters","File name contains invalid characters":"File name contains invalid characters","Large file may take a long time to upload":"Large file may take a long time to upload","File unavailable: {{status}} {{statusText}}":"File unavailable: {{status}} {{statusText}}","File too large: {{size}}":"File too large: {{size}}","Unsupported file type: {{contentType}}":"Unsupported file type: {{contentType}}","Invalid server response: folder ID is missing":"Invalid server response: folder ID is missing","Error: folder cannot be its own parent":"Error: folder cannot be its own parent","Upload to Trash is forbidden":"Upload to Trash is forbidden","renameFolder is not implemented in dataProviders":"renameFolder is not implemented in dataProviders","renameFile is not implemented in dataProviders":"renameFile is not implemented in dataProviders",Deleted:"Deleted",Clean:"Clean","Circular dependency detected: folder cannot be its own parent":"Circular dependency detected: folder cannot be its own parent","Save as copy and choose":"Save as copy and choose","Save and choose":"Save and choose",pixie:{"added drawing":"Added Drawing","added frame":"Added Frame","added image":"Added Image","added shape":"Added Shape","added sticker":"Added Sticker","added text":"Added Text","applied filters":"Applied Filters",apply:"Apply",background:"Background","background color":"Background color",beach:"Beach","brush color":"Brush Color","brush size":"Brush Size","brush type":"Brush Type",bubbles:"Bubbles",Cancel:"Cancel","changed style":"Changed Style","Circle Brush":"Circle Brush",close:"Close",color:"Color",corners:"Corners",crop:"Crop",Custom:"Custom","deleted object":"Deleted object","Diamond Brush":"Diamond Brush",doodles:"Doodles",draw:"Draw",emoticons:"Emoticons","Eraser Brush":"Eraser Brush",filter:"Filter",font:"Font","font size":"Font Size",frame:"Frame",gradient:"Gradient",height:"Height",history:"History","H Line Brush":"H Line Brush",image:"Image",initial:"Initial",landmarks:"Landmarks","loaded state":"Loaded State","loading canvas":"Loading Canvas","loading image":"Loading Image","loading state":"Loading State","maintain aspect ratio":"Maintain aspect ratio",merge:"Merge","merged objects":"Merged Objects","new text":"New Text",objects:"Objects",opacity:"Opacity",outline:"Outline","outline color":"Outline Color","Pencil Brush":"Pencil Brush","processing image":"Processing Image",quality:"Quality",radius:"Radius","replace image":"Replace Image","replaced background image":"Replaced Background Image",resize:"Resize","resized image":"Resized Image","rounded corner":"Rounded Corner",save:"Save",shadow:"Shadow","shadow color":"Shadow Color",shapes:"Shapes","Spray Brush":"Spray Brush",square:"Square","Square Brush":"Square Brush",stickers:"Stickers",text:"Text",texture:"Texture",transportation:"Transportation","V Line Brush":"V Line Brush",width:"Width",grayscale:"Grayscale","black & White":"Black & White",sharpen:"Sharpen",invert:"Invert",vintage:"Vintage",polaroid:"Polaroid",kodachrome:"Kodachrome",technicolor:"Technicolor",brownie:"Brownie",sepia:"Sepia","remove Color":"Remove Color",brightness:"Brightness",gamma:"Gamma",noise:"Noise",pixelate:"Pixelate",blur:"Blur",emboss:"Emboss","blend Color":"Blend Color",distance:"Distance",red:"Red",green:"Green",blue:"Blue",blocksize:"Blocksize",alpha:"Alpha",add:"Add",multiply:"Multiply",subtract:"Subtract",diff:"Diff",screen:"Screen",lighten:"Lighten",darken:"Darken","select an option...":"Select an option..."}}},ru:{translation:{Files:"\u0424\u0430\u0439\u043b\u044b",selected:"\u0432\u044b\u0431\u0440\u0430\u043d\u043e",Deselected:"\u041e\u0442\u043c\u0435\u043d\u0438\u0442\u044c \u0432\u044b\u0431\u043e\u0440",Refresh:"\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c","Select all":"\u0412\u044b\u0431\u0440\u0430\u0442\u044c \u0432\u0441\u0435",Rename:"\u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c","Rename file":"\u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b {{currentFileName}}","Select the destination folder":"\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043f\u0430\u043f\u043a\u0443 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f","Selected files:":"\u0412\u044b\u0431\u0440\u0430\u043d\u043e \u0444\u0430\u0439\u043b\u043e\u0432:","Selected files":"\u0412\u044b\u0431\u0440\u0430\u043d\u043e \u0444\u0430\u0439\u043b\u043e\u0432: {{count}}",selected_files_one:"\u0412\u044b\u0431\u0440\u0430\u043d {{count}} \u0444\u0430\u0439\u043b",selected_files_few:"\u0412\u044b\u0431\u0440\u0430\u043d\u043e {{count}} \u0444\u0430\u0439\u043b\u0430",selected_files_many:"\u0412\u044b\u0431\u0440\u0430\u043d\u043e {{count}} \u0444\u0430\u0439\u043b\u043e\u0432",selected_files_other:"\u0412\u044b\u0431\u0440\u0430\u043d\u043e {{count}} \u0444\u0430\u0439\u043b\u043e\u0432",Copy:"\u0414\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c",Edit:"\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c",Move:"\u041f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c","Move to":"\u041f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c",Delete:"\u0423\u0434\u0430\u043b\u0438\u0442\u044c","New folder":"\u041d\u043e\u0432\u0430\u044f \u043f\u0430\u043f\u043a\u0430","Image search...":"\u041f\u043e\u0438\u0441\u043a \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439...","Search icons":"\u041d\u0430\u0439\u0442\u0438 \u0438\u043a\u043e\u043d\u043a\u0438","By name":"\u041f\u043e \u0438\u043c\u0435\u043d\u0438","By size":"\u041f\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0443","By date":"\u041f\u043e \u0434\u0430\u0442\u0435",List:"\u0421\u043f\u0438\u0441\u043e\u043a",Grid:"\u041f\u043b\u0438\u0442\u043a\u0438",Main:"\u0413\u043b\u0430\u0432\u043d\u0430\u044f",Folders:"\u041f\u0430\u043f\u043a\u0438","total pages":"\u0412\u0441\u0435\u0433\u043e {{total}} \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432",Name:"\u0418\u043c\u044f",Untitled:"\u0411\u0435\u0437 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f",Size:"\u0420\u0430\u0437\u043c\u0435\u0440",Dimensions:"\u0420\u0430\u0437\u043c\u0435\u0440",Date:"\u0414\u0430\u0442\u0430",error:"\u043e\u0448\u0438\u0431\u043a\u0430",Folder:"\u041f\u0430\u043f\u043a\u0430",created:"\u0441\u043e\u0437\u0434\u0430\u043d\u0430","Failed to create folder":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0430\u043f\u043a\u0443","File deleted":"\u0424\u0430\u0439\u043b \u0443\u0434\u0430\u043b\u0435\u043d","Files deleted":"\u0424\u0430\u0439\u043b\u044b \u0443\u0434\u0430\u043b\u0435\u043d\u044b","Error when deleting a file":"\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0438 \u0444\u0430\u0439\u043b\u0430","Folder deleted":"\u041f\u0430\u043f\u043a\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u0430","Error when deleting a folder":"\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0438 \u043f\u0430\u043f\u043a\u0438","Delete folder":"\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u043f\u0430\u043f\u043a\u0443","Are you sure you want to delete this folder? This action will also delete all files and subfolders.":"\u0412\u044b \u0443\u0432\u0435\u0440\u0435\u043d\u044b, \u0447\u0442\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u044d\u0442\u0443 \u043f\u0430\u043f\u043a\u0443? \u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0442\u0430\u043a\u0436\u0435 \u0443\u0434\u0430\u043b\u0438\u0442 \u0432\u0441\u0435 \u0444\u0430\u0439\u043b\u044b \u0438 \u043f\u043e\u0434\u043f\u0430\u043f\u043a\u0438.","API-endpoint for file upload is not configured":"API-endpoint \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0444\u0430\u0439\u043b\u043e\u0432 \u043d\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d","Please select an image file":"\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0444\u0430\u0439\u043b \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f",File:"\u0424\u0430\u0439\u043b","has been successfully uploaded":"\u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d","The URL must point to an image":"URL \u0434\u043e\u043b\u0436\u0435\u043d \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435","Image upload...":"\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f...",Unknown:"\u041d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e","Error downloading file by URL":"\u041e\u0448\u0438\u0431\u043a\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0444\u0430\u0439\u043b\u0430 \u043f\u043e URL","successfully uploaded":"\u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d","Error when downloading a file by URL":"\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0444\u0430\u0439\u043b\u0430 \u043f\u043e URL","Error when uploading a file":"\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0444\u0430\u0439\u043b\u0430","Error loading files":"\u041e\u0448\u0438\u0431\u043a\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0444\u0430\u0439\u043b\u043e\u0432","File not found":"\u0424\u0430\u0439\u043b \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d","File renamed to":"\u0424\u0430\u0439\u043b \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d \u043d\u0430 ","Failed to rename the file":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b","Folder renamed to":"\u041f\u0430\u043f\u043a\u0430 \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0430 \u043d\u0430","Rename folder":"\u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u043f\u043a\u0443","New folder name":"\u041d\u043e\u0432\u043e\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u043f\u043a\u0438","Enter a new folder name":"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043d\u043e\u0432\u043e\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u043f\u043a\u0438","Please drag and drop image files only":"\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043f\u0435\u0440\u0435\u0442\u0430\u0449\u0438\u0442\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0444\u0430\u0439\u043b\u044b \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439","Upload file by URL":"\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0444\u0430\u0439\u043b \u043f\u043e URL","Upload file":"\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0444\u0430\u0439\u043b","Creating a new folder":"\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0439 \u043f\u0430\u043f\u043a\u0438",Create:"\u0421\u043e\u0437\u0434\u0430\u0442\u044c",Cancel:"\u041e\u0442\u043c\u0435\u043d\u0430","Folder name":"\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u043f\u043a\u0438","Enter the name of the folder":"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u043f\u043a\u0438","Enter the name":"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435","A folder will be created inside:":"\u041f\u0430\u043f\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0430 \u0432\u043d\u0443\u0442\u0440\u0438:","selected folder":"\u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0439 \u043f\u0430\u043f\u043a\u0438","The folder will be created in the root directory":"\u041f\u0430\u043f\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0430 \u0432 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u043c \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435","Failed to load folders":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043f\u0430\u043f\u043a\u0438","Folder name cannot be empty":"\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u043f\u043a\u0438 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0443\u0441\u0442\u044b\u043c","Folder creation provider is not configured":"\u041f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0430\u043f\u043e\u043a \u043d\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d","Folder created":"\u041f\u0430\u043f\u043a\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0430","Folder rename is disabled by config":"\u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u043f\u043e\u043a \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0435\u0439","Folder rename provider is not configured":"\u041f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440 \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0430\u043f\u043e\u043a \u043d\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d","Unexpected response when renaming folder":"\u041d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u0430\u043f\u043a\u0438","Folder renamed":"\u041f\u0430\u043f\u043a\u0430 \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0430","Failed to rename folder":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u043f\u043a\u0443","Failed to load folder items count":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0444\u0430\u0439\u043b\u043e\u0432 \u0432 \u043f\u0430\u043f\u043a\u0435","Failed to load subfolders":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043f\u043e\u0434\u043f\u0430\u043f\u043a\u0438",Download:"\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c","image URL":"URL \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f","Enter the URL of the image":"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 URL \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f","Supported formats: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP":"\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0435 \u0444\u043e\u0440\u043c\u0430\u0442\u044b: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP","New file name":"\u041d\u043e\u0432\u043e\u0435 \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430","Enter a new file name":"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043d\u043e\u0432\u043e\u0435 \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430","Copy to folder":"\u041a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u043f\u0430\u043f\u043a\u0443",Added:"\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043e {{date}}","File uploaded successfully":"\u0424\u0430\u0439\u043b {{fileName}} \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d","Successfully uploaded":"\u0423\u0441\u043f\u0435\u0448\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043e {{successCount}} \u0438\u0437 {{count}} \u0444\u0430\u0439\u043b\u0430","Successfully uploaded files":"\u0423\u0441\u043f\u0435\u0448\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043e {{successCount}} \u0438\u0437 {{count}} \u0444\u0430\u0439\u043b\u043e\u0432",uploads_success_summary:"\u0417\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043e {{successCount}} \u0438\u0437 {{totalCount}} \u0444\u0430\u0439\u043b\u043e\u0432",uploads_fail_summary:"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c {{failCount}} \u0438\u0437 {{totalCount}} \u0444\u0430\u0439\u043b\u043e\u0432","File with this name already exists.":"\u0424\u0430\u0439\u043b \u0441 \u0442\u0430\u043a\u0438\u043c \u0438\u043c\u0435\u043d\u0435\u043c \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442.","File not found or no longer available.":"\u0424\u0430\u0439\u043b \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d \u0438\u043b\u0438 \u0443\u0436\u0435 \u0431\u044b\u043b \u0443\u0434\u0430\u043b\u0451\u043d.","You don't have permission to access this file.":"\u0423 \u0432\u0430\u0441 \u043d\u0435\u0442 \u043f\u0440\u0430\u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u044d\u0442\u043e\u043c\u0443 \u0444\u0430\u0439\u043b\u0443.","File is too large to upload.":"\u0424\u0430\u0439\u043b \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438.","File is too large ({{fileSize}}). Maximum allowed size: {{maxSize}}.":"\u0424\u0430\u0439\u043b \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u043e\u0439 ({{fileSize}}). \u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u2014 {{maxSize}}.","Maximum number of files exceeded. Allowed: {{allowed}}, received: {{received}}":"\u041f\u0440\u0435\u0432\u044b\u0448\u0435\u043d\u043e \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0444\u0430\u0439\u043b\u043e\u0432. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e: {{allowed}}, \u0432\u044b\u0431\u0440\u0430\u043d\u043e: {{received}}","This file type is not allowed.":"\u042d\u0442\u043e\u0442 \u0442\u0438\u043f \u0444\u0430\u0439\u043b\u0430 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f.","File name is not valid.":"\u041d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e\u0435 \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430.","File name is not valid. Allowed characters: {{allowedChars}}":"\u041d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e\u0435 \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b: {{allowedChars}}","Failed to read the file.":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0444\u0430\u0439\u043b.","Failed to write the file.":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0444\u0430\u0439\u043b.","The file appears to be corrupted.":"\u0424\u0430\u0439\u043b \u043f\u043e\u0432\u0440\u0435\u0436\u0434\u0451\u043d \u0438\u043b\u0438 \u0438\u043c\u0435\u0435\u0442 \u043d\u0435\u0432\u0435\u0440\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442.","File integrity check failed.":"\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0446\u0435\u043b\u043e\u0441\u0442\u043d\u043e\u0441\u0442\u0438 \u0444\u0430\u0439\u043b\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u0430\u0441\u044c \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u043e.","Folder not found or no longer available.":"\u041f\u0430\u043f\u043a\u0430 \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u0430 \u0438\u043b\u0438 \u0443\u0436\u0435 \u0431\u044b\u043b\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u0430.","Folder with this name already exists.":"\u041f\u0430\u043f\u043a\u0430 \u0441 \u0442\u0430\u043a\u0438\u043c \u0438\u043c\u0435\u043d\u0435\u043c \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442.","A folder with that name already exists. Please enter a different folder name.":"\u041f\u0430\u043f\u043a\u0430 \u0441 \u0442\u0430\u043a\u0438\u043c \u0438\u043c\u0435\u043d\u0435\u043c \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442. \u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0434\u0440\u0443\u0433\u043e\u0435 \u0438\u043c\u044f \u043f\u0430\u043f\u043a\u0438.","You don't have permission to access this folder.":"\u0423 \u0432\u0430\u0441 \u043d\u0435\u0442 \u043f\u0440\u0430\u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u044d\u0442\u043e\u0439 \u043f\u0430\u043f\u043a\u0435.","Folder name is not valid.":"\u041d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e\u0435 \u0438\u043c\u044f \u043f\u0430\u043f\u043a\u0438.","Folder name is not valid. Allowed characters: {{allowedChars}}":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0430\u043f\u043a\u0443. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0432 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0438 \u043f\u0430\u043f\u043a\u0438: {{allowedChars}}","Failed to read the folder contents.":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043f\u0430\u043f\u043a\u0438.","Failed to write to the folder.":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u0441 \u043f\u0430\u043f\u043a\u043e\u0439.","Folder storage quota exceeded.":"\u041f\u0440\u0435\u0432\u044b\u0448\u0435\u043d\u0430 \u043a\u0432\u043e\u0442\u0430 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043f\u0430\u043f\u043a\u0438.","Folder is not empty.":"\u041f\u0430\u043f\u043a\u0430 \u043d\u0435 \u043f\u0443\u0441\u0442\u0430.","Server error while processing the folder.":"\u041e\u0448\u0438\u0431\u043a\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043f\u0430\u043f\u043a\u0438.","Folder operation took too long.":"\u041e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0441 \u043f\u0430\u043f\u043a\u043e\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0430\u0441\u044c \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0434\u043e\u043b\u0433\u043e.","Network error. Please check your connection and try again.":"\u041e\u0448\u0438\u0431\u043a\u0430 \u0441\u0435\u0442\u0438. \u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0443 \u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u0435 \u043f\u043e\u043f\u044b\u0442\u043a\u0443.","The operation took too long. Please try again.":"\u041e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0430\u0441\u044c \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0434\u043e\u043b\u0433\u043e. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0435\u0449\u0451 \u0440\u0430\u0437.","Server error. Please try again later.":"\u041e\u0448\u0438\u0431\u043a\u0430 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435. \u041f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u0435 \u043f\u043e\u043f\u044b\u0442\u043a\u0443 \u043f\u043e\u0437\u0436\u0435.","Service is temporarily unavailable. Please try again later.":"\u0421\u0435\u0440\u0432\u0438\u0441 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d. \u041f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u0435 \u043f\u043e\u043f\u044b\u0442\u043a\u0443 \u043f\u043e\u0437\u0436\u0435.","Too many requests. Please try again a bit later.":"\u0421\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0435\u0449\u0451 \u0440\u0430\u0437 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0437\u0436\u0435.","Authentication failed. Please sign in again.":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u0440\u043e\u0439\u0442\u0438 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e. \u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0432\u043e\u0439\u0434\u0438\u0442\u0435 \u0441\u043d\u043e\u0432\u0430.","You are not allowed to perform this action.":"\u0423 \u0432\u0430\u0441 \u043d\u0435\u0442 \u043f\u0440\u0430\u0432 \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f.","Some of the provided data is invalid.":"\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b.","This operation is not supported.":"\u042d\u0442\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f.","Request payload is too large.":"\u0422\u0435\u043b\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u043e\u0435.","This media type is not supported.":"\u042d\u0442\u043e\u0442 \u0442\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f.","You have exceeded the upload quota.":"\u041f\u0440\u0435\u0432\u044b\u0448\u0435\u043d\u0430 \u043a\u0432\u043e\u0442\u0430 \u043d\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0444\u0430\u0439\u043b\u043e\u0432.","Network error while uploading the file.":"\u0421\u0435\u0442\u0435\u0432\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0444\u0430\u0439\u043b\u0430.","File upload took too long.":"\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0444\u0430\u0439\u043b\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0430\u0441\u044c \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0434\u043e\u043b\u0433\u043e.","Server error while uploading the file.":"\u041e\u0448\u0438\u0431\u043a\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0444\u0430\u0439\u043b\u0430.","The specified URL is not valid.":"\u0423\u043a\u0430\u0437\u0430\u043d \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 URL.","The specified URL is not reachable.":"\u0423\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 URL \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d.","Content type at the URL is not allowed.":"\u0422\u0438\u043f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u043f\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c\u0443 URL \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f.","Failed to download file from the URL.":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0444\u0430\u0439\u043b \u043f\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c\u0443 URL.","Network error while downloading the file.":"\u0421\u0435\u0442\u0435\u0432\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0438 \u0444\u0430\u0439\u043b\u0430.","File download took too long.":"\u0421\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u043e\u0441\u044c \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0434\u043e\u043b\u0433\u043e.","Server error while downloading the file.":"\u041e\u0448\u0438\u0431\u043a\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043f\u0440\u0438 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0438 \u0444\u0430\u0439\u043b\u0430.","Some items could not be processed.":"\u041d\u0435 \u0432\u0441\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0431\u044b\u043b\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u044b \u0443\u0441\u043f\u0435\u0448\u043d\u043e.","Failed to process all items in the batch.":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0438 \u043e\u0434\u0438\u043d \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432 \u043f\u0430\u043a\u0435\u0442\u043d\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438.","Some items in the batch are in a conflicting state.":"\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0432 \u043f\u0430\u043a\u0435\u0442\u043d\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u0443\u044e\u0449\u0435\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438.","Some items in the batch did not pass validation.":"\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0432 \u043f\u0430\u043a\u0435\u0442\u043d\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043d\u0435 \u043f\u0440\u043e\u0448\u043b\u0438 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e.","AI service returned an invalid response.":"\u0421\u0435\u0440\u0432\u0438\u0441 AI \u0432\u0435\u0440\u043d\u0443\u043b \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442.","Failed to generate image using AI.":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e AI.","You have reached the AI image generation limit.":"\u0414\u043e\u0441\u0442\u0438\u0433\u043d\u0443\u0442 \u043b\u0438\u043c\u0438\u0442 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 AI.","Error in external integration.":"\u041e\u0448\u0438\u0431\u043a\u0430 \u0432\u043e \u0432\u043d\u0435\u0448\u043d\u0435\u0439 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438.","Error in a third-party service.":"\u041e\u0448\u0438\u0431\u043a\u0430 \u0432\u043e \u0432\u043d\u0435\u0448\u043d\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u0435.","An unknown error occurred.":"\u041f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430.","Renaming is not allowed for this item.":"\u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u043e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430.","Moving is not allowed for this item.":"\u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u043d\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u043e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430.","Copying is not allowed for this item.":"\u041a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u043e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430.","Deleting is not allowed for this item.":"\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u043d\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u043e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430.","Cannot move an item into itself.":"\u041d\u0435\u043b\u044c\u0437\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432 \u0441\u0430\u043c\u043e\u0433\u043e \u0441\u0435\u0431\u044f.","Cannot move an item into its descendant folder.":"\u041d\u0435\u043b\u044c\u0437\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432 \u0434\u043e\u0447\u0435\u0440\u043d\u044e\u044e \u043f\u0430\u043f\u043a\u0443.","Cannot copy an item into itself.":"\u041d\u0435\u043b\u044c\u0437\u044f \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432 \u0441\u0430\u043c\u043e\u0433\u043e \u0441\u0435\u0431\u044f.","Configuration error occurred.":"\u041f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438.","Storage quota exceeded. Please free up space.":"\u041f\u0440\u0435\u0432\u044b\u0448\u0435\u043d\u0430 \u043a\u0432\u043e\u0442\u0430 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430. \u041e\u0441\u0432\u043e\u0431\u043e\u0434\u0438\u0442\u0435 \u043c\u0435\u0441\u0442\u043e.","File is locked by another process or user.":"\u0424\u0430\u0439\u043b \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d \u0434\u0440\u0443\u0433\u0438\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u043c \u0438\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c.","File version conflict. Please refresh and try again.":"\u041a\u043e\u043d\u0444\u043b\u0438\u043a\u0442 \u0432\u0435\u0440\u0441\u0438\u0439 \u0444\u0430\u0439\u043b\u0430. \u041e\u0431\u043d\u043e\u0432\u0438\u0442\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0441\u043d\u043e\u0432\u0430.","Batch operation exceeds the maximum number of items allowed.":"\u041f\u0430\u043a\u0435\u0442\u043d\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0435\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432.",Moved:"\u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u044b: {{names}}",move_success_summary:"\u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u043e {{successCount}} \u0438\u0437 {{totalCount}} \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432",move_fail_summary:"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c {{failCount}} \u0438\u0437 {{totalCount}} \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432",Copied:"\u0421\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u044b: {{names}}",copy_success_summary:"\u0421\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u043e {{successCount}} \u0438\u0437 {{totalCount}} \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432",copy_fail_summary:"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c {{failCount}} \u0438\u0437 {{totalCount}} \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432",Uploaded:"\u0417\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u044b: {{names}}",Failed:"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c: {{names}}","Failed to upload":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c {{failCount}} \u0438\u0437 {{count}} \u0444\u0430\u0439\u043b\u0430","Failed to upload files":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c {{failCount}} \u0438\u0437 {{count}} \u0444\u0430\u0439\u043b\u043e\u0432",months:{january:"\u044f\u043d\u0432\u0430\u0440\u044f",february:"\u0444\u0435\u0432\u0440\u0430\u043b\u044f",march:"\u043c\u0430\u0440\u0442\u0430",april:"\u0430\u043f\u0440\u0435\u043b\u044f",may:"\u043c\u0430\u044f",june:"\u0438\u044e\u043d\u044f",july:"\u0438\u044e\u043b\u044f",august:"\u0430\u0432\u0433\u0443\u0441\u0442\u0430",september:"\u0441\u0435\u043d\u0442\u044f\u0431\u0440\u044f",october:"\u043e\u043a\u0442\u044f\u0431\u0440\u044f",november:"\u043d\u043e\u044f\u0431\u0440\u044f",december:"\u0434\u0435\u043a\u0430\u0431\u0440\u044f"},files:"\u0444\u0430\u0439\u043b\u043e\u0432","No available folders":"\u041d\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u043f\u0430\u043f\u043e\u043a","My files":"\u041c\u043e\u0438 \u0444\u0430\u0439\u043b\u044b",GIF:"GIF","Stock images":"\u0421\u0442\u043e\u043a\u043e\u0432\u044b\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f",Icons:"\u0418\u043a\u043e\u043d\u043a\u0438",AI:"AI","AI image generation":"AI \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439","Search GIFs":"\u041d\u0430\u0439\u0442\u0438 GIF","That`s all we could find.":"\u042d\u0442\u043e \u0432\u0441\u0435, \u0447\u0442\u043e \u043c\u044b \u0441\u043c\u043e\u0433\u043b\u0438 \u043d\u0430\u0439\u0442\u0438.","Search image":"\u041d\u0430\u0439\u0442\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435",All:"\u0412\u0441\u0435",Landscape:"\u0413\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0435",Portrait:"\u0412\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0435",Squarish:"\u041a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u044b\u0435",Black:"\u0427\u0435\u0440\u043d\u044b\u0439","Black and White":"\u0427\u0435\u0440\u043d\u043e-\u0431\u0435\u043b\u044b\u0439",White:"\u0411\u0435\u043b\u044b\u0439",Orange:"\u041e\u0440\u0430\u043d\u0436\u0435\u0432\u044b\u0439",Red:"\u041a\u0440\u0430\u0441\u043d\u044b\u0439",Purple:"\u0424\u0438\u043e\u043b\u0435\u0442\u043e\u0432\u044b\u0439",Magenta:"\u041f\u0443\u0440\u043f\u0443\u0440\u043d\u044b\u0439",Green:"\u0417\u0435\u043b\u0435\u043d\u044b\u0439",Teal:"\u0411\u0438\u0440\u044e\u0437\u043e\u0432\u044b\u0439",Blue:"\u0421\u0438\u043d\u0438\u0439","Photo by":"\u0424\u043e\u0442\u043e",on:"\u043d\u0430","File Manager":"\u0424\u0430\u0439\u043b\u043e\u0432\u044b\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440","File Manager not configured":"\u0424\u0430\u0439\u043b\u043e\u0432\u044b\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u043d\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d","Filter by type":"\u0424\u0438\u043b\u044c\u0442\u0440 \u043f\u043e \u0442\u0438\u043f\u0443","All types":"\u0412\u0441\u0435 \u0442\u0438\u043f\u044b","File name":"\u0418\u043c\u044f \u0444\u0430\u0439\u043b\u0430",Actions:"\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u044f","Add file":"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0444\u0430\u0439\u043b","Add folder":"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0430\u043f\u043a\u0443","Add file by URL":"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0444\u0430\u0439\u043b \u043f\u043e URL","File moved":"\u0424\u0430\u0439\u043b \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0451\u043d","Files moved":"\u0424\u0430\u0439\u043b\u044b \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u044b","Error when moving a file":"\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0438 \u0444\u0430\u0439\u043b\u0430","Files copied":"\u0424\u0430\u0439\u043b\u044b \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u044b","Failed to download file":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0444\u0430\u0439\u043b","Failed to load JSON data":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 JSON","Invalid file URL":"\u041d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 URL \u0444\u0430\u0439\u043b\u0430","Unable to validate file URL":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0444\u0430\u0439\u043b \u043f\u043e URL","Type to search...":"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430...",Submit:"\u041e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c","No folders yet":"\u041f\u0430\u043f\u043e\u043a \u043f\u043e\u043a\u0430 \u043d\u0435\u0442","Drag files to upload":"\u041f\u0435\u0440\u0435\u0442\u0430\u0449\u0438\u0442\u0435 \u0444\u0430\u0439\u043b\u044b \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438","Drop files here to upload":"\u041e\u0442\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u0444\u0430\u0439\u043b\u044b \u0437\u0434\u0435\u0441\u044c, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0438\u0445","Newest first":"\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u043e\u0432\u044b\u0435","Oldest first":"\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u0442\u0430\u0440\u044b\u0435","Largest first":"\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0431\u043e\u043b\u044c\u0448\u0438\u0435","Smallest first":"\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0435","A-Z":"\u041f\u043e \u0430\u043b\u0444\u0430\u0432\u0438\u0442\u0443 \u0410-\u042f","Z-A":"\u041f\u043e \u0430\u043b\u0444\u0430\u0432\u0438\u0442\u0443 \u042f-\u0410","By type":"\u041f\u043e \u0442\u0438\u043f\u0443","Evaluating the task":"\u041e\u0446\u0435\u043d\u043a\u0430 \u0437\u0430\u0434\u0430\u043d\u0438\u044f","Something went wrong, please try again":"\u0427\u0442\u043e-\u0442\u043e \u043f\u043e\u0448\u043b\u043e \u043d\u0435 \u0442\u0430\u043a, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0435\u0449\u0435 \u0440\u0430\u0437","Sort by":"\u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e","preview text":"\u0418\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044f ...","Use this variant":"\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u0432\u0430\u0440\u0438\u0430\u043d\u0442","Confirm deletion":"\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044c \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435","Are you sure you want to delete the selected items?":"\u0412\u044b \u0443\u0432\u0435\u0440\u0435\u043d\u044b, \u0447\u0442\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b?","Move to Trash":"\u041f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443","Are you sure you want to move the selected items to the Trash?":"\u0412\u044b \u0443\u0432\u0435\u0440\u0435\u043d\u044b, \u0447\u0442\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443?","Permanently delete":"\u041f\u043e\u043b\u043d\u043e\u0435 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435","Delete permanently":"\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u0431\u0435\u0437\u0432\u043e\u0437\u0432\u0440\u0430\u0442\u043d\u043e","Are you sure you want to permanently delete the selected items? This action cannot be undone.":"\u0412\u044b \u0443\u0432\u0435\u0440\u0435\u043d\u044b, \u0447\u0442\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u0431\u0435\u0437\u0432\u043e\u0437\u0432\u0440\u0430\u0442\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b? \u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043d\u0435\u043b\u044c\u0437\u044f \u043e\u0442\u043c\u0435\u043d\u0438\u0442\u044c.",Clear:"\u041e\u0447\u0438\u0441\u0442\u0438\u0442\u044c","Clear Trash":"\u041e\u0447\u0438\u0441\u0442\u0438\u0442\u044c \u043a\u043e\u0440\u0437\u0438\u043d\u0443","Are you sure you want to permanently delete all items from Trash?":"\u0412\u044b \u0443\u0432\u0435\u0440\u0435\u043d\u044b, \u0447\u0442\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u0431\u0435\u0437\u0432\u043e\u0437\u0432\u0440\u0430\u0442\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0432\u0441\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0438\u0437 \u043a\u043e\u0440\u0437\u0438\u043d\u044b?","Trash cleared successfully":"\u041a\u043e\u0440\u0437\u0438\u043d\u0430 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043e\u0447\u0438\u0449\u0435\u043d\u0430","{{count}} items permanently deleted":"{{count}} \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0431\u0435\u0437\u0432\u043e\u0437\u0432\u0440\u0430\u0442\u043d\u043e \u0443\u0434\u0430\u043b\u0435\u043d\u043e","Trash partially cleared":"\u041a\u043e\u0440\u0437\u0438\u043d\u0430 \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e \u043e\u0447\u0438\u0449\u0435\u043d\u0430","{{succeeded}} items deleted, {{failed}} items failed":"{{succeeded}} \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0443\u0434\u0430\u043b\u0435\u043d\u043e, {{failed}} \u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0443\u0434\u0430\u043b\u0438\u0442\u044c","Failed to clear trash":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043e\u0447\u0438\u0441\u0442\u0438\u0442\u044c \u043a\u043e\u0440\u0437\u0438\u043d\u0443","Error clearing trash":"\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u043e\u0447\u0438\u0441\u0442\u043a\u0435 \u043a\u043e\u0440\u0437\u0438\u043d\u044b","Deleting items...":"\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432...",delete_files_permanent_one:"\u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0431\u0435\u0437\u0432\u043e\u0437\u0432\u0440\u0430\u0442\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442 {{count}} \u0444\u0430\u0439\u043b",delete_files_permanent_few:"\u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0431\u0435\u0437\u0432\u043e\u0437\u0432\u0440\u0430\u0442\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442 {{count}} \u0444\u0430\u0439\u043b\u0430",delete_files_permanent_many:"\u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0431\u0435\u0437\u0432\u043e\u0437\u0432\u0440\u0430\u0442\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442 {{count}} \u0444\u0430\u0439\u043b\u043e\u0432",delete_files_permanent_other:"\u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0431\u0435\u0437\u0432\u043e\u0437\u0432\u0440\u0430\u0442\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442 {{count}} \u0444\u0430\u0439\u043b\u043e\u0432",delete_folder_permanent:"\u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0431\u0435\u0437\u0432\u043e\u0437\u0432\u0440\u0430\u0442\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442 \u043f\u0430\u043f\u043a\u0443 \xab{{name}}\xbb \u0438 \u0432\u0441\u0451 \u0435\u0451 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435, \u0432\u043a\u043b\u044e\u0447\u0430\u044f {{count}} \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432.",delete_mixed_permanent:"\u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0431\u0435\u0437\u0432\u043e\u0437\u0432\u0440\u0430\u0442\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442 {{total}} \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u0432\u043a\u043b\u044e\u0447\u0430\u044f {{folders}} \u043f\u0430\u043f\u043e\u043a \u0438 \u0432\u0441\u0435 {{images}} \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0438\u0445.",permanent_delete_warning:"\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u044b\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u0432 \u043f\u0438\u0441\u044c\u043c\u0430\u0445, \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u043a \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u043c \u0441 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435\u043c \u043a\u0430\u0440\u0442\u0438\u043d\u043e\u043a \u0432 \u0441\u0442\u0430\u0440\u044b\u0445 \u043f\u0438\u0441\u044c\u043c\u0430\u0445. \u0412\u044b \u0443\u0432\u0435\u0440\u0435\u043d\u044b, \u0447\u0442\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0435?",move_files_to_trash_one:"\u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443 {{count}} \u0444\u0430\u0439\u043b.",move_files_to_trash_few:"\u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443 {{count}} \u0444\u0430\u0439\u043b\u0430.",move_files_to_trash_many:"\u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443 {{count}} \u0444\u0430\u0439\u043b\u043e\u0432.",move_files_to_trash_other:"\u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443 {{count}} \u0444\u0430\u0439\u043b\u043e\u0432.",move_folder_to_trash:"\u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443 \u043f\u0430\u043f\u043a\u0443 \xab{{name}}\xbb \u0438 \u0432\u0441\u0451 \u0435\u0451 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 ({{count}} \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432).",move_mixed_to_trash:"\u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443 {{total}} \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u0432\u043a\u043b\u044e\u0447\u0430\u044f {{folders}} \u043f\u0430\u043f\u043e\u043a \u0438 {{images}} \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439.",delete_count_confirm_trash_one:"\u041f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443 {{count}} \u0444\u0430\u0439\u043b?",delete_count_confirm_trash_few:"\u041f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443 {{count}} \u0444\u0430\u0439\u043b\u0430?",delete_count_confirm_trash_many:"\u041f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443 {{count}} \u0444\u0430\u0439\u043b\u043e\u0432?",delete_count_confirm_trash_other:"\u041f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443 {{count}} \u0444\u0430\u0439\u043b\u043e\u0432?",delete_count_confirm_permanent_one:"\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u043d\u0430\u0432\u0441\u0435\u0433\u0434\u0430 {{count}} \u0444\u0430\u0439\u043b?",delete_count_confirm_permanent_few:"\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u043d\u0430\u0432\u0441\u0435\u0433\u0434\u0430 {{count}} \u0444\u0430\u0439\u043b\u0430?",delete_count_confirm_permanent_many:"\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u043d\u0430\u0432\u0441\u0435\u0433\u0434\u0430 {{count}} \u0444\u0430\u0439\u043b\u043e\u0432?",delete_count_confirm_permanent_other:"\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u043d\u0430\u0432\u0441\u0435\u0433\u0434\u0430 {{count}} \u0444\u0430\u0439\u043b\u043e\u0432?",delete_count_confirm_one:"\u0423\u0434\u0430\u043b\u0438\u0442\u044c {{count}} \u0444\u0430\u0439\u043b?",delete_count_confirm_few:"\u0423\u0434\u0430\u043b\u0438\u0442\u044c {{count}} \u0444\u0430\u0439\u043b\u0430?",delete_count_confirm_many:"\u0423\u0434\u0430\u043b\u0438\u0442\u044c {{count}} \u0444\u0430\u0439\u043b\u043e\u0432?",delete_count_confirm_other:"\u0423\u0434\u0430\u043b\u0438\u0442\u044c {{count}} \u0444\u0430\u0439\u043b\u043e\u0432?",item:"\u0444\u0430\u0439\u043b",items:"\u0444\u0430\u0439\u043b\u043e\u0432",Trash:"\u041a\u043e\u0440\u0437\u0438\u043d\u0430",Choose:"\u0412\u044b\u0431\u0440\u0430\u0442\u044c",Stock:"\u0424\u043e\u0442\u043e\u0441\u0442\u043e\u043a","Select an image from our library":"\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0438\u0437 \u043d\u0430\u0448\u0435\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438","AI generation":"AI \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f","Creating an image on demand":"\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043f\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0443","Search file or folder":"\u041d\u0430\u0439\u0442\u0438 \u0444\u0430\u0439\u043b \u0438\u043b\u0438 \u043f\u0430\u043f\u043a\u0443","Click here to select a file":"\u041d\u0430\u0436\u043c\u0438\u0442\u0435 \u0437\u0434\u0435\u0441\u044c, \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0444\u0430\u0439\u043b","Supported files:":"\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0435 \u0444\u0430\u0439\u043b\u044b:","Create folder":"\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0430\u043f\u043a\u0443",Done:"\u0413\u043e\u0442\u043e\u0432\u043e","Move here":"\u041f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0441\u044e\u0434\u0430","Copy here":"\u041a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u044e\u0434\u0430","File URL":"URL \u0444\u0430\u0439\u043b\u0430","There's nothing here":"\u0417\u0434\u0435\u0441\u044c \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435\u0442","Try using a different search query.":"\u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441.","Millions of free stock images":"\u041c\u0438\u043b\u043b\u0438\u043e\u043d\u044b \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0445 \u0441\u0442\u043e\u043a\u043e\u0432\u044b\u0445 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439","Enter a search query and we'll find the perfect image for you":"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441, \u0438 \u043c\u044b \u043d\u0430\u0439\u0434\u0435\u043c \u0434\u043b\u044f \u0432\u0430\u0441 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435","Millions of icons":"\u041c\u0438\u043b\u043b\u0438\u043e\u043d\u044b \u0438\u043a\u043e\u043d\u043e\u043a","Enter a search query and we'll find the perfect icon for you":"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441, \u0438 \u043c\u044b \u043d\u0430\u0439\u0434\u0435\u043c \u0434\u043b\u044f \u0432\u0430\u0441 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u0443\u044e \u0438\u043a\u043e\u043d\u043a\u0443","Enter your query and we will find the right one for you":"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0437\u0430\u043f\u0440\u043e\u0441 \u0438 \u043c\u044b \u043d\u0430\u0439\u0434\u0435\u043c \u0434\u043b\u044f \u0432\u0430\u0441 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0435\u0435","Over 350,000 live images":"\u0411\u043e\u043b\u0435\u0435 350 000 \u0436\u0438\u0432\u044b\u0445 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439","The folder will be created in the root directory.":"\u041f\u0430\u043f\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0430 \u0432 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u043c \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435.",undo:"\u041e\u0422\u041c\u0415\u041d\u0410",moved_to_trash_one:"\u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0451\u043d {{count}} \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443",moved_to_trash_few:"\u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u043e {{count}} \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443",moved_to_trash_many:"\u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u043e {{count}} \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443",moved_to_trash_other:"\u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u043e {{count}} \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443",restored_items_one:"\u0412\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0451\u043d {{count}} \u044d\u043b\u0435\u043c\u0435\u043d\u0442",restored_items_few:"\u0412\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e {{count}} \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430",restored_items_many:"\u0412\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e {{count}} \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432",restored_items_other:"\u0412\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e {{count}} \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432",Type:"\u0422\u0438\u043f","Generate image":"C\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435","A beautiful image of a sunset over a calm ocean.":"\u041a\u0440\u0430\u0441\u0438\u0432\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u043a\u0430\u0442\u0430 \u043d\u0430\u0434 \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u044b\u043c \u043e\u043a\u0435\u0430\u043d\u043e\u043c.","For example:":"\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:",Insert:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044c",Error:"\u041e\u0448\u0438\u0431\u043a\u0430","Upload progress":"\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 {{completed}}/{{total}}","Uploading files":"\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 {{completed}}/{{total}} \u0444\u0430\u0439\u043b\u043e\u0432","Uploaded files":"\u0417\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043e {{success}} \u0438\u0437 {{total}} \u0444\u0430\u0439\u043b\u043e\u0432","Upload error files":"\u041e\u0448\u0438\u0431\u043a\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 {{errorCount}} \u0444\u0430\u0439\u043b\u043e\u0432","Applies to all {{count}} files":"(\u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043a\u043e \u0432\u0441\u0435\u043c {{count}} \u0444\u0430\u0439\u043b\u0430\u043c)","Some files failed to upload":"\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c. \u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u0440\u0430\u0437\u043c\u0435\u0440 \u0438 \u0444\u043e\u0440\u043c\u0430\u0442 \u0444\u0430\u0439\u043b\u043e\u0432.",upload_error_hint_invalid_name:"\u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u0443\u0439\u0442\u0435 \u0444\u0430\u0439\u043b: \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0431\u0443\u043a\u0432\u044b, \u0446\u0438\u0444\u0440\u044b, \u0434\u0435\u0444\u0438\u0441 \u0438 \u043f\u043e\u0434\u0447\u0451\u0440\u043a\u0438\u0432\u0430\u043d\u0438\u0435.",upload_error_hint_size:"\u0423\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u0435 \u0440\u0430\u0437\u043c\u0435\u0440 \u0444\u0430\u0439\u043b\u0430 \u0438\u043b\u0438 \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0434\u0440\u0443\u0433\u043e\u0439.",upload_error_hint_format:"\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442: JPG, PNG \u0438\u043b\u0438 GIF.",upload_error_hint_exists:"\u0424\u0430\u0439\u043b \u0441 \u0442\u0430\u043a\u0438\u043c \u0438\u043c\u0435\u043d\u0435\u043c \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u0432 \u043f\u0430\u043f\u043a\u0435. \u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u0443\u0439\u0442\u0435 \u0444\u0430\u0439\u043b.","Images generated successfully":"\u0418\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u044b","Trash is empty":"\u041a\u043e\u0440\u0437\u0438\u043d\u0430 \u043f\u0443\u0441\u0442\u0430","Deleted files will be displayed here":"\u0417\u0434\u0435\u0441\u044c \u0431\u0443\u0434\u0443\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c\u0441\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b","Stroke width":"\u0422\u043e\u043b\u0449\u0438\u043d\u0430:",Style:"\u0421\u0442\u0438\u043b\u044c",Color1:"\u0426\u0432\u0435\u0442 1:",Color2:"\u0426\u0432\u0435\u0442 2:",Color3:"\u0426\u0432\u0435\u0442 3: ","Global search":"\u0413\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a","Family search":"\u041f\u043e\u0438\u0441\u043a \u043f\u043e \u0441\u0435\u043c\u0435\u0439\u0441\u0442\u0432\u0443","Choose for template":"\u0412\u044b\u0431\u0440\u0430\u0442\u044c \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0432 \u0448\u0430\u0431\u043b\u043e\u043d",Back:"\u041d\u0430\u0437\u0430\u0434","Editing: {{name}}":"\u0420\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435: {{name}}","Editing image":"\u0420\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f",Save:"\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c","Loading editor...":"\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430\u2026","Error loading image":"\u041e\u0448\u0438\u0431\u043a\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f","Error saving image":"\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f","Error initializing editor":"\u041e\u0448\u0438\u0431\u043a\u0430 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430","Close File Manager":"\u0417\u0430\u043a\u0440\u044b\u0442\u044c \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440","Are you sure you want to close? Unsaved changes will be lost.":"\u0412\u044b \u0443\u0432\u0435\u0440\u0435\u043d\u044b, \u0447\u0442\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u0437\u0430\u043a\u0440\u044b\u0442\u044c? \u041d\u0435\u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u0442\u0435\u0440\u044f\u043d\u044b.","Are you sure you want to close the file manager?":"\u0412\u044b \u0443\u0432\u0435\u0440\u0435\u043d\u044b, \u0447\u0442\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u0437\u0430\u043a\u0440\u044b\u0442\u044c \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440?",Close:"\u0417\u0430\u043a\u0440\u044b\u0442\u044c",KB:"\u041a\u0411","No files":"\u041d\u0435\u0442 \u0444\u0430\u0439\u043b\u043e\u0432","Folder is empty or files not found":"\u041f\u0430\u043f\u043a\u0430 \u043f\u0443\u0441\u0442\u0430 \u0438\u043b\u0438 \u0444\u0430\u0439\u043b\u044b \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u044b","Search files...":"\u041f\u043e\u0438\u0441\u043a \u0444\u0430\u0439\u043b\u043e\u0432...",Success:"\u0423\u0441\u043f\u0435\u0445","Image updated successfully":"\u0418\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u043e","Failed to save changes":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f: {{error}}","Unknown error":"\u041d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430","Select destination folder":"\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043f\u0430\u043f\u043a\u0443 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f","Error moving":"\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0438","Error deleting":"\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0438","Error copying":"\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438","Error renaming":"\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0438","Failed to refresh folder tree":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0434\u0435\u0440\u0435\u0432\u043e \u043f\u0430\u043f\u043e\u043a","Failed to refresh file list":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0444\u0430\u0439\u043b\u043e\u0432","Errors occurred while moving":"\u041f\u0440\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0438 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0438","Errors occurred while copying":"\u041f\u0440\u0438 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0438","(error)":"(\u043e\u0448\u0438\u0431\u043a\u0430)","(circular reference)":"(\u0446\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0441\u0441\u044b\u043b\u043a\u0430)","File too large. Maximum size: {{size}}":"\u0424\u0430\u0439\u043b \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u043e\u0439. \u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440: {{size}}","File too small. Minimum size: {{size}}":"\u0424\u0430\u0439\u043b \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439. \u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440: {{size}}","Unsupported file type":"\u041d\u0435\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0439 \u0442\u0438\u043f \u0444\u0430\u0439\u043b\u0430","Unsupported file type: {{type}}":"\u041d\u0435\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0439 \u0442\u0438\u043f \u0444\u0430\u0439\u043b\u0430: {{type}}",unknown:"\u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439","Failed to load files":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0444\u0430\u0439\u043b\u044b","DataProvider for folder deletion is not configured":"DataProvider \u0434\u043b\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043f\u043e\u043a \u043d\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d","DataProvider for file upload is not configured":"DataProvider \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0444\u0430\u0439\u043b\u043e\u0432 \u043d\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d","Error uploading file {{fileName}}":"\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0444\u0430\u0439\u043b\u0430 {{fileName}}","Error uploading file":"\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0444\u0430\u0439\u043b\u0430","Cannot upload files to Trash":"\u041d\u0435\u043b\u044c\u0437\u044f \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0444\u0430\u0439\u043b\u044b \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443","Please fill in all fields":"\u0417\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u0432\u0441\u0435 \u043f\u043e\u043b\u044f","URL too long":"URL \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0434\u043b\u0438\u043d\u043d\u044b\u0439","Only http and https URLs are supported":"\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e URL \u0441 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u043e\u043c http \u0438 https","Private and local URLs are not allowed":"\u041b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0438 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0435 URL \u0437\u0430\u043f\u0440\u0435\u0449\u0435\u043d\u044b","Upload by URL is not supported":"\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043f\u043e URL \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f","File name is too long. Maximum {{max}} characters":"\u0418\u043c\u044f \u0444\u0430\u0439\u043b\u0430 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0434\u043b\u0438\u043d\u043d\u043e\u0435. \u041c\u0430\u043a\u0441\u0438\u043c\u0443\u043c {{max}} \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432","File name contains invalid characters":"\u0418\u043c\u044f \u0444\u0430\u0439\u043b\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b","Large file may take a long time to upload":"\u0411\u043e\u043b\u044c\u0448\u043e\u0439 \u0444\u0430\u0439\u043b \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c\u0441\u044f \u0434\u043e\u043b\u0433\u043e","File unavailable: {{status}} {{statusText}}":"\u0424\u0430\u0439\u043b \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d: {{status}} {{statusText}}","File too large: {{size}}":"\u0424\u0430\u0439\u043b \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u043e\u0439: {{size}}","Unsupported file type: {{contentType}}":"\u041d\u0435\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0439 \u0442\u0438\u043f \u0444\u0430\u0439\u043b\u0430: {{contentType}}","Invalid server response: folder ID is missing":"\u041d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442 \u043e\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430: \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 ID \u043f\u0430\u043f\u043a\u0438","Error: folder cannot be its own parent":"\u041e\u0448\u0438\u0431\u043a\u0430: \u043f\u0430\u043f\u043a\u0430 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u0435\u043c \u0441\u0430\u043c\u043e\u0439 \u0441\u0435\u0431\u044f","Upload to Trash is forbidden":"\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443 \u0437\u0430\u043f\u0440\u0435\u0449\u0435\u043d\u0430","renameFolder is not implemented in dataProviders":"renameFolder \u043d\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0432 dataProviders","renameFile is not implemented in dataProviders":"renameFile \u043d\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0432 dataProviders",Deleted:"\u0423\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b",Clean:"\u041e\u0447\u0438\u0441\u0442\u0438\u0442\u044c","Circular dependency detected: folder cannot be its own parent":"\u041e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0430 \u0446\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c: \u043f\u0430\u043f\u043a\u0430 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u0435\u043c \u0441\u0430\u043c\u043e\u0439 \u0441\u0435\u0431\u044f","Save as copy and choose":"\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043a\u0430\u043a \u043a\u043e\u043f\u0438\u044e \u0438 \u0432\u044b\u0431\u0440\u0430\u0442\u044c","Save and choose":"\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438 \u0432\u044b\u0431\u0440\u0430\u0442\u044c",pixie:{"added drawing":"\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0440\u0438\u0441\u0443\u043d\u043a\u0430","added frame":"\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0440\u0430\u043c\u043a\u0438","added image":"\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f","added shape":"\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0444\u0438\u0433\u0443\u0440\u044b","added sticker":"\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0438\u043a\u0435\u0440\u0430","added text":"\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0442\u0435\u043a\u0441\u0442\u0430","applied filters":"\u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0444\u0438\u043b\u044c\u0442\u0440",apply:"\u041f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c",background:"\u0424\u043e\u043d","background color":"\u0424\u043e\u043d\u043e\u0432\u044b\u0439 \u0446\u0432\u0435\u0442",beach:"\u041f\u043b\u044f\u0436","brush color":"\u0426\u0432\u0435\u0442 \u043a\u0438\u0441\u0442\u0438","brush size":"\u0420\u0430\u0437\u043c\u0435\u0440 \u043a\u0438\u0441\u0442\u0438","brush type":"\u0422\u0438\u043f \u043a\u0438\u0441\u0442\u0438",bubbles:"\u041f\u0443\u0437\u044b\u0440\u044c\u043a\u0438",Cancel:"\u041e\u0442\u043c\u0435\u043d\u0430","changed style":"\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0441\u0442\u0438\u043b\u044f","Circle Brush":"\u041a\u0440\u0443\u0433\u0438",close:"\u0417\u0430\u043a\u0440\u044b\u0442\u044c",color:"\u0426\u0432\u0435\u0442",corners:"\u0423\u0433\u043b\u044b",crop:"\u041e\u0431\u0440\u0435\u0437\u0430\u0442\u044c",Custom:"\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439","deleted object":"\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u0430","Diamond Brush":"\u0410\u043b\u043c\u0430\u0437",doodles:"\u0426\u0432\u0435\u0442\u043d\u044b\u0435",draw:"\u0420\u0438\u0441\u0443\u043d\u043e\u043a",emoticons:"\u0421\u043c\u0430\u0439\u043b\u0438\u043a\u0438","Eraser Brush":"\u041b\u0430\u0441\u0442\u0438\u043a",filter:"\u0424\u0438\u043b\u044c\u0442\u0440",font:"\u0428\u0440\u0438\u0444\u0442","font size":"\u0420\u0430\u0437\u043c\u0435\u0440 \u0448\u0440\u0438\u0444\u0442\u0430",frame:"\u0420\u0430\u043c\u043a\u0430",gradient:"\u0413\u0440\u0430\u0434\u0438\u0435\u043d\u0442",height:"\u0412\u044b\u0441\u043e\u0442\u0430",history:"\u0418\u0441\u0442\u043e\u0440\u0438\u044f","H Line Brush":"\u041d-\u043e\u0431\u0440\u0430\u0437\u043d\u0430\u044f",image:"\u0418\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435",initial:"\u041d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439",landmarks:"\u0414\u043e\u0441\u0442\u043e\u043f\u0440\u0438\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438","loaded state":"\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f","loading canvas":"\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430","loading image":"\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430","loading state":"\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430","maintain aspect ratio":"Maintain aspect ratio",merge:"\u041e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435","merged objects":"\u041e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432","new text":"\u041d\u043e\u0432\u0430\u044f \u043d\u0430\u0434\u043f\u0438\u0441\u044c",objects:"\u041e\u0431\u044a\u0435\u043a\u0442",opacity:"\u041f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e\u0441\u0442\u044c",outline:"\u041a\u043e\u043d\u0442\u0443\u0440","outline color":"\u0426\u0432\u0435\u0442 \u043a\u043e\u043d\u0442\u0443\u0440\u0430","Pencil Brush":"\u041a\u0430\u0440\u0430\u043d\u0434\u0430\u0448","processing image":"\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430",quality:"\u041a\u0430\u0447\u0435\u0441\u0442\u0432\u043e",radius:"\u0420\u0430\u0434\u0438\u0443\u0441","replace image":"Replace Image","replaced background image":"\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0444\u043e\u043d\u043e\u0432\u043e\u0433\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f",resize:"\u0420\u0430\u0437\u043c\u0435\u0440","resized image":"\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u043c\u0435\u0440\u0430","rounded corner":"\u0417\u0430\u0433\u0440\u0443\u0433\u043b\u0435\u043d\u0438\u0435 \u0443\u0433\u043b\u043e\u0432",save:"\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c",shadow:"\u0422\u0435\u043d\u044c","shadow color":"\u0426\u0432\u0435\u0442 \u0442\u0435\u043d\u0438",shapes:"\u0424\u0438\u0433\u0443\u0440\u044b","Spray Brush":"\u0421\u043f\u0440\u0435\u0439",square:"\u041a\u0432\u0430\u0440\u0434\u0440\u0430\u0442","Square Brush":"\u041a\u0432\u0430\u0440\u0434\u0440\u0430\u0442",stickers:"\u0421\u0442\u0438\u043a\u0435\u0440\u044b",text:"\u041d\u0430\u0434\u043f\u0438\u0441\u044c",texture:"\u0422\u0435\u043a\u0441\u0442\u0443\u0440\u0430",transportation:"\u0422\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442","V Line Brush":"V-\u043e\u0431\u0440\u0430\u0437\u043d\u0430\u044f",width:"\u0428\u0438\u0440\u0438\u043d\u0430",grayscale:"\u041e\u0442\u0442\u0435\u043d\u043a\u0438 \u0441\u0435\u0440\u043e\u0433\u043e","black & White":"\u0427\u0435\u0440\u043d\u043e-\u0431\u0435\u043b\u044b\u0439",sharpen:"\u0420\u0435\u0437\u043a\u043e\u0441\u0442\u044c",invert:"\u0418\u043d\u0432\u0435\u0440\u0441\u0438\u044f",vintage:"\u0412\u0438\u043d\u0442\u0430\u0436",polaroid:"\u041f\u043e\u043b\u0430\u0440\u043e\u0438\u0434",kodachrome:"\u041a\u043e\u0434\u0430\u0445\u0440\u043e\u043c",technicolor:"\u0422\u0435\u0445\u043d\u0438\u043a\u043e\u043b\u043e\u0440",brownie:"\u041a\u043e\u0440\u0438\u0447\u043d\u0435\u0432\u044b\u0439",sepia:"\u0421\u0435\u043f\u0438\u044f","remove Color":"\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u0446\u0432\u0435\u0442",brightness:"\u042f\u0440\u043a\u043e\u0441\u0442\u044c",gamma:"\u0413\u0430\u043c\u043c\u0430",noise:"\u0428\u0443\u043c",pixelate:"\u041f\u0438\u043a\u0441\u0435\u043b\u044c\u0438\u0437\u0430\u0446\u0438\u044f",blur:"\u0420\u0430\u0437\u043c\u044b\u0442\u0438\u0435",emboss:"\u0422\u0438\u0441\u043d\u0435\u043d\u0438\u0435","blend Color":"\u0421\u043c\u0435\u0448\u0430\u0442\u044c \u0446\u0432\u0435\u0442",distance:"\u0420\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435",red:"\u041a\u0440\u0430\u0441\u043d\u044b\u0439",green:"\u0417\u0435\u043b\u0435\u043d\u044b\u0439",blue:"\u0421\u0438\u043d\u0438\u0439",blocksize:"\u0420\u0430\u0437\u043c\u0435\u0440 \u0431\u043b\u043e\u043a\u0430",alpha:"\u0410\u043b\u044c\u0444\u0430",add:"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c",multiply:"\u0423\u043c\u043d\u043e\u0436\u0438\u0442\u044c",subtract:"\u0412\u044b\u0447\u0435\u0441\u0442\u044c",diff:"\u0420\u0430\u0437\u043d\u0438\u0446\u0430",screen:"\u042d\u043a\u0440\u0430\u043d",lighten:"\u041e\u0441\u0432\u0435\u0442\u043b\u0438\u0442\u044c",darken:"\u0417\u0430\u0442\u0435\u043c\u043d\u0438\u0442\u044c","select an option...":"\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043e\u043f\u0446\u0438\u044e..."}}},es:{translation:{Files:"Archivos",selected:"seleccionado(s)",Deselected:"Deseleccionar",Refresh:"Actualizar","Select all":"Seleccionar todo",Rename:"Renombrar","Rename file":"Renombrar archivo {{currentFileName}}","Select the destination folder":"Seleccionar la carpeta de destino","Selected files:":"Archivos seleccionados:","Selected files":"Archivos seleccionados: {{count}}",selected_files_one:"{{count}} archivo seleccionado",selected_files_few:"{{count}} archivos seleccionados",selected_files_many:"{{count}} archivos seleccionados",selected_files_other:"{{count}} archivos seleccionados",Copy:"Duplicar",Edit:"Editar",Move:"Mover","Move to":"Mover a",Delete:"Eliminar","New folder":"Nueva carpeta","Image search...":"B\xfasqueda de im\xe1genes...","Search icons":"Buscar iconos","By name":"Por nombre","By size":"Por tama\xf1o","By date":"Por fecha",List:"Lista",Grid:"Cuadr\xedcula",Main:"Principal",Folders:"Carpetas","total pages":"{{total}} elementos en total",Name:"Nombre",Untitled:"Sin t\xedtulo",Size:"Tama\xf1o",Dimensions:"Dimensiones",Date:"Fecha",error:"error",Folder:"Carpeta",created:"creada","Failed to create folder":"Error al crear la carpeta","File deleted":"Archivo eliminado","Error when deleting a file":"Error al eliminar el archivo","Folder deleted":"Carpeta eliminada","Error when deleting a folder":"Error al eliminar la carpeta","Delete folder":"Eliminar carpeta","Are you sure you want to delete this folder? This action will also delete all files and subfolders.":"\xbfEst\xe1 seguro de que desea eliminar esta carpeta? Esta acci\xf3n tambi\xe9n eliminar\xe1 todos los archivos y subcarpetas.","API-endpoint for file upload is not configured":"El endpoint API para la carga de archivos no est\xe1 configurado","Please select an image file":"Por favor, seleccione un archivo de imagen",File:"Archivo","has been successfully uploaded":"se ha cargado exitosamente","The URL must point to an image":"La URL debe apuntar a una imagen","Image upload...":"Cargando imagen...",Unknown:"Desconocido","Error downloading file by URL":"Error al descargar el archivo por URL","successfully uploaded":"cargado exitosamente","Error when downloading a file by URL":"Error al descargar un archivo por URL","Error when uploading a file":"Error al cargar el archivo","Error loading files":"Error al cargar archivos","File not found":"Archivo no encontrado","File renamed to":"Archivo renombrado a","Failed to rename the file":"Error al renombrar el archivo","Folder renamed to":"Carpeta renombrada a","Rename folder":"Renombrar carpeta","New folder name":"Nuevo nombre de la carpeta","Enter a new folder name":"Ingrese un nuevo nombre para la carpeta","Please drag and drop image files only":"Por favor, arrastre y suelte solo archivos de imagen","Upload file by URL":"Cargar archivo por URL","Upload file":"Cargar archivo","Creating a new folder":"Creando una nueva carpeta",Create:"Crear",Cancel:"Cancelar","Folder name":"Nombre de la carpeta","Enter the name of the folder":"Ingrese el nombre de la carpeta","Enter the name":"Ingrese el nombre","A folder will be created inside:":"La carpeta se crear\xe1 dentro de:","selected folder":"carpeta seleccionada","The folder will be created in the root directory":"La carpeta se crear\xe1 en el directorio ra\xedz","Failed to load folders":"No se pudieron cargar las carpetas","Folder name cannot be empty":"El nombre de la carpeta no puede estar vac\xedo","Folder creation provider is not configured":"El proveedor de creaci\xf3n de carpetas no est\xe1 configurado","Folder created":"Carpeta creada","Folder rename is disabled by config":"El renombrado de carpetas est\xe1 deshabilitado por la configuraci\xf3n","Folder rename provider is not configured":"El proveedor para renombrar carpetas no est\xe1 configurado","Unexpected response when renaming folder":"Respuesta inesperada al renombrar la carpeta","Folder renamed":"Carpeta renombrada","Failed to rename folder":"No se pudo renombrar la carpeta","Failed to load folder items count":"No se pudo obtener la cantidad de elementos de la carpeta","Failed to load subfolders":"No se pudieron cargar las subcarpetas",Download:"Descargar","image URL":"URL de la imagen","Enter the URL of the image":"Ingrese la URL de la imagen","Supported formats: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP":"Formatos admitidos: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP","New file name":"Nuevo nombre del archivo","Enter a new file name":"Ingrese un nuevo nombre para el archivo","Copy to folder":"Copiar a carpeta",Added:"A\xf1adido el {{date}}","File uploaded successfully":"Archivo {{fileName}} cargado exitosamente","Successfully uploaded":"{{successCount}} de {{count}} archivo cargado exitosamente","Successfully uploaded files":"{{successCount}} de {{count}} archivos cargados exitosamente",uploads_success_summary:"Se cargaron {{successCount}} de {{totalCount}} archivos",uploads_fail_summary:"No se pudieron cargar {{failCount}} de {{totalCount}} archivos","File with this name already exists.":"Ya existe un archivo con este nombre.","File not found or no longer available.":"El archivo no se encontr\xf3 o ya fue eliminado.","You don't have permission to access this file.":"No tiene permisos para acceder a este archivo.","File is too large to upload.":"El archivo es demasiado grande para subir.","File is too large ({{fileSize}}). Maximum allowed size: {{maxSize}}.":"El archivo es demasiado grande ({{fileSize}}). Tama\xf1o m\xe1ximo permitido: {{maxSize}}.","Maximum number of files exceeded. Allowed: {{allowed}}, received: {{received}}":"Se ha superado el n\xfamero m\xe1ximo de archivos. Permitido: {{allowed}}, recibido: {{received}}","This file type is not allowed.":"Este tipo de archivo no est\xe1 permitido.","File name is not valid.":"El nombre del archivo no es v\xe1lido.","File name is not valid. Allowed characters: {{allowedChars}}":"El nombre del archivo no es v\xe1lido. Caracteres permitidos: {{allowedChars}}","Failed to read the file.":"No se pudo leer el archivo.","Failed to write the file.":"No se pudo escribir el archivo.","The file appears to be corrupted.":"El archivo parece estar da\xf1ado.","File integrity check failed.":"La verificaci\xf3n de integridad del archivo fall\xf3.","Folder not found or no longer available.":"La carpeta no se encontr\xf3 o ya fue eliminada.","Folder with this name already exists.":"Ya existe una carpeta con este nombre.","A folder with that name already exists. Please enter a different folder name.":"Ya existe una carpeta con ese nombre. Introduzca un nombre de carpeta diferente.","You don't have permission to access this folder.":"No tiene permisos para acceder a esta carpeta.","Folder name is not valid.":"El nombre de la carpeta no es v\xe1lido.","Folder name is not valid. Allowed characters: {{allowedChars}}":"No se pudo crear la carpeta. Caracteres permitidos en el nombre: {{allowedChars}}","Failed to read the folder contents.":"No se pudo leer el contenido de la carpeta.","Failed to write to the folder.":"No se pudo escribir en la carpeta.","Folder storage quota exceeded.":"Se super\xf3 la cuota de almacenamiento de la carpeta.","Folder is not empty.":"La carpeta no est\xe1 vac\xeda.","Server error while processing the folder.":"Error del servidor al procesar la carpeta.","Folder operation took too long.":"La operaci\xf3n con la carpeta tard\xf3 demasiado.","Network error. Please check your connection and try again.":"Error de red. Compruebe su conexi\xf3n e int\xe9ntelo de nuevo.","The operation took too long. Please try again.":"La operaci\xf3n tard\xf3 demasiado. Int\xe9ntelo de nuevo.","Server error. Please try again later.":"Error del servidor. Int\xe9ntelo de nuevo m\xe1s tarde.","Service is temporarily unavailable. Please try again later.":"El servicio no est\xe1 disponible temporalmente. Int\xe9ntelo de nuevo m\xe1s tarde.","Too many requests. Please try again a bit later.":"Demasiadas solicitudes. Int\xe9ntelo de nuevo m\xe1s tarde.","Authentication failed. Please sign in again.":"Error de autenticaci\xf3n. Inicie sesi\xf3n de nuevo.","You are not allowed to perform this action.":"No tiene permisos para realizar esta acci\xf3n.","Some of the provided data is invalid.":"Algunos de los datos proporcionados no son v\xe1lidos.","This operation is not supported.":"Esta operaci\xf3n no est\xe1 soportada.","Request payload is too large.":"El cuerpo de la solicitud es demasiado grande.","This media type is not supported.":"Este tipo de contenido no est\xe1 soportado.","You have exceeded the upload quota.":"Se ha superado la cuota de subida de archivos.","Network error while uploading the file.":"Error de red al subir el archivo.","File upload took too long.":"La subida del archivo tard\xf3 demasiado.","Server error while uploading the file.":"Error del servidor al subir el archivo.","The specified URL is not valid.":"La URL especificada no es v\xe1lida.","The specified URL is not reachable.":"La URL especificada no es accesible.","Content type at the URL is not allowed.":"El tipo de contenido en la URL no est\xe1 permitido.","Failed to download file from the URL.":"No se pudo descargar el archivo desde la URL.","Network error while downloading the file.":"Error de red al descargar el archivo.","File download took too long.":"La descarga del archivo tard\xf3 demasiado.","Server error while downloading the file.":"Error del servidor al descargar el archivo.","Some items could not be processed.":"No todos los elementos se procesaron correctamente.","Failed to process all items in the batch.":"No se pudo procesar ning\xfan elemento del lote.","Some items in the batch are in a conflicting state.":"Algunos elementos del lote est\xe1n en estado de conflicto.","Some items in the batch did not pass validation.":"Algunos elementos del lote no pasaron la validaci\xf3n.","AI service returned an invalid response.":"El servicio de IA devolvi\xf3 una respuesta no v\xe1lida.","Failed to generate image using AI.":"No se pudo generar la imagen usando IA.","You have reached the AI image generation limit.":"Se alcanz\xf3 el l\xedmite de generaci\xf3n de im\xe1genes con IA.","Error in external integration.":"Error en la integraci\xf3n externa.","Error in a third-party service.":"Error en un servicio de terceros.","An unknown error occurred.":"Se ha producido un error desconocido.","Renaming is not allowed for this item.":"No se permite renombrar este elemento.","Moving is not allowed for this item.":"No se permite mover este elemento.","Copying is not allowed for this item.":"No se permite copiar este elemento.","Deleting is not allowed for this item.":"No se permite eliminar este elemento.","Cannot move an item into itself.":"No se puede mover un elemento dentro de s\xed mismo.","Cannot move an item into its descendant folder.":"No se puede mover un elemento a su carpeta descendiente.","Cannot copy an item into itself.":"No se puede copiar un elemento dentro de s\xed mismo.","Configuration error occurred.":"Se produjo un error de configuraci\xf3n.","Storage quota exceeded. Please free up space.":"Se super\xf3 la cuota de almacenamiento. Libere espacio.","File is locked by another process or user.":"El archivo est\xe1 bloqueado por otro proceso o usuario.","File version conflict. Please refresh and try again.":"Conflicto de versi\xf3n del archivo. Actualice la p\xe1gina e int\xe9ntelo de nuevo.","Batch operation exceeds the maximum number of items allowed.":"La operaci\xf3n por lotes excede el n\xfamero m\xe1ximo de elementos permitidos.",Moved:"Movidos: {{names}}",move_success_summary:"Se movieron {{successCount}} de {{totalCount}} elementos",move_fail_summary:"No se pudieron mover {{failCount}} de {{totalCount}} elementos",Copied:"Copiados: {{names}}",copy_success_summary:"Se copiaron {{successCount}} de {{totalCount}} elementos",copy_fail_summary:"No se pudieron copiar {{failCount}} de {{totalCount}} elementos",Uploaded:"Archivos cargados: {{names}}",Failed:"No se pudieron cargar: {{names}}","Failed to upload":"Error al cargar {{failCount}} de {{count}} archivo","Failed to upload files":"Error al cargar {{failCount}} de {{count}} archivos",months:{january:"enero",february:"febrero",march:"marzo",april:"abril",may:"mayo",june:"junio",july:"julio",august:"agosto",september:"septiembre",october:"octubre",november:"noviembre",december:"diciembre"},files:"archivos","No available folders":"No hay carpetas disponibles","My files":"Mis archivos",GIF:"GIF","Stock images":"Im\xe1genes de stock",AI:"IA","AI image generation":"Generaci\xf3n de im\xe1genes con IA","Search GIFs":"Buscar GIFs","That`s all we could find.":"Es todo lo que pudimos encontrar.","Search image":"Buscar imagen",All:"Todos",Landscape:"Horizontal",Portrait:"Vertical",Squarish:"Cuadrado",Black:"Negro","Black and White":"Blanco y negro",White:"Blanco",Orange:"Naranja",Red:"Rojo",Purple:"Morado",Magenta:"Magenta",Green:"Verde",Teal:"Verde azulado",Blue:"Azul","Photo by":"Foto de",on:"en","File Manager":"Administrador de archivos","File Manager not configured":"Administrador de archivos no configurado","Filter by type":"Filtrar por tipo","All types":"Todos los tipos","File name":"Nombre del archivo",Actions:"Acciones","Add file":"A\xf1adir archivo","Add folder":"A\xf1adir carpeta","Add file by URL":"A\xf1adir archivo por URL","File moved":"Archivo movido","Error when moving a file":"Error al mover el archivo","Failed to download file":"No se pudo descargar el archivo","Failed to load JSON data":"No se pudieron cargar los datos JSON","Invalid file URL":"URL de archivo inv\xe1lida","Unable to validate file URL":"No se pudo validar la URL del archivo","Type to search...":"Escriba para buscar...",Submit:"Enviar","No folders yet":"A\xfan no hay carpetas","Drag files to upload":"Arrastre archivos para cargarlos","Drop files here to upload":"Suelte los archivos aqu\xed para cargarlos","Newest first":"Los m\xe1s nuevos primero","Oldest first":"Los m\xe1s antiguos primero","Largest first":"Los m\xe1s grandes primero","Smallest first":"Los m\xe1s peque\xf1os primero","A-Z":"A-Z","Z-A":"Z-A","By type":"Por tipo","Evaluating the task":"Evaluando la tarea","Something went wrong, please try again":"Algo sali\xf3 mal, por favor intente nuevamente","Sort by":"Ordenar por","preview text":"Cargando imagen...","Use this variant":"Usar esta variante","Confirm deletion":"Confirmar eliminaci\xf3n","Are you sure you want to delete the selected items?":"\xbfEst\xe1 seguro de que desea eliminar los elementos seleccionados?","Move to Trash":"Mover a la papelera","Are you sure you want to move the selected items to the Trash?":"\xbfEst\xe1 seguro de que desea mover los elementos seleccionados a la papelera?","Permanently delete":"Eliminaci\xf3n permanente","Delete permanently":"Eliminar permanentemente","Are you sure you want to permanently delete the selected items? This action cannot be undone.":"\xbfEst\xe1 seguro de que desea eliminar permanentemente los elementos seleccionados? Esta acci\xf3n no se puede deshacer.",Clear:"Limpiar","Clear Trash":"Vaciar papelera","Are you sure you want to permanently delete all items from Trash?":"\xbfEst\xe1 seguro de que desea eliminar permanentemente todos los elementos de la papelera?","Trash cleared successfully":"Papelera vaciada con \xe9xito","{{count}} items permanently deleted":"{{count}} elementos eliminados permanentemente","Trash partially cleared":"Papelera parcialmente vaciada","{{succeeded}} items deleted, {{failed}} items failed":"{{succeeded}} elementos eliminados, {{failed}} fallaron","Failed to clear trash":"Error al vaciar papelera","Error clearing trash":"Error al vaciar papelera","Deleting items...":"Eliminando elementos...",delete_files_permanent_one:"Esta acci\xf3n eliminar\xe1 permanentemente {{count}} archivo",delete_files_permanent_few:"Esta acci\xf3n eliminar\xe1 permanentemente {{count}} archivos",delete_files_permanent_many:"Esta acci\xf3n eliminar\xe1 permanentemente {{count}} archivos",delete_files_permanent_other:"Esta acci\xf3n eliminar\xe1 permanentemente {{count}} archivos",delete_folder_permanent:"Esta acci\xf3n eliminar\xe1 permanentemente la carpeta \xab{{name}}\xbb y todo su contenido, incluyendo {{count}} elementos.",delete_mixed_permanent:"Esta acci\xf3n eliminar\xe1 permanentemente {{total}} elementos seleccionados, incluyendo {{folders}} carpetas y todas las {{images}} im\xe1genes dentro de ellas.",permanent_delete_warning:"Eliminar archivos que se usaron en correos provocar\xe1 problemas para mostrar im\xe1genes en correos antiguos. \xbfEst\xe1 seguro de que desea eliminar permanentemente la selecci\xf3n?",move_files_to_trash_one:"Esta acci\xf3n mover\xe1 {{count}} archivo a la papelera.",move_files_to_trash_few:"Esta acci\xf3n mover\xe1 {{count}} archivos a la papelera.",move_files_to_trash_many:"Esta acci\xf3n mover\xe1 {{count}} archivos a la papelera.",move_files_to_trash_other:"Esta acci\xf3n mover\xe1 {{count}} archivos a la papelera.",move_folder_to_trash:"Esta acci\xf3n mover\xe1 la carpeta \xab{{name}}\xbb y todo su contenido ({{count}} elementos) a la papelera.",move_mixed_to_trash:"Esta acci\xf3n mover\xe1 {{total}} elementos seleccionados a la papelera, incluyendo {{folders}} carpetas y {{images}} im\xe1genes.",delete_count_confirm_trash_one:"\xbfMover {{count}} archivo a la papelera?",delete_count_confirm_trash_few:"\xbfMover {{count}} archivos a la papelera?",delete_count_confirm_trash_many:"\xbfMover {{count}} archivos a la papelera?",delete_count_confirm_trash_other:"\xbfMover {{count}} archivos a la papelera?",delete_count_confirm_permanent_one:"\xbfEliminar permanentemente {{count}} archivo?",delete_count_confirm_permanent_few:"\xbfEliminar permanentemente {{count}} archivos?",delete_count_confirm_permanent_many:"\xbfEliminar permanentemente {{count}} archivos?",delete_count_confirm_permanent_other:"\xbfEliminar permanentemente {{count}} archivos?",delete_count_confirm_one:"\xbfEliminar {{count}} archivo?",delete_count_confirm_few:"\xbfEliminar {{count}} archivos?",delete_count_confirm_many:"\xbfEliminar {{count}} archivos?",delete_count_confirm_other:"\xbfEliminar {{count}} archivos?",item:"archivo",items:"archivos",Trash:"Papelera",Choose:"Elegir",Stock:"Banco de im\xe1genes","Select an image from our library":"Seleccione una imagen de nuestra biblioteca","AI generation":"Generaci\xf3n con IA","Creating an image on demand":"Creando una imagen bajo demanda","Search file or folder":"Buscar archivo o carpeta","Click here to select a file":"Haz clic aqu\xed para seleccionar un archivo","Supported files:":"Archivos admitidos:","Create folder":"Crear carpeta",Done:"Hecho","Move here":"Mover aqu\xed","Copy here":"Copiar aqu\xed","File URL":"URL del archivo","There's nothing here":"Aqu\xed no hay nada","Try using a different search query.":"Prueba a utilizar una consulta de b\xfasqueda diferente.","Millions of free stock images":"Millones de im\xe1genes de stock gratuitas","Enter a search query and we'll find the perfect image for you":"Ingrese una consulta de b\xfasqueda y encontraremos la imagen perfecta para usted","Millions of icons":"Millones de iconos","Enter a search query and we'll find the perfect icon for you":"Ingrese una consulta de b\xfasqueda y encontraremos el \xedcono perfecto para usted","Enter your query and we will find the right one for you":"Ingrese su consulta y nosotros encontraremos la adecuada para usted","Over 350,000 live images":"M\xe1s de 350,000 im\xe1genes en vivo","The folder will be created in the root directory.":"La carpeta se crear\xe1 en el directorio ra\xedz.",undo:"DESHACER",moved_to_trash_one:"{{count}} elemento movido a la papelera",moved_to_trash_few:"{{count}} elementos movidos a la papelera",moved_to_trash_many:"{{count}} elementos movidos a la papelera",moved_to_trash_other:"{{count}} elementos movidos a la papelera",restored_items_one:"{{count}} elemento restaurado",restored_items_few:"{{count}} elementos restaurados",restored_items_many:"{{count}} elementos restaurados",restored_items_other:"{{count}} elementos restaurados",Type:"Tipo","Generate image":"Generar imagen","A beautiful image of a sunset over a calm ocean.":"Una imagen hermosa de un atardecer sobre un oc\xe9ano tranquilo.","For example:":"Por ejemplo:",Insert:"Insertar",Error:"Error","Upload progress":"Cargando {{completed}}/{{total}}","Uploading files":"Cargando {{completed}}/{{total}} archivos","Uploaded files":"Cargados {{success}} de {{total}} archivos","Upload error files":"Error al cargar {{errorCount}} archivos","Applies to all {{count}} files":"(se aplica a todos los {{count}} archivos)","Some files failed to upload":"Algunos archivos no se pudieron cargar. Verifique el tama\xf1o y el formato de los archivos.",upload_error_hint_invalid_name:"Renombre el archivo: use solo letras, n\xfameros, guiones y guiones bajos.",upload_error_hint_size:"Reduzca el tama\xf1o del archivo o elija otro.",upload_error_hint_format:"Use un formato permitido: JPG, PNG o GIF.",upload_error_hint_exists:"Ya existe un archivo con este nombre en la carpeta. Renombre el archivo.","Images generated successfully":"Im\xe1genes generadas correctamente","Choose for template":"Seleccionar para cargar en la plantilla","Trash is empty":"La papelera est\xe1 vac\xeda","Deleted files will be displayed here":"Los archivos eliminados se mostrar\xe1n aqu\xed","Editing: {{name}}":"Editando: {{name}}","Editing image":"Editando imagen",Save:"Guardar","Loading editor...":"Cargando editor...","Error loading image":"Error al cargar la imagen","Error saving image":"Error al guardar la imagen","Error initializing editor":"Error al inicializar el editor","Close File Manager":"Cerrar administrador de archivos","Are you sure you want to close? Unsaved changes will be lost.":"\xbfEst\xe1 seguro de que desea cerrar? Los cambios no guardados se perder\xe1n.","Are you sure you want to close the file manager?":"\xbfEst\xe1 seguro de que desea cerrar el administrador de archivos?",Close:"Cerrar",KB:"KB","No files":"No hay archivos","Folder is empty or files not found":"La carpeta est\xe1 vac\xeda o no se encontraron archivos","Search files...":"Buscar archivos...",Success:"\xc9xito","Image updated successfully":"Imagen actualizada exitosamente","Failed to save changes":"Error al guardar los cambios: {{error}}","Unknown error":"Error desconocido","Select destination folder":"Seleccione la carpeta de destino","Error moving":"Error al mover","Error deleting":"Error al eliminar","Error copying":"Error al copiar","Error renaming":"Error al renombrar","Failed to refresh folder tree":"Error al actualizar el \xe1rbol de carpetas","Failed to refresh file list":"Error al actualizar la lista de archivos","Errors occurred while moving":"Ocurrieron errores al mover","Errors occurred while copying":"Ocurrieron errores al copiar","(error)":"(error)","(circular reference)":"(referencia circular)","File too large. Maximum size: {{size}}":"El archivo es demasiado grande. Tama\xf1o m\xe1ximo: {{size}}","File too small. Minimum size: {{size}}":"El archivo es demasiado peque\xf1o. Tama\xf1o m\xednimo: {{size}}","Unsupported file type":"Tipo de archivo no admitido","Unsupported file type: {{type}}":"Tipo de archivo no admitido: {{type}}",unknown:"desconocido","Failed to load files":"Error al cargar archivos","DataProvider for folder deletion is not configured":"DataProvider para eliminar carpetas no est\xe1 configurado","DataProvider for file upload is not configured":"DataProvider para cargar archivos no est\xe1 configurado","Error uploading file {{fileName}}":"Error al cargar el archivo {{fileName}}","Error uploading file":"Error al cargar el archivo","Cannot upload files to Trash":"No se pueden cargar archivos a la papelera","Please fill in all fields":"Por favor, complete todos los campos","URL too long":"La URL es demasiado larga","Only http and https URLs are supported":"Solo se admiten URLs con protocolo http y https","Private and local URLs are not allowed":"No se permiten URLs locales ni privadas","Upload by URL is not supported":"La carga por URL no est\xe1 admitida","File name is too long. Maximum {{max}} characters":"El nombre del archivo es demasiado largo. M\xe1ximo {{max}} caracteres","File name contains invalid characters":"El nombre del archivo contiene caracteres no v\xe1lidos","Large file may take a long time to upload":"Un archivo grande puede tardar mucho en cargarse","File unavailable: {{status}} {{statusText}}":"Archivo no disponible: {{status}} {{statusText}}","File too large: {{size}}":"Archivo demasiado grande: {{size}}","Unsupported file type: {{contentType}}":"Tipo de archivo no admitido: {{contentType}}","Invalid server response: folder ID is missing":"Respuesta del servidor inv\xe1lida: falta el ID de la carpeta","Error: folder cannot be its own parent":"Error: la carpeta no puede ser su propio padre","Upload to Trash is forbidden":"Cargar a la papelera est\xe1 prohibido","renameFolder is not implemented in dataProviders":"renameFolder no est\xe1 implementado en dataProviders","renameFile is not implemented in dataProviders":"renameFile no est\xe1 implementado en dataProviders",Clean:"Limpiar","Circular dependency detected: folder cannot be its own parent":"Dependencia circular detectada: la carpeta no puede ser su propio padre","Save as copy and choose":"Guardar como copia y elegir","Save and choose":"Guardar y elegir",pixie:{"added drawing":"Dibujo a\xf1adido","added frame":"Marco a\xf1adido","added image":"Imagen a\xf1adida","added shape":"Forma a\xf1adida","added sticker":"Pegatina a\xf1adida","added text":"Texto a\xf1adido","applied filters":"Filtros aplicados",apply:"Aplicar",background:"Fondo","background color":"Color de fondo",beach:"Playa","brush color":"Color del pincel","brush size":"Tama\xf1o del pincel","brush type":"Tipo de pincel",bubbles:"Burbujas",Cancel:"Cancelar","changed style":"Estilo cambiado","Circle Brush":"C\xedrculo",close:"Cerrar",color:"Color",corners:"Esquinas",crop:"Recortar",Custom:"Personalizado","deleted object":"Objeto eliminado","Diamond Brush":"Diamante",doodles:"Garabatos",draw:"Dibujar",emoticons:"Emoticonos","Eraser Brush":"Borrador",filter:"Filtro",font:"Fuente","font size":"Tama\xf1o de fuente",frame:"Marco",gradient:"Gradiente",height:"Alto",history:"Historial","H Line Brush":"L\xednea H",image:"Imagen",initial:"Inicial",landmarks:"Monumentos","loaded state":"Estado cargado","loading canvas":"Cargando lienzo","loading image":"Cargando imagen","loading state":"Cargando estado","maintain aspect ratio":"Mantener proporci\xf3n",merge:"Fusionar","merged objects":"Objetos fusionados","new text":"Nuevo texto",objects:"Objetos",opacity:"Opacidad",outline:"Contorno","outline color":"Color del contorno","Pencil Brush":"L\xe1piz","processing image":"Procesando imagen",quality:"Calidad",radius:"Radio","replace image":"Reemplazar imagen","replaced background image":"Imagen de fondo reemplazada",resize:"Redimensionar","resized image":"Imagen redimensionada","rounded corner":"Esquina redondeada",save:"Guardar",shadow:"Sombra","shadow color":"Color de la sombra",shapes:"Formas","Spray Brush":"Spray",square:"Cuadrado","Square Brush":"Cuadrado",stickers:"Pegatinas",text:"Texto",texture:"Textura",transportation:"Transporte","V Line Brush":"L\xednea V",width:"Ancho",grayscale:"Escala de grises","black & White":"Blanco y negro",sharpen:"Enfocar",invert:"Invertir",vintage:"Vintage",polaroid:"Polaroid",kodachrome:"Kodachrome",technicolor:"Technicolor",brownie:"Sepia c\xe1lido",sepia:"Sepia","remove Color":"Eliminar color",brightness:"Brillo",gamma:"Gamma",noise:"Ruido",pixelate:"Pixelar",blur:"Desenfocar",emboss:"Relieve","blend Color":"Mezclar color",distance:"Distancia",red:"Rojo",green:"Verde",blue:"Azul",blocksize:"Tama\xf1o de bloque",alpha:"Alfa",add:"A\xf1adir",multiply:"Multiplicar",subtract:"Restar",diff:"Diferencia",screen:"Pantalla",lighten:"Aclarar",darken:"Oscurecer","select an option...":"Seleccione una opci\xf3n..."}}},uk:{translation:{Files:"\u0424\u0430\u0439\u043b\u0438",selected:"\u043e\u0431\u0440\u0430\u043d\u043e",Deselected:"\u0421\u043a\u0430\u0441\u0443\u0432\u0430\u0442\u0438 \u0432\u0438\u0431\u0456\u0440",Refresh:"\u041e\u043d\u043e\u0432\u0438\u0442\u0438","Select all":"\u0412\u0438\u0431\u0440\u0430\u0442\u0438 \u0432\u0441\u0435",Rename:"\u041f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u0443\u0432\u0430\u0442\u0438","Rename file":"\u041f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u0443\u0432\u0430\u0442\u0438 \u0444\u0430\u0439\u043b {{currentFileName}}","Select the destination folder":"\u0412\u0438\u0431\u0435\u0440\u0456\u0442\u044c \u043f\u0430\u043f\u043a\u0443 \u043f\u0440\u0438\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044f","Selected files:":"\u041e\u0431\u0440\u0430\u043d\u043e \u0444\u0430\u0439\u043b\u0456\u0432:","Selected files":"\u041e\u0431\u0440\u0430\u043d\u043e \u0444\u0430\u0439\u043b\u0456\u0432: {{count}}",selected_files_one:"\u041e\u0431\u0440\u0430\u043d\u043e {{count}} \u0444\u0430\u0439\u043b",selected_files_few:"\u041e\u0431\u0440\u0430\u043d\u043e {{count}} \u0444\u0430\u0439\u043b\u0438",selected_files_many:"\u041e\u0431\u0440\u0430\u043d\u043e {{count}} \u0444\u0430\u0439\u043b\u0456\u0432",selected_files_other:"\u041e\u0431\u0440\u0430\u043d\u043e {{count}} \u0444\u0430\u0439\u043b\u0456\u0432",Copy:"\u0414\u0443\u0431\u043b\u044e\u0432\u0430\u0442\u0438",Edit:"\u0417\u043c\u0456\u043d\u0438\u0442\u0438",Move:"\u041f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u0438","Move to":"\u041f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u0438",Delete:"\u0412\u0438\u0434\u0430\u043b\u0438\u0442\u0438","New folder":"\u041d\u043e\u0432\u0430 \u043f\u0430\u043f\u043a\u0430","Image search...":"\u041f\u043e\u0448\u0443\u043a \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u044c...","Search icons":"\u0417\u043d\u0430\u0439\u0442\u0438 \u0456\u043a\u043e\u043d\u043a\u0438","By name":"\u0417\u0430 \u043d\u0430\u0437\u0432\u043e\u044e","By size":"\u0417\u0430 \u0440\u043e\u0437\u043c\u0456\u0440\u043e\u043c","By date":"\u0417\u0430 \u0434\u0430\u0442\u043e\u044e",List:"\u0421\u043f\u0438\u0441\u043e\u043a",Grid:"\u041f\u043b\u0438\u0442\u043a\u0438",Main:"\u0413\u043e\u043b\u043e\u0432\u043d\u0430",Folders:"\u041f\u0430\u043f\u043a\u0438","total pages":"\u0412\u0441\u044c\u043e\u0433\u043e {{total}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432",Name:"\u041d\u0430\u0437\u0432\u0430",Untitled:"\u0411\u0435\u0437 \u043d\u0430\u0437\u0432\u0438",Size:"\u0420\u043e\u0437\u043c\u0456\u0440",Dimensions:"\u0420\u043e\u0437\u043c\u0456\u0440",Date:"\u0414\u0430\u0442\u0430",error:"\u043f\u043e\u043c\u0438\u043b\u043a\u0430",Folder:"\u041f\u0430\u043f\u043a\u0430",created:"\u0441\u0442\u0432\u043e\u0440\u0435\u043d\u0430","Failed to create folder":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0441\u0442\u0432\u043e\u0440\u0438\u0442\u0438 \u043f\u0430\u043f\u043a\u0443","File deleted":"\u0424\u0430\u0439\u043b \u0432\u0438\u0434\u0430\u043b\u0435\u043d\u043e","Error when deleting a file":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043f\u0440\u0438 \u0432\u0438\u0434\u0430\u043b\u0435\u043d\u043d\u0456 \u0444\u0430\u0439\u043b\u0443","Folder deleted":"\u041f\u0430\u043f\u043a\u0443 \u0432\u0438\u0434\u0430\u043b\u0435\u043d\u043e","Error when deleting a folder":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043f\u0440\u0438 \u0432\u0438\u0434\u0430\u043b\u0435\u043d\u043d\u0456 \u043f\u0430\u043f\u043a\u0438","Delete folder":"\u0412\u0438\u0434\u0430\u043b\u0438\u0442\u0438 \u043f\u0430\u043f\u043a\u0443","Are you sure you want to delete this folder? This action will also delete all files and subfolders.":"\u0412\u0438 \u0432\u043f\u0435\u0432\u043d\u0435\u043d\u0456, \u0449\u043e \u0445\u043e\u0447\u0435\u0442\u0435 \u0432\u0438\u0434\u0430\u043b\u0438\u0442\u0438 \u0446\u044e \u043f\u0430\u043f\u043a\u0443? \u0426\u044f \u0434\u0456\u044f \u0442\u0430\u043a\u043e\u0436 \u0432\u0438\u0434\u0430\u043b\u0438\u0442\u044c \u0443\u0441\u0456 \u0444\u0430\u0439\u043b\u0438 \u0442\u0430 \u043f\u0456\u0434\u043f\u0430\u043f\u043a\u0438.","API-endpoint for file upload is not configured":"API-endpoint \u0434\u043b\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0444\u0430\u0439\u043b\u0456\u0432 \u043d\u0435 \u043d\u0430\u043b\u0430\u0448\u0442\u043e\u0432\u0430\u043d\u043e","Please select an image file":"\u0411\u0443\u0434\u044c \u043b\u0430\u0441\u043a\u0430, \u0432\u0438\u0431\u0435\u0440\u0456\u0442\u044c \u0444\u0430\u0439\u043b \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f",File:"\u0424\u0430\u0439\u043b","has been successfully uploaded":"\u0443\u0441\u043f\u0456\u0448\u043d\u043e \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043e","The URL must point to an image":"URL \u043f\u043e\u0432\u0438\u043d\u0435\u043d \u0432\u043a\u0430\u0437\u0443\u0432\u0430\u0442\u0438 \u043d\u0430 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f","Image upload...":"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f...",Unknown:"\u041d\u0435\u0432\u0456\u0434\u043e\u043c\u043e","Error downloading file by URL":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0444\u0430\u0439\u043b\u0443 \u0437\u0430 URL","successfully uploaded":"\u0443\u0441\u043f\u0456\u0448\u043d\u043e \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043e","Error when downloading a file by URL":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043f\u0440\u0438 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u0456 \u0444\u0430\u0439\u043b\u0443 \u0437\u0430 URL","Error when uploading a file":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043f\u0440\u0438 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u0456 \u0444\u0430\u0439\u043b\u0443","Error loading files":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0444\u0430\u0439\u043b\u0456\u0432","File not found":"\u0424\u0430\u0439\u043b \u043d\u0435 \u0437\u043d\u0430\u0439\u0434\u0435\u043d\u043e","File renamed to":"\u0424\u0430\u0439\u043b \u043f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u043e \u043d\u0430 ","Failed to rename the file":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u043f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u0443\u0432\u0430\u0442\u0438 \u0444\u0430\u0439\u043b","Folder renamed to":"\u041f\u0430\u043f\u043a\u0443 \u043f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u043e \u043d\u0430","Rename folder":"\u041f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u0443\u0432\u0430\u0442\u0438 \u043f\u0430\u043f\u043a\u0443","New folder name":"\u041d\u043e\u0432\u0430 \u043d\u0430\u0437\u0432\u0430 \u043f\u0430\u043f\u043a\u0438","Enter a new folder name":"\u0412\u0432\u0435\u0434\u0456\u0442\u044c \u043d\u043e\u0432\u0443 \u043d\u0430\u0437\u0432\u0443 \u043f\u0430\u043f\u043a\u0438","Please drag and drop image files only":"\u0411\u0443\u0434\u044c \u043b\u0430\u0441\u043a\u0430, \u043f\u0435\u0440\u0435\u0442\u044f\u0433\u0443\u0439\u0442\u0435 \u043b\u0438\u0448\u0435 \u0444\u0430\u0439\u043b\u0438 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u044c","Upload file by URL":"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438 \u0444\u0430\u0439\u043b \u0437\u0430 URL","Upload file":"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438 \u0444\u0430\u0439\u043b","Creating a new folder":"\u0421\u0442\u0432\u043e\u0440\u0435\u043d\u043d\u044f \u043d\u043e\u0432\u043e\u0457 \u043f\u0430\u043f\u043a\u0438",Create:"\u0421\u0442\u0432\u043e\u0440\u0438\u0442\u0438",Cancel:"\u0421\u043a\u0430\u0441\u0443\u0432\u0430\u0442\u0438","Folder name":"\u041d\u0430\u0437\u0432\u0430 \u043f\u0430\u043f\u043a\u0438","Enter the name of the folder":"\u0412\u0432\u0435\u0434\u0456\u0442\u044c \u043d\u0430\u0437\u0432\u0443 \u043f\u0430\u043f\u043a\u0438","Enter the name":"\u0412\u0432\u0435\u0434\u0456\u0442\u044c \u043d\u0430\u0437\u0432\u0443","A folder will be created inside:":"\u041f\u0430\u043f\u043a\u0430 \u0431\u0443\u0434\u0435 \u0441\u0442\u0432\u043e\u0440\u0435\u043d\u0430 \u0432\u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0456:","selected folder":"\u043e\u0431\u0440\u0430\u043d\u043e\u0457 \u043f\u0430\u043f\u043a\u0438","The folder will be created in the root directory":"\u041f\u0430\u043f\u043a\u0430 \u0431\u0443\u0434\u0435 \u0441\u0442\u0432\u043e\u0440\u0435\u043d\u0430 \u0432 \u043a\u043e\u0440\u0435\u043d\u0435\u0432\u043e\u043c\u0443 \u043a\u0430\u0442\u0430\u043b\u043e\u0437\u0456","Failed to load folders":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438 \u043f\u0430\u043f\u043a\u0438","Folder name cannot be empty":"\u041d\u0430\u0437\u0432\u0430 \u043f\u0430\u043f\u043a\u0438 \u043d\u0435 \u043c\u043e\u0436\u0435 \u0431\u0443\u0442\u0438 \u043f\u043e\u0440\u043e\u0436\u043d\u044c\u043e\u044e","Folder creation provider is not configured":"\u041f\u043e\u0441\u0442\u0430\u0447\u0430\u043b\u044c\u043d\u0438\u043a \u0441\u0442\u0432\u043e\u0440\u0435\u043d\u043d\u044f \u043f\u0430\u043f\u043e\u043a \u043d\u0435 \u043d\u0430\u043b\u0430\u0448\u0442\u043e\u0432\u0430\u043d\u0438\u0439","Folder created":"\u041f\u0430\u043f\u043a\u0443 \u0441\u0442\u0432\u043e\u0440\u0435\u043d\u043e","Folder rename is disabled by config":"\u041f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u0443\u0432\u0430\u043d\u043d\u044f \u043f\u0430\u043f\u043e\u043a \u0432\u0438\u043c\u043a\u043d\u0435\u043d\u043e \u0432 \u043d\u0430\u043b\u0430\u0448\u0442\u0443\u0432\u0430\u043d\u043d\u044f\u0445","Folder rename provider is not configured":"\u041f\u043e\u0441\u0442\u0430\u0447\u0430\u043b\u044c\u043d\u0438\u043a \u043f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u0443\u0432\u0430\u043d\u043d\u044f \u043f\u0430\u043f\u043e\u043a \u043d\u0435 \u043d\u0430\u043b\u0430\u0448\u0442\u043e\u0432\u0430\u043d\u0438\u0439","Unexpected response when renaming folder":"\u041d\u0435\u043e\u0447\u0456\u043a\u0443\u0432\u0430\u043d\u0430 \u0432\u0456\u0434\u043f\u043e\u0432\u0456\u0434\u044c \u043f\u0456\u0434 \u0447\u0430\u0441 \u043f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u0443\u0432\u0430\u043d\u043d\u044f \u043f\u0430\u043f\u043a\u0438","Folder renamed":"\u041f\u0430\u043f\u043a\u0443 \u043f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u043e","Failed to rename folder":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u043f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u0443\u0432\u0430\u0442\u0438 \u043f\u0430\u043f\u043a\u0443","Failed to load folder items count":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u043e\u0442\u0440\u0438\u043c\u0430\u0442\u0438 \u043a\u0456\u043b\u044c\u043a\u0456\u0441\u0442\u044c \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432 \u0443 \u043f\u0430\u043f\u0446\u0456","Failed to load subfolders":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438 \u043f\u0456\u0434\u043f\u0430\u043f\u043a\u0438",Download:"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438","image URL":"URL \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f","Enter the URL of the image":"\u0412\u0432\u0435\u0434\u0456\u0442\u044c URL \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f","Supported formats: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP":"\u041f\u0456\u0434\u0442\u0440\u0438\u043c\u0443\u0432\u0430\u043d\u0456 \u0444\u043e\u0440\u043c\u0430\u0442\u0438: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP","New file name":"\u041d\u043e\u0432\u0430 \u043d\u0430\u0437\u0432\u0430 \u0444\u0430\u0439\u043b\u0443","Enter a new file name":"\u0412\u0432\u0435\u0434\u0456\u0442\u044c \u043d\u043e\u0432\u0443 \u043d\u0430\u0437\u0432\u0443 \u0444\u0430\u0439\u043b\u0443","Copy to folder":"\u041a\u043e\u043f\u0456\u044e\u0432\u0430\u0442\u0438 \u0432 \u043f\u0430\u043f\u043a\u0443",Added:"\u0414\u043e\u0434\u0430\u043d\u043e {{date}}","File uploaded successfully":"\u0424\u0430\u0439\u043b {{fileName}} \u0443\u0441\u043f\u0456\u0448\u043d\u043e \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043e","Successfully uploaded":"\u0423\u0441\u043f\u0456\u0448\u043d\u043e \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043e {{successCount}} \u0437 {{count}} \u0444\u0430\u0439\u043b\u0443","Successfully uploaded files":"\u0423\u0441\u043f\u0456\u0448\u043d\u043e \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043e {{successCount}} \u0437 {{count}} \u0444\u0430\u0439\u043b\u0456\u0432",uploads_success_summary:"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043e {{successCount}} \u0437 {{totalCount}} \u0444\u0430\u0439\u043b\u0456\u0432",uploads_fail_summary:"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438 {{failCount}} \u0437 {{totalCount}} \u0444\u0430\u0439\u043b\u0456\u0432","File with this name already exists.":"\u0424\u0430\u0439\u043b \u0437 \u0442\u0430\u043a\u043e\u044e \u043d\u0430\u0437\u0432\u043e\u044e \u0432\u0436\u0435 \u0456\u0441\u043d\u0443\u0454.","File not found or no longer available.":"\u0424\u0430\u0439\u043b \u043d\u0435 \u0437\u043d\u0430\u0439\u0434\u0435\u043d\u043e \u0430\u0431\u043e \u0439\u043e\u0433\u043e \u0432\u0436\u0435 \u0432\u0438\u0434\u0430\u043b\u0435\u043d\u043e.","You don't have permission to access this file.":"\u0423 \u0432\u0430\u0441 \u043d\u0435\u043c\u0430\u0454 \u043f\u0440\u0430\u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u0443 \u0434\u043e \u0446\u044c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0443.","File is too large to upload.":"\u0424\u0430\u0439\u043b \u0437\u0430\u043d\u0430\u0434\u0442\u043e \u0432\u0435\u043b\u0438\u043a\u0438\u0439 \u0434\u043b\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f.","File is too large ({{fileSize}}). Maximum allowed size: {{maxSize}}.":"\u0424\u0430\u0439\u043b \u0437\u0430\u043d\u0430\u0434\u0442\u043e \u0432\u0435\u043b\u0438\u043a\u0438\u0439 ({{fileSize}}). \u0414\u043e\u0437\u0432\u043e\u043b\u0435\u043d\u0438\u0439 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0438\u0439 \u0440\u043e\u0437\u043c\u0456\u0440 \u2014 {{maxSize}}.","Maximum number of files exceeded. Allowed: {{allowed}}, received: {{received}}":"\u041f\u0435\u0440\u0435\u0432\u0438\u0449\u0435\u043d\u043e \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0443 \u043a\u0456\u043b\u044c\u043a\u0456\u0441\u0442\u044c \u0444\u0430\u0439\u043b\u0456\u0432. \u0414\u043e\u0437\u0432\u043e\u043b\u0435\u043d\u043e: {{allowed}}, \u043e\u0431\u0440\u0430\u043d\u043e: {{received}}","This file type is not allowed.":"\u0426\u0435\u0439 \u0442\u0438\u043f \u0444\u0430\u0439\u043b\u0443 \u043d\u0435 \u043f\u0456\u0434\u0442\u0440\u0438\u043c\u0443\u0454\u0442\u044c\u0441\u044f.","File name is not valid.":"\u041d\u0435\u043f\u0440\u0438\u043f\u0443\u0441\u0442\u0438\u043c\u0430 \u043d\u0430\u0437\u0432\u0430 \u0444\u0430\u0439\u043b\u0443.","File name is not valid. Allowed characters: {{allowedChars}}":"\u041d\u0435\u043f\u0440\u0438\u043f\u0443\u0441\u0442\u0438\u043c\u0430 \u043d\u0430\u0437\u0432\u0430 \u0444\u0430\u0439\u043b\u0443. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u0456 \u0441\u0438\u043c\u0432\u043e\u043b\u0438: {{allowedChars}}","Failed to read the file.":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u0438 \u0444\u0430\u0439\u043b.","Failed to write the file.":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u0438 \u0444\u0430\u0439\u043b.","The file appears to be corrupted.":"\u0424\u0430\u0439\u043b \u043f\u043e\u0448\u043a\u043e\u0434\u0436\u0435\u043d\u0438\u0439 \u0430\u0431\u043e \u043c\u0430\u0454 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0438\u0439 \u0444\u043e\u0440\u043c\u0430\u0442.","File integrity check failed.":"\u041f\u0435\u0440\u0435\u0432\u0456\u0440\u043a\u0430 \u0446\u0456\u043b\u0456\u0441\u043d\u043e\u0441\u0442\u0456 \u0444\u0430\u0439\u043b\u0443 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u0430\u0441\u044c \u043d\u0435\u0432\u0434\u0430\u043b\u043e.","Folder not found or no longer available.":"\u041f\u0430\u043f\u043a\u0443 \u043d\u0435 \u0437\u043d\u0430\u0439\u0434\u0435\u043d\u043e \u0430\u0431\u043e \u0457\u0457 \u0432\u0436\u0435 \u0432\u0438\u0434\u0430\u043b\u0435\u043d\u043e.","Folder with this name already exists.":"\u041f\u0430\u043f\u043a\u0430 \u0437 \u0442\u0430\u043a\u043e\u044e \u043d\u0430\u0437\u0432\u043e\u044e \u0432\u0436\u0435 \u0456\u0441\u043d\u0443\u0454.","A folder with that name already exists. Please enter a different folder name.":"\u041f\u0430\u043f\u043a\u0430 \u0437 \u0442\u0430\u043a\u043e\u044e \u043d\u0430\u0437\u0432\u043e\u044e \u0432\u0436\u0435 \u0456\u0441\u043d\u0443\u0454. \u0412\u0432\u0435\u0434\u0456\u0442\u044c \u0456\u043d\u0448\u0435 \u0456\u043c'\u044f \u043f\u0430\u043f\u043a\u0438.","You don't have permission to access this folder.":"\u0423 \u0432\u0430\u0441 \u043d\u0435\u043c\u0430\u0454 \u043f\u0440\u0430\u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u0443 \u0434\u043e \u0446\u0456\u0454\u0457 \u043f\u0430\u043f\u043a\u0438.","Folder name is not valid.":"\u041d\u0435\u043f\u0440\u0438\u043f\u0443\u0441\u0442\u0438\u043c\u0430 \u043d\u0430\u0437\u0432\u0430 \u043f\u0430\u043f\u043a\u0438.","Folder name is not valid. Allowed characters: {{allowedChars}}":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0441\u0442\u0432\u043e\u0440\u0438\u0442\u0438 \u043f\u0430\u043f\u043a\u0443. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u0456 \u0441\u0438\u043c\u0432\u043e\u043b\u0438 \u0432 \u043d\u0430\u0437\u0432\u0456 \u043f\u0430\u043f\u043a\u0438: {{allowedChars}}","Failed to read the folder contents.":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u0438 \u0432\u043c\u0456\u0441\u0442 \u043f\u0430\u043f\u043a\u0438.","Failed to write to the folder.":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0432\u0438\u043a\u043e\u043d\u0430\u0442\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0456\u044e \u0437 \u043f\u0430\u043f\u043a\u043e\u044e.","Folder storage quota exceeded.":"\u041f\u0435\u0440\u0435\u0432\u0438\u0449\u0435\u043d\u043e \u043a\u0432\u043e\u0442\u0443 \u0437\u0431\u0435\u0440\u0456\u0433\u0430\u043d\u043d\u044f \u0434\u043b\u044f \u043f\u0430\u043f\u043a\u0438.","Folder is not empty.":"\u041f\u0430\u043f\u043a\u0430 \u043d\u0435 \u043f\u043e\u0440\u043e\u0436\u043d\u044f.","Server error while processing the folder.":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043f\u0456\u0434 \u0447\u0430\u0441 \u043e\u0431\u0440\u043e\u0431\u043a\u0438 \u043f\u0430\u043f\u043a\u0438.","Folder operation took too long.":"\u041e\u043f\u0435\u0440\u0430\u0446\u0456\u044f \u0437 \u043f\u0430\u043f\u043a\u043e\u044e \u0437\u0430\u0439\u043d\u044f\u043b\u0430 \u043d\u0430\u0434\u0442\u043e \u0431\u0430\u0433\u0430\u0442\u043e \u0447\u0430\u0441\u0443.","Network error. Please check your connection and try again.":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043c\u0435\u0440\u0435\u0436\u0456. \u041f\u0435\u0440\u0435\u0432\u0456\u0440\u0442\u0435 \u043f\u0456\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044f \u0434\u043e \u0456\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0443 \u0442\u0430 \u043f\u043e\u0432\u0442\u043e\u0440\u0456\u0442\u044c \u0441\u043f\u0440\u043e\u0431\u0443.","The operation took too long. Please try again.":"\u041e\u043f\u0435\u0440\u0430\u0446\u0456\u044f \u0432\u0438\u043a\u043e\u043d\u0443\u0432\u0430\u043b\u0430\u0441\u044f \u043d\u0430\u0434\u0442\u043e \u0434\u043e\u0432\u0433\u043e. \u0421\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0449\u0435 \u0440\u0430\u0437.","Server error. Please try again later.":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0456. \u041f\u043e\u0432\u0442\u043e\u0440\u0456\u0442\u044c \u0441\u043f\u0440\u043e\u0431\u0443 \u043f\u0456\u0437\u043d\u0456\u0448\u0435.","Service is temporarily unavailable. Please try again later.":"\u0421\u0435\u0440\u0432\u0456\u0441 \u0442\u0438\u043c\u0447\u0430\u0441\u043e\u0432\u043e \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0438\u0439. \u041f\u043e\u0432\u0442\u043e\u0440\u0456\u0442\u044c \u0441\u043f\u0440\u043e\u0431\u0443 \u043f\u0456\u0437\u043d\u0456\u0448\u0435.","Too many requests. Please try again a bit later.":"\u0417\u0430\u043d\u0430\u0434\u0442\u043e \u0431\u0430\u0433\u0430\u0442\u043e \u0437\u0430\u043f\u0438\u0442\u0456\u0432. \u0421\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0449\u0435 \u0440\u0430\u0437 \u043f\u0456\u0437\u043d\u0456\u0448\u0435.","Authentication failed. Please sign in again.":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u043f\u0440\u043e\u0439\u0442\u0438 \u0430\u0432\u0442\u0435\u043d\u0442\u0438\u0444\u0456\u043a\u0430\u0446\u0456\u044e. \u0411\u0443\u0434\u044c \u043b\u0430\u0441\u043a\u0430, \u0443\u0432\u0456\u0439\u0434\u0456\u0442\u044c \u0437\u043d\u043e\u0432\u0443.","You are not allowed to perform this action.":"\u0423 \u0432\u0430\u0441 \u043d\u0435\u043c\u0430\u0454 \u043f\u0440\u0430\u0432 \u0434\u043b\u044f \u0432\u0438\u043a\u043e\u043d\u0430\u043d\u043d\u044f \u0446\u0456\u0454\u0457 \u0434\u0456\u0457.","Some of the provided data is invalid.":"\u0414\u0435\u044f\u043a\u0456 \u0437 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u0438\u0445 \u0434\u0430\u043d\u0438\u0445 \u0454 \u043d\u0435\u043a\u043e\u0440\u0435\u043a\u0442\u043d\u0438\u043c\u0438.","This operation is not supported.":"\u0426\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0456\u044f \u043d\u0435 \u043f\u0456\u0434\u0442\u0440\u0438\u043c\u0443\u0454\u0442\u044c\u0441\u044f.","Request payload is too large.":"\u0422\u0456\u043b\u043e \u0437\u0430\u043f\u0438\u0442\u0443 \u0437\u0430\u043d\u0430\u0434\u0442\u043e \u0432\u0435\u043b\u0438\u043a\u0435.","This media type is not supported.":"\u0426\u0435\u0439 \u0442\u0438\u043f \u0434\u0430\u043d\u0438\u0445 \u043d\u0435 \u043f\u0456\u0434\u0442\u0440\u0438\u043c\u0443\u0454\u0442\u044c\u0441\u044f.","You have exceeded the upload quota.":"\u041f\u0435\u0440\u0435\u0432\u0438\u0449\u0435\u043d\u043e \u043a\u0432\u043e\u0442\u0443 \u043d\u0430 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0444\u0430\u0439\u043b\u0456\u0432.","Network error while uploading the file.":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043c\u0435\u0440\u0435\u0436\u0456 \u043f\u0456\u0434 \u0447\u0430\u0441 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0444\u0430\u0439\u043b\u0443.","File upload took too long.":"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0444\u0430\u0439\u043b\u0443 \u0442\u0440\u0438\u0432\u0430\u043b\u043e \u043d\u0430\u0434\u0442\u043e \u0434\u043e\u0432\u0433\u043e.","Server error while uploading the file.":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043f\u0456\u0434 \u0447\u0430\u0441 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0444\u0430\u0439\u043b\u0443.","The specified URL is not valid.":"\u0412\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0435\u043a\u043e\u0440\u0435\u043a\u0442\u043d\u0443 URL-\u0430\u0434\u0440\u0435\u0441\u0443.","The specified URL is not reachable.":"\u0412\u043a\u0430\u0437\u0430\u043d\u0430 URL-\u0430\u0434\u0440\u0435\u0441\u0430 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430.","Content type at the URL is not allowed.":"\u0422\u0438\u043f \u0432\u043c\u0456\u0441\u0442\u0443 \u0437\u0430 \u0432\u043a\u0430\u0437\u0430\u043d\u043e\u044e URL-\u0430\u0434\u0440\u0435\u0441\u043e\u044e \u043d\u0435 \u043f\u0456\u0434\u0442\u0440\u0438\u043c\u0443\u0454\u0442\u044c\u0441\u044f.","Failed to download file from the URL.":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438 \u0444\u0430\u0439\u043b \u0437\u0430 \u0432\u043a\u0430\u0437\u0430\u043d\u043e\u044e URL-\u0430\u0434\u0440\u0435\u0441\u043e\u044e.","Network error while downloading the file.":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043c\u0435\u0440\u0435\u0436\u0456 \u043f\u0456\u0434 \u0447\u0430\u0441 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0444\u0430\u0439\u043b\u0443.","File download took too long.":"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0444\u0430\u0439\u043b\u0443 \u0442\u0440\u0438\u0432\u0430\u043b\u043e \u043d\u0430\u0434\u0442\u043e \u0434\u043e\u0432\u0433\u043e.","Server error while downloading the file.":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043f\u0456\u0434 \u0447\u0430\u0441 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0444\u0430\u0439\u043b\u0443.","Some items could not be processed.":"\u041d\u0435 \u0432\u0441\u0456 \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0438 \u0431\u0443\u043b\u0438 \u043e\u0431\u0440\u043e\u0431\u043b\u0435\u043d\u0456 \u0443\u0441\u043f\u0456\u0448\u043d\u043e.","Failed to process all items in the batch.":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u043e\u0431\u0440\u043e\u0431\u0438\u0442\u0438 \u0436\u043e\u0434\u0435\u043d \u0435\u043b\u0435\u043c\u0435\u043d\u0442 \u0443 \u043f\u0430\u043a\u0435\u0442\u043d\u0456\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0456\u0457.","Some items in the batch are in a conflicting state.":"\u0414\u0435\u044f\u043a\u0456 \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0438 \u0432 \u043f\u0430\u043a\u0435\u0442\u043d\u0456\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0456\u0457 \u043f\u0435\u0440\u0435\u0431\u0443\u0432\u0430\u044e\u0442\u044c \u0443 \u043a\u043e\u043d\u0444\u043b\u0456\u043a\u0442\u043d\u043e\u043c\u0443 \u0441\u0442\u0430\u043d\u0456.","Some items in the batch did not pass validation.":"\u0414\u0435\u044f\u043a\u0456 \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0438 \u0432 \u043f\u0430\u043a\u0435\u0442\u043d\u0456\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0456\u0457 \u043d\u0435 \u043f\u0440\u043e\u0439\u0448\u043b\u0438 \u0432\u0430\u043b\u0456\u0434\u0430\u0446\u0456\u044e.","AI service returned an invalid response.":"\u0421\u0435\u0440\u0432\u0456\u0441 \u0428\u0406 \u043f\u043e\u0432\u0435\u0440\u043d\u0443\u0432 \u043d\u0435\u043a\u043e\u0440\u0435\u043a\u0442\u043d\u0443 \u0432\u0456\u0434\u043f\u043e\u0432\u0456\u0434\u044c.","Failed to generate image using AI.":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0441\u0442\u0432\u043e\u0440\u0438\u0442\u0438 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f \u0437\u0430 \u0434\u043e\u043f\u043e\u043c\u043e\u0433\u043e\u044e \u0428\u0406.","You have reached the AI image generation limit.":"\u0414\u043e\u0441\u044f\u0433\u043d\u0443\u0442\u043e \u043b\u0456\u043c\u0456\u0442\u0443 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0456\u0457 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u044c \u0428\u0406.","Error in external integration.":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u0443 \u0437\u043e\u0432\u043d\u0456\u0448\u043d\u0456\u0439 \u0456\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0456\u0457.","Error in a third-party service.":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u0443 \u0437\u043e\u0432\u043d\u0456\u0448\u043d\u044c\u043e\u043c\u0443 \u0441\u0435\u0440\u0432\u0456\u0441\u0456.","An unknown error occurred.":"\u0421\u0442\u0430\u043b\u0430\u0441\u044f \u043d\u0435\u0432\u0456\u0434\u043e\u043c\u0430 \u043f\u043e\u043c\u0438\u043b\u043a\u0430.","Renaming is not allowed for this item.":"\u041f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u0443\u0432\u0430\u043d\u043d\u044f \u043d\u0435 \u0434\u043e\u0437\u0432\u043e\u043b\u0435\u043d\u043e \u0434\u043b\u044f \u0446\u044c\u043e\u0433\u043e \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0430.","Moving is not allowed for this item.":"\u041f\u0435\u0440\u0435\u043c\u0456\u0449\u0435\u043d\u043d\u044f \u043d\u0435 \u0434\u043e\u0437\u0432\u043e\u043b\u0435\u043d\u043e \u0434\u043b\u044f \u0446\u044c\u043e\u0433\u043e \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0430.","Copying is not allowed for this item.":"\u041a\u043e\u043f\u0456\u044e\u0432\u0430\u043d\u043d\u044f \u043d\u0435 \u0434\u043e\u0437\u0432\u043e\u043b\u0435\u043d\u043e \u0434\u043b\u044f \u0446\u044c\u043e\u0433\u043e \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0430.","Deleting is not allowed for this item.":"\u0412\u0438\u0434\u0430\u043b\u0435\u043d\u043d\u044f \u043d\u0435 \u0434\u043e\u0437\u0432\u043e\u043b\u0435\u043d\u043e \u0434\u043b\u044f \u0446\u044c\u043e\u0433\u043e \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0430.","Cannot move an item into itself.":"\u041d\u0435 \u043c\u043e\u0436\u043d\u0430 \u043f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u0438 \u0435\u043b\u0435\u043c\u0435\u043d\u0442 \u0443 \u0441\u0430\u043c\u043e\u0433\u043e \u0441\u0435\u0431\u0435.","Cannot move an item into its descendant folder.":"\u041d\u0435 \u043c\u043e\u0436\u043d\u0430 \u043f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u0438 \u0435\u043b\u0435\u043c\u0435\u043d\u0442 \u0443 \u0434\u043e\u0447\u0456\u0440\u043d\u044e \u043f\u0430\u043f\u043a\u0443.","Cannot copy an item into itself.":"\u041d\u0435 \u043c\u043e\u0436\u043d\u0430 \u0441\u043a\u043e\u043f\u0456\u044e\u0432\u0430\u0442\u0438 \u0435\u043b\u0435\u043c\u0435\u043d\u0442 \u0443 \u0441\u0430\u043c\u043e\u0433\u043e \u0441\u0435\u0431\u0435.","Configuration error occurred.":"\u0421\u0442\u0430\u043b\u0430\u0441\u044f \u043f\u043e\u043c\u0438\u043b\u043a\u0430 \u043a\u043e\u043d\u0444\u0456\u0433\u0443\u0440\u0430\u0446\u0456\u0457.","Storage quota exceeded. Please free up space.":"\u041f\u0435\u0440\u0435\u0432\u0438\u0449\u0435\u043d\u043e \u043a\u0432\u043e\u0442\u0443 \u0441\u0445\u043e\u0432\u0438\u0449\u0430. \u0417\u0432\u0456\u043b\u044c\u043d\u0456\u0442\u044c \u043c\u0456\u0441\u0446\u0435.","File is locked by another process or user.":"\u0424\u0430\u0439\u043b \u0437\u0430\u0431\u043b\u043e\u043a\u043e\u0432\u0430\u043d\u043e \u0456\u043d\u0448\u0438\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u043e\u043c \u0430\u0431\u043e \u043a\u043e\u0440\u0438\u0441\u0442\u0443\u0432\u0430\u0447\u0435\u043c.","File version conflict. Please refresh and try again.":"\u041a\u043e\u043d\u0444\u043b\u0456\u043a\u0442 \u0432\u0435\u0440\u0441\u0456\u0439 \u0444\u0430\u0439\u043b\u0443. \u041e\u043d\u043e\u0432\u0456\u0442\u044c \u0441\u0442\u043e\u0440\u0456\u043d\u043a\u0443 \u0442\u0430 \u0441\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0449\u0435 \u0440\u0430\u0437.","Batch operation exceeds the maximum number of items allowed.":"\u041f\u0430\u043a\u0435\u0442\u043d\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0456\u044f \u043f\u0435\u0440\u0435\u0432\u0438\u0449\u0443\u0454 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u0443 \u043a\u0456\u043b\u044c\u043a\u0456\u0441\u0442\u044c \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432.",Moved:"\u041f\u0435\u0440\u0435\u043c\u0456\u0449\u0435\u043d\u043e: {{names}}",move_success_summary:"\u041f\u0435\u0440\u0435\u043c\u0456\u0449\u0435\u043d\u043e {{successCount}} \u0437 {{totalCount}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432",move_fail_summary:"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u043f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u0438 {{failCount}} \u0437 {{totalCount}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432",Copied:"\u0421\u043a\u043e\u043f\u0456\u0439\u043e\u0432\u0430\u043d\u043e: {{names}}",copy_success_summary:"\u0421\u043a\u043e\u043f\u0456\u0439\u043e\u0432\u0430\u043d\u043e {{successCount}} \u0437 {{totalCount}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432",copy_fail_summary:"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0441\u043a\u043e\u043f\u0456\u044e\u0432\u0430\u0442\u0438 {{failCount}} \u0437 {{totalCount}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432",Uploaded:"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043e: {{names}}",Failed:"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438: {{names}}","Failed to upload":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438 {{failCount}} \u0437 {{count}} \u0444\u0430\u0439\u043b\u0443","Failed to upload files":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438 {{failCount}} \u0437 {{count}} \u0444\u0430\u0439\u043b\u0456\u0432",months:{january:"\u0441\u0456\u0447\u043d\u044f",february:"\u043b\u044e\u0442\u043e\u0433\u043e",march:"\u0431\u0435\u0440\u0435\u0437\u043d\u044f",april:"\u043a\u0432\u0456\u0442\u043d\u044f",may:"\u0442\u0440\u0430\u0432\u043d\u044f",june:"\u0447\u0435\u0440\u0432\u043d\u044f",july:"\u043b\u0438\u043f\u043d\u044f",august:"\u0441\u0435\u0440\u043f\u043d\u044f",september:"\u0432\u0435\u0440\u0435\u0441\u043d\u044f",october:"\u0436\u043e\u0432\u0442\u043d\u044f",november:"\u043b\u0438\u0441\u0442\u043e\u043f\u0430\u0434\u0430",december:"\u0433\u0440\u0443\u0434\u043d\u044f"},files:"\u0444\u0430\u0439\u043b\u0456\u0432","No available folders":"\u041d\u0435\u043c\u0430\u0454 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0438\u0445 \u043f\u0430\u043f\u043e\u043a","My files":"\u041c\u043e\u0457 \u0444\u0430\u0439\u043b\u0438",GIF:"GIF","Stock images":"\u0421\u0442\u043e\u043a\u043e\u0432\u0456 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f",AI:"AI","AI image generation":"AI \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0456\u044f \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u044c","Search GIFs":"\u0417\u043d\u0430\u0439\u0442\u0438 GIF","That`s all we could find.":"\u0426\u0435 \u0432\u0441\u0435, \u0449\u043e \u043c\u0438 \u0437\u043c\u043e\u0433\u043b\u0438 \u0437\u043d\u0430\u0439\u0442\u0438.","Search image":"\u0417\u043d\u0430\u0439\u0442\u0438 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f",All:"\u0412\u0441\u0456",Landscape:"\u0413\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u0456",Portrait:"\u0412\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u0456",Squarish:"\u041a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u0456",Black:"\u0427\u043e\u0440\u043d\u0438\u0439","Black and White":"\u0427\u043e\u0440\u043d\u043e-\u0431\u0456\u043b\u0438\u0439",White:"\u0411\u0456\u043b\u0438\u0439",Orange:"\u041f\u043e\u043c\u0430\u0440\u0430\u043d\u0447\u0435\u0432\u0438\u0439",Red:"\u0427\u0435\u0440\u0432\u043e\u043d\u0438\u0439",Purple:"\u0424\u0456\u043e\u043b\u0435\u0442\u043e\u0432\u0438\u0439",Magenta:"\u041f\u0443\u0440\u043f\u0443\u0440\u043d\u0438\u0439",Green:"\u0417\u0435\u043b\u0435\u043d\u0438\u0439",Teal:"\u0411\u0456\u0440\u044e\u0437\u043e\u0432\u0438\u0439",Blue:"\u0421\u0438\u043d\u0456\u0439","Photo by":"\u0424\u043e\u0442\u043e",on:"\u043d\u0430","File Manager":"\u0424\u0430\u0439\u043b\u043e\u0432\u0438\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440","File Manager not configured":"\u0424\u0430\u0439\u043b\u043e\u0432\u0438\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u043d\u0435 \u043d\u0430\u043b\u0430\u0448\u0442\u043e\u0432\u0430\u043d\u043e","Filter by type":"\u0424\u0456\u043b\u044c\u0442\u0440 \u0437\u0430 \u0442\u0438\u043f\u043e\u043c","All types":"\u0412\u0441\u0456 \u0442\u0438\u043f\u0438","File name":"\u041d\u0430\u0437\u0432\u0430 \u0444\u0430\u0439\u043b\u0443",Actions:"\u0414\u0456\u0457","Add file":"\u0414\u043e\u0434\u0430\u0442\u0438 \u0444\u0430\u0439\u043b","Add folder":"\u0414\u043e\u0434\u0430\u0442\u0438 \u043f\u0430\u043f\u043a\u0443","Add file by URL":"\u0414\u043e\u0434\u0430\u0442\u0438 \u0444\u0430\u0439\u043b \u0437\u0430 URL","File moved":"\u0424\u0430\u0439\u043b \u043f\u0435\u0440\u0435\u043c\u0456\u0449\u0435\u043d\u043e","Error when moving a file":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u043c\u0456\u0449\u0435\u043d\u043d\u0456 \u0444\u0430\u0439\u043b\u0443","Failed to download file":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438 \u0444\u0430\u0439\u043b","Failed to load JSON data":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438 \u0434\u0430\u043d\u0456 JSON","Invalid file URL":"\u041d\u0435\u043a\u043e\u0440\u0435\u043a\u0442\u043d\u0438\u0439 URL \u0444\u0430\u0439\u043b\u0443","Unable to validate file URL":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u043f\u0435\u0440\u0435\u0432\u0456\u0440\u0438\u0442\u0438 \u0444\u0430\u0439\u043b \u0437\u0430 URL","Type to search...":"\u0412\u0432\u0435\u0434\u0456\u0442\u044c \u0434\u043b\u044f \u043f\u043e\u0448\u0443\u043a\u0443...",Submit:"\u041d\u0430\u0434\u0456\u0441\u043b\u0430\u0442\u0438","No folders yet":"\u041f\u0430\u043f\u043e\u043a \u043f\u043e\u043a\u0438 \u043d\u0435\u043c\u0430\u0454","Drag files to upload":"\u041f\u0435\u0440\u0435\u0442\u044f\u0433\u043d\u0456\u0442\u044c \u0444\u0430\u0439\u043b\u0438 \u0434\u043b\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f","Drop files here to upload":"\u0412\u0456\u0434\u043f\u0443\u0441\u0442\u0456\u0442\u044c \u0444\u0430\u0439\u043b\u0438 \u0442\u0443\u0442, \u0449\u043e\u0431 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438 \u0457\u0445","Newest first":"\u0421\u043f\u043e\u0447\u0430\u0442\u043a\u0443 \u043d\u043e\u0432\u0456","Oldest first":"\u0421\u043f\u043e\u0447\u0430\u0442\u043a\u0443 \u0441\u0442\u0430\u0440\u0456","Largest first":"\u0421\u043f\u043e\u0447\u0430\u0442\u043a\u0443 \u0432\u0435\u043b\u0438\u043a\u0456","Smallest first":"\u0421\u043f\u043e\u0447\u0430\u0442\u043a\u0443 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0456","A-Z":"\u0417\u0430 \u0430\u043b\u0444\u0430\u0432\u0456\u0442\u043e\u043c \u0410-\u042f","Z-A":"\u0417\u0430 \u0430\u043b\u0444\u0430\u0432\u0456\u0442\u043e\u043c \u042f-\u0410","By type":"\u0417\u0430 \u0442\u0438\u043f\u043e\u043c","Evaluating the task":"\u041e\u0446\u0456\u043d\u043a\u0430 \u0437\u0430\u0432\u0434\u0430\u043d\u043d\u044f","Something went wrong, please try again":"\u0429\u043e\u0441\u044c \u043f\u0456\u0448\u043b\u043e \u043d\u0435 \u0442\u0430\u043a, \u0431\u0443\u0434\u044c \u043b\u0430\u0441\u043a\u0430, \u0441\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0449\u0435 \u0440\u0430\u0437","Sort by":"\u0421\u043e\u0440\u0442\u0443\u0432\u0430\u0442\u0438 \u0437\u0430","preview text":"\u0417\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0443\u0454\u0442\u044c\u0441\u044f ...","Use this variant":"\u0412\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u0430\u0442\u0438 \u0446\u0435\u0439 \u0432\u0430\u0440\u0456\u0430\u043d\u0442","Confirm deletion":"\u041f\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0438 \u0432\u0438\u0434\u0430\u043b\u0435\u043d\u043d\u044f","Are you sure you want to delete the selected items?":"\u0412\u0438 \u0432\u043f\u0435\u0432\u043d\u0435\u043d\u0456, \u0449\u043e \u0445\u043e\u0447\u0435\u0442\u0435 \u0432\u0438\u0434\u0430\u043b\u0438\u0442\u0438 \u043e\u0431\u0440\u0430\u043d\u0456 \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0438?","Move to Trash":"\u041f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u0438 \u0432 \u043a\u043e\u0448\u0438\u043a","Are you sure you want to move the selected items to the Trash?":"\u0412\u0438 \u0432\u043f\u0435\u0432\u043d\u0435\u043d\u0456, \u0449\u043e \u0445\u043e\u0447\u0435\u0442\u0435 \u043f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u0438 \u043e\u0431\u0440\u0430\u043d\u0456 \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0438 \u0432 \u043a\u043e\u0448\u0438\u043a?","Permanently delete":"\u041f\u043e\u0432\u043d\u0435 \u0432\u0438\u0434\u0430\u043b\u0435\u043d\u043d\u044f","Delete permanently":"\u0412\u0438\u0434\u0430\u043b\u0438\u0442\u0438 \u0431\u0435\u0437\u043f\u043e\u0432\u043e\u0440\u043e\u0442\u043d\u043e","Are you sure you want to permanently delete the selected items? This action cannot be undone.":"\u0412\u0438 \u0432\u043f\u0435\u0432\u043d\u0435\u043d\u0456, \u0449\u043e \u0445\u043e\u0447\u0435\u0442\u0435 \u0431\u0435\u0437\u043f\u043e\u0432\u043e\u0440\u043e\u0442\u043d\u043e \u0432\u0438\u0434\u0430\u043b\u0438\u0442\u0438 \u043e\u0431\u0440\u0430\u043d\u0456 \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0438? \u0426\u044e \u0434\u0456\u044e \u043d\u0435 \u043c\u043e\u0436\u043d\u0430 \u0441\u043a\u0430\u0441\u0443\u0432\u0430\u0442\u0438.",Clear:"\u041e\u0447\u0438\u0441\u0442\u0438\u0442\u0438","Clear Trash":"\u041e\u0447\u0438\u0441\u0442\u0438\u0442\u0438 \u043a\u043e\u0448\u0438\u043a","Are you sure you want to permanently delete all items from Trash?":"\u0412\u0438 \u0432\u043f\u0435\u0432\u043d\u0435\u043d\u0456, \u0449\u043e \u0445\u043e\u0447\u0435\u0442\u0435 \u0431\u0435\u0437\u043f\u043e\u0432\u043e\u0440\u043e\u0442\u043d\u043e \u0432\u0438\u0434\u0430\u043b\u0438\u0442\u0438 \u0432\u0441\u0456 \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0438 \u0437 \u043a\u043e\u0448\u0438\u043a\u0430?","Trash cleared successfully":"\u041a\u043e\u0448\u0438\u043a \u0443\u0441\u043f\u0456\u0448\u043d\u043e \u043e\u0447\u0438\u0449\u0435\u043d\u043e","{{count}} items permanently deleted":"{{count}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432 \u0431\u0435\u0437\u043f\u043e\u0432\u043e\u0440\u043e\u0442\u043d\u043e \u0432\u0438\u0434\u0430\u043b\u0435\u043d\u043e","Trash partially cleared":"\u041a\u043e\u0448\u0438\u043a \u0447\u0430\u0441\u0442\u043a\u043e\u0432\u043e \u043e\u0447\u0438\u0449\u0435\u043d\u043e","{{succeeded}} items deleted, {{failed}} items failed":"{{succeeded}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432 \u0432\u0438\u0434\u0430\u043b\u0435\u043d\u043e, {{failed}} \u043d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0432\u0438\u0434\u0430\u043b\u0438\u0442\u0438","Failed to clear trash":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u043e\u0447\u0438\u0441\u0442\u0438\u0442\u0438 \u043a\u043e\u0448\u0438\u043a","Error clearing trash":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043f\u0440\u0438 \u043e\u0447\u0438\u0449\u0435\u043d\u043d\u0456 \u043a\u043e\u0448\u0438\u043a\u0430","Deleting items...":"\u0412\u0438\u0434\u0430\u043b\u0435\u043d\u043d\u044f \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432...",delete_files_permanent_one:"\u0426\u044f \u0434\u0456\u044f \u0431\u0435\u0437\u043f\u043e\u0432\u043e\u0440\u043e\u0442\u043d\u043e \u0432\u0438\u0434\u0430\u043b\u0438\u0442\u044c {{count}} \u0444\u0430\u0439\u043b",delete_files_permanent_few:"\u0426\u044f \u0434\u0456\u044f \u0431\u0435\u0437\u043f\u043e\u0432\u043e\u0440\u043e\u0442\u043d\u043e \u0432\u0438\u0434\u0430\u043b\u0438\u0442\u044c {{count}} \u0444\u0430\u0439\u043b\u0438",delete_files_permanent_many:"\u0426\u044f \u0434\u0456\u044f \u0431\u0435\u0437\u043f\u043e\u0432\u043e\u0440\u043e\u0442\u043d\u043e \u0432\u0438\u0434\u0430\u043b\u0438\u0442\u044c {{count}} \u0444\u0430\u0439\u043b\u0456\u0432",delete_files_permanent_other:"\u0426\u044f \u0434\u0456\u044f \u0431\u0435\u0437\u043f\u043e\u0432\u043e\u0440\u043e\u0442\u043d\u043e \u0432\u0438\u0434\u0430\u043b\u0438\u0442\u044c {{count}} \u0444\u0430\u0439\u043b\u0456\u0432",delete_folder_permanent:"\u0426\u044f \u0434\u0456\u044f \u0431\u0435\u0437\u043f\u043e\u0432\u043e\u0440\u043e\u0442\u043d\u043e \u0432\u0438\u0434\u0430\u043b\u0438\u0442\u044c \u043f\u0430\u043f\u043a\u0443 \xab{{name}}\xbb \u0456 \u0432\u0441\u0435 \u0457\u0457 \u0432\u043c\u0456\u0441\u0442, \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0447\u0438 {{count}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432.",delete_mixed_permanent:"\u0426\u044f \u0434\u0456\u044f \u0431\u0435\u0437\u043f\u043e\u0432\u043e\u0440\u043e\u0442\u043d\u043e \u0432\u0438\u0434\u0430\u043b\u0438\u0442\u044c {{total}} \u043e\u0431\u0440\u0430\u043d\u0438\u0445 \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432, \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0447\u0438 {{folders}} \u043f\u0430\u043f\u043e\u043a \u0456 \u0432\u0441\u0456 {{images}} \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u044c \u0432\u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0456 \u043d\u0438\u0445.",permanent_delete_warning:"\u0412\u0438\u0434\u0430\u043b\u0435\u043d\u043d\u044f \u0444\u0430\u0439\u043b\u0456\u0432, \u044f\u043a\u0456 \u0431\u0443\u043b\u0438 \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u0430\u043d\u0456 \u0432 \u043b\u0438\u0441\u0442\u0430\u0445, \u043f\u0440\u0438\u0437\u0432\u0435\u0434\u0435 \u0434\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0437 \u0432\u0456\u0434\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f\u043c \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u044c \u0443 \u0441\u0442\u0430\u0440\u0438\u0445 \u043b\u0438\u0441\u0442\u0430\u0445. \u0412\u0438 \u0432\u043f\u0435\u0432\u043d\u0435\u043d\u0456, \u0449\u043e \u0445\u043e\u0447\u0435\u0442\u0435 \u043f\u043e\u0432\u043d\u0456\u0441\u0442\u044e \u0432\u0438\u0434\u0430\u043b\u0438\u0442\u0438 \u043e\u0431\u0440\u0430\u043d\u0435?",move_files_to_trash_one:"\u0426\u044f \u0434\u0456\u044f \u043f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u044c \u0443 \u043a\u043e\u0448\u0438\u043a {{count}} \u0444\u0430\u0439\u043b.",move_files_to_trash_few:"\u0426\u044f \u0434\u0456\u044f \u043f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u044c \u0443 \u043a\u043e\u0448\u0438\u043a {{count}} \u0444\u0430\u0439\u043b\u0438.",move_files_to_trash_many:"\u0426\u044f \u0434\u0456\u044f \u043f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u044c \u0443 \u043a\u043e\u0448\u0438\u043a {{count}} \u0444\u0430\u0439\u043b\u0456\u0432.",move_files_to_trash_other:"\u0426\u044f \u0434\u0456\u044f \u043f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u044c \u0443 \u043a\u043e\u0448\u0438\u043a {{count}} \u0444\u0430\u0439\u043b\u0456\u0432.",move_folder_to_trash:"\u0426\u044f \u0434\u0456\u044f \u043f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u044c \u0443 \u043a\u043e\u0448\u0438\u043a \u043f\u0430\u043f\u043a\u0443 \xab{{name}}\xbb \u0456 \u0432\u0441\u0435 \u0457\u0457 \u0432\u043c\u0456\u0441\u0442 ({{count}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432).",move_mixed_to_trash:"\u0426\u044f \u0434\u0456\u044f \u043f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u044c \u0443 \u043a\u043e\u0448\u0438\u043a {{total}} \u043e\u0431\u0440\u0430\u043d\u0438\u0445 \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432, \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0447\u0438 {{folders}} \u043f\u0430\u043f\u043e\u043a \u0456 {{images}} \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u044c.",delete_count_confirm_trash_one:"\u041f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u0438 \u0432 \u043a\u043e\u0448\u0438\u043a {{count}} \u0444\u0430\u0439\u043b?",delete_count_confirm_trash_few:"\u041f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u0438 \u0432 \u043a\u043e\u0448\u0438\u043a {{count}} \u0444\u0430\u0439\u043b\u0438?",delete_count_confirm_trash_many:"\u041f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u0438 \u0432 \u043a\u043e\u0448\u0438\u043a {{count}} \u0444\u0430\u0439\u043b\u0456\u0432?",delete_count_confirm_trash_other:"\u041f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u0438 \u0432 \u043a\u043e\u0448\u0438\u043a {{count}} \u0444\u0430\u0439\u043b\u0456\u0432?",delete_count_confirm_permanent_one:"\u0412\u0438\u0434\u0430\u043b\u0438\u0442\u0438 \u043d\u0430\u0437\u0430\u0432\u0436\u0434\u0438 {{count}} \u0444\u0430\u0439\u043b?",delete_count_confirm_permanent_few:"\u0412\u0438\u0434\u0430\u043b\u0438\u0442\u0438 \u043d\u0430\u0437\u0430\u0432\u0436\u0434\u0438 {{count}} \u0444\u0430\u0439\u043b\u0438?",delete_count_confirm_permanent_many:"\u0412\u0438\u0434\u0430\u043b\u0438\u0442\u0438 \u043d\u0430\u0437\u0430\u0432\u0436\u0434\u0438 {{count}} \u0444\u0430\u0439\u043b\u0456\u0432?",delete_count_confirm_permanent_other:"\u0412\u0438\u0434\u0430\u043b\u0438\u0442\u0438 \u043d\u0430\u0437\u0430\u0432\u0436\u0434\u0438 {{count}} \u0444\u0430\u0439\u043b\u0456\u0432?",delete_count_confirm_one:"\u0412\u0438\u0434\u0430\u043b\u0438\u0442\u0438 {{count}} \u0444\u0430\u0439\u043b?",delete_count_confirm_few:"\u0412\u0438\u0434\u0430\u043b\u0438\u0442\u0438 {{count}} \u0444\u0430\u0439\u043b\u0438?",delete_count_confirm_many:"\u0412\u0438\u0434\u0430\u043b\u0438\u0442\u0438 {{count}} \u0444\u0430\u0439\u043b\u0456\u0432?",delete_count_confirm_other:"\u0412\u0438\u0434\u0430\u043b\u0438\u0442\u0438 {{count}} \u0444\u0430\u0439\u043b\u0456\u0432?",item:"\u0444\u0430\u0439\u043b",items:"\u0444\u0430\u0439\u043b\u0456\u0432",Trash:"\u0412\u0438\u0434\u0430\u043b\u0435\u043d\u0456",Choose:"\u041e\u0431\u0440\u0430\u0442\u0438",Stock:"\u0424\u043e\u0442\u043e\u0441\u0442\u043e\u043a","Select an image from our library":"\u0412\u0438\u0431\u0435\u0440\u0456\u0442\u044c \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f \u0437 \u043d\u0430\u0448\u043e\u0457 \u0431\u0456\u0431\u043b\u0456\u043e\u0442\u0435\u043a\u0438","AI generation":"AI \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0456\u044f","Creating an image on demand":"\u0421\u0442\u0432\u043e\u0440\u0435\u043d\u043d\u044f \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f \u043d\u0430 \u0437\u0430\u043c\u043e\u0432\u043b\u0435\u043d\u043d\u044f","Search file or folder":"\u0417\u043d\u0430\u0439\u0442\u0438 \u0444\u0430\u0439\u043b \u0430\u0431\u043e \u043f\u0430\u043f\u043a\u0443","Click here to select a file":"\u041d\u0430\u0442\u0438\u0441\u043d\u0456\u0442\u044c \u0442\u0443\u0442, \u0449\u043e\u0431 \u0432\u0438\u0431\u0440\u0430\u0442\u0438 \u0444\u0430\u0439\u043b","Supported files:":"\u041f\u0456\u0434\u0442\u0440\u0438\u043c\u0443\u0432\u0430\u043d\u0456 \u0444\u0430\u0439\u043b\u0438:","Create folder":"\u0421\u0442\u0432\u043e\u0440\u0438\u0442\u0438 \u043f\u0430\u043f\u043a\u0443",Done:"\u0413\u043e\u0442\u043e\u0432\u043e","Move here":"\u041f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u0438 \u0441\u044e\u0434\u0438","Copy here":"\u041a\u043e\u043f\u0456\u044e\u0432\u0430\u0442\u0438 \u0441\u044e\u0434\u0438","File URL":"URL \u0444\u0430\u0439\u043b\u0443","There's nothing here":"\u0422\u0443\u0442 \u043d\u0456\u0447\u043e\u0433\u043e \u043d\u0435\u043c\u0430\u0454","Try using a different search query.":"\u0421\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0432\u0430\u0442\u0438 \u0456\u043d\u0448\u0438\u0439 \u043f\u043e\u0448\u0443\u043a\u043e\u0432\u0438\u0439 \u0437\u0430\u043f\u0438\u0442.","Millions of free stock images":"\u041c\u0456\u043b\u044c\u0439\u043e\u043d\u0438 \u0431\u0435\u0437\u043a\u043e\u0448\u0442\u043e\u0432\u043d\u0438\u0445 \u0441\u0442\u043e\u043a\u043e\u0432\u0438\u0445 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u044c","Enter a search query and we'll find the perfect image for you":"\u0412\u0432\u0435\u0434\u0456\u0442\u044c \u043f\u043e\u0448\u0443\u043a\u043e\u0432\u0438\u0439 \u0437\u0430\u043f\u0438\u0442, \u0456 \u043c\u0438 \u0437\u043d\u0430\u0439\u0434\u0435\u043c\u043e \u0434\u043b\u044f \u0432\u0430\u0441 \u0456\u0434\u0435\u0430\u043b\u044c\u043d\u0435 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f","Millions of icons":"\u041c\u0456\u043b\u044c\u0439\u043e\u043d\u0438 \u0456\u043a\u043e\u043d\u043e\u043a","Enter a search query and we'll find the perfect icon for you":"\u0412\u0432\u0435\u0434\u0456\u0442\u044c \u043f\u043e\u0448\u0443\u043a\u043e\u0432\u0438\u0439 \u0437\u0430\u043f\u0438\u0442, \u0456 \u043c\u0438 \u0437\u043d\u0430\u0439\u0434\u0435\u043c\u043e \u0434\u043b\u044f \u0432\u0430\u0441 \u0456\u0434\u0435\u0430\u043b\u044c\u043d\u0443 \u0456\u043a\u043e\u043d\u043a\u0443","Enter your query and we will find the right one for you":"\u0412\u0432\u0435\u0434\u0456\u0442\u044c \u0437\u0430\u043f\u0438\u0442 \u0456 \u043c\u0438 \u0437\u043d\u0430\u0439\u0434\u0435\u043c\u043e \u0434\u043b\u044f \u0432\u0430\u0441 \u0432\u0456\u0434\u043f\u043e\u0432\u0456\u0434\u043d\u0435","Over 350,000 live images":"\u041f\u043e\u043d\u0430\u0434 350 000 \u0436\u0438\u0432\u0438\u0445 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u044c","The folder will be created in the root directory.":"\u041f\u0430\u043f\u043a\u0430 \u0431\u0443\u0434\u0435 \u0441\u0442\u0432\u043e\u0440\u0435\u043d\u0430 \u0432 \u043a\u043e\u0440\u0435\u043d\u0435\u0432\u043e\u043c\u0443 \u043a\u0430\u0442\u0430\u043b\u043e\u0437\u0456.",undo:"\u0421\u041a\u0410\u0421\u0423\u0412\u0410\u0422\u0418",moved_to_trash_one:"\u041f\u0435\u0440\u0435\u043c\u0456\u0449\u0435\u043d\u043e {{count}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442 \u0443 \u043a\u043e\u0448\u0438\u043a",moved_to_trash_few:"\u041f\u0435\u0440\u0435\u043c\u0456\u0449\u0435\u043d\u043e {{count}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0438 \u0443 \u043a\u043e\u0448\u0438\u043a",moved_to_trash_many:"\u041f\u0435\u0440\u0435\u043c\u0456\u0449\u0435\u043d\u043e {{count}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432 \u0443 \u043a\u043e\u0448\u0438\u043a",moved_to_trash_other:"\u041f\u0435\u0440\u0435\u043c\u0456\u0449\u0435\u043d\u043e {{count}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432 \u0443 \u043a\u043e\u0448\u0438\u043a",restored_items_one:"\u0412\u0456\u0434\u043d\u043e\u0432\u043b\u0435\u043d\u043e {{count}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442",restored_items_few:"\u0412\u0456\u0434\u043d\u043e\u0432\u043b\u0435\u043d\u043e {{count}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0438",restored_items_many:"\u0412\u0456\u0434\u043d\u043e\u0432\u043b\u0435\u043d\u043e {{count}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432",restored_items_other:"\u0412\u0456\u0434\u043d\u043e\u0432\u043b\u0435\u043d\u043e {{count}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432",Type:"\u0422\u0438\u043f","Generate image":"\u0421\u0442\u0432\u043e\u0440\u0438\u0442\u0438 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f","A beautiful image of a sunset over a calm ocean.":"\u041a\u0440\u0430\u0441\u0438\u0432\u0435 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f \u0437\u0430\u0445\u043e\u0434\u0443 \u0441\u043e\u043d\u0446\u044f \u043d\u0430\u0434 \u0441\u043f\u043e\u043a\u0456\u0439\u043d\u0438\u043c \u043e\u043a\u0435\u0430\u043d\u043e\u043c.","For example:":"\u041d\u0430\u043f\u0440\u0438\u043a\u043b\u0430\u0434:",Insert:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u0438",Error:"\u041f\u043e\u043c\u0438\u043b\u043a\u0430","Upload progress":"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f {{completed}}/{{total}}","Uploading files":"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f {{completed}}/{{total}} \u0444\u0430\u0439\u043b\u0456\u0432","Uploaded files":"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043e {{success}} \u0437 {{total}} \u0444\u0430\u0439\u043b\u0456\u0432","Upload error files":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f {{errorCount}} \u0444\u0430\u0439\u043b\u0456\u0432","Applies to all {{count}} files":"(\u0441\u0442\u043e\u0441\u0443\u0454\u0442\u044c\u0441\u044f \u0432\u0441\u0456\u0445 {{count}} \u0444\u0430\u0439\u043b\u0456\u0432)","Some files failed to upload":"\u0414\u0435\u044f\u043a\u0456 \u0444\u0430\u0439\u043b\u0438 \u043d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438. \u041f\u0435\u0440\u0435\u0432\u0456\u0440\u0442\u0435 \u0440\u043e\u0437\u043c\u0456\u0440 \u0442\u0430 \u0444\u043e\u0440\u043c\u0430\u0442 \u0444\u0430\u0439\u043b\u0456\u0432.",upload_error_hint_invalid_name:"\u041f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u0443\u0439\u0442\u0435 \u0444\u0430\u0439\u043b: \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0439\u0442\u0435 \u043b\u0438\u0448\u0435 \u043b\u0456\u0442\u0435\u0440\u0438, \u0446\u0438\u0444\u0440\u0438, \u0434\u0435\u0444\u0456\u0441 \u0442\u0430 \u043f\u0456\u0434\u043a\u0440\u0435\u0441\u043b\u0435\u043d\u043d\u044f.",upload_error_hint_size:"\u0417\u043c\u0435\u043d\u0448\u0456\u0442\u044c \u0440\u043e\u0437\u043c\u0456\u0440 \u0444\u0430\u0439\u043b\u0443 \u0430\u0431\u043e \u043e\u0431\u0435\u0440\u0456\u0442\u044c \u0456\u043d\u0448\u0438\u0439.",upload_error_hint_format:"\u041e\u0431\u0435\u0440\u0456\u0442\u044c \u0434\u043e\u0437\u0432\u043e\u043b\u0435\u043d\u0438\u0439 \u0444\u043e\u0440\u043c\u0430\u0442: JPG, PNG \u0430\u0431\u043e GIF.",upload_error_hint_exists:"\u0424\u0430\u0439\u043b \u0437 \u0442\u0430\u043a\u043e\u044e \u043d\u0430\u0437\u0432\u043e\u044e \u0432\u0436\u0435 \u0454 \u0432 \u043f\u0430\u043f\u0446\u0456. \u041f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u0443\u0439\u0442\u0435 \u0444\u0430\u0439\u043b.","Images generated successfully":"\u0417\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f \u0443\u0441\u043f\u0456\u0448\u043d\u043e \u0441\u0442\u0432\u043e\u0440\u0435\u043d\u043e","Choose for template":"\u0412\u0438\u0431\u0440\u0430\u0442\u0438 \u0434\u043b\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0432 \u0448\u0430\u0431\u043b\u043e\u043d","Trash is empty":"\u041a\u043e\u0448\u0438\u043a \u043f\u043e\u0440\u043e\u0436\u043d\u0456\u0439","Deleted files will be displayed here":"\u0422\u0443\u0442 \u0431\u0443\u0434\u0443\u0442\u044c \u0432\u0456\u0434\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u0438\u0441\u044f \u0432\u0438\u0434\u0430\u043b\u0435\u043d\u0456 \u0444\u0430\u0439\u043b\u0438","Editing: {{name}}":"\u0420\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u043d\u043d\u044f: {{name}}","Editing image":"\u0420\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u043d\u043d\u044f \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f",Save:"\u0417\u0431\u0435\u0440\u0435\u0433\u0442\u0438","Loading editor...":"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430\u2026","Error loading image":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f","Error saving image":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043f\u0440\u0438 \u0437\u0431\u0435\u0440\u0435\u0436\u0435\u043d\u043d\u0456 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f","Error initializing editor":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u0456\u043d\u0456\u0446\u0456\u0430\u043b\u0456\u0437\u0430\u0446\u0456\u0457 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430","Close File Manager":"\u0417\u0430\u043a\u0440\u0438\u0442\u0438 \u0444\u0430\u0439\u043b\u043e\u0432\u0438\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440","Are you sure you want to close? Unsaved changes will be lost.":"\u0412\u0438 \u0432\u043f\u0435\u0432\u043d\u0435\u043d\u0456, \u0449\u043e \u0445\u043e\u0447\u0435\u0442\u0435 \u0437\u0430\u043a\u0440\u0438\u0442\u0438? \u041d\u0435\u0437\u0431\u0435\u0440\u0435\u0436\u0435\u043d\u0456 \u0437\u043c\u0456\u043d\u0438 \u0431\u0443\u0434\u0443\u0442\u044c \u0432\u0442\u0440\u0430\u0447\u0435\u043d\u0456.","Are you sure you want to close the file manager?":"\u0412\u0438 \u0432\u043f\u0435\u0432\u043d\u0435\u043d\u0456, \u0449\u043e \u0445\u043e\u0447\u0435\u0442\u0435 \u0437\u0430\u043a\u0440\u0438\u0442\u0438 \u0444\u0430\u0439\u043b\u043e\u0432\u0438\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440?",Close:"\u0417\u0430\u043a\u0440\u0438\u0442\u0438",KB:"\u041a\u0411","No files":"\u041d\u0435\u043c\u0430\u0454 \u0444\u0430\u0439\u043b\u0456\u0432","Folder is empty or files not found":"\u041f\u0430\u043f\u043a\u0430 \u043f\u043e\u0440\u043e\u0436\u043d\u044f \u0430\u0431\u043e \u0444\u0430\u0439\u043b\u0438 \u043d\u0435 \u0437\u043d\u0430\u0439\u0434\u0435\u043d\u0456","Search files...":"\u041f\u043e\u0448\u0443\u043a \u0444\u0430\u0439\u043b\u0456\u0432...",Success:"\u0423\u0441\u043f\u0456\u0445","Image updated successfully":"\u0417\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f \u0443\u0441\u043f\u0456\u0448\u043d\u043e \u043e\u043d\u043e\u0432\u043b\u0435\u043d\u043e","Failed to save changes":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0437\u0431\u0435\u0440\u0435\u0433\u0442\u0438 \u0437\u043c\u0456\u043d\u0438: {{error}}","Unknown error":"\u041d\u0435\u0432\u0456\u0434\u043e\u043c\u0430 \u043f\u043e\u043c\u0438\u043b\u043a\u0430","Select destination folder":"\u0412\u0438\u0431\u0435\u0440\u0456\u0442\u044c \u043f\u0430\u043f\u043a\u0443 \u043f\u0440\u0438\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044f","Error moving":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u043c\u0456\u0449\u0435\u043d\u043d\u0456","Error deleting":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043f\u0440\u0438 \u0432\u0438\u0434\u0430\u043b\u0435\u043d\u043d\u0456","Error copying":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043f\u0440\u0438 \u043a\u043e\u043f\u0456\u044e\u0432\u0430\u043d\u043d\u0456","Error renaming":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u0443\u0432\u0430\u043d\u043d\u0456","Failed to refresh folder tree":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u043e\u043d\u043e\u0432\u0438\u0442\u0438 \u0434\u0435\u0440\u0435\u0432\u043e \u043f\u0430\u043f\u043e\u043a","Failed to refresh file list":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u043e\u043d\u043e\u0432\u0438\u0442\u0438 \u0441\u043f\u0438\u0441\u043e\u043a \u0444\u0430\u0439\u043b\u0456\u0432","Errors occurred while moving":"\u041f\u0456\u0434 \u0447\u0430\u0441 \u043f\u0435\u0440\u0435\u043c\u0456\u0449\u0435\u043d\u043d\u044f \u0432\u0438\u043d\u0438\u043a\u043b\u0438 \u043f\u043e\u043c\u0438\u043b\u043a\u0438","Errors occurred while copying":"\u041f\u0456\u0434 \u0447\u0430\u0441 \u043a\u043e\u043f\u0456\u044e\u0432\u0430\u043d\u043d\u044f \u0432\u0438\u043d\u0438\u043a\u043b\u0438 \u043f\u043e\u043c\u0438\u043b\u043a\u0438","(error)":"(\u043f\u043e\u043c\u0438\u043b\u043a\u0430)","(circular reference)":"(\u0446\u0438\u043a\u043b\u0456\u0447\u043d\u0435 \u043f\u043e\u0441\u0438\u043b\u0430\u043d\u043d\u044f)","File too large. Maximum size: {{size}}":"\u0424\u0430\u0439\u043b \u0437\u0430\u043d\u0430\u0434\u0442\u043e \u0432\u0435\u043b\u0438\u043a\u0438\u0439. \u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0438\u0439 \u0440\u043e\u0437\u043c\u0456\u0440: {{size}}","File too small. Minimum size: {{size}}":"\u0424\u0430\u0439\u043b \u0437\u0430\u043d\u0430\u0434\u0442\u043e \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439. \u041c\u0456\u043d\u0456\u043c\u0430\u043b\u044c\u043d\u0438\u0439 \u0440\u043e\u0437\u043c\u0456\u0440: {{size}}","Unsupported file type":"\u041d\u0435\u043f\u0456\u0434\u0442\u0440\u0438\u043c\u0443\u0432\u0430\u043d\u0438\u0439 \u0442\u0438\u043f \u0444\u0430\u0439\u043b\u0443","Unsupported file type: {{type}}":"\u041d\u0435\u043f\u0456\u0434\u0442\u0440\u0438\u043c\u0443\u0432\u0430\u043d\u0438\u0439 \u0442\u0438\u043f \u0444\u0430\u0439\u043b\u0443: {{type}}",unknown:"\u043d\u0435\u0432\u0456\u0434\u043e\u043c\u0438\u0439","Failed to load files":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438 \u0444\u0430\u0439\u043b\u0438","DataProvider for folder deletion is not configured":"DataProvider \u0434\u043b\u044f \u0432\u0438\u0434\u0430\u043b\u0435\u043d\u043d\u044f \u043f\u0430\u043f\u043e\u043a \u043d\u0435 \u043d\u0430\u043b\u0430\u0448\u0442\u043e\u0432\u0430\u043d\u043e","DataProvider for file upload is not configured":"DataProvider \u0434\u043b\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0444\u0430\u0439\u043b\u0456\u0432 \u043d\u0435 \u043d\u0430\u043b\u0430\u0448\u0442\u043e\u0432\u0430\u043d\u043e","Error uploading file {{fileName}}":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043f\u0440\u0438 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u0456 \u0444\u0430\u0439\u043b\u0443 {{fileName}}","Error uploading file":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043f\u0440\u0438 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u0456 \u0444\u0430\u0439\u043b\u0443","Cannot upload files to Trash":"\u041d\u0435 \u043c\u043e\u0436\u043d\u0430 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0443\u0432\u0430\u0442\u0438 \u0444\u0430\u0439\u043b\u0438 \u0432 \u043a\u043e\u0448\u0438\u043a","Please fill in all fields":"\u0417\u0430\u043f\u043e\u0432\u043d\u0456\u0442\u044c \u0443\u0441\u0456 \u043f\u043e\u043b\u044f","URL too long":"URL \u0437\u0430\u043d\u0430\u0434\u0442\u043e \u0434\u043e\u0432\u0433\u0438\u0439","Only http and https URLs are supported":"\u041f\u0456\u0434\u0442\u0440\u0438\u043c\u0443\u044e\u0442\u044c\u0441\u044f \u043b\u0438\u0448\u0435 URL \u0437 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u043e\u043c http \u0442\u0430 https","Private and local URLs are not allowed":"\u041b\u043e\u043a\u0430\u043b\u044c\u043d\u0456 \u0442\u0430 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u0456 URL \u0437\u0430\u0431\u043e\u0440\u043e\u043d\u0435\u043d\u0456","Upload by URL is not supported":"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0437\u0430 URL \u043d\u0435 \u043f\u0456\u0434\u0442\u0440\u0438\u043c\u0443\u0454\u0442\u044c\u0441\u044f","File name is too long. Maximum {{max}} characters":"\u0406\u043c'\u044f \u0444\u0430\u0439\u043b\u0443 \u0437\u0430\u043d\u0430\u0434\u0442\u043e \u0434\u043e\u0432\u0433\u0435. \u041c\u0430\u043a\u0441\u0438\u043c\u0443\u043c {{max}} \u0441\u0438\u043c\u0432\u043e\u043b\u0456\u0432","File name contains invalid characters":"\u0406\u043c'\u044f \u0444\u0430\u0439\u043b\u0443 \u043c\u0456\u0441\u0442\u0438\u0442\u044c \u043d\u0435\u043f\u0440\u0438\u043f\u0443\u0441\u0442\u0438\u043c\u0456 \u0441\u0438\u043c\u0432\u043e\u043b\u0438","Large file may take a long time to upload":"\u0412\u0435\u043b\u0438\u043a\u0438\u0439 \u0444\u0430\u0439\u043b \u043c\u043e\u0436\u0435 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0443\u0432\u0430\u0442\u0438\u0441\u044f \u0434\u043e\u0432\u0433\u043e","File unavailable: {{status}} {{statusText}}":"\u0424\u0430\u0439\u043b \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0438\u0439: {{status}} {{statusText}}","File too large: {{size}}":"\u0424\u0430\u0439\u043b \u0437\u0430\u043d\u0430\u0434\u0442\u043e \u0432\u0435\u043b\u0438\u043a\u0438\u0439: {{size}}","Unsupported file type: {{contentType}}":"\u041d\u0435\u043f\u0456\u0434\u0442\u0440\u0438\u043c\u0443\u0432\u0430\u043d\u0438\u0439 \u0442\u0438\u043f \u0444\u0430\u0439\u043b\u0443: {{contentType}}","Invalid server response: folder ID is missing":"\u041d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u0430 \u0432\u0456\u0434\u043f\u043e\u0432\u0456\u0434\u044c \u0441\u0435\u0440\u0432\u0435\u0440\u0430: \u0432\u0456\u0434\u0441\u0443\u0442\u043d\u0456\u0439 ID \u043f\u0430\u043f\u043a\u0438","Error: folder cannot be its own parent":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430: \u043f\u0430\u043f\u043a\u0430 \u043d\u0435 \u043c\u043e\u0436\u0435 \u0431\u0443\u0442\u0438 \u0431\u0430\u0442\u044c\u043a\u043e\u043c \u0441\u0430\u043c\u043e\u0457 \u0441\u0435\u0431\u0435","Upload to Trash is forbidden":"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0432 \u043a\u043e\u0448\u0438\u043a \u0437\u0430\u0431\u043e\u0440\u043e\u043d\u0435\u043d\u043e","renameFolder is not implemented in dataProviders":"renameFolder \u043d\u0435 \u0440\u0435\u0430\u043b\u0456\u0437\u043e\u0432\u0430\u043d\u043e \u0432 dataProviders","renameFile is not implemented in dataProviders":"renameFile \u043d\u0435 \u0440\u0435\u0430\u043b\u0456\u0437\u043e\u0432\u0430\u043d\u043e \u0432 dataProviders",Clean:"\u041e\u0447\u0438\u0441\u0442\u0438\u0442\u0438","Circular dependency detected: folder cannot be its own parent":"\u0412\u0438\u044f\u0432\u043b\u0435\u043d\u043e \u0446\u0438\u043a\u043b\u0456\u0447\u043d\u0443 \u0437\u0430\u043b\u0435\u0436\u043d\u0456\u0441\u0442\u044c: \u043f\u0430\u043f\u043a\u0430 \u043d\u0435 \u043c\u043e\u0436\u0435 \u0431\u0443\u0442\u0438 \u0431\u0430\u0442\u044c\u043a\u043e\u043c \u0441\u0430\u043c\u043e\u0457 \u0441\u0435\u0431\u0435","Save as copy and choose":"\u0417\u0431\u0435\u0440\u0435\u0433\u0442\u0438 \u044f\u043a \u043a\u043e\u043f\u0456\u044e \u0456 \u0432\u0438\u0431\u0440\u0430\u0442\u0438","Save and choose":"\u0417\u0431\u0435\u0440\u0435\u0433\u0442\u0438 \u0456 \u0432\u0438\u0431\u0440\u0430\u0442\u0438",pixie:{"added drawing":"\u0414\u043e\u0434\u0430\u0432\u0430\u043d\u043d\u044f \u043c\u0430\u043b\u044e\u043d\u043a\u0430","added frame":"\u0414\u043e\u0434\u0430\u0432\u0430\u043d\u043d\u044f \u0440\u0430\u043c\u043a\u0438","added image":"\u0414\u043e\u0434\u0430\u0432\u0430\u043d\u043d\u044f \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f","added shape":"\u0414\u043e\u0434\u0430\u0432\u0430\u043d\u043d\u044f \u0444\u0456\u0433\u0443\u0440\u0438","added sticker":"\u0414\u043e\u0434\u0430\u0432\u0430\u043d\u043d\u044f \u0441\u0442\u0456\u043a\u0435\u0440\u0430","added text":"\u0414\u043e\u0434\u0430\u0432\u0430\u043d\u043d\u044f \u0442\u0435\u043a\u0441\u0442\u0443","applied filters":"\u0417\u0430\u0441\u0442\u043e\u0441\u0443\u0432\u0430\u043d\u043d\u044f \u0444\u0456\u043b\u044c\u0442\u0440",apply:"\u0417\u0430\u0441\u0442\u043e\u0441\u0443\u0432\u0430\u0442\u0438",background:"\u0424\u043e\u043d","background color":"\u0424\u043e\u043d\u043e\u0432\u0438\u0439 \u043a\u043e\u043b\u0456\u0440",beach:"\u041f\u043b\u044f\u0436","brush color":"\u041a\u043e\u043b\u0456\u0440 \u043a\u0438\u0441\u0442\u0456","brush size":"\u0420\u043e\u0437\u043c\u0456\u0440 \u043a\u0438\u0441\u0442\u0456","brush type":"\u0422\u0438\u043f \u043a\u0438\u0441\u0442\u0456",bubbles:"\u041f\u0443\u0437\u0438\u0440\u0446\u0456",Cancel:"\u0421\u043a\u0430\u0441\u0443\u0432\u0430\u0442\u0438","changed style":"\u0417\u043c\u0456\u043d\u0430 \u0441\u0442\u0438\u043b\u044e","Circle Brush":"\u041a\u043e\u043b\u0430",close:"\u0417\u0430\u043a\u0440\u0438\u0442\u0438",color:"\u041a\u043e\u043b\u0456\u0440",corners:"\u041a\u0443\u0442\u0438",crop:"\u041e\u0431\u0440\u0456\u0437\u0430\u0442\u0438",Custom:"\u041a\u043e\u0440\u0438\u0441\u0442\u0443\u0432\u0430\u0446\u044c\u043a\u0438\u0439","deleted object":"\u0412\u0438\u0434\u0430\u043b\u0435\u043d\u043d\u044f \u043e\u0431'\u0454\u043a\u0442\u0430","Diamond Brush":"\u0410\u043b\u043c\u0430\u0437",doodles:"\u041a\u043e\u043b\u044c\u043e\u0440\u043e\u0432\u0456",draw:"\u041c\u0430\u043b\u044e\u043d\u043e\u043a",emoticons:"\u0421\u043c\u0430\u0439\u043b\u0438\u043a\u0438","Eraser Brush":"\u0413\u0443\u043c\u043a\u0430",filter:"\u0424\u0456\u043b\u044c\u0442\u0440",font:"\u0428\u0440\u0438\u0444\u0442","font size":"\u0420\u043e\u0437\u043c\u0456\u0440 \u0448\u0440\u0438\u0444\u0442\u0443",frame:"\u0420\u0430\u043c\u043a\u0430",gradient:"\u0413\u0440\u0430\u0434\u0456\u0454\u043d\u0442",height:"\u0412\u0438\u0441\u043e\u0442\u0430",history:"\u0406\u0441\u0442\u043e\u0440\u0456\u044f","H Line Brush":"\u041d-\u043f\u043e\u0434\u0456\u0431\u043d\u0430",image:"\u0417\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f",initial:"\u041f\u043e\u0447\u0430\u0442\u043a\u043e\u0432\u0438\u0439",landmarks:"\u041f\u0430\u043c'\u044f\u0442\u043a\u0438","loaded state":"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0441\u0442\u0430\u043d\u0443","loading canvas":"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f","loading image":"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f","loading state":"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f","maintain aspect ratio":"Maintain aspect ratio",merge:"\u041e\u0431'\u0454\u0434\u043d\u0430\u043d\u043d\u044f","merged objects":"\u041e\u0431'\u0454\u0434\u043d\u0430\u043d\u043d\u044f \u043e\u0431'\u0454\u043a\u0442\u0456\u0432","new text":"\u041d\u043e\u0432\u0438\u0439 \u043d\u0430\u043f\u0438\u0441",objects:"\u041e\u0431'\u0454\u043a\u0442",opacity:"\u041f\u0440\u043e\u0437\u043e\u0440\u0456\u0441\u0442\u044c",outline:"\u041a\u043e\u043d\u0442\u0443\u0440","outline color":"\u041a\u043e\u043b\u0456\u0440 \u043a\u043e\u043d\u0442\u0443\u0440\u0443","Pencil Brush":"\u041e\u043b\u0456\u0432\u0435\u0446\u044c","processing image":"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f",quality:"\u042f\u043a\u0456\u0441\u0442\u044c",radius:"\u0420\u0430\u0434\u0456\u0443\u0441","replace image":"Replace Image","replaced background image":"\u0412\u0438\u0434\u0430\u043b\u0435\u043d\u043d\u044f \u0444\u043e\u043d\u043e\u0432\u043e\u0433\u043e \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f",resize:"\u0420\u043e\u0437\u043c\u0456\u0440","resized image":"\u0417\u043c\u0456\u043d\u0430 \u0440\u043e\u0437\u043c\u0456\u0440\u0443","rounded corner":"\u0417\u0430\u043e\u043a\u0440\u0443\u0433\u043b\u0435\u043d\u043d\u044f \u043a\u0443\u0442\u0456\u0432",save:"\u0417\u0431\u0435\u0440\u0435\u0433\u0442\u0438",shadow:"\u0422\u0456\u043d\u044c","shadow color":"\u041a\u043e\u043b\u0456\u0440 \u0442\u0456\u043d\u0456",shapes:"\u0424\u0456\u0433\u0443\u0440\u0438","Spray Brush":"\u0421\u043f\u0440\u0435\u0439",square:"\u041a\u0432\u0430\u0434\u0440\u0430\u0442","Square Brush":"\u041a\u0432\u0430\u0434\u0440\u0430\u0442",stickers:"\u0421\u0442\u0456\u043a\u0435\u0440\u0438",text:"\u041d\u0430\u043f\u0438\u0441",texture:"\u0422\u0435\u043a\u0441\u0442\u0443\u0440\u0430",transportation:"\u0422\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442","V Line Brush":"V-\u043f\u043e\u0434\u0456\u0431\u043d\u0430",width:"\u0428\u0438\u0440\u0438\u043d\u0430",grayscale:"\u0412\u0456\u0434\u0442\u0456\u043d\u043a\u0438 \u0441\u0456\u0440\u043e\u0433\u043e","black & White":"\u0427\u043e\u0440\u043d\u043e-\u0431\u0456\u043b\u0438\u0439",sharpen:"\u0420\u0456\u0437\u043a\u0456\u0441\u0442\u044c",invert:"\u0406\u043d\u0432\u0435\u0440\u0441\u0456\u044f",vintage:"\u0412\u0456\u043d\u0442\u0430\u0436",polaroid:"\u041f\u043e\u043b\u0430\u0440\u043e\u0457\u0434",kodachrome:"\u041a\u043e\u0434\u0430\u0445\u0440\u043e\u043c",technicolor:"\u0422\u0435\u0445\u043d\u0456\u043a\u043e\u043b\u043e\u0440",brownie:"\u041a\u043e\u0440\u0438\u0447\u043d\u0435\u0432\u0438\u0439",sepia:"\u0421\u0435\u043f\u0456\u044f","remove Color":"\u0412\u0438\u0434\u0430\u043b\u0438\u0442\u0438 \u043a\u043e\u043b\u0456\u0440",brightness:"\u042f\u0441\u043a\u0440\u0430\u0432\u0456\u0441\u0442\u044c",gamma:"\u0413\u0430\u043c\u043c\u0430",noise:"\u0428\u0443\u043c",pixelate:"\u041f\u0456\u043a\u0441\u0435\u043b\u0456\u0437\u0430\u0446\u0456\u044f",blur:"\u0420\u043e\u0437\u043c\u0438\u0442\u0442\u044f",emboss:"\u0422\u0438\u0441\u043d\u0435\u043d\u043d\u044f","blend Color":"\u0417\u043c\u0456\u0448\u0430\u0442\u0438 \u043a\u043e\u043b\u0456\u0440",distance:"\u0412\u0456\u0434\u0441\u0442\u0430\u043d\u044c",red:"\u0427\u0435\u0440\u0432\u043e\u043d\u0438\u0439",green:"\u0417\u0435\u043b\u0435\u043d\u0438\u0439",blue:"\u0421\u0438\u043d\u0456\u0439",blocksize:"\u0420\u043e\u0437\u043c\u0456\u0440 \u0431\u043b\u043e\u043a\u0443",alpha:"\u0410\u043b\u044c\u0444\u0430",add:"\u0414\u043e\u0434\u0430\u0442\u0438",multiply:"\u041f\u043e\u043c\u043d\u043e\u0436\u0438\u0442\u0438",subtract:"\u0412\u0456\u0434\u043d\u044f\u0442\u0438",diff:"\u0420\u0456\u0437\u043d\u0438\u0446\u044f",screen:"\u0415\u043a\u0440\u0430\u043d",lighten:"\u041e\u0441\u0432\u0456\u0442\u043b\u0438\u0442\u0438",darken:"\u0417\u0430\u0442\u0435\u043c\u043d\u0438\u0442\u0438","select an option...":"\u0412\u0438\u0431\u0435\u0440\u0456\u0442\u044c \u043e\u043f\u0446\u0456\u044e..."}}},"pt-br":{translation:Ar},pt:{translation:Ar},br:{translation:Ar},"pt-BR":{translation:Ar}};yr.use(_n).init({resources:kr,lng:"en",fallbackLng:"en",interpolation:{escapeValue:!1}});const Er=({size:e=24,color:t="currentColor",...n})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},o.createElement("path",{d:"m6 9 6 6 6-6"}));Er.displayName="ChevronDown";const Ir=({size:e=24,color:t="currentColor",...n})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},o.createElement("path",{d:"M12 20.472a6 6 0 1 0 5.58-10.262m-11.16 0a6 6 0 1 0 7.16 3.58M18 8A6 6 0 1 1 6 8a6 6 0 0 1 12 0Z"}));Ir.displayName="Colors";const jr=({size:e=24,color:t="currentColor",...n})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},o.createElement("path",{d:"M16 16v2.8c0 1.12 0 1.68-.218 2.108a2 2 0 0 1-.874.874C14.48 22 13.92 22 12.8 22H5.2c-1.12 0-1.68 0-2.108-.218a2 2 0 0 1-.874-.874C2 20.48 2 19.92 2 18.8v-7.6c0-1.12 0-1.68.218-2.108a2 2 0 0 1 .874-.874C3.52 8 4.08 8 5.2 8H8m3.2 8h7.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C22 14.48 22 13.92 22 12.8V5.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C20.48 2 19.92 2 18.8 2h-7.6c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C8 3.52 8 4.08 8 5.2v7.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C9.52 16 10.08 16 11.2 16Z"}));jr.displayName="Copy04";const Tr=({size:e=24,color:t="currentColor",...n})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},o.createElement("path",{d:"M10 6h4.8c1.12 0 1.68 0 2.108.218a2 2 0 0 1 .874.874C18 7.52 18 8.08 18 9.2V14M2 6h4m12 12v4m4-4H9.2c-1.12 0-1.68 0-2.108-.218a2 2 0 0 1-.874-.874C6 16.48 6 15.92 6 14.8V2"}));Tr.displayName="Crop02";const Fr=({size:e=24,color:t="currentColor",...n})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},o.createElement("path",{d:"M12 13a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0-7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 14a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"}));Fr.displayName="DotsVertical";const Or=({size:e=24,color:t="currentColor",...n})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},o.createElement("path",{d:"m13 7-1.116-2.231c-.32-.642-.481-.963-.72-1.198a2 2 0 0 0-.748-.462C10.1 3 9.74 3 9.022 3H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 4.52 2 5.08 2 6.2V7m0 0h15.2c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C22 9.28 22 10.12 22 11.8v4.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C19.72 21 18.88 21 17.2 21H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C2 18.72 2 17.88 2 16.2V7Zm7 7 3 3m0 0 3-3m-3 3v-6"}));Or.displayName="FolderDownload";const Mr=({size:e=24,color:t="currentColor",...n})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},o.createElement("path",{d:"m13 7-1.116-2.231c-.32-.642-.481-.963-.72-1.198a2 2 0 0 0-.748-.462C10.1 3 9.74 3 9.022 3H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 4.52 2 5.08 2 6.2V7m0 0h15.2c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C22 9.28 22 10.12 22 11.8v4.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C19.72 21 18.88 21 17.2 21H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C2 18.72 2 17.88 2 16.2V7Zm7 7h6"}));Mr.displayName="FolderMinus";const Pr=({size:e=24,color:t="currentColor",...n})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},o.createElement("path",{d:"m13 7-1.116-2.231c-.32-.642-.481-.963-.72-1.198a2 2 0 0 0-.748-.462C10.1 3 9.74 3 9.022 3H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 4.52 2 5.08 2 6.2V7m0 0h15.2c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C22 9.28 22 10.12 22 11.8v4.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C19.72 21 18.88 21 17.2 21H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C2 18.72 2 17.88 2 16.2V7Zm10 10v-6m-3 3h6"}));Pr.displayName="FolderPlus";const Rr=({size:e=24,color:t="currentColor",...n})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},o.createElement("path",{d:"m13 7-1.116-2.231c-.32-.642-.481-.963-.72-1.198a2 2 0 0 0-.748-.462C10.1 3 9.74 3 9.022 3H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 4.52 2 5.08 2 6.2V7m0 0h15.2c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C22 9.28 22 10.12 22 11.8v4.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C19.72 21 18.88 21 17.2 21H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C2 18.72 2 17.88 2 16.2V7Zm13.5 10.5L14 16m1-2.5a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0Z"}));Rr.displayName="FolderSearch";const Lr=({size:e=24,color:t="currentColor",...n})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},o.createElement("path",{d:"M8.4 3H4.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C3 3.76 3 4.04 3 4.6v3.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C3.76 10 4.04 10 4.6 10h3.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C10 9.24 10 8.96 10 8.4V4.6c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C9.24 3 8.96 3 8.4 3Zm11 0h-3.8c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C14 3.76 14 4.04 14 4.6v3.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C14.76 10 15.04 10 15.6 10h3.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C21 9.24 21 8.96 21 8.4V4.6c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C20.24 3 19.96 3 19.4 3Zm0 11h-3.8c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C14 14.76 14 15.04 14 15.6v3.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C14.76 21 15.04 21 15.6 21h3.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C21 20.24 21 19.96 21 19.4v-3.8c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C20.24 14 19.96 14 19.4 14Zm-11 0H4.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C3 14.76 3 15.04 3 15.6v3.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C3.76 21 4.04 21 4.6 21h3.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C10 20.24 10 19.96 10 19.4v-3.8c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C9.24 14 8.96 14 8.4 14Z"}));Lr.displayName="Grid01";const Nr=({size:e=24,color:t="currentColor",...n})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},o.createElement("path",{d:"m4.272 20.728 6.597-6.597c.396-.396.594-.594.822-.668a1 1 0 0 1 .618 0c.228.074.426.272.822.668l6.553 6.553M14 15l2.869-2.869c.396-.396.594-.594.822-.668a1 1 0 0 1 .618 0c.228.074.426.272.822.668L22 15M10 9a2 2 0 1 1-4 0 2 2 0 0 1 4 0ZM6.8 21h10.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C22 18.72 22 17.88 22 16.2V7.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C19.72 3 18.88 3 17.2 3H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 5.28 2 6.12 2 7.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 21 5.12 21 6.8 21Z"}));Nr.displayName="Image03";const Dr=({size:e=24,color:t="currentColor",...n})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},o.createElement("path",{d:"m12.708 18.364-1.415 1.414a5 5 0 1 1-7.07-7.07l1.413-1.415m12.728 1.414 1.415-1.414a5 5 0 0 0-7.071-7.071l-1.415 1.414M8.5 15.5l7-7"}));Dr.displayName="Link01";const zr=({size:e=24,color:t="currentColor",...n})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},o.createElement("path",{d:"M21 12H9m12-6H9m12 12H9m-4-6a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm0-6a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm0 12a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"}));zr.displayName="List";const Br=({size:e=24,color:t="currentColor",...n})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},o.createElement("path",{d:"M9.5 8.965c0-.477 0-.716.1-.849a.5.5 0 0 1 .364-.199c.166-.012.367.117.769.375l4.72 3.035c.349.224.523.336.583.478a.5.5 0 0 1 0 .39c-.06.142-.234.254-.583.478l-4.72 3.035c-.402.258-.603.387-.769.375a.5.5 0 0 1-.364-.2c-.1-.132-.1-.371-.1-.848v-6.07Z"}),o.createElement("path",{d:"M3 7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8Z"}));Br.displayName="PlaySquare";const Ur=({size:e=24,color:t="currentColor",...n})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},o.createElement("path",{d:"M12 8v8m-4-4h8m6 0c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"}));Ur.displayName="PlusCircle";const Vr=({size:e=24,color:t="currentColor",...n})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},o.createElement("path",{d:"M20.453 12.893A8.5 8.5 0 0 1 4.638 16.25l-.25-.433m-.842-4.71A8.5 8.5 0 0 1 19.361 7.75l.25.433M3.493 18.066l.732-2.732 2.732.732m10.085-8.132 2.732.732.732-2.732"}));Vr.displayName="RefreshCw05";const Hr=({size:e=24,color:t="currentColor",...n})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},o.createElement("path",{d:"M14 22H6.8m0 0c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C2 19.72 2 18.88 2 17.2M6.8 22h.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C12 19.72 12 18.88 12 17.2v-.4c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C9.72 12 8.88 12 7.2 12h-.4c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 14.28 2 15.12 2 16.8v.4m0 0V10m8-8h4m8 8v4m-4 8c.93 0 1.395 0 1.776-.102a3 3 0 0 0 2.122-2.122C22 19.395 22 18.93 22 18m0-12c0-.93 0-1.395-.102-1.776a3 3 0 0 0-2.122-2.122C19.395 2 18.93 2 18 2M6 2c-.93 0-1.395 0-1.776.102a3 3 0 0 0-2.122 2.122C2 4.605 2 5.07 2 6"}));Hr.displayName="Scale01";const Wr=({size:e=24,color:t="currentColor",...n})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},o.createElement("path",{d:"m21 21-4.35-4.35M19 11a8 8 0 1 1-16 0 8 8 0 0 1 16 0Z"}));Wr.displayName="SearchMd";const $r=({size:e=24,color:t="currentColor",...n})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},o.createElement("path",{d:"M4.5 22v-5m0-10V2M2 4.5h5m-5 15h5M13 3l-1.734 4.509c-.282.733-.423 1.1-.643 1.408a3 3 0 0 1-.706.707c-.308.219-.675.36-1.408.642L4 12l4.509 1.734c.733.282 1.1.423 1.408.643.273.194.512.433.707.706.219.308.36.675.642 1.408L13 21l1.734-4.509c.282-.733.423-1.1.643-1.408.194-.273.433-.512.706-.707.308-.219.675-.36 1.408-.642L22 12l-4.509-1.734c-.733-.282-1.1-.423-1.408-.642a3 3 0 0 1-.706-.707c-.22-.308-.36-.675-.643-1.408L13 3Z"}));$r.displayName="Stars02";const Gr=({size:e=24,color:t="currentColor",...n})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},o.createElement("path",{d:"M13 7H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 8.52 2 9.08 2 10.2v3.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C3.52 17 4.08 17 5.2 17H13m4-10h1.8c1.12 0 1.68 0 2.108.218a2 2 0 0 1 .874.874C22 8.52 22 9.08 22 10.2v3.6c0 1.12 0 1.68-.218 2.108a2 2 0 0 1-.874.874C20.48 17 19.92 17 18.8 17H17m0 4V3m2.5 0h-5m5 18h-5"}));Gr.displayName="TextInput";const qr=({size:e=24,color:t="currentColor",...n})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},o.createElement("path",{d:"M7 22V11m-5 2v7a2 2 0 0 0 2 2h13.426a3 3 0 0 0 2.965-2.544l1.077-7A3 3 0 0 0 18.503 9H15a1 1 0 0 1-1-1V4.466A2.466 2.466 0 0 0 11.534 2a.822.822 0 0 0-.75.488l-3.52 7.918A1 1 0 0 1 6.35 11H4a2 2 0 0 0-2 2Z"}));qr.displayName="ThumbsUp";const Yr=({size:e=24,color:t="currentColor",...n})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},o.createElement("path",{d:"M9 3h6M3 6h18m-2 0-.701 10.52c-.105 1.578-.158 2.367-.499 2.965a3 3 0 0 1-1.298 1.215c-.62.3-1.41.3-2.993.3h-3.018c-1.582 0-2.373 0-2.993-.3A3 3 0 0 1 6.2 19.485c-.34-.598-.394-1.387-.499-2.966L5 6m5 4.5v5m4-5v5"}));Yr.displayName="Trash03";const Xr=({size:e=24,color:t="currentColor",...n})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},o.createElement("path",{d:"M9 3h6M3 6h18m-2 0-.701 10.52c-.105 1.578-.158 2.367-.499 2.965a3 3 0 0 1-1.298 1.215c-.62.3-1.41.3-2.993.3h-3.018c-1.582 0-2.373 0-2.993-.3A3 3 0 0 1 6.2 19.485c-.34-.598-.394-1.387-.499-2.966L5 6"}));Xr.displayName="Trash04";const Kr=()=>(0,i.jsx)("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"mixed-view",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:(0,i.jsx)("path",{d:"M1 1h2v2H1V1zm0 4h2v2H1V5zm0 4h2v2H1V9zm4-8h2v2H5V1zm0 4h2v2H5V5zm0 4h2v2H5V9zm4-8h2v2H9V1zm0 4h2v2H9V5zm0 4h2v2H9V9z"})}),Zr=()=>(0,i.jsx)("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"landscape-view",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:(0,i.jsx)("path",{d:"M1 3h10v6H1V3zm1 1v4h8V4H2z"})}),Jr=()=>(0,i.jsx)("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"portrait-view",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:(0,i.jsx)("path",{d:"M3 1h6v10H3V1zm1 1v8h4V2H4z"})}),Qr=()=>(0,i.jsx)("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"square-view",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:(0,i.jsx)("path",{d:"M1 1h10v10H1V1zm1 1v8h8V2H2z"})}),ei=()=>(0,i.jsxs)("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"ai-icon",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:[(0,i.jsx)("path",{d:"M2.45454 11.7273C2.45454 11.7273 2.16994 10.446 1.66154 9.88113C1.15314 9.31625 0 9 0 9C0 9 1.15314 8.68374 1.66154 8.11887C2.16994 7.554 2.45454 6.27273 2.45454 6.27273C2.45454 6.27273 2.73915 7.554 3.24755 8.11887C3.75594 8.68374 4.90909 9 4.90909 9C4.90909 9 3.75594 9.31625 3.24755 9.88113C2.73915 10.446 2.45454 11.7273 2.45454 11.7273Z"}),(0,i.jsx)("path",{d:"M7.63636 9C7.63636 9 7.1304 6.94996 6.22658 6.04614C5.32276 5.14233 3.27273 4.63636 3.27273 4.63636C3.27273 4.63636 5.32276 4.1304 6.22658 3.22657C7.1304 2.32275 7.63636 0.272728 7.63636 0.272728C7.63636 0.272728 8.14233 2.32275 9.04615 3.22657C9.94996 4.1304 12 4.63636 12 4.63636C12 4.63636 9.94996 5.14233 9.04615 6.04614C8.14233 6.94996 7.63636 9 7.63636 9Z"}),(0,i.jsx)("path",{d:"M1.63636 4.09091C1.63636 4.09091 1.44663 3.19402 1.10769 2.7986C0.768758 2.40318 0 2.18182 0 2.18182C0 2.18182 0.768758 1.96046 1.10769 1.56503C1.44663 1.16961 1.63636 0.272728 1.63636 0.272728C1.63636 0.272728 1.8261 1.16961 2.16503 1.56503C2.50397 1.96046 3.27273 2.18182 3.27273 2.18182C3.27273 2.18182 2.50397 2.40318 2.16503 2.7986C1.8261 3.19402 1.63636 4.09091 1.63636 4.09091Z"}),(0,i.jsx)("path",{d:"M10.6364 11.7273C10.6364 11.7273 10.4782 11.0866 10.1958 10.8042C9.91336 10.5218 9.27273 10.3636 9.27273 10.3636C9.27273 10.3636 9.91336 10.2055 10.1958 9.92307C10.4782 9.64064 10.6364 9 10.6364 9C10.6364 9 10.7945 9.64064 11.0769 9.92307C11.3594 10.2055 12 10.3636 12 10.3636C12 10.3636 11.3594 10.5218 11.0769 10.8042C10.7945 11.0866 10.6364 11.7273 10.6364 11.7273Z"})]}),ti=()=>(0,i.jsx)("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"light-mode",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:(0,i.jsx)("path",{d:"M6 7.81819C6.50303 7.81819 6.93182 7.64092 7.28637 7.28637C7.64092 6.93182 7.81819 6.50303 7.81819 6C7.81819 5.49697 7.64092 5.06818 7.28637 4.71363C6.93182 4.35908 6.50303 4.18181 6 4.18181C5.49697 4.18181 5.06818 4.35908 4.71363 4.71363C4.35908 5.06818 4.18181 5.49697 4.18181 6C4.18181 6.50303 4.35908 6.93182 4.71363 7.28637C5.06818 7.64092 5.49697 7.81819 6 7.81819ZM6 8.72727C5.24545 8.72727 4.60227 8.46136 4.07045 7.92955C3.53864 7.39773 3.27273 6.75455 3.27273 6C3.27273 5.24545 3.53864 4.60227 4.07045 4.07045C4.60227 3.53864 5.24545 3.27273 6 3.27273C6.75455 3.27273 7.39773 3.53864 7.92955 4.07045C8.46136 4.60227 8.72727 5.24545 8.72727 6C8.72727 6.75455 8.46136 7.39773 7.92955 7.92955C7.39773 8.46136 6.75455 8.72727 6 8.72727ZM2.18182 6.45454H0V5.54546H2.18182V6.45454ZM12 6.45454H9.81818V5.54546H12V6.45454ZM5.54546 2.18182V0H6.45454V2.18182H5.54546ZM5.54546 12V9.81818H6.45454V12H5.54546ZM3 3.6091L1.63182 2.28637L2.28181 1.61819L3.5909 2.98182L3 3.6091ZM9.72727 10.3727L8.39546 9.00454L9.0091 8.38182L10.3682 9.71363L9.72727 10.3727ZM8.38182 2.9909L9.71363 1.63182L10.3818 2.27273L9.02727 3.6L8.38182 2.9909ZM1.62727 9.71819L2.98636 8.38636L3.61818 9.0091L2.28637 10.3682L1.62727 9.71819Z"})}),ni=()=>(0,i.jsx)("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"dark-mode",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:(0,i.jsx)("path",{d:"M6 11C4.61111 11 3.43056 10.5139 2.45833 9.54167C1.48611 8.56944 1 7.38889 1 6C1 4.61111 1.48611 3.43056 2.45833 2.45833C3.43056 1.48611 4.61111 1 6 1C6.09259 1 6.1875 1.00309 6.28472 1.00926C6.38194 1.01543 6.49382 1.02469 6.62036 1.03704C6.2716 1.32408 5.99769 1.68442 5.79861 2.11806C5.59954 2.55169 5.5 3.01234 5.5 3.5C5.5 4.33333 5.79167 5.04167 6.375 5.625C6.95833 6.20833 7.66667 6.5 8.5 6.5C8.99074 6.5 9.45216 6.40509 9.88426 6.21528C10.3164 6.02546 10.6759 5.76544 10.963 5.43519C10.9753 5.54939 10.9846 5.65047 10.9907 5.73843C10.9969 5.82639 11 5.91358 11 6C11 7.38889 10.5139 8.56944 9.54167 9.54167C8.56944 10.5139 7.38889 11 6 11ZM6 10.0741C6.94444 10.0741 7.77469 9.7909 8.49075 9.22454C9.20681 8.65818 9.67594 7.97376 9.89815 7.17129C9.68211 7.25463 9.45474 7.3179 9.21606 7.36111C8.97737 7.40431 8.73869 7.42592 8.5 7.42592C7.41242 7.42592 6.4862 7.0435 5.72135 6.27865C4.9565 5.5138 4.57408 4.58758 4.57408 3.5C4.57408 3.29012 4.59414 3.06944 4.63426 2.83796C4.67438 2.60648 4.74229 2.35185 4.83797 2.07407C3.99229 2.3395 3.29552 2.83487 2.74768 3.56018C2.19984 4.28549 1.92592 5.09876 1.92592 6C1.92592 7.12963 2.32252 8.09105 3.11574 8.88426C3.90895 9.67748 4.87037 10.0741 6 10.0741Z"})}),ri=()=>(0,i.jsxs)("svg",{width:"64",height:"64",viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)("path",{opacity:"0.5",d:"M6 19H49C54.5229 19 59 23.4772 59 29V46C59 51.5228 54.5228 56 49 56H14C9.58172 56 6 52.4183 6 48V19Z",fill:"#91CAFF"}),(0,i.jsx)("path",{d:"M6 19L34.866 18.5L30.7172 11.0737C29.6569 9.17588 27.6531 8 25.4792 8H10C7.79086 8 6 9.79086 6 12V19Z",fill:"#2884FF"}),(0,i.jsx)("path",{d:"M34.6663 18.6667L31.6916 12.7171C30.8354 11.0048 30.4073 10.1486 29.7687 9.5231C29.2039 8.96995 28.5232 8.54926 27.7759 8.29149C26.9308 8 25.9736 8 24.0591 8H13.8663C10.8794 8 9.38592 8 8.24506 8.5813C7.24153 9.09262 6.42563 9.90852 5.91431 10.9121C5.33301 12.0529 5.33301 13.5464 5.33301 16.5333V18.6667M5.33301 18.6667H45.8663C50.3468 18.6667 52.587 18.6667 54.2983 19.5386C55.8036 20.3056 57.0274 21.5294 57.7944 23.0347C58.6663 24.746 58.6663 26.9862 58.6663 31.4667V43.2C58.6663 47.6804 58.6663 49.9206 57.7944 51.6319C57.0274 53.1372 55.8036 54.3611 54.2983 55.1281C52.587 56 50.3468 56 45.8663 56H18.133C13.6526 56 11.4124 56 9.70108 55.1281C8.19579 54.3611 6.97194 53.1372 6.20496 51.6319C5.33301 49.9206 5.33301 47.6804 5.33301 43.2V18.6667Z",stroke:"#2884FF",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),ii=()=>(0,i.jsxs)("svg",{width:"64",height:"64",viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)("path",{opacity:"0.5",d:"M6 19H49C54.5229 19 59 23.4772 59 29V46C59 51.5228 54.5228 56 49 56H14C9.58172 56 6 52.4183 6 48V19Z",fill:"#91CAFF"}),(0,i.jsx)("path",{d:"M6 19L34.866 18.5L30.7172 11.0737C29.6569 9.17588 27.6531 8 25.4792 8H10C7.79086 8 6 9.79086 6 12V19Z",stroke:"currentColor"}),(0,i.jsx)("path",{d:"M34.6663 18.6667L31.6916 12.7171C30.8354 11.0048 30.4073 10.1486 29.7687 9.5231C29.2039 8.96995 28.5232 8.54926 27.7759 8.29149C26.9308 8 25.9736 8 24.0591 8H13.8663C10.8794 8 9.38592 8 8.24506 8.5813C7.24153 9.09262 6.42563 9.90852 5.91431 10.9121C5.33301 12.0529 5.33301 13.5464 5.33301 16.5333V18.6667M5.33301 18.6667H45.8663C50.3468 18.6667 52.587 18.6667 54.2983 19.5386C55.8036 20.3056 57.0274 21.5294 57.7944 23.0347C58.6663 24.746 58.6663 26.9862 58.6663 31.4667V43.2C58.6663 47.6804 58.6663 49.9206 57.7944 51.6319C57.0274 53.1372 55.8036 54.3611 54.2983 55.1281C52.587 56 50.3468 56 45.8663 56H18.133C13.6526 56 11.4124 56 9.70108 55.1281C8.19579 54.3611 6.97194 53.1372 6.20496 51.6319C5.33301 49.9206 5.33301 47.6804 5.33301 43.2V18.6667Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),oi=()=>(0,i.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)("path",{d:"M10.8337 5.83333L9.90404 3.9741C9.6365 3.439 9.50271 3.17144 9.30313 2.97597C9.12664 2.80311 8.91393 2.67164 8.68039 2.59109C8.4163 2.5 8.11716 2.5 7.5189 2.5H4.33366C3.40024 2.5 2.93353 2.5 2.57701 2.68166C2.2634 2.84144 2.00844 3.09641 1.84865 3.41002C1.66699 3.76654 1.66699 4.23325 1.66699 5.16667V5.83333M1.66699 5.83333H14.3337C15.7338 5.83333 16.4339 5.83333 16.9686 6.10582C17.439 6.3455 17.8215 6.72795 18.0612 7.19836C18.3337 7.73314 18.3337 8.4332 18.3337 9.83333V13.5C18.3337 14.9001 18.3337 15.6002 18.0612 16.135C17.8215 16.6054 17.439 16.9878 16.9686 17.2275C16.4339 17.5 15.7338 17.5 14.3337 17.5H5.66699C4.26686 17.5 3.5668 17.5 3.03202 17.2275C2.56161 16.9878 2.17916 16.6054 1.93948 16.135C1.66699 15.6002 1.66699 14.9001 1.66699 13.5V5.83333Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})}),ai=()=>(0,i.jsx)("svg",{width:"48",height:"49",viewBox:"0 0 48 49",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)("path",{d:"M32 24.5L24 16.5M24 16.5L16 24.5M24 16.5V34.9C24 37.6814 24 39.0721 25.101 40.6292C25.8326 41.6638 27.9388 42.9406 29.1944 43.1108C31.0842 43.3668 31.8019 42.9924 33.2371 42.2437C39.6333 38.9071 44 32.2135 44 24.5C44 13.4543 35.0457 4.5 24 4.5C12.9543 4.5 4 13.4543 4 24.5C4 31.9028 8.02199 38.3663 14 41.8244",stroke:"currentColor",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"})}),si=()=>(0,i.jsxs)("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)("rect",{width:"56",height:"56",rx:"24",fill:"#8946FB"}),(0,i.jsx)("path",{d:"M28 36.4722C29.0615 37.4223 30.4633 38 32 38C35.3137 38 38 35.3137 38 32C38 29.2331 36.1271 26.9036 33.5798 26.2102M22.4202 26.2102C19.8729 26.9036 18 29.2331 18 32C18 35.3137 20.6863 38 24 38C27.3137 38 30 35.3137 30 32C30 31.2195 29.851 30.4738 29.5798 29.7898M34 24C34 27.3137 31.3137 30 28 30C24.6863 30 22 27.3137 22 24C22 20.6863 24.6863 18 28 18C31.3137 18 34 20.6863 34 24Z",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),li=()=>(0,i.jsxs)("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)("rect",{width:"56",height:"56",rx:"24",fill:"#7ED846"}),(0,i.jsx)("path",{d:"M20.5 38V33M20.5 23V18M18 20.5H23M18 35.5H23M29 19L27.2658 23.5089C26.9838 24.2421 26.8428 24.6087 26.6235 24.9171C26.4292 25.1904 26.1904 25.4292 25.9171 25.6235C25.6087 25.8428 25.2421 25.9838 24.5089 26.2658L20 28L24.5089 29.7342C25.2421 30.0162 25.6087 30.1572 25.9171 30.3765C26.1904 30.5708 26.4292 30.8096 26.6235 31.0829C26.8428 31.3913 26.9838 31.7579 27.2658 32.4911L29 37L30.7342 32.4911C31.0162 31.7579 31.1572 31.3913 31.3765 31.0829C31.5708 30.8096 31.8096 30.5708 32.0829 30.3765C32.3913 30.1572 32.7579 30.0162 33.4911 29.7342L38 28L33.4911 26.2658C32.7579 25.9838 32.3913 25.8428 32.0829 25.6235C31.8096 25.4292 31.5708 25.1904 31.3765 24.9171C31.1572 24.6087 31.0162 24.2421 30.7342 23.5089L29 19Z",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),ci=()=>(0,i.jsxs)("svg",{width:"48",height:"49",viewBox:"0 0 48 49",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)("path",{d:"M19 18.4307C19 17.4761 19 16.9988 19.1995 16.7324C19.3733 16.5001 19.6394 16.3549 19.9288 16.3342C20.2608 16.3105 20.6622 16.5686 21.4652 17.0848L30.9064 23.1541C31.6032 23.602 31.9516 23.826 32.0719 24.1108C32.177 24.3596 32.177 24.6404 32.0719 24.8892C31.9516 25.174 31.6032 25.398 30.9064 25.8459L21.4652 31.9152C20.6622 32.4314 20.2608 32.6895 19.9288 32.6658C19.6394 32.6451 19.3733 32.4998 19.1995 32.2676C19 32.0012 19 31.5239 19 30.5693V18.4307Z",stroke:"currentColor",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"}),(0,i.jsx)("path",{d:"M6 16.1C6 12.7397 6 11.0595 6.65396 9.77606C7.2292 8.64708 8.14708 7.7292 9.27606 7.15396C10.5595 6.5 12.2397 6.5 15.6 6.5H32.4C35.7603 6.5 37.4405 6.5 38.7239 7.15396C39.8529 7.7292 40.7708 8.64708 41.346 9.77606C42 11.0595 42 12.7397 42 16.1V32.9C42 36.2603 42 37.9405 41.346 39.2239C40.7708 40.3529 39.8529 41.2708 38.7239 41.846C37.4405 42.5 35.7603 42.5 32.4 42.5H15.6C12.2397 42.5 10.5595 42.5 9.27606 41.846C8.14708 41.2708 7.2292 40.3529 6.65396 39.2239C6 37.9405 6 36.2603 6 32.9V16.1Z",stroke:"currentColor",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"})]}),ui=()=>(0,i.jsx)("svg",{width:"48",height:"49",viewBox:"0 0 48 49",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)("path",{d:"M24 41.4444C26.123 43.3446 28.9266 44.5 32 44.5C38.6274 44.5 44 39.1274 44 32.5C44 26.9662 40.2541 22.3072 35.1596 20.9203M12.8404 20.9203C7.74587 22.3072 4 26.9661 4 32.5C4 39.1274 9.37258 44.5 16 44.5C22.6274 44.5 28 39.1274 28 32.5C28 30.939 27.7019 29.4476 27.1596 28.0797M36 16.5C36 23.1274 30.6274 28.5 24 28.5C17.3726 28.5 12 23.1274 12 16.5C12 9.87258 17.3726 4.5 24 4.5C30.6274 4.5 36 9.87258 36 16.5Z",stroke:"currentColor",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"})}),di=e=>(0,i.jsx)(W.A,Object.assign({component:Kr},e)),hi=e=>(0,i.jsx)(W.A,Object.assign({component:Zr},e)),fi=e=>(0,i.jsx)(W.A,Object.assign({component:Jr},e)),pi=e=>(0,i.jsx)(W.A,Object.assign({component:Qr},e)),gi=e=>(0,i.jsx)(W.A,Object.assign({component:ei},e)),mi=e=>(0,i.jsx)(W.A,Object.assign({component:ti},e)),vi=e=>(0,i.jsx)(W.A,Object.assign({component:ni},e)),yi=e=>(0,i.jsx)(W.A,Object.assign({component:ri},e)),bi=e=>(0,i.jsx)(W.A,Object.assign({component:ii},e)),wi=e=>(0,i.jsx)(W.A,Object.assign({component:oi},e)),xi=e=>(0,i.jsx)(W.A,Object.assign({component:ai},e)),Ci=e=>(0,i.jsx)(W.A,Object.assign({component:si},e)),_i=e=>(0,i.jsx)(W.A,Object.assign({component:li},e)),Si=e=>(0,i.jsx)(W.A,Object.assign({component:ci},e)),Ai=e=>(0,i.jsx)(W.A,Object.assign({component:ui},e)),ki=(0,o.createContext)({state:{},actions:{},options:{}}),Ei=()=>(0,o.useContext)(ki),Ii=({children:e,options:t})=>{var n,r,a;const[s,l]=(0,o.useState)([]),[c,u]=(0,o.useState)([]),[h,f]=(0,o.useState)(null),[p,g]=(0,o.useState)(t.searchQuery||""),[m,v]=(0,o.useState)(t.sortBySize||"name"),{config:y}=t,b=(0,o.useCallback)(e=>{var t,n,r;if(e===Nt){const e=!1!==(null===(t=null==y?void 0:y.features)||void 0===t?void 0:t.enableGif),n=!(null==y?void 0:y.enabledTabs)||y.enabledTabs.includes("gif");return e&&n}if(e===Dt){const e=!1!==(null===(n=null==y?void 0:y.features)||void 0===n?void 0:n.enableStockImages),t=!(null==y?void 0:y.enabledTabs)||y.enabledTabs.includes("stock");return e&&t}if(e===zt){const e=!1!==(null===(r=null==y?void 0:y.features)||void 0===r?void 0:r.enableIconStock),t=!(null==y?void 0:y.enabledTabs)||y.enabledTabs.includes("icons");return e&&t}return!0},[null==y?void 0:y.enabledTabs,null===(n=null==y?void 0:y.features)||void 0===n?void 0:n.enableGif,null===(r=null==y?void 0:y.features)||void 0===r?void 0:r.enableIconStock,null===(a=null==y?void 0:y.features)||void 0===a?void 0:a.enableStockImages]),[w,x]=(0,o.useState)("date"),[C,_]=(0,o.useState)("desc"),[S,A]=(0,o.useState)([{id:"folders",name:"\u041f\u0430\u043f\u043a\u0438"}]),[k,E]=(0,o.useState)(""),[I,j]=(0,o.useState)(!1),[T,F]=(0,o.useState)(Lt);(0,o.useEffect)(()=>{(null==y?void 0:y.activeLibraryItem)&&F&&F(b(y.activeLibraryItem)?y.activeLibraryItem:Lt)},[null==y?void 0:y.activeLibraryItem,b,F]),(0,o.useEffect)(()=>{b(T)||F(Lt)},[T,b]);const[O,M]=(0,o.useState)({current:1,pageSize:12,total:0}),[P]=d.A.useForm(),[R]=d.A.useForm(),[L]=d.A.useForm(),[N]=d.A.useForm(),[D]=d.A.useForm(),[z]=d.A.useForm(),[B,U]=(0,o.useState)(!1),[V,H]=(0,o.useState)(!1),[W,$]=(0,o.useState)(!1),[G,q]=(0,o.useState)(!1),[Y,X]=(0,o.useState)(!1),[K,Z]=(0,o.useState)(!1),[J,Q]=(0,o.useState)(!1),[ee,te]=(0,o.useState)(null),[ne,re]=(0,o.useState)(null),[ie,oe]=(0,o.useState)(null),ae=(e,t)=>{A(n=>n.map(n=>n.id===e?Object.assign(Object.assign({},n),{name:t}):n))},se=(0,o.useCallback)(e=>{M(t=>Object.assign(Object.assign({},t),e))},[M]),le=(0,o.useMemo)(()=>{var e;return{folders:s,files:c,selectedFolder:h,searchTerm:p,sortField:m,sortBy:w,sortOrder:C,pathHistory:S,currentMenuFile:k,loading:I,pagination:O,isModalVisible:B,isUrlModalVisible:V,isRenameModalVisible:W,isMoveModalVisible:G,isRenameFolderModalVisible:Y,isCopyModalVisible:K,isDeleteConfirmVisible:J,form:P,urlForm:R,renameForm:L,moveForm:N,renameFolderForm:D,copyForm:z,fileToRename:ee,folderToRename:ne,activeLibraryItem:T,multiSelect:null===(e=null==y?void 0:y.multiSelect)||void 0===e||e,undoDeletion:ie}},[T,null==y?void 0:y.multiSelect,z,k,ee,c,s,P,K,J,B,G,Y,W,V,I,N,O,S,D,L,p,h,w,m,C,ie,R,ne]),ce=(0,o.useMemo)(()=>({setFolders:l,setFiles:u,setSelectedFolder:f,setSearchTerm:g,setSortField:v,setSortBy:x,setSortOrder:_,setPathHistory:A,setLoading:j,setPagination:se,setIsModalVisible:U,setIsUrlModalVisible:H,setIsRenameModalVisible:$,setIsMoveModalVisible:q,setIsRenameFolderModalVisible:X,setIsCopyModalVisible:Z,setIsDeleteConfirmVisible:Q,setFileToRename:te,setFolderToRename:re,setUndoDeletion:oe,updatePathHistoryOnFolderRename:ae,setActiveLibraryItem:e=>F(b(e)?e:Lt),setCurrentMenuFile:E}),[se,b]),ue=(0,o.useMemo)(()=>({state:le,actions:ce,options:t}),[ce,t,le]);return(0,i.jsx)(ki.Provider,{value:ue,children:e})},ji=()=>{const{options:e}=Ei(),{customIcons:t}=e,n=o.useCallback((e,n,r)=>{const i=null==t?void 0:t[e];return i?o.createElement(i,r):o.createElement(n,r)},[t]);return o.useMemo(()=>({RootFolderIcon:e=>n("rootFolder",$.A,e),FolderIcon:e=>n("folder",yi,e),FolderOpenIcon:e=>n("folderOpen",G.A,e),AddFolderIcon:e=>n("addFolder",q.A,e),FileIcon:e=>n("file",Y.A,e),UploadIcon:e=>n("upload",X.A,e),UploadByUrlIcon:e=>n("uploadByUrl",K.A,e),ExpandArrowIcon:e=>n("expandArrow",Z.A,e),CollapseArrowIcon:e=>n("collapseArrow",J.A,e),ExpandFolderIcon:e=>n("expandArrow",Pr,e),CollapseFolderIcon:e=>n("collapseArrow",Mr,e),FolderPreviewIcon:e=>n("folderPreview",bi,e),EmptyFolderIcon:e=>n("folderPreview",wi,e),GridViewIcon:e=>n("gridView",Q.A,e),ListViewIcon:e=>n("listView",ee.A,e),DropZoneFileIcon:e=>n("folderPreview",xi,e),BigStockIcon:e=>n("folderPreview",Ci,e),BigAIIcon:e=>n("folderPreview",_i,e),GifPlayIcon:e=>n("folderPreview",Si,e),StockBigIcon:e=>n("folderPreview",Ai,e),MixedViewIcon:e=>n("mixedView",di,e),LandscapeViewIcon:e=>n("landscapeView",hi,e),PortraitViewIcon:e=>n("portraitView",fi,e),SquareViewIcon:e=>n("squareView",pi,e),LightModeIcon:e=>n("lightMode",mi,e),DarkModeIcon:e=>n("darkMode",vi,e),AiIcon_2:e=>n("aiIcon_2",gi,e),NoFilesIcon:e=>n("noFiles",Rr,e),ThumbsUpIcon:e=>n("thumbsUp",qr,e),getCustomIcon:n}),[n])};const Ti=()=>{const{t:e}=En(),{NoFilesIcon:t}=ji();return(0,i.jsxs)("div",{className:"noFilesContainer",children:[(0,i.jsx)(t,{className:"noFilesImage",size:48,strokeWidth:1.4}),(0,i.jsx)("h2",{className:"noFilesTitle",children:e("There's nothing here")}),(0,i.jsx)("div",{className:"noFilesDescription",children:e("Try using a different search query.")})]})};var Fi,Oi={exports:{}},Mi=Oi.exports,Pi=(Fi||(Fi=1,function(e,t){(function(){var n,r="Expected a function",i="__lodash_hash_undefined__",o="__lodash_placeholder__",a=32,s=128,l=1/0,c=9007199254740991,u=NaN,d=4294967295,h=[["ary",s],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",a],["partialRight",64],["rearg",256]],f="[object Arguments]",p="[object Array]",g="[object Boolean]",m="[object Date]",v="[object Error]",y="[object Function]",b="[object GeneratorFunction]",w="[object Map]",x="[object Number]",C="[object Object]",_="[object Promise]",S="[object RegExp]",A="[object Set]",k="[object String]",E="[object Symbol]",I="[object WeakMap]",j="[object ArrayBuffer]",T="[object DataView]",F="[object Float32Array]",O="[object Float64Array]",M="[object Int8Array]",P="[object Int16Array]",R="[object Int32Array]",L="[object Uint8Array]",N="[object Uint8ClampedArray]",D="[object Uint16Array]",z="[object Uint32Array]",B=/\b__p \+= '';/g,U=/\b(__p \+=) '' \+/g,V=/(__e\(.*?\)|\b__t\)) \+\n'';/g,H=/&(?:amp|lt|gt|quot|#39);/g,W=/[&<>"']/g,$=RegExp(H.source),G=RegExp(W.source),q=/<%-([\s\S]+?)%>/g,Y=/<%([\s\S]+?)%>/g,X=/<%=([\s\S]+?)%>/g,K=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Z=/^\w*$/,J=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Q=/[\\^$.*+?()[\]{}|]/g,ee=RegExp(Q.source),te=/^\s+/,ne=/\s/,re=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ie=/\{\n\/\* \[wrapped with (.+)\] \*/,oe=/,? & /,ae=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,se=/[()=,{}\[\]\/\s]/,le=/\\(\\)?/g,ce=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ue=/\w*$/,de=/^[-+]0x[0-9a-f]+$/i,he=/^0b[01]+$/i,fe=/^\[object .+?Constructor\]$/,pe=/^0o[0-7]+$/i,ge=/^(?:0|[1-9]\d*)$/,me=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ve=/($^)/,ye=/['\n\r\u2028\u2029\\]/g,be="\\ud800-\\udfff",we="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",xe="\\u2700-\\u27bf",Ce="a-z\\xdf-\\xf6\\xf8-\\xff",_e="A-Z\\xc0-\\xd6\\xd8-\\xde",Se="\\ufe0e\\ufe0f",Ae="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ke="["+be+"]",Ee="["+Ae+"]",Ie="["+we+"]",je="\\d+",Te="["+xe+"]",Fe="["+Ce+"]",Oe="[^"+be+Ae+je+xe+Ce+_e+"]",Me="\\ud83c[\\udffb-\\udfff]",Pe="[^"+be+"]",Re="(?:\\ud83c[\\udde6-\\uddff]){2}",Le="[\\ud800-\\udbff][\\udc00-\\udfff]",Ne="["+_e+"]",De="\\u200d",ze="(?:"+Fe+"|"+Oe+")",Be="(?:"+Ne+"|"+Oe+")",Ue="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",Ve="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",He="(?:"+Ie+"|"+Me+")?",We="["+Se+"]?",$e=We+He+"(?:"+De+"(?:"+[Pe,Re,Le].join("|")+")"+We+He+")*",Ge="(?:"+[Te,Re,Le].join("|")+")"+$e,qe="(?:"+[Pe+Ie+"?",Ie,Re,Le,ke].join("|")+")",Ye=RegExp("['\u2019]","g"),Xe=RegExp(Ie,"g"),Ke=RegExp(Me+"(?="+Me+")|"+qe+$e,"g"),Ze=RegExp([Ne+"?"+Fe+"+"+Ue+"(?="+[Ee,Ne,"$"].join("|")+")",Be+"+"+Ve+"(?="+[Ee,Ne+ze,"$"].join("|")+")",Ne+"?"+ze+"+"+Ue,Ne+"+"+Ve,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",je,Ge].join("|"),"g"),Je=RegExp("["+De+be+we+Se+"]"),Qe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,et=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],tt=-1,nt={};nt[F]=nt[O]=nt[M]=nt[P]=nt[R]=nt[L]=nt[N]=nt[D]=nt[z]=!0,nt[f]=nt[p]=nt[j]=nt[g]=nt[T]=nt[m]=nt[v]=nt[y]=nt[w]=nt[x]=nt[C]=nt[S]=nt[A]=nt[k]=nt[I]=!1;var rt={};rt[f]=rt[p]=rt[j]=rt[T]=rt[g]=rt[m]=rt[F]=rt[O]=rt[M]=rt[P]=rt[R]=rt[w]=rt[x]=rt[C]=rt[S]=rt[A]=rt[k]=rt[E]=rt[L]=rt[N]=rt[D]=rt[z]=!0,rt[v]=rt[y]=rt[I]=!1;var it={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ot=parseFloat,at=parseInt,st="object"==typeof dn&&dn&&dn.Object===Object&&dn,lt="object"==typeof self&&self&&self.Object===Object&&self,ct=st||lt||Function("return this")(),ut=t&&!t.nodeType&&t,dt=ut&&e&&!e.nodeType&&e,ht=dt&&dt.exports===ut,ft=ht&&st.process,pt=function(){try{return dt&&dt.require&&dt.require("util").types||ft&&ft.binding&&ft.binding("util")}catch(e){}}(),gt=pt&&pt.isArrayBuffer,mt=pt&&pt.isDate,vt=pt&&pt.isMap,yt=pt&&pt.isRegExp,bt=pt&&pt.isSet,wt=pt&&pt.isTypedArray;function xt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Ct(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i<o;){var a=e[i];t(r,a,n(a),e)}return r}function _t(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function St(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function At(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function kt(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}function Et(e,t){return!(null==e||!e.length)&&Nt(e,t,0)>-1}function It(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function jt(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}function Tt(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function Ft(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function Ot(e,t,n,r){var i=null==e?0:e.length;for(r&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function Mt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var Pt=Ut("length");function Rt(e,t,n){var r;return n(e,function(e,n,i){if(t(e,n,i))return r=n,!1}),r}function Lt(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function Nt(e,t,n){return t==t?function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}(e,t,n):Lt(e,zt,n)}function Dt(e,t,n,r){for(var i=n-1,o=e.length;++i<o;)if(r(e[i],t))return i;return-1}function zt(e){return e!=e}function Bt(e,t){var n=null==e?0:e.length;return n?Wt(e,t)/n:u}function Ut(e){return function(t){return null==t?n:t[e]}}function Vt(e){return function(t){return null==e?n:e[t]}}function Ht(e,t,n,r,i){return i(e,function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)}),n}function Wt(e,t){for(var r,i=-1,o=e.length;++i<o;){var a=t(e[i]);a!==n&&(r=r===n?a:r+a)}return r}function $t(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function Gt(e){return e?e.slice(0,cn(e)+1).replace(te,""):e}function qt(e){return function(t){return e(t)}}function Yt(e,t){return jt(t,function(t){return e[t]})}function Xt(e,t){return e.has(t)}function Kt(e,t){for(var n=-1,r=e.length;++n<r&&Nt(t,e[n],0)>-1;);return n}function Zt(e,t){for(var n=e.length;n--&&Nt(t,e[n],0)>-1;);return n}var Jt=Vt({"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i","\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O","\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"}),Qt=Vt({"&":"&","<":"<",">":">",'"':""","'":"'"});function en(e){return"\\"+it[e]}function tn(e){return Je.test(e)}function nn(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function rn(e,t){return function(n){return e(t(n))}}function on(e,t){for(var n=-1,r=e.length,i=0,a=[];++n<r;){var s=e[n];s!==t&&s!==o||(e[n]=o,a[i++]=n)}return a}function an(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function sn(e){return tn(e)?function(e){for(var t=Ke.lastIndex=0;Ke.test(e);)++t;return t}(e):Pt(e)}function ln(e){return tn(e)?function(e){return e.match(Ke)||[]}(e):function(e){return e.split("")}(e)}function cn(e){for(var t=e.length;t--&&ne.test(e.charAt(t)););return t}var un=Vt({"&":"&","<":"<",">":">",""":'"',"'":"'"}),hn=function e(t){var ne,be=(t=null==t?ct:hn.defaults(ct.Object(),t,hn.pick(ct,et))).Array,we=t.Date,xe=t.Error,Ce=t.Function,_e=t.Math,Se=t.Object,Ae=t.RegExp,ke=t.String,Ee=t.TypeError,Ie=be.prototype,je=Ce.prototype,Te=Se.prototype,Fe=t["__core-js_shared__"],Oe=je.toString,Me=Te.hasOwnProperty,Pe=0,Re=(ne=/[^.]+$/.exec(Fe&&Fe.keys&&Fe.keys.IE_PROTO||""))?"Symbol(src)_1."+ne:"",Le=Te.toString,Ne=Oe.call(Se),De=ct._,ze=Ae("^"+Oe.call(Me).replace(Q,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Be=ht?t.Buffer:n,Ue=t.Symbol,Ve=t.Uint8Array,He=Be?Be.allocUnsafe:n,We=rn(Se.getPrototypeOf,Se),$e=Se.create,Ge=Te.propertyIsEnumerable,qe=Ie.splice,Ke=Ue?Ue.isConcatSpreadable:n,Je=Ue?Ue.iterator:n,it=Ue?Ue.toStringTag:n,st=function(){try{var e=so(Se,"defineProperty");return e({},"",{}),e}catch(e){}}(),lt=t.clearTimeout!==ct.clearTimeout&&t.clearTimeout,ut=we&&we.now!==ct.Date.now&&we.now,dt=t.setTimeout!==ct.setTimeout&&t.setTimeout,ft=_e.ceil,pt=_e.floor,Pt=Se.getOwnPropertySymbols,Vt=Be?Be.isBuffer:n,dn=t.isFinite,fn=Ie.join,pn=rn(Se.keys,Se),gn=_e.max,mn=_e.min,vn=we.now,yn=t.parseInt,bn=_e.random,wn=Ie.reverse,xn=so(t,"DataView"),Cn=so(t,"Map"),_n=so(t,"Promise"),Sn=so(t,"Set"),An=so(t,"WeakMap"),kn=so(Se,"create"),En=An&&new An,In={},jn=Po(xn),Tn=Po(Cn),Fn=Po(_n),On=Po(Sn),Mn=Po(An),Pn=Ue?Ue.prototype:n,Rn=Pn?Pn.valueOf:n,Ln=Pn?Pn.toString:n;function Nn(e){if(Za(e)&&!Ba(e)&&!(e instanceof Un)){if(e instanceof Bn)return e;if(Me.call(e,"__wrapped__"))return Ro(e)}return new Bn(e)}var Dn=function(){function e(){}return function(t){if(!Ka(t))return{};if($e)return $e(t);e.prototype=t;var r=new e;return e.prototype=n,r}}();function zn(){}function Bn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=n}function Un(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d,this.__views__=[]}function Vn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Hn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Wn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function $n(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Wn;++t<n;)this.add(e[t])}function Gn(e){var t=this.__data__=new Hn(e);this.size=t.size}function qn(e,t){var n=Ba(e),r=!n&&za(e),i=!n&&!r&&Wa(e),o=!n&&!r&&!i&&os(e),a=n||r||i||o,s=a?$t(e.length,ke):[],l=s.length;for(var c in e)!t&&!Me.call(e,c)||a&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||go(c,l))||s.push(c);return s}function Yn(e){var t=e.length;return t?e[Wr(0,t-1)]:n}function Xn(e,t){return Fo(Ai(e),ir(t,0,e.length))}function Kn(e){return Fo(Ai(e))}function Zn(e,t,r){(r!==n&&!La(e[t],r)||r===n&&!(t in e))&&nr(e,t,r)}function Jn(e,t,r){var i=e[t];Me.call(e,t)&&La(i,r)&&(r!==n||t in e)||nr(e,t,r)}function Qn(e,t){for(var n=e.length;n--;)if(La(e[n][0],t))return n;return-1}function er(e,t,n,r){return cr(e,function(e,i,o){t(r,e,n(e),o)}),r}function tr(e,t){return e&&ki(t,Es(t),e)}function nr(e,t,n){"__proto__"==t&&st?st(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function rr(e,t){for(var r=-1,i=t.length,o=be(i),a=null==e;++r<i;)o[r]=a?n:Cs(e,t[r]);return o}function ir(e,t,r){return e==e&&(r!==n&&(e=e<=r?e:r),t!==n&&(e=e>=t?e:t)),e}function or(e,t,r,i,o,a){var s,l=1&t,c=2&t,u=4&t;if(r&&(s=o?r(e,i,o,a):r(e)),s!==n)return s;if(!Ka(e))return e;var d=Ba(e);if(d){if(s=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Me.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!l)return Ai(e,s)}else{var h=uo(e),p=h==y||h==b;if(Wa(e))return bi(e,l);if(h==C||h==f||p&&!o){if(s=c||p?{}:fo(e),!l)return c?function(e,t){return ki(e,co(e),t)}(e,function(e,t){return e&&ki(t,Is(t),e)}(s,e)):function(e,t){return ki(e,lo(e),t)}(e,tr(s,e))}else{if(!rt[h])return o?e:{};s=function(e,t,n){var r,i=e.constructor;switch(t){case j:return wi(e);case g:case m:return new i(+e);case T:return function(e,t){var n=t?wi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case F:case O:case M:case P:case R:case L:case N:case D:case z:return xi(e,n);case w:return new i;case x:case k:return new i(e);case S:return function(e){var t=new e.constructor(e.source,ue.exec(e));return t.lastIndex=e.lastIndex,t}(e);case A:return new i;case E:return r=e,Rn?Se(Rn.call(r)):{}}}(e,h,l)}}a||(a=new Gn);var v=a.get(e);if(v)return v;a.set(e,s),ns(e)?e.forEach(function(n){s.add(or(n,t,r,n,e,a))}):Ja(e)&&e.forEach(function(n,i){s.set(i,or(n,t,r,i,e,a))});var _=d?n:(u?c?eo:Qi:c?Is:Es)(e);return _t(_||e,function(n,i){_&&(n=e[i=n]),Jn(s,i,or(n,t,r,i,e,a))}),s}function ar(e,t,r){var i=r.length;if(null==e)return!i;for(e=Se(e);i--;){var o=r[i],a=t[o],s=e[o];if(s===n&&!(o in e)||!a(s))return!1}return!0}function sr(e,t,i){if("function"!=typeof e)throw new Ee(r);return Eo(function(){e.apply(n,i)},t)}function lr(e,t,n,r){var i=-1,o=Et,a=!0,s=e.length,l=[],c=t.length;if(!s)return l;n&&(t=jt(t,qt(n))),r?(o=It,a=!1):t.length>=200&&(o=Xt,a=!1,t=new $n(t));e:for(;++i<s;){var u=e[i],d=null==n?u:n(u);if(u=r||0!==u?u:0,a&&d==d){for(var h=c;h--;)if(t[h]===d)continue e;l.push(u)}else o(t,d,r)||l.push(u)}return l}Nn.templateSettings={escape:q,evaluate:Y,interpolate:X,variable:"",imports:{_:Nn}},Nn.prototype=zn.prototype,Nn.prototype.constructor=Nn,Bn.prototype=Dn(zn.prototype),Bn.prototype.constructor=Bn,Un.prototype=Dn(zn.prototype),Un.prototype.constructor=Un,Vn.prototype.clear=function(){this.__data__=kn?kn(null):{},this.size=0},Vn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Vn.prototype.get=function(e){var t=this.__data__;if(kn){var r=t[e];return r===i?n:r}return Me.call(t,e)?t[e]:n},Vn.prototype.has=function(e){var t=this.__data__;return kn?t[e]!==n:Me.call(t,e)},Vn.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=kn&&t===n?i:t,this},Hn.prototype.clear=function(){this.__data__=[],this.size=0},Hn.prototype.delete=function(e){var t=this.__data__,n=Qn(t,e);return!(n<0||(n==t.length-1?t.pop():qe.call(t,n,1),--this.size,0))},Hn.prototype.get=function(e){var t=this.__data__,r=Qn(t,e);return r<0?n:t[r][1]},Hn.prototype.has=function(e){return Qn(this.__data__,e)>-1},Hn.prototype.set=function(e,t){var n=this.__data__,r=Qn(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Wn.prototype.clear=function(){this.size=0,this.__data__={hash:new Vn,map:new(Cn||Hn),string:new Vn}},Wn.prototype.delete=function(e){var t=oo(this,e).delete(e);return this.size-=t?1:0,t},Wn.prototype.get=function(e){return oo(this,e).get(e)},Wn.prototype.has=function(e){return oo(this,e).has(e)},Wn.prototype.set=function(e,t){var n=oo(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},$n.prototype.add=$n.prototype.push=function(e){return this.__data__.set(e,i),this},$n.prototype.has=function(e){return this.__data__.has(e)},Gn.prototype.clear=function(){this.__data__=new Hn,this.size=0},Gn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Gn.prototype.get=function(e){return this.__data__.get(e)},Gn.prototype.has=function(e){return this.__data__.has(e)},Gn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Hn){var r=n.__data__;if(!Cn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Wn(r)}return n.set(e,t),this.size=n.size,this};var cr=ji(vr),ur=ji(yr,!0);function dr(e,t){var n=!0;return cr(e,function(e,r,i){return n=!!t(e,r,i)}),n}function hr(e,t,r){for(var i=-1,o=e.length;++i<o;){var a=e[i],s=t(a);if(null!=s&&(l===n?s==s&&!is(s):r(s,l)))var l=s,c=a}return c}function fr(e,t){var n=[];return cr(e,function(e,r,i){t(e,r,i)&&n.push(e)}),n}function pr(e,t,n,r,i){var o=-1,a=e.length;for(n||(n=po),i||(i=[]);++o<a;){var s=e[o];t>0&&n(s)?t>1?pr(s,t-1,n,r,i):Tt(i,s):r||(i[i.length]=s)}return i}var gr=Ti(),mr=Ti(!0);function vr(e,t){return e&&gr(e,t,Es)}function yr(e,t){return e&&mr(e,t,Es)}function br(e,t){return kt(t,function(t){return qa(e[t])})}function wr(e,t){for(var r=0,i=(t=gi(t,e)).length;null!=e&&r<i;)e=e[Mo(t[r++])];return r&&r==i?e:n}function xr(e,t,n){var r=t(e);return Ba(e)?r:Tt(r,n(e))}function Cr(e){return null==e?e===n?"[object Undefined]":"[object Null]":it&&it in Se(e)?function(e){var t=Me.call(e,it),r=e[it];try{e[it]=n;var i=!0}catch(e){}var o=Le.call(e);return i&&(t?e[it]=r:delete e[it]),o}(e):function(e){return Le.call(e)}(e)}function _r(e,t){return e>t}function Sr(e,t){return null!=e&&Me.call(e,t)}function Ar(e,t){return null!=e&&t in Se(e)}function kr(e,t,r){for(var i=r?It:Et,o=e[0].length,a=e.length,s=a,l=be(a),c=1/0,u=[];s--;){var d=e[s];s&&t&&(d=jt(d,qt(t))),c=mn(d.length,c),l[s]=!r&&(t||o>=120&&d.length>=120)?new $n(s&&d):n}d=e[0];var h=-1,f=l[0];e:for(;++h<o&&u.length<c;){var p=d[h],g=t?t(p):p;if(p=r||0!==p?p:0,!(f?Xt(f,g):i(u,g,r))){for(s=a;--s;){var m=l[s];if(!(m?Xt(m,g):i(e[s],g,r)))continue e}f&&f.push(g),u.push(p)}}return u}function Er(e,t,r){var i=null==(e=So(e,t=gi(t,e)))?e:e[Mo(Go(t))];return null==i?n:xt(i,e,r)}function Ir(e){return Za(e)&&Cr(e)==f}function jr(e,t,r,i,o){return e===t||(null==e||null==t||!Za(e)&&!Za(t)?e!=e&&t!=t:function(e,t,r,i,o,a){var s=Ba(e),l=Ba(t),c=s?p:uo(e),u=l?p:uo(t),d=(c=c==f?C:c)==C,h=(u=u==f?C:u)==C,y=c==u;if(y&&Wa(e)){if(!Wa(t))return!1;s=!0,d=!1}if(y&&!d)return a||(a=new Gn),s||os(e)?Zi(e,t,r,i,o,a):function(e,t,n,r,i,o,a){switch(n){case T:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case j:return!(e.byteLength!=t.byteLength||!o(new Ve(e),new Ve(t)));case g:case m:case x:return La(+e,+t);case v:return e.name==t.name&&e.message==t.message;case S:case k:return e==t+"";case w:var s=nn;case A:var l=1&r;if(s||(s=an),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;r|=2,a.set(e,t);var u=Zi(s(e),s(t),r,i,o,a);return a.delete(e),u;case E:if(Rn)return Rn.call(e)==Rn.call(t)}return!1}(e,t,c,r,i,o,a);if(!(1&r)){var b=d&&Me.call(e,"__wrapped__"),_=h&&Me.call(t,"__wrapped__");if(b||_){var I=b?e.value():e,F=_?t.value():t;return a||(a=new Gn),o(I,F,r,i,a)}}return!!y&&(a||(a=new Gn),function(e,t,r,i,o,a){var s=1&r,l=Qi(e),c=l.length;if(c!=Qi(t).length&&!s)return!1;for(var u=c;u--;){var d=l[u];if(!(s?d in t:Me.call(t,d)))return!1}var h=a.get(e),f=a.get(t);if(h&&f)return h==t&&f==e;var p=!0;a.set(e,t),a.set(t,e);for(var g=s;++u<c;){var m=e[d=l[u]],v=t[d];if(i)var y=s?i(v,m,d,t,e,a):i(m,v,d,e,t,a);if(!(y===n?m===v||o(m,v,r,i,a):y)){p=!1;break}g||(g="constructor"==d)}if(p&&!g){var b=e.constructor,w=t.constructor;b==w||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof w&&w instanceof w||(p=!1)}return a.delete(e),a.delete(t),p}(e,t,r,i,o,a))}(e,t,r,i,jr,o))}function Tr(e,t,r,i){var o=r.length,a=o,s=!i;if(null==e)return!a;for(e=Se(e);o--;){var l=r[o];if(s&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++o<a;){var c=(l=r[o])[0],u=e[c],d=l[1];if(s&&l[2]){if(u===n&&!(c in e))return!1}else{var h=new Gn;if(i)var f=i(u,d,c,e,t,h);if(!(f===n?jr(d,u,3,i,h):f))return!1}}return!0}function Fr(e){return!(!Ka(e)||(t=e,Re&&Re in t))&&(qa(e)?ze:fe).test(Po(e));var t}function Or(e){return"function"==typeof e?e:null==e?Qs:"object"==typeof e?Ba(e)?Nr(e[0],e[1]):Lr(e):ll(e)}function Mr(e){if(!wo(e))return pn(e);var t=[];for(var n in Se(e))Me.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Pr(e,t){return e<t}function Rr(e,t){var n=-1,r=Va(e)?be(e.length):[];return cr(e,function(e,i,o){r[++n]=t(e,i,o)}),r}function Lr(e){var t=ao(e);return 1==t.length&&t[0][2]?Co(t[0][0],t[0][1]):function(n){return n===e||Tr(n,e,t)}}function Nr(e,t){return vo(e)&&xo(t)?Co(Mo(e),t):function(r){var i=Cs(r,e);return i===n&&i===t?_s(r,e):jr(t,i,3)}}function Dr(e,t,r,i,o){e!==t&&gr(t,function(a,s){if(o||(o=new Gn),Ka(a))!function(e,t,r,i,o,a,s){var l=Ao(e,r),c=Ao(t,r),u=s.get(c);if(u)Zn(e,r,u);else{var d=a?a(l,c,r+"",e,t,s):n,h=d===n;if(h){var f=Ba(c),p=!f&&Wa(c),g=!f&&!p&&os(c);d=c,f||p||g?Ba(l)?d=l:Ha(l)?d=Ai(l):p?(h=!1,d=bi(c,!0)):g?(h=!1,d=xi(c,!0)):d=[]:es(c)||za(c)?(d=l,za(l)?d=fs(l):Ka(l)&&!qa(l)||(d=fo(c))):h=!1}h&&(s.set(c,d),o(d,c,i,a,s),s.delete(c)),Zn(e,r,d)}}(e,t,s,r,Dr,i,o);else{var l=i?i(Ao(e,s),a,s+"",e,t,o):n;l===n&&(l=a),Zn(e,s,l)}},Is)}function zr(e,t){var r=e.length;if(r)return go(t+=t<0?r:0,r)?e[t]:n}function Br(e,t,n){t=t.length?jt(t,function(e){return Ba(e)?function(t){return wr(t,1===e.length?e[0]:e)}:e}):[Qs];var r=-1;t=jt(t,qt(io()));var i=Rr(e,function(e,n,i){var o=jt(t,function(t){return t(e)});return{criteria:o,index:++r,value:e}});return function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}(i,function(e,t){return function(e,t,n){for(var r=-1,i=e.criteria,o=t.criteria,a=i.length,s=n.length;++r<a;){var l=Ci(i[r],o[r]);if(l)return r>=s?l:l*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)})}function Ur(e,t,n){for(var r=-1,i=t.length,o={};++r<i;){var a=t[r],s=wr(e,a);n(s,a)&&Xr(o,gi(a,e),s)}return o}function Vr(e,t,n,r){var i=r?Dt:Nt,o=-1,a=t.length,s=e;for(e===t&&(t=Ai(t)),n&&(s=jt(e,qt(n)));++o<a;)for(var l=0,c=t[o],u=n?n(c):c;(l=i(s,u,l,r))>-1;)s!==e&&qe.call(s,l,1),qe.call(e,l,1);return e}function Hr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;go(i)?qe.call(e,i,1):si(e,i)}}return e}function Wr(e,t){return e+pt(bn()*(t-e+1))}function $r(e,t){var n="";if(!e||t<1||t>c)return n;do{t%2&&(n+=e),(t=pt(t/2))&&(e+=e)}while(t);return n}function Gr(e,t){return Io(_o(e,t,Qs),e+"")}function qr(e){return Yn(Ls(e))}function Yr(e,t){var n=Ls(e);return Fo(n,ir(t,0,n.length))}function Xr(e,t,r,i){if(!Ka(e))return e;for(var o=-1,a=(t=gi(t,e)).length,s=a-1,l=e;null!=l&&++o<a;){var c=Mo(t[o]),u=r;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(o!=s){var d=l[c];(u=i?i(d,c,l):n)===n&&(u=Ka(d)?d:go(t[o+1])?[]:{})}Jn(l,c,u),l=l[c]}return e}var Kr=En?function(e,t){return En.set(e,t),e}:Qs,Zr=st?function(e,t){return st(e,"toString",{configurable:!0,enumerable:!1,value:Ks(t),writable:!0})}:Qs;function Jr(e){return Fo(Ls(e))}function Qr(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=be(i);++r<i;)o[r]=e[r+t];return o}function ei(e,t){var n;return cr(e,function(e,r,i){return!(n=t(e,r,i))}),!!n}function ti(e,t,n){var r=0,i=null==e?r:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;r<i;){var o=r+i>>>1,a=e[o];null!==a&&!is(a)&&(n?a<=t:a<t)?r=o+1:i=o}return i}return ni(e,t,Qs,n)}function ni(e,t,r,i){var o=0,a=null==e?0:e.length;if(0===a)return 0;for(var s=(t=r(t))!=t,l=null===t,c=is(t),u=t===n;o<a;){var d=pt((o+a)/2),h=r(e[d]),f=h!==n,p=null===h,g=h==h,m=is(h);if(s)var v=i||g;else v=u?g&&(i||f):l?g&&f&&(i||!p):c?g&&f&&!p&&(i||!m):!p&&!m&&(i?h<=t:h<t);v?o=d+1:a=d}return mn(a,4294967294)}function ri(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var a=e[n],s=t?t(a):a;if(!n||!La(s,l)){var l=s;o[i++]=0===a?0:a}}return o}function ii(e){return"number"==typeof e?e:is(e)?u:+e}function oi(e){if("string"==typeof e)return e;if(Ba(e))return jt(e,oi)+"";if(is(e))return Ln?Ln.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function ai(e,t,n){var r=-1,i=Et,o=e.length,a=!0,s=[],l=s;if(n)a=!1,i=It;else if(o>=200){var c=t?null:$i(e);if(c)return an(c);a=!1,i=Xt,l=new $n}else l=t?[]:s;e:for(;++r<o;){var u=e[r],d=t?t(u):u;if(u=n||0!==u?u:0,a&&d==d){for(var h=l.length;h--;)if(l[h]===d)continue e;t&&l.push(d),s.push(u)}else i(l,d,n)||(l!==s&&l.push(d),s.push(u))}return s}function si(e,t){return null==(e=So(e,t=gi(t,e)))||delete e[Mo(Go(t))]}function li(e,t,n,r){return Xr(e,t,n(wr(e,t)),r)}function ci(e,t,n,r){for(var i=e.length,o=r?i:-1;(r?o--:++o<i)&&t(e[o],o,e););return n?Qr(e,r?0:o,r?o+1:i):Qr(e,r?o+1:0,r?i:o)}function ui(e,t){var n=e;return n instanceof Un&&(n=n.value()),Ft(t,function(e,t){return t.func.apply(t.thisArg,Tt([e],t.args))},n)}function di(e,t,n){var r=e.length;if(r<2)return r?ai(e[0]):[];for(var i=-1,o=be(r);++i<r;)for(var a=e[i],s=-1;++s<r;)s!=i&&(o[i]=lr(o[i]||a,e[s],t,n));return ai(pr(o,1),t,n)}function hi(e,t,r){for(var i=-1,o=e.length,a=t.length,s={};++i<o;){var l=i<a?t[i]:n;r(s,e[i],l)}return s}function fi(e){return Ha(e)?e:[]}function pi(e){return"function"==typeof e?e:Qs}function gi(e,t){return Ba(e)?e:vo(e,t)?[e]:Oo(ps(e))}var mi=Gr;function vi(e,t,r){var i=e.length;return r=r===n?i:r,!t&&r>=i?e:Qr(e,t,r)}var yi=lt||function(e){return ct.clearTimeout(e)};function bi(e,t){if(t)return e.slice();var n=e.length,r=He?He(n):new e.constructor(n);return e.copy(r),r}function wi(e){var t=new e.constructor(e.byteLength);return new Ve(t).set(new Ve(e)),t}function xi(e,t){var n=t?wi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Ci(e,t){if(e!==t){var r=e!==n,i=null===e,o=e==e,a=is(e),s=t!==n,l=null===t,c=t==t,u=is(t);if(!l&&!u&&!a&&e>t||a&&s&&c&&!l&&!u||i&&s&&c||!r&&c||!o)return 1;if(!i&&!a&&!u&&e<t||u&&r&&o&&!i&&!a||l&&r&&o||!s&&o||!c)return-1}return 0}function _i(e,t,n,r){for(var i=-1,o=e.length,a=n.length,s=-1,l=t.length,c=gn(o-a,0),u=be(l+c),d=!r;++s<l;)u[s]=t[s];for(;++i<a;)(d||i<o)&&(u[n[i]]=e[i]);for(;c--;)u[s++]=e[i++];return u}function Si(e,t,n,r){for(var i=-1,o=e.length,a=-1,s=n.length,l=-1,c=t.length,u=gn(o-s,0),d=be(u+c),h=!r;++i<u;)d[i]=e[i];for(var f=i;++l<c;)d[f+l]=t[l];for(;++a<s;)(h||i<o)&&(d[f+n[a]]=e[i++]);return d}function Ai(e,t){var n=-1,r=e.length;for(t||(t=be(r));++n<r;)t[n]=e[n];return t}function ki(e,t,r,i){var o=!r;r||(r={});for(var a=-1,s=t.length;++a<s;){var l=t[a],c=i?i(r[l],e[l],l,r,e):n;c===n&&(c=e[l]),o?nr(r,l,c):Jn(r,l,c)}return r}function Ei(e,t){return function(n,r){var i=Ba(n)?Ct:er,o=t?t():{};return i(n,e,io(r,2),o)}}function Ii(e){return Gr(function(t,r){var i=-1,o=r.length,a=o>1?r[o-1]:n,s=o>2?r[2]:n;for(a=e.length>3&&"function"==typeof a?(o--,a):n,s&&mo(r[0],r[1],s)&&(a=o<3?n:a,o=1),t=Se(t);++i<o;){var l=r[i];l&&e(t,l,i,a)}return t})}function ji(e,t){return function(n,r){if(null==n)return n;if(!Va(n))return e(n,r);for(var i=n.length,o=t?i:-1,a=Se(n);(t?o--:++o<i)&&!1!==r(a[o],o,a););return n}}function Ti(e){return function(t,n,r){for(var i=-1,o=Se(t),a=r(t),s=a.length;s--;){var l=a[e?s:++i];if(!1===n(o[l],l,o))break}return t}}function Fi(e){return function(t){var r=tn(t=ps(t))?ln(t):n,i=r?r[0]:t.charAt(0),o=r?vi(r,1).join(""):t.slice(1);return i[e]()+o}}function Oi(e){return function(t){return Ft(qs(zs(t).replace(Ye,"")),e,"")}}function Mi(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Dn(e.prototype),r=e.apply(n,t);return Ka(r)?r:n}}function Pi(e){return function(t,r,i){var o=Se(t);if(!Va(t)){var a=io(r,3);t=Es(t),r=function(e){return a(o[e],e,o)}}var s=e(t,r,i);return s>-1?o[a?t[s]:s]:n}}function Ri(e){return Ji(function(t){var i=t.length,o=i,a=Bn.prototype.thru;for(e&&t.reverse();o--;){var s=t[o];if("function"!=typeof s)throw new Ee(r);if(a&&!l&&"wrapper"==no(s))var l=new Bn([],!0)}for(o=l?o:i;++o<i;){var c=no(s=t[o]),u="wrapper"==c?to(s):n;l=u&&yo(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?l[no(u[0])].apply(l,u[3]):1==s.length&&yo(s)?l[c]():l.thru(s)}return function(){var e=arguments,n=e[0];if(l&&1==e.length&&Ba(n))return l.plant(n).value();for(var r=0,o=i?t[r].apply(this,e):n;++r<i;)o=t[r].call(this,o);return o}})}function Li(e,t,r,i,o,a,l,c,u,d){var h=t&s,f=1&t,p=2&t,g=24&t,m=512&t,v=p?n:Mi(e);return function s(){for(var y=arguments.length,b=be(y),w=y;w--;)b[w]=arguments[w];if(g)var x=ro(s),C=function(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}(b,x);if(i&&(b=_i(b,i,o,g)),a&&(b=Si(b,a,l,g)),y-=C,g&&y<d){var _=on(b,x);return Hi(e,t,Li,s.placeholder,r,b,_,c,u,d-y)}var S=f?r:this,A=p?S[e]:e;return y=b.length,c?b=function(e,t){for(var r=e.length,i=mn(t.length,r),o=Ai(e);i--;){var a=t[i];e[i]=go(a,r)?o[a]:n}return e}(b,c):m&&y>1&&b.reverse(),h&&u<y&&(b.length=u),this&&this!==ct&&this instanceof s&&(A=v||Mi(A)),A.apply(S,b)}}function Ni(e,t){return function(n,r){return function(e,t,n,r){return vr(e,function(e,i,o){t(r,n(e),i,o)}),r}(n,e,t(r),{})}}function Di(e,t){return function(r,i){var o;if(r===n&&i===n)return t;if(r!==n&&(o=r),i!==n){if(o===n)return i;"string"==typeof r||"string"==typeof i?(r=oi(r),i=oi(i)):(r=ii(r),i=ii(i)),o=e(r,i)}return o}}function zi(e){return Ji(function(t){return t=jt(t,qt(io())),Gr(function(n){var r=this;return e(t,function(e){return xt(e,r,n)})})})}function Bi(e,t){var r=(t=t===n?" ":oi(t)).length;if(r<2)return r?$r(t,e):t;var i=$r(t,ft(e/sn(t)));return tn(t)?vi(ln(i),0,e).join(""):i.slice(0,e)}function Ui(e){return function(t,r,i){return i&&"number"!=typeof i&&mo(t,r,i)&&(r=i=n),t=cs(t),r===n?(r=t,t=0):r=cs(r),function(e,t,n,r){for(var i=-1,o=gn(ft((t-e)/(n||1)),0),a=be(o);o--;)a[r?o:++i]=e,e+=n;return a}(t,r,i=i===n?t<r?1:-1:cs(i),e)}}function Vi(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=hs(t),n=hs(n)),e(t,n)}}function Hi(e,t,r,i,o,s,l,c,u,d){var h=8&t;t|=h?a:64,4&(t&=~(h?64:a))||(t&=-4);var f=[e,t,o,h?s:n,h?l:n,h?n:s,h?n:l,c,u,d],p=r.apply(n,f);return yo(e)&&ko(p,f),p.placeholder=i,jo(p,e,t)}function Wi(e){var t=_e[e];return function(e,n){if(e=hs(e),(n=null==n?0:mn(us(n),292))&&dn(e)){var r=(ps(e)+"e").split("e");return+((r=(ps(t(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return t(e)}}var $i=Sn&&1/an(new Sn([,-0]))[1]==l?function(e){return new Sn(e)}:il;function Gi(e){return function(t){var n=uo(t);return n==w?nn(t):n==A?function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}(t):function(e,t){return jt(t,function(t){return[t,e[t]]})}(t,e(t))}}function qi(e,t,i,l,c,u,d,h){var f=2&t;if(!f&&"function"!=typeof e)throw new Ee(r);var p=l?l.length:0;if(p||(t&=-97,l=c=n),d=d===n?d:gn(us(d),0),h=h===n?h:us(h),p-=c?c.length:0,64&t){var g=l,m=c;l=c=n}var v=f?n:to(e),y=[e,t,i,l,c,g,m,u,d,h];if(v&&function(e,t){var n=e[1],r=t[1],i=n|r,a=i<131,l=r==s&&8==n||r==s&&256==n&&e[7].length<=t[8]||384==r&&t[7].length<=t[8]&&8==n;if(!a&&!l)return e;1&r&&(e[2]=t[2],i|=1&n?0:4);var c=t[3];if(c){var u=e[3];e[3]=u?_i(u,c,t[4]):c,e[4]=u?on(e[3],o):t[4]}(c=t[5])&&(u=e[5],e[5]=u?Si(u,c,t[6]):c,e[6]=u?on(e[5],o):t[6]),(c=t[7])&&(e[7]=c),r&s&&(e[8]=null==e[8]?t[8]:mn(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i}(y,v),e=y[0],t=y[1],i=y[2],l=y[3],c=y[4],!(h=y[9]=y[9]===n?f?0:e.length:gn(y[9]-p,0))&&24&t&&(t&=-25),t&&1!=t)b=8==t||16==t?function(e,t,r){var i=Mi(e);return function o(){for(var a=arguments.length,s=be(a),l=a,c=ro(o);l--;)s[l]=arguments[l];var u=a<3&&s[0]!==c&&s[a-1]!==c?[]:on(s,c);return(a-=u.length)<r?Hi(e,t,Li,o.placeholder,n,s,u,n,n,r-a):xt(this&&this!==ct&&this instanceof o?i:e,this,s)}}(e,t,h):t!=a&&33!=t||c.length?Li.apply(n,y):function(e,t,n,r){var i=1&t,o=Mi(e);return function t(){for(var a=-1,s=arguments.length,l=-1,c=r.length,u=be(c+s),d=this&&this!==ct&&this instanceof t?o:e;++l<c;)u[l]=r[l];for(;s--;)u[l++]=arguments[++a];return xt(d,i?n:this,u)}}(e,t,i,l);else var b=function(e,t,n){var r=1&t,i=Mi(e);return function t(){return(this&&this!==ct&&this instanceof t?i:e).apply(r?n:this,arguments)}}(e,t,i);return jo((v?Kr:ko)(b,y),e,t)}function Yi(e,t,r,i){return e===n||La(e,Te[r])&&!Me.call(i,r)?t:e}function Xi(e,t,r,i,o,a){return Ka(e)&&Ka(t)&&(a.set(t,e),Dr(e,t,n,Xi,a),a.delete(t)),e}function Ki(e){return es(e)?n:e}function Zi(e,t,r,i,o,a){var s=1&r,l=e.length,c=t.length;if(l!=c&&!(s&&c>l))return!1;var u=a.get(e),d=a.get(t);if(u&&d)return u==t&&d==e;var h=-1,f=!0,p=2&r?new $n:n;for(a.set(e,t),a.set(t,e);++h<l;){var g=e[h],m=t[h];if(i)var v=s?i(m,g,h,t,e,a):i(g,m,h,e,t,a);if(v!==n){if(v)continue;f=!1;break}if(p){if(!Mt(t,function(e,t){if(!Xt(p,t)&&(g===e||o(g,e,r,i,a)))return p.push(t)})){f=!1;break}}else if(g!==m&&!o(g,m,r,i,a)){f=!1;break}}return a.delete(e),a.delete(t),f}function Ji(e){return Io(_o(e,n,Uo),e+"")}function Qi(e){return xr(e,Es,lo)}function eo(e){return xr(e,Is,co)}var to=En?function(e){return En.get(e)}:il;function no(e){for(var t=e.name+"",n=In[t],r=Me.call(In,t)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==e)return i.name}return t}function ro(e){return(Me.call(Nn,"placeholder")?Nn:e).placeholder}function io(){var e=Nn.iteratee||el;return e=e===el?Or:e,arguments.length?e(arguments[0],arguments[1]):e}function oo(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function ao(e){for(var t=Es(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,xo(i)]}return t}function so(e,t){var r=function(e,t){return null==e?n:e[t]}(e,t);return Fr(r)?r:n}var lo=Pt?function(e){return null==e?[]:(e=Se(e),kt(Pt(e),function(t){return Ge.call(e,t)}))}:dl,co=Pt?function(e){for(var t=[];e;)Tt(t,lo(e)),e=We(e);return t}:dl,uo=Cr;function ho(e,t,n){for(var r=-1,i=(t=gi(t,e)).length,o=!1;++r<i;){var a=Mo(t[r]);if(!(o=null!=e&&n(e,a)))break;e=e[a]}return o||++r!=i?o:!!(i=null==e?0:e.length)&&Xa(i)&&go(a,i)&&(Ba(e)||za(e))}function fo(e){return"function"!=typeof e.constructor||wo(e)?{}:Dn(We(e))}function po(e){return Ba(e)||za(e)||!!(Ke&&e&&e[Ke])}function go(e,t){var n=typeof e;return!!(t=null==t?c:t)&&("number"==n||"symbol"!=n&&ge.test(e))&&e>-1&&e%1==0&&e<t}function mo(e,t,n){if(!Ka(n))return!1;var r=typeof t;return!!("number"==r?Va(n)&&go(t,n.length):"string"==r&&t in n)&&La(n[t],e)}function vo(e,t){if(Ba(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!is(e))||Z.test(e)||!K.test(e)||null!=t&&e in Se(t)}function yo(e){var t=no(e),n=Nn[t];if("function"!=typeof n||!(t in Un.prototype))return!1;if(e===n)return!0;var r=to(n);return!!r&&e===r[0]}(xn&&uo(new xn(new ArrayBuffer(1)))!=T||Cn&&uo(new Cn)!=w||_n&&uo(_n.resolve())!=_||Sn&&uo(new Sn)!=A||An&&uo(new An)!=I)&&(uo=function(e){var t=Cr(e),r=t==C?e.constructor:n,i=r?Po(r):"";if(i)switch(i){case jn:return T;case Tn:return w;case Fn:return _;case On:return A;case Mn:return I}return t});var bo=Fe?qa:hl;function wo(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Te)}function xo(e){return e==e&&!Ka(e)}function Co(e,t){return function(r){return null!=r&&r[e]===t&&(t!==n||e in Se(r))}}function _o(e,t,r){return t=gn(t===n?e.length-1:t,0),function(){for(var n=arguments,i=-1,o=gn(n.length-t,0),a=be(o);++i<o;)a[i]=n[t+i];i=-1;for(var s=be(t+1);++i<t;)s[i]=n[i];return s[t]=r(a),xt(e,this,s)}}function So(e,t){return t.length<2?e:wr(e,Qr(t,0,-1))}function Ao(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var ko=To(Kr),Eo=dt||function(e,t){return ct.setTimeout(e,t)},Io=To(Zr);function jo(e,t,n){var r=t+"";return Io(e,function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(re,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return _t(h,function(n){var r="_."+n[0];t&n[1]&&!Et(e,r)&&e.push(r)}),e.sort()}(function(e){var t=e.match(ie);return t?t[1].split(oe):[]}(r),n)))}function To(e){var t=0,r=0;return function(){var i=vn(),o=16-(i-r);if(r=i,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(n,arguments)}}function Fo(e,t){var r=-1,i=e.length,o=i-1;for(t=t===n?i:t;++r<t;){var a=Wr(r,o),s=e[a];e[a]=e[r],e[r]=s}return e.length=t,e}var Oo=function(){var e=Ta(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(J,function(e,n,r,i){t.push(r?i.replace(le,"$1"):n||e)}),t},function(e){return 500===t.size&&t.clear(),e}),t=e.cache;return e}();function Mo(e){if("string"==typeof e||is(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Po(e){if(null!=e){try{return Oe.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Ro(e){if(e instanceof Un)return e.clone();var t=new Bn(e.__wrapped__,e.__chain__);return t.__actions__=Ai(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Lo=Gr(function(e,t){return Ha(e)?lr(e,pr(t,1,Ha,!0)):[]}),No=Gr(function(e,t){var r=Go(t);return Ha(r)&&(r=n),Ha(e)?lr(e,pr(t,1,Ha,!0),io(r,2)):[]}),Do=Gr(function(e,t){var r=Go(t);return Ha(r)&&(r=n),Ha(e)?lr(e,pr(t,1,Ha,!0),n,r):[]});function zo(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:us(n);return i<0&&(i=gn(r+i,0)),Lt(e,io(t,3),i)}function Bo(e,t,r){var i=null==e?0:e.length;if(!i)return-1;var o=i-1;return r!==n&&(o=us(r),o=r<0?gn(i+o,0):mn(o,i-1)),Lt(e,io(t,3),o,!0)}function Uo(e){return null!=e&&e.length?pr(e,1):[]}function Vo(e){return e&&e.length?e[0]:n}var Ho=Gr(function(e){var t=jt(e,fi);return t.length&&t[0]===e[0]?kr(t):[]}),Wo=Gr(function(e){var t=Go(e),r=jt(e,fi);return t===Go(r)?t=n:r.pop(),r.length&&r[0]===e[0]?kr(r,io(t,2)):[]}),$o=Gr(function(e){var t=Go(e),r=jt(e,fi);return(t="function"==typeof t?t:n)&&r.pop(),r.length&&r[0]===e[0]?kr(r,n,t):[]});function Go(e){var t=null==e?0:e.length;return t?e[t-1]:n}var qo=Gr(Yo);function Yo(e,t){return e&&e.length&&t&&t.length?Vr(e,t):e}var Xo=Ji(function(e,t){var n=null==e?0:e.length,r=rr(e,t);return Hr(e,jt(t,function(e){return go(e,n)?+e:e}).sort(Ci)),r});function Ko(e){return null==e?e:wn.call(e)}var Zo=Gr(function(e){return ai(pr(e,1,Ha,!0))}),Jo=Gr(function(e){var t=Go(e);return Ha(t)&&(t=n),ai(pr(e,1,Ha,!0),io(t,2))}),Qo=Gr(function(e){var t=Go(e);return t="function"==typeof t?t:n,ai(pr(e,1,Ha,!0),n,t)});function ea(e){if(!e||!e.length)return[];var t=0;return e=kt(e,function(e){if(Ha(e))return t=gn(e.length,t),!0}),$t(t,function(t){return jt(e,Ut(t))})}function ta(e,t){if(!e||!e.length)return[];var r=ea(e);return null==t?r:jt(r,function(e){return xt(t,n,e)})}var na=Gr(function(e,t){return Ha(e)?lr(e,t):[]}),ra=Gr(function(e){return di(kt(e,Ha))}),ia=Gr(function(e){var t=Go(e);return Ha(t)&&(t=n),di(kt(e,Ha),io(t,2))}),oa=Gr(function(e){var t=Go(e);return t="function"==typeof t?t:n,di(kt(e,Ha),n,t)}),aa=Gr(ea),sa=Gr(function(e){var t=e.length,r=t>1?e[t-1]:n;return r="function"==typeof r?(e.pop(),r):n,ta(e,r)});function la(e){var t=Nn(e);return t.__chain__=!0,t}function ca(e,t){return t(e)}var ua=Ji(function(e){var t=e.length,r=t?e[0]:0,i=this.__wrapped__,o=function(t){return rr(t,e)};return!(t>1||this.__actions__.length)&&i instanceof Un&&go(r)?((i=i.slice(r,+r+(t?1:0))).__actions__.push({func:ca,args:[o],thisArg:n}),new Bn(i,this.__chain__).thru(function(e){return t&&!e.length&&e.push(n),e})):this.thru(o)}),da=Ei(function(e,t,n){Me.call(e,n)?++e[n]:nr(e,n,1)}),ha=Pi(zo),fa=Pi(Bo);function pa(e,t){return(Ba(e)?_t:cr)(e,io(t,3))}function ga(e,t){return(Ba(e)?St:ur)(e,io(t,3))}var ma=Ei(function(e,t,n){Me.call(e,n)?e[n].push(t):nr(e,n,[t])}),va=Gr(function(e,t,n){var r=-1,i="function"==typeof t,o=Va(e)?be(e.length):[];return cr(e,function(e){o[++r]=i?xt(t,e,n):Er(e,t,n)}),o}),ya=Ei(function(e,t,n){nr(e,n,t)});function ba(e,t){return(Ba(e)?jt:Rr)(e,io(t,3))}var wa=Ei(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),xa=Gr(function(e,t){if(null==e)return[];var n=t.length;return n>1&&mo(e,t[0],t[1])?t=[]:n>2&&mo(t[0],t[1],t[2])&&(t=[t[0]]),Br(e,pr(t,1),[])}),Ca=ut||function(){return ct.Date.now()};function _a(e,t,r){return t=r?n:t,t=e&&null==t?e.length:t,qi(e,s,n,n,n,n,t)}function Sa(e,t){var i;if("function"!=typeof t)throw new Ee(r);return e=us(e),function(){return--e>0&&(i=t.apply(this,arguments)),e<=1&&(t=n),i}}var Aa=Gr(function(e,t,n){var r=1;if(n.length){var i=on(n,ro(Aa));r|=a}return qi(e,r,t,n,i)}),ka=Gr(function(e,t,n){var r=3;if(n.length){var i=on(n,ro(ka));r|=a}return qi(t,r,e,n,i)});function Ea(e,t,i){var o,a,s,l,c,u,d=0,h=!1,f=!1,p=!0;if("function"!=typeof e)throw new Ee(r);function g(t){var r=o,i=a;return o=a=n,d=t,l=e.apply(i,r)}function m(e){var r=e-u;return u===n||r>=t||r<0||f&&e-d>=s}function v(){var e=Ca();if(m(e))return y(e);c=Eo(v,function(e){var n=t-(e-u);return f?mn(n,s-(e-d)):n}(e))}function y(e){return c=n,p&&o?g(e):(o=a=n,l)}function b(){var e=Ca(),r=m(e);if(o=arguments,a=this,u=e,r){if(c===n)return function(e){return d=e,c=Eo(v,t),h?g(e):l}(u);if(f)return yi(c),c=Eo(v,t),g(u)}return c===n&&(c=Eo(v,t)),l}return t=hs(t)||0,Ka(i)&&(h=!!i.leading,s=(f="maxWait"in i)?gn(hs(i.maxWait)||0,t):s,p="trailing"in i?!!i.trailing:p),b.cancel=function(){c!==n&&yi(c),d=0,o=u=a=c=n},b.flush=function(){return c===n?l:y(Ca())},b}var Ia=Gr(function(e,t){return sr(e,1,t)}),ja=Gr(function(e,t,n){return sr(e,hs(t)||0,n)});function Ta(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ee(r);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(Ta.Cache||Wn),n}function Fa(e){if("function"!=typeof e)throw new Ee(r);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Ta.Cache=Wn;var Oa=mi(function(e,t){var n=(t=1==t.length&&Ba(t[0])?jt(t[0],qt(io())):jt(pr(t,1),qt(io()))).length;return Gr(function(r){for(var i=-1,o=mn(r.length,n);++i<o;)r[i]=t[i].call(this,r[i]);return xt(e,this,r)})}),Ma=Gr(function(e,t){var r=on(t,ro(Ma));return qi(e,a,n,t,r)}),Pa=Gr(function(e,t){var r=on(t,ro(Pa));return qi(e,64,n,t,r)}),Ra=Ji(function(e,t){return qi(e,256,n,n,n,t)});function La(e,t){return e===t||e!=e&&t!=t}var Na=Vi(_r),Da=Vi(function(e,t){return e>=t}),za=Ir(function(){return arguments}())?Ir:function(e){return Za(e)&&Me.call(e,"callee")&&!Ge.call(e,"callee")},Ba=be.isArray,Ua=gt?qt(gt):function(e){return Za(e)&&Cr(e)==j};function Va(e){return null!=e&&Xa(e.length)&&!qa(e)}function Ha(e){return Za(e)&&Va(e)}var Wa=Vt||hl,$a=mt?qt(mt):function(e){return Za(e)&&Cr(e)==m};function Ga(e){if(!Za(e))return!1;var t=Cr(e);return t==v||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!es(e)}function qa(e){if(!Ka(e))return!1;var t=Cr(e);return t==y||t==b||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Ya(e){return"number"==typeof e&&e==us(e)}function Xa(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=c}function Ka(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Za(e){return null!=e&&"object"==typeof e}var Ja=vt?qt(vt):function(e){return Za(e)&&uo(e)==w};function Qa(e){return"number"==typeof e||Za(e)&&Cr(e)==x}function es(e){if(!Za(e)||Cr(e)!=C)return!1;var t=We(e);if(null===t)return!0;var n=Me.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Oe.call(n)==Ne}var ts=yt?qt(yt):function(e){return Za(e)&&Cr(e)==S},ns=bt?qt(bt):function(e){return Za(e)&&uo(e)==A};function rs(e){return"string"==typeof e||!Ba(e)&&Za(e)&&Cr(e)==k}function is(e){return"symbol"==typeof e||Za(e)&&Cr(e)==E}var os=wt?qt(wt):function(e){return Za(e)&&Xa(e.length)&&!!nt[Cr(e)]},as=Vi(Pr),ss=Vi(function(e,t){return e<=t});function ls(e){if(!e)return[];if(Va(e))return rs(e)?ln(e):Ai(e);if(Je&&e[Je])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Je]());var t=uo(e);return(t==w?nn:t==A?an:Ls)(e)}function cs(e){return e?(e=hs(e))===l||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function us(e){var t=cs(e),n=t%1;return t==t?n?t-n:t:0}function ds(e){return e?ir(us(e),0,d):0}function hs(e){if("number"==typeof e)return e;if(is(e))return u;if(Ka(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Ka(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Gt(e);var n=he.test(e);return n||pe.test(e)?at(e.slice(2),n?2:8):de.test(e)?u:+e}function fs(e){return ki(e,Is(e))}function ps(e){return null==e?"":oi(e)}var gs=Ii(function(e,t){if(wo(t)||Va(t))ki(t,Es(t),e);else for(var n in t)Me.call(t,n)&&Jn(e,n,t[n])}),ms=Ii(function(e,t){ki(t,Is(t),e)}),vs=Ii(function(e,t,n,r){ki(t,Is(t),e,r)}),ys=Ii(function(e,t,n,r){ki(t,Es(t),e,r)}),bs=Ji(rr),ws=Gr(function(e,t){e=Se(e);var r=-1,i=t.length,o=i>2?t[2]:n;for(o&&mo(t[0],t[1],o)&&(i=1);++r<i;)for(var a=t[r],s=Is(a),l=-1,c=s.length;++l<c;){var u=s[l],d=e[u];(d===n||La(d,Te[u])&&!Me.call(e,u))&&(e[u]=a[u])}return e}),xs=Gr(function(e){return e.push(n,Xi),xt(Ts,n,e)});function Cs(e,t,r){var i=null==e?n:wr(e,t);return i===n?r:i}function _s(e,t){return null!=e&&ho(e,t,Ar)}var Ss=Ni(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Le.call(t)),e[t]=n},Ks(Qs)),As=Ni(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Le.call(t)),Me.call(e,t)?e[t].push(n):e[t]=[n]},io),ks=Gr(Er);function Es(e){return Va(e)?qn(e):Mr(e)}function Is(e){return Va(e)?qn(e,!0):function(e){if(!Ka(e))return function(e){var t=[];if(null!=e)for(var n in Se(e))t.push(n);return t}(e);var t=wo(e),n=[];for(var r in e)("constructor"!=r||!t&&Me.call(e,r))&&n.push(r);return n}(e)}var js=Ii(function(e,t,n){Dr(e,t,n)}),Ts=Ii(function(e,t,n,r){Dr(e,t,n,r)}),Fs=Ji(function(e,t){var n={};if(null==e)return n;var r=!1;t=jt(t,function(t){return t=gi(t,e),r||(r=t.length>1),t}),ki(e,eo(e),n),r&&(n=or(n,7,Ki));for(var i=t.length;i--;)si(n,t[i]);return n}),Os=Ji(function(e,t){return null==e?{}:function(e,t){return Ur(e,t,function(t,n){return _s(e,n)})}(e,t)});function Ms(e,t){if(null==e)return{};var n=jt(eo(e),function(e){return[e]});return t=io(t),Ur(e,n,function(e,n){return t(e,n[0])})}var Ps=Gi(Es),Rs=Gi(Is);function Ls(e){return null==e?[]:Yt(e,Es(e))}var Ns=Oi(function(e,t,n){return t=t.toLowerCase(),e+(n?Ds(t):t)});function Ds(e){return Gs(ps(e).toLowerCase())}function zs(e){return(e=ps(e))&&e.replace(me,Jt).replace(Xe,"")}var Bs=Oi(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),Us=Oi(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),Vs=Fi("toLowerCase"),Hs=Oi(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),Ws=Oi(function(e,t,n){return e+(n?" ":"")+Gs(t)}),$s=Oi(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Gs=Fi("toUpperCase");function qs(e,t,r){return e=ps(e),(t=r?n:t)===n?function(e){return Qe.test(e)}(e)?function(e){return e.match(Ze)||[]}(e):function(e){return e.match(ae)||[]}(e):e.match(t)||[]}var Ys=Gr(function(e,t){try{return xt(e,n,t)}catch(e){return Ga(e)?e:new xe(e)}}),Xs=Ji(function(e,t){return _t(t,function(t){t=Mo(t),nr(e,t,Aa(e[t],e))}),e});function Ks(e){return function(){return e}}var Zs=Ri(),Js=Ri(!0);function Qs(e){return e}function el(e){return Or("function"==typeof e?e:or(e,1))}var tl=Gr(function(e,t){return function(n){return Er(n,e,t)}}),nl=Gr(function(e,t){return function(n){return Er(e,n,t)}});function rl(e,t,n){var r=Es(t),i=br(t,r);null!=n||Ka(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=br(t,Es(t)));var o=!(Ka(n)&&"chain"in n&&!n.chain),a=qa(e);return _t(i,function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__);return(n.__actions__=Ai(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Tt([this.value()],arguments))})}),e}function il(){}var ol=zi(jt),al=zi(At),sl=zi(Mt);function ll(e){return vo(e)?Ut(Mo(e)):function(e){return function(t){return wr(t,e)}}(e)}var cl=Ui(),ul=Ui(!0);function dl(){return[]}function hl(){return!1}var fl,pl=Di(function(e,t){return e+t},0),gl=Wi("ceil"),ml=Di(function(e,t){return e/t},1),vl=Wi("floor"),yl=Di(function(e,t){return e*t},1),bl=Wi("round"),wl=Di(function(e,t){return e-t},0);return Nn.after=function(e,t){if("function"!=typeof t)throw new Ee(r);return e=us(e),function(){if(--e<1)return t.apply(this,arguments)}},Nn.ary=_a,Nn.assign=gs,Nn.assignIn=ms,Nn.assignInWith=vs,Nn.assignWith=ys,Nn.at=bs,Nn.before=Sa,Nn.bind=Aa,Nn.bindAll=Xs,Nn.bindKey=ka,Nn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ba(e)?e:[e]},Nn.chain=la,Nn.chunk=function(e,t,r){t=(r?mo(e,t,r):t===n)?1:gn(us(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var o=0,a=0,s=be(ft(i/t));o<i;)s[a++]=Qr(e,o,o+=t);return s},Nn.compact=function(e){for(var t=-1,n=null==e?0:e.length,r=0,i=[];++t<n;){var o=e[t];o&&(i[r++]=o)}return i},Nn.concat=function(){var e=arguments.length;if(!e)return[];for(var t=be(e-1),n=arguments[0],r=e;r--;)t[r-1]=arguments[r];return Tt(Ba(n)?Ai(n):[n],pr(t,1))},Nn.cond=function(e){var t=null==e?0:e.length,n=io();return e=t?jt(e,function(e){if("function"!=typeof e[1])throw new Ee(r);return[n(e[0]),e[1]]}):[],Gr(function(n){for(var r=-1;++r<t;){var i=e[r];if(xt(i[0],this,n))return xt(i[1],this,n)}})},Nn.conforms=function(e){return function(e){var t=Es(e);return function(n){return ar(n,e,t)}}(or(e,1))},Nn.constant=Ks,Nn.countBy=da,Nn.create=function(e,t){var n=Dn(e);return null==t?n:tr(n,t)},Nn.curry=function e(t,r,i){var o=qi(t,8,n,n,n,n,n,r=i?n:r);return o.placeholder=e.placeholder,o},Nn.curryRight=function e(t,r,i){var o=qi(t,16,n,n,n,n,n,r=i?n:r);return o.placeholder=e.placeholder,o},Nn.debounce=Ea,Nn.defaults=ws,Nn.defaultsDeep=xs,Nn.defer=Ia,Nn.delay=ja,Nn.difference=Lo,Nn.differenceBy=No,Nn.differenceWith=Do,Nn.drop=function(e,t,r){var i=null==e?0:e.length;return i?Qr(e,(t=r||t===n?1:us(t))<0?0:t,i):[]},Nn.dropRight=function(e,t,r){var i=null==e?0:e.length;return i?Qr(e,0,(t=i-(t=r||t===n?1:us(t)))<0?0:t):[]},Nn.dropRightWhile=function(e,t){return e&&e.length?ci(e,io(t,3),!0,!0):[]},Nn.dropWhile=function(e,t){return e&&e.length?ci(e,io(t,3),!0):[]},Nn.fill=function(e,t,r,i){var o=null==e?0:e.length;return o?(r&&"number"!=typeof r&&mo(e,t,r)&&(r=0,i=o),function(e,t,r,i){var o=e.length;for((r=us(r))<0&&(r=-r>o?0:o+r),(i=i===n||i>o?o:us(i))<0&&(i+=o),i=r>i?0:ds(i);r<i;)e[r++]=t;return e}(e,t,r,i)):[]},Nn.filter=function(e,t){return(Ba(e)?kt:fr)(e,io(t,3))},Nn.flatMap=function(e,t){return pr(ba(e,t),1)},Nn.flatMapDeep=function(e,t){return pr(ba(e,t),l)},Nn.flatMapDepth=function(e,t,r){return r=r===n?1:us(r),pr(ba(e,t),r)},Nn.flatten=Uo,Nn.flattenDeep=function(e){return null!=e&&e.length?pr(e,l):[]},Nn.flattenDepth=function(e,t){return null!=e&&e.length?pr(e,t=t===n?1:us(t)):[]},Nn.flip=function(e){return qi(e,512)},Nn.flow=Zs,Nn.flowRight=Js,Nn.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var i=e[t];r[i[0]]=i[1]}return r},Nn.functions=function(e){return null==e?[]:br(e,Es(e))},Nn.functionsIn=function(e){return null==e?[]:br(e,Is(e))},Nn.groupBy=ma,Nn.initial=function(e){return null!=e&&e.length?Qr(e,0,-1):[]},Nn.intersection=Ho,Nn.intersectionBy=Wo,Nn.intersectionWith=$o,Nn.invert=Ss,Nn.invertBy=As,Nn.invokeMap=va,Nn.iteratee=el,Nn.keyBy=ya,Nn.keys=Es,Nn.keysIn=Is,Nn.map=ba,Nn.mapKeys=function(e,t){var n={};return t=io(t,3),vr(e,function(e,r,i){nr(n,t(e,r,i),e)}),n},Nn.mapValues=function(e,t){var n={};return t=io(t,3),vr(e,function(e,r,i){nr(n,r,t(e,r,i))}),n},Nn.matches=function(e){return Lr(or(e,1))},Nn.matchesProperty=function(e,t){return Nr(e,or(t,1))},Nn.memoize=Ta,Nn.merge=js,Nn.mergeWith=Ts,Nn.method=tl,Nn.methodOf=nl,Nn.mixin=rl,Nn.negate=Fa,Nn.nthArg=function(e){return e=us(e),Gr(function(t){return zr(t,e)})},Nn.omit=Fs,Nn.omitBy=function(e,t){return Ms(e,Fa(io(t)))},Nn.once=function(e){return Sa(2,e)},Nn.orderBy=function(e,t,r,i){return null==e?[]:(Ba(t)||(t=null==t?[]:[t]),Ba(r=i?n:r)||(r=null==r?[]:[r]),Br(e,t,r))},Nn.over=ol,Nn.overArgs=Oa,Nn.overEvery=al,Nn.overSome=sl,Nn.partial=Ma,Nn.partialRight=Pa,Nn.partition=wa,Nn.pick=Os,Nn.pickBy=Ms,Nn.property=ll,Nn.propertyOf=function(e){return function(t){return null==e?n:wr(e,t)}},Nn.pull=qo,Nn.pullAll=Yo,Nn.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Vr(e,t,io(n,2)):e},Nn.pullAllWith=function(e,t,r){return e&&e.length&&t&&t.length?Vr(e,t,n,r):e},Nn.pullAt=Xo,Nn.range=cl,Nn.rangeRight=ul,Nn.rearg=Ra,Nn.reject=function(e,t){return(Ba(e)?kt:fr)(e,Fa(io(t,3)))},Nn.remove=function(e,t){var n=[];if(!e||!e.length)return n;var r=-1,i=[],o=e.length;for(t=io(t,3);++r<o;){var a=e[r];t(a,r,e)&&(n.push(a),i.push(r))}return Hr(e,i),n},Nn.rest=function(e,t){if("function"!=typeof e)throw new Ee(r);return Gr(e,t=t===n?t:us(t))},Nn.reverse=Ko,Nn.sampleSize=function(e,t,r){return t=(r?mo(e,t,r):t===n)?1:us(t),(Ba(e)?Xn:Yr)(e,t)},Nn.set=function(e,t,n){return null==e?e:Xr(e,t,n)},Nn.setWith=function(e,t,r,i){return i="function"==typeof i?i:n,null==e?e:Xr(e,t,r,i)},Nn.shuffle=function(e){return(Ba(e)?Kn:Jr)(e)},Nn.slice=function(e,t,r){var i=null==e?0:e.length;return i?(r&&"number"!=typeof r&&mo(e,t,r)?(t=0,r=i):(t=null==t?0:us(t),r=r===n?i:us(r)),Qr(e,t,r)):[]},Nn.sortBy=xa,Nn.sortedUniq=function(e){return e&&e.length?ri(e):[]},Nn.sortedUniqBy=function(e,t){return e&&e.length?ri(e,io(t,2)):[]},Nn.split=function(e,t,r){return r&&"number"!=typeof r&&mo(e,t,r)&&(t=r=n),(r=r===n?d:r>>>0)?(e=ps(e))&&("string"==typeof t||null!=t&&!ts(t))&&!(t=oi(t))&&tn(e)?vi(ln(e),0,r):e.split(t,r):[]},Nn.spread=function(e,t){if("function"!=typeof e)throw new Ee(r);return t=null==t?0:gn(us(t),0),Gr(function(n){var r=n[t],i=vi(n,0,t);return r&&Tt(i,r),xt(e,this,i)})},Nn.tail=function(e){var t=null==e?0:e.length;return t?Qr(e,1,t):[]},Nn.take=function(e,t,r){return e&&e.length?Qr(e,0,(t=r||t===n?1:us(t))<0?0:t):[]},Nn.takeRight=function(e,t,r){var i=null==e?0:e.length;return i?Qr(e,(t=i-(t=r||t===n?1:us(t)))<0?0:t,i):[]},Nn.takeRightWhile=function(e,t){return e&&e.length?ci(e,io(t,3),!1,!0):[]},Nn.takeWhile=function(e,t){return e&&e.length?ci(e,io(t,3)):[]},Nn.tap=function(e,t){return t(e),e},Nn.throttle=function(e,t,n){var i=!0,o=!0;if("function"!=typeof e)throw new Ee(r);return Ka(n)&&(i="leading"in n?!!n.leading:i,o="trailing"in n?!!n.trailing:o),Ea(e,t,{leading:i,maxWait:t,trailing:o})},Nn.thru=ca,Nn.toArray=ls,Nn.toPairs=Ps,Nn.toPairsIn=Rs,Nn.toPath=function(e){return Ba(e)?jt(e,Mo):is(e)?[e]:Ai(Oo(ps(e)))},Nn.toPlainObject=fs,Nn.transform=function(e,t,n){var r=Ba(e),i=r||Wa(e)||os(e);if(t=io(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:Ka(e)&&qa(o)?Dn(We(e)):{}}return(i?_t:vr)(e,function(e,r,i){return t(n,e,r,i)}),n},Nn.unary=function(e){return _a(e,1)},Nn.union=Zo,Nn.unionBy=Jo,Nn.unionWith=Qo,Nn.uniq=function(e){return e&&e.length?ai(e):[]},Nn.uniqBy=function(e,t){return e&&e.length?ai(e,io(t,2)):[]},Nn.uniqWith=function(e,t){return t="function"==typeof t?t:n,e&&e.length?ai(e,n,t):[]},Nn.unset=function(e,t){return null==e||si(e,t)},Nn.unzip=ea,Nn.unzipWith=ta,Nn.update=function(e,t,n){return null==e?e:li(e,t,pi(n))},Nn.updateWith=function(e,t,r,i){return i="function"==typeof i?i:n,null==e?e:li(e,t,pi(r),i)},Nn.values=Ls,Nn.valuesIn=function(e){return null==e?[]:Yt(e,Is(e))},Nn.without=na,Nn.words=qs,Nn.wrap=function(e,t){return Ma(pi(t),e)},Nn.xor=ra,Nn.xorBy=ia,Nn.xorWith=oa,Nn.zip=aa,Nn.zipObject=function(e,t){return hi(e||[],t||[],Jn)},Nn.zipObjectDeep=function(e,t){return hi(e||[],t||[],Xr)},Nn.zipWith=sa,Nn.entries=Ps,Nn.entriesIn=Rs,Nn.extend=ms,Nn.extendWith=vs,rl(Nn,Nn),Nn.add=pl,Nn.attempt=Ys,Nn.camelCase=Ns,Nn.capitalize=Ds,Nn.ceil=gl,Nn.clamp=function(e,t,r){return r===n&&(r=t,t=n),r!==n&&(r=(r=hs(r))==r?r:0),t!==n&&(t=(t=hs(t))==t?t:0),ir(hs(e),t,r)},Nn.clone=function(e){return or(e,4)},Nn.cloneDeep=function(e){return or(e,5)},Nn.cloneDeepWith=function(e,t){return or(e,5,t="function"==typeof t?t:n)},Nn.cloneWith=function(e,t){return or(e,4,t="function"==typeof t?t:n)},Nn.conformsTo=function(e,t){return null==t||ar(e,t,Es(t))},Nn.deburr=zs,Nn.defaultTo=function(e,t){return null==e||e!=e?t:e},Nn.divide=ml,Nn.endsWith=function(e,t,r){e=ps(e),t=oi(t);var i=e.length,o=r=r===n?i:ir(us(r),0,i);return(r-=t.length)>=0&&e.slice(r,o)==t},Nn.eq=La,Nn.escape=function(e){return(e=ps(e))&&G.test(e)?e.replace(W,Qt):e},Nn.escapeRegExp=function(e){return(e=ps(e))&&ee.test(e)?e.replace(Q,"\\$&"):e},Nn.every=function(e,t,r){var i=Ba(e)?At:dr;return r&&mo(e,t,r)&&(t=n),i(e,io(t,3))},Nn.find=ha,Nn.findIndex=zo,Nn.findKey=function(e,t){return Rt(e,io(t,3),vr)},Nn.findLast=fa,Nn.findLastIndex=Bo,Nn.findLastKey=function(e,t){return Rt(e,io(t,3),yr)},Nn.floor=vl,Nn.forEach=pa,Nn.forEachRight=ga,Nn.forIn=function(e,t){return null==e?e:gr(e,io(t,3),Is)},Nn.forInRight=function(e,t){return null==e?e:mr(e,io(t,3),Is)},Nn.forOwn=function(e,t){return e&&vr(e,io(t,3))},Nn.forOwnRight=function(e,t){return e&&yr(e,io(t,3))},Nn.get=Cs,Nn.gt=Na,Nn.gte=Da,Nn.has=function(e,t){return null!=e&&ho(e,t,Sr)},Nn.hasIn=_s,Nn.head=Vo,Nn.identity=Qs,Nn.includes=function(e,t,n,r){e=Va(e)?e:Ls(e),n=n&&!r?us(n):0;var i=e.length;return n<0&&(n=gn(i+n,0)),rs(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Nt(e,t,n)>-1},Nn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:us(n);return i<0&&(i=gn(r+i,0)),Nt(e,t,i)},Nn.inRange=function(e,t,r){return t=cs(t),r===n?(r=t,t=0):r=cs(r),function(e,t,n){return e>=mn(t,n)&&e<gn(t,n)}(e=hs(e),t,r)},Nn.invoke=ks,Nn.isArguments=za,Nn.isArray=Ba,Nn.isArrayBuffer=Ua,Nn.isArrayLike=Va,Nn.isArrayLikeObject=Ha,Nn.isBoolean=function(e){return!0===e||!1===e||Za(e)&&Cr(e)==g},Nn.isBuffer=Wa,Nn.isDate=$a,Nn.isElement=function(e){return Za(e)&&1===e.nodeType&&!es(e)},Nn.isEmpty=function(e){if(null==e)return!0;if(Va(e)&&(Ba(e)||"string"==typeof e||"function"==typeof e.splice||Wa(e)||os(e)||za(e)))return!e.length;var t=uo(e);if(t==w||t==A)return!e.size;if(wo(e))return!Mr(e).length;for(var n in e)if(Me.call(e,n))return!1;return!0},Nn.isEqual=function(e,t){return jr(e,t)},Nn.isEqualWith=function(e,t,r){var i=(r="function"==typeof r?r:n)?r(e,t):n;return i===n?jr(e,t,n,r):!!i},Nn.isError=Ga,Nn.isFinite=function(e){return"number"==typeof e&&dn(e)},Nn.isFunction=qa,Nn.isInteger=Ya,Nn.isLength=Xa,Nn.isMap=Ja,Nn.isMatch=function(e,t){return e===t||Tr(e,t,ao(t))},Nn.isMatchWith=function(e,t,r){return r="function"==typeof r?r:n,Tr(e,t,ao(t),r)},Nn.isNaN=function(e){return Qa(e)&&e!=+e},Nn.isNative=function(e){if(bo(e))throw new xe("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Fr(e)},Nn.isNil=function(e){return null==e},Nn.isNull=function(e){return null===e},Nn.isNumber=Qa,Nn.isObject=Ka,Nn.isObjectLike=Za,Nn.isPlainObject=es,Nn.isRegExp=ts,Nn.isSafeInteger=function(e){return Ya(e)&&e>=-9007199254740991&&e<=c},Nn.isSet=ns,Nn.isString=rs,Nn.isSymbol=is,Nn.isTypedArray=os,Nn.isUndefined=function(e){return e===n},Nn.isWeakMap=function(e){return Za(e)&&uo(e)==I},Nn.isWeakSet=function(e){return Za(e)&&"[object WeakSet]"==Cr(e)},Nn.join=function(e,t){return null==e?"":fn.call(e,t)},Nn.kebabCase=Bs,Nn.last=Go,Nn.lastIndexOf=function(e,t,r){var i=null==e?0:e.length;if(!i)return-1;var o=i;return r!==n&&(o=(o=us(r))<0?gn(i+o,0):mn(o,i-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,o):Lt(e,zt,o,!0)},Nn.lowerCase=Us,Nn.lowerFirst=Vs,Nn.lt=as,Nn.lte=ss,Nn.max=function(e){return e&&e.length?hr(e,Qs,_r):n},Nn.maxBy=function(e,t){return e&&e.length?hr(e,io(t,2),_r):n},Nn.mean=function(e){return Bt(e,Qs)},Nn.meanBy=function(e,t){return Bt(e,io(t,2))},Nn.min=function(e){return e&&e.length?hr(e,Qs,Pr):n},Nn.minBy=function(e,t){return e&&e.length?hr(e,io(t,2),Pr):n},Nn.stubArray=dl,Nn.stubFalse=hl,Nn.stubObject=function(){return{}},Nn.stubString=function(){return""},Nn.stubTrue=function(){return!0},Nn.multiply=yl,Nn.nth=function(e,t){return e&&e.length?zr(e,us(t)):n},Nn.noConflict=function(){return ct._===this&&(ct._=De),this},Nn.noop=il,Nn.now=Ca,Nn.pad=function(e,t,n){e=ps(e);var r=(t=us(t))?sn(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return Bi(pt(i),n)+e+Bi(ft(i),n)},Nn.padEnd=function(e,t,n){e=ps(e);var r=(t=us(t))?sn(e):0;return t&&r<t?e+Bi(t-r,n):e},Nn.padStart=function(e,t,n){e=ps(e);var r=(t=us(t))?sn(e):0;return t&&r<t?Bi(t-r,n)+e:e},Nn.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),yn(ps(e).replace(te,""),t||0)},Nn.random=function(e,t,r){if(r&&"boolean"!=typeof r&&mo(e,t,r)&&(t=r=n),r===n&&("boolean"==typeof t?(r=t,t=n):"boolean"==typeof e&&(r=e,e=n)),e===n&&t===n?(e=0,t=1):(e=cs(e),t===n?(t=e,e=0):t=cs(t)),e>t){var i=e;e=t,t=i}if(r||e%1||t%1){var o=bn();return mn(e+o*(t-e+ot("1e-"+((o+"").length-1))),t)}return Wr(e,t)},Nn.reduce=function(e,t,n){var r=Ba(e)?Ft:Ht,i=arguments.length<3;return r(e,io(t,4),n,i,cr)},Nn.reduceRight=function(e,t,n){var r=Ba(e)?Ot:Ht,i=arguments.length<3;return r(e,io(t,4),n,i,ur)},Nn.repeat=function(e,t,r){return t=(r?mo(e,t,r):t===n)?1:us(t),$r(ps(e),t)},Nn.replace=function(){var e=arguments,t=ps(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Nn.result=function(e,t,r){var i=-1,o=(t=gi(t,e)).length;for(o||(o=1,e=n);++i<o;){var a=null==e?n:e[Mo(t[i])];a===n&&(i=o,a=r),e=qa(a)?a.call(e):a}return e},Nn.round=bl,Nn.runInContext=e,Nn.sample=function(e){return(Ba(e)?Yn:qr)(e)},Nn.size=function(e){if(null==e)return 0;if(Va(e))return rs(e)?sn(e):e.length;var t=uo(e);return t==w||t==A?e.size:Mr(e).length},Nn.snakeCase=Hs,Nn.some=function(e,t,r){var i=Ba(e)?Mt:ei;return r&&mo(e,t,r)&&(t=n),i(e,io(t,3))},Nn.sortedIndex=function(e,t){return ti(e,t)},Nn.sortedIndexBy=function(e,t,n){return ni(e,t,io(n,2))},Nn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var r=ti(e,t);if(r<n&&La(e[r],t))return r}return-1},Nn.sortedLastIndex=function(e,t){return ti(e,t,!0)},Nn.sortedLastIndexBy=function(e,t,n){return ni(e,t,io(n,2),!0)},Nn.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=ti(e,t,!0)-1;if(La(e[n],t))return n}return-1},Nn.startCase=Ws,Nn.startsWith=function(e,t,n){return e=ps(e),n=null==n?0:ir(us(n),0,e.length),t=oi(t),e.slice(n,n+t.length)==t},Nn.subtract=wl,Nn.sum=function(e){return e&&e.length?Wt(e,Qs):0},Nn.sumBy=function(e,t){return e&&e.length?Wt(e,io(t,2)):0},Nn.template=function(e,t,r){var i=Nn.templateSettings;r&&mo(e,t,r)&&(t=n),e=ps(e),t=vs({},t,i,Yi);var o,a,s=vs({},t.imports,i.imports,Yi),l=Es(s),c=Yt(s,l),u=0,d=t.interpolate||ve,h="__p += '",f=Ae((t.escape||ve).source+"|"+d.source+"|"+(d===X?ce:ve).source+"|"+(t.evaluate||ve).source+"|$","g"),p="//# sourceURL="+(Me.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++tt+"]")+"\n";e.replace(f,function(t,n,r,i,s,l){return r||(r=i),h+=e.slice(u,l).replace(ye,en),n&&(o=!0,h+="' +\n__e("+n+") +\n'"),s&&(a=!0,h+="';\n"+s+";\n__p += '"),r&&(h+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),u=l+t.length,t}),h+="';\n";var g=Me.call(t,"variable")&&t.variable;if(g){if(se.test(g))throw new xe("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(a?h.replace(B,""):h).replace(U,"$1").replace(V,"$1;"),h="function("+(g||"obj")+") {\n"+(g?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var m=Ys(function(){return Ce(l,p+"return "+h).apply(n,c)});if(m.source=h,Ga(m))throw m;return m},Nn.times=function(e,t){if((e=us(e))<1||e>c)return[];var n=d,r=mn(e,d);t=io(t),e-=d;for(var i=$t(r,t);++n<e;)t(n);return i},Nn.toFinite=cs,Nn.toInteger=us,Nn.toLength=ds,Nn.toLower=function(e){return ps(e).toLowerCase()},Nn.toNumber=hs,Nn.toSafeInteger=function(e){return e?ir(us(e),-9007199254740991,c):0===e?e:0},Nn.toString=ps,Nn.toUpper=function(e){return ps(e).toUpperCase()},Nn.trim=function(e,t,r){if((e=ps(e))&&(r||t===n))return Gt(e);if(!e||!(t=oi(t)))return e;var i=ln(e),o=ln(t);return vi(i,Kt(i,o),Zt(i,o)+1).join("")},Nn.trimEnd=function(e,t,r){if((e=ps(e))&&(r||t===n))return e.slice(0,cn(e)+1);if(!e||!(t=oi(t)))return e;var i=ln(e);return vi(i,0,Zt(i,ln(t))+1).join("")},Nn.trimStart=function(e,t,r){if((e=ps(e))&&(r||t===n))return e.replace(te,"");if(!e||!(t=oi(t)))return e;var i=ln(e);return vi(i,Kt(i,ln(t))).join("")},Nn.truncate=function(e,t){var r=30,i="...";if(Ka(t)){var o="separator"in t?t.separator:o;r="length"in t?us(t.length):r,i="omission"in t?oi(t.omission):i}var a=(e=ps(e)).length;if(tn(e)){var s=ln(e);a=s.length}if(r>=a)return e;var l=r-sn(i);if(l<1)return i;var c=s?vi(s,0,l).join(""):e.slice(0,l);if(o===n)return c+i;if(s&&(l+=c.length-l),ts(o)){if(e.slice(l).search(o)){var u,d=c;for(o.global||(o=Ae(o.source,ps(ue.exec(o))+"g")),o.lastIndex=0;u=o.exec(d);)var h=u.index;c=c.slice(0,h===n?l:h)}}else if(e.indexOf(oi(o),l)!=l){var f=c.lastIndexOf(o);f>-1&&(c=c.slice(0,f))}return c+i},Nn.unescape=function(e){return(e=ps(e))&&$.test(e)?e.replace(H,un):e},Nn.uniqueId=function(e){var t=++Pe;return ps(e)+t},Nn.upperCase=$s,Nn.upperFirst=Gs,Nn.each=pa,Nn.eachRight=ga,Nn.first=Vo,rl(Nn,(fl={},vr(Nn,function(e,t){Me.call(Nn.prototype,t)||(fl[t]=e)}),fl),{chain:!1}),Nn.VERSION="4.17.21",_t(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){Nn[e].placeholder=Nn}),_t(["drop","take"],function(e,t){Un.prototype[e]=function(r){r=r===n?1:gn(us(r),0);var i=this.__filtered__&&!t?new Un(this):this.clone();return i.__filtered__?i.__takeCount__=mn(r,i.__takeCount__):i.__views__.push({size:mn(r,d),type:e+(i.__dir__<0?"Right":"")}),i},Un.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),_t(["filter","map","takeWhile"],function(e,t){var n=t+1,r=1==n||3==n;Un.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:io(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}}),_t(["head","last"],function(e,t){var n="take"+(t?"Right":"");Un.prototype[e]=function(){return this[n](1).value()[0]}}),_t(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");Un.prototype[e]=function(){return this.__filtered__?new Un(this):this[n](1)}}),Un.prototype.compact=function(){return this.filter(Qs)},Un.prototype.find=function(e){return this.filter(e).head()},Un.prototype.findLast=function(e){return this.reverse().find(e)},Un.prototype.invokeMap=Gr(function(e,t){return"function"==typeof e?new Un(this):this.map(function(n){return Er(n,e,t)})}),Un.prototype.reject=function(e){return this.filter(Fa(io(e)))},Un.prototype.slice=function(e,t){e=us(e);var r=this;return r.__filtered__&&(e>0||t<0)?new Un(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==n&&(r=(t=us(t))<0?r.dropRight(-t):r.take(t-e)),r)},Un.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Un.prototype.toArray=function(){return this.take(d)},vr(Un.prototype,function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),o=Nn[i?"take"+("last"==t?"Right":""):t],a=i||/^find/.test(t);o&&(Nn.prototype[t]=function(){var t=this.__wrapped__,s=i?[1]:arguments,l=t instanceof Un,c=s[0],u=l||Ba(t),d=function(e){var t=o.apply(Nn,Tt([e],s));return i&&h?t[0]:t};u&&r&&"function"==typeof c&&1!=c.length&&(l=u=!1);var h=this.__chain__,f=!!this.__actions__.length,p=a&&!h,g=l&&!f;if(!a&&u){t=g?t:new Un(this);var m=e.apply(t,s);return m.__actions__.push({func:ca,args:[d],thisArg:n}),new Bn(m,h)}return p&&g?e.apply(this,s):(m=this.thru(d),p?i?m.value()[0]:m.value():m)})}),_t(["pop","push","shift","sort","splice","unshift"],function(e){var t=Ie[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Nn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(Ba(i)?i:[],e)}return this[n](function(n){return t.apply(Ba(n)?n:[],e)})}}),vr(Un.prototype,function(e,t){var n=Nn[t];if(n){var r=n.name+"";Me.call(In,r)||(In[r]=[]),In[r].push({name:t,func:n})}}),In[Li(n,2).name]=[{name:"wrapper",func:n}],Un.prototype.clone=function(){var e=new Un(this.__wrapped__);return e.__actions__=Ai(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ai(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ai(this.__views__),e},Un.prototype.reverse=function(){if(this.__filtered__){var e=new Un(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Un.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Ba(e),r=t<0,i=n?e.length:0,o=function(e,t,n){for(var r=-1,i=n.length;++r<i;){var o=n[r],a=o.size;switch(o.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=mn(t,e+a);break;case"takeRight":e=gn(e,t-a)}}return{start:e,end:t}}(0,i,this.__views__),a=o.start,s=o.end,l=s-a,c=r?s:a-1,u=this.__iteratees__,d=u.length,h=0,f=mn(l,this.__takeCount__);if(!n||!r&&i==l&&f==l)return ui(e,this.__actions__);var p=[];e:for(;l--&&h<f;){for(var g=-1,m=e[c+=t];++g<d;){var v=u[g],y=v.iteratee,b=v.type,w=y(m);if(2==b)m=w;else if(!w){if(1==b)continue e;break e}}p[h++]=m}return p},Nn.prototype.at=ua,Nn.prototype.chain=function(){return la(this)},Nn.prototype.commit=function(){return new Bn(this.value(),this.__chain__)},Nn.prototype.next=function(){this.__values__===n&&(this.__values__=ls(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?n:this.__values__[this.__index__++]}},Nn.prototype.plant=function(e){for(var t,r=this;r instanceof zn;){var i=Ro(r);i.__index__=0,i.__values__=n,t?o.__wrapped__=i:t=i;var o=i;r=r.__wrapped__}return o.__wrapped__=e,t},Nn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Un){var t=e;return this.__actions__.length&&(t=new Un(this)),(t=t.reverse()).__actions__.push({func:ca,args:[Ko],thisArg:n}),new Bn(t,this.__chain__)}return this.thru(Ko)},Nn.prototype.toJSON=Nn.prototype.valueOf=Nn.prototype.value=function(){return ui(this.__wrapped__,this.__actions__)},Nn.prototype.first=Nn.prototype.head,Je&&(Nn.prototype[Je]=function(){return this}),Nn}();dt?((dt.exports=hn)._=hn,ut._=hn):ct._=hn}).call(Mi)}(Oi,Oi.exports)),Oi.exports);const Ri=e=>null===e.parentId||"null"===e.parentId||!e.parentId,Li=e=>{var t,n,r,i;const{state:a,actions:s,options:l}=Ei(),{searchTerm:c,sortBy:u,sortOrder:d,selectedFolder:h,pagination:f}=a,{setSearchTerm:p,setSortBy:g,setSortOrder:m,setPagination:v}=s,y=e||s.fetchFiles,b=(0,o.useRef)(null),w=(0,o.useRef)(Pi.debounce(e=>{const t=JSON.stringify(e);b.current!==t&&(b.current=t,null==y||y(e))},150)).current,x=(0,o.useCallback)(()=>{var e;const t=null===(e=null==l?void 0:l.config)||void 0===e?void 0:e.disablePagination;return{folderId:h||"",search:(null==c?void 0:c.trim())||void 0,page:t?void 0:f.current,limit:t?void 0:f.pageSize,sortBy:u,sortOrder:d,itemType:"all"}},[h,c,f.current,f.pageSize,u,d,null===(t=null==l?void 0:l.config)||void 0===t?void 0:t.disablePagination]),C=(0,o.useCallback)(e=>{var t,n;if(p&&p(e),v&&v({current:1,pageSize:f.pageSize,total:0}),y){const r={folderId:h||"",search:(null==e?void 0:e.trim())||void 0,page:(null===(t=null==l?void 0:l.config)||void 0===t?void 0:t.disablePagination)?void 0:1,limit:(null===(n=null==l?void 0:l.config)||void 0===n?void 0:n.disablePagination)?void 0:f.pageSize,sortBy:u,sortOrder:d,itemType:"all"};y(r)}},[p,v,f.pageSize,y,h,u,d,null===(n=null==l?void 0:l.config)||void 0===n?void 0:n.disablePagination]),_=(0,o.useCallback)((e,t)=>{var n,r;null==g||g(e),null==m||m(t),y&&w({folderId:h||"",search:(null==c?void 0:c.trim())||void 0,page:(null===(n=null==l?void 0:l.config)||void 0===n?void 0:n.disablePagination)?void 0:f.current,limit:(null===(r=null==l?void 0:l.config)||void 0===r?void 0:r.disablePagination)?void 0:f.pageSize,sortBy:e,sortOrder:t,itemType:"all"})},[g,m,w,h,c,f.current,f.pageSize,null===(r=null==l?void 0:l.config)||void 0===r?void 0:r.disablePagination]),S=(0,o.useCallback)((e,t)=>{var n;(null===(n=null==l?void 0:l.config)||void 0===n?void 0:n.disablePagination)||(v&&v({current:e,pageSize:t||f.pageSize,total:f.total}),y&&w({folderId:h||"",search:(null==c?void 0:c.trim())||void 0,page:e,limit:t||f.pageSize,sortBy:u,sortOrder:d,itemType:"all"}))},[v,f.pageSize,f.total,w,h,c,u,d,null===(i=null==l?void 0:l.config)||void 0===i?void 0:i.disablePagination]);return(0,o.useEffect)(()=>{if(y){const e=x();w(Object.assign(Object.assign({},e),{page:1}))}},[h]),(0,o.useEffect)(()=>{y&&w(x())},[]),(0,o.useEffect)(()=>()=>{var e;null===(e=w.cancel)||void 0===e||e.call(w)},[w]),{state:{searchTerm:c||"",sortBy:u||"name",sortOrder:d||"asc"},actions:{setSearchTerm:p||(()=>{}),setSortBy:g||(()=>{}),setSortOrder:m||(()=>{}),handleSearch:C,handleSort:_,handlePaginationChange:S,getCurrentQueryParams:x}}},Ni=()=>{var e;const{notification:t}=u.A.useApp(),n=Ei(),{options:r}=n,i=(0,o.useCallback)(async e=>{let t;if(r.handleNotify){try{t=await r.handleNotify(e)}catch(e){}if(!1===t)return!1;"object"==typeof t&&t&&(e=t)}if("error"===e.type&&r.handleError){try{t=await r.handleError(e)}catch(e){}if(!1===t)return!1;"object"==typeof t&&t&&(e=t)}if("success"===e.type&&r.handleSuccess){try{t=await r.handleSuccess(e)}catch(e){}if(t)return!1}return t},[r]),a=(0,o.useCallback)(async function(e,n=!1){var o;try{void 0===e.visibility&&(e.visibility=!n);const a=await i(e);if("object"==typeof a&&(e=a),!1===e.visibility||!1===a||!1===(null===(o=r.config)||void 0===o?void 0:o.showNotifications))return e;const s=t[e.type];"function"==typeof s&&s(e)}catch(e){}return e},[t,i,null===(e=r.config)||void 0===e?void 0:e.showNotifications]);return(0,o.useMemo)(()=>({error:(e,t=!1)=>a(Object.assign(Object.assign({},e),{type:"error"}),t),success:(e,t=!1)=>a(Object.assign(Object.assign({},e),{type:"success"}),t),warning:(e,t=!1)=>a(Object.assign(Object.assign({},e),{type:"warning"}),t),notify:a}),[a])};Object.values({images:["image/jpeg","image/png","image/gif","image/webp","image/svg+xml","image/bmp","image/tiff"],documents:["application/pdf","text/plain","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],archives:["application/zip","application/x-rar-compressed","application/x-7z-compressed"],videos:["video/mp4","video/avi","video/quicktime","video/x-msvideo"],audio:["audio/mpeg","audio/wav","audio/ogg"]}).flat();const Di=e=>{if(0===e)return"0 Bytes";const t=Math.floor(Math.log(e)/Math.log(1024));return parseFloat((e/Math.pow(1024,t)).toFixed(2))+" "+["Bytes","KB","MB","GB"][t]},zi=e=>{if(!e||e<=0)return"";const t=1048576;return e<t?`${Math.round(e/1024)} Kb`:`${(e/t).toFixed(2)} Mb`},Bi=e=>{if(null==e)return"";if("number"==typeof e)return zi(e);const t=String(e).trim();if(!t)return"";const n=Number(t);return Number.isNaN(n)?t:zi(n)},Ui=(e,t)=>{const n=t.filter(e=>"string"==typeof e),r=new Set(n.map(e=>e.toLowerCase())),i="string"==typeof e?e:String(null!=e?e:"");if(!r.has(i.toLowerCase()))return i;const o=i.lastIndexOf("."),a=o>0?i.slice(0,o):i,s=o>0?i.slice(o):"";let l,c=1;do{l=`${a}_${c}${s}`,c++}while(r.has(l.toLowerCase()));return l},Vi={FileNotFound:"File not found or no longer available.",FileAlreadyExists:"File with this name already exists.",FileInvalidName:"File name is not valid. Allowed characters: {{allowedChars}}",FileAccessDenied:"You don't have permission to access this file.",FileReadError:"Failed to read the file.",FileWriteError:"Failed to write the file.",FileTooLarge:"File is too large ({{fileSize}}). Maximum allowed size: {{maxSize}}.",FileTypeNotAllowed:"This file type is not allowed.",FileCorrupted:"The file appears to be corrupted.",FileChecksumMismatch:"File integrity check failed.",FileStorageQuotaExceeded:"Storage quota exceeded. Please free up space.",FileLocked:"File is locked by another process or user.",FileVersionConflict:"File version conflict. Please refresh and try again.",FolderNotFound:"Folder not found or no longer available.",FolderAlreadyExists:"Folder with this name already exists.",FolderInvalidName:"Folder name is not valid. Allowed characters: {{allowedChars}}",FolderAccessDenied:"You don't have permission to access this folder.",FolderReadError:"Failed to read the folder contents.",FolderWriteError:"Failed to write to the folder.",FolderQuotaExceeded:"Folder storage quota exceeded.",FolderNotEmpty:"Folder is not empty.",FolderBackendError:"Server error while processing the folder.",FolderTimeout:"Folder operation took too long.",RenameNotAllowed:"Renaming is not allowed for this item.",MoveNotAllowed:"Moving is not allowed for this item.",CopyNotAllowed:"Copying is not allowed for this item.",DeleteNotAllowed:"Deleting is not allowed for this item.",MoveIntoSelf:"Cannot move an item into itself.",MoveIntoDescendant:"Cannot move an item into its descendant folder.",CopyIntoSelf:"Cannot copy an item into itself.",UnsupportedOperation:"This operation is not supported.",ConfigError:"Configuration error occurred.",FileUploadQuotaExceeded:"You have exceeded the upload quota.",FileUploadNetworkError:"Network error while uploading the file.",FileUploadTimeout:"File upload took too long.",FileUploadBackendError:"Server error while uploading the file.",UploadUrlInvalid:"The specified URL is not valid.",UploadUrlNotReachable:"The specified URL is not reachable.",UploadUrlContentTypeNotAllowed:"Content type at the URL is not allowed.",UploadUrlDownloadFailed:"Failed to download file from the URL.",FileLookupFailed:"Failed to find existing file by URL.",FileProxyFailed:"Failed to load file through proxy.",FileProxyNotConfigured:"File proxy is not configured.",FileDownloadNetworkError:"Network error while downloading the file.",FileDownloadTimeout:"File download took too long.",FileDownloadBackendError:"Server error while downloading the file.",BatchPartialFailure:"Some items could not be processed.",BatchAllFailed:"Failed to process all items in the batch.",BatchConflict:"Some items in the batch are in a conflicting state.",BatchValidationFailed:"Some items in the batch did not pass validation.",BatchItemLimitExceeded:"Batch operation exceeds the maximum number of items allowed.",ValidationError:"Some of the provided data is invalid.",PayloadTooLarge:"File is too large ({{fileSize}}). Maximum allowed size: {{maxSize}}.",UnsupportedMediaType:"This media type is not supported.",NetworkError:"Network error. Please check your connection and try again.",BackendError:"Server error. Please try again later.",Timeout:"The operation took too long. Please try again.",AuthenticationFailed:"Authentication failed. Please sign in again.",AuthorizationFailed:"You are not allowed to perform this action.",RateLimitExceeded:"Too many requests. Please try again a bit later.",ServiceUnavailable:"Service is temporarily unavailable. Please try again later.",AIResponseInvalid:"AI service returned an invalid response.",AIImageGenerationFailed:"Failed to generate image using AI.",AIImageGenerationLimitExceeded:"You have reached the AI image generation limit.",IntegrationError:"Error in external integration.",ThirdPartyError:"Error in a third-party service.",UnknownError:"An unknown error occurred."},Hi={FileTooLarge:"File is too large to upload.",PayloadTooLarge:"File is too large to upload."},Wi=(e,t,n)=>{var r,i,o;if(!e)return;const a=Vi[e];if(!a)return;const s=null!==(r=null==n?void 0:n.fileSize)&&void 0!==r?r:"",l=null!==(i=null==n?void 0:n.maxSize)&&void 0!==i?i:"";if(("FileTooLarge"===e||"PayloadTooLarge"===e)&&(!s||!l)){const n=Hi[e];return n?t(n):t(a,{fileSize:"?",maxSize:"?"})}return t(a,{allowedChars:null!==(o=null==n?void 0:n.allowedChars)&&void 0!==o?o:"a-z A-Z 0-9 . _ -",fileSize:s,maxSize:l})},$i=e=>{if(!e||"string"!=typeof e)return;const t=e.toLowerCase();return(t.includes("maximum number of files")||t.includes("number of files exceeded"))&&(t.includes("allowed")||t.includes("received"))?"BatchItemLimitExceeded":t.includes("exceeds")||t.includes("maximum")||t.includes("too large")||t.includes("size limit")||t.includes("object size")||t.includes("\u0440\u0430\u0437\u043c\u0435\u0440")||t.includes("\u043f\u0440\u0435\u0432\u044b\u0448\u0435\u043d")?"PayloadTooLarge":t.includes("403")||t.includes("forbidden")||t.includes("access denied")||t.includes("\u0434\u043e\u0441\u0442\u0443\u043f \u0437\u0430\u043f\u0440\u0435\u0449\u0451\u043d")?"AuthorizationFailed":t.includes("404")||t.includes("not found")||t.includes("\u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d")?"UploadUrlNotReachable":t.includes("already exists")||t.includes("\u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442")||t.includes("\u0434\u0443\u0431\u043b\u0438\u043a\u0430\u0442")?"FileAlreadyExists":t.includes("invalid")&&(t.includes("name")||t.includes("\u0438\u043c\u044f")||t.includes("\u043d\u0430\u0437\u0432\u0430"))?"FileInvalidName":t.includes("type")&&(t.includes("not allowed")||t.includes("\u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f"))?"FileTypeNotAllowed":void 0},Gi=e=>{var t,n,r,i,o,a,s,l,c,u,d,h,f,p,g,m,v,y;if(!e)return{message:"Unknown error",raw:e};if("string"==typeof e)return{message:e};if(e instanceof Error){const o=e;return{message:null!==(t=o.message)&&void 0!==t?t:e.message,code:o.code,status:null!==(n=o.status)&&void 0!==n?n:o.httpStatus,stack:null!==(r=o.stack)&&void 0!==r?r:e.stack,raw:null!==(i=o.raw)&&void 0!==i?i:e}}if("object"==typeof e){const t=e,n=null!==(o=t.data)&&void 0!==o?o:t,r=null!==(a=null==n?void 0:n.data)&&void 0!==a?a:n,i=null!==(c=null!==(l=null!==(s=t.message)&&void 0!==s?s:null==n?void 0:n.message)&&void 0!==l?l:t.error)&&void 0!==c?c:t.reason,b=null!==(h=null!==(d=null!==(u=t.status)&&void 0!==u?u:t.httpStatus)&&void 0!==d?d:null==r?void 0:r.status)&&void 0!==h?h:null==n?void 0:n.status,w=null!==(f=t.code)&&void 0!==f?f:null==n?void 0:n.code,x=t.stack,C=null!==(p=t.raw)&&void 0!==p?p:e,_=null!==(m=null!==(g=t.fileSize)&&void 0!==g?g:null==r?void 0:r.fileSize)&&void 0!==m?m:null==n?void 0:n.fileSize,S=null!==(y=null!==(v=t.maxSize)&&void 0!==v?v:null==r?void 0:r.maxSize)&&void 0!==y?y:null==n?void 0:n.maxSize;if(i||w||b||x||C)return Object.assign(Object.assign({message:i,code:w,status:b,stack:x,raw:C},null!=_&&{fileSize:_}),null!=S&&{maxSize:S})}return{message:String(e),raw:e}},qi=(e,t,n)=>{const r=Gi(e),i=null==r?void 0:r.code;if("FileTooLarge"===i&&null!=(null==n?void 0:n.fileSize)&&null!=(null==n?void 0:n.maxSize))return t("File too large ({{size}}). Maximum allowed size: {{maxSize}}",{size:Di(n.fileSize),maxSize:Di(n.maxSize)});if(("BatchItemLimitExceeded"===i||"exceeded_max_files"===i)&&(null==r?void 0:r.message)){const{allowed:e,received:n}=function(e){const t=e.match(/Allowed:\s*(\d+)/i),n=e.match(/received:\s*(\d+)/i);return{allowed:t?parseInt(t[1],10):void 0,received:n?parseInt(n[1],10):void 0}}(r.message);if(null!=e&&null!=n)return t("Maximum number of files exceeded. Allowed: {{allowed}}, received: {{received}}",{allowed:e,received:n})}if((null==r?void 0:r.message)&&"Unknown error"!==r.message)return r.message;const o=null!=(null==n?void 0:n.fileSize)&&null!=(null==n?void 0:n.maxSize)?{fileSize:Di(n.fileSize),maxSize:Di(n.maxSize)}:void 0,a=Wi(i,t,o);return null!=a?a:t("Error uploading file")},Yi=e=>{const t=Gi(e);return"path_folder_not_found"===(null==t?void 0:t.code)},Xi=["file_get_contents","open stream","failed to open stream","http request failed","curl_error"],Ki=(e,t,n)=>{var r;if(!e)return t("Error when downloading a file by URL");const i=null!==(r=(e=>{const t=$i(e);if("AuthorizationFailed"===t){const t=(e||"").toLowerCase();if(t.includes("download")||t.includes("url")||t.includes("file_get_contents")||t.includes("failed to download"))return"UploadUrlNotReachable"}return t})(null==e?void 0:e.message))&&void 0!==r?r:null==e?void 0:e.code,o=Wi(i,t,n);if(o)return o;const a=(null==e?void 0:e.message)&&"string"==typeof e.message?e.message.trim():null;return a&&function(e){if(!e||e.length>200)return!1;const t=e.toLowerCase();return!Xi.some(e=>t.includes(e))}(a)?a:t("Failed to download file from the URL.")},Zi=e=>Array.isArray(e)?e.filter(e=>(null==e?void 0:e.id)&&"folders"!==e.id).map(e=>e.name).filter(Boolean).join("/"):"",Ji=e=>{const t=e.trim();if(!t)return"";const n=t.toLowerCase(),r=[n.indexOf(" and "),n.indexOf(" or "),t.indexOf(","),t.indexOf(";"),n.indexOf(". ")].filter(e=>e>=0);if(0===r.length)return t;const i=Math.min(...r);return t.slice(0,i).trim()||t},Qi=(e,t)=>{const n=(e=>{var t,n,r,i;if(e&&"object"==typeof e){const o=e,a=null!==(r=null===(n=null===(t=o.data)||void 0===t?void 0:t.data)||void 0===n?void 0:n.path_folder)&&void 0!==r?r:null===(i=o.data)||void 0===i?void 0:i.path_folder;if("string"==typeof a&&a.trim())return Ji(a)||null}const o=Gi(e),a=null==o?void 0:o.message;if(!a)return null;const s=a.toLowerCase(),l=["\u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442:","not exists:","not exist:","not found:"];for(const u of l){const e=s.indexOf(u);if(e>=0){const t=a.slice(e+u.length).trim();return Ji(t)||null}}const c=["not exists ","not exist ","not found "];for(const u of c){const e=s.indexOf(u);if(e>=0){const t=a.slice(e+u.length).trim();return Ji(t)||null}}return null})(e);return n?(e=>{const t=e.split("/").filter(Boolean);return t.length<=1?"":(t.pop(),t.join("/"))})(n):Zi(t)},eo=async e=>{var t;const{options:n,pathFolder:r,dataProviders:i}=e;if(null==i?void 0:i.clearCache)return void await i.clearCache(r||null);const o=null===(t=null==n?void 0:n.apiEndpoints)||void 0===t?void 0:t.clearCache;if(!o)return;const a=o.includes("?");let s=o;r&&r.length>0&&(s=`${o}${a?"&":"?"}path_folder=${encodeURIComponent(r)}`);const l=await fetch(s,{method:"POST"});if(!l.ok)throw new Error(`Cache clear failed: ${l.status}`)},to={"\u0430":"a","\u0431":"b","\u0432":"v","\u0433":"g","\u0434":"d","\u0435":"e","\u0451":"yo","\u0436":"zh","\u0437":"z","\u0438":"i","\u0439":"y","\u043a":"k","\u043b":"l","\u043c":"m","\u043d":"n","\u043e":"o","\u043f":"p","\u0440":"r","\u0441":"s","\u0442":"t","\u0443":"u","\u0444":"f","\u0445":"h","\u0446":"ts","\u0447":"ch","\u0448":"sh","\u0449":"sch","\u044a":"","\u044b":"y","\u044c":"","\u044d":"e","\u044e":"yu","\u044f":"ya","\u0410":"A","\u0411":"B","\u0412":"V","\u0413":"G","\u0414":"D","\u0415":"E","\u0401":"Yo","\u0416":"Zh","\u0417":"Z","\u0418":"I","\u0419":"Y","\u041a":"K","\u041b":"L","\u041c":"M","\u041d":"N","\u041e":"O","\u041f":"P","\u0420":"R","\u0421":"S","\u0422":"T","\u0423":"U","\u0424":"F","\u0425":"H","\u0426":"Ts","\u0427":"Ch","\u0428":"Sh","\u0429":"Sch","\u042a":"","\u042b":"Y","\u042c":"","\u042d":"E","\u042e":"Yu","\u042f":"Ya"},no=/[<>:"/\\|?*()#\x00-\x1f]/g,ro={transliterate:!0,replaceSpaces:!0,removeForbiddenChars:!0,toLowerCase:!0};function io(e,t){let n=e;return t.transliterate&&(n=n.split("").map(e=>to[e]||e).join("")),t.removeForbiddenChars&&(n=n.replace(no,"_")),t.replaceSpaces&&(n=n.replace(/\s+/g,"_")),t.toLowerCase&&(n=n.toLowerCase()),n=n.replace(/_{2,}/g,"_"),n=n.replace(/^_+|_+$/g,""),n.length>255&&(n=n.substring(0,255)),n}function oo(e,t){const n=Object.assign(Object.assign({},ro),null==t?void 0:t.fileNameProcessing),r=e.lastIndexOf(".");let i,o;return r>0?(i=e.substring(0,r),o=e.substring(r).toLowerCase()):(i=e,o=""),(io(i,n)||"unnamed_file")+o}function ao(e,t){return io(e,Object.assign(Object.assign({},ro),null==t?void 0:t.folderNameProcessing))||"unnamed_folder"}const so=()=>{var e,t;const{state:n,actions:r,options:i}=Ei(),{t:a}=En(),s=Ni(),{folders:l,selectedFolder:c,pathHistory:u,form:d,loading:h,isModalVisible:f}=n,{setFolders:p,setLoading:g,setIsModalVisible:m}=r,{dataProviders:v,config:y}=i,b=(0,o.useCallback)(e=>(Array.isArray(e)?e:[]).filter(e=>e&&e.id&&e.name).map(e=>({id:e.id,name:e.name,parentId:e.folderId?e.folderId:null})),[]),w=(0,o.useCallback)(async(e=!1)=>{null==g||g(!0);try{let e=[];const t="lazy"===(null==y?void 0:y.folderTreeLoading);if(!(null==v?void 0:v.getFolders)){if(null==v?void 0:v.getFiles){const e=async n=>{const{files:r}=await v.getFiles({itemType:"folder",folderId:n||void 0}),i=b(r);if(t)return i;const o=await Promise.all(i.map(t=>e(t.id)));return[...i,...o.flat()]},n=await e(null);return void(p&&p(e=>{const r=Array.isArray(e)?e:[];if(!t){const e=n;return e.filter(e=>e.id===e.parentId).length,e}const i=r.filter(e=>e.parentId),o=[...i,...n],a=o.filter(e=>e.id===e.parentId);return a.length,o}))}return}{const n=!t;e=await v.getFolders({parentId:null,deep:n})}const n=Array.isArray(e)?e:[];null==p||p(n);const r=n.filter(e=>e.id===e.parentId);r.length}catch(t){const r=Gi(t);if(!e&&(404===(null==r?void 0:r.status)||"FileNotFound"===(null==r?void 0:r.code))){const r=Qi(t,u||[]);try{return await eo({options:i,pathFolder:r,dataProviders:null==i?void 0:i.dataProviders}),void await w(!0)}catch(e){}}const o=Wi(null==r?void 0:r.code,a);s.error({id:"FOLDERS_FETCH_FAILED",message:null!=o?o:a("Failed to load folders"),placement:"bottomRight",innerException:t,data:{reason:t instanceof Error?t.message:String(t)}})}finally{null==g||g(!1)}},[null==v?void 0:v.getFiles,null==v?void 0:v.getFolders,p,g,null==y?void 0:y.folderTreeLoading,b,s,a,u,i]),x=(0,o.useCallback)(()=>w(),[w]),C=(0,o.useCallback)(async e=>{try{let t,n;if(null==v?void 0:v.getFolders){t=await v.getFolders({parentId:e,deep:!1});const r=Array.isArray(l)?l:[],i=new Set(t.map(e=>e.id)),o=r.filter(t=>t.parentId!==e||i.has(t.id));n=[...o,...t.filter(e=>!o.some(t=>t.id===e.id))]}else{if(!(null==v?void 0:v.getFiles))return[];{const{files:r}=await v.getFiles({itemType:"folder",folderId:e||void 0});t=b(r);const i=Array.isArray(l)?l:[],o=new Set(t.map(e=>e.id)),a=i.filter(t=>t.parentId!==e||o.has(t.id));n=[...a,...t.filter(e=>!a.some(t=>t.id===e.id))]}}let r=n,i=0;for(;i!==r.length;){i=r.length;const e=new Set(r.map(e=>e.id));r=r.filter(t=>!t.parentId||e.has(t.parentId))}return null==p||p(r),t}catch(e){return[]}},[v,l,p,b]),_=(0,o.useCallback)(()=>{var e;const t=null!==(e=null==y?void 0:y.defaultFolderName)&&void 0!==e?e:a("New folder");d.setFieldsValue({folderName:t}),null==m||m(!0)},[d,m,a,null==y?void 0:y.defaultFolderName]),S=(0,o.useCallback)(async(e,t)=>{const n=[...(Array.isArray(l)?l:[]).filter(t=>t.id!==e.id),e];if(null==p||p(n),e.parentId&&(await C(e.parentId),await new Promise(e=>setTimeout(e,50))),!(null==t?void 0:t.preserveSelection)&&r.setSelectedFolder&&r.setSelectedFolder(e.id),!(null==t?void 0:t.preserveSelection)&&r.setPathHistory){const t=Array.isArray(n)?n:[],i=(e,n=new Set)=>{if(n.has(e))return[];const r=t.find(t=>t.id===e);if(!r)return[];const o=new Set(n);return o.add(e),r.parentId?[...i(r.parentId,o),{id:r.id,name:r.name}]:[{id:r.id,name:r.name}]},o=i(e.id),s=[{id:"folders",name:a("Folders")},...o];r.setPathHistory(s)}},[l,p,r,n.pathHistory,C,a]),A=(0,o.useCallback)(async e=>{try{if(null==v?void 0:v.getFolders){const t=await v.getFolders();return(Array.isArray(t)?t:[]).some(t=>t.id===e)}if(null==v?void 0:v.getFiles){const t=new Set,n=async r=>{const{files:i}=await v.getFiles({itemType:"folder",folderId:r||void 0}),o=b(i);for(const a of o)if(!t.has(a.id)){if(t.add(a.id),a.id===e)return!0;if(await n(a.id))return!0}return!1};return await n(null)}}catch(e){}return!1},[null==v?void 0:v.getFolders,null==v?void 0:v.getFiles,b]),k=(0,o.useCallback)(async e=>{var t;let n,r,i=null;try{const o=await(e?e.validateFields():d.validateFields());if(n=o.folderName.trim(),!n){const e=o.targetFolder||(c&&"folders"!==c?c:null);return void s.warning({id:"FOLDER_OPERATION_VALIDATION_FAILED",message:a("Folder name cannot be empty"),placement:"bottomRight",data:{folderName:n,folderId:null!=e?e:null,reason:"emptyName",is_force_create:!!o.is_force_create}})}r=ao(n,y);const h=o.targetFolder;if(h)i="folders"!==h?h:null;else if(c&&"folders"!==c)i=c;else if(Array.isArray(u)&&u.length>1){const e=u[u.length-1];i=(null==e?void 0:e.id)&&"folders"!==e.id?e.id:null}if((!1===(null==y?void 0:y.paginationAvailable)||!1===(null==y?void 0:y.hasPagination)||!0===(null==y?void 0:y.disablePagination))&&(null==v?void 0:v.getFolders))try{const e=(await v.getFolders({parentId:i,deep:!1})||[]).map(e=>{var t;return null===(t=e.name)||void 0===t?void 0:t.toLowerCase()}).filter(Boolean);if(e.includes(n.trim().toLowerCase()))return void s.error({id:"FOLDER_ALREADY_EXISTS",message:a("A folder with that name already exists. Please enter a different folder name."),placement:"bottomRight",data:{folderName:n,folderId:i}})}catch(e){}let f;if(!(null==v?void 0:v.createFolder))return void s.error({id:"FOLDER_CREATE_PROVIDER_NOT_CONFIGURED",message:a("Folder creation provider is not configured"),placement:"bottomRight",data:{folderName:r,folderId:null!=i?i:null,is_force_create:!!o.is_force_create}});f=await v.createFolder({name:r,parentId:i,is_force_create:!!o.is_force_create}),(e=>{if(!e||!e.id)throw new Error(a("Invalid server response: folder ID is missing"));if(e.id===e.parentId&&e.parentId)throw new Error(a("Error: folder cannot be its own parent"))})(f);const g={id:f.id,name:f.name,parentId:null!=i?i:null,childCount:f.childCount},b=[...(Array.isArray(l)?l:[]).filter(e=>e.id!==g.id),g];if(null==p||p(b),s.success({id:"FOLDER_CREATE_SUCCESS",message:a("Folder created"),placement:"bottomRight",data:{itemIds:[g.id],folderId:null!==(t=g.parentId)&&void 0!==t?t:null,folderName:g.name}}),e||null==m||m(!1),(async()=>{try{await S(g,{preserveSelection:Boolean(e)}),await x(),await new Promise(e=>setTimeout(e,200)),await A(f.id)}catch(e){}})(),e)return f}catch(e){const t=Gi(e),o=Wi(null==t?void 0:t.code,a);s.error({id:"FOLDER_CREATE_FAILED",message:null!=o?o:a("Failed to create folder"),placement:"bottomRight",innerException:e,data:{folderName:r||n,folderId:null!=i?i:null,reason:e instanceof Error?e.message:String(e)}})}},[d,c,v,S,x,A,m,s,a,l,p,y,u]),E=(0,o.useCallback)(()=>{null==m||m(!1)},[m]),I=(0,o.useCallback)((e,t=new Set)=>{const n=Array.isArray(l)?l:[];return e.map(e=>{if(t.has(e.id))return{key:e.id,label:e.name+" "+a("(error)"),icon:o.createElement($.A,{style:{color:"red"}})};const r=new Set(t);r.add(e.id);const i=n.filter(t=>t.parentId===e.id&&t.id!==e.id);return{key:e.id,label:e.name,children:i.length>0?I(i,r):void 0}})},[l]),j=(0,o.useCallback)(()=>{const e=Array.isArray(l)?l:[],t={key:"folders",label:a("Folders"),children:[]},n=e.filter(e=>null===e.parentId||!e.parentId);return t.children=I(n),[t]},[l,a,I]),T=(0,o.useCallback)(async(e,t)=>{var n,o,c,u;let d;try{const h=t.trim(),f=null==l?void 0:l.find(t=>t.id===e);if(!h)return void s.warning({id:"FOLDER_OPERATION_VALIDATION_FAILED",message:a("Folder name cannot be empty"),placement:"bottomRight",data:{folderId:e,folderName:t,reason:"emptyName"}});if(d=ao(h,y),!1===(null===(n=null==y?void 0:y.features)||void 0===n?void 0:n.enableRenameFolder))return void s.error({id:"FOLDER_RENAME_DISABLED_BY_CONFIG",message:a("Folder rename is disabled by config"),placement:"bottomRight",data:{itemId:e,itemName:null!==(o=null==f?void 0:f.name)&&void 0!==o?o:d}});if(!(null===(c=i.dataProviders)||void 0===c?void 0:c.renameFolder))return void s.error({id:"FOLDER_RENAME_FAILED",message:a("Folder rename provider is not configured"),placement:"bottomRight",data:{itemId:e,itemName:d,error:{message:"providerNotConfigured"}}});const p=await i.dataProviders.renameFolder(e,d);if(!(null==p?void 0:p.id))return void s.error({id:"FOLDER_RENAME_FAILED",message:a("Unexpected response when renaming folder"),placement:"bottomRight",data:{itemId:e,itemName:d,error:{message:"invalidResponse"}}});await x(),e!==p.id&&r.setSelectedFolder&&r.setSelectedFolder(p.id),s.success({id:"FOLDER_RENAME_SUCCESS",message:a("Folder renamed"),placement:"bottomRight",data:{itemId:p.id,itemName:p.name,folderId:null!==(u=p.parentId)&&void 0!==u?u:null}})}catch(n){s.error({id:"FOLDER_RENAME_FAILED",message:a("Failed to rename folder"),placement:"bottomRight",innerException:n,data:{itemId:e,itemName:d||t,error:{message:n instanceof Error?n.message:String(n)}}})}},[x,l,null===(e=i.dataProviders)||void 0===e?void 0:e.renameFolder,null===(t=null==y?void 0:y.features)||void 0===t?void 0:t.enableRenameFolder,y,r.setSelectedFolder,s,a]);return{state:{folders:l,isCreatingFolder:f,loading:h},actions:{fetchFolders:x,fetchChildFolders:C,handleCreateFolder:_,handleModalOk:k,handleModalCancel:E,generateMenuItems:j,renameFolder:T}}},lo=()=>{const{options:e,actions:t}=Ei(),{dataProviders:n,config:r}=e,{setUndoDeletion:i}=t,{t:a}=En(),s=Ni(),l=(0,o.useCallback)(async({items:e,selectedFolder:t,getItemNameById:o,showNotifications:l=!1})=>{let c=0,u=0;const d=[],h=async t=>{if(null==n?void 0:n.deleteItems)try{const r=await n.deleteItems(e.map(e=>e.id),{permanent:t}),i=r.detailed;if(i){const e=i.filter(e=>e.success),t=i.filter(e=>!e.success),n=t.filter(e=>{var t;const n=null!==(t=e.innerException)&&void 0!==t?t:e.error;return Yi(n)}),r=t.filter(e=>{var t;const n=null!==(t=e.innerException)&&void 0!==t?t:e.error;return!Yi(n)});return c+=e.length+n.length,u+=r.length,void r.forEach(e=>{var t;const n=(e=>{var t;return null!==(t=e.requestId)&&void 0!==t?t:e.id})(e),r=null!==(t=e.innerException)&&void 0!==t?t:e.error,i=Gi(r);d.push({itemId:n,itemName:o(n),error:i})})}if(r.success)c+=e.length;else{const t=r.error;if(Yi(t))c+=e.length;else if(t){u+=e.length;const n=Gi(t);d.push({error:n})}else u+=e.length}return}catch(n){if(Yi(n))c+=e.length;else{u+=e.length;const r=Gi(n);d.push({error:r})}}},f=(null==r?void 0:r.enableTrashFolder)&&"Trash"===t;return(null==r?void 0:r.enableTrashFolder)&&!f?await h(!1):await h(!0),c>0&&(null==r?void 0:r.enableTrashFolder)&&!f&&(null==i||i({itemIds:e.map(e=>e.id),sourceFolderId:t||"folders"})),l&&(c>0&&s.success({id:"FILES_DELETE_SUCCESS",message:a("Files deleted"),placement:"bottomRight",data:{successCount:c,totalCount:e.length,itemIds:e.map(e=>e.id),folderId:t||null}}),u>0&&s.error({id:"FILES_DELETE_ERROR",message:a("Error when deleting a file"),placement:"bottomRight",data:{failCount:u,totalCount:e.length,itemIds:e.map(e=>e.id),itemNames:e.map(e=>o(e.id)),folderId:t||null,errors:d}})),{successCount:c,failCount:u,errorDetails:d}},[n,r,i,a,s]);return{deleteItems:l}};class co extends Error{constructor(e,t,n,r){super(e),this.code=t,this.status=n,this.details=r,this.name="FileManagerApiError",Error.captureStackTrace&&Error.captureStackTrace(this,co)}}const uo=/^(localhost|127\.0\.0\.1|0\.0\.0\.0|::1)$/i,ho=/^(10\.|172\.(1[6-9]|2[0-9]|3[01])\.|192\.168\.)/;function fo(e,t){const n=e.trim();if(!n)throw new co(t("Enter the URL of the image"),"UploadUrlInvalid");if(n.length>8192)throw new co(t("URL too long"),"UploadUrlInvalid");let r;try{r=new URL(n)}catch(e){throw new co(t("The specified URL is not valid."),"UploadUrlInvalid")}const i=r.protocol.toLowerCase();if("http:"!==i&&"https:"!==i)throw new co(t("Only http and https URLs are supported"),"UploadUrlInvalid");const o=r.hostname.toLowerCase();if(uo.test(o))throw new co(t("Private and local URLs are not allowed"),"UploadUrlInvalid");if(ho.test(o))throw new co(t("Private and local URLs are not allowed"),"UploadUrlInvalid")}function po(e,t){return new Promise(function(n,r){let i;return go(e).then(function(e){try{return i=e,n(new Blob([t.slice(0,2),i,t.slice(2)],{type:"image/jpeg"}))}catch(e){return r(e)}},r)})}const go=e=>new Promise((t,n)=>{const r=new FileReader;r.addEventListener("load",({target:{result:e}})=>{const r=new DataView(e);let i=0;if(65496!==r.getUint16(i))return n("not a valid JPEG");for(i+=2;;){const o=r.getUint16(i);if(65498===o)break;const a=r.getUint16(i+2);if(65505===o&&1165519206===r.getUint32(i+4)){const o=i+10;let s;switch(r.getUint16(o)){case 18761:s=!0;break;case 19789:s=!1;break;default:return n("TIFF header contains invalid endian")}if(42!==r.getUint16(o+2,s))return n("TIFF header contains invalid version");const l=r.getUint32(o+4,s),c=o+l+2+12*r.getUint16(o+l,s);for(let e=o+l+2;e<c;e+=12)if(274==r.getUint16(e,s)){if(3!==r.getUint16(e+2,s))return n("Orientation data type is invalid");if(1!==r.getUint32(e+4,s))return n("Orientation data count is invalid");r.setUint16(e+8,1,s);break}return t(e.slice(i,i+2+a))}i+=2+a}return t(new Blob)}),r.readAsArrayBuffer(e)});var mo={},vo={get exports(){return mo},set exports(e){mo=e}};!function(){var e,t,n={};vo.exports=n,n.parse=function(e,t){for(var r=n.bin.readUshort,i=n.bin.readUint,o=0,a={},s=new Uint8Array(e),l=s.length-4;101010256!=i(s,l);)l--;o=l,o+=4;var c=r(s,o+=4);r(s,o+=2);var u=i(s,o+=2),d=i(s,o+=4);o+=4,o=d;for(var h=0;h<c;h++){i(s,o),o+=4,o+=4,o+=4,i(s,o+=4),u=i(s,o+=4);var f=i(s,o+=4),p=r(s,o+=4),g=r(s,o+2),m=r(s,o+4);o+=6;var v=i(s,o+=8);o+=4,o+=p+g+m,n._readLocal(s,v,a,u,f,t)}return a},n._readLocal=function(e,t,r,i,o,a){var s=n.bin.readUshort,l=n.bin.readUint;l(e,t),s(e,t+=4),s(e,t+=2);var c=s(e,t+=2);l(e,t+=2),l(e,t+=4),t+=4;var u=s(e,t+=8),d=s(e,t+=2);t+=2;var h=n.bin.readUTF8(e,t,u);if(t+=u,t+=d,a)r[h]={size:o,csize:i};else{var f=new Uint8Array(e.buffer,t);if(0==c)r[h]=new Uint8Array(f.buffer.slice(t,t+i));else{if(8!=c)throw"unknown compression method: "+c;var p=new Uint8Array(o);n.inflateRaw(f,p),r[h]=p}}},n.inflateRaw=function(e,t){return n.F.inflate(e,t)},n.inflate=function(e,t){return e[0],e[1],n.inflateRaw(new Uint8Array(e.buffer,e.byteOffset+2,e.length-6),t)},n.deflate=function(e,t){null==t&&(t={level:6});var r=0,i=new Uint8Array(50+Math.floor(1.1*e.length));i[r]=120,i[r+1]=156,r+=2,r=n.F.deflateRaw(e,i,r,t.level);var o=n.adler(e,0,e.length);return i[r+0]=o>>>24&255,i[r+1]=o>>>16&255,i[r+2]=o>>>8&255,i[r+3]=o>>>0&255,new Uint8Array(i.buffer,0,r+4)},n.deflateRaw=function(e,t){null==t&&(t={level:6});var r=new Uint8Array(50+Math.floor(1.1*e.length)),i=n.F.deflateRaw(e,r,i,t.level);return new Uint8Array(r.buffer,0,i)},n.encode=function(e,t){null==t&&(t=!1);var r=0,i=n.bin.writeUint,o=n.bin.writeUshort,a={};for(var s in e){var l=!n._noNeed(s)&&!t,c=e[s],u=n.crc.crc(c,0,c.length);a[s]={cpr:l,usize:c.length,crc:u,file:l?n.deflateRaw(c):c}}for(var s in a)r+=a[s].file.length+30+46+2*n.bin.sizeUTF8(s);r+=22;var d=new Uint8Array(r),h=0,f=[];for(var s in a){var p=a[s];f.push(h),h=n._writeHeader(d,h,s,p,0)}var g=0,m=h;for(var s in a)p=a[s],f.push(h),h=n._writeHeader(d,h,s,p,1,f[g++]);var v=h-m;return i(d,h,101010256),h+=4,o(d,h+=4,g),o(d,h+=2,g),i(d,h+=2,v),i(d,h+=4,m),h+=4,h+=2,d.buffer},n._noNeed=function(e){var t=e.split(".").pop().toLowerCase();return-1!="png,jpg,jpeg,zip".indexOf(t)},n._writeHeader=function(e,t,r,i,o,a){var s=n.bin.writeUint,l=n.bin.writeUshort,c=i.file;return s(e,t,0==o?67324752:33639248),t+=4,1==o&&(t+=2),l(e,t,20),l(e,t+=2,0),l(e,t+=2,i.cpr?8:0),s(e,t+=2,0),s(e,t+=4,i.crc),s(e,t+=4,c.length),s(e,t+=4,i.usize),l(e,t+=4,n.bin.sizeUTF8(r)),l(e,t+=2,0),t+=2,1==o&&(t+=2,t+=2,s(e,t+=6,a),t+=4),t+=n.bin.writeUTF8(e,t,r),0==o&&(e.set(c,t),t+=c.length),t},n.crc={table:function(){for(var e=new Uint32Array(256),t=0;t<256;t++){for(var n=t,r=0;r<8;r++)1&n?n=3988292384^n>>>1:n>>>=1;e[t]=n}return e}(),update:function(e,t,r,i){for(var o=0;o<i;o++)e=n.crc.table[255&(e^t[r+o])]^e>>>8;return e},crc:function(e,t,r){return 4294967295^n.crc.update(4294967295,e,t,r)}},n.adler=function(e,t,n){for(var r=1,i=0,o=t,a=t+n;o<a;){for(var s=Math.min(o+5552,a);o<s;)i+=r+=e[o++];r%=65521,i%=65521}return i<<16|r},n.bin={readUshort:function(e,t){return e[t]|e[t+1]<<8},writeUshort:function(e,t,n){e[t]=255&n,e[t+1]=n>>8&255},readUint:function(e,t){return 16777216*e[t+3]+(e[t+2]<<16|e[t+1]<<8|e[t])},writeUint:function(e,t,n){e[t]=255&n,e[t+1]=n>>8&255,e[t+2]=n>>16&255,e[t+3]=n>>24&255},readASCII:function(e,t,n){for(var r="",i=0;i<n;i++)r+=String.fromCharCode(e[t+i]);return r},writeASCII:function(e,t,n){for(var r=0;r<n.length;r++)e[t+r]=n.charCodeAt(r)},pad:function(e){return e.length<2?"0"+e:e},readUTF8:function(e,t,r){for(var i,o="",a=0;a<r;a++)o+="%"+n.bin.pad(e[t+a].toString(16));try{i=decodeURIComponent(o)}catch(i){return n.bin.readASCII(e,t,r)}return i},writeUTF8:function(e,t,n){for(var r=n.length,i=0,o=0;o<r;o++){var a=n.charCodeAt(o);if(4294967168&a)if(4294965248&a)if(4294901760&a){if(4292870144&a)throw"e";e[t+i]=240|a>>18,e[t+i+1]=128|a>>12&63,e[t+i+2]=128|a>>6&63,e[t+i+3]=128|63&a,i+=4}else e[t+i]=224|a>>12,e[t+i+1]=128|a>>6&63,e[t+i+2]=128|63&a,i+=3;else e[t+i]=192|a>>6,e[t+i+1]=128|63&a,i+=2;else e[t+i]=a,i++}return i},sizeUTF8:function(e){for(var t=e.length,n=0,r=0;r<t;r++){var i=e.charCodeAt(r);if(4294967168&i)if(4294965248&i)if(4294901760&i){if(4292870144&i)throw"e";n+=4}else n+=3;else n+=2;else n++}return n}},n.F={},n.F.deflateRaw=function(e,t,r,i){var o=[[0,0,0,0,0],[4,4,8,4,0],[4,5,16,8,0],[4,6,16,16,0],[4,10,16,32,0],[8,16,32,32,0],[8,16,128,128,0],[8,32,128,256,0],[32,128,258,1024,1],[32,258,258,4096,1]][i],a=n.F.U,s=n.F._goodIndex;n.F._hash;var l=n.F._putsE,c=0,u=r<<3,d=0,h=e.length;if(0==i){for(;c<h;)l(t,u,c+(S=Math.min(65535,h-c))==h?1:0),u=n.F._copyExact(e,c,S,t,u+8),c+=S;return u>>>3}var f=a.lits,p=a.strt,g=a.prev,m=0,v=0,y=0,b=0,w=0,x=0;for(h>2&&(p[x=n.F._hash(e,0)]=0),c=0;c<h;c++){if(w=x,c+1<h-2){x=n.F._hash(e,c+1);var C=c+1&32767;g[C]=p[x],p[x]=C}if(d<=c){(m>14e3||v>26697)&&h-c>100&&(d<c&&(f[m]=c-d,m+=2,d=c),u=n.F._writeBlock(c==h-1||d==h?1:0,f,m,b,e,y,c-y,t,u),m=v=b=0,y=c);var _=0;c<h-2&&(_=n.F._bestMatch(e,c,g,w,Math.min(o[2],h-c),o[3]));var S=_>>>16,A=65535&_;if(0!=_){A=65535&_;var k=s(S=_>>>16,a.of0);a.lhst[257+k]++;var E=s(A,a.df0);a.dhst[E]++,b+=a.exb[k]+a.dxb[E],f[m]=S<<23|c-d,f[m+1]=A<<16|k<<8|E,m+=2,d=c+S}else a.lhst[e[c]]++;v++}}for(y==c&&0!=e.length||(d<c&&(f[m]=c-d,m+=2,d=c),u=n.F._writeBlock(1,f,m,b,e,y,c-y,t,u),m=0,v=0,m=v=b=0,y=c);7&u;)u++;return u>>>3},n.F._bestMatch=function(e,t,r,i,o,a){var s=32767&t,l=r[s],c=s-l+32768&32767;if(l==s||i!=n.F._hash(e,t-c))return 0;for(var u=0,d=0,h=Math.min(32767,t);c<=h&&0!=--a&&l!=s;){if(0==u||e[t+u]==e[t+u-c]){var f=n.F._howLong(e,t,c);if(f>u){if(d=c,(u=f)>=o)break;c+2<f&&(f=c+2);for(var p=0,g=0;g<f-2;g++){var m=t-c+g+32768&32767,v=m-r[m]+32768&32767;v>p&&(p=v,l=m)}}}c+=(s=l)-(l=r[s])+32768&32767}return u<<16|d},n.F._howLong=function(e,t,n){if(e[t]!=e[t-n]||e[t+1]!=e[t+1-n]||e[t+2]!=e[t+2-n])return 0;var r=t,i=Math.min(e.length,t+258);for(t+=3;t<i&&e[t]==e[t-n];)t++;return t-r},n.F._hash=function(e,t){return(e[t]<<8|e[t+1])+(e[t+2]<<4)&65535},n.saved=0,n.F._writeBlock=function(e,t,r,i,o,a,s,l,c){var u,d,h,f,p,g,m,v,y,b=n.F.U,w=n.F._putsF,x=n.F._putsE;b.lhst[256]++,d=(u=n.F.getTrees())[0],h=u[1],f=u[2],p=u[3],g=u[4],m=u[5],v=u[6],y=u[7];var C=32+(c+3&7?8-(c+3&7):0)+(s<<3),_=i+n.F.contSize(b.fltree,b.lhst)+n.F.contSize(b.fdtree,b.dhst),S=i+n.F.contSize(b.ltree,b.lhst)+n.F.contSize(b.dtree,b.dhst);S+=14+3*m+n.F.contSize(b.itree,b.ihst)+(2*b.ihst[16]+3*b.ihst[17]+7*b.ihst[18]);for(var A=0;A<286;A++)b.lhst[A]=0;for(A=0;A<30;A++)b.dhst[A]=0;for(A=0;A<19;A++)b.ihst[A]=0;var k=C<_&&C<S?0:_<S?1:2;if(w(l,c,e),w(l,c+1,k),c+=3,0==k){for(;7&c;)c++;c=n.F._copyExact(o,a,s,l,c)}else{var E,I;if(1==k&&(E=b.fltree,I=b.fdtree),2==k){n.F.makeCodes(b.ltree,d),n.F.revCodes(b.ltree,d),n.F.makeCodes(b.dtree,h),n.F.revCodes(b.dtree,h),n.F.makeCodes(b.itree,f),n.F.revCodes(b.itree,f),E=b.ltree,I=b.dtree,x(l,c,p-257),x(l,c+=5,g-1),x(l,c+=5,m-4),c+=4;for(var j=0;j<m;j++)x(l,c+3*j,b.itree[1+(b.ordr[j]<<1)]);c+=3*m,c=n.F._codeTiny(v,b.itree,l,c),c=n.F._codeTiny(y,b.itree,l,c)}for(var T=a,F=0;F<r;F+=2){for(var O=t[F],M=O>>>23,P=T+(8388607&O);T<P;)c=n.F._writeLit(o[T++],E,l,c);if(0!=M){var R=t[F+1],L=R>>16,N=R>>8&255,D=255&R;x(l,c=n.F._writeLit(257+N,E,l,c),M-b.of0[N]),c+=b.exb[N],w(l,c=n.F._writeLit(D,I,l,c),L-b.df0[D]),c+=b.dxb[D],T+=M}}c=n.F._writeLit(256,E,l,c)}return c},n.F._copyExact=function(e,t,n,r,i){var o=i>>>3;return r[o]=n,r[o+1]=n>>>8,r[o+2]=255-r[o],r[o+3]=255-r[o+1],o+=4,r.set(new Uint8Array(e.buffer,t,n),o),i+(n+4<<3)},n.F.getTrees=function(){for(var e=n.F.U,t=n.F._hufTree(e.lhst,e.ltree,15),r=n.F._hufTree(e.dhst,e.dtree,15),i=[],o=n.F._lenCodes(e.ltree,i),a=[],s=n.F._lenCodes(e.dtree,a),l=0;l<i.length;l+=2)e.ihst[i[l]]++;for(l=0;l<a.length;l+=2)e.ihst[a[l]]++;for(var c=n.F._hufTree(e.ihst,e.itree,7),u=19;u>4&&0==e.itree[1+(e.ordr[u-1]<<1)];)u--;return[t,r,c,o,s,u,i,a]},n.F.getSecond=function(e){for(var t=[],n=0;n<e.length;n+=2)t.push(e[n+1]);return t},n.F.nonZero=function(e){for(var t="",n=0;n<e.length;n+=2)0!=e[n+1]&&(t+=(n>>1)+",");return t},n.F.contSize=function(e,t){for(var n=0,r=0;r<t.length;r++)n+=t[r]*e[1+(r<<1)];return n},n.F._codeTiny=function(e,t,r,i){for(var o=0;o<e.length;o+=2){var a=e[o],s=e[o+1];i=n.F._writeLit(a,t,r,i);var l=16==a?2:17==a?3:7;a>15&&(n.F._putsE(r,i,s,l),i+=l)}return i},n.F._lenCodes=function(e,t){for(var n=e.length;2!=n&&0==e[n-1];)n-=2;for(var r=0;r<n;r+=2){var i=e[r+1],o=r+3<n?e[r+3]:-1,a=r+5<n?e[r+5]:-1,s=0==r?-1:e[r-1];if(0==i&&o==i&&a==i){for(var l=r+5;l+2<n&&e[l+2]==i;)l+=2;(c=Math.min(l+1-r>>>1,138))<11?t.push(17,c-3):t.push(18,c-11),r+=2*c-2}else if(i==s&&o==i&&a==i){for(l=r+5;l+2<n&&e[l+2]==i;)l+=2;var c=Math.min(l+1-r>>>1,6);t.push(16,c-3),r+=2*c-2}else t.push(i,0)}return n>>>1},n.F._hufTree=function(e,t,r){var i=[],o=e.length,a=t.length,s=0;for(s=0;s<a;s+=2)t[s]=0,t[s+1]=0;for(s=0;s<o;s++)0!=e[s]&&i.push({lit:s,f:e[s]});var l=i.length,c=i.slice(0);if(0==l)return 0;if(1==l){var u=i[0].lit;return c=0==u?1:0,t[1+(u<<1)]=1,t[1+(c<<1)]=1,1}i.sort(function(e,t){return e.f-t.f});var d=i[0],h=i[1],f=0,p=1,g=2;for(i[0]={lit:-1,f:d.f+h.f,l:d,r:h,d:0};p!=l-1;)d=f!=p&&(g==l||i[f].f<i[g].f)?i[f++]:i[g++],h=f!=p&&(g==l||i[f].f<i[g].f)?i[f++]:i[g++],i[p++]={lit:-1,f:d.f+h.f,l:d,r:h};var m=n.F.setDepth(i[p-1],0);for(m>r&&(n.F.restrictDepth(c,r,m),m=r),s=0;s<l;s++)t[1+(c[s].lit<<1)]=c[s].d;return m},n.F.setDepth=function(e,t){return-1!=e.lit?(e.d=t,t):Math.max(n.F.setDepth(e.l,t+1),n.F.setDepth(e.r,t+1))},n.F.restrictDepth=function(e,t,n){var r=0,i=1<<n-t,o=0;for(e.sort(function(e,t){return t.d==e.d?e.f-t.f:t.d-e.d}),r=0;r<e.length&&e[r].d>t;r++){var a=e[r].d;e[r].d=t,o+=i-(1<<n-a)}for(o>>>=n-t;o>0;)(a=e[r].d)<t?(e[r].d++,o-=1<<t-a-1):r++;for(;r>=0;r--)e[r].d==t&&o<0&&(e[r].d--,o++)},n.F._goodIndex=function(e,t){var n=0;return t[16|n]<=e&&(n|=16),t[8|n]<=e&&(n|=8),t[4|n]<=e&&(n|=4),t[2|n]<=e&&(n|=2),t[1|n]<=e&&(n|=1),n},n.F._writeLit=function(e,t,r,i){return n.F._putsF(r,i,t[e<<1]),i+t[1+(e<<1)]},n.F.inflate=function(e,t){var r=Uint8Array;if(3==e[0]&&0==e[1])return t||new r(0);var i=n.F,o=i._bitsF,a=i._bitsE,s=i._decodeTiny,l=i.makeCodes,c=i.codes2map,u=i._get17,d=i.U,h=null==t;h&&(t=new r(e.length>>>2<<3));for(var f,p,g=0,m=0,v=0,y=0,b=0,w=0,x=0,C=0,_=0;0==g;)if(g=o(e,_,1),m=o(e,_+1,2),_+=3,0!=m){if(h&&(t=n.F._check(t,C+(1<<17))),1==m&&(f=d.flmap,p=d.fdmap,w=511,x=31),2==m){v=a(e,_,5)+257,y=a(e,_+5,5)+1,b=a(e,_+10,4)+4,_+=14;for(var S=0;S<38;S+=2)d.itree[S]=0,d.itree[S+1]=0;var A=1;for(S=0;S<b;S++){var k=a(e,_+3*S,3);d.itree[1+(d.ordr[S]<<1)]=k,k>A&&(A=k)}_+=3*b,l(d.itree,A),c(d.itree,A,d.imap),f=d.lmap,p=d.dmap,_=s(d.imap,(1<<A)-1,v+y,e,_,d.ttree);var E=i._copyOut(d.ttree,0,v,d.ltree);w=(1<<E)-1;var I=i._copyOut(d.ttree,v,y,d.dtree);x=(1<<I)-1,l(d.ltree,E),c(d.ltree,E,f),l(d.dtree,I),c(d.dtree,I,p)}for(;;){var j=f[u(e,_)&w];_+=15&j;var T=j>>>4;if(T>>>8==0)t[C++]=T;else{if(256==T)break;var F=C+T-254;if(T>264){var O=d.ldef[T-257];F=C+(O>>>3)+a(e,_,7&O),_+=7&O}var M=p[u(e,_)&x];_+=15&M;var P=M>>>4,R=d.ddef[P],L=(R>>>4)+o(e,_,15&R);for(_+=15&R,h&&(t=n.F._check(t,C+(1<<17)));C<F;)t[C]=t[C++-L],t[C]=t[C++-L],t[C]=t[C++-L],t[C]=t[C++-L];C=F}}}else{7&_&&(_+=8-(7&_));var N=4+(_>>>3),D=e[N-4]|e[N-3]<<8;h&&(t=n.F._check(t,C+D)),t.set(new r(e.buffer,e.byteOffset+N,D),C),_=N+D<<3,C+=D}return t.length==C?t:t.slice(0,C)},n.F._check=function(e,t){var n=e.length;if(t<=n)return e;var r=new Uint8Array(Math.max(n<<1,t));return r.set(e,0),r},n.F._decodeTiny=function(e,t,r,i,o,a){for(var s=n.F._bitsE,l=n.F._get17,c=0;c<r;){var u=e[l(i,o)&t];o+=15&u;var d=u>>>4;if(d<=15)a[c]=d,c++;else{var h=0,f=0;16==d?(f=3+s(i,o,2),o+=2,h=a[c-1]):17==d?(f=3+s(i,o,3),o+=3):18==d&&(f=11+s(i,o,7),o+=7);for(var p=c+f;c<p;)a[c]=h,c++}}return o},n.F._copyOut=function(e,t,n,r){for(var i=0,o=0,a=r.length>>>1;o<n;){var s=e[o+t];r[o<<1]=0,r[1+(o<<1)]=s,s>i&&(i=s),o++}for(;o<a;)r[o<<1]=0,r[1+(o<<1)]=0,o++;return i},n.F.makeCodes=function(e,t){for(var r,i,o,a,s=n.F.U,l=e.length,c=s.bl_count,u=0;u<=t;u++)c[u]=0;for(u=1;u<l;u+=2)c[e[u]]++;var d=s.next_code;for(r=0,c[0]=0,i=1;i<=t;i++)r=r+c[i-1]<<1,d[i]=r;for(o=0;o<l;o+=2)0!=(a=e[o+1])&&(e[o]=d[a],d[a]++)},n.F.codes2map=function(e,t,r){for(var i=e.length,o=n.F.U.rev15,a=0;a<i;a+=2)if(0!=e[a+1])for(var s=a>>1,l=e[a+1],c=s<<4|l,u=t-l,d=e[a]<<u,h=d+(1<<u);d!=h;)r[o[d]>>>15-t]=c,d++},n.F.revCodes=function(e,t){for(var r=n.F.U.rev15,i=15-t,o=0;o<e.length;o+=2){var a=e[o]<<t-e[o+1];e[o]=r[a]>>>i}},n.F._putsE=function(e,t,n){n<<=7&t;var r=t>>>3;e[r]|=n,e[r+1]|=n>>>8},n.F._putsF=function(e,t,n){n<<=7&t;var r=t>>>3;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},n.F._bitsE=function(e,t,n){return(e[t>>>3]|e[1+(t>>>3)]<<8)>>>(7&t)&(1<<n)-1},n.F._bitsF=function(e,t,n){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)&(1<<n)-1},n.F._get17=function(e,t){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)},n.F._get25=function(e,t){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16|e[3+(t>>>3)]<<24)>>>(7&t)},n.F.U=(e=Uint16Array,t=Uint32Array,{next_code:new e(16),bl_count:new e(16),ordr:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],of0:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],exb:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],ldef:new e(32),df0:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],dxb:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],ddef:new t(32),flmap:new e(512),fltree:[],fdmap:new e(32),fdtree:[],lmap:new e(32768),ltree:[],ttree:[],dmap:new e(32768),dtree:[],imap:new e(512),itree:[],rev15:new e(32768),lhst:new t(286),dhst:new t(30),ihst:new t(19),lits:new t(15e3),strt:new e(65536),prev:new e(32768)}),function(){for(var e=n.F.U,t=0;t<32768;t++){var r=t;r=(4278255360&(r=(4042322160&(r=(3435973836&(r=(2863311530&r)>>>1|(1431655765&r)<<1))>>>2|(858993459&r)<<2))>>>4|(252645135&r)<<4))>>>8|(16711935&r)<<8,e.rev15[t]=(r>>>16|r<<16)>>>17}function i(e,t,n){for(;0!=t--;)e.push(0,n)}for(t=0;t<32;t++)e.ldef[t]=e.of0[t]<<3|e.exb[t],e.ddef[t]=e.df0[t]<<4|e.dxb[t];i(e.fltree,144,8),i(e.fltree,112,9),i(e.fltree,24,7),i(e.fltree,8,8),n.F.makeCodes(e.fltree,9),n.F.codes2map(e.fltree,9,e.flmap),n.F.revCodes(e.fltree,9),i(e.fdtree,32,5),n.F.makeCodes(e.fdtree,5),n.F.codes2map(e.fdtree,5,e.fdmap),n.F.revCodes(e.fdtree,5),i(e.itree,19,0),i(e.ltree,286,0),i(e.dtree,30,0),i(e.ttree,320,0)}()}();var yo=function(e,t){return t.forEach(function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach(function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}})}),Object.freeze(e)}({__proto__:null,default:mo},[mo]);const bo=function(){var e={nextZero(e,t){for(;0!=e[t];)t++;return t},readUshort:(e,t)=>e[t]<<8|e[t+1],writeUshort(e,t,n){e[t]=n>>8&255,e[t+1]=255&n},readUint:(e,t)=>16777216*e[t]+(e[t+1]<<16|e[t+2]<<8|e[t+3]),writeUint(e,t,n){e[t]=n>>24&255,e[t+1]=n>>16&255,e[t+2]=n>>8&255,e[t+3]=255&n},readASCII(e,t,n){let r="";for(let i=0;i<n;i++)r+=String.fromCharCode(e[t+i]);return r},writeASCII(e,t,n){for(let r=0;r<n.length;r++)e[t+r]=n.charCodeAt(r)},readBytes(e,t,n){const r=[];for(let i=0;i<n;i++)r.push(e[t+i]);return r},pad:e=>e.length<2?`0${e}`:e,readUTF8(t,n,r){let i,o="";for(let a=0;a<r;a++)o+=`%${e.pad(t[n+a].toString(16))}`;try{i=decodeURIComponent(o)}catch(i){return e.readASCII(t,n,r)}return i}};function t(t,n,r,i){const a=n*r,s=o(i),l=Math.ceil(n*s/8),c=new Uint8Array(4*a),u=new Uint32Array(c.buffer),{ctype:d}=i,{depth:h}=i,f=e.readUshort;if(6==d){const e=a<<2;if(8==h)for(var p=0;p<e;p+=4)c[p]=t[p],c[p+1]=t[p+1],c[p+2]=t[p+2],c[p+3]=t[p+3];if(16==h)for(p=0;p<e;p++)c[p]=t[p<<1]}else if(2==d){const e=i.tabs.tRNS;if(null==e){if(8==h)for(p=0;p<a;p++){var g=3*p;u[p]=255<<24|t[g+2]<<16|t[g+1]<<8|t[g]}if(16==h)for(p=0;p<a;p++)g=6*p,u[p]=255<<24|t[g+4]<<16|t[g+2]<<8|t[g]}else{var m=e[0];const n=e[1],r=e[2];if(8==h)for(p=0;p<a;p++){var v=p<<2;g=3*p,u[p]=255<<24|t[g+2]<<16|t[g+1]<<8|t[g],t[g]==m&&t[g+1]==n&&t[g+2]==r&&(c[v+3]=0)}if(16==h)for(p=0;p<a;p++)v=p<<2,g=6*p,u[p]=255<<24|t[g+4]<<16|t[g+2]<<8|t[g],f(t,g)==m&&f(t,g+2)==n&&f(t,g+4)==r&&(c[v+3]=0)}}else if(3==d){const e=i.tabs.PLTE,o=i.tabs.tRNS,s=o?o.length:0;if(1==h)for(var y=0;y<r;y++){var b=y*l,w=y*n;for(p=0;p<n;p++){v=w+p<<2;var x=3*(C=t[b+(p>>3)]>>7-(7&p)&1);c[v]=e[x],c[v+1]=e[x+1],c[v+2]=e[x+2],c[v+3]=C<s?o[C]:255}}if(2==h)for(y=0;y<r;y++)for(b=y*l,w=y*n,p=0;p<n;p++)v=w+p<<2,x=3*(C=t[b+(p>>2)]>>6-((3&p)<<1)&3),c[v]=e[x],c[v+1]=e[x+1],c[v+2]=e[x+2],c[v+3]=C<s?o[C]:255;if(4==h)for(y=0;y<r;y++)for(b=y*l,w=y*n,p=0;p<n;p++)v=w+p<<2,x=3*(C=t[b+(p>>1)]>>4-((1&p)<<2)&15),c[v]=e[x],c[v+1]=e[x+1],c[v+2]=e[x+2],c[v+3]=C<s?o[C]:255;if(8==h)for(p=0;p<a;p++){var C;v=p<<2,x=3*(C=t[p]),c[v]=e[x],c[v+1]=e[x+1],c[v+2]=e[x+2],c[v+3]=C<s?o[C]:255}}else if(4==d){if(8==h)for(p=0;p<a;p++){v=p<<2;var _=t[S=p<<1];c[v]=_,c[v+1]=_,c[v+2]=_,c[v+3]=t[S+1]}if(16==h)for(p=0;p<a;p++){var S;v=p<<2,_=t[S=p<<2],c[v]=_,c[v+1]=_,c[v+2]=_,c[v+3]=t[S+2]}}else if(0==d)for(m=i.tabs.tRNS?i.tabs.tRNS:-1,y=0;y<r;y++){const e=y*l,r=y*n;if(1==h)for(var A=0;A<n;A++){var k=(_=255*(t[e+(A>>>3)]>>>7-(7&A)&1))==255*m?0:255;u[r+A]=k<<24|_<<16|_<<8|_}else if(2==h)for(A=0;A<n;A++)k=(_=85*(t[e+(A>>>2)]>>>6-((3&A)<<1)&3))==85*m?0:255,u[r+A]=k<<24|_<<16|_<<8|_;else if(4==h)for(A=0;A<n;A++)k=(_=17*(t[e+(A>>>1)]>>>4-((1&A)<<2)&15))==17*m?0:255,u[r+A]=k<<24|_<<16|_<<8|_;else if(8==h)for(A=0;A<n;A++)k=(_=t[e+A])==m?0:255,u[r+A]=k<<24|_<<16|_<<8|_;else if(16==h)for(A=0;A<n;A++)_=t[e+(A<<1)],k=f(t,e+(A<<1))==m?0:255,u[r+A]=k<<24|_<<16|_<<8|_}return c}function n(e,t,n,s){const l=o(e),c=Math.ceil(n*l/8),u=new Uint8Array((c+1+e.interlace)*s);return t=e.tabs.CgBI?i(t,u):r(t,u),0==e.interlace?t=a(t,e,0,n,s):1==e.interlace&&(t=function(e,t){const n=t.width,r=t.height,i=o(t),s=i>>3,l=Math.ceil(n*i/8),c=new Uint8Array(r*l);let u=0;const d=[0,0,4,0,2,0,1],h=[0,4,0,2,0,1,0],f=[8,8,8,4,4,2,2],p=[8,8,4,4,2,2,1];let g=0;for(;g<7;){const o=f[g],v=p[g];let y=0,b=0,w=d[g];for(;w<r;)w+=o,b++;let x=h[g];for(;x<n;)x+=v,y++;const C=Math.ceil(y*i/8);a(e,t,u,y,b);let _=0,S=d[g];for(;S<r;){let t=h[g],r=u+_*C<<3;for(;t<n;){var m;if(1==i&&(m=(m=e[r>>3])>>7-(7&r)&1,c[S*l+(t>>3)]|=m<<7-(7&t)),2==i&&(m=(m=e[r>>3])>>6-(7&r)&3,c[S*l+(t>>2)]|=m<<6-((3&t)<<1)),4==i&&(m=(m=e[r>>3])>>4-(7&r)&15,c[S*l+(t>>1)]|=m<<4-((1&t)<<2)),i>=8){const n=S*l+t*s;for(let t=0;t<s;t++)c[n+t]=e[(r>>3)+t]}r+=i,t+=v}_++,S+=o}y*b!=0&&(u+=b*(1+C)),g+=1}return c}(t,e)),t}function r(e,t){return i(new Uint8Array(e.buffer,2,e.length-6),t)}var i=function(){const e={H:{}};return e.H.N=function(t,n){const r=Uint8Array;let i,o,a=0,s=0,l=0,c=0,u=0,d=0,h=0,f=0,p=0;if(3==t[0]&&0==t[1])return n||new r(0);const g=e.H,m=g.b,v=g.e,y=g.R,b=g.n,w=g.A,x=g.Z,C=g.m,_=null==n;for(_&&(n=new r(t.length>>>2<<5));0==a;)if(a=m(t,p,1),s=m(t,p+1,2),p+=3,0!=s){if(_&&(n=e.H.W(n,f+(1<<17))),1==s&&(i=C.J,o=C.h,d=511,h=31),2==s){l=v(t,p,5)+257,c=v(t,p+5,5)+1,u=v(t,p+10,4)+4,p+=14;let e=1;for(var S=0;S<38;S+=2)C.Q[S]=0,C.Q[S+1]=0;for(S=0;S<u;S++){const n=v(t,p+3*S,3);C.Q[1+(C.X[S]<<1)]=n,n>e&&(e=n)}p+=3*u,b(C.Q,e),w(C.Q,e,C.u),i=C.w,o=C.d,p=y(C.u,(1<<e)-1,l+c,t,p,C.v);const n=g.V(C.v,0,l,C.C);d=(1<<n)-1;const r=g.V(C.v,l,c,C.D);h=(1<<r)-1,b(C.C,n),w(C.C,n,i),b(C.D,r),w(C.D,r,o)}for(;;){const e=i[x(t,p)&d];p+=15&e;const r=e>>>4;if(r>>>8==0)n[f++]=r;else{if(256==r)break;{let e=f+r-254;if(r>264){const n=C.q[r-257];e=f+(n>>>3)+v(t,p,7&n),p+=7&n}const i=o[x(t,p)&h];p+=15&i;const a=i>>>4,s=C.c[a],l=(s>>>4)+m(t,p,15&s);for(p+=15&s;f<e;)n[f]=n[f++-l],n[f]=n[f++-l],n[f]=n[f++-l],n[f]=n[f++-l];f=e}}}}else{7&p&&(p+=8-(7&p));const i=4+(p>>>3),o=t[i-4]|t[i-3]<<8;_&&(n=e.H.W(n,f+o)),n.set(new r(t.buffer,t.byteOffset+i,o),f),p=i+o<<3,f+=o}return n.length==f?n:n.slice(0,f)},e.H.W=function(e,t){const n=e.length;if(t<=n)return e;const r=new Uint8Array(n<<1);return r.set(e,0),r},e.H.R=function(t,n,r,i,o,a){const s=e.H.e,l=e.H.Z;let c=0;for(;c<r;){const e=t[l(i,o)&n];o+=15&e;const r=e>>>4;if(r<=15)a[c]=r,c++;else{let e=0,t=0;16==r?(t=3+s(i,o,2),o+=2,e=a[c-1]):17==r?(t=3+s(i,o,3),o+=3):18==r&&(t=11+s(i,o,7),o+=7);const n=c+t;for(;c<n;)a[c]=e,c++}}return o},e.H.V=function(e,t,n,r){let i=0,o=0;const a=r.length>>>1;for(;o<n;){const n=e[o+t];r[o<<1]=0,r[1+(o<<1)]=n,n>i&&(i=n),o++}for(;o<a;)r[o<<1]=0,r[1+(o<<1)]=0,o++;return i},e.H.n=function(t,n){const r=e.H.m,i=t.length;let o,a,s,l;const c=r.j;for(var u=0;u<=n;u++)c[u]=0;for(u=1;u<i;u+=2)c[t[u]]++;const d=r.K;for(o=0,c[0]=0,a=1;a<=n;a++)o=o+c[a-1]<<1,d[a]=o;for(s=0;s<i;s+=2)l=t[s+1],0!=l&&(t[s]=d[l],d[l]++)},e.H.A=function(t,n,r){const i=t.length,o=e.H.m.r;for(let e=0;e<i;e+=2)if(0!=t[e+1]){const i=e>>1,a=t[e+1],s=i<<4|a,l=n-a;let c=t[e]<<l;const u=c+(1<<l);for(;c!=u;)r[o[c]>>>15-n]=s,c++}},e.H.l=function(t,n){const r=e.H.m.r,i=15-n;for(let e=0;e<t.length;e+=2){const o=t[e]<<n-t[e+1];t[e]=r[o]>>>i}},e.H.M=function(e,t,n){n<<=7&t;const r=t>>>3;e[r]|=n,e[r+1]|=n>>>8},e.H.I=function(e,t,n){n<<=7&t;const r=t>>>3;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},e.H.e=function(e,t,n){return(e[t>>>3]|e[1+(t>>>3)]<<8)>>>(7&t)&(1<<n)-1},e.H.b=function(e,t,n){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)&(1<<n)-1},e.H.Z=function(e,t){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)},e.H.i=function(e,t){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16|e[3+(t>>>3)]<<24)>>>(7&t)},e.H.m=function(){const e=Uint16Array,t=Uint32Array;return{K:new e(16),j:new e(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],T:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],q:new e(32),p:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],z:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],c:new t(32),J:new e(512),_:[],h:new e(32),$:[],w:new e(32768),C:[],v:[],d:new e(32768),D:[],u:new e(512),Q:[],r:new e(32768),s:new t(286),Y:new t(30),a:new t(19),t:new t(15e3),k:new e(65536),g:new e(32768)}}(),function(){const t=e.H.m;for(var n=0;n<32768;n++){let e=n;e=(2863311530&e)>>>1|(1431655765&e)<<1,e=(3435973836&e)>>>2|(858993459&e)<<2,e=(4042322160&e)>>>4|(252645135&e)<<4,e=(4278255360&e)>>>8|(16711935&e)<<8,t.r[n]=(e>>>16|e<<16)>>>17}function r(e,t,n){for(;0!=t--;)e.push(0,n)}for(n=0;n<32;n++)t.q[n]=t.S[n]<<3|t.T[n],t.c[n]=t.p[n]<<4|t.z[n];r(t._,144,8),r(t._,112,9),r(t._,24,7),r(t._,8,8),e.H.n(t._,9),e.H.A(t._,9,t.J),e.H.l(t._,9),r(t.$,32,5),e.H.n(t.$,5),e.H.A(t.$,5,t.h),e.H.l(t.$,5),r(t.Q,19,0),r(t.C,286,0),r(t.D,30,0),r(t.v,320,0)}(),e.H.N}();function o(e){return[1,null,3,1,2,null,4][e.ctype]*e.depth}function a(e,t,n,r,i){let a=o(t);const l=Math.ceil(r*a/8);let c,u;a=Math.ceil(a/8);let d=e[n],h=0;if(d>1&&(e[n]=[0,0,1][d-2]),3==d)for(h=a;h<l;h++)e[h+1]=e[h+1]+(e[h+1-a]>>>1)&255;for(let o=0;o<i;o++)if(c=n+o*l,u=c+o+1,d=e[u-1],h=0,0==d)for(;h<l;h++)e[c+h]=e[u+h];else if(1==d){for(;h<a;h++)e[c+h]=e[u+h];for(;h<l;h++)e[c+h]=e[u+h]+e[c+h-a]}else if(2==d)for(;h<l;h++)e[c+h]=e[u+h]+e[c+h-l];else if(3==d){for(;h<a;h++)e[c+h]=e[u+h]+(e[c+h-l]>>>1);for(;h<l;h++)e[c+h]=e[u+h]+(e[c+h-l]+e[c+h-a]>>>1)}else{for(;h<a;h++)e[c+h]=e[u+h]+s(0,e[c+h-l],0);for(;h<l;h++)e[c+h]=e[u+h]+s(e[c+h-a],e[c+h-l],e[c+h-a-l])}return e}function s(e,t,n){const r=e+t-n,i=r-e,o=r-t,a=r-n;return i*i<=o*o&&i*i<=a*a?e:o*o<=a*a?t:n}function l(t,n,r){r.width=e.readUint(t,n),n+=4,r.height=e.readUint(t,n),n+=4,r.depth=t[n],n++,r.ctype=t[n],n++,r.compress=t[n],n++,r.filter=t[n],n++,r.interlace=t[n],n++}function c(e,t,n,r,i,o,a,s,l){const c=Math.min(t,i),u=Math.min(n,o);let d=0,h=0;for(let x=0;x<u;x++)for(let n=0;n<c;n++)if(a>=0&&s>=0?(d=x*t+n<<2,h=(s+x)*i+a+n<<2):(d=(-s+x)*t-a+n<<2,h=x*i+n<<2),0==l)r[h]=e[d],r[h+1]=e[d+1],r[h+2]=e[d+2],r[h+3]=e[d+3];else if(1==l){var f=e[d+3]*(1/255),p=e[d]*f,g=e[d+1]*f,m=e[d+2]*f,v=r[h+3]*(1/255),y=r[h]*v,b=r[h+1]*v,w=r[h+2]*v;const t=1-f,n=f+v*t,i=0==n?0:1/n;r[h+3]=255*n,r[h+0]=(p+y*t)*i,r[h+1]=(g+b*t)*i,r[h+2]=(m+w*t)*i}else if(2==l)f=e[d+3],p=e[d],g=e[d+1],m=e[d+2],v=r[h+3],y=r[h],b=r[h+1],w=r[h+2],f==v&&p==y&&g==b&&m==w?(r[h]=0,r[h+1]=0,r[h+2]=0,r[h+3]=0):(r[h]=p,r[h+1]=g,r[h+2]=m,r[h+3]=f);else if(3==l){if(f=e[d+3],p=e[d],g=e[d+1],m=e[d+2],v=r[h+3],y=r[h],b=r[h+1],w=r[h+2],f==v&&p==y&&g==b&&m==w)continue;if(f<220&&v>20)return!1}return!0}return{decode:function(t){const o=new Uint8Array(t);let a=8;const s=e,c=s.readUshort,u=s.readUint,d={tabs:{},frames:[]},h=new Uint8Array(o.length);let f,p=0,g=0;const m=[137,80,78,71,13,10,26,10];for(var v=0;v<8;v++)if(o[v]!=m[v])throw"The input is not a PNG file!";for(;a<o.length;){const t=s.readUint(o,a);a+=4;const m=s.readASCII(o,a,4);if(a+=4,"IHDR"==m)l(o,a,d);else if("iCCP"==m){for(var y=a;0!=o[y];)y++;s.readASCII(o,a,y-a),o[y+1];const n=o.slice(y+2,a+t);let l=null;try{l=r(n)}catch(e){l=i(n)}d.tabs[m]=l}else if("CgBI"==m)d.tabs[m]=o.slice(a,a+4);else if("IDAT"==m){for(v=0;v<t;v++)h[p+v]=o[a+v];p+=t}else if("acTL"==m)d.tabs[m]={num_frames:u(o,a),num_plays:u(o,a+4)},f=new Uint8Array(o.length);else if("fcTL"==m){0!=g&&((S=d.frames[d.frames.length-1]).data=n(d,f.slice(0,g),S.rect.width,S.rect.height),g=0);const e={x:u(o,a+12),y:u(o,a+16),width:u(o,a+4),height:u(o,a+8)};let t=c(o,a+22);t=c(o,a+20)/(0==t?100:t);const r={rect:e,delay:Math.round(1e3*t),dispose:o[a+24],blend:o[a+25]};d.frames.push(r)}else if("fdAT"==m){for(v=0;v<t-4;v++)f[g+v]=o[a+v+4];g+=t-4}else if("pHYs"==m)d.tabs[m]=[s.readUint(o,a),s.readUint(o,a+4),o[a+8]];else if("cHRM"==m)for(d.tabs[m]=[],v=0;v<8;v++)d.tabs[m].push(s.readUint(o,a+4*v));else if("tEXt"==m||"zTXt"==m){null==d.tabs[m]&&(d.tabs[m]={});var b=s.nextZero(o,a),w=s.readASCII(o,a,b-a),x=a+t-b-1;if("tEXt"==m)_=s.readASCII(o,b+1,x);else{var C=r(o.slice(b+2,b+2+x));_=s.readUTF8(C,0,C.length)}d.tabs[m][w]=_}else if("iTXt"==m){null==d.tabs[m]&&(d.tabs[m]={}),b=0,y=a,b=s.nextZero(o,y),w=s.readASCII(o,y,b-y);const e=o[y=b+1];var _;o[y+1],y+=2,b=s.nextZero(o,y),s.readASCII(o,y,b-y),y=b+1,b=s.nextZero(o,y),s.readUTF8(o,y,b-y),x=t-((y=b+1)-a),0==e?_=s.readUTF8(o,y,x):(C=r(o.slice(y,y+x)),_=s.readUTF8(C,0,C.length)),d.tabs[m][w]=_}else if("PLTE"==m)d.tabs[m]=s.readBytes(o,a,t);else if("hIST"==m){const e=d.tabs.PLTE.length/3;for(d.tabs[m]=[],v=0;v<e;v++)d.tabs[m].push(c(o,a+2*v))}else if("tRNS"==m)3==d.ctype?d.tabs[m]=s.readBytes(o,a,t):0==d.ctype?d.tabs[m]=c(o,a):2==d.ctype&&(d.tabs[m]=[c(o,a),c(o,a+2),c(o,a+4)]);else if("gAMA"==m)d.tabs[m]=s.readUint(o,a)/1e5;else if("sRGB"==m)d.tabs[m]=o[a];else if("bKGD"==m)0==d.ctype||4==d.ctype?d.tabs[m]=[c(o,a)]:2==d.ctype||6==d.ctype?d.tabs[m]=[c(o,a),c(o,a+2),c(o,a+4)]:3==d.ctype&&(d.tabs[m]=o[a]);else if("IEND"==m)break;a+=t,s.readUint(o,a),a+=4}var S;return 0!=g&&((S=d.frames[d.frames.length-1]).data=n(d,f.slice(0,g),S.rect.width,S.rect.height)),d.data=n(d,h,d.width,d.height),delete d.compress,delete d.interlace,delete d.filter,d},toRGBA8:function(e){const n=e.width,r=e.height;if(null==e.tabs.acTL)return[t(e.data,n,r,e).buffer];const i=[];null==e.frames[0].data&&(e.frames[0].data=e.data);const o=n*r*4,a=new Uint8Array(o),s=new Uint8Array(o),l=new Uint8Array(o);for(let d=0;d<e.frames.length;d++){const h=e.frames[d],f=h.rect.x,p=h.rect.y,g=h.rect.width,m=h.rect.height,v=t(h.data,g,m,e);if(0!=d)for(var u=0;u<o;u++)l[u]=a[u];if(0==h.blend?c(v,g,m,a,n,r,f,p,0):1==h.blend&&c(v,g,m,a,n,r,f,p,1),i.push(a.buffer.slice(0)),0==h.dispose);else if(1==h.dispose)c(s,g,m,a,n,r,f,p,0);else if(2==h.dispose)for(u=0;u<o;u++)a[u]=l[u]}return i},_paeth:s,_copyTile:c,_bin:e}}();!function(){const{_copyTile:e}=bo,{_bin:t}=bo,n=bo._paeth;var r={table:function(){const e=new Uint32Array(256);for(let t=0;t<256;t++){let n=t;for(let e=0;e<8;e++)1&n?n=3988292384^n>>>1:n>>>=1;e[t]=n}return e}(),update(e,t,n,i){for(let o=0;o<i;o++)e=r.table[255&(e^t[n+o])]^e>>>8;return e},crc:(e,t,n)=>4294967295^r.update(4294967295,e,t,n)};function i(e,t,n,r){t[n]+=e[0]*r>>4,t[n+1]+=e[1]*r>>4,t[n+2]+=e[2]*r>>4,t[n+3]+=e[3]*r>>4}function o(e){return Math.max(0,Math.min(255,e))}function a(e,t){const n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2],o=e[3]-t[3];return n*n+r*r+i*i+o*o}function s(e,t,n,r,s,l,c){null==c&&(c=1);const u=r.length,d=[];for(var h=0;h<u;h++){const e=r[h];d.push([e>>>0&255,e>>>8&255,e>>>16&255,e>>>24&255])}for(h=0;h<u;h++){let e=4294967295;for(var f=0,p=0;p<u;p++){var g=a(d[h],d[p]);p!=h&&g<e&&(e=g,f=p)}}const m=new Uint32Array(s.buffer),v=new Int16Array(t*n*4),y=[0,8,2,10,12,4,14,6,3,11,1,9,15,7,13,5];for(h=0;h<y.length;h++)y[h]=255*((y[h]+.5)/16-.5);for(let w=0;w<n;w++)for(let s=0;s<t;s++){var b;h=4*(w*t+s),2!=c?b=[o(e[h]+v[h]),o(e[h+1]+v[h+1]),o(e[h+2]+v[h+2]),o(e[h+3]+v[h+3])]:(g=y[4*(3&w)+(3&s)],b=[o(e[h]+g),o(e[h+1]+g),o(e[h+2]+g),o(e[h+3]+g)]),f=0;let x=16777215;for(p=0;p<u;p++){const e=a(b,d[p]);e<x&&(x=e,f=p)}const C=d[f],_=[b[0]-C[0],b[1]-C[1],b[2]-C[2],b[3]-C[3]];1==c&&(s!=t-1&&i(_,v,h+4,7),w!=n-1&&(0!=s&&i(_,v,h+4*t-4,3),i(_,v,h+4*t,5),s!=t-1&&i(_,v,h+4*t+4,1))),l[h>>2]=f,m[h>>2]=r[f]}}function l(e,n,i,o,a){null==a&&(a={});const{crc:s}=r,l=t.writeUint,c=t.writeUshort,u=t.writeASCII;let d=8;const h=e.frames.length>1;let f,p=!1,g=33+(h?20:0);if(null!=a.sRGB&&(g+=13),null!=a.pHYs&&(g+=21),null!=a.iCCP&&(f=pako.deflate(a.iCCP),g+=21+f.length+4),3==e.ctype){for(var m=e.plte.length,v=0;v<m;v++)e.plte[v]>>>24!=255&&(p=!0);g+=8+3*m+4+(p?8+1*m+4:0)}for(var y=0;y<e.frames.length;y++)h&&(g+=38),g+=(C=e.frames[y]).cimg.length+12,0!=y&&(g+=4);g+=12;const b=new Uint8Array(g),w=[137,80,78,71,13,10,26,10];for(v=0;v<8;v++)b[v]=w[v];if(l(b,d,13),d+=4,u(b,d,"IHDR"),d+=4,l(b,d,n),d+=4,l(b,d,i),d+=4,b[d]=e.depth,d++,b[d]=e.ctype,d++,b[d]=0,d++,b[d]=0,d++,b[d]=0,d++,l(b,d,s(b,d-17,17)),d+=4,null!=a.sRGB&&(l(b,d,1),d+=4,u(b,d,"sRGB"),d+=4,b[d]=a.sRGB,d++,l(b,d,s(b,d-5,5)),d+=4),null!=a.iCCP){const e=13+f.length;l(b,d,e),d+=4,u(b,d,"iCCP"),d+=4,u(b,d,"ICC profile"),d+=11,d+=2,b.set(f,d),d+=f.length,l(b,d,s(b,d-(e+4),e+4)),d+=4}if(null!=a.pHYs&&(l(b,d,9),d+=4,u(b,d,"pHYs"),d+=4,l(b,d,a.pHYs[0]),d+=4,l(b,d,a.pHYs[1]),d+=4,b[d]=a.pHYs[2],d++,l(b,d,s(b,d-13,13)),d+=4),h&&(l(b,d,8),d+=4,u(b,d,"acTL"),d+=4,l(b,d,e.frames.length),d+=4,l(b,d,null!=a.loop?a.loop:0),d+=4,l(b,d,s(b,d-12,12)),d+=4),3==e.ctype){for(l(b,d,3*(m=e.plte.length)),d+=4,u(b,d,"PLTE"),d+=4,v=0;v<m;v++){const t=3*v,n=e.plte[v],r=255&n,i=n>>>8&255,o=n>>>16&255;b[d+t+0]=r,b[d+t+1]=i,b[d+t+2]=o}if(d+=3*m,l(b,d,s(b,d-3*m-4,3*m+4)),d+=4,p){for(l(b,d,m),d+=4,u(b,d,"tRNS"),d+=4,v=0;v<m;v++)b[d+v]=e.plte[v]>>>24&255;d+=m,l(b,d,s(b,d-m-4,m+4)),d+=4}}let x=0;for(y=0;y<e.frames.length;y++){var C=e.frames[y];h&&(l(b,d,26),d+=4,u(b,d,"fcTL"),d+=4,l(b,d,x++),d+=4,l(b,d,C.rect.width),d+=4,l(b,d,C.rect.height),d+=4,l(b,d,C.rect.x),d+=4,l(b,d,C.rect.y),d+=4,c(b,d,o[y]),d+=2,c(b,d,1e3),d+=2,b[d]=C.dispose,d++,b[d]=C.blend,d++,l(b,d,s(b,d-30,30)),d+=4);const t=C.cimg;l(b,d,(m=t.length)+(0==y?0:4)),d+=4;const n=d;u(b,d,0==y?"IDAT":"fdAT"),d+=4,0!=y&&(l(b,d,x++),d+=4),b.set(t,d),d+=m,l(b,d,s(b,n,d-n)),d+=4}return l(b,d,0),d+=4,u(b,d,"IEND"),d+=4,l(b,d,s(b,d-4,4)),d+=4,b.buffer}function c(e,t,n){for(let r=0;r<e.frames.length;r++){const i=e.frames[r];i.rect.width;const o=i.rect.height,a=new Uint8Array(o*i.bpl+o);i.cimg=f(i.img,o,i.bpp,i.bpl,a,t,n)}}function u(t,n,r,i,o){const a=o[0],l=o[1],c=o[2],u=o[3],f=o[4],p=o[5];let m=6,v=8,y=255;for(var b=0;b<t.length;b++){const e=new Uint8Array(t[b]);for(var w=e.length,x=0;x<w;x+=4)y&=e[x+3]}const C=255!=y,_=function(t,n,r,i,o,a){const s=[];for(var l=0;l<t.length;l++){const d=new Uint8Array(t[l]),f=new Uint32Array(d.buffer);var c;let g=0,m=0,v=n,y=r,b=i?1:0;if(0!=l){const w=a||i||1==l||0!=s[l-2].dispose?1:2;let x=0,C=1e9;for(let e=0;e<w;e++){var u=new Uint8Array(t[l-1-e]);const i=new Uint32Array(t[l-1-e]);let a=n,s=r,c=-1,d=-1;for(let e=0;e<r;e++)for(let t=0;t<n;t++)f[p=e*n+t]!=i[p]&&(t<a&&(a=t),t>c&&(c=t),e<s&&(s=e),e>d&&(d=e));-1==c&&(a=s=c=d=0),o&&(!(1&~a)&&a--,!(1&~s)&&s--);const h=(c-a+1)*(d-s+1);h<C&&(C=h,x=e,g=a,m=s,v=c-a+1,y=d-s+1)}u=new Uint8Array(t[l-1-x]),1==x&&(s[l-1].dispose=2),c=new Uint8Array(v*y*4),e(u,n,r,c,v,y,-g,-m,0),b=e(d,n,r,c,v,y,-g,-m,3)?1:0,1==b?h(d,n,r,c,{x:g,y:m,width:v,height:y}):e(d,n,r,c,v,y,-g,-m,0)}else c=d.slice(0);s.push({rect:{x:g,y:m,width:v,height:y},img:c,blend:b,dispose:0})}if(i)for(l=0;l<s.length;l++){if(1==(g=s[l]).blend)continue;const e=g.rect,i=s[l-1].rect,a=Math.min(e.x,i.x),c=Math.min(e.y,i.y),u={x:a,y:c,width:Math.max(e.x+e.width,i.x+i.width)-a,height:Math.max(e.y+e.height,i.y+i.height)-c};s[l-1].dispose=1,l-1!=0&&d(t,n,r,s,l-1,u,o),d(t,n,r,s,l,u,o)}let f=0;if(1!=t.length)for(var p=0;p<s.length;p++){var g;f+=(g=s[p]).rect.width*g.rect.height}return s}(t,n,r,a,l,c),S={},A=[],k=[];if(0!=i){const e=[];for(x=0;x<_.length;x++)e.push(_[x].img.buffer);const t=function(e){let t=0;for(var n=0;n<e.length;n++)t+=e[n].byteLength;const r=new Uint8Array(t);let i=0;for(n=0;n<e.length;n++){const t=new Uint8Array(e[n]),o=t.length;for(let e=0;e<o;e+=4){let n=t[e],o=t[e+1],a=t[e+2];const s=t[e+3];0==s&&(n=o=a=0),r[i+e]=n,r[i+e+1]=o,r[i+e+2]=a,r[i+e+3]=s}i+=o}return r.buffer}(e),n=g(t,i);for(x=0;x<n.plte.length;x++)A.push(n.plte[x].est.rgba);let r=0;for(x=0;x<_.length;x++){const e=(I=_[x]).img.length;var E=new Uint8Array(n.inds.buffer,r>>2,e>>2);k.push(E);const t=new Uint8Array(n.abuf,r,e);p&&s(I.img,I.rect.width,I.rect.height,A,t,E),I.img.set(t),r+=e}}else for(b=0;b<_.length;b++){var I=_[b];const e=new Uint32Array(I.img.buffer);var j=I.rect.width;for(w=e.length,E=new Uint8Array(w),k.push(E),x=0;x<w;x++){const t=e[x];if(0!=x&&t==e[x-1])E[x]=E[x-1];else if(x>j&&t==e[x-j])E[x]=E[x-j];else{let e=S[t];if(null==e&&(S[t]=e=A.length,A.push(t),A.length>=300))break;E[x]=e}}}const T=A.length;for(T<=256&&0==f&&(v=T<=2?1:T<=4?2:T<=16?4:8,v=Math.max(v,u)),b=0;b<_.length;b++){(I=_[b]).rect.x,I.rect.y,j=I.rect.width;const e=I.rect.height;let t=I.img;new Uint32Array(t.buffer);let n=4*j,r=4;if(T<=256&&0==f){n=Math.ceil(v*j/8);var F=new Uint8Array(n*e);const i=k[b];for(let t=0;t<e;t++){x=t*n;const e=t*j;if(8==v)for(var O=0;O<j;O++)F[x+O]=i[e+O];else if(4==v)for(O=0;O<j;O++)F[x+(O>>1)]|=i[e+O]<<4-4*(1&O);else if(2==v)for(O=0;O<j;O++)F[x+(O>>2)]|=i[e+O]<<6-2*(3&O);else if(1==v)for(O=0;O<j;O++)F[x+(O>>3)]|=i[e+O]<<7-1*(7&O)}t=F,m=3,r=1}else if(0==C&&1==_.length){F=new Uint8Array(j*e*3);const i=j*e;for(x=0;x<i;x++){const e=3*x,n=4*x;F[e]=t[n],F[e+1]=t[n+1],F[e+2]=t[n+2]}t=F,m=2,r=3,n=3*j}I.img=t,I.bpl=n,I.bpp=r}return{ctype:m,depth:v,plte:A,frames:_}}function d(t,n,r,i,o,a,s){const l=Uint8Array,c=Uint32Array,u=new l(t[o-1]),d=new c(t[o-1]),f=o+1<t.length?new l(t[o+1]):null,p=new l(t[o]),g=new c(p.buffer);let m=n,v=r,y=-1,b=-1;for(let e=0;e<a.height;e++)for(let t=0;t<a.width;t++){const r=a.x+t,s=a.y+e,l=s*n+r,c=g[l];0==c||0==i[o-1].dispose&&d[l]==c&&(null==f||0!=f[4*l+3])||(r<m&&(m=r),r>y&&(y=r),s<v&&(v=s),s>b&&(b=s))}-1==y&&(m=v=y=b=0),s&&(!(1&~m)&&m--,!(1&~v)&&v--),a={x:m,y:v,width:y-m+1,height:b-v+1};const w=i[o];w.rect=a,w.blend=1,w.img=new Uint8Array(a.width*a.height*4),0==i[o-1].dispose?(e(u,n,r,w.img,a.width,a.height,-a.x,-a.y,0),h(p,n,r,w.img,a)):e(p,n,r,w.img,a.width,a.height,-a.x,-a.y,0)}function h(t,n,r,i,o){e(t,n,r,i,o.width,o.height,-o.x,-o.y,2)}function f(e,t,n,r,i,o,a){const s=[];let l,c=[0,1,2,3,4];-1!=o?c=[o]:(t*r>5e5||1==n)&&(c=[0]),a&&(l={level:0});const u=yo;for(var d=0;d<c.length;d++){for(let o=0;o<t;o++)p(i,e,o,r,n,c[d]);s.push(u.deflate(i,l))}let h,f=1e9;for(d=0;d<s.length;d++)s[d].length<f&&(h=d,f=s[d].length);return s[h]}function p(e,t,r,i,o,a){const s=r*i;let l=s+r;if(e[l]=a,l++,0==a)if(i<500)for(var c=0;c<i;c++)e[l+c]=t[s+c];else e.set(new Uint8Array(t.buffer,s,i),l);else if(1==a){for(c=0;c<o;c++)e[l+c]=t[s+c];for(c=o;c<i;c++)e[l+c]=t[s+c]-t[s+c-o]+256&255}else if(0==r){for(c=0;c<o;c++)e[l+c]=t[s+c];if(2==a)for(c=o;c<i;c++)e[l+c]=t[s+c];if(3==a)for(c=o;c<i;c++)e[l+c]=t[s+c]-(t[s+c-o]>>1)+256&255;if(4==a)for(c=o;c<i;c++)e[l+c]=t[s+c]-n(t[s+c-o],0,0)+256&255}else{if(2==a)for(c=0;c<i;c++)e[l+c]=t[s+c]+256-t[s+c-i]&255;if(3==a){for(c=0;c<o;c++)e[l+c]=t[s+c]+256-(t[s+c-i]>>1)&255;for(c=o;c<i;c++)e[l+c]=t[s+c]+256-(t[s+c-i]+t[s+c-o]>>1)&255}if(4==a){for(c=0;c<o;c++)e[l+c]=t[s+c]+256-n(0,t[s+c-i],0)&255;for(c=o;c<i;c++)e[l+c]=t[s+c]+256-n(t[s+c-o],t[s+c-i],t[s+c-o-i])&255}}}function g(e,t){const n=new Uint8Array(e),r=n.slice(0),i=new Uint32Array(r.buffer),o=m(r,t),a=o[0],s=o[1],l=n.length,c=new Uint8Array(l>>2);let u;if(n.length<2e7)for(var d=0;d<l;d+=4)u=v(a,h=n[d]*(1/255),f=n[d+1]*(1/255),p=n[d+2]*(1/255),g=n[d+3]*(1/255)),c[d>>2]=u.ind,i[d>>2]=u.est.rgba;else for(d=0;d<l;d+=4){var h=n[d]*(1/255),f=n[d+1]*(1/255),p=n[d+2]*(1/255),g=n[d+3]*(1/255);for(u=a;u.left;)u=y(u.est,h,f,p,g)<=0?u.left:u.right;c[d>>2]=u.ind,i[d>>2]=u.est.rgba}return{abuf:r.buffer,inds:c,plte:s}}function m(e,t,n){null==n&&(n=1e-4);const r=new Uint32Array(e.buffer),i={i0:0,i1:e.length,bst:null,est:null,tdst:0,left:null,right:null};i.bst=x(e,i.i0,i.i1),i.est=C(i.bst);const o=[i];for(;o.length<t;){let t=0,i=0;for(var a=0;a<o.length;a++)o[a].est.L>t&&(t=o[a].est.L,i=a);if(t<n)break;const s=o[i],l=b(e,r,s.i0,s.i1,s.est.e,s.est.eMq255);if(s.i0>=l||s.i1<=l){s.est.L=0;continue}const c={i0:s.i0,i1:l,bst:null,est:null,tdst:0,left:null,right:null};c.bst=x(e,c.i0,c.i1),c.est=C(c.bst);const u={i0:l,i1:s.i1,bst:null,est:null,tdst:0,left:null,right:null};for(u.bst={R:[],m:[],N:s.bst.N-c.bst.N},a=0;a<16;a++)u.bst.R[a]=s.bst.R[a]-c.bst.R[a];for(a=0;a<4;a++)u.bst.m[a]=s.bst.m[a]-c.bst.m[a];u.est=C(u.bst),s.left=c,s.right=u,o[i]=c,o.push(u)}for(o.sort((e,t)=>t.bst.N-e.bst.N),a=0;a<o.length;a++)o[a].ind=a;return[i,o]}function v(e,t,n,r,i){if(null==e.left)return e.tdst=function(e,t,n,r,i){const o=t-e[0],a=n-e[1],s=r-e[2],l=i-e[3];return o*o+a*a+s*s+l*l}(e.est.q,t,n,r,i),e;const o=y(e.est,t,n,r,i);let a=e.left,s=e.right;o>0&&(a=e.right,s=e.left);const l=v(a,t,n,r,i);if(l.tdst<=o*o)return l;const c=v(s,t,n,r,i);return c.tdst<l.tdst?c:l}function y(e,t,n,r,i){const{e:o}=e;return o[0]*t+o[1]*n+o[2]*r+o[3]*i-e.eMq}function b(e,t,n,r,i,o){for(r-=4;n<r;){for(;w(e,n,i)<=o;)n+=4;for(;w(e,r,i)>o;)r-=4;if(n>=r)break;const a=t[n>>2];t[n>>2]=t[r>>2],t[r>>2]=a,n+=4,r-=4}for(;w(e,n,i)>o;)n-=4;return n+4}function w(e,t,n){return e[t]*n[0]+e[t+1]*n[1]+e[t+2]*n[2]+e[t+3]*n[3]}function x(e,t,n){const r=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],i=[0,0,0,0],o=n-t>>2;for(let a=t;a<n;a+=4){const t=e[a]*(1/255),n=e[a+1]*(1/255),o=e[a+2]*(1/255),s=e[a+3]*(1/255);i[0]+=t,i[1]+=n,i[2]+=o,i[3]+=s,r[0]+=t*t,r[1]+=t*n,r[2]+=t*o,r[3]+=t*s,r[5]+=n*n,r[6]+=n*o,r[7]+=n*s,r[10]+=o*o,r[11]+=o*s,r[15]+=s*s}return r[4]=r[1],r[8]=r[2],r[9]=r[6],r[12]=r[3],r[13]=r[7],r[14]=r[11],{R:r,m:i,N:o}}function C(e){const{R:t}=e,{m:n}=e,{N:r}=e,i=n[0],o=n[1],a=n[2],s=n[3],l=0==r?0:1/r,c=[t[0]-i*i*l,t[1]-i*o*l,t[2]-i*a*l,t[3]-i*s*l,t[4]-o*i*l,t[5]-o*o*l,t[6]-o*a*l,t[7]-o*s*l,t[8]-a*i*l,t[9]-a*o*l,t[10]-a*a*l,t[11]-a*s*l,t[12]-s*i*l,t[13]-s*o*l,t[14]-s*a*l,t[15]-s*s*l],u=c,d=_;let h=[Math.random(),Math.random(),Math.random(),Math.random()],f=0,p=0;if(0!=r)for(let m=0;m<16&&(h=d.multVec(u,h),p=Math.sqrt(d.dot(h,h)),h=d.sml(1/p,h),!(0!=m&&Math.abs(p-f)<1e-9));m++)f=p;const g=[i*l,o*l,a*l,s*l];return{Cov:c,q:g,e:h,L:f,eMq255:d.dot(d.sml(255,g),h),eMq:d.dot(h,g),rgba:(Math.round(255*g[3])<<24|Math.round(255*g[2])<<16|Math.round(255*g[1])<<8|Math.round(255*g[0]))>>>0}}var _={multVec:(e,t)=>[e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3],e[4]*t[0]+e[5]*t[1]+e[6]*t[2]+e[7]*t[3],e[8]*t[0]+e[9]*t[1]+e[10]*t[2]+e[11]*t[3],e[12]*t[0]+e[13]*t[1]+e[14]*t[2]+e[15]*t[3]],dot:(e,t)=>e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3],sml:(e,t)=>[e*t[0],e*t[1],e*t[2],e*t[3]]};bo.encode=function(e,t,n,r,i,o,a){null==r&&(r=0),null==a&&(a=!1);const s=u(e,t,n,r,[!1,!1,!1,0,a,!1]);return c(s,-1),l(s,t,n,i,o)},bo.encodeLL=function(e,t,n,r,i,o,a,s){const u={ctype:0+(1==r?0:2)+(0==i?0:4),depth:o,frames:[]},d=(r+i)*o,h=d*t;for(let l=0;l<e.length;l++)u.frames.push({rect:{x:0,y:0,width:t,height:n},img:new Uint8Array(e[l]),blend:0,dispose:1,bpp:Math.ceil(d/8),bpl:Math.ceil(h/8)});return c(u,0,!0),l(u,t,n,a,s)},bo.encode.compress=u,bo.encode.dither=s,bo.quantize=g,bo.quantize.getKDtree=m,bo.quantize.getNearest=v}();const wo={toArrayBuffer(e,t){const n=e.width,r=e.height,i=n<<2,o=e.getContext("2d").getImageData(0,0,n,r),a=new Uint32Array(o.data.buffer),s=(32*n+31)/32<<2,l=s*r,c=122+l,u=new ArrayBuffer(c),d=new DataView(u),h=1<<20;let f,p,g,m,v=h,y=0,b=0,w=0;function x(e){d.setUint16(b,e,!0),b+=2}function C(e){d.setUint32(b,e,!0),b+=4}function _(e){b+=e}x(19778),C(c),_(4),C(122),C(108),C(n),C(-r>>>0),x(1),x(32),C(3),C(l),C(2835),C(2835),_(8),C(16711680),C(65280),C(255),C(4278190080),C(1466527264),function e(){for(;y<r&&v>0;){for(m=122+y*s,f=0;f<i;)v--,p=a[w++],g=p>>>24,d.setUint32(m+f,p<<8|g),f+=4;y++}w<a.length?(v=h,setTimeout(e,wo._dly)):t(u)}()},toBlob(e,t){this.toArrayBuffer(e,e=>{t(new Blob([e],{type:"image/bmp"}))})},_dly:9};var xo={CHROME:"CHROME",FIREFOX:"FIREFOX",DESKTOP_SAFARI:"DESKTOP_SAFARI",IE:"IE",IOS:"IOS",ETC:"ETC"},Co={[xo.CHROME]:16384,[xo.FIREFOX]:11180,[xo.DESKTOP_SAFARI]:16384,[xo.IE]:8192,[xo.IOS]:4096,[xo.ETC]:8192};const _o="undefined"!=typeof window,So="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,Ao=_o&&window.cordova&&window.cordova.require&&window.cordova.require("cordova/modulemapper"),ko=(_o||So)&&(Ao&&Ao.getOriginalSymbol(window,"File")||"undefined"!=typeof File&&File),Eo=(_o||So)&&(Ao&&Ao.getOriginalSymbol(window,"FileReader")||"undefined"!=typeof FileReader&&FileReader);function Io(e,t,n=Date.now()){return new Promise(r=>{const i=e.split(","),o=i[0].match(/:(.*?);/)[1],a=globalThis.atob(i[1]);let s=a.length;const l=new Uint8Array(s);for(;s--;)l[s]=a.charCodeAt(s);const c=new Blob([l],{type:o});c.name=t,c.lastModified=n,r(c)})}function jo(e){return new Promise((t,n)=>{const r=new Eo;r.onload=()=>t(r.result),r.onerror=e=>n(e),r.readAsDataURL(e)})}function To(e){return new Promise((t,n)=>{const r=new Image;r.onload=()=>t(r),r.onerror=e=>n(e),r.src=e})}function Fo(){if(void 0!==Fo.cachedResult)return Fo.cachedResult;let e=xo.ETC;const{userAgent:t}=navigator;return/Chrom(e|ium)/i.test(t)?e=xo.CHROME:/iP(ad|od|hone)/i.test(t)&&/WebKit/i.test(t)?e=xo.IOS:/Safari/i.test(t)?e=xo.DESKTOP_SAFARI:/Firefox/i.test(t)?e=xo.FIREFOX:(/MSIE/i.test(t)||1==!!document.documentMode)&&(e=xo.IE),Fo.cachedResult=e,Fo.cachedResult}function Oo(e,t){const n=Fo(),r=Co[n];let i=e,o=t,a=i*o;const s=i>o?o/i:i/o;for(;a>r*r;){const e=(r+i)/2,t=(r+o)/2;e<t?(o=t,i=t*s):(o=e*s,i=e),a=i*o}return{width:i,height:o}}function Mo(e,t){let n,r;try{if(n=new OffscreenCanvas(e,t),r=n.getContext("2d"),null===r)throw new Error("getContext of OffscreenCanvas returns null")}catch(e){n=document.createElement("canvas"),r=n.getContext("2d")}return n.width=e,n.height=t,[n,r]}function Po(e,t){const{width:n,height:r}=Oo(e.width,e.height),[i,o]=Mo(n,r);return t&&/jpe?g/.test(t)&&(o.fillStyle="white",o.fillRect(0,0,i.width,i.height)),o.drawImage(e,0,0,i.width,i.height),i}function Ro(){return void 0!==Ro.cachedResult||(Ro.cachedResult=["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"undefined"!=typeof document&&"ontouchend"in document),Ro.cachedResult}function Lo(e,t={}){return new Promise(function(n,r){let i,o;var a=function(){try{return o=Po(i,t.fileType||e.type),n([i,o])}catch(e){return r(e)}},s=function(t){try{var n=function(e){try{throw e}catch(e){return r(e)}};try{let t;return jo(e).then(function(e){try{return t=e,To(t).then(function(e){try{return i=e,function(){try{return a()}catch(e){return r(e)}}()}catch(e){return n(e)}},n)}catch(e){return n(e)}},n)}catch(e){n(e)}}catch(e){return r(e)}};try{if(Ro()||[xo.DESKTOP_SAFARI,xo.MOBILE_SAFARI].includes(Fo()))throw new Error("Skip createImageBitmap on IOS and Safari");return createImageBitmap(e).then(function(e){try{return i=e,a()}catch(e){return s()}},s)}catch(e){s()}})}function No(e,t,n,r,i=1){return new Promise(function(o,a){let s;if("image/png"===t){let c,u,d;return c=e.getContext("2d"),({data:u}=c.getImageData(0,0,e.width,e.height)),d=bo.encode([u.buffer],e.width,e.height,4096*i),s=new Blob([d],{type:t}),s.name=n,s.lastModified=r,l.call(this)}{if("image/bmp"===t)return new Promise(t=>wo.toBlob(e,t)).then(function(e){try{return s=e,s.name=n,s.lastModified=r,h.call(this)}catch(e){return a(e)}}.bind(this),a);{if("function"==typeof OffscreenCanvas&&e instanceof OffscreenCanvas)return e.convertToBlob({type:t,quality:i}).then(function(e){try{return s=e,s.name=n,s.lastModified=r,f.call(this)}catch(e){return a(e)}}.bind(this),a);{let p;return p=e.toDataURL(t,i),Io(p,n,r).then(function(e){try{return s=e,f.call(this)}catch(e){return a(e)}}.bind(this),a)}function f(){return h.call(this)}}function h(){return l.call(this)}}function l(){return o(s)}})}function Do(e){e.width=0,e.height=0}function zo(){return new Promise(function(e,t){let n,r,i,o;return void 0!==zo.cachedResult?e(zo.cachedResult):Io("data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/xABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAAAAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q==","test.jpg",Date.now()).then(function(a){try{return n=a,Lo(n).then(function(a){try{return r=a[1],No(r,n.type,n.name,n.lastModified).then(function(n){try{return i=n,Do(r),Lo(i).then(function(n){try{return o=n[0],zo.cachedResult=1===o.width&&2===o.height,e(zo.cachedResult)}catch(e){return t(e)}},t)}catch(e){return t(e)}},t)}catch(e){return t(e)}},t)}catch(e){return t(e)}},t)})}function Bo(e){return new Promise((t,n)=>{const r=new Eo;r.onload=e=>{const n=new DataView(e.target.result);if(65496!=n.getUint16(0,!1))return t(-2);const r=n.byteLength;let i=2;for(;i<r;){if(n.getUint16(i+2,!1)<=8)return t(-1);const e=n.getUint16(i,!1);if(i+=2,65505==e){if(1165519206!=n.getUint32(i+=2,!1))return t(-1);const e=18761==n.getUint16(i+=6,!1);i+=n.getUint32(i+4,e);const r=n.getUint16(i,e);i+=2;for(let o=0;o<r;o++)if(274==n.getUint16(i+12*o,e))return t(n.getUint16(i+12*o+8,e))}else{if(65280&~e)break;i+=n.getUint16(i,!1)}}return t(-1)},r.onerror=e=>n(e),r.readAsArrayBuffer(e)})}function Uo(e,t){const{width:n}=e,{height:r}=e,{maxWidthOrHeight:i}=t;let o,a=e;return isFinite(i)&&(n>i||r>i)&&([a,o]=Mo(n,r),n>r?(a.width=i,a.height=r/n*i):(a.width=n/r*i,a.height=i),o.drawImage(e,0,0,a.width,a.height),Do(e)),a}function Vo(e,t){const{width:n}=e,{height:r}=e,[i,o]=Mo(n,r);switch(t>4&&t<9?(i.width=r,i.height=n):(i.width=n,i.height=r),t){case 2:o.transform(-1,0,0,1,n,0);break;case 3:o.transform(-1,0,0,-1,n,r);break;case 4:o.transform(1,0,0,-1,0,r);break;case 5:o.transform(0,1,1,0,0,0);break;case 6:o.transform(0,1,-1,0,r,0);break;case 7:o.transform(0,-1,-1,0,r,n);break;case 8:o.transform(0,-1,1,0,0,n)}return o.drawImage(e,0,0,n,r),Do(e),i}function Ho(e,t,n=0){return new Promise(function(r,i){let o,a,s,l,c,u,d,h,f,p,g,m,v,y,b,w,x,C,_,S;function A(e=5){if(t.signal&&t.signal.aborted)throw t.signal.reason;o+=e,t.onProgress(Math.min(o,100))}function k(e){if(t.signal&&t.signal.aborted)throw t.signal.reason;o=Math.min(Math.max(e,o),100),t.onProgress(o)}return o=n,a=t.maxIteration||10,s=1024*t.maxSizeMB*1024,A(),Lo(e,t).then(function(n){try{return[,l]=n,A(),c=Uo(l,t),A(),new Promise(function(n,r){var i;if(!(i=t.exifOrientation))return Bo(e).then(function(e){try{return i=e,o.call(this)}catch(e){return r(e)}}.bind(this),r);function o(){return n(i)}return o.call(this)}).then(function(n){try{return u=n,A(),zo().then(function(n){try{return d=n?c:Vo(c,u),A(),h=t.initialQuality||1,f=t.fileType||e.type,No(d,f,e.name,e.lastModified,h).then(function(n){try{{if(p=n,A(),g=p.size>s,m=p.size>e.size,!g&&!m)return k(100),r(p);var o;function E(){if(a--&&(b>s||b>v)){let t,n;return t=S?.95*_.width:_.width,n=S?.95*_.height:_.height,[x,C]=Mo(t,n),C.drawImage(_,0,0,t,n),h*="image/png"===f?.85:.95,No(x,f,e.name,e.lastModified,h).then(function(e){try{return w=e,Do(_),_=x,b=w.size,k(Math.min(99,Math.floor((y-b)/(y-s)*100))),E}catch(e){return i(e)}},i)}return[1]}return v=e.size,y=p.size,b=y,_=d,S=!t.alwaysKeepResolution&&g,(o=function(e){for(;e;){if(e.then)return void e.then(o,i);try{if(e.pop){if(e.length)return e.pop()?I.call(this):e;e=E}else e=e.call(this)}catch(e){return i(e)}}}.bind(this))(E);function I(){return Do(_),Do(x),Do(c),Do(d),Do(l),k(100),r(w)}}}catch(u){return i(u)}}.bind(this),i)}catch(e){return i(e)}}.bind(this),i)}catch(e){return i(e)}}.bind(this),i)}catch(e){return i(e)}}.bind(this),i)})}let Wo;function $o(e,t){return new Promise(function(n,r){let i,o,a,s,l,c;if(i={...t},a=0,({onProgress:s}=i),i.maxSizeMB=i.maxSizeMB||Number.POSITIVE_INFINITY,l="boolean"!=typeof i.useWebWorker||i.useWebWorker,delete i.useWebWorker,i.onProgress=e=>{a=e,"function"==typeof s&&s(a)},!(e instanceof Blob||e instanceof ko))return r(new Error("The file given is not an instance of Blob or File"));if(!/^image/.test(e.type))return r(new Error("The file given is not an image"));if(c="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,!l||"function"!=typeof Worker||c)return Ho(e,i).then(function(e){try{return o=e,h.call(this)}catch(e){return r(e)}}.bind(this),r);var u=function(){try{return h.call(this)}catch(e){return r(e)}}.bind(this),d=function(t){try{return Ho(e,i).then(function(e){try{return o=e,u()}catch(e){return r(e)}},r)}catch(e){return r(e)}};try{return i.libURL=i.libURL||"https://cdn.jsdelivr.net/npm/browser-image-compression@2.0.2/dist/browser-image-compression.js",function(e,t){return new Promise((n,r)=>{Wo||(Wo=function(){const e=[];return e.push("\nlet scriptImported = false\nself.addEventListener('message', async (e) => {\n const { file, id, imageCompressionLibUrl, options } = e.data\n options.onProgress = (progress) => self.postMessage({ progress, id })\n try {\n if (!scriptImported) {\n // console.log('[worker] importScripts', imageCompressionLibUrl)\n self.importScripts(imageCompressionLibUrl)\n scriptImported = true\n }\n // console.log('[worker] self', self)\n const compressedFile = await imageCompression(file, options)\n self.postMessage({ file: compressedFile, id })\n } catch (e) {\n // console.error('[worker] error', e)\n self.postMessage({ error: e.message + '\\n' + e.stack, id })\n }\n})\n"),URL.createObjectURL(new Blob(e))}());const i=new Worker(Wo);i.addEventListener("message",function(e){if(t.signal&&t.signal.aborted)i.terminate();else if(void 0===e.data.progress){if(e.data.error)return r(new Error(e.data.error)),void i.terminate();n(e.data.file),i.terminate()}else t.onProgress(e.data.progress)}),i.addEventListener("error",r),t.signal&&t.signal.addEventListener("abort",()=>{r(t.signal.reason),i.terminate()}),i.postMessage({file:e,imageCompressionLibUrl:t.libURL,options:{...t,onProgress:void 0,signal:void 0}})})}(e,i).then(function(e){try{return o=e,u()}catch(e){return d()}},d)}catch(e){d()}function h(){try{o.name=e.name,o.lastModified=e.lastModified}catch(e){}try{i.preserveExif&&"image/jpeg"===e.type&&(!i.fileType||i.fileType&&i.fileType===e.type)&&(o=po(e,o))}catch(e){}return n(o)}})}function Go(e,t){var n;if(null==e?void 0:e.extension){const t=e.extension.toLowerCase(),n={jpg:{extension:"jpeg",mimeType:"image/jpeg",format:"jpeg",pixieFormat:"jpeg"},jpeg:{extension:"jpeg",mimeType:"image/jpeg",format:"jpeg",pixieFormat:"jpeg"},png:{extension:"png",mimeType:"image/png",format:"png",pixieFormat:"png"},gif:{extension:"gif",mimeType:"image/gif",format:"gif",pixieFormat:"png"},webp:{extension:"webp",mimeType:"image/webp",format:"webp",pixieFormat:"png"},svg:{extension:"svg",mimeType:"image/svg+xml",format:"svg",pixieFormat:"svg"}};if(n[t])return n[t]}if(null==e?void 0:e.type){const t=rn(e.type),n={"image/jpeg":{extension:"jpeg",mimeType:"image/jpeg",format:"jpeg",pixieFormat:"jpeg"},"image/png":{extension:"png",mimeType:"image/png",format:"png",pixieFormat:"png"},"image/gif":{extension:"gif",mimeType:"image/gif",format:"gif",pixieFormat:"png"},"image/webp":{extension:"webp",mimeType:"image/webp",format:"webp",pixieFormat:"png"},"image/svg+xml":{extension:"svg",mimeType:"image/svg+xml",format:"svg",pixieFormat:"svg"}};if(n[t])return n[t]}if(null==e?void 0:e.name){const t=null===(n=e.name.split(".").pop())||void 0===n?void 0:n.toLowerCase();if(t){const e={jpg:{extension:"jpeg",mimeType:"image/jpeg",format:"jpeg",pixieFormat:"jpeg"},jpeg:{extension:"jpeg",mimeType:"image/jpeg",format:"jpeg",pixieFormat:"jpeg"},png:{extension:"png",mimeType:"image/png",format:"png",pixieFormat:"png"},gif:{extension:"gif",mimeType:"image/gif",format:"gif",pixieFormat:"png"},webp:{extension:"webp",mimeType:"image/webp",format:"webp",pixieFormat:"png"},svg:{extension:"svg",mimeType:"image/svg+xml",format:"svg",pixieFormat:"svg"}};if(e[t])return e[t]}}if(t){const e=rn(t),n=sn(e);let r="jpeg";return"png"===n?r="png":"svg"===n?r="svg":"jpeg"===n&&(r="jpeg"),{extension:n,mimeType:e,format:n,pixieFormat:r}}return{extension:"jpeg",mimeType:"image/jpeg",format:"jpeg",pixieFormat:"jpeg"}}$o.getDataUrlFromFile=jo,$o.getFilefromDataUrl=Io,$o.loadImage=To,$o.drawImageInCanvas=Po,$o.drawFileInCanvas=Lo,$o.canvasToFile=No,$o.getExifOrientation=Bo,$o.handleMaxWidthOrHeight=Uo,$o.followExifOrientation=Vo,$o.cleanupCanvasMemory=Do,$o.isAutoOrientationInBrowser=zo,$o.approximateBelowMaximumCanvasSizeOfBrowser=Oo,$o.copyExifWithoutOrientation=po,$o.getBrowserName=Fo,$o.version="2.0.2";const qo={MAX_SIZE_MB:.48,MAX_WIDTH_OR_HEIGHT:2e3,QUALITY:.8},Yo=["gif","svg"];function Xo(e,t,n,r){return new File([e],t,{type:n,lastModified:r})}function Ko(e,t){return t&&t!==e.name?Xo(e,t,e.type,e.lastModified):e}async function Zo(e,t={}){const{maxSizeMB:n=qo.MAX_SIZE_MB,maxWidthOrHeight:r=qo.MAX_WIDTH_OR_HEIGHT,mimeType:i,fileName:o,libURL:a,enableCompression:s=!0}=t;if(!(e&&e instanceof File))return e;const l=rn(e.type||i||"image/jpeg");if(!l.startsWith("image/"))return Ko(e,o);const c="image/webp"===(u=l)?"image/jpeg":u;var u;const d=sn(l),h=sn(c),f=c!==l?function(e,t){const n=t.startsWith(".")?t.slice(1):t,r=e.lastIndexOf(".");return r>0?`${e.substring(0,r)}.${n}`:`${e}.${n}`}(null!=o?o:e.name,h):null!=o?o:e.name,p=s&&(g=d,!Yo.includes(g));var g;if(!p&&c===l)return Ko(e,f);try{const t={libURL:a,useWebWorker:!0,fileType:c};p?(t.maxSizeMB=n,t.maxWidthOrHeight=r):(t.maxSizeMB=Math.max(e.size/1048576+1,1),t.initialQuality=1,t.alwaysKeepResolution=!0);const i=await $o(e,t);return function(e,t,n,r){const i=null!=r?r:t.name;return e instanceof File?e.type!==n||e.lastModified!==t.lastModified||e.name!==i?Xo(e,i,n,t.lastModified):e:Xo(e,i,n,t.lastModified)}(i,e,rn(i.type||c),f)}catch(t){try{return Ko(e,f)}catch(t){return e}}}const Jo=/^(utm_[a-z0-9_]+|fbclid|gclid|igshid|mc_cid|mc_eid)$/i;function Qo(e){const t=new URL(e.trim());t.hash="",t.hostname=t.hostname.toLowerCase(),("https:"===t.protocol&&"443"===t.port||"http:"===t.protocol&&"80"===t.port)&&(t.port="");const n=Array.from(t.searchParams.entries()).filter(([e])=>!Jo.test(e)).sort(([e,t],[n,r])=>{const i=e.localeCompare(n);return 0!==i?i:t.localeCompare(r)});return t.search="",n.forEach(([e,n])=>t.searchParams.append(e,n)),t.toString()}function ea(e){return!!(null==e?void 0:e.startsWith("image/"))&&"image/gif"!==e}function ta(e,t){if(t===e.name)return e;try{return new File([e],t,{type:e.type,lastModified:e.lastModified})}catch(t){return e}}async function na(e){const t=await fetch(e,{mode:"cors"});if(!t.ok)throw new co(`HTTP ${t.status}`,"UploadUrlDownloadFailed",t.status);return t.blob()}const ra=()=>{var e,t,n,r,i,a,s;const{state:l,actions:c,options:u}=Ei(),d=Li(),{sortBy:h,sortOrder:f}=d.state,{actions:{fetchFolders:p}}=so(),{t:g}=En(),m=Ni(),{deleteItems:v}=lo(),{selectedFolder:y,urlForm:b,pagination:w,files:x,pathHistory:C}=l,_=o.useRef(null),S=o.useRef([]);_.current=w,S.current=Array.isArray(x)?x:[];const{setFiles:A,setLoading:k,setIsUrlModalVisible:E,setActiveLibraryItem:I,setPagination:j,setSelectedFolder:T,setPathHistory:F}=c,{dataProviders:O}=u,M=(0,o.useCallback)(async e=>{var t,n,r;if(!(null==O?void 0:O.getFiles))return[];const i=null===(t=null==u?void 0:u.config)||void 0===t?void 0:t.disablePagination,{files:o,pagination:a}=await O.getFiles({folderId:"folders"!==(null==e?void 0:e.folderId)?null==e?void 0:e.folderId:void 0,noFolder:null==e?void 0:e.noFolder,search:(null===(n=null==e?void 0:e.search)||void 0===n?void 0:n.trim())||void 0,sortBy:null==e?void 0:e.sortBy,sortOrder:null==e?void 0:e.sortOrder,page:i||null==e?void 0:e.page,limit:i||null==e?void 0:e.limit,itemType:(null==e?void 0:e.itemType)||"all"});return j&&((null===(r=null==u?void 0:u.config)||void 0===r?void 0:r.disablePagination)?j({current:1,pageSize:o.length||1,total:o.length||0}):a&&j({current:a.page,pageSize:a.limit,total:a.total})),o},[O,null===(e=null==u?void 0:u.config)||void 0===e?void 0:e.disablePagination,j]),P=(0,o.useCallback)(async(e,t,n)=>{var r,i,o;if(!1!==(null===(r=null==u?void 0:u.config)||void 0===r?void 0:r.paginationAvailable)&&!1!==(null===(i=null==u?void 0:u.config)||void 0===i?void 0:i.hasPagination)&&!0!==(null===(o=null==u?void 0:u.config)||void 0===o?void 0:o.disablePagination)||!(null==O?void 0:O.getFiles))return e;try{let r=[];const{files:i}=await O.getFiles({folderId:n?void 0:t||void 0,noFolder:n,itemType:"all",page:1,limit:1e4});if(r=(i||[]).map(e=>e.name).filter(e=>!!e),!n&&(null==O?void 0:O.getFolders)){const e=(await O.getFolders({parentId:null!=t?t:null,deep:!1})||[]).map(e=>e.name).filter(e=>!!e);r=[...r,...e]}return Ui(e,r)}catch(t){return e}},[O,null===(t=null==u?void 0:u.config)||void 0===t?void 0:t.disablePagination,null===(n=null==u?void 0:u.config)||void 0===n?void 0:n.hasPagination,null===(r=null==u?void 0:u.config)||void 0===r?void 0:r.paginationAvailable]),R=(0,o.useCallback)(async(e,t=!1)=>{var n;try{null==k||k(!0);let t=[];if(!(null==O?void 0:O.getFiles))return;t=await M(e);const n=null!=e?e:{folderId:y||"",itemType:"all"};"file"!==n.itemType&&(t=await(async(e,t,n)=>{var r;if("file"===(null==t?void 0:t.itemType))return e;let i=[];if(!n)return e;{const e=await n({parentId:t.folderId});i=Array.isArray(e)?e:[]}let o=((e,t)=>{const n=Array.isArray(e)?e:[];return(r=t.folderId)&&"root"!==r&&"folders"!==r&&"null"!==r&&null!==r?n.filter(e=>e.parentId===t.folderId):n.filter(Ri);var r})(i,t);if(null===(r=null==t?void 0:t.search)||void 0===r?void 0:r.trim()){const e=t.search.trim().toLowerCase();o=o.filter(t=>{var n;return null===(n=t.name)||void 0===n?void 0:n.toLowerCase().includes(e)})}if(0===o.length)return e;const a=o.map(e=>({id:e.id,name:e.name,size:void 0,date:"-",isFolder:!0,folderId:e.parentId||"",type:"",selected:!1,extension:"",childCount:e.childCount}));if("folder"===(null==t?void 0:t.itemType))return a;const s=e.filter(e=>!e.isFolder);return[...a,...s]})(t,n,null==O?void 0:O.getFolders)),"Trash"!==(y||"")&&(t=t.filter(e=>!(e.isFolder&&"Trash"===e.id))),null==A||A(t)}catch(r){if("StaleLoad"===(null==r?void 0:r.name))return;const o=Gi(r),a=404===(null==o?void 0:o.status)||"FileNotFound"===(null==o?void 0:o.code)||"path_folder_not_found"===(null==o?void 0:o.code);if(!t&&a){const t=Qi(r,C||[]);try{return await eo({options:u,pathFolder:t,dataProviders:null==u?void 0:u.dataProviders}),void await R(e,!0)}catch(e){}}if(a&&T&&F){const t=Array.isArray(C)?C:[];if(t.length>1){const r=t.slice(0,-1),i=r[r.length-1],o=null!==(n=null==i?void 0:i.id)&&void 0!==n?n:"folders";return F(r),T(o),await p(),m.success({id:"FOLDER_NOT_FOUND_NAVIGATE",message:g("Folder not found"),description:g("Navigated to parent folder"),placement:"bottomRight"}),void await R(Object.assign(Object.assign({},e),{folderId:o}),!1)}return F([{id:"folders",name:g("Folders")}]),T("folders"),await p(),m.success({id:"FOLDER_NOT_FOUND_NAVIGATE",message:g("Folder not found"),description:g("Navigated to root folder"),placement:"bottomRight"}),void await R(Object.assign(Object.assign({},e),{folderId:"folders"}),!1)}const s=Wi(null==o?void 0:o.code,g);m.error({id:"FILES_FETCH_FAILED",message:null!=s?s:g("Failed to load files"),placement:"bottomRight",innerException:r,data:{params:e}})}finally{null==k||k(!1)}},[O,A,k,T,F,M,p,y,m,g,C,u]),L=(0,o.useCallback)(e=>R(e),[R]),N=(0,o.useCallback)(async(e,t)=>{var n;if(!(null==O?void 0:O.findFileByUrl))return null;const r=Qo(e);try{return null!==(n=await O.findFileByUrl(r))&&void 0!==n?n:null}catch(e){return null}},[O]),D=(0,o.useCallback)(async(e,t)=>{var n,r,i,o;fo(e,g);const a=Qo(e),s=await N(a,t);if(s)return{kind:"existing",file:s,normalizedUrl:a};let l,c;const d=null===(n=null==u?void 0:u.config)||void 0===n?void 0:n.handleFileProxy,h=null===(r=null==u?void 0:u.config)||void 0===r?void 0:r.handleProxyUrl;if(d)try{l=await Promise.resolve(d(a))}catch(e){c=e}if(!l&&h)try{const e=await Promise.resolve(h(a));l=await na(e)}catch(e){c=e}if(!l)try{l=await na(a)}catch(e){c=e}if(!(l instanceof Blob)||0===l.size)throw c instanceof Error?c:new co(g("Failed to load file through proxy."),"FileProxyFailed");const f=(null===(o=null===(i=l.type)||void 0===i?void 0:i.split(";")[0])||void 0===o?void 0:o.trim())||"image/png";if(!f.startsWith("image/"))throw new co(g("Content type at the URL is not allowed."),"UploadUrlContentTypeNotAllowed");const p=sn(f),m=function(e){try{const t=new URL(e).pathname.split("/").pop();return t?decodeURIComponent(t):void 0}catch(e){return}}(a)||"uploaded-file",v=m.replace(/\.[^.]+$/,"")||"uploaded-file";return{kind:"blob",blob:l,normalizedUrl:a,mimeType:f,extension:p,fileName:oo(m.includes(".")?m:`${v}.${p}`,null==u?void 0:u.config)}},[N,null==u?void 0:u.config,g]),z=(0,o.useCallback)(async(e,t)=>{var n,r;fo(e,g);const i=Qo(e);try{const e=await D(i,t);if("existing"===e.kind)return e.file;const n=await(a=e.blob,new Promise((e,t)=>{const n=new FileReader;n.onload=()=>e(n.result),n.onerror=()=>{var e;return t(null!==(e=n.error)&&void 0!==e?e:new Error("Failed to read proxied file"))},n.readAsDataURL(a)}));return{thumbnail:n,name:e.fileName,type:e.mimeType,extension:e.extension,size:e.blob.size,sourceUrl:e.normalizedUrl,saveWithoutFolder:!0}}catch(e){const a=Gi(e),s="string"==typeof(o=null==a?void 0:a.code)?o:"UploadUrlDownloadFailed",l=e instanceof co?e:new co(null!==(r=null!==(n=Wi(s,g))&&void 0!==n?n:null==a?void 0:a.message)&&void 0!==r?r:g("Failed to load file through proxy."),s,null==a?void 0:a.status);throw l.notificationShown=!0,await m.error({id:"EDITOR_PROXY_FILE_FAILED",message:l.message,placement:"bottomRight",data:{url:i,folderId:y||null,error:a,eventSource:"pixie"},innerException:e},t),l}var o,a},[N,m,null==u?void 0:u.config,y,g]),B=(0,o.useCallback)(async e=>{const t=_.current;try{const n=S.current.find(t=>t.id===e),r=e=>{if(!e)return;const t=x.find(t=>t.id===e);return null==t?void 0:t.name};await v({items:[{id:e,isFolder:null==n?void 0:n.isFolder}],selectedFolder:y,getItemNameById:r,showNotifications:!0});const i=Object.assign({},t);let o=t.current;1===x.length&&(o=i.current>1?i.current-1:1),await L({folderId:y||"",page:o,limit:t.pageSize,sortBy:h,sortOrder:f})}catch(t){(null==t?void 0:t.notificationShown)||m.error({id:"FILES_DELETE_ERROR",message:g("Error when deleting a file"),placement:"bottomRight",innerException:t,data:{failCount:1,totalCount:1,itemIds:[e],folderId:y||null,errors:[{itemId:e,error:Gi(t)}]}})}},[v,L,y,g,m,x,h,f]),U=(0,o.useCallback)(async e=>{try{const t=_.current;if(!(null==O?void 0:O.deleteFolder))return void m.error({id:"FOLDER_DELETE_ERROR",message:g("DataProvider for folder deletion is not configured"),placement:"bottomRight",data:{totalCount:1,failCount:1,itemIds:[e],folderId:e}});if(!await O.deleteFolder(e)){const e=new Error("\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u043f\u0430\u043f\u043a\u0443");throw e.notificationShown=!1,e}m.success({id:"FOLDER_DELETE_SUCCESS",message:g("Folder deleted"),placement:"bottomRight",data:{successCount:1,totalCount:1,itemIds:[e],folderId:e}}),y===e?await L({page:t.current,limit:t.pageSize,sortBy:h,sortOrder:f}):await L({folderId:y||"",sortBy:h,sortOrder:f,page:t.current,limit:t.pageSize})}catch(t){(null==t?void 0:t.notificationShown)||m.error({id:"FOLDER_DELETE_ERROR",message:g("Error when deleting a folder"),innerException:t,placement:"bottomRight",data:{totalCount:1,failCount:1,itemIds:[e],folderId:e,errors:[{itemId:e,error:Gi(t)}]}})}},[O,y,m,g,L,h,f]),V=(0,o.useCallback)(async(e,t)=>{var n,r;try{if(null==O?void 0:O.getFileData){const t=await O.getFileData(e);if(t)return t;throw new Error(g("Failed to download file"))}{const t=await fetch(`/api/files/${e}/content`);if(!t.ok)throw new Error(g("Error loading image"));return await t.blob()}}catch(i){const o=S.current.find(t=>t.id===e);t||m.error({id:"FILE_DOWNLOAD_FAILED",message:g("Failed to download file"),placement:"bottomRight",description:(null==o?void 0:o.name)||e,innerException:i,data:{itemId:e,itemName:(null==o?void 0:o.name)||e,folderId:null!==(n=null==o?void 0:o.folderId)&&void 0!==n?n:null,thumbnail:null!==(r=null==o?void 0:o.thumbnail)&&void 0!==r?r:null}},t)}},[O,m,g]),H=(0,o.useCallback)(async(e,t,n,r)=>{var i,o,a,s,c,d,h,f,p,v,b,w,x,C,_,S,A;if("Trash"===(r?"":null!=t?t:y||""))throw new Error(g("Upload to Trash is forbidden"));const k=oo(e.name,null==u?void 0:u.config),E=k.split(".").pop()||"",j=r?"":null!=t?t:y||"";let T=e;try{if(null===(o=null===(i=e.type)||void 0===i?void 0:i.startsWith)||void 0===o?void 0:o.call(i,"image/")){const t=null!==(s=null===(a=null==u?void 0:u.config)||void 0===a?void 0:a.compressMaxSize)&&void 0!==s?s:qo.MAX_SIZE_MB,n=null!==(d=null===(c=null==u?void 0:u.config)||void 0===c?void 0:c.compressMaxWidthOrHeight)&&void 0!==d?d:2e3,r=null!==(f=null===(h=null==u?void 0:u.config)||void 0===h?void 0:h.compessorUrl)&&void 0!==f?f:null===(p=null==u?void 0:u.config)||void 0===p?void 0:p.compressorUrl;T=await Zo(e,{maxSizeMB:t,maxWidthOrHeight:n,mimeType:e.type,fileName:k,libURL:r,enableCompression:ea(e.type)})}else T=ta(e,k)}catch(t){T=ta(e,k)}let F=T.name;const R=!1===(null===(v=null==u?void 0:u.config)||void 0===v?void 0:v.hasPagination)||!0===(null===(b=null==u?void 0:u.config)||void 0===b?void 0:b.disablePagination);R&&(F=await P(F,j,r)),R&&(T=ta(T,F));try{if(null==O?void 0:O.uploadFiles)try{const t=await O.uploadFiles({items:[{name:F,size:T.size,type:T.type||e.type,folderId:j,data:T,extension:E,noFolder:r}],folderId:j});if(t.success&&t.detailed&&t.detailed.length>0){const i=t.detailed[0];if(!i.success||!i.data){if(!n){const e=(null==i?void 0:i.error)?String(i.error):g("Failed to upload file");m.error({id:"FILE_UPLOAD_ITEM_FAILED",message:e,placement:"bottomRight",description:k,innerException:null==i?void 0:i.error,data:{itemName:k,folderId:j||null,eventSource:"upload"}})}return void(I&&I(Lt))}{const t=i.data;if(t.id){const n=(null!==(w=t.folderId)&&void 0!==w?w:j)||void 0;await L({folderId:n,noFolder:r});let i=l.files.find(e=>e.id===t.id);if(!i)try{i=(await M({folderId:n,noFolder:r,itemType:"file"})).find(e=>e.id===t.id)}catch(e){}return I&&I(Lt),i||Object.assign(Object.assign({},t),{id:t.id,name:t.name||k,folderId:null!==(C=null!==(x=t.folderId)&&void 0!==x?x:j)&&void 0!==C?C:null,type:T.type||e.type,size:T.size,extension:E||k.split(".").pop()||"",thumbnail:null!==(_=t.thumbnail)&&void 0!==_?_:void 0,url:null!==(S=t.url)&&void 0!==S?S:void 0,thumbnailUrl:null!==(A=t.thumbnailUrl)&&void 0!==A?A:void 0,isFolder:!1,selected:!1})}}}else if(!t.success){if(!n){const e=t.error?String(t.error):g("Failed to upload file");m.error({id:"FILE_UPLOAD_ITEM_FAILED",message:e,placement:"bottomRight",description:k,innerException:t.error,data:{itemName:k,folderId:j||null,eventSource:"upload"}})}return void(I&&I(Lt))}return void(I&&I(Lt))}catch(e){throw e}if(null==O?void 0:O.uploadFile){const t=await O.uploadFile({name:F,size:T.size,type:T.type||e.type,folderId:j,noFolder:r,data:T,extension:E});return I&&I(Lt),t}return void(n||m.error({id:"FILES_UPLOAD_PROVIDER_NOT_CONFIGURED",message:g("DataProvider for file upload is not configured"),placement:"bottomRight"}))}catch(e){const t=Gi(e),r=Wi(null==t?void 0:t.code,g);return n?void 0:void m.error({id:"FILE_UPLOAD_ITEM_FAILED",message:null!=r?r:g("Failed to upload file"),placement:"bottomRight",description:k,innerException:e,data:{itemName:k,folderId:j||null,error:Gi(e),eventSource:"upload"}})}},[O,y,I,l.files,L,M,m,g,null==u?void 0:u.config]),W=(0,o.useCallback)(async(e,t)=>{var n;if(!(null==O?void 0:O.getFolders)||!(null==O?void 0:O.createFolder))return e||"";try{const r=await O.getFolders(),i=Array.isArray(r)?r:[],o=(e,t)=>i.find(n=>{var r;return(null!==(r=n.parentId)&&void 0!==r?r:null)===(null!=e?e:null)&&n.name===t});let a=null!=e?e:"";for(const e of t){if(!e)continue;let t=o(a,e);if(!t){const n=await O.createFolder({name:e,parentId:null!=a?a:null});i.push(n),t=n}a=t.id}return null!==(n=a)&&void 0!==n?n:e||""}catch(t){return e||""}},[O]),$=(0,o.useCallback)(async(e,t)=>{var n,r,i,o;if(!(null===(r=null===(n=e.type)||void 0===n?void 0:n.startsWith)||void 0===r?void 0:r.call(n,"image/")))return null!=t?t:null;const a=null==e?void 0:e.webkitRelativePath;let s=t||"";if(a&&a.includes("/")){const e=a.split("/");e.pop();const n=e.filter(Boolean);n.length&&(s=await W(t||"",n)||t||"")}return null!==(o=null!==(i=s)&&void 0!==i?i:t)&&void 0!==o?o:null},[W]);(0,o.useCallback)(async e=>{var t,n,r,i,o,a,s,l,c,u,d,h;const{file:f,selectedFolderId:p,uploadFn:g,progressCallbacks:m}=e;if(!(null===(n=null===(t=f.type)||void 0===t?void 0:t.startsWith)||void 0===n?void 0:n.call(t,"image/")))return{success:!0,fileName:f.name,folderId:null!=p?p:null};const v=null!==(i=null!==(r=await $(f,p))&&void 0!==r?r:p)&&void 0!==i?i:null,y=null!==(o=null!=v?v:p)&&void 0!==o?o:null;let b;null===(a=null==m?void 0:m.onStart)||void 0===a||a.call(m,f);try{if(null==m?void 0:m.onProgress){let e=0;b=window.setInterval(()=>{var t;e=Math.min(e+10+Math.floor(Date.now()%10),90),null===(t=null==m?void 0:m.onProgress)||void 0===t||t.call(m,f.name,e)},200)}const e=await g(f,null!=y?y:void 0);return(null==m?void 0:m.onProgress)&&(null===(s=null==m?void 0:m.onProgress)||void 0===s||s.call(m,f.name,100)),null===(l=null==m?void 0:m.onComplete)||void 0===l||l.call(m,f.name),{success:!0,fileName:f.name,fileId:null==e?void 0:e.id,folderId:null!==(u=null!==(c=null==e?void 0:e.folderId)&&void 0!==c?c:y)&&void 0!==u?u:null}}catch(e){const t=e instanceof Error?e.message:String(e);return null===(d=null==m?void 0:m.onError)||void 0===d||d.call(m,f.name,t),{success:!1,fileName:f.name,folderId:null!==(h=null!=y?y:p)&&void 0!==h?h:null,error:t}}finally{void 0!==b&&clearInterval(b)}},[$]);const G=(0,o.useCallback)(async(e,t)=>{var n,r,i,o,a,s,l,c,d,h,f,p,v,b,w,x,C,_,S,A,k,E,j,T,F,M,P,R,L,N,D,z,B,U,V,H,W,G,q,Y;if(0===e.length)return{successCount:0,failCount:0,successes:[],errors:[],totalCount:0};null===(n=null==t?void 0:t.onStartBatch)||void 0===n||n.call(t,e);const X=e=>{const t=e.filter(Boolean);return t.length>0&&t.length<=5?t.join(", "):null},K=[];for(let I=0;I<e.length;I++){const n=e[I];if(!(null===(i=null===(r=n.type)||void 0===r?void 0:r.startsWith)||void 0===i?void 0:i.call(r,"image/"))){const e=await m.warning({id:"FILES_UPLOAD_UNSUPPORTED_TYPE",message:g("Unsupported file type"),placement:"bottomRight",data:{itemName:n.name,fileType:n.type,folderId:y||null}});null===(o=null==t?void 0:t.onError)||void 0===o||o.call(t,n.name,e.message);continue}const w=oo(n.name,null==u?void 0:u.config);let x=n;try{if(null===(s=null===(a=n.type)||void 0===a?void 0:a.startsWith)||void 0===s?void 0:s.call(a,"image/")){const e=null!==(c=null===(l=null==u?void 0:u.config)||void 0===l?void 0:l.compressMaxSize)&&void 0!==c?c:qo.MAX_SIZE_MB,t=null!==(h=null===(d=null==u?void 0:u.config)||void 0===d?void 0:d.compressMaxWidthOrHeight)&&void 0!==h?h:2e3,r=null!==(p=null===(f=null==u?void 0:u.config)||void 0===f?void 0:f.compessorUrl)&&void 0!==p?p:null===(v=null==u?void 0:u.config)||void 0===v?void 0:v.compressorUrl;x=await Zo(n,{maxSizeMB:e,maxWidthOrHeight:t,mimeType:n.type,fileName:w,libURL:r,enableCompression:ea(n.type)})}else x=ta(n,w)}catch(e){x=ta(n,w)}const C=`${Date.now()}-${I}-${Math.random().toString(36).slice(2,8)}`,_=await $(x,y);null===(b=null==t?void 0:t.onStart)||void 0===b||b.call(t,x),K.push({file:x,targetFolderId:_,requestId:C,originalFileName:n.name,originalIndex:I})}const Z=K.length;if(0===Z)return{successCount:0,failCount:0,successes:[],errors:[],totalCount:0};const J=!1===(null===(w=null==u?void 0:u.config)||void 0===w?void 0:w.hasPagination)||!0===(null===(x=null==u?void 0:u.config)||void 0===x?void 0:x.disablePagination),Q=new Map;if(J&&(null==O?void 0:O.getFiles)){const t=[...new Set(K.map(e=>{var t,n;return null!==(n=null!==(t=e.targetFolderId)&&void 0!==t?t:y)&&void 0!==n?n:""}).filter(Boolean))];for(const n of t)try{const{files:e}=await O.getFiles({folderId:n||void 0,itemType:"file",page:1,limit:1e4});Q.set(n,(e||[]).map(e=>e.name))}catch(e){}}const ee=new Map,te=!t,ne=1===Z&&te,re=[],ie=[],oe=[],ae=[],se=new Map;let le=0,ce=0;const ue=null!==(_=null===(C=null==u?void 0:u.config)||void 0===C?void 0:C.maxFileSize)&&void 0!==_?_:52428800,de=async(e,n,r,i)=>{var o,a;const{emitProgress:s=!0,emitNotification:l=!0}=null!=i?i:{};le++,re.push(e),ie.push(null!=r?r:e),await((e,t,n,r)=>{var i;return m.success({id:"FILE_UPLOAD_ITEM_SUCCESS",message:`${g("File")} ${e} ${g("has been successfully uploaded")}`,placement:"bottomRight",data:{itemId:n,itemName:e,folderId:null!==(i=null!=t?t:y)&&void 0!==i?i:null,eventSource:"upload"}},r||!te)})(e,n,r,!l),s&&(null===(o=null==t?void 0:t.onProgress)||void 0===o||o.call(t,e,100),null===(a=null==t?void 0:t.onComplete)||void 0===a||a.call(t,e))},he=async(e,n,r,i)=>{var o;const{emitProgress:a=!0,emitNotification:s=!0,fileSize:l,progressCallbackName:c,progressCallbackIndex:u}=null!=i?i:{};ce++;const d=null!=l?{fileSize:l,maxSize:ue}:void 0,h=await((e,t,n,r,i)=>{var o,a,s,l,c,u,d;const h=Gi(n),f=null!==(o=null==i?void 0:i.fileSize)&&void 0!==o?o:null==h?void 0:h.fileSize,p=null!==(s=null!==(a=null==i?void 0:i.maxSize)&&void 0!==a?a:null==h?void 0:h.maxSize)&&void 0!==s?s:ue,v={allowedChars:"a-z A-Z 0-9 . _ -",fileSize:null!=f?Di(Number(f)):void 0,maxSize:null!=p?Di(Number(p)):void 0},b=null==h?void 0:h.code,w="BatchItemLimitExceeded"===b||"exceeded_max_files"===b?b:null!==(l=$i(null==h?void 0:h.message))&&void 0!==l?l:b,x="BatchItemLimitExceeded"===w||"exceeded_max_files"===w?qi(n,g):Wi(w,g,v),C=(null==h?void 0:h.message)&&"string"==typeof h.message&&h.message.length>0?h.message:null,_=n instanceof Error?n.message:"string"==typeof n?n:null,S=_&&"[object Object]"!==_?_:null;return m.error({id:"FILE_UPLOAD_ITEM_FAILED",message:null!==(u=null!==(c=null!=C?C:x)&&void 0!==c?c:S)&&void 0!==u?u:g("Error uploading file {{fileName}}",{fileName:e}),placement:"bottomRight",data:{itemName:e,folderId:null!==(d=null!=t?t:y)&&void 0!==d?d:null,error:Gi(n),eventSource:"upload"},innerException:n},r||!te)})(e,n,r,!s,d);a&&(null===(o=null==t?void 0:t.onError)||void 0===o||o.call(t,null!=c?c:e,h.message,u)),ae.push({itemId:void 0,itemName:e,error:Gi(r)}),oe.push({fileName:e,error:h.message})};if(!(null==O?void 0:O.uploadFiles))return m.error({id:"FILES_UPLOAD_PROVIDER_NOT_CONFIGURED",message:g("DataProvider for file upload is not configured"),placement:"bottomRight"}),{successCount:0,failCount:Z,successes:[],errors:[],totalCount:Z};{const n=[];try{(null==t?void 0:t.onProgress)&&K.forEach(e=>{let r=0;const i=window.setInterval(()=>{var n;r=Math.min(r+10+Math.floor(Date.now()%10),90),null===(n=null==t?void 0:t.onProgress)||void 0===n||n.call(t,e.file.name,r)},200);n.push(i)});let e=await O.uploadFiles({items:K.map(e=>{var t,n;const r=J?((e,t)=>{const n=null!=e?e:"";let r=Q.get(n)||[],i=ee.get(n);i||(i=new Set(r.map(e=>e.toLowerCase())),ee.set(n,i));const o=Ui(t,Array.from(i));return i.add(o.toLowerCase()),o})(e.targetFolderId,e.file.name):e.file.name,i=J?ta(e.file,r):e.file;return{requestId:e.requestId,name:r,size:i.size,type:i.type,folderId:null!==(n=null!==(t=e.targetFolderId)&&void 0!==t?t:y)&&void 0!==n?n:null,data:i,extension:i.name.split(".").pop()||""}}),folderId:null!=y?y:null});n.forEach(e=>window.clearInterval(e)),n.length=0;const r=null!==(S=e.detailed)&&void 0!==S?S:[],i=new Map(r.filter(e=>e.requestId).map(e=>[e.requestId,e]));if(r.length>0)for(let t=0;t<K.length;t++){const e=K[t],n=null!==(A=e.requestId?i.get(e.requestId):void 0)&&void 0!==A?A:r[t];if(n&&n.success){const t=n.data,r=null!==(k=null==t?void 0:t.name)&&void 0!==k?k:oo(e.file.name,null==u?void 0:u.config),i=null!==(T=null!==(j=null!==(E=null==t?void 0:t.folderId)&&void 0!==E?E:e.targetFolderId)&&void 0!==j?j:y)&&void 0!==T?T:null,o=null==t?void 0:t.id;se.set(r,{id:o,name:r,folderId:i,size:null==t?void 0:t.size,originalFileName:e.originalFileName,originalIndex:e.originalIndex}),await de(r,i,o,{emitNotification:ne})}else{const t=null==n?void 0:n.data,r=null!==(F=null==t?void 0:t.name)&&void 0!==F?F:oo(e.file.name,null==u?void 0:u.config),i=null!==(R=null!==(P=null!==(M=null==t?void 0:t.folderId)&&void 0!==M?M:e.targetFolderId)&&void 0!==P?P:y)&&void 0!==R?R:null;await he(r,i,null!==(L=null==n?void 0:n.error)&&void 0!==L?L:new Error(g("Error uploading file")),{emitNotification:ne,fileSize:e.file.size,progressCallbackName:e.originalFileName,progressCallbackIndex:e.originalIndex})}}else if(e.success)for(const t of K){const e=oo(t.file.name,null==u?void 0:u.config),n=null!==(D=null!==(N=t.targetFolderId)&&void 0!==N?N:y)&&void 0!==D?D:null;await de(e,n,void 0,{emitNotification:ne})}else{const t=null!==(z=e.error)&&void 0!==z?z:new Error(g("Error uploading file"));for(const e of K){const n=oo(e.file.name,null==u?void 0:u.config),r=null!==(U=null!==(B=e.targetFolderId)&&void 0!==B?B:y)&&void 0!==U?U:null;await he(n,r,t,{emitNotification:ne,fileSize:e.file.size,progressCallbackName:e.originalFileName,progressCallbackIndex:e.originalIndex})}}}catch(e){for(const t of K){const n=oo(t.file.name,null==u?void 0:u.config),r=null!==(H=null!==(V=t.targetFolderId)&&void 0!==V?V:y)&&void 0!==H?H:null;await he(n,r,null!=e?e:new Error(g("Error uploading file")),{emitNotification:ne,fileSize:t.file.size,progressCallbackName:t.originalFileName,progressCallbackIndex:t.originalIndex})}}finally{n.forEach(e=>window.clearInterval(e))}}if(le>0&&(I&&I(Lt),Z>1&&te)){const e=X(re),t=e?g("Uploaded",{names:e}):g("uploads_success_summary",{successCount:le,totalCount:Z});m.success({id:"FILES_UPLOAD_BATCH_SUCCESS",message:t,placement:"bottomRight",data:{successCount:le,totalCount:Z,itemIds:ie,itemNames:re,folderId:null!=y?y:null,eventSource:"upload"}})}if(ce>0&&te&&!ne)if(Z>1){const e=oe.map(e=>e.fileName),t=X(e),n=t?g("Failed",{names:t}):g("uploads_fail_summary",{failCount:ce,totalCount:Z});m.error({id:"FILES_UPLOAD_BATCH_FAILED",message:n,placement:"bottomRight",data:{failCount:ce,totalCount:Z,itemNames:e,folderId:null!=y?y:null,errors:ae,eventSource:"upload"}})}else if(1===Z&&ae.length>0&&(null===(W=ae[0].error)||void 0===W?void 0:W.code)){const e=Wi(null===(G=ae[0].error)||void 0===G?void 0:G.code,g),t=null!==(Y=null===(q=oe[0])||void 0===q?void 0:q.fileName)&&void 0!==Y?Y:"",n=null!=e?e:t?`${g("Failed to upload files")}: ${t}`:g("Failed to upload files");m.error({id:"FILES_UPLOAD_BATCH_FAILED",message:n,placement:"bottomRight",data:{failCount:ce,totalCount:Z,itemNames:[t],folderId:null!=y?y:null,errors:ae,eventSource:"upload"}})}return{successCount:le,failCount:ce,successes:re,errors:oe,totalCount:Z,uploadedFiles:se.size>0?se:void 0}},[O,null===(i=null==u?void 0:u.config)||void 0===i?void 0:i.hasPagination,null===(a=null==u?void 0:u.config)||void 0===a?void 0:a.disablePagination,m,$,y,I,g,null==u?void 0:u.config]),q=(0,o.useCallback)(async e=>{var t;if(!(null==O?void 0:O.uploadFiles))return void m.error({id:"FILES_UPLOAD_PROVIDER_NOT_CONFIGURED",message:g("DataProvider for file upload is not configured"),placement:"bottomRight"});if("Trash"===y)return void m.warning({id:"FOLDER_OPERATION_VALIDATION_FAILED",message:g("Cannot upload files to Trash"),placement:"bottomRight",data:{folderId:y||null,reason:"Upload to Trash is not allowed"}});const n=_.current,r=document.createElement("input");r.type="file",r.accept="image/*",r.multiple=!0;try{(null===(t=null==u?void 0:u.config)||void 0===t?void 0:t.features)&&u.config.features.enableDirectoryUpload&&(r.webkitdirectory=!0)}catch(e){}r.onchange=async t=>{var r;const i=t.target.files;if(!i||0===i.length)return;const o=Array.from(i);try{null==k||k(!0);const{successes:t,errors:i,uploadedFiles:a}=await G(o,e);null===(r=null==e?void 0:e.onBatchComplete)||void 0===r||r.call(e,{files:o,successes:t,errors:i,uploadedFiles:a}),await p(),await L({folderId:y||"",sortBy:h,sortOrder:f,page:n.current,limit:n.pageSize})}catch(e){}finally{null==k||k(!1)}},r.click()},[null==O?void 0:O.uploadFiles,y,m,g,k,L,p,h,f,G,null===(s=null==u?void 0:u.config)||void 0===s?void 0:s.features]),Y=(0,o.useCallback)(async(e,t,n,r="uploadByUrl")=>{const i=_.current,o=Boolean(e&&String(e).trim());let a,s=null!=e?e:null;try{if(!t&&"Trash"===y)throw n||m.warning({id:"FOLDER_OPERATION_VALIDATION_FAILED",message:g("Cannot upload files to Trash"),placement:"bottomRight",data:{folderId:y||null,reason:"Upload to Trash is not allowed"}}),new co(g("Cannot upload files to Trash"),"UploadUrlDownloadFailed");let l,c;if(!s&&b&&(l=await b.validateFields(),s=null==l?void 0:l.fileUrl),!s)throw n||m.error({id:"FILES_UPLOAD_URL_VALIDATION_FAILED",message:g("Please fill in all fields"),placement:"bottomRight",data:{url:null!=s?s:null,folderId:y||null,eventSource:r}}),new co(g("Please fill in all fields"),"UploadUrlInvalid");if(fo(s,g),s=Qo(s),null==k||k(!0),s){const e=s.split("?")[0].split("#")[0].split("/");c=e[e.length-1]||"uploaded-file",c=oo(c,null==u?void 0:u.config)}const d=t?"":y||"",p=Boolean((null==O?void 0:O.uploadFiles)||(null==O?void 0:O.uploadFile)),v=Boolean(null==O?void 0:O.uploadFileByUrl);let w=c;w&&v&&(w=await P(w,d,t));try{const i=await D(s,n);if("existing"===i.kind)a=i.file;else if(p){const n=new File([i.blob],i.fileName,{type:i.mimeType,lastModified:Date.now()});try{a=await H(n,d,!0,t)}catch(e){throw e.uploadUrlStage="binaryUpload",e}if(!a){const e=new co(g("Failed to upload file"),"FileUploadBackendError");throw e.uploadUrlStage="binaryUpload",e}}else{if(!v)throw n||m.error({id:"FILES_UPLOAD_URL_NOT_SUPPORTED",message:g("Upload by URL is not supported"),placement:"bottomRight",data:{url:s,folderId:y||null,eventSource:r}}),new co(g("Upload by URL is not supported"),"UploadUrlDownloadFailed");a=await O.uploadFileByUrl({url:s,folderId:y||"",noFolder:t,name:w,eventSource:r})}}catch(e){if("binaryUpload"===(null==e?void 0:e.uploadUrlStage)||!v)throw e;a=await O.uploadFileByUrl({url:s,folderId:y||"",noFolder:t,name:w,eventSource:r})}const x=(null==l?void 0:l.name)||(null==a?void 0:a.name)||"unnamed file";return a&&m.success({id:"FILE_UPLOAD_ITEM_SUCCESS",message:`${g("File")} ${x} ${g("successfully uploaded")}`,placement:"bottomRight",data:{itemName:x,itemId:null==a?void 0:a.id,folderId:y||null,eventSource:r}},n),(l||o)&&(null==E||E(!1),null==b||b.resetFields()),I&&I(Lt),await L({folderId:y||"",noFolder:t,sortBy:h,sortOrder:f,page:i.current,limit:i.pageSize}),a}catch(e){if(!n){const t=Gi(e),n=t,i=e,o=Number(null==n?void 0:n.fileSize),a=Number(null==n?void 0:n.maxSize),l=Number.isFinite(o)&&Number.isFinite(a)?{fileSize:o,maxSize:a}:void 0,c="binaryUpload"===(null==i?void 0:i.uploadUrlStage)?qi(t,g,l):Ki(t,g);m.error({id:"FILES_UPLOAD_BY_URL_FAILED",message:c,placement:"bottomRight",data:{url:null!=s?s:null,folderId:y||null,error:t,eventSource:r},innerException:e})}throw e}finally{null==k||k(!1)}},[b,k,O,m,g,E,I,L,y,h,f,P,D,H,null==u?void 0:u.config]),X=(0,o.useCallback)(async e=>{if(!e.length)return;const t=_.current;"Trash"!==y?(await G(e),await L({folderId:y||"",sortBy:h,sortOrder:f,page:t.current,limit:t.pageSize})):m.warning({id:"FOLDER_OPERATION_VALIDATION_FAILED",message:g("Cannot upload files to Trash"),placement:"bottomRight",data:{folderId:y||null,reason:"Upload to Trash is not allowed"}})},[L,y,h,f,G,m,g]);return{fetchFiles:L,handleDeleteFile:B,handleDeleteFolder:U,handleAddFile:q,handleAddFileByUrl:Y,handleDroppedFiles:X,getFileData:V,findFileByUrl:N,resolveFileForEditByUrl:z,uploadFileWithProvider:H}},ia=e=>{let t;const n=new Set,r=(e,r)=>{const i="function"==typeof e?e(t):e;if(!Object.is(i,t)){const e=t;t=(null!=r?r:"object"!=typeof i||null===i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,o={setState:r,getState:i,getInitialState:()=>a,subscribe:e=>(n.add(e),()=>n.delete(e))},a=t=e(r,i,o);return o},oa=e=>e,aa=e=>{const t=(e=>e?ia(e):ia)(e),n=e=>function(e,t=oa){const n=o.useSyncExternalStore(e.subscribe,o.useCallback(()=>t(e.getState()),[e,t]),o.useCallback(()=>t(e.getInitialState()),[e,t]));return o.useDebugValue(n),n}(t,e);return Object.assign(n,t),n};function sa(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}const la=(ca=e=>({selectedFiles:new Set,visibleFileIds:[],anchorId:null,multiSelect:!0,setMultiSelect:t=>{e(e=>{var n;if(e.multiSelect===t)return e;if(t)return{multiSelect:!0};const r=null!==(n=Array.from(e.selectedFiles)[0])&&void 0!==n?n:null;return{multiSelect:!1,selectedFiles:r?new Set([r]):new Set,anchorId:r}})},syncVisibleFiles:t=>{const n=Array.isArray(t)?t.map(e=>e.id):[];e(e=>{const t=new Set(n),r=new Set(Array.from(e.selectedFiles).filter(e=>t.has(e))),i=e.anchorId&&t.has(e.anchorId)?e.anchorId:null,o=function(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}(e.visibleFileIds,n),a=sa(e.selectedFiles,r),s=e.anchorId===i;return o&&a&&s?e:{visibleFileIds:n,selectedFiles:r,anchorId:i}})},setSelectedFiles:t=>{e(e=>{var n;const r=new Set(e.visibleFileIds),i=new Set(Array.from(t).filter(e=>r.has(e)));return sa(e.selectedFiles,i)?e:{selectedFiles:i,anchorId:null!==(n=Array.from(i)[0])&&void 0!==n?n:null}})},clearSelection:()=>{e(e=>0===e.selectedFiles.size&&null===e.anchorId?e:{selectedFiles:new Set,anchorId:null})},selectAllVisible:()=>{e(e=>{var t;const n=new Set(e.visibleFileIds),r=null!==(t=e.visibleFileIds[0])&&void 0!==t?t:null;return sa(e.selectedFiles,n)&&e.anchorId===r?e:{selectedFiles:n,anchorId:r}})},toggleFileSelection:(t,n)=>{e(e=>{const r=!1!==e.multiSelect,i=Boolean(null==n?void 0:n.shiftKey)&&r,o=Boolean(null==n?void 0:n.metaKey)||Boolean(null==n?void 0:n.ctrlKey)||Boolean(null==n?void 0:n.forceToggle),a=e.visibleFileIds,s=new Set(a);if(a.length>0&&!s.has(t))return e;if(!r){const n=new Set([t]);return sa(e.selectedFiles,n)&&e.anchorId===t?e:{selectedFiles:n,anchorId:t}}if(i&&e.anchorId&&s.has(e.anchorId)){const n=a.indexOf(e.anchorId),r=a.indexOf(t);if(-1===n||-1===r)return e;const[i,s]=n<r?[n,r]:[r,n],l=a.slice(i,s+1),c=o?new Set(e.selectedFiles):new Set;return l.forEach(e=>{c.add(e)}),sa(e.selectedFiles,c)?e:{selectedFiles:c}}if(i&&!e.anchorId){const n=new Set([t]);return sa(e.selectedFiles,n)&&e.anchorId===t?e:{selectedFiles:n,anchorId:t}}if(o){const n=new Set(e.selectedFiles);return n.has(t)?n.delete(t):n.add(t),sa(e.selectedFiles,n)&&e.anchorId===t?e:{selectedFiles:n,anchorId:t}}const l=new Set([t]);return sa(e.selectedFiles,l)&&e.anchorId===t?e:{selectedFiles:l,anchorId:t}})}}),ca?aa(ca):aa);var ca;const ua=e=>{const t=t=>{if(!t)return;const n=e.find(e=>e.id===t);return null==n?void 0:n.name};return{getItemNameById:t,getItemNamesByIds:e=>e.map(t).filter(e=>Boolean(e)),getNamesPreview:e=>e.length>0&&e.length<=5?e.join(", "):null}},da=(e,t,n,r,i)=>({itemIds:e,itemNames:i&&i.length?i:void 0,successCount:t,totalCount:n,folderId:null!=r?r:null}),ha=(e,t,n,r,i,o)=>({itemIds:e,itemNames:o&&o.length?o:void 0,failCount:t,totalCount:n,folderId:null!=r?r:null,errors:i}),fa=()=>{const e=Ni(),{t:t}=En(),{actions:{fetchFolders:n,fetchChildFolders:r}}=so();return{refreshFolders:(0,o.useCallback)(async({parentIds:i,selectedFolder:o})=>{try{if(await n(),i&&r)for(const e of i)e&&await r(e)}catch(n){e.error({id:"FILES_FETCH_FAILED",message:t("Failed to refresh folder tree"),placement:"bottomRight",innerException:n,data:{params:{folderId:o||void 0}}})}},[e,t]),refreshFiles:(0,o.useCallback)(async({fetchFiles:n,selectedFolder:r,page:i,limit:o})=>{try{await n({folderId:r||"",page:i,limit:o})}catch(n){e.error({id:"FILES_FETCH_FAILED",message:t("Failed to refresh file list"),placement:"bottomRight",innerException:n,data:{params:{folderId:r||void 0,page:i,limit:o}}})}},[e,t])}},pa=e=>{const t=(e=>{var t,n,r,i;const{state:a,actions:s,options:l}=Ei(),{t:c}=En(),u=so(),d=Ni(),{fetchFolders:h}=u.actions,{renameItem:f}=(()=>{const{options:e}=Ei(),{dataProviders:t}=e,{t:n}=En(),r=(0,o.useCallback)(async({itemId:r,newName:i,isFolder:o})=>{var a,s,l,c,u,d,h,f;try{if(o){if(!(null==t?void 0:t.renameFolder))throw new Error(n("renameFolder is not implemented in dataProviders"));const o=ao(i.trim(),e.config),c=await t.renameFolder(r,o);return{success:!0,renamedItem:{id:c.id,name:null!==(a=c.name)&&void 0!==a?a:o,parentId:null!==(s=c.parentId)&&void 0!==s?s:null,folderId:null!==(l=c.parentId)&&void 0!==l?l:null}}}if(!(null==t?void 0:t.renameFile))throw new Error(n("renameFile is not implemented in dataProviders"));const p=oo(i,e.config),g=await t.renameFile(r,p);return{success:!0,renamedItem:{id:null!==(c=null==g?void 0:g.id)&&void 0!==c?c:r,name:null!==(u=null==g?void 0:g.name)&&void 0!==u?u:p,folderId:null!==(d=null==g?void 0:g.folderId)&&void 0!==d?d:null,parentId:null!==(f=null!==(h=null==g?void 0:g.parentId)&&void 0!==h?h:null==g?void 0:g.folderId)&&void 0!==f?f:null}}}catch(e){return{success:!1,error:Gi(e)}}},[t,n,e.config]);return{renameItem:r}})(),{files:p,selectedFolder:g,fileToRename:m,renameForm:v,isRenameModalVisible:y,pagination:b}=a,{setFileToRename:w,setIsRenameModalVisible:x}=s,{dataProviders:C,config:_}=l,S=e=>{var t,n;if(!e)return null;const r=e;return null!==(n=null!==(t=r.folderId)&&void 0!==t?t:r.parentId)&&void 0!==n?n:null},A=(e,t)=>{var n;return{itemId:null!==(n=null==e?void 0:e.id)&&void 0!==n?n:t,itemName:null==e?void 0:e.name,folderId:S(e)}},k=(0,o.useCallback)(e=>{var t,n;const r=null==p?void 0:p.find(t=>t.id===e);if((null==r?void 0:r.isFolder)||e.startsWith("folder_")){if(!1===(null===(t=null==_?void 0:_.features)||void 0===t?void 0:t.enableRenameFolder))return void d.error({id:"FOLDER_RENAME_DISABLED_BY_CONFIG",message:c("Folder rename is disabled by config"),placement:"bottomRight",data:A(r,e)});if(!(null==C?void 0:C.renameFolder))throw new Error(c("renameFolder is not implemented in dataProviders"))}else{if(!1===(null===(n=null==_?void 0:_.features)||void 0===n?void 0:n.enableRenameFile))return void d.error({id:"FILE_RENAME_DISABLED_BY_CONFIG",message:c("File rename is disabled by config"),placement:"bottomRight",data:A(r,e)});if(!(null==C?void 0:C.renameFile))throw new Error(c("renameFile is not implemented in dataProviders"))}null==w||w(e),null==x||x(!0),r&&v&&v.setFieldsValue({newFileName:r.name})},[p,w,x,v,null===(t=null==_?void 0:_.features)||void 0===t?void 0:t.enableRenameFolder,null===(n=null==_?void 0:_.features)||void 0===n?void 0:n.enableRenameFile,null==C?void 0:C.renameFolder,null==C?void 0:C.renameFile,d,c]),E=(0,o.useCallback)(()=>{null==x||x(!1),null==w||w(null),null==v||v.resetFields()},[x,w,v]),I=(0,o.useCallback)(async()=>{var t,n,r,i,o,a,l,u,y,w,x,C;if(!m||!v)return;const S=null==p?void 0:p.find(e=>e.id===m);try{const p=await v.validateFields();if(!(null==p?void 0:p.newFileName))return;const k=(null==S?void 0:S.isFolder)||m.startsWith("folder_");if(k){if(!1===(null===(t=null==_?void 0:_.features)||void 0===t?void 0:t.enableRenameFolder))return void d.error({id:"FOLDER_RENAME_DISABLED_BY_CONFIG",message:c("Folder rename is disabled by config"),placement:"bottomRight",data:A(S,m)})}else if(!1===(null===(n=null==_?void 0:_.features)||void 0===n?void 0:n.enableRenameFile))return void d.error({id:"FILE_RENAME_DISABLED_BY_CONFIG",message:c("File rename is disabled by config"),placement:"bottomRight",data:A(S,m)});const I=await f({itemId:m,newName:p.newFileName,isFolder:k});if(!I.success){const e=Wi(null===(r=I.error)||void 0===r?void 0:r.code,c);return void d.error({id:"ITEM_RENAME_FAILED",message:null!==(o=null!=e?e:null===(i=I.error)||void 0===i?void 0:i.message)&&void 0!==o?o:c("Error renaming"),placement:"bottomRight",data:Object.assign(Object.assign({},A(S,m)),{error:I.error}),innerException:I.error})}const j=I.renamedItem;k?(d.success({id:"FOLDER_RENAME_SUCCESS",message:c(`${c("Folder renamed to")} ${null!==(a=null==j?void 0:j.name)&&void 0!==a?a:p.newFileName}`),placement:"bottomRight",data:{itemId:null!==(l=null==j?void 0:j.id)&&void 0!==l?l:m,itemName:null!==(u=null==j?void 0:j.name)&&void 0!==u?u:p.newFileName,folderId:null!==(w=null!==(y=null==j?void 0:j.parentId)&&void 0!==y?y:null==j?void 0:j.folderId)&&void 0!==w?w:null}}),await h(),(null==j?void 0:j.id)&&j.id!==m&&s.setSelectedFolder&&s.setSelectedFolder(j.id)):d.success({id:"FILE_RENAME_SUCCESS",message:`${c("File renamed to")} ${null!==(x=null==j?void 0:j.name)&&void 0!==x?x:p.newFileName}`,placement:"bottomRight",data:Object.assign(Object.assign({},A(S,m)),{itemName:null!==(C=null==j?void 0:j.name)&&void 0!==C?C:p.newFileName})}),E(),await e({folderId:g||"",page:b.current,limit:b.pageSize})}catch(e){const n=Gi(e),r=Wi(null==n?void 0:n.code,c);d.error({id:"ITEM_RENAME_FAILED",message:null!=r?r:e instanceof Error?e.message:c("Error renaming"),placement:"bottomRight",data:Object.assign(Object.assign({},A(S,m)),{error:n}),innerException:e})}},[m,v,p,s,E,e,g,c,b,null===(r=null==_?void 0:_.features)||void 0===r?void 0:r.enableRenameFolder,null===(i=null==_?void 0:_.features)||void 0===i?void 0:i.enableRenameFile,d,h,f]);return{state:{isRenamingFile:y||!1,fileToRename:m},actions:{showRenameModal:k,handleRenameCancel:E,handleRenameOk:I}}})(e),n=(e=>{var t,n;const{state:r,actions:i,options:a}=Ei(),{t:s}=En(),l=Ni(),c=la(e=>e.selectedFiles),u=la(e=>e.clearSelection),{files:d,selectedFolder:h,moveForm:f,pagination:p,currentMenuFile:g}=r,{setIsMoveModalVisible:m,setPagination:v}=i,{dataProviders:y}=a,{moveItems:b}=(()=>{const{options:e}=Ei(),{dataProviders:t}=e,{t:n}=En(),r=Ni(),i=(0,o.useCallback)(async({items:e,targetFolderId:i,getItemNameById:o,showNotifications:a=!1})=>{let s=0,l=0;const c=[];if(null==t?void 0:t.moveItems)try{const n=await t.moveItems("folders"===i?"":i,e.map(e=>e.id)),r=n.detailed;if(r){const e=r.filter(e=>e.success),t=r.filter(e=>!e.success);s+=e.length,l+=t.length,t.forEach(e=>{const t=(e=>{var t;return null!==(t=e.requestId)&&void 0!==t?t:e.id})(e),n=e.error,r=Gi(n);c.push({itemId:t,itemName:o(t),error:r})})}else if(n.success)s+=e.length;else{const t=n.error;if(t){l+=e.length;const n=Gi(t);c.push({error:n})}else l+=e.length}}catch(t){l+=e.length;const r=Gi(t);c.push({error:r})}else l+=e.length,c.push({error:{message:"Move provider is not configured"}});return a&&(s>0&&r.success({id:"FILES_MOVE_SUCCESS",message:n("Files moved"),placement:"bottomRight",data:{successCount:s,totalCount:e.length,itemIds:e.map(e=>e.id),folderId:"folders"===i?null:i}}),l>0&&r.error({id:"FILES_MOVE_ERROR",message:n("Errors occurred while moving"),placement:"bottomRight",innerException:c.length?c:void 0,data:{failCount:l,totalCount:e.length,itemIds:e.map(e=>e.id),errors:c.length?c:void 0}})),{successCount:s,failCount:l,errorDetails:c}},[t,r,n]);return{moveItems:i}})(),{refreshFolders:w,refreshFiles:x}=fa(),{getItemNameById:C,getItemNamesByIds:_,getNamesPreview:S}=ua(d),A=(0,o.useCallback)(()=>{null==m||m(!0)},[m]),k=(0,o.useCallback)(()=>{null==m||m(!1),null==f||f.resetFields()},[m,f]),E=(0,o.useCallback)(async t=>{var n,r,i,o,m,A,E,I,j,T;if(!((null==g?void 0:g.length)||c&&0!==c.size))return;const F=d.length,O=Object.assign({},p),M=Array.from((null==g?void 0:g.length)?[g]:c),P=M.length;let R=0,L=0;const N=[],D=M.map(e=>d.find(t=>t.id===e)).filter(e=>Boolean(e)),z=D.some(e=>(null==e?void 0:e.isFolder)||e.id.startsWith("folder_"));try{let c=t;if(!t){const e=await f.validateFields();c=null==e?void 0:e.targetFolder}if(!c)return void l.error({id:"FILES_MOVE_DIRECTORY_NOT_SELECTED",message:s("Select destination folder"),placement:"bottomRight"});const d="folders"===c?null:c,p=null!=d?d:h,g=!1===(null===(n=null==a?void 0:a.config)||void 0===n?void 0:n.paginationAvailable)||!1===(null===(r=null==a?void 0:a.config)||void 0===r?void 0:r.hasPagination)||!0===(null===(i=null==a?void 0:a.config)||void 0===i?void 0:i.disablePagination);if(g&&(null==y?void 0:y.getFolders))try{const e=await y.getFolders({parentId:d,deep:!1}),t=new Set((e||[]).map(e=>{var t;return null===(t=e.name)||void 0===t?void 0:t.toLowerCase()}).filter(Boolean));for(const n of D){if(!n.isFolder&&!(null===(m=(o=n.id).startsWith)||void 0===m?void 0:m.call(o,"folder_")))continue;const e=n.name||C(n.id)||"";if(e&&t.has(e.toLowerCase()))return void l.error({id:"FOLDER_ALREADY_EXISTS_MOVE",message:s("A folder with that name already exists. Please enter a different folder name."),placement:"bottomRight",data:{folderName:e,targetFolderId:c}})}}catch(e){}if(g&&(null==y?void 0:y.getFiles)&&(null==y?void 0:y.renameFile))try{let e=[];if(null==y?void 0:y.getFiles){const{files:t}=await y.getFiles({folderId:d||void 0,itemType:"all",page:1,limit:1e4});e=(t||[]).map(e=>e.name).filter(e=>!!e)}if(null==y?void 0:y.getFolders){const t=(await y.getFolders({parentId:d,deep:!1})||[]).map(e=>e.name).filter(e=>!!e);e=[...e,...t]}const t=new Set(e.map(e=>null==e?void 0:e.toLowerCase()).filter(Boolean));for(const n of D){if(n.isFolder||(null===(E=(A=n.id).startsWith)||void 0===E?void 0:E.call(A,"folder_")))continue;const e=n.name||C(n.id)||"";if(!e||!t.has(e.toLowerCase())){t.add(e.toLowerCase());continue}const r=Ui(e,Array.from(t));await y.renameFile(n.id,r),t.add(r.toLowerCase())}}catch(e){}const B=await b({items:D,targetFolderId:c,getItemNameById:C,showNotifications:!1});if(R=B.successCount,L=B.failCount,N.push(...B.errorDetails),R>0){const e=_(M),t=S(e),n=t?s("Moved",{names:t}):s("move_success_summary",{successCount:R,totalCount:P});l.success({id:"FILES_MOVE_SUCCESS",message:n,placement:"bottomRight",data:da(M,R,P,d,e)})}if(L>0){const e=_(M),t=S(e);let n;if(1===P&&N.length>0&&(null===(I=N[0].error)||void 0===I?void 0:I.code)){const e=Wi(null===(j=N[0].error)||void 0===j?void 0:j.code,s);n=null!=e?e:t?s("Failed",{names:t}):s("move_fail_summary",{failCount:L,totalCount:P})}else n=t?s("Failed",{names:t}):s("move_fail_summary",{failCount:L,totalCount:P});l.error({id:"FILES_MOVE_ERROR",message:n,placement:"bottomRight",innerException:N.length?N:void 0,data:ha(M,L,P,d,N.length?N:void 0,e)})}k(),u();let U=O.current;if(R>0&&F>0&&R>=F&&O.current>1&&(U=O.current-1),R>0&&O.total>=R){const e=Math.max(0,(null!==(T=O.total)&&void 0!==T?T:0)-R);null==v||v({current:U,pageSize:O.pageSize,total:e})}z&&await w({parentIds:void 0,selectedFolder:p}),await x({fetchFiles:e,selectedFolder:h,page:U,limit:O.pageSize})}catch(e){const n=Wi(Gi(e).code,s);l.error({id:"FILES_MOVE_ERROR",innerException:e,message:null!=n?n:s("Error moving"),placement:"bottomRight",data:ha(M,P,P,h||null,[{error:Gi(e)}],_(M))})}},[g,c,f,e,h,p,d,l,v,s,b,u,m,null===(t=null==a?void 0:a.config)||void 0===t?void 0:t.hasPagination,null===(n=null==a?void 0:a.config)||void 0===n?void 0:n.disablePagination,null==y?void 0:y.getFiles,null==y?void 0:y.renameFile,C]);return{actions:{showMoveModal:A,handleMoveCancel:k,handleMoveOk:E}}})(e),r=(e=>{var t,n;const{state:r,actions:i,options:a}=Ei(),{t:s}=En(),l=Ni(),c=la(e=>e.selectedFiles),u=la(e=>e.clearSelection),{files:d,selectedFolder:h,copyForm:f,pagination:p,currentMenuFile:g}=r,{setIsCopyModalVisible:m}=i,{dataProviders:v}=a,{copyItems:y}=(()=>{const{options:e}=Ei(),{dataProviders:t}=e,{t:n}=En(),r=Ni(),i=(0,o.useCallback)(async({items:e,targetFolderId:i,getItemNameById:o,showNotifications:a=!1})=>{let s=0,l=0;const c=[],u="folders"===i?"":i;if(null==t?void 0:t.copyItems)try{const n=await t.copyItems(u,e.map(e=>({id:e.id,newName:e.newName}))),r=n.detailed;if(r){const e=r.filter(e=>e.success),t=r.filter(e=>!e.success);s+=e.length,l+=t.length,t.forEach(e=>{const t=(e=>{var t;return null!==(t=e.requestId)&&void 0!==t?t:e.id})(e),n=e.error,r=Gi(n);c.push({itemId:t,itemName:o(t),error:r})})}else if(n.success)s+=e.length;else{const t=n.error;if(t){l+=e.length;const n=Gi(t);c.push({error:n})}else l+=e.length}}catch(t){l+=e.length;const r=Gi(t);c.push({error:r})}else if(null==t?void 0:t.copyItem)for(const n of e)try{const e=(null==n?void 0:n.isFolder)||n.id.startsWith("folder_");await t.copyItem({itemId:n.id,targetFolderId:u,isFolder:e,newName:n.newName})?s++:l++}catch(e){l++;const t=Gi(e);c.push({itemId:n.id,itemName:o(n.id),error:t})}else l+=e.length,c.push({error:{message:"Copy provider is not configured"}});return a&&(s>0&&r.success({id:"FILES_COPY_SUCCESS",message:n("Files copied"),placement:"bottomRight",data:{successCount:s,totalCount:e.length,itemIds:e.map(e=>e.id),folderId:"folders"===i?null:i}}),l>0&&r.error({id:"FILES_COPY_ERROR",message:n("Errors occurred while copying"),placement:"bottomRight",innerException:c.length?c:void 0,data:{failCount:l,totalCount:e.length,itemIds:e.map(e=>e.id),errors:c.length?c:void 0}})),{successCount:s,failCount:l,errorDetails:c}},[t,r,n]);return{copyItems:i}})(),{refreshFolders:b,refreshFiles:w}=fa(),{getItemNameById:x,getItemNamesByIds:C,getNamesPreview:_}=ua(d),S=(0,o.useCallback)(()=>{null==m||m(!0)},[m]),A=(0,o.useCallback)(()=>{null==m||m(!1),null==f||f.resetFields()},[m,f]),k=(0,o.useCallback)(async t=>{var n,r,i,o,m,S,k;if(!((null==g?void 0:g.length)||c&&0!==c.size))return;const E=Array.from((null==g?void 0:g.length)?[g]:c),I=E.length;let j=0,T=0;const F=[],O=E.map(e=>d.find(t=>t.id===e)).filter(e=>Boolean(e)),M=O.some(e=>(null==e?void 0:e.isFolder)||e.id.startsWith("folder_"));try{let c=t;if(!t){const e=await f.validateFields();c=null==e?void 0:e.targetFolder}if(!c)return void l.error({id:"FILES_COPY_DIRECTORY_NOT_SELECTED",message:s("Select destination folder"),placement:"bottomRight"});const d="folders"===c?null:c,g=null!=d?d:h;let P=O.map(e=>({id:e.id,isFolder:(null==e?void 0:e.isFolder)||e.id.startsWith("folder_")}));const R=!1===(null===(n=null==a?void 0:a.config)||void 0===n?void 0:n.paginationAvailable)||!1===(null===(r=null==a?void 0:a.config)||void 0===r?void 0:r.hasPagination)||!0===(null===(i=null==a?void 0:a.config)||void 0===i?void 0:i.disablePagination);if(R&&(null==v?void 0:v.getFolders))try{const e=await v.getFolders({parentId:d,deep:!1}),t=new Set((e||[]).map(e=>{var t;return null===(t=e.name)||void 0===t?void 0:t.toLowerCase()}).filter(Boolean));for(const n of O){if(!n.isFolder&&!(null===(m=(o=n.id).startsWith)||void 0===m?void 0:m.call(o,"folder_")))continue;const e=n.name||x(n.id)||"";if(e&&t.has(e.toLowerCase()))return void l.error({id:"FOLDER_ALREADY_EXISTS_COPY",message:s("A folder with that name already exists. Please enter a different folder name."),placement:"bottomRight",data:{folderName:e,targetFolderId:c}})}}catch(e){}if(R&&(null==v?void 0:v.getFiles))try{let e=[];const{files:t}=await v.getFiles({folderId:d||void 0,itemType:"all",page:1,limit:1e4});if(e=(t||[]).map(e=>e.name).filter(e=>!!e),null==v?void 0:v.getFolders){const t=(await v.getFolders({parentId:d,deep:!1})||[]).map(e=>e.name).filter(e=>!!e);e=[...e,...t]}const n=[...e];P=O.map(e=>{var t,r;if(e.isFolder||(null===(r=(t=e.id).startsWith)||void 0===r?void 0:r.call(t,"folder_")))return{id:e.id,isFolder:!0};const i=O.find(t=>t.id===e.id),o=(null==i?void 0:i.name)||x(e.id)||"",a=Ui(o,n);return n.push(a),{id:e.id,isFolder:!1,newName:a!==o?a:void 0}})}catch(e){}else P=O.map(e=>({id:e.id,isFolder:(null==e?void 0:e.isFolder)||e.id.startsWith("folder_")}));const L=await y({items:P,targetFolderId:c,getItemNameById:x,showNotifications:!1});if(j=L.successCount,T=L.failCount,F.push(...L.errorDetails),j>0){const e=C(E),t=_(e),n=t?s("Copied",{names:t}):s("copy_success_summary",{successCount:j,totalCount:I});l.success({id:"FILES_COPY_SUCCESS",message:n,placement:"bottomRight",data:da(E,j,I,d,e)})}if(T>0){const e=C(E),t=_(e);let n;if(1===I&&F.length>0&&(null===(S=F[0].error)||void 0===S?void 0:S.code)){const e=Wi(null===(k=F[0].error)||void 0===k?void 0:k.code,s);n=null!=e?e:t?s("Failed",{names:t}):s("copy_fail_summary",{failCount:T,totalCount:I})}else n=t?s("Failed",{names:t}):s("copy_fail_summary",{failCount:T,totalCount:I});l.error({id:"FILES_COPY_ERROR",message:n,placement:"bottomRight",innerException:F.length?F:void 0,data:ha(E,T,I,d,F.length?F:void 0,e)})}A(),u(),M&&await b({parentIds:void 0,selectedFolder:g}),await w({fetchFiles:e,selectedFolder:h,page:p.current,limit:p.pageSize})}catch(e){const n=Wi(Gi(e).code,s);l.error({id:"FILES_COPY_ERROR",message:null!=n?n:s("Error copying"),innerException:e,placement:"bottomRight",data:ha(E,I,I,h||null,[{error:Gi(e)}],C(E))})}},[g,c,f,e,h,p,d,l,s,y,u,m,null===(t=null==a?void 0:a.config)||void 0===t?void 0:t.hasPagination,null===(n=null==a?void 0:a.config)||void 0===n?void 0:n.disablePagination,null==v?void 0:v.getFiles,x]);return{actions:{showCopyModal:S,handleCopyCancel:A,handleCopyOk:k}}})(e),i=(e=>{const{state:t,actions:n,options:r}=Ei(),{t:i}=En(),a=Ni(),s=la(e=>e.selectedFiles),l=la(e=>e.clearSelection),{files:c,selectedFolder:u,pagination:d,currentMenuFile:h}=t,{setIsDeleteConfirmVisible:f,setUndoDeletion:p,setPagination:g}=n,{config:m}=r,{deleteItems:v}=lo(),{refreshFolders:y,refreshFiles:b}=fa(),{getItemNameById:w,getItemNamesByIds:x,getNamesPreview:C}=ua(c),_=(0,o.useCallback)(()=>{null==f||f(!0)},[f]),S=(0,o.useCallback)(()=>{null==f||f(!1)},[f]),A=(0,o.useCallback)(async()=>{var t,n,r;if(!((null==h?void 0:h.length)||s&&0!==s.size))return void(null==f||f(!1));const o=c.length,_=Object.assign({},d),S=Array.from(h?[h]:s),A=S.map(e=>c.find(t=>t.id===e)).filter(e=>Boolean(e)),k=new Set;A.forEach(e=>{(null==e?void 0:e.isFolder)&&k.add((e=>{var t,n;if(!e)return null;const r=e;return null!==(n=null!==(t=r.folderId)&&void 0!==t?t:r.parentId)&&void 0!==n?n:null})(e))});let E=0,I=0;const j=[];try{const s=await v({items:A,selectedFolder:u,getItemNameById:w,showNotifications:!1});E=s.successCount,I=s.failCount,j.push(...s.errorDetails);const c=(null==m?void 0:m.enableTrashFolder)&&"Trash"===u;if(E>0&&(null==m?void 0:m.enableTrashFolder)&&!c&&(null==p||p({itemIds:S,sourceFolderId:u||"folders"})),E>0){const e=S.length;(null==m?void 0:m.enableTrashFolder)&&!c?await a.success({id:"FILES_DELETE_SUCCESS",message:i("moved_to_trash",{count:E}),placement:"bottomRight",data:{successCount:E,totalCount:e,itemIds:S,folderId:u||null}}):await a.success({id:"FILES_DELETE_SUCCESS",message:i("Files deleted"),placement:"bottomRight",data:{successCount:E,totalCount:e,itemIds:S,folderId:u||null}})}if(I>0){const e=x(S),r=C(e),o=S.length,s=1===o&&j.length>0&&(null===(t=j[0].error)||void 0===t?void 0:t.code),l=(null==m?void 0:m.enableTrashFolder)&&!c,u=i(l?"\u041f\u0440\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0438 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0438":"\u041f\u0440\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0438 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0438"),d=s?Wi(null===(n=j[0].error)||void 0===n?void 0:n.code,i):void 0,h=null!=d?d:r?i("Failed",{names:r}):u;a.error({id:"FILES_DELETE_ERROR",message:h,placement:"bottomRight",innerException:j.length?j:void 0,data:{failCount:I,isTrashMove:l,totalCount:o,itemNames:e,errors:j.length?j:void 0}})}l(),null==f||f(!1),await y({parentIds:Array.from(k),selectedFolder:u});let d=_.current;if(E>0&&o>0&&E>=o&&_.current>1&&(d=_.current-1),E>0&&_.total>=E){const e=Math.max(0,(null!==(r=_.total)&&void 0!==r?r:0)-E);null==g||g({current:d,pageSize:_.pageSize,total:e})}await b({fetchFiles:e,selectedFolder:u,page:d,limit:_.pageSize})}catch(e){a.error({id:"FILES_DELETE_ERROR",message:i("Error deleting"),placement:"bottomRight",innerException:e,data:{failCount:I,totalCount:A.length}})}},[h,s,f,e,u,d,p,g,c,i,a,v,l,null==m?void 0:m.enableTrashFolder]);return{actions:{showDeleteConfirm:_,handleDeleteConfirmCancel:S,handleDeleteConfirmOk:A}}})(e);return{state:t.state,actions:Object.assign(Object.assign(Object.assign(Object.assign({},t.actions),n.actions),r.actions),i.actions)}},ga="filemanager_sidebar_width",ma=({onSearch:e,placeholder:t,className:n})=>{const{t:r}=En(),[a,s]=(0,o.useState)(""),l=(0,o.useRef)(null),{options:c}=Ei(),{config:u}=c,d=t||r("Search files...");return(0,o.useEffect)(()=>(l.current=Pi.debounce(t=>{e(t)},500),()=>{var e;null===(e=l.current)||void 0===e||e.cancel()}),[e]),(0,i.jsx)(h.A,{value:a,onChange:e=>{var t;const n=e.target.value;s(n),null===(t=l.current)||void 0===t||t.call(l,n)},placeholder:d,prefix:(0,i.jsx)(Wr,{size:16,strokeWidth:null==u?void 0:u.iconStrokeWidth}),className:n,allowClear:!0,onClear:()=>{s(""),e("")}})};var va={contentLayout:"contentLayout",headerContainer:"headerContainer",actionsContainer:"actionsContainer",filesContainer:"filesContainer",emptyStateWrapper:"emptyStateWrapper",paginationContainer:"paginationContainer",uploadIcon:"uploadIcon",tableContainer:"tableContainer",tableLoadingWrapper:"tableLoadingWrapper",imagePreview:"imagePreview",fileManagerTableFolder:"fileManagerTableFolder",fileManagerTableFolderInner:"fileManagerTableFolderInner",sortSelect:"sortSelect",fileNameCol:"fileNameCol",fileItemCount:"fileItemCount",fileSize:"fileSize",fileDate:"fileDate",tableMenu:"tableMenu",tableImagePreview:"tableImagePreview",tableFolderIcon:"tableFolderIcon",buttonDeselected:"buttonDeselected",buttonSelectAll:"buttonSelectAll",gridRow:"gridRow",gridCard:"gridCard",selectedRow:"selectedRow",gridCardSelected:"gridCardSelected",gridCheckbox:"gridCheckbox",gridCardContent:"gridCardContent",gridPreviewContainer:"gridPreviewContainer",gridPreviewContainerFolder:"gridPreviewContainerFolder",gridFolderIcon:"gridFolderIcon",gridFolderIconImage:"gridFolderIconImage",gridFileName:"gridFileName",gridFileInfo:"gridFileInfo",gridFileMenu:"gridFileMenu",gridFileMenuButton:"gridFileMenuButton",actionsBox:"actionsBox",uploadContainer:"uploadContainer",uploadArea:"uploadArea",blockText:"blockText",textTitle:"textTitle",textDescription:"textDescription",buttons:"buttons",btnAi:"btnAi",btnPhoto:"btnPhoto",dragOverlay:"dragOverlay",dragOverlayInner:"dragOverlayInner",dragCaptureLayer:"dragCaptureLayer",dragOverlayGlobal:"dragOverlayGlobal",noFiles:"noFiles",noFilesIcon:"noFilesIcon",textTitle_trash:"textTitle_trash",textDescription_trash:"textDescription_trash"};const{Text:ya}=f.A,{Option:ba}=p.A,wa=o.memo(({files:e,filesById:t,currentSortOption:n,isSmallScreen:r,iconStrokeWidth:a,multiSelectEnabled:s=!0,features:l,viewMode:c,setViewMode:u,handleSearch:d,handleSortOptionChange:h,onClearSelection:f,onRename:b,onDelete:w,onCopy:x,onMove:C,onEdit:_,t:S})=>{const A=la(e=>e.selectedFiles),k=la(e=>e.selectedFiles.size),E=la(e=>e.selectAllVisible),I=e.length>0&&k===e.length,j=(0,o.useMemo)(()=>Array.from(A)[0],[A]),T=(0,o.useMemo)(()=>j?t.get(j):void 0,[t,j]),F=(null==T?void 0:T.isFolder)?!1!==(null==l?void 0:l.enableRenameFolder):!1!==(null==l?void 0:l.enableRenameFile),O=(0,o.useMemo)(()=>Array.from(A).every(e=>{const n=t.get(e);return!!n&&(n.isFolder?!1!==(null==l?void 0:l.enableMoveFolder):!1!==(null==l?void 0:l.enableMoveItem))}),[l,t,A]),M=(0,o.useMemo)(()=>Array.from(A).every(e=>{const n=t.get(e);return!!n&&(n.isFolder?!1!==(null==l?void 0:l.enableCopyFolder):!1!==(null==l?void 0:l.enableCopyItem))}),[l,t,A]),P=(0,o.useMemo)(()=>1===k&&function(e){var t,n,r;if(!e||e.isFolder)return!1;const i=e.extension||(e.name&&e.name.includes(".")?e.name.split(".").pop():void 0)||((null===(t=e.type)||void 0===t?void 0:t.startsWith("image/"))?null===(r=null===(n=e.type.split("/")[1])||void 0===n?void 0:n.split(";")[0])||void 0===r?void 0:r.trim():void 0);return Boolean(i&&Yt.includes(i.toLowerCase()))}(T),[k,T]);return(0,i.jsxs)("div",k>0?{className:`header-container ${va.headerContainer}`,children:[(0,i.jsxs)(ya,{type:"secondary",className:"selected-text",children:[(0,i.jsxs)("div",{children:[k," ",S("selected")]}),s&&(0,i.jsx)(g.A,{title:r?S("Select all"):null,children:(0,i.jsx)(m.Ay,{className:va.buttonSelectAll,onClick:E,disabled:I||0===e.length,children:S("Select all")})}),(0,i.jsx)(g.A,{title:r?S("Deselected"):null,children:(0,i.jsx)(m.Ay,{className:va.buttonDeselected,icon:(0,i.jsx)(Hr,{size:16,strokeWidth:a}),onClick:f,children:S("Deselected")})})]}),(0,i.jsxs)(v.A,{children:[P&&!1!==(null==l?void 0:l.enableEdit)&&(0,i.jsx)(g.A,{title:r?S("Edit"):null,children:(0,i.jsx)(m.Ay,{icon:(0,i.jsx)(Tr,{size:16,strokeWidth:a}),onClick:()=>_(T),disabled:!P,children:S("Edit")})}),O&&(0,i.jsx)(g.A,{title:r?S("Move to"):null,children:(0,i.jsx)(m.Ay,{icon:(0,i.jsx)(Or,{size:16,strokeWidth:a}),onClick:C,children:S("Move to")})}),M&&(0,i.jsx)(g.A,{title:r?S("Copy"):null,children:(0,i.jsx)(m.Ay,{icon:(0,i.jsx)(jr,{size:16,strokeWidth:a}),onClick:x,children:S("Copy")})}),1===k&&F&&(0,i.jsx)(g.A,{title:r?S("Rename"):null,children:(0,i.jsx)(m.Ay,{icon:(0,i.jsx)(Gr,{size:16,strokeWidth:a}),onClick:()=>b(),disabled:1!==k||!F,children:S("Rename")})}),!1!==(null==l?void 0:l.enableDelete)&&(0,i.jsx)(g.A,{title:r?S("Delete"):null,children:(0,i.jsx)(m.Ay,{danger:!0,icon:(0,i.jsx)(Yr,{size:16,strokeWidth:a}),onClick:e=>{e.stopPropagation(),e.preventDefault(),w()},children:S("Delete")})})]})]}:{className:va.headerContainer,children:[(0,i.jsx)("div",{className:"search-container",children:(0,i.jsx)(ma,{placeholder:S("Search file or folder"),onSearch:d,className:va.searchInput})}),(0,i.jsxs)("div",{className:va.actionsBox,children:[(0,i.jsx)("div",{className:"sort-container",children:(0,i.jsxs)(p.A,{value:n,onChange:h,className:va.sortSelect,popupMatchSelectWidth:!1,suffixIcon:(0,i.jsx)(Er,{size:16,strokeWidth:a}),children:[(0,i.jsx)(ba,{value:"date-desc",children:S("Newest first")}),(0,i.jsx)(ba,{value:"date-asc",children:S("Oldest first")}),(0,i.jsx)(ba,{value:"size-desc",children:S("Largest first")}),(0,i.jsx)(ba,{value:"size-asc",children:S("Smallest first")}),(0,i.jsx)(ba,{value:"name-asc",children:S("A-Z")}),(0,i.jsx)(ba,{value:"name-desc",children:S("Z-A")}),(0,i.jsx)(ba,{value:"type-asc",children:S("By type")})]})}),(0,i.jsx)("div",{className:va.actionsContainer,children:(0,i.jsx)(y.A,{options:[{value:"grid",icon:(0,i.jsx)(Lr,{size:16,strokeWidth:a})},{value:"table",icon:(0,i.jsx)(zr,{size:20,strokeWidth:a})}],value:c,onChange:e=>u(e)})})]})]})});wa.displayName="FileContentHeader";const xa=o.memo(({fileId:e,style:t})=>{const n=la(t=>t.selectedFiles.has(e)),r=la(e=>e.toggleFileSelection);return(0,i.jsx)(b.A,{checked:n,style:t,onClick:e=>{e.stopPropagation()},onChange:t=>{const n=t.nativeEvent;r(e,{metaKey:n.metaKey,ctrlKey:n.ctrlKey,shiftKey:n.shiftKey,forceToggle:!0})}})});function Ca(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}xa.displayName="FileSelectionCheckbox","function"==typeof SuppressedError&&SuppressedError;const _a=o.memo(e=>{var{className:t}=e,n=Ca(e,["className"]);const r=n["data-row-key"],o=null==r?"":String(r),a=[t,la(e=>!!o&&e.selectedFiles.has(o))?va.selectedRow:""].filter(Boolean).join(" ");return(0,i.jsx)("tr",Object.assign({},n,{className:a}))});_a.displayName="SelectableTableRow";const Sa=o.memo(({item:e,variant:t="table",t:n,iconStrokeWidth:r,setCurrentMenuFile:a,showMoveModal:s,showCopyModal:l,showRenameModal:c,showDeleteConfirm:u,onEdit:d})=>{const[h,f]=(0,o.useState)(!1),p=(0,o.useMemo)(()=>{if(!h)return[];const t=[];return e.canEdit&&t.push({key:"edit",label:n("Edit"),icon:(0,i.jsx)(Tr,{size:16,strokeWidth:r})}),e.canMove&&t.push({key:"move",label:n("Move to"),icon:(0,i.jsx)(Or,{size:16,strokeWidth:r})}),e.canCopy&&t.push({key:"copy",label:n("Copy"),icon:(0,i.jsx)(jr,{size:16,strokeWidth:r})}),e.canRename&&t.push({key:"rename",label:n("Rename"),icon:(0,i.jsx)(Gr,{size:16,strokeWidth:r})}),e.canDelete&&t.push({key:"delete",label:n("Delete"),icon:(0,i.jsx)(Yr,{size:16,strokeWidth:r}),style:{color:"#ff4d4f"}}),t},[r,h,e.canCopy,e.canDelete,e.canEdit,e.canMove,e.canRename,n]),g=(0,o.useCallback)(({key:t})=>{switch(e.id&&(null==a||a(e.id)),t){case"edit":d(e.file);break;case"move":s();break;case"copy":l();break;case"rename":c(e.id);break;case"delete":null==u||u();break;default:null==a||a("")}},[e,d,a,l,u,s,c]),v=(0,o.useMemo)(()=>({items:p,onClick:g}),[g,p]);return(0,i.jsx)(w.A,{arrow:!0,placement:"bottom",menu:v,trigger:["hover"],onOpenChange:f,children:"grid"===t?(0,i.jsx)(m.Ay,{type:"default",className:`${va.gridFileMenuButton} gridFileMenuButton`,onClick:e=>{e.stopPropagation(),e.preventDefault()},children:(0,i.jsx)(Fr,{size:16,strokeWidth:r})}):(0,i.jsx)("span",{className:`${va.tableMenu} tableMenuButton`,onClick:e=>{e.stopPropagation(),e.preventDefault()},children:(0,i.jsx)(Fr,{size:16,strokeWidth:r})})})});Sa.displayName="FileItemActionsDropdown";const Aa=({thumbnailSrc:e,previewSrc:t,alt:n,className:r,width:a,height:s,preview:l=!1})=>{const c=n,[u,d]=(0,o.useState)(e),[h,f]=(0,o.useState)(t),p=o.useRef(!1),g=o.useRef(!1),m=(0,o.useCallback)(e=>{const t=e.split(",")[1];return!!(t&&t.length>20)},[]),v=(0,o.useCallback)(e=>{var t;if(e&&e!==Kt)return e.startsWith("data:image/")?m(e)?e:void 0:e.startsWith("blob:")?e:e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?null!==(t=(e=>{if(e&&"string"==typeof e){if(e.startsWith("data:")||e.startsWith("blob:"))return e;try{if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")){const t=new URL(e.startsWith("/")?`https://x${e}`:e),n=e.startsWith("/")?"":`${t.protocol}//${t.host}`,r=t.pathname.split("/").map(e=>{if(!e)return"";try{return encodeURIComponent(decodeURIComponent(e))}catch(t){return encodeURIComponent(e)}}).join("/");return e.startsWith("/")?r+(t.search||"")+(t.hash||""):`${n}${r}${t.search}${t.hash}`}}catch(e){}return e}})(e))&&void 0!==t?t:e:void 0},[m]);(0,o.useEffect)(()=>{p.current=!1,g.current=!1;const n=v(e),r=v(t),i=null!=r?r:n;d(null!=n?n:r),f(i)},[e,t,v]);const y=(0,o.useCallback)((e,t)=>e&&e.toLowerCase().endsWith(".svg")||t&&(t.includes(".svg")||t.includes("image/svg+xml")),[]),b=(0,o.useCallback)(()=>{u!==Kt&&(p.current||(p.current=!0,y(c,u)),d(Kt))},[u,c,y]),w=(0,o.useCallback)(()=>{if(h&&h!==Kt&&!g.current)return h;const t=v(e);return t&&!p.current?t:void 0},[h,e,v]),C=u===Kt?qt:u,_=w();return C?(0,i.jsx)(x.A,{className:r,src:C,alt:n,width:a,height:s,preview:!(!l||!_)&&{src:_,toolbarRender:()=>null,destroyOnHidden:!0,mask:(0,i.jsx)(te.A,{style:{fontSize:"20px"}})},onError:b,fallback:qt}):null},ka=o.memo(({item:e,variant:t="table",FolderIcon:n,getFileData:r,className:o,width:a,height:s})=>e.isFolder?(0,i.jsx)("div","grid"===t?{className:va.gridFolderIcon,children:(0,i.jsx)(n,{className:va.gridFolderIconImage})}:{className:va.fileManagerTableFolder,children:(0,i.jsx)("div",{className:va.fileManagerTableFolderInner,children:(0,i.jsx)(n,{className:va.tableFolderIcon,style:{width:null!=a?a:40,height:null!=s?s:40}})})}):e.thumbnailSrc||e.previewSrc?(0,i.jsx)(Aa,{className:o,thumbnailSrc:e.thumbnailSrc,previewSrc:e.previewSrc,alt:e.file.name,width:a,height:s,preview:!0,file:e.file,getFileData:r}):null);ka.displayName="FileItemPreview";const Ea=o.memo(({item:e,t:t,iconStrokeWidth:n,FolderIcon:r,handleSingleClick:o,handleDoubleClick:a,handleItemClick:s,setCurrentMenuFile:l,showMoveModal:c,showCopyModal:u,showRenameModal:d,showDeleteConfirm:h,onEdit:f,onEditorOk:p,getFileData:g,showSelectionCheckbox:m=!0})=>{const v=la(t=>t.selectedFiles.has(e.id)),y=la(e=>e.toggleFileSelection);return(0,i.jsx)(C.A,{className:va.gridCard_col,style:{padding:0},children:(0,i.jsxs)(_.A,{hoverable:!0,cover:(0,i.jsx)("div",{className:e.isFolder?va.gridPreviewContainerFolder:va.gridPreviewContainer,onClick:t=>{t.stopPropagation(),e.isFolder&&o(()=>{y(e.id,{metaKey:t.metaKey,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey})})},onDoubleClick:t=>{t.stopPropagation(),a(()=>{e.isFolder&&s(e.file)})},children:(0,i.jsx)(ka,{item:e,variant:"grid",FolderIcon:r,getFileData:g,className:va.gridImagePreview})}),className:`${va.gridCard} ${v?va.gridCardSelected:""}`,onClick:t=>{t.stopPropagation(),t.preventDefault();const n=t.target;n.closest(".gridFileMenuButton")||n.closest(".ant-dropdown-menu")||o(()=>y(e.id,{metaKey:t.metaKey,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey}))},onDoubleClick:t=>{t.stopPropagation(),a(()=>{e.isFolder&&s(e.file)})},children:[(0,i.jsxs)("div",{className:va.gridCardContent,onDoubleClick:t=>{t.stopPropagation(),t.preventDefault(),a(()=>{e.isFolder?s(e.file):p&&p(e.file)})},onClick:t=>{t.stopPropagation(),t.preventDefault();const n=t.target;n.closest(".gridFileMenuButton")||n.closest(".ant-dropdown-menu")||o(()=>y(e.id,{metaKey:t.metaKey,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey}))},children:[(0,i.jsx)("div",{className:va.gridFileName,children:e.nameText||t("Untitled")}),(0,i.jsx)("div",{className:va.gridFileInfo,children:e.gridInfoText})]}),(0,i.jsx)("div",{className:va.gridFileMenu,children:(0,i.jsx)(Sa,{item:e,variant:"grid",t:t,iconStrokeWidth:n,setCurrentMenuFile:l,showMoveModal:c,showCopyModal:u,showRenameModal:d,showDeleteConfirm:h,onEdit:f})}),m?(0,i.jsx)("div",{onClick:e=>{e.stopPropagation()},className:va.gridCheckbox,children:(0,i.jsx)(xa,{fileId:e.id,style:{height:20}})}):null]})})});Ea.displayName="FileGridItem";const Ia=o.memo(({rows:e,topOffset:t=0,bottomOffset:n=0,t:r,iconStrokeWidth:o,FolderIcon:a,handleSingleClick:s,handleDoubleClick:l,handleItemClick:c,setCurrentMenuFile:u,showMoveModal:d,showCopyModal:h,showRenameModal:f,showDeleteConfirm:p,onEdit:g,onEditorOk:m,getFileData:v,showSelectionCheckbox:y=!0})=>(0,i.jsx)(i.Fragment,{children:(0,i.jsx)("div",{style:{paddingTop:t,paddingBottom:n},children:(0,i.jsx)(S.A,{gutter:[16,16],className:va.gridRow,style:{gap:20,padding:"0 24px 24px",margin:0},children:e.map(e=>(0,i.jsx)(Ea,{item:e,handleSingleClick:s,handleDoubleClick:l,handleItemClick:c,iconStrokeWidth:o,t:r,FolderIcon:a,setCurrentMenuFile:u,showMoveModal:d,showCopyModal:h,showRenameModal:f,showDeleteConfirm:p,onEdit:g,onEditorOk:m,getFileData:v,showSelectionCheckbox:y},e.id))})})}));Ia.displayName="FileGridView";const ja=o.memo(({rows:e,columns:t,loading:n,topOffset:r=0,bottomOffset:a=0,onRow:l,components:u})=>{const d=(0,o.useMemo)(()=>(0,i.jsx)("div",{style:{paddingTop:r,paddingBottom:a},children:(0,i.jsx)(c.Ay,{renderEmpty:()=>(0,i.jsx)(A.A,{image:(0,i.jsx)(i.Fragment,{}),description:""}),children:(0,i.jsx)(k.A,{dataSource:e,columns:t,rowKey:"id",pagination:!1,tableLayout:"fixed",onRow:l,components:u,showHeader:!1})})}),[a,t,u,l,e,r]);return(0,i.jsx)(s.A,{spinning:n,className:va.tableLoadingWrapper,children:d})});ja.displayName="FileTableView";const Ta=o.memo(({item:e})=>e.dateText?(0,i.jsx)(g.A,{title:e.dateText,placement:"bottom",className:va.fileDate,children:e.dateText}):null);Ta.displayName="FileItemDate";const Fa=o.memo(({item:e})=>(0,i.jsxs)("div",{className:va.fileName,children:[e.nameText,e.isFolder&&(0,i.jsx)("div",{className:va.fileItemCount,children:e.folderItemsText})]}));Fa.displayName="FileItemName";const Oa="filemanager_view_mode";class Ma{constructor(){this.rowsById=new Map}reconcile(e,t,n){const r=new Map,i=[];for(const o of e){const e=t.getId(o),a=t.buildSignature(o,n),s=this.rowsById.get(e);if(s&&s.signature===a){r.set(e,s),i.push(s);continue}const l=t.buildRowModel(o,n,{id:e,signature:a});r.set(e,l),i.push(l)}return this.rowsById=r,i}}class Pa{createRenderWindow(e,t){var n,r,i,o,a,s,l,c,u,d,h;if("windowed"!==(null!==(n=null==t?void 0:t.renderStrategy)&&void 0!==n?n:"full"))return{rows:e,startIndex:0,endIndex:e.length>0?e.length-1:-1,topOffset:0,bottomOffset:0,totalCount:e.length};const f=Math.max(0,null!==(i=null===(r=null==t?void 0:t.windowed)||void 0===r?void 0:r.startIndex)&&void 0!==i?i:0),p=null!==(a=null===(o=null==t?void 0:t.windowed)||void 0===o?void 0:o.endIndex)&&void 0!==a?a:e.length-1,g=Math.max(0,null!==(l=null===(s=null==t?void 0:t.windowed)||void 0===s?void 0:s.overscan)&&void 0!==l?l:0),m=Math.max(1,null!==(u=null===(c=null==t?void 0:t.windowed)||void 0===c?void 0:c.estimatedItemSize)&&void 0!==u?u:1),v=Math.max(1,null!==(h=null===(d=null==t?void 0:t.windowed)||void 0===d?void 0:d.itemsPerLane)&&void 0!==h?h:1),y=Math.ceil(e.length/v),b=Math.min(e.length-1,p),w=Math.floor(f/v),x=Math.floor(Math.max(f,b)/v),C=Math.max(0,w-g),_=Math.min(y-1,x+g),S=C*v,A=Math.min(e.length-1,(_+1)*v-1),k=Math.max(0,y-_-1);return{rows:e.slice(S,A+1),startIndex:S,endIndex:A,topOffset:C*m,bottomOffset:k*m,totalCount:e.length}}}function Ra(e){var t,n,r;const i=e.extension||(e.name&&e.name.includes(".")?e.name.split(".").pop():void 0)||((null===(t=e.type)||void 0===t?void 0:t.startsWith("image/"))?null===(r=null===(n=e.type.split("/")[1])||void 0===n?void 0:n.split(";")[0])||void 0===r?void 0:r.trim():void 0);return Boolean(i&&Yt.includes(i.toLowerCase()))}function La(e,t){if(!e)return"";const n=new Date(e);if(Number.isNaN(n.getTime()))return"";const r=[t("months.january"),t("months.february"),t("months.march"),t("months.april"),t("months.may"),t("months.june"),t("months.july"),t("months.august"),t("months.september"),t("months.october"),t("months.november"),t("months.december")];return t("Added",{date:`${n.getDate()} ${r[n.getMonth()]} ${n.getFullYear()}`})}const Na={getId:e=>e.id,buildSignature:(e,t)=>function(e,t){var n,r,i,o,a,s,l,c,u,d;const h=Boolean(e.isFolder),f=h&&null!==(r=null!==(n=e.childCount)&&void 0!==n?n:t.folderFileCounts[e.id])&&void 0!==r?r:0,p=La(e.date,t.t),g=!h&&e.size?String(e.size):"",m=[!1!==(null===(i=t.features)||void 0===i?void 0:i.enableEdit),!1!==(null===(o=t.features)||void 0===o?void 0:o.enableMoveFolder),!1!==(null===(a=t.features)||void 0===a?void 0:a.enableMoveItem),!1!==(null===(s=t.features)||void 0===s?void 0:s.enableCopyFolder),!1!==(null===(l=t.features)||void 0===l?void 0:l.enableCopyItem),!1!==(null===(c=t.features)||void 0===c?void 0:c.enableRenameFolder),!1!==(null===(u=t.features)||void 0===u?void 0:u.enableRenameFile),!1!==(null===(d=t.features)||void 0===d?void 0:d.enableDelete)].join("|");return[e.id,e.name,e.folderId,e.type||"",e.extension||"",e.thumbnailUrl||e.thumbnail||"",e.thumbnailUrl||e.thumbnail||"",e.dimensions||"",g,p,h?"1":"0",String(f),m].join("::")}(e,t),buildRowModel:(e,t,n)=>{var r,i,o,a,s,l,c,u,d,h;const f=Boolean(e.isFolder),p=f&&null!==(i=null!==(r=e.childCount)&&void 0!==r?r:t.folderFileCounts[e.id])&&void 0!==i?i:0,g=1===p?t.t("item"):t.t("items"),m=f?`${p} ${g}`:"",v=e.dimensions||"",y=!f&&e.size?Bi(e.size):"",b=f?t.t("Folder"):function(e){var t,n,r;return e.extension||(null===(t=e.name.split(".").pop())||void 0===t?void 0:t.toLowerCase())||(e.url?null===(r=null===(n=e.url.split("?")[0].split("/").pop())||void 0===n?void 0:n.split(".").pop())||void 0===r?void 0:r.toLowerCase():"")||""}(e),w=La(e.date,t.t),x=f?m:[v,y,b].filter(Boolean).join(" \u2022 ");return{id:n.id,signature:n.signature,item:e,file:e,isFolder:f,nameText:e.name||t.t("No name"),folderItemsText:m,dimensionsText:v,sizeText:y,typeText:b,dateText:w,gridInfoText:x,thumbnailSrc:e.thumbnailUrl||e.thumbnail,previewSrc:e.thumbnailUrl||e.thumbnail,canEdit:!f&&!1!==(null===(o=t.features)||void 0===o?void 0:o.enableEdit)&&Ra(e),canMove:f?!1!==(null===(a=t.features)||void 0===a?void 0:a.enableMoveFolder):!1!==(null===(s=t.features)||void 0===s?void 0:s.enableMoveItem),canCopy:f?!1!==(null===(l=t.features)||void 0===l?void 0:l.enableCopyFolder):!1!==(null===(c=t.features)||void 0===c?void 0:c.enableCopyItem),canRename:f?!1!==(null===(u=t.features)||void 0===u?void 0:u.enableRenameFolder):!1!==(null===(d=t.features)||void 0===d?void 0:d.enableRenameFile),canDelete:!1!==(null===(h=t.features)||void 0===h?void 0:h.enableDelete)}}};function Da({files:e,folderFileCounts:t,features:n,t:r,viewMode:i}){const a=(0,o.useMemo)(()=>({folderFileCounts:t,features:n,t:r}),[n,t,r]),[s,l]=(0,o.useState)(()=>Math.max(1,Math.floor(5))),c=(0,o.useMemo)(()=>{const t=e.length>150;return"table"===i?{enabled:t,estimatedItemSize:56,overscan:10,itemsPerLane:1,fallbackViewportHeight:800}:{enabled:t,estimatedItemSize:320,overscan:2,itemsPerLane:s,fallbackViewportHeight:800}},[e.length,s,i]),{engineOptions:u,handleViewportChange:d}=function({totalCount:e,plan:t}){const[n,r]=(0,o.useState)(null),i=(0,o.useMemo)(()=>{var r,i;if(!t.enabled)return{renderStrategy:"full"};const o=function(e,t){var n;return Math.max(1,null!==(n=null==e?void 0:e.viewportHeight)&&void 0!==n?n:t)}(n,null!==(r=t.fallbackViewportHeight)&&void 0!==r?r:800),a=Math.max(1,Math.ceil(o/t.estimatedItemSize)),s=Math.max(1,Math.ceil(e/t.itemsPerLane)),l=Math.min(s-1,Math.max(0,Math.floor((null!==(i=null==n?void 0:n.scrollTop)&&void 0!==i?i:0)/t.estimatedItemSize))),c=l+a-1;return{renderStrategy:"windowed",windowed:{startIndex:l*t.itemsPerLane,endIndex:Math.min(e-1,(c+1)*t.itemsPerLane-1),overscan:t.overscan,estimatedItemSize:t.estimatedItemSize,itemsPerLane:t.itemsPerLane}}},[t.enabled,t.estimatedItemSize,t.fallbackViewportHeight,t.itemsPerLane,t.overscan,e,n]);return{engineOptions:i,handleViewportChange:(0,o.useCallback)(e=>{r(t=>(null==t?void 0:t.viewportHeight)===e.viewportHeight&&(null==t?void 0:t.viewportWidth)===e.viewportWidth&&(null==t?void 0:t.scrollHeight)===e.scrollHeight&&(null==t?void 0:t.scrollTop)===e.scrollTop?t:e)},[])}}({totalCount:e.length,plan:c}),{rowModels:h,renderWindow:f}=function({items:e,context:t,adapter:n,options:r}){const i=(0,o.useRef)(null),a=(0,o.useRef)(null);i.current||(i.current=new Ma),a.current||(a.current=new Pa);const s=(0,o.useMemo)(()=>i.current.reconcile(e,n,t),[n,t,e]),l=(0,o.useMemo)(()=>a.current.createRenderWindow(s,r),[r,s]);return{rowModels:s,renderWindow:l}}({items:e,context:a,adapter:Na,options:u}),p=(0,o.useMemo)(()=>h.some(e=>Boolean(e.dateText)),[h]),g=(0,o.useCallback)(e=>{if("grid"===i){const t=Math.max(1,Math.floor(e.viewportWidth/240));l(e=>e===t?e:t)}d(e)},[d,i]);return{rowModels:h,renderRows:f.rows,renderWindow:f,hasAnyValidDate:p,handleViewportChange:g}}const za=/(auto|scroll|overlay)/;function Ba(e){if("undefined"==typeof window)return!1;const t=window.getComputedStyle(e);return za.test(t.overflowY)||za.test(t.overflow)||za.test(t.overflowX)}function Ua(e){if("undefined"==typeof window)return e;let t=e;for(;t;){if(Ba(t))return t;t=t.parentElement}return null}function Va(e,t,n){return Math.max(0,e.clientHeight),Math.max(0,Math.round(e.getBoundingClientRect().height)),Math.max(1,t)}function Ha(e){if("undefined"==typeof window)return{scrollTop:e.scrollTop,viewportHeight:Math.max(1,e.clientHeight),viewportWidth:e.clientWidth,scrollHeight:e.scrollHeight};const t=Ua(e);return t&&function(e){return e.scrollHeight-e.clientHeight>1}(t)?function(e,t){if(e===t){const n=function(e){var t;if("undefined"==typeof window)return Math.max(1,e.clientHeight);const n=e.getBoundingClientRect(),r=window.innerHeight||(null===(t=document.documentElement)||void 0===t?void 0:t.clientHeight)||0,i=Math.max(0,n.top),o=Math.min(r,n.bottom);return Math.max(0,Math.round(o-i))}(t);return{scrollTop:t.scrollTop,viewportHeight:Va(e,Math.min(t.clientHeight,n||t.clientHeight)),viewportWidth:Math.max(1,t.clientWidth),scrollHeight:e.scrollHeight}}const n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=Math.max(n.top,r.top),o=Math.min(n.bottom,r.bottom),a=Math.max(n.left,r.left),s=Math.min(n.right,r.right),l=Math.max(0,Math.round(o-i)),c=Math.max(0,Math.round(s-a));return{scrollTop:Math.max(0,Math.round(i-r.top)),viewportHeight:Va(e,l),viewportWidth:Math.max(1,c||t.clientWidth||e.clientWidth),scrollHeight:e.scrollHeight}}(e,t):function(e){var t,n;const r=e.getBoundingClientRect(),i=window.innerHeight||(null===(t=document.documentElement)||void 0===t?void 0:t.clientHeight)||0,o=window.innerWidth||(null===(n=document.documentElement)||void 0===n?void 0:n.clientWidth)||r.width,a=Math.max(0,r.top),s=Math.min(i,r.bottom),l=Math.max(0,Math.round(s-a));return{scrollTop:Math.max(0,Math.round(-r.top)),viewportHeight:Va(e,l),viewportWidth:Math.max(1,Math.min(Math.round(r.width),o)),scrollHeight:e.scrollHeight}}(e)}const Wa=o.memo(({files:e,searchTerm:t,handleSearch:n,sortBy:r,sortOrder:a,handleSortOptionChange:s,pagination:l,setPagination:c,loading:u,handleItemClick:d,onClearSelection:h,onRename:f,onDelete:p,onCopy:g,onMove:m,showRenameModal:v,showDeleteConfirm:y,showCopyModal:b,showMoveModal:w,onEdit:x,getFileData:C,handleAddFile:_})=>{var S;const{t:A}=En(),{DropZoneFileIcon:k,BigStockIcon:I,BigAIIcon:j,FolderIcon:T}=ji(),{options:F,actions:O,state:M}=Ei(),{dataProviders:P,config:R}=F,L=null==R?void 0:R.disablePagination,{setCurrentMenuFile:N,setActiveLibraryItem:D}=O,z="Trash"===(null==M?void 0:M.selectedFolder),B=!1!==(null==M?void 0:M.multiSelect),U=la(e=>e.toggleFileSelection),{viewMode:V,setViewMode:H}=(()=>{const[e,t]=(0,o.useState)(()=>{try{return localStorage.getItem(Oa)||"table"}catch(e){return"table"}}),n=(0,o.useCallback)(e=>{t(e);try{localStorage.setItem(Oa,e)}catch(e){}},[]),r=(0,o.useCallback)(()=>{n("table"===e?"grid":"table")},[e,n]);return{viewMode:e,setViewMode:n,toggleViewMode:r}})(),[W,$]=(0,o.useState)({}),[G,q]=(0,o.useState)(!1),Y=(0,o.useRef)(null),X=(0,o.useRef)(0),K=(0,o.useRef)(null);(0,o.useEffect)(()=>{const e=window.matchMedia("(max-width: 1199px)"),t=e=>{q(e.matches)};t(e);const n=e=>t(e);return"function"==typeof e.addEventListener?(e.addEventListener("change",n),()=>e.removeEventListener("change",n)):(e.addListener(n),()=>e.removeListener(n))},[]);const Z=(0,o.useMemo)(()=>(null==R?void 0:R.features)||{},[null==R?void 0:R.features]),J=null==R?void 0:R.iconStrokeWidth,Q=`${r}-${a}`,ee=(0,o.useMemo)(()=>new Map(e.map(e=>[e.id,e])),[e]),{renderRows:te,renderWindow:ne,hasAnyValidDate:re,handleViewportChange:ie}=Da({files:e,folderFileCounts:W,features:Z,t:A,viewMode:V}),oe=(0,o.useCallback)(async e=>{var t;try{if(null==P?void 0:P.getChildrenCount)return await P.getChildrenCount("folders"===e?void 0:e);if(null==P?void 0:P.getFiles){const{files:n,pagination:r}=await P.getFiles({folderId:"folders"===e?void 0:e,itemType:"all",page:L?void 0:1,limit:L?void 0:1});return L?Array.isArray(n)?n.length:0:null!==(t=null==r?void 0:r.total)&&void 0!==t?t:Array.isArray(n)?n.length:0}return 0}catch(t){return null==t||t.name,0}},[P,L]),ae=(0,o.useCallback)(async()=>{const t=X.current+1;X.current=t;const n=e.filter(e=>e.isFolder);if(0===n.length)return void $(e=>0===Object.keys(e).length?e:{});const r={},i=n.map(async e=>{"number"!=typeof e.childCount?r[e.id]=await oe(e.id):r[e.id]=e.childCount});await Promise.all(i),X.current===t&&$(e=>{const t=Object.keys(e),n=Object.keys(r);return t.length===n.length&&t.every(t=>e[t]===r[t])?e:r})},[e,oe]);(0,o.useEffect)(()=>{ae()},[ae]),(0,o.useEffect)(()=>{K.current&&ie(Ha(K.current))},[e.length,ie,V]),(0,o.useEffect)(()=>{if(!K.current||"undefined"==typeof ResizeObserver)return;const e=K.current,t=new ResizeObserver(()=>{ie(Ha(e))});return t.observe(e),()=>{t.disconnect()}},[ie]);const se=(0,o.useCallback)((e=()=>{})=>{if(Y.current)return;const t=setTimeout(()=>{e(),Y.current=null},300);Y.current=t},[]),le=(0,o.useCallback)(e=>{Y.current&&(clearTimeout(Y.current),Y.current=null),e()},[]),ce=(0,o.useCallback)(e=>{const t=Ha(e);ie(t)},[ie]);(0,o.useEffect)(()=>{const e=K.current;if(!e)return;const t=()=>{ce(e)},n=function(e){if("undefined"==typeof window)return[e];const t=Ua(e);return t?t===e?[window,e]:[window,t]:[window]}(e);return n.forEach(e=>{e.addEventListener("scroll",t,{passive:!0})}),()=>{n.forEach(e=>{e.removeEventListener("scroll",t)})}},[e.length,ce,V]);const ue=(0,o.useCallback)((e,t)=>e!==t,[]),de=(0,o.useMemo)(()=>[...B?[{key:"selection",width:46,shouldCellUpdate:ue,render:(e,t)=>(0,i.jsx)(xa,{fileId:t.id})}]:[],{key:"preview",width:60,shouldCellUpdate:ue,render:(e,t)=>(0,i.jsx)(ka,{item:t,variant:"table",FolderIcon:T,getFileData:C,className:`${va.imagePreview} ${va.tableImagePreview}`,width:40,height:40})},{title:A("Name"),width:"calc(100% - 430px)",dataIndex:"nameText",key:"name",className:va.fileNameCol,shouldCellUpdate:ue,render:(e,t)=>(0,i.jsx)(Fa,{item:t})},{title:A("Dimensions"),key:"dimensions",width:100,shouldCellUpdate:ue,render:(e,t)=>t.dimensionsText&&(0,i.jsx)("div",{className:va.fileSize,children:t.dimensionsText})},{title:A("Size"),key:"size",width:90,shouldCellUpdate:ue,render:(e,t)=>t.sizeText?(0,i.jsx)("div",{className:va.fileSize,children:t.sizeText}):null},{title:A("Type"),key:"type",width:90,shouldCellUpdate:ue,render:(e,t)=>(0,i.jsx)("div",{className:va.fileSize,children:t.typeText})},...re?[{title:A("Date"),dataIndex:"dateText",key:"date",width:200,shouldCellUpdate:ue,render:(e,t)=>(0,i.jsx)(Ta,{item:t})}]:[],{width:40,title:"",dataIndex:"",key:"x",onCell:()=>({style:{padding:0}}),shouldCellUpdate:ue,render:(e,t)=>(0,i.jsx)(Sa,{item:t,variant:"table",t:A,iconStrokeWidth:J,setCurrentMenuFile:N,showMoveModal:w,showCopyModal:b,showRenameModal:v,showDeleteConfirm:y,onEdit:x})}],[T,C,re,J,B,x,N,ue,b,y,w,v,A]);(0,o.useEffect)(()=>()=>{Y.current&&clearTimeout(Y.current)},[]);const he=(0,o.useMemo)(()=>({body:{row:_a}}),[]),fe=(0,o.useCallback)(e=>({onClick:t=>{const n=t.target;se(()=>{t.stopPropagation(),t.preventDefault();const r=Boolean(n.closest(".ant-image"))||Boolean(n.closest(".ant-image-preview-wrap")),i=Boolean(n.closest(".tableMenuButton")),o=Boolean(n.closest(".ant-dropdown-menu"));r||i||o||U(e.id,{metaKey:t.metaKey,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey})})},onDoubleClick:t=>{le(()=>{t.stopPropagation(),t.preventDefault();const n=t.target;n.closest(".ant-checkbox-wrapper")||n.closest(".tableMenu")||(e.isFolder?d(e.file):n.closest(".ant-image")||n.closest(".ant-image-preview-wrap")||!F.onEditorOk||F.onEditorOk(e.file))})}}),[le,d,se,F,U]);let pe="table"===V?(0,i.jsx)(ja,{rows:te,columns:de,loading:u,topOffset:ne.topOffset,bottomOffset:ne.bottomOffset,onRow:fe,components:he}):(0,i.jsx)(Ia,{rows:te,topOffset:ne.topOffset,bottomOffset:ne.bottomOffset,t:A,iconStrokeWidth:J,FolderIcon:T,handleSingleClick:se,handleDoubleClick:le,handleItemClick:d,setCurrentMenuFile:N,showMoveModal:w,showCopyModal:b,showRenameModal:v,showDeleteConfirm:y,onEdit:x,onEditorOk:F.onEditorOk,getFileData:C,showSelectionCheckbox:B});t&&!e.length&&(pe=(0,i.jsx)(Ti,{}));const ge=null===(S=null==R?void 0:R.availableImageExtensions)||void 0===S?void 0:S.map(e=>"."+e).join(", "),me=(0,i.jsxs)("div",z?{className:`${va.noFiles} ant-layout-sider-light`,children:[(0,i.jsx)(Xr,{size:48,className:va.noFilesIcon}),(0,i.jsx)("div",{className:`${va.textTitle_trash} ant-menu-submenu-title`,children:A("Trash is empty")}),(0,i.jsx)("div",{className:`${va.textDescription_trash} ant-menu-submenu-title`,children:A("Deleted files will be displayed here")})]}:{className:va.uploadContainer,children:[(0,i.jsxs)("div",{className:`${va.uploadArea} `,onClick:_,children:[(0,i.jsx)("div",{className:va.uploadIcon,children:(0,i.jsx)(k,{})}),(0,i.jsx)("div",{className:va.textTitle,children:A("Click here to select a file")}),(0,i.jsx)("div",{className:va.textDescription,children:A("Supported files:")+" "+(ge||"jpeg, .svg, .png")})]}),(0,i.jsxs)("div",{className:va.buttons,children:[(0,i.jsxs)("button",{className:va.btnPhoto,onClick:()=>{D&&D(Dt)},children:[(0,i.jsx)("div",{className:va.icon,children:(0,i.jsx)(I,{})}),(0,i.jsxs)("div",{className:va.blockText,children:[(0,i.jsx)("div",{className:va.textTitle,children:A("Stock")}),(0,i.jsx)("div",{className:va.textDescription,children:A("Select an image from our library")})]})]}),(0,i.jsxs)("button",{className:va.btnAi,onClick:()=>{D&&D(Bt)},children:[(0,i.jsx)("div",{className:va.icon,children:(0,i.jsx)(j,{})}),(0,i.jsxs)("div",{className:va.blockText,children:[(0,i.jsx)("div",{className:va.textTitle,children:A("AI generation")}),(0,i.jsx)("div",{className:va.textDescription,children:A("Creating an image on demand")})]})]})]})]});return(0,i.jsx)("div",{className:`content-layout ${va.contentLayout}`,children:u||0!==(null==e?void 0:e.length)||t?(0,i.jsxs)("div",{className:va.tableContainer,children:[(0,i.jsx)(wa,{files:e,filesById:ee,currentSortOption:Q,isSmallScreen:G,iconStrokeWidth:J,multiSelectEnabled:B,features:Z,viewMode:V,setViewMode:H,handleSearch:n,handleSortOptionChange:s,onClearSelection:h,onRename:f,onDelete:p,onCopy:g,onMove:m,onEdit:x,t:A}),(0,i.jsx)("div",{ref:K,className:va.filesContainer,children:pe}),!L&&l.total>l.pageSize&&(0,i.jsx)("div",{className:va.paginationContainer,children:(0,i.jsx)(E.A,{current:l.current,pageSize:l.pageSize,total:l.total,onChange:(e,t)=>c({current:e,pageSize:t,total:l.total}),showSizeChanger:!0,showTotal:e=>A("total pages",{total:e})})})]}):(0,i.jsx)("div",{className:va.emptyStateWrapper,children:me})})});Wa.displayName="FileContent";var $a="folderLabelItem",Ga="foldersTitle",qa="foldersTitleItem";const Ya=({selectedFolder:e,onSelect:t,onExpand:n,generateMenuItems:r,fetchChildFolders:a,disabledFolders:s=[],showFileCounts:l=!1,folderFileCounts:c={},className:u="",expandedKeys:d,setExpandedKeys:h,showTrashFolder:f=!1,mode:p="navigation",defaultExpandAll:g=!1})=>{const{t:m}=En(),{options:v}=Ei(),{config:y}=v,{ExpandArrowIcon:b,CollapseArrowIcon:w,CollapseFolderIcon:x,ExpandFolderIcon:C,EmptyFolderIcon:_}=ji(),S=(0,o.useCallback)(e=>{const t=[],n=e=>{e.forEach(e=>{t.push(e.key),e.children&&n(e.children)})};return n(e),t},[]),[A,k]=(0,o.useState)(()=>{if(g||"selection"===p&&g){const e=r();return S(e)}return[]}),E=void 0!==d?d:A,j=void 0!==h?h:k;(0,o.useEffect)(()=>{if(g||"selection"===p&&g){const e=r(),t=S(e);void 0===d&&k(t)}},[g,p,r,S,d]);const T=(0,o.useCallback)(async e=>{const n=e[0];n&&"empty"!==n&&!n.endsWith("_input")&&(null==t||t(e),await(null==a?void 0:a("folders"===n?null:n)))},[t,a]),F=(0,o.useCallback)(async(e,t)=>{var r;if(j(e),null==n||n(e,t),"lazy"!==(null==y?void 0:y.folderTreeLoading))return;const i=(null===(r=null==t?void 0:t.node)||void 0===r?void 0:r.key)||void 0;if(i&&"folders"!==i)try{await(null==a?void 0:a(i))}catch(e){}},[null==y?void 0:y.folderTreeLoading,a,n,j]),O=(0,o.useCallback)(()=>{var t,n;const o=r(),a=e=>e.filter(e=>"Trash"!==e.key).map(e=>Object.assign(Object.assign({},e),{children:e.children?a(e.children):void 0})),u=f?a(o):o,d=t=>{"selection"!==p?(E.includes(t)&&e===t?j(E.filter(e=>e!==t)):E.includes(t)||j([...E,t]),T([t])):T([t])},h=0===u.length||1===u.length&&(!u[0].children||0===u[0].children.length),g=e=>{var t;const n=l&&c[e.key]||0,r=E.includes(e.key),o=s.includes(e.key),a=(()=>{var t;return(null===(t=e.children)||void 0===t?void 0:t.length)?(0,i.jsx)(r?x:C,{size:20,strokeWidth:null==y?void 0:y.iconStrokeWidth}):(0,i.jsx)(_,{size:20,strokeWidth:null==y?void 0:y.iconStrokeWidth})})(),u=(0,i.jsxs)("div",{className:"folderItemContainer folder-item-container",onClick:()=>!o&&d(e.key),style:{opacity:o?.5:1,cursor:o?"not-allowed":"pointer"},children:[(0,i.jsxs)("div",{className:"folderLabel",children:[void 0!==e.icon?e.icon:a,(0,i.jsx)("span",{className:$a,children:e.label})]}),l&&(0,i.jsx)("div",{className:"fileCount",title:`${n} ${1===n?"file":"files"}`,children:n})]});return{key:e.key,title:u,children:null===(t=e.children)||void 0===t?void 0:t.map(g),disabled:o}},v=E.includes("folders"),b=(0,i.jsx)("div",{className:Ga,onClick:()=>d("folders"),children:(0,i.jsxs)("div",{className:qa,children:[(0,i.jsx)(v?x:C,{size:20,strokeWidth:null==y?void 0:y.iconStrokeWidth}),(0,i.jsx)("span",{className:`${$a} folder-label-item`,children:"folders"===(null===(t=u[0])||void 0===t?void 0:t.key)?u[0].label:m("Folders")})]})}),w=()=>({key:"Trash",title:(0,i.jsx)("div",{className:Ga,onClick:()=>d("Trash"),children:(0,i.jsxs)("div",{className:qa,children:[(0,i.jsx)(Yr,{size:20,strokeWidth:null==y?void 0:y.iconStrokeWidth}),(0,i.jsx)("span",{className:$a,children:m("Trash")})]})}),children:void 0});if(h){if(!f)return[{key:"empty",title:(0,i.jsx)("div",{className:"emptyFolderContainer",children:m("No folders yet")}),disabled:!0}];const e=[];return u.length>0&&"folders"===u[0].key&&e.push({key:"folders",title:b,children:[]}),e.push(w()),e}if(u.length>0&&"folders"===u[0].key){const e=[{key:"folders",title:b,children:null===(n=u[0].children)||void 0===n?void 0:n.map(g)}];return f&&e.push(w()),e}return u.map(g)},[r,E,x,null==y?void 0:y.iconStrokeWidth,C,m,e,T,l,c,_,s,f,p,j]),M=(0,o.useMemo)(()=>O(),[O]);return(0,i.jsx)(I.A,{className:`folderTree folderMenu ${u}`,selectedKeys:e?[e]:[],expandedKeys:E,onSelect:T,onExpand:F,treeData:M,switcherIcon:({expanded:e})=>(0,i.jsx)(e?w:b,{}),showLine:!1})},Xa=({style:e={},wrap:t=!1})=>{const n=Object.assign({width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},e);return(0,i.jsx)(v.A,{size:"large",style:n,wrap:t,children:(0,i.jsx)(s.A,{})})};var Ka={formFooter:"formFooter",folderButton:"folderButton",foldersWrapper:"foldersWrapper",formItem:"formItem",folderToolsField:"folderToolsField",inputButtonOk:"inputButtonOk",permanentDeleteWarning:"permanentDeleteWarning",clearTrashProgress:"clearTrashProgress",progressText:"progressText",closeIcon:"closeIcon",modalContentWithLoader:"modalContentWithLoader",modalLoaderOverlay:"modalLoaderOverlay"};const Za=({folderId:e,activeFormField:t,EmptyFolderIcon:n,targetForm:r,handleModalOk:o,onComplete:a,setIsLoading:s,t:l})=>(0,i.jsx)(d.A.Item,{className:"form-item form-item-moveto "+(t===e?"form-item_active":""),name:"folderName",initialValue:l("New folder"),rules:[{required:!0,validator:(e,t)=>"string"==typeof t&&0===t.trim().length?Promise.reject(new Error(l("Enter the name of the folder"))):Promise.resolve()}],children:(0,i.jsx)(h.A,{className:"form-input",autoFocus:!0,prefix:(0,i.jsx)(n,{style:{marginRight:6}}),suffix:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(g.A,{placement:"top",title:"Clean",children:(0,i.jsx)(m.Ay,{icon:(0,i.jsx)(ne.A,{style:{fontSize:10}}),className:Ka.inputButtonClose,type:"text",onClick:()=>{r.setFieldsValue({folderName:""})}})}),(0,i.jsx)(m.Ay,{className:Ka.inputButtonOk,type:"text",onClick:()=>{s(!0),o(r).then(e=>{const t=null==e?void 0:e.id;a(t)}).finally(()=>s(!1))},children:l("Create")})]})})});function Ja({folders:e,selectedFolder:t,EmptyFolderIcon:n,handleCreateFolderModalOk:r,setIsLoading:a,t:s}){const[l,c]=o.useState(""),u=o.useCallback((e,t)=>o=>(0,i.jsx)(Za,{folderId:o,activeFormField:l,EmptyFolderIcon:n,targetForm:e,handleModalOk:r,onComplete:t,setIsLoading:a,t:s},o),[n,l,r,a,s]),d=o.useCallback(e=>{const{folderId:t,targetForm:n,onTreeSelect:r,onComplete:i}=e;return{handleAddFolder:e=>{e.preventDefault(),e.stopPropagation(),c(t),n.setFieldsValue({folderName:s("New folder"),targetFolder:t})},handleSelectFolder:e=>{e.preventDefault(),e.stopPropagation(),r([t]).then(()=>i(t))}}},[s]),h=o.useCallback(n=>{const{targetForm:r,onTreeSelect:o,onComplete:a,actionButtonText:c}=n,h=u(r,a),f=Array.isArray(e)?e:[],p=(e=null,n=new Set)=>f.filter(t=>{const n=null===e&&!t.parentId,r=t.parentId===e;return n||r}).map(e=>{if(n.has(e.id))return{key:e.id,label:`${e.name} (\u0446\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0441\u0441\u044b\u043b\u043a\u0430)`};const s=new Set(n);s.add(e.id);const u=p(e.id,s),{handleAddFolder:f,handleSelectFolder:g}=d({folderId:e.id,targetForm:r,onTreeSelect:o,onComplete:a}),v=l===e.id?[{key:`${e.id}_input`,label:h(e.id),icon:null},...u]:u;return{key:e.id,label:(0,i.jsxs)(i.Fragment,{children:[e.name,t!==e.id&&(0,i.jsxs)("div",{className:`${Ka.folderToolsField} folder-tools-field`,children:[(0,i.jsx)(m.Ay,{onClick:f,children:"+"}),(0,i.jsx)(m.Ay,{onClick:g,children:c})]})]}),children:v}}),g=p(),{handleAddFolder:v,handleSelectFolder:y}=d({folderId:"folders",targetForm:r,onTreeSelect:o,onComplete:a}),b="folders"===l?[{key:"folders_input",label:h("folders"),icon:null},...g]:g;return[{key:"folders",label:(0,i.jsxs)(i.Fragment,{children:[s("Folders"),"folders"!==t&&null!==t&&(0,i.jsxs)("div",{className:`${Ka.folderToolsField} folder-tools-field`,children:[(0,i.jsx)(m.Ay,{onClick:v,children:"+"}),(0,i.jsx)(m.Ay,{onClick:y,children:c})]})]}),children:b}]},[l,u,d,e,t,s]);return{activeFormField:l,setActiveFormField:c,generateMenuItemsFromFolders:h}}const Qa=(0,o.memo)(({folderId:e,activeFormField:t,EmptyFolderIcon:n,targetForm:r,handleModalOk:a,onComplete:s,t:l,setIsLoading:c,defaultFolderName:u})=>{const f=(0,o.useCallback)(()=>{c(!0),a(r).then(e=>s(null==e?void 0:e.id)).finally(()=>c(!1))},[a,r,s,c]);return(0,i.jsx)(d.A.Item,{className:"form-item form-item-moveto "+(t===e?"form-item_active":""),name:"folderName",initialValue:u,rules:[{required:!0,validator:(e,t)=>"string"==typeof t&&0===t.trim().length?Promise.reject(new Error(l("Enter the name of the folder"))):Promise.resolve()}],children:(0,i.jsx)(h.A,{className:"form-input",autoFocus:!0,prefix:(0,i.jsx)(n,{style:{marginRight:6}}),suffix:(0,i.jsx)(m.Ay,{className:Ka.inputButtonOk,type:"text",onClick:()=>{c(!0),f()},children:l("Create")})})})});Qa.displayName="CustomFolderInput";const es=({isModalVisible:e,handleModalOk:t,handleModalCancel:n,form:r,selectedFolder:a,folders:s,isUrlModalVisible:l,setIsUrlModalVisible:c,handleAddFileByUrl:u,urlForm:f,isRenameModalVisible:p,handleRenameOk:g,handleRenameCancel:v,renameForm:y,fileToRename:b,files:w,isMoveModalVisible:x,handleMoveOk:C,handleMoveCancel:_,moveForm:S,selectedFiles:A,isRenameFolderModalVisible:k,handleRenameFolderOk:E,handleRenameFolderCancel:I,renameFolderForm:F,folderToRename:O,isCopyModalVisible:M,handleCopyOk:P,handleCopyCancel:R,copyForm:L,isDeleteConfirmVisible:N,handleDeleteConfirmOk:D,handleDeleteConfirmCancel:z,isClearTrashConfirmVisible:B,handleClearTrashConfirm:U,handleClearTrashCancel:V,fetchChildFolders:H})=>{var W,$,G;const{t:q}=En(),{state:Y,actions:X,options:K}=Ei(),{setCurrentMenuFile:Z}=X,{config:J}=K,{currentMenuFile:Q}=Y,ee=d.A.useWatch("folderName",r),{EmptyFolderIcon:te}=ji(),[re,ie]=(0,o.useState)(!1),oe=(0,o.useMemo)(()=>{var e;return(null===(e=null==J?void 0:J.defaultFolderName)||void 0===e?void 0:e.trim())||q("New folder")},[null==J?void 0:J.defaultFolderName,q]),ae=!ee||0===String(ee).trim().length,se=(0,o.useMemo)(()=>Array.isArray(w)?w:[],[w]),le=b?null===(W=se.find(e=>e.id===b))||void 0===W?void 0:W.name:"",ce=Array.isArray(s)?s:[],ue=O?null===($=ce.find(e=>e.id===O))||void 0===$?void 0:$.name:"",{activeFormField:de,setActiveFormField:he,generateMenuItemsFromFolders:fe}=Ja({folders:ce,selectedFolder:a,EmptyFolderIcon:te,handleCreateFolderModalOk:t,setIsLoading:e=>ie(Boolean(e)),t:q});(0,o.useEffect)(()=>{if(N){const e=setTimeout(()=>{const e=document.querySelector(".deleteModal");if(e){const t=e.querySelector(".ant-modal-footer");if(t){const e=t.querySelector(".ant-btn-primary");e&&e.focus()}}},100);return()=>clearTimeout(e)}},[N]);const pe=b?se.find(e=>e.id===b):null,ge=(null==pe?void 0:pe.isFolder)||(null==b?void 0:b.startsWith("folder_")),me=(0,o.useCallback)(async e=>{e.length>0&&(S.setFieldsValue({targetFolder:e[0]}),de!==e[0].toString()&&he(""))},[S,de,he]),ve=(0,o.useCallback)(async e=>{e.length>0&&(L.setFieldsValue({targetFolder:e[0]}),de!==e[0].toString()&&he(""))},[de,L,he]),ye=(0,o.useCallback)(async e=>{ie(!0);try{await C(e)}finally{ie(!1)}},[C]),be=(0,o.useCallback)(async e=>{ie(!0);try{await P(e)}finally{ie(!1)}},[P]),we=(0,o.useMemo)(()=>{const e=Array.from(A).filter(e=>{const t=se.find(t=>t.id===e);return(null==t?void 0:t.isFolder)||s.some(t=>t.id===e)});return a&&"folders"!==a?e.push(a):a&&"folders"!==a||e.push("folders"),e},[A,se,s,a]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(j.A,{title:(0,i.jsx)("div",{className:"modal-title",children:q("Creating a new folder")}),open:e,onOk:()=>t(),onCancel:n,okText:q("Create"),cancelText:q("Cancel"),okButtonProps:{disabled:ae,loading:re},cancelButtonProps:{disabled:re},afterClose:()=>ie(!1),children:(0,i.jsxs)(d.A,{form:r,layout:"vertical",children:[(0,i.jsx)(d.A.Item,{name:"folderName",label:(0,i.jsx)("div",{className:"form-label",children:q("Folder name")}),rules:[{required:!0,validator:(e,t)=>"string"==typeof t&&0===t.trim().length?Promise.reject(new Error(q("Enter the name of the folder"))):Promise.resolve()}],initialValue:oe,className:"form-item",style:{marginBottom:5},children:(0,i.jsx)(h.A,{autoFocus:!0,className:"form-input",disabled:re,placeholder:q("Enter the name"),onPressEnter:async()=>{ie(!0);try{await r.validateFields(),ae||await t()}catch(It){ie(!1)}}})}),(0,i.jsx)("div",{children:a&&"folders"!==a?(0,i.jsxs)("p",{className:"fm-note",children:[q("A folder will be created inside:")," ",(null===(G=ce.find(e=>e.id===a))||void 0===G?void 0:G.name)||q("selected folder"),"."]}):(0,i.jsx)("p",{className:"fm-note",children:q("The folder will be created in the root directory.")})})]})}),(0,i.jsx)(j.A,{title:(0,i.jsx)("div",{className:"modal-title",children:q("Upload file by URL")}),open:l,onOk:async()=>{var e;ie(!0);try{const t=await f.validateFields(),n=String(null!==(e=t.fileUrl)&&void 0!==e?e:"").trim();await u(n,void 0,void 0,"uploadByUrl")}catch(e){}finally{ie(!1)}},onCancel:()=>c(!1),okText:q("Download"),okButtonProps:{loading:re},cancelText:q("Cancel"),cancelButtonProps:{disabled:re},afterClose:()=>ie(!1),children:(0,i.jsx)(d.A,{form:f,layout:"vertical",children:(0,i.jsx)(d.A.Item,{name:"fileUrl",label:(0,i.jsx)("div",{className:"form-label",children:q("File URL")}),rules:[{required:!0,message:q("Enter the URL of the image")},{validator:(e,t)=>{if(!t||!String(t).trim())return Promise.resolve();try{return fo(String(t),q),Promise.resolve()}catch(e){return Promise.reject(new Error(e instanceof Error?e.message:q("The specified URL is not valid.")))}}}],validateTrigger:"onBlur",className:"form-item",children:(0,i.jsx)(h.A,{className:"form-input",placeholder:"https://example.com/image.jpg",autoFocus:!0,disabled:re,onPressEnter:async()=>{var e;ie(!0);try{const t=await f.validateFields(),n=String(null!==(e=t.fileUrl)&&void 0!==e?e:"").trim();await u(n,void 0,void 0,"uploadByUrl")}catch(e){}finally{ie(!1)}}})})})}),(0,i.jsx)(j.A,{title:(0,i.jsx)("div",{className:"modal-title",children:ge?`${q("Rename folder")} ${le}`:q("Rename file",{currentFileName:le})}),open:p,onOk:g,okText:q("Rename"),okButtonProps:{loading:re},onCancel:v,cancelText:q("Cancel"),cancelButtonProps:{disabled:re},afterClose:()=>{ie(!1),Z&&Z("")},children:(0,i.jsx)(d.A,{form:y,layout:"vertical",children:(0,i.jsx)(d.A.Item,{name:"newFileName",label:(0,i.jsx)("div",{className:"form-label",children:q(ge?"New folder name":"New file name")}),rules:[{required:!0,message:q(ge?"Enter a new folder name":"Enter a new file name")}],className:"form-item",children:(0,i.jsx)(h.A,{autoFocus:!0,className:"form-input",disabled:re,onPressEnter:async()=>{ie(!0);try{await y.validateFields(),g()}catch(It){ie(!1)}}})})})}),(0,i.jsx)(j.A,{title:(0,i.jsx)("div",{className:"modal-title",children:q("Move to")}),open:x,onCancel:_,footer:(0,i.jsxs)("div",{className:Ka.formFooter,children:[(0,i.jsxs)(m.Ay,{className:Ka.folderButton,onClick:()=>{const e=null!=a?a:"folders";he(e),S.setFieldsValue({folderName:oe,targetFolder:e})},loading:re,children:[(0,i.jsx)(Pr,{size:18,strokeWidth:null==J?void 0:J.iconStrokeWidth}),q("Create folder")]}),(0,i.jsx)(m.Ay,{type:"primary",className:Ka.folderButton,onClick:_,loading:re,children:q("Done")})]}),afterClose:()=>{Z&&Z(""),he(""),ie(!1)},loading:re,children:(0,i.jsxs)("div",{className:Ka.modalContentWithLoader,children:[re&&(0,i.jsx)("div",{className:Ka.modalLoaderOverlay,children:(0,i.jsx)(Xa,{})}),(0,i.jsx)(d.A,{form:S,layout:"vertical",initialValues:{targetFolder:"folders",folderName:oe,is_force_create:!1},children:(0,i.jsxs)("div",{className:Ka.foldersWrapper,children:[(0,i.jsx)(d.A.Item,{name:"targetFolder",rules:[{required:!0,message:q("Select the destination folder")}],className:Ka.formItem,children:(0,i.jsx)(Ya,{onSelect:me,generateMenuItems:()=>fe({targetForm:S,onTreeSelect:me,onComplete:ye,actionButtonText:q("Move here")}),fetchChildFolders:H,disabledFolders:we,mode:"selection",className:"folderSelectionTree",defaultExpandAll:!0})}),(0,i.jsx)(d.A.Item,{name:"folderName",style:{display:"none"},rules:[{required:!0,validator:(e,t)=>"string"==typeof t&&0===t.trim().length?Promise.reject(new Error(q("Enter the name of the folder"))):Promise.resolve()}],children:(0,i.jsx)(h.A,{})}),(0,i.jsx)(d.A.Item,{name:"is_force_create",style:{display:"none"},children:(0,i.jsx)(h.A,{})})]})})]})}),(0,i.jsx)(j.A,{title:(0,i.jsx)("div",{className:"modal-title",children:q("Copy to folder")}),open:M,onCancel:R,footer:(0,i.jsxs)("div",{className:Ka.formFooter,children:[(0,i.jsxs)(m.Ay,{className:Ka.folderButton,onClick:()=>{const e=null!=a?a:"folders";he(e),L.setFieldsValue({folderName:oe,targetFolder:e})},loading:re,children:[(0,i.jsx)(Pr,{size:18,strokeWidth:null==J?void 0:J.iconStrokeWidth}),q("Create folder")]}),(0,i.jsx)(m.Ay,{type:"primary",className:Ka.folderButton,onClick:R,loading:re,children:q("Done")})]}),afterClose:()=>{Z&&Z(""),he(""),ie(!1)},loading:re,children:(0,i.jsxs)("div",{className:Ka.modalContentWithLoader,children:[re&&(0,i.jsx)("div",{className:Ka.modalLoaderOverlay,children:(0,i.jsx)(Xa,{})}),(0,i.jsx)(d.A,{form:L,layout:"vertical",initialValues:{targetFolder:"folders",folderName:oe,is_force_create:!1},children:(0,i.jsxs)("div",{className:Ka.foldersWrapper,children:[(0,i.jsx)(d.A.Item,{name:"targetFolder",rules:[{required:!0,message:q("Select the destination folder")}],className:Ka.formItem,children:(0,i.jsx)(Ya,{onSelect:ve,generateMenuItems:()=>fe({targetForm:L,onTreeSelect:ve,onComplete:be,actionButtonText:q("Copy here")}),fetchChildFolders:H,disabledFolders:we,mode:"selection",className:"folderSelectionTree",defaultExpandAll:!0})}),(0,i.jsx)(d.A.Item,{name:"folderName",style:{display:"none"},rules:[{required:!0,validator:(e,t)=>"string"==typeof t&&0===t.trim().length?Promise.reject(new Error(q("Enter the name of the folder"))):Promise.resolve()}],children:(0,i.jsx)(h.A,{})}),(0,i.jsx)(d.A.Item,{name:"is_force_create",style:{display:"none"},children:(0,i.jsx)(h.A,{})})]})})]})}),(0,i.jsx)(j.A,{title:(0,i.jsxs)("div",{className:"modal-title",children:[q("Rename folder")," ",ue]}),open:k,onOk:E,onCancel:I,okText:q("Rename"),cancelText:q("Cancel"),okButtonProps:{loading:re},cancelButtonProps:{disabled:re},afterClose:()=>{ie(!1),Z&&Z("")},children:(0,i.jsx)(d.A,{form:F,layout:"vertical",children:(0,i.jsx)(d.A.Item,{name:"newFolderName",label:(0,i.jsx)("div",{className:"form-label",children:q("New folder name")}),rules:[{required:!0,message:q("Enter a new folder name")}],className:"form-item",children:(0,i.jsx)(h.A,{autoFocus:!0,className:"form-input",disabled:re,onPressEnter:async()=>{ie(!0);try{await F.validateFields(),E()}catch(It){ie(!1)}}})})})}),(0,i.jsx)(j.A,{className:`${Ka.deleteModal} deleteModal`,title:(()=>{const e=!!(null==J?void 0:J.enableTrashFolder)&&"Trash"===a||!(null==J?void 0:J.enableTrashFolder),t=q(e?"Permanently delete":"Move to Trash");return(0,i.jsx)("div",{className:"modal-title",children:t})})(),open:!!N,onOk:()=>{ie(!0);try{D&&D()}catch(It){ie(!1)}},onCancel:()=>z&&z(),okText:(null==J?void 0:J.enableTrashFolder)&&"Trash"===a?q("Delete permanently"):(null==J?void 0:J.enableTrashFolder)?q("Move to Trash"):q("Delete"),cancelText:q("Cancel"),okButtonProps:{danger:!(null==J?void 0:J.enableTrashFolder)||"Trash"===a,loading:re},cancelButtonProps:{disabled:re},afterClose:()=>{ie(!1),Z&&Z("")},closeIcon:(0,i.jsx)(ne.A,{className:Ka.closeIcon}),children:(()=>{var e,t;const n=(Q?[Q]:Array.from(A||[])).map(e=>se.find(t=>t.id===e)).filter(e=>!!e),r=n.filter(e=>e.isFolder||e.id.startsWith("folder_")),o=n.filter(e=>!(e.isFolder||e.id.startsWith("folder_"))),s=n.length,l=r.length,c=o.length,u=!!(null==J?void 0:J.enableTrashFolder);if(!u||u&&"Trash"===a){let t;if(1===s&&1===l){const n=r[0],i=(null==n?void 0:n.name)||"",o=null!==(e=null==n?void 0:n.childCount)&&void 0!==e?e:0;t=q("delete_folder_permanent",{name:i,count:o})}else t=0===l&&c>0?q("delete_files_permanent",{count:c}):q("delete_mixed_permanent",{total:s,folders:l,images:c});return(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{children:t}),(0,i.jsx)("p",{className:Ka.permanentDeleteWarning,children:q("permanent_delete_warning")})]})}if(1===s&&1===l){const e=r[0],n=(null==e?void 0:e.name)||"",o=null!==(t=null==e?void 0:e.childCount)&&void 0!==t?t:0;return(0,i.jsx)("div",{children:q("move_folder_to_trash",{name:n,count:o})})}return(0,i.jsx)("div",0===l&&c>0?{children:q("move_files_to_trash",{count:c})}:{children:q("move_mixed_to_trash",{total:s,folders:l,images:c})})})()}),(0,i.jsxs)(j.A,{className:`${Ka.deleteModal} deleteModal`,title:(0,i.jsx)("div",{className:"modal-title",children:q("Clear Trash")}),open:!!B,onOk:async()=>{ie(!0),U&&await U(),ie(!1)},onCancel:()=>V&&V(),okText:q("Delete permanently"),cancelText:q("Cancel"),okButtonProps:{danger:!0,loading:re},cancelButtonProps:{disabled:re},afterClose:()=>{ie(!1)},closeIcon:(0,i.jsx)(ne.A,{className:Ka.closeIcon}),children:[(0,i.jsx)("div",{children:q("Are you sure you want to permanently delete all items from Trash?")}),re&&(0,i.jsxs)("div",{className:Ka.clearTrashProgress,children:[(0,i.jsx)(T.A,{percent:99,status:"active",showInfo:!1}),(0,i.jsx)("div",{className:Ka.progressText,children:q("Deleting items...")})]})]})]})};var ts={button:"button",folderActions:"folderActions",uploadButton:"uploadButton",foldersContainer:"foldersContainer",buttonWrapper:"buttonWrapper",uploadButtonTitle:"uploadButtonTitle"};const ns=(0,o.memo)((0,o.forwardRef)(({selectedFolder:e,generateMenuItems:t,onFolderSelect:n,folders:r,fetchChildFolders:a,handleAddFile:s,setIsUrlModalVisible:l,handleCreateFolder:c,activeLibraryItem:u,setActiveLibraryItem:d},h)=>{var f,p,g;const v=(0,o.useMemo)(()=>Array.isArray(r)?r:[],[r]),{t:y}=En(),b=Ni(),[w,x]=(0,o.useState)({}),{options:C}=Ei(),{dataProviders:_,config:S}=C,A=!1!==(null===(f=null==S?void 0:S.features)||void 0===f?void 0:f.enableGif)&&(!(null==S?void 0:S.enabledTabs)||S.enabledTabs.includes("gif")),k=!1!==(null===(p=null==S?void 0:S.features)||void 0===p?void 0:p.enableStockImages)&&(!(null==S?void 0:S.enabledTabs)||S.enabledTabs.includes("stock")),E=!1!==(null===(g=null==S?void 0:S.features)||void 0===g?void 0:g.enableIconStock)&&(!(null==S?void 0:S.enabledTabs)||S.enabledTabs.includes("icons")),I=(0,o.useCallback)(e=>{const t=[],n=e=>{e.forEach(e=>{t.push(e.key),e.children&&n(e.children)})};return n(e),t},[]),[j,T]=(0,o.useState)(()=>{if(!0===(null==S?void 0:S.expandAllFoldersOnInit)&&"lazy"!==(null==S?void 0:S.folderTreeLoading)){const e=t();return I(e)}return!0===(null==S?void 0:S.expandRootFolderOnInit)?["folders"]:[]}),M=(0,o.useRef)(!1),P=(0,o.useRef)(!1);(0,o.useEffect)(()=>{M.current||"lazy"===(null==S?void 0:S.folderTreeLoading)&&!0===(null==S?void 0:S.expandRootFolderOnInit)&&(M.current=!0,(async()=>{try{await(null==a?void 0:a(null))}catch(It){}})())},[null==S?void 0:S.folderTreeLoading,null==S?void 0:S.expandRootFolderOnInit,a]),(0,o.useEffect)(()=>{!0===(null==S?void 0:S.expandRootFolderOnInit)&&Array.isArray(v)&&v.length>0&&(P.current||j&&0!==j.length||(P.current=!0,T(["folders"])))},[null==S?void 0:S.expandRootFolderOnInit,v,j]),(0,o.useEffect)(()=>{if(!0===(null==S?void 0:S.expandAllFoldersOnInit)&&"lazy"!==(null==S?void 0:S.folderTreeLoading)){const e=t(),n=I(e);return void T(n)}!0===(null==S?void 0:S.expandRootFolderOnInit)&&T(e=>e&&e.length>0?[...e]:["folders"])},[v,t,I,null==S?void 0:S.expandAllFoldersOnInit,null==S?void 0:S.folderTreeLoading,null==S?void 0:S.expandRootFolderOnInit]);const R=null==S?void 0:S.disablePagination,L=(0,o.useCallback)(async e=>{var t,n,r,i;try{if(null==_?void 0:_.getChildrenCount)return await _.getChildrenCount("folders"===e?void 0:e);if(null==_?void 0:_.getFiles){const{files:n,pagination:r}=await _.getFiles({folderId:"folders"===e?void 0:e,itemType:"all",page:R?void 0:1,limit:R?void 0:1});return R?Array.isArray(n)?n.length:0:null!==(t=null==r?void 0:r.total)&&void 0!==t?t:Array.isArray(n)?n.length:0}return 0}catch(t){if("StaleLoad"===(null==t?void 0:t.name))return 0;const o=t;return 404===(null==o?void 0:o.status)||"FileNotFound"===(null==o?void 0:o.code)||"path_folder_not_found"===(null==o?void 0:o.code)||"path_folder_not_found"===(null===(n=null==o?void 0:o.data)||void 0===n?void 0:n.code)||404===(null===(i=null===(r=null==o?void 0:o.data)||void 0===r?void 0:r.data)||void 0===i?void 0:i.status)||b.error({id:"FOLDER_CHILDREN_COUNT_FAILED",message:y("Failed to load folder items count"),placement:"bottomRight",innerException:t,data:{folderId:"folders"===e?null:e,reason:t instanceof Error?t.message:String(t)}}),0}},[_,b,y,R]),N=(0,o.useCallback)(async()=>{if(0===v.length)return;const e={};e.folders=await L("folders");const t=v.map(async t=>{"number"!=typeof t.childCount?e[t.id]=await L(t.id):e[t.id]=t.childCount});await Promise.all(t),x(e)},[v,L]),D=(0,o.useCallback)(async e=>{const t=await L(e);x(n=>Object.assign(Object.assign({},n),{[e]:t}))},[L]);(0,o.useImperativeHandle)(h,()=>({refreshFileCounts:N}),[N]),(0,o.useEffect)(()=>{N()},[N]),(0,o.useEffect)(()=>{if(!e||"folders"===e)return;const t=(e,n=new Set)=>{if(n.has(e))return[];const r=v.find(t=>t.id===e);if(!r)return[];if(!r.parentId)return[];const i=new Set(n);return i.add(e),[...t(r.parentId,i),r.parentId]},n=t(e);n.length>0?T(e=>{const t=new Set(e);return n.forEach(e=>t.add(e)),t.add("folders"),Array.from(t)}):T(e=>e.includes("folders")?e:[...e,"folders"])},[e,v]);const z=(0,o.useCallback)(async()=>{await s(),e?await D(e):await D("folders")},[s,e,D]),B=[{key:Lt,label:y("My files"),icon:(0,i.jsx)(Nr,{size:20,strokeWidth:null==S?void 0:S.iconStrokeWidth})},{key:Nt,label:y("GIF"),icon:(0,i.jsx)(Br,{size:20,strokeWidth:null==S?void 0:S.iconStrokeWidth}),disabled:!A},{key:Dt,label:y("Stock images"),icon:(0,i.jsx)(Ir,{size:20,strokeWidth:null==S?void 0:S.iconStrokeWidth}),disabled:!k},{key:zt,label:y("Icons"),icon:(0,i.jsx)(re.A,{size:20}),disabled:!E},{key:Bt,label:y("AI"),icon:(0,i.jsx)($r,{size:20,strokeWidth:null==S?void 0:S.iconStrokeWidth}),disabled:!(null==S?void 0:S.sseQuery)}].filter(e=>!e.disabled),U=(0,o.useCallback)(async e=>{const t=e[0];t&&"empty"!==t&&(u!==Lt&&d(Lt),null==n||n(t),await(null==a?void 0:a(t)))},[n,u,d,a]),V=(0,o.useCallback)(({key:e})=>{d(e)},[d]),H=(0,o.useCallback)(async(e,t)=>{var n;if(T(e),"lazy"!==(null==S?void 0:S.folderTreeLoading))return;const r=(null===(n=null==t?void 0:t.node)||void 0===n?void 0:n.key)||void 0;if(r&&"folders"!==r)try{await(null==a?void 0:a(r))}catch(e){b.error({id:"FOLDER_CHILDREN_FETCH_FAILED",message:y("Failed to load subfolders"),placement:"bottomRight",innerException:e,data:{folderId:r,reason:e instanceof Error?e.message:String(e)}})}},[null==S?void 0:S.folderTreeLoading,a,b,y]);return(0,i.jsxs)("div",{className:"sidebar-container",children:[(0,i.jsxs)("div",{className:ts.buttonWrapper,children:[(0,i.jsx)(m.Ay,{type:"primary",size:"large",icon:(0,i.jsx)(Ur,{size:24,strokeWidth:null==S?void 0:S.iconStrokeWidth}),onClick:z,className:ts.uploadButton,style:{whiteSpace:"nowrap"},disabled:"Trash"===e,children:(0,i.jsx)("span",{className:ts.uploadButtonTitle,children:y("Upload file")})}),(0,i.jsx)(m.Ay,{type:"primary",size:"large",icon:(0,i.jsx)(Dr,{size:24,strokeWidth:null==S?void 0:S.iconStrokeWidth}),onClick:()=>null==l?void 0:l(!0),className:ts.uploadByURLButton,style:{whiteSpace:"nowrap"},disabled:"Trash"===e})]}),(0,i.jsx)(F.A,{className:"folder-menu",items:B,defaultSelectedKeys:[Lt],onSelect:({key:e})=>V({key:e}),selectedKeys:[u]}),(0,i.jsx)(O.A,{className:ts.divider}),(0,i.jsxs)("div",{className:ts.foldersContainer,children:[(0,i.jsx)(Ya,{selectedFolder:e,onSelect:U,onExpand:H,generateMenuItems:t,fetchChildFolders:a,showFileCounts:!0,folderFileCounts:w,expandedKeys:j,setExpandedKeys:T,showTrashFolder:null==S?void 0:S.enableTrashFolder}),(0,i.jsx)("div",{className:ts.folderActions,children:(0,i.jsx)(m.Ay,{onClick:e=>{e.stopPropagation(),c()},className:ts.button,icon:(0,i.jsx)(Pr,{size:18,strokeWidth:null==S?void 0:S.iconStrokeWidth}),size:"middle"})})]})]})}));ns.displayName="FolderSidebar";var rs=Object.defineProperty,is=(e,t,n)=>(((e,t,n)=>{t in e?rs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);function os(e,t){return void 0===t&&(t=15),+parseFloat(Number(e).toPrecision(t))}function as(e){var t=e.toString().split(/[eE]/),n=(t[0].split(".")[1]||"").length-+(t[1]||0);return n>0?n:0}function ss(e){if(-1===e.toString().indexOf("e"))return Number(e.toString().replace(".",""));var t=as(e);return t>0?os(Number(e)*Math.pow(10,t)):Number(e)}function ls(e){hs&&(e>Number.MAX_SAFE_INTEGER||Number.MIN_SAFE_INTEGER)}function cs(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=t[0];return t.slice(1).reduce(function(t,n){return e(t,n)},r)}}var us=cs(function(e,t){var n=ss(e),r=ss(t),i=as(e)+as(t),o=n*r;return ls(o),o/Math.pow(10,i)}),ds=(cs(function(e,t){var n=Math.pow(10,Math.max(as(e),as(t)));return(us(e,n)+us(t,n))/n}),cs(function(e,t){var n=Math.pow(10,Math.max(as(e),as(t)));return(us(e,n)-us(t,n))/n}),cs(function(e,t){var n=ss(e),r=ss(t);return ls(n),ls(r),us(n/r,os(Math.pow(10,as(t)-as(e))))})),hs=!0,fs=function(e,t){var n=Math.pow(10,t),r=ds(Math.round(Math.abs(us(e,n))),n);return e<0&&0!==r&&(r=us(r,-1)),r},ps=function(e){void 0===e&&(e=!0),hs=e};const gs=Object.prototype.toString;function ms(e){switch(gs.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return ks(e,Error)}}function vs(e,t){return gs.call(e)===`[object ${t}]`}function ys(e){return vs(e,"ErrorEvent")}function bs(e){return vs(e,"DOMError")}function ws(e){return vs(e,"String")}function xs(e){return"object"==typeof e&&null!==e&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function Cs(e){return null===e||xs(e)||"object"!=typeof e&&"function"!=typeof e}function _s(e){return vs(e,"Object")}function Ss(e){return typeof Event<"u"&&ks(e,Event)}function As(e){return!(!e||!e.then||"function"!=typeof e.then)}function ks(e,t){try{return e instanceof t}catch{return!1}}function Es(e){return!("object"!=typeof e||null===e||!e.__isVue&&!e._isVue)}function Is(e,t=0){return"string"!=typeof e||0===t||e.length<=t?e:`${e.slice(0,t)}...`}function js(e,t){if(!Array.isArray(e))return"";const n=[];for(let r=0;r<e.length;r++){const t=e[r];try{Es(t)?n.push("[VueViewModel]"):n.push(String(t))}catch{n.push("[value cannot be serialized]")}}return n.join(t)}function Ts(e,t=[],n=!1){return t.some(t=>function(e,t,n=!1){return!!ws(e)&&(function(e){return vs(e,"RegExp")}(t)?t.test(e):!!ws(t)&&(n?e===t:e.includes(t)))}(e,t,n))}function Fs(e,t,n=250,r,i,o,a){if(!(o.exception&&o.exception.values&&a&&ks(a.originalException,Error)))return;const s=o.exception.values.length>0?o.exception.values[o.exception.values.length-1]:void 0;s&&(o.exception.values=function(e,t){return e.map(e=>(e.value&&(e.value=Is(e.value,t)),e))}(Os(e,t,i,a.originalException,r,o.exception.values,s,0),n))}function Os(e,t,n,r,i,o,a,s){if(o.length>=n+1)return o;let l=[...o];if(ks(r[i],Error)){Ms(a,s);const o=e(t,r[i]),c=l.length;Ps(o,i,c,s),l=Os(e,t,n,r[i],i,[o,...l],o,c)}return Array.isArray(r.errors)&&r.errors.forEach((r,o)=>{if(ks(r,Error)){Ms(a,s);const c=e(t,r),u=l.length;Ps(c,`errors[${o}]`,u,s),l=Os(e,t,n,r,i,[c,...l],c,u)}}),l}function Ms(e,t){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,..."AggregateError"===e.type&&{is_exception_group:!0},exception_id:t}}function Ps(e,t,n,r){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}function Rs(e){return e&&e.Math==Math?e:void 0}const Ls="object"==typeof globalThis&&Rs(globalThis)||"object"==typeof window&&Rs(window)||"object"==typeof self&&Rs(self)||"object"==typeof n.g&&Rs(n.g)||function(){return this}()||{};function Ns(){return Ls}function Ds(e,t,n){const r=n||Ls,i=r.__SENTRY__=r.__SENTRY__||{};return i[e]||(i[e]=t())}const zs=Ns();function Bs(e,t={}){if(!e)return"<unknown>";try{let n=e;const r=5,i=[];let o=0,a=0;const s=" > ",l=s.length;let c;const u=Array.isArray(t)?t:t.keyAttrs,d=!Array.isArray(t)&&t.maxStringLength||80;for(;n&&o++<r&&(c=Us(n,u),!("html"===c||o>1&&a+i.length*l+c.length>=d));)i.push(c),a+=c.length,n=n.parentNode;return i.reverse().join(s)}catch{return"<unknown>"}}function Us(e,t){const n=e,r=[];let i,o,a,s,l;if(!n||!n.tagName)return"";if(zs.HTMLElement&&n instanceof HTMLElement&&n.dataset&&n.dataset.sentryComponent)return n.dataset.sentryComponent;r.push(n.tagName.toLowerCase());const c=t&&t.length?t.filter(e=>n.getAttribute(e)).map(e=>[e,n.getAttribute(e)]):null;if(c&&c.length)c.forEach(e=>{r.push(`[${e[0]}="${e[1]}"]`)});else if(n.id&&r.push(`#${n.id}`),i=n.className,i&&ws(i))for(o=i.split(/\s+/),l=0;l<o.length;l++)r.push(`.${o[l]}`);const u=["aria-label","type","name","title","alt"];for(l=0;l<u.length;l++)a=u[l],s=n.getAttribute(a),s&&r.push(`[${a}="${s}"]`);return r.join("")}const Vs=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Hs=["debug","info","warn","error","log","assert","trace"],Ws={};function $s(e){if(!("console"in Ls))return e();const t=Ls.console,n={},r=Object.keys(Ws);r.forEach(e=>{const r=Ws[e];n[e]=t[e],t[e]=r});try{return e()}finally{r.forEach(e=>{t[e]=n[e]})}}const Gs=function(){let e=!1;const t={enable:()=>{e=!0},disable:()=>{e=!1},isEnabled:()=>e};return Vs?Hs.forEach(n=>{t[n]=(...t)=>{e&&$s(()=>{Ls.console[n](`Sentry Logger [${n}]:`,...t)})}}):Hs.forEach(e=>{t[e]=()=>{}}),t}(),qs=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function Ys(e,t=!1){const{host:n,path:r,pass:i,port:o,projectId:a,protocol:s,publicKey:l}=e;return`${s}://${l}${t&&i?`:${i}`:""}@${n}${o?`:${o}`:""}/${r&&`${r}/`}${a}`}function Xs(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}class Ks extends Error{constructor(e,t="warn"){super(e),this.message=e,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=t}}function Zs(e,t,n){if(!(t in e))return;const r=e[t],i=n(r);"function"==typeof i&&Qs(i,r),e[t]=i}function Js(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{Vs&&Gs.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function Qs(e,t){try{const n=t.prototype||{};e.prototype=t.prototype=n,Js(e,"__sentry_original__",t)}catch{}}function el(e){return e.__sentry_original__}function tl(e){if(ms(e))return{message:e.message,name:e.name,stack:e.stack,...rl(e)};if(Ss(e)){const t={type:e.type,target:nl(e.target),currentTarget:nl(e.currentTarget),...rl(e)};return typeof CustomEvent<"u"&&ks(e,CustomEvent)&&(t.detail=e.detail),t}return e}function nl(e){try{return function(e){return typeof Element<"u"&&ks(e,Element)}(e)?Bs(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function rl(e){if("object"==typeof e&&null!==e){const t={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}return{}}function il(e){return ol(e,new Map)}function ol(e,t){if(function(e){if(!_s(e))return!1;try{const t=Object.getPrototypeOf(e).constructor.name;return!t||"Object"===t}catch{return!0}}(e)){const n=t.get(e);if(void 0!==n)return n;const r={};t.set(e,r);for(const i of Object.keys(e))typeof e[i]<"u"&&(r[i]=ol(e[i],t));return r}if(Array.isArray(e)){const n=t.get(e);if(void 0!==n)return n;const r=[];return t.set(e,r),e.forEach(e=>{r.push(ol(e,t))}),r}return e}const al=/\(error: (.*)\)/,sl=/captureMessage|captureException/;function ll(...e){const t=e.sort((e,t)=>e[0]-t[0]).map(e=>e[1]);return(e,n=0)=>{const r=[],i=e.split("\n");for(let o=n;o<i.length;o++){const e=i[o];if(e.length>1024)continue;const n=al.test(e)?e.replace(al,"$1"):e;if(!n.match(/\S*Error: /)){for(const e of t){const t=e(n);if(t){r.push(t);break}}if(r.length>=50)break}}return function(e){if(!e.length)return[];const t=Array.from(e);return/sentryWrapped/.test(t[t.length-1].function||"")&&t.pop(),t.reverse(),sl.test(t[t.length-1].function||"")&&(t.pop(),sl.test(t[t.length-1].function||"")&&t.pop()),t.slice(0,50).map(e=>({...e,filename:e.filename||t[t.length-1].filename,function:e.function||"?"}))}(r)}}function cl(e){return Array.isArray(e)?ll(...e):e}const ul="<anonymous>";function dl(e){try{return e&&"function"==typeof e&&e.name||ul}catch{return ul}}const hl={},fl={};function pl(e,t){hl[e]=hl[e]||[],hl[e].push(t)}function gl(e,t){fl[e]||(t(),fl[e]=!0)}function ml(e,t){const n=e&&hl[e];if(n)for(const r of n)try{r(t)}catch(t){Vs&&Gs.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${dl(r)}\nError:`,t)}}function vl(){"console"in Ls&&Hs.forEach(function(e){e in Ls.console&&Zs(Ls.console,e,function(t){return Ws[e]=t,function(...t){ml("console",{args:t,level:e});const n=Ws[e];n&&n.apply(Ls.console,t)}})})}function yl(){const e=Ls,t=e.crypto||e.msCrypto;let n=()=>16*Math.random();try{if(t&&t.randomUUID)return t.randomUUID().replace(/-/g,"");t&&t.getRandomValues&&(n=()=>{const e=new Uint8Array(1);return t.getRandomValues(e),e[0]})}catch{}return([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,e=>(e^(15&n())>>e/4).toString(16))}function bl(e){return e.exception&&e.exception.values?e.exception.values[0]:void 0}function wl(e){const{message:t,event_id:n}=e;if(t)return t;const r=bl(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function xl(e,t,n){const r=e.exception=e.exception||{},i=r.values=r.values||[],o=i[0]=i[0]||{};o.value||(o.value=t||""),o.type||(o.type="Error")}function Cl(e,t){const n=bl(e);if(!n)return;const r=n.mechanism;if(n.mechanism={type:"generic",handled:!0,...r,...t},t&&"data"in t){const e={...r&&r.data,...t.data};n.mechanism.data=e}}function _l(e){if(e&&e.__sentry_captured__)return!0;try{Js(e,"__sentry_captured__",!0)}catch{}return!1}function Sl(e){return Array.isArray(e)?e:[e]}const Al=Ls;let kl,El,Il;function jl(){if(!Al.document)return;const e=ml.bind(null,"dom"),t=Tl(e,!0);Al.document.addEventListener("click",t,!1),Al.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(t=>{const n=Al[t]&&Al[t].prototype;!n||!n.hasOwnProperty||!n.hasOwnProperty("addEventListener")||(Zs(n,"addEventListener",function(t){return function(n,r,i){if("click"===n||"keypress"==n)try{const r=this,o=r.__sentry_instrumentation_handlers__=r.__sentry_instrumentation_handlers__||{},a=o[n]=o[n]||{refCount:0};if(!a.handler){const r=Tl(e);a.handler=r,t.call(this,n,r,i)}a.refCount++}catch{}return t.call(this,n,r,i)}}),Zs(n,"removeEventListener",function(e){return function(t,n,r){if("click"===t||"keypress"==t)try{const n=this,i=n.__sentry_instrumentation_handlers__||{},o=i[t];o&&(o.refCount--,o.refCount<=0&&(e.call(this,t,o.handler,r),o.handler=void 0,delete i[t]),0===Object.keys(i).length&&delete n.__sentry_instrumentation_handlers__)}catch{}return e.call(this,t,n,r)}}))})}function Tl(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const r=function(e){try{return e.target}catch{return null}}(n);if(function(e,t){return!("keypress"!==e||t&&t.tagName&&("INPUT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable))}(n.type,r))return;Js(n,"_sentryCaptured",!0),r&&!r._sentryId&&Js(r,"_sentryId",yl());const i="keypress"===n.type?"input":n.type;(function(e){if(e.type!==El)return!1;try{if(!e.target||e.target._sentryId!==Il)return!1}catch{}return!0})(n)||(e({event:n,name:i,global:t}),El=n.type,Il=r?r._sentryId:void 0),clearTimeout(kl),kl=Al.setTimeout(()=>{Il=void 0,El=void 0},1e3)}}const Fl=Ns();function Ol(){if(!("fetch"in Fl))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function Ml(e){return e&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function Pl(){(function(){if("string"==typeof EdgeRuntime)return!0;if(!Ol())return!1;if(Ml(Fl.fetch))return!0;let e=!1;const t=Fl.document;if(t&&"function"==typeof t.createElement)try{const n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow&&n.contentWindow.fetch&&(e=Ml(n.contentWindow.fetch)),t.head.removeChild(n)}catch(e){Vs&&Gs.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return e})()&&Zs(Ls,"fetch",function(e){return function(...t){const{method:n,url:r}=function(e){if(0===e.length)return{method:"GET",url:""};if(2===e.length){const[t,n]=e;return{url:Ll(t),method:Rl(n,"method")?String(n.method).toUpperCase():"GET"}}const t=e[0];return{url:Ll(t),method:Rl(t,"method")?String(t.method).toUpperCase():"GET"}}(t),i={args:t,fetchData:{method:n,url:r},startTimestamp:Date.now()};return ml("fetch",{...i}),e.apply(Ls,t).then(e=>(ml("fetch",{...i,endTimestamp:Date.now(),response:e}),e),e=>{throw ml("fetch",{...i,endTimestamp:Date.now(),error:e}),e})}})}function Rl(e,t){return!!e&&"object"==typeof e&&!!e[t]}function Ll(e){return"string"==typeof e?e:e?Rl(e,"url")?e.url:e.toString?e.toString():"":""}let Nl=null;function Dl(){Nl=Ls.onerror,Ls.onerror=function(e,t,n,r,i){return ml("error",{column:r,error:i,line:n,msg:e,url:t}),!(!Nl||Nl.__SENTRY_LOADER__)&&Nl.apply(this,arguments)},Ls.onerror.__SENTRY_INSTRUMENTED__=!0}let zl=null;function Bl(){zl=Ls.onunhandledrejection,Ls.onunhandledrejection=function(e){return ml("unhandledrejection",e),!(zl&&!zl.__SENTRY_LOADER__)||zl.apply(this,arguments)},Ls.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const Ul=Ns(),Vl=Ls;let Hl;function Wl(e){const t="history";pl(t,e),gl(t,$l)}function $l(){if(!function(){const e=Ul.chrome,t=e&&e.app&&e.app.runtime,n="history"in Ul&&!!Ul.history.pushState&&!!Ul.history.replaceState;return!t&&n}())return;const e=Vl.onpopstate;function t(e){return function(...t){const n=t.length>2?t[2]:void 0;if(n){const e=Hl,t=String(n);Hl=t,ml("history",{from:e,to:t})}return e.apply(this,t)}}Vl.onpopstate=function(...t){const n=Vl.location.href,r=Hl;if(Hl=n,ml("history",{from:r,to:n}),e)try{return e.apply(this,t)}catch{}},Zs(Vl.history,"pushState",t),Zs(Vl.history,"replaceState",t)}const Gl=Ls,ql="__sentry_xhr_v3__";function Yl(){if(!Gl.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;Zs(e,"open",function(e){return function(...t){const n=Date.now(),r=ws(t[0])?t[0].toUpperCase():void 0,i=function(e){if(ws(e))return e;try{return e.toString()}catch{}}(t[1]);if(!r||!i)return e.apply(this,t);this[ql]={method:r,url:i,request_headers:{}},"POST"===r&&i.match(/sentry_key/)&&(this.__sentry_own_request__=!0);const o=()=>{const e=this[ql];if(e&&4===this.readyState){try{e.status_code=this.status}catch{}ml("xhr",{args:[r,i],endTimestamp:Date.now(),startTimestamp:n,xhr:this})}};return"onreadystatechange"in this&&"function"==typeof this.onreadystatechange?Zs(this,"onreadystatechange",function(e){return function(...t){return o(),e.apply(this,t)}}):this.addEventListener("readystatechange",o),Zs(this,"setRequestHeader",function(e){return function(...t){const[n,r]=t,i=this[ql];return i&&ws(n)&&ws(r)&&(i.request_headers[n.toLowerCase()]=r),e.apply(this,t)}}),e.apply(this,t)}}),Zs(e,"send",function(e){return function(...t){const n=this[ql];return n?(void 0!==t[0]&&(n.body=t[0]),ml("xhr",{args:[n.method,n.url],startTimestamp:Date.now(),xhr:this}),e.apply(this,t)):e.apply(this,t)}})}function Xl(e,t=100,n=1/0){try{return Zl("",e,t,n)}catch(e){return{ERROR:`**non-serializable** (${e})`}}}function Kl(e,t=3,n=102400){const r=Xl(e,t);return function(e){return function(e){return~-encodeURI(e).split(/%..|./).length}(JSON.stringify(e))}(r)>n?Kl(e,t-1,n):r}function Zl(e,t,r=1/0,i=1/0,o=function(){const e="function"==typeof WeakSet,t=e?new WeakSet:[];return[function(n){if(e)return!!t.has(n)||(t.add(n),!1);for(let e=0;e<t.length;e++)if(t[e]===n)return!0;return t.push(n),!1},function(n){if(e)t.delete(n);else for(let e=0;e<t.length;e++)if(t[e]===n){t.splice(e,1);break}}]}()){const[a,s]=o;if(null==t||["number","boolean","string"].includes(typeof t)&&!function(e){return"number"==typeof e&&e!=e}(t))return t;const l=function(e,t){try{if("domain"===e&&t&&"object"==typeof t&&t._events)return"[Domain]";if("domainEmitter"===e)return"[DomainEmitter]";if(typeof n.g<"u"&&t===n.g)return"[Global]";if(typeof window<"u"&&t===window)return"[Window]";if(typeof document<"u"&&t===document)return"[Document]";if(Es(t))return"[VueViewModel]";if(function(e){return _s(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}(t))return"[SyntheticEvent]";if("number"==typeof t&&t!=t)return"[NaN]";if("function"==typeof t)return`[Function: ${dl(t)}]`;if("symbol"==typeof t)return`[${String(t)}]`;if("bigint"==typeof t)return`[BigInt: ${String(t)}]`;const r=function(e){const t=Object.getPrototypeOf(e);return t?t.constructor.name:"null prototype"}(t);return/^HTML(\w*)Element$/.test(r)?`[HTMLElement: ${r}]`:`[object ${r}]`}catch(e){return`**non-serializable** (${e})`}}(e,t);if(!l.startsWith("[object "))return l;if(t.__sentry_skip_normalization__)return t;const c="number"==typeof t.__sentry_override_normalization_depth__?t.__sentry_override_normalization_depth__:r;if(0===c)return l.replace("object ","");if(a(t))return"[Circular ~]";const u=t;if(u&&"function"==typeof u.toJSON)try{return Zl("",u.toJSON(),c-1,i,o)}catch{}const d=Array.isArray(t)?[]:{};let h=0;const f=tl(t);for(const n in f){if(!Object.prototype.hasOwnProperty.call(f,n))continue;if(h>=i){d[n]="[MaxProperties ~]";break}const e=f[n];d[n]=Zl(n,e,c-1,i,o),h++}return s(t),d}var Jl;function Ql(e){return new tc(t=>{t(e)})}function ec(e){return new tc((t,n)=>{n(e)})}!function(e){e[e.PENDING=0]="PENDING",e[e.RESOLVED=1]="RESOLVED",e[e.REJECTED=2]="REJECTED"}(Jl||(Jl={}));class tc{constructor(e){tc.prototype.__init.call(this),tc.prototype.__init2.call(this),tc.prototype.__init3.call(this),tc.prototype.__init4.call(this),this._state=Jl.PENDING,this._handlers=[];try{e(this._resolve,this._reject)}catch(e){this._reject(e)}}then(e,t){return new tc((n,r)=>{this._handlers.push([!1,t=>{if(e)try{n(e(t))}catch(e){r(e)}else n(t)},e=>{if(t)try{n(t(e))}catch(e){r(e)}else r(e)}]),this._executeHandlers()})}catch(e){return this.then(e=>e,e)}finally(e){return new tc((t,n)=>{let r,i;return this.then(t=>{i=!1,r=t,e&&e()},t=>{i=!0,r=t,e&&e()}).then(()=>{i?n(r):t(r)})})}__init(){this._resolve=e=>{this._setResult(Jl.RESOLVED,e)}}__init2(){this._reject=e=>{this._setResult(Jl.REJECTED,e)}}__init3(){this._setResult=(e,t)=>{if(this._state===Jl.PENDING){if(As(t))return void t.then(this._resolve,this._reject);this._state=e,this._value=t,this._executeHandlers()}}}__init4(){this._executeHandlers=()=>{if(this._state===Jl.PENDING)return;const e=this._handlers.slice();this._handlers=[],e.forEach(e=>{e[0]||(this._state===Jl.RESOLVED&&e[1](this._value),this._state===Jl.REJECTED&&e[2](this._value),e[0]=!0)})}}}function nc(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}const rc=["fatal","error","warning","log","info","debug"];function ic(e){return"warn"===e?"warning":rc.includes(e)?e:"log"}function oc(){return Date.now()/1e3}const ac=function(){const{performance:e}=Ls;if(!e||!e.now)return oc;const t=Date.now()-e.now(),n=null==e.timeOrigin?t:e.timeOrigin;return()=>(n+e.now())/1e3}();function sc(e,t=[]){return[e,t]}function lc(e,t){const[n,r]=e;return[n,[...r,t]]}function cc(e,t){const n=e[1];for(const r of n)if(t(r,r[0].type))return!0;return!1}function uc(e,t){return(t||new TextEncoder).encode(e)}function dc(e,t){const[n,r]=e;let i=JSON.stringify(n);function o(e){"string"==typeof i?i="string"==typeof e?i+e:[uc(i,t),e]:i.push("string"==typeof e?uc(e,t):e)}for(const a of r){const[e,t]=a;if(o(`\n${JSON.stringify(e)}\n`),"string"==typeof t||t instanceof Uint8Array)o(t);else{let e;try{e=JSON.stringify(t)}catch{e=JSON.stringify(Xl(t))}o(e)}}return"string"==typeof i?i:function(e){const t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t);let r=0;for(const i of e)n.set(i,r),r+=i.length;return n}(i)}function hc(e,t){const n="string"==typeof e.data?uc(e.data,t):e.data;return[il({type:"attachment",length:n.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType}),n]}(()=>{const{performance:e}=Ls;if(!e||!e.now)return;const t=36e5,n=e.now(),r=Date.now(),i=e.timeOrigin?Math.abs(e.timeOrigin+n-r):t,o=i<t,a=e.timing&&e.timing.navigationStart,s="number"==typeof a?Math.abs(a+n-r):t;(o||s<t)&&i<=s&&e.timeOrigin})();const fc={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",statsd:"metric_bucket"};function pc(e){return fc[e]}function gc(e){if(!e||!e.sdk)return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}const mc=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,vc="production";function yc(){return Ds("globalEventProcessors",()=>[])}function bc(e){yc().push(e)}function wc(e,t,n,r=0){return new tc((i,o)=>{const a=e[r];if(null===t||"function"!=typeof a)i(t);else{const s=a({...t},n);mc&&a.id&&null===s&&Gs.log(`Event processor "${a.id}" dropped event`),As(s)?s.then(t=>wc(e,t,n,r+1).then(i)).then(null,o):wc(e,s,n,r+1).then(i).then(null,o)}})}function xc(e){const t=ac(),n={sid:yl(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(e){return il({sid:`${e.sid}`,init:e.init,started:new Date(1e3*e.started).toISOString(),timestamp:new Date(1e3*e.timestamp).toISOString(),status:e.status,errors:e.errors,did:"number"==typeof e.did||"string"==typeof e.did?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}})}(n)};return e&&Cc(n,e),n}function Cc(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||ac(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:yl()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),"number"==typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"==typeof t.duration)e.duration=t.duration;else{const t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"==typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}function _c(e,t){let n={};"ok"===e.status&&(n={status:"exited"}),Cc(e,n)}function Sc(e){const{spanId:t,traceId:n}=e.spanContext(),{data:r,op:i,parent_span_id:o,status:a,tags:s,origin:l}=Ac(e);return il({data:r,op:i,parent_span_id:o,span_id:t,status:a,tags:s,trace_id:n,origin:l})}function Ac(e){return function(e){return"function"==typeof e.getSpanJSON}(e)?e.getSpanJSON():"function"==typeof e.toJSON?e.toJSON():{}}const kc=new WeakMap;function Ec(e,t){return Kc().captureEvent(e,t)}function Ic(e,t){Kc().addBreadcrumb(e,t)}function jc(){return Kc().getClient()}function Tc(){return Kc().getScope()}function Fc(e){const t=jc(),n=Zc(),r=Tc(),{release:i,environment:o=vc}=t&&t.getOptions()||{},{userAgent:a}=Ls.navigator||{},s=xc({release:i,environment:o,user:r.getUser()||n.getUser(),...a&&{userAgent:a},...e}),l=n.getSession();return l&&"ok"===l.status&&Cc(l,{status:"exited"}),Oc(),n.setSession(s),r.setSession(s),s}function Oc(){const e=Zc(),t=Tc(),n=t.getSession()||e.getSession();n&&_c(n),Mc(),e.setSession(),t.setSession()}function Mc(){const e=Zc(),t=Tc(),n=jc(),r=t.getSession()||e.getSession();r&&n&&n.captureSession&&n.captureSession(r)}function Pc(e=!1){e?Oc():Mc()}function Rc(e){return e.transaction}function Lc(e,t,n){const r=t.getOptions(),{publicKey:i}=t.getDsn()||{},{segment:o}=n&&n.getUser()||{},a=il({environment:r.environment||vc,release:r.release,user_segment:o,public_key:i,trace_id:e});return t.emit&&t.emit("createDsc",a),a}function Nc(e){const t=jc();if(!t)return{};const n=Lc(Ac(e).trace_id||"",t,Tc()),r=Rc(e);if(!r)return n;const i=r&&r._frozenDynamicSamplingContext;if(i)return i;const{sampleRate:o,source:a}=r.metadata;null!=o&&(n.sample_rate=`${o}`);const s=Ac(r);return a&&"url"!==a&&(n.transaction=s.description),n.sampled=String(function(e){const{traceFlags:t}=e.spanContext();return!!(1&t)}(r)),t.emit&&t.emit("createDsc",n),n}function Dc(e,t){const{fingerprint:n,span:r,breadcrumbs:i,sdkProcessingMetadata:o}=t;(function(e,t){const{extra:n,tags:r,user:i,contexts:o,level:a,transactionName:s}=t,l=il(n);l&&Object.keys(l).length&&(e.extra={...l,...e.extra});const c=il(r);c&&Object.keys(c).length&&(e.tags={...c,...e.tags});const u=il(i);u&&Object.keys(u).length&&(e.user={...u,...e.user});const d=il(o);d&&Object.keys(d).length&&(e.contexts={...d,...e.contexts}),a&&(e.level=a),s&&(e.transaction=s)})(e,t),r&&function(e,t){e.contexts={trace:Sc(t),...e.contexts};const n=Rc(t);if(n){e.sdkProcessingMetadata={dynamicSamplingContext:Nc(t),...e.sdkProcessingMetadata};const r=Ac(n).description;r&&(e.tags={transaction:r,...e.tags})}}(e,r),function(e,t){e.fingerprint=e.fingerprint?Sl(e.fingerprint):[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint}(e,n),function(e,t){const n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}(e,i),function(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}(e,o)}function zc(e,t){const{extra:n,tags:r,user:i,contexts:o,level:a,sdkProcessingMetadata:s,breadcrumbs:l,fingerprint:c,eventProcessors:u,attachments:d,propagationContext:h,transactionName:f,span:p}=t;Bc(e,"extra",n),Bc(e,"tags",r),Bc(e,"user",i),Bc(e,"contexts",o),Bc(e,"sdkProcessingMetadata",s),a&&(e.level=a),f&&(e.transactionName=f),p&&(e.span=p),l.length&&(e.breadcrumbs=[...e.breadcrumbs,...l]),c.length&&(e.fingerprint=[...e.fingerprint,...c]),u.length&&(e.eventProcessors=[...e.eventProcessors,...u]),d.length&&(e.attachments=[...e.attachments,...d]),e.propagationContext={...e.propagationContext,...h}}function Bc(e,t,n){if(n&&Object.keys(n).length){e[t]={...e[t]};for(const r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[t][r]=n[r])}}let Uc;class Vc{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=Hc()}static clone(e){return e?e.clone():new Vc}clone(){const e=new Vc;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._extra={...this._extra},e._contexts={...this._contexts},e._user=this._user,e._level=this._level,e._span=this._span,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._requestSession=this._requestSession,e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e}setClient(e){this._client=e}getClient(){return this._client}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,segment:void 0,username:void 0},this._session&&Cc(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this._tags={...this._tags,[e]:t},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return null===t?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSpan(e){return this._span=e,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){const e=this._span;return e&&e.transaction}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;const t="function"==typeof e?e(this):e;if(t instanceof Vc){const e=t.getScopeData();this._tags={...this._tags,...e.tags},this._extra={...this._extra,...e.extra},this._contexts={...this._contexts,...e.contexts},e.user&&Object.keys(e.user).length&&(this._user=e.user),e.level&&(this._level=e.level),e.fingerprint.length&&(this._fingerprint=e.fingerprint),t.getRequestSession()&&(this._requestSession=t.getRequestSession()),e.propagationContext&&(this._propagationContext=e.propagationContext)}else if(_s(t)){const t=e;this._tags={...this._tags,...t.tags},this._extra={...this._extra,...t.extra},this._contexts={...this._contexts,...t.contexts},t.user&&(this._user=t.user),t.level&&(this._level=t.level),t.fingerprint&&(this._fingerprint=t.fingerprint),t.requestSession&&(this._requestSession=t.requestSession),t.propagationContext&&(this._propagationContext=t.propagationContext)}return this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this._attachments=[],this._propagationContext=Hc(),this}addBreadcrumb(e,t){const n="number"==typeof t?t:100;if(n<=0)return this;const r={timestamp:oc(),...e},i=this._breadcrumbs;return i.push(r),this._breadcrumbs=i.length>n?i.slice(-n):i,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}getAttachments(){return this.getScopeData().attachments}clearAttachments(){return this._attachments=[],this}getScopeData(){const{_breadcrumbs:e,_attachments:t,_contexts:n,_tags:r,_extra:i,_user:o,_level:a,_fingerprint:s,_eventProcessors:l,_propagationContext:c,_sdkProcessingMetadata:u,_transactionName:d,_span:h}=this;return{breadcrumbs:e,attachments:t,contexts:n,tags:r,extra:i,user:o,level:a,fingerprint:s||[],eventProcessors:l,propagationContext:c,sdkProcessingMetadata:u,transactionName:d,span:h}}applyToEvent(e,t={},n=[]){return Dc(e,this.getScopeData()),wc([...n,...yc(),...this._eventProcessors],e,t)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...e},this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,t){const n=t&&t.event_id?t.event_id:yl();if(!this._client)return Gs.warn("No client configured on scope - will not capture exception!"),n;const r=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:r,...t,event_id:n},this),n}captureMessage(e,t,n){const r=n&&n.event_id?n.event_id:yl();if(!this._client)return Gs.warn("No client configured on scope - will not capture message!"),r;const i=new Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:i,...n,event_id:r},this),r}captureEvent(e,t){const n=t&&t.event_id?t.event_id:yl();return this._client?(this._client.captureEvent(e,{...t,event_id:n},this),n):(Gs.warn("No client configured on scope - will not capture event!"),n)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}}function Hc(){return{traceId:yl(),spanId:yl().substring(16)}}const Wc="7.116.0",$c=parseFloat(Wc),Gc=100;class qc{constructor(e,t,n,r=$c){let i,o;this._version=r,t?i=t:(i=new Vc,i.setClient(e)),n?o=n:(o=new Vc,o.setClient(e)),this._stack=[{scope:i}],e&&this.bindClient(e),this._isolationScope=o}isOlderThan(e){return this._version<e}bindClient(e){const t=this.getStackTop();t.client=e,t.scope.setClient(e),e&&e.setupIntegrations&&e.setupIntegrations()}pushScope(){const e=this.getScope().clone();return this.getStack().push({client:this.getClient(),scope:e}),e}popScope(){return!(this.getStack().length<=1)&&!!this.getStack().pop()}withScope(e){const t=this.pushScope();let n;try{n=e(t)}catch(e){throw this.popScope(),e}return As(n)?n.then(e=>(this.popScope(),e),e=>{throw this.popScope(),e}):(this.popScope(),n)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStack(){return this._stack}getStackTop(){return this._stack[this._stack.length-1]}captureException(e,t){const n=this._lastEventId=t&&t.event_id?t.event_id:yl(),r=new Error("Sentry syntheticException");return this.getScope().captureException(e,{originalException:e,syntheticException:r,...t,event_id:n}),n}captureMessage(e,t,n){const r=this._lastEventId=n&&n.event_id?n.event_id:yl(),i=new Error(e);return this.getScope().captureMessage(e,t,{originalException:e,syntheticException:i,...n,event_id:r}),r}captureEvent(e,t){const n=t&&t.event_id?t.event_id:yl();return e.type||(this._lastEventId=n),this.getScope().captureEvent(e,{...t,event_id:n}),n}lastEventId(){return this._lastEventId}addBreadcrumb(e,t){const{scope:n,client:r}=this.getStackTop();if(!r)return;const{beforeBreadcrumb:i=null,maxBreadcrumbs:o=Gc}=r.getOptions&&r.getOptions()||{};if(o<=0)return;const a={timestamp:oc(),...e},s=i?$s(()=>i(a,t)):a;null!==s&&(r.emit&&r.emit("beforeAddBreadcrumb",s,t),n.addBreadcrumb(s,o))}setUser(e){this.getScope().setUser(e),this.getIsolationScope().setUser(e)}setTags(e){this.getScope().setTags(e),this.getIsolationScope().setTags(e)}setExtras(e){this.getScope().setExtras(e),this.getIsolationScope().setExtras(e)}setTag(e,t){this.getScope().setTag(e,t),this.getIsolationScope().setTag(e,t)}setExtra(e,t){this.getScope().setExtra(e,t),this.getIsolationScope().setExtra(e,t)}setContext(e,t){this.getScope().setContext(e,t),this.getIsolationScope().setContext(e,t)}configureScope(e){const{scope:t,client:n}=this.getStackTop();n&&e(t)}run(e){const t=Xc(this);try{e(this)}finally{Xc(t)}}getIntegration(e){const t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch{return mc&&Gs.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,t){const n=this._callExtensionMethod("startTransaction",e,t);return mc&&!n&&(this.getClient()?Gs.warn("Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':\nSentry.addTracingExtensions();\nSentry.init({...});\n"):Gs.warn("Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'")),n}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){const e=this.getStackTop().scope,t=e.getSession();t&&_c(t),this._sendSessionUpdate(),e.setSession()}startSession(e){const{scope:t,client:n}=this.getStackTop(),{release:r,environment:i=vc}=n&&n.getOptions()||{},{userAgent:o}=Ls.navigator||{},a=xc({release:r,environment:i,user:t.getUser(),...o&&{userAgent:o},...e}),s=t.getSession&&t.getSession();return s&&"ok"===s.status&&Cc(s,{status:"exited"}),this.endSession(),t.setSession(a),a}shouldSendDefaultPii(){const e=this.getClient(),t=e&&e.getOptions();return!(!t||!t.sendDefaultPii)}_sendSessionUpdate(){const{scope:e,client:t}=this.getStackTop(),n=e.getSession();n&&t&&t.captureSession&&t.captureSession(n)}_callExtensionMethod(e,...t){const n=Yc().__SENTRY__;if(n&&n.extensions&&"function"==typeof n.extensions[e])return n.extensions[e].apply(this,t);mc&&Gs.warn(`Extension method ${e} couldn't be found, doing nothing.`)}}function Yc(){return Ls.__SENTRY__=Ls.__SENTRY__||{extensions:{},hub:void 0},Ls}function Xc(e){const t=Yc(),n=Jc(t);return Qc(t,e),n}function Kc(){const e=Yc();if(e.__SENTRY__&&e.__SENTRY__.acs){const t=e.__SENTRY__.acs.getCurrentHub();if(t)return t}return function(e=Yc()){return(!function(e){return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}(e)||Jc(e).isOlderThan($c))&&Qc(e,new qc),Jc(e)}(e)}function Zc(){return Kc().getIsolationScope()}function Jc(e){return Ds("hub",()=>new qc,e)}function Qc(e,t){return!!e&&((e.__SENTRY__=e.__SENTRY__||{}).hub=t,!0)}const eu=[];function tu(e){const t=e.defaultIntegrations||[],n=e.integrations;let r;t.forEach(e=>{e.isDefaultInstance=!0}),r=Array.isArray(n)?[...t,...n]:"function"==typeof n?Sl(n(t)):t;const i=function(e){const t={};return e.forEach(e=>{const{name:n}=e,r=t[n];r&&!r.isDefaultInstance&&e.isDefaultInstance||(t[n]=e)}),Object.keys(t).map(e=>t[e])}(r),o=function(e,t){for(let n=0;n<e.length;n++)if(!0===t(e[n]))return n;return-1}(i,e=>"Debug"===e.name);if(-1!==o){const[e]=i.splice(o,1);i.push(e)}return i}function nu(e,t){for(const n of t)n&&n.afterAllSetup&&n.afterAllSetup(e)}function ru(e,t,n){if(n[t.name])mc&&Gs.log(`Integration skipped because it was already installed: ${t.name}`);else{if(n[t.name]=t,-1===eu.indexOf(t.name)&&(t.setupOnce(bc,Kc),eu.push(t.name)),t.setup&&"function"==typeof t.setup&&t.setup(e),e.on&&"function"==typeof t.preprocessEvent){const n=t.preprocessEvent.bind(t);e.on("preprocessEvent",(t,r)=>n(t,r,e))}if(e.addEventProcessor&&"function"==typeof t.processEvent){const n=t.processEvent.bind(t),r=Object.assign((t,r)=>n(t,r,e),{id:t.name});e.addEventProcessor(r)}mc&&Gs.log(`Integration installed: ${t.name}`)}}function iu(e,t){return Object.assign(function(...e){return t(...e)},{id:e})}const ou="Not capturing exception because it's already been captured.";class au{constructor(e){if(this._options=e,this._integrations={},this._integrationsInitialized=!1,this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=function(e){const t="string"==typeof e?function(e){const t=qs.exec(e);if(!t)return void $s(()=>{});const[n,r,i="",o,a="",s]=t.slice(1);let l="",c=s;const u=c.split("/");if(u.length>1&&(l=u.slice(0,-1).join("/"),c=u.pop()),c){const e=c.match(/^\d+/);e&&(c=e[0])}return Xs({host:o,pass:i,path:l,projectId:c,port:a,protocol:n,publicKey:r})}(e):Xs(e);if(t&&function(e){if(!Vs)return!0;const{port:t,projectId:n,protocol:r}=e;return!(["protocol","publicKey","host","projectId"].find(t=>!e[t]&&(Gs.error(`Invalid Sentry Dsn: ${t} missing`),!0))||(n.match(/^\d+$/)?function(e){return"http"===e||"https"===e}(r)?t&&isNaN(parseInt(t,10))&&(Gs.error(`Invalid Sentry Dsn: Invalid port ${t}`),1):(Gs.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),1):(Gs.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),1)))}(t))return t}(e.dsn):mc&&Gs.warn("No DSN provided, client will not send events."),this._dsn){const t=function(e,t={}){const n="string"==typeof t?t:t.tunnel,r="string"!=typeof t&&t._metadata?t._metadata.sdk:void 0;return n||`${function(e){return`${function(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}(e)}${e.projectId}/envelope/`}(e)}?${function(e,t){return function(e){return Object.keys(e).map(t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`).join("&")}({sentry_key:e.publicKey,sentry_version:"7",...t&&{sentry_client:`${t.name}/${t.version}`}})}(e,r)}`}(this._dsn,e);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:t})}}captureException(e,t,n){if(_l(e))return void(mc&&Gs.log(ou));let r=t&&t.event_id;return this._process(this.eventFromException(e,t).then(e=>this._captureEvent(e,t,n)).then(e=>{r=e})),r}captureMessage(e,t,n,r){let i=n&&n.event_id;const o=xs(e)?e:String(e),a=Cs(e)?this.eventFromMessage(o,t,n):this.eventFromException(e,n);return this._process(a.then(e=>this._captureEvent(e,n,r)).then(e=>{i=e})),i}captureEvent(e,t,n){if(t&&t.originalException&&_l(t.originalException))return void(mc&&Gs.log(ou));let r=t&&t.event_id;const i=(e.sdkProcessingMetadata||{}).capturedSpanScope;return this._process(this._captureEvent(e,t,i||n).then(e=>{r=e})),r}captureSession(e){"string"!=typeof e.release?mc&&Gs.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),Cc(e,{init:!1}))}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(e){const t=this._transport;return t?(this.metricsAggregator&&this.metricsAggregator.flush(),this._isClientDoneProcessing(e).then(n=>t.flush(e).then(e=>n&&e))):Ql(!0)}close(e){return this.flush(e).then(e=>(this.getOptions().enabled=!1,this.metricsAggregator&&this.metricsAggregator.close(),e))}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}setupIntegrations(e){(e&&!this._integrationsInitialized||this._isEnabled()&&!this._integrationsInitialized)&&this._setupIntegrations()}init(){this._isEnabled()&&this._setupIntegrations()}getIntegrationById(e){return this.getIntegrationByName(e)}getIntegrationByName(e){return this._integrations[e]}getIntegration(e){try{return this._integrations[e.id]||null}catch{return mc&&Gs.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}addIntegration(e){const t=this._integrations[e.name];ru(this,e,this._integrations),t||nu(this,[e])}sendEvent(e,t={}){this.emit("beforeSendEvent",e,t);let n=function(e,t,n,r){const i=gc(n),o=e.type&&"replay_event"!==e.type?e.type:"event";!function(e,t){t&&(e.sdk=e.sdk||{},e.sdk.name=e.sdk.name||t.name,e.sdk.version=e.sdk.version||t.version,e.sdk.integrations=[...e.sdk.integrations||[],...t.integrations||[]],e.sdk.packages=[...e.sdk.packages||[],...t.packages||[]])}(e,n&&n.sdk);const a=function(e,t,n,r){const i=e.sdkProcessingMetadata&&e.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:e.event_id,sent_at:(new Date).toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:Ys(r)},...i&&{trace:il({...i})}}}(e,i,r,t);return delete e.sdkProcessingMetadata,sc(a,[[{type:o},e]])}(e,this._dsn,this._options._metadata,this._options.tunnel);for(const i of t.attachments||[])n=lc(n,hc(i,this._options.transportOptions&&this._options.transportOptions.textEncoder));const r=this._sendEnvelope(n);r&&r.then(t=>this.emit("afterSendEvent",e,t),null)}sendSession(e){const t=function(e,t,n,r){const i=gc(n);return sc({sent_at:(new Date).toISOString(),...i&&{sdk:i},...!!r&&t&&{dsn:Ys(t)}},["aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()]])}(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(t)}recordDroppedEvent(e,t,n){if(this._options.sendClientReports){const n=`${e}:${t}`;mc&&Gs.log(`Adding outcome: "${n}"`),this._outcomes[n]=this._outcomes[n]+1||1}}captureAggregateMetrics(e){mc&&Gs.log(`Flushing aggregated metrics, number of metrics: ${e.length}`);const t=function(e,t,n,r){const i={sent_at:(new Date).toISOString()};n&&n.sdk&&(i.sdk={name:n.sdk.name,version:n.sdk.version}),r&&t&&(i.dsn=Ys(t));const o=function(e){const t=function(e){let t="";for(const n of e){const e=Object.entries(n.tags),r=e.length>0?`|#${e.map(([e,t])=>`${e}:${t}`).join(",")}`:"";t+=`${n.name}@${n.unit}:${n.metric}|${n.metricType}${r}|T${n.timestamp}\n`}return t}(e);return[{type:"statsd",length:t.length},t]}(e);return sc(i,[o])}(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(t)}on(e,t){this._hooks[e]||(this._hooks[e]=[]),this._hooks[e].push(t)}emit(e,...t){this._hooks[e]&&this._hooks[e].forEach(e=>e(...t))}_setupIntegrations(){const{integrations:e}=this._options;this._integrations=function(e,t){const n={};return t.forEach(t=>{t&&ru(e,t,n)}),n}(this,e),nu(this,e),this._integrationsInitialized=!0}_updateSessionFromEvent(e,t){let n=!1,r=!1;const i=t.exception&&t.exception.values;if(i){r=!0;for(const e of i){const t=e.mechanism;if(t&&!1===t.handled){n=!0;break}}}const o="ok"===e.status;(o&&0===e.errors||o&&n)&&(Cc(e,{...n&&{status:"crashed"},errors:e.errors||Number(r||n)}),this.captureSession(e))}_isClientDoneProcessing(e){return new tc(t=>{let n=0;const r=setInterval(()=>{0==this._numProcessing?(clearInterval(r),t(!0)):(n+=1,e&&n>=e&&(clearInterval(r),t(!1)))},1)})}_isEnabled(){return!1!==this.getOptions().enabled&&void 0!==this._transport}_prepareEvent(e,t,n,r=Zc()){const i=this.getOptions(),o=Object.keys(this._integrations);return!t.integrations&&o.length>0&&(t.integrations=o),this.emit("preprocessEvent",e,t),function(e,t,n,r,i,o){const{normalizeDepth:a=3,normalizeMaxBreadth:s=1e3}=e,l={...t,event_id:t.event_id||n.event_id||yl(),timestamp:t.timestamp||oc()},c=n.integrations||e.integrations.map(e=>e.name);(function(e,t){const{environment:n,release:r,dist:i,maxValueLength:o=250}=t;"environment"in e||(e.environment="environment"in t?n:vc),void 0===e.release&&void 0!==r&&(e.release=r),void 0===e.dist&&void 0!==i&&(e.dist=i),e.message&&(e.message=Is(e.message,o));const a=e.exception&&e.exception.values&&e.exception.values[0];a&&a.value&&(a.value=Is(a.value,o));const s=e.request;s&&s.url&&(s.url=Is(s.url,o))})(l,e),function(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}(l,c),void 0===t.type&&function(e,t){const n=Ls._sentryDebugIds;if(!n)return;let r;const i=kc.get(t);i?r=i:(r=new Map,kc.set(t,r));const o=Object.keys(n).reduce((e,i)=>{let o;const a=r.get(i);a?o=a:(o=t(i),r.set(i,o));for(let t=o.length-1;t>=0;t--){const r=o[t];if(r.filename){e[r.filename]=n[i];break}}return e},{});try{e.exception.values.forEach(e=>{e.stacktrace.frames.forEach(e=>{e.filename&&(e.debug_id=o[e.filename])})})}catch{}}(l,e.stackParser);const u=function(e,t){if(!t)return e;const n=e?e.clone():new Vc;return n.update(t),n}(r,n.captureContext);n.mechanism&&Cl(l,n.mechanism);const d=i&&i.getEventProcessors?i.getEventProcessors():[],h=(Uc||(Uc=new Vc),Uc).getScopeData();o&&zc(h,o.getScopeData()),u&&zc(h,u.getScopeData());const f=[...n.attachments||[],...h.attachments];return f.length&&(n.attachments=f),Dc(l,h),wc([...d,...yc(),...h.eventProcessors],l,n).then(e=>(e&&function(e){const t={};try{e.exception.values.forEach(e=>{e.stacktrace.frames.forEach(e=>{e.debug_id&&(e.abs_path?t[e.abs_path]=e.debug_id:e.filename&&(t[e.filename]=e.debug_id),delete e.debug_id)})})}catch{}if(0===Object.keys(t).length)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];const n=e.debug_meta.images;Object.keys(t).forEach(e=>{n.push({type:"sourcemap",code_file:e,debug_id:t[e]})})}(e),"number"==typeof a&&a>0?function(e,t,n){if(!e)return null;const r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(e=>({...e,...e.data&&{data:Xl(e.data,t,n)}}))},...e.user&&{user:Xl(e.user,t,n)},...e.contexts&&{contexts:Xl(e.contexts,t,n)},...e.extra&&{extra:Xl(e.extra,t,n)}};return e.contexts&&e.contexts.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=Xl(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(e=>{const r=Ac(e).data;return r&&(e.data=Xl(r,t,n)),e})),r}(e,a,s):e))}(i,e,t,n,this,r).then(e=>{if(null===e)return e;const t={...r.getPropagationContext(),...n?n.getPropagationContext():void 0};if((!e.contexts||!e.contexts.trace)&&t){const{traceId:r,spanId:i,parentSpanId:o,dsc:a}=t;e.contexts={trace:{trace_id:r,span_id:i,parent_span_id:o},...e.contexts};const s=a||Lc(r,this,n);e.sdkProcessingMetadata={dynamicSamplingContext:s,...e.sdkProcessingMetadata}}return e})}_captureEvent(e,t={},n){return this._processEvent(e,t,n).then(e=>e.event_id,e=>{if(mc){const t=e;"log"===t.logLevel?Gs.log(t.message):Gs.warn(t)}})}_processEvent(e,t,n){const r=this.getOptions(),{sampleRate:i}=r,o=lu(e),a=su(e),s=e.type||"error",l=`before send for type \`${s}\``;if(a&&"number"==typeof i&&Math.random()>i)return this.recordDroppedEvent("sample_rate","error",e),ec(new Ks(`Discarding event because it's not included in the random sample (sampling rate = ${i})`,"log"));const c="replay_event"===s?"replay":s,u=(e.sdkProcessingMetadata||{}).capturedSpanIsolationScope;return this._prepareEvent(e,t,n,u).then(n=>{if(null===n)throw this.recordDroppedEvent("event_processor",c,e),new Ks("An event processor returned `null`, will not send event.","log");if(t.data&&!0===t.data.__sentry__)return n;const i=function(e,t,n){const{beforeSend:r,beforeSendTransaction:i}=e;return su(t)&&r?r(t,n):lu(t)&&i?i(t,n):t}(r,n,t);return function(e,t){const n=`${t} must return \`null\` or a valid event.`;if(As(e))return e.then(e=>{if(!_s(e)&&null!==e)throw new Ks(n);return e},e=>{throw new Ks(`${t} rejected with ${e}`)});if(!_s(e)&&null!==e)throw new Ks(n);return e}(i,l)}).then(r=>{if(null===r)throw this.recordDroppedEvent("before_send",c,e),new Ks(`${l} returned \`null\`, will not send event.`,"log");const i=n&&n.getSession();!o&&i&&this._updateSessionFromEvent(i,r);const a=r.transaction_info;if(o&&a&&r.transaction!==e.transaction){const e="custom";r.transaction_info={...a,source:e}}return this.sendEvent(r,t),r}).then(null,e=>{throw e instanceof Ks?e:(this.captureException(e,{data:{__sentry__:!0},originalException:e}),new Ks(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${e}`))})}_process(e){this._numProcessing++,e.then(e=>(this._numProcessing--,e),e=>(this._numProcessing--,e))}_sendEnvelope(e){if(this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport)return this._transport.send(e).then(null,e=>{mc&&Gs.error("Error while sending event:",e)});mc&&Gs.error("Transport disabled")}_clearOutcomes(){const e=this._outcomes;return this._outcomes={},Object.keys(e).map(t=>{const[n,r]=t.split(":");return{reason:n,category:r,quantity:e[t]}})}}function su(e){return void 0===e.type}function lu(e){return"transaction"===e.type}function cu(e,t,n=function(e){const t=[];function n(e){return t.splice(t.indexOf(e),1)[0]}return{$:t,add:function(r){if(!(void 0===e||t.length<e))return ec(new Ks("Not adding Promise because buffer limit was reached."));const i=r();return-1===t.indexOf(i)&&t.push(i),i.then(()=>n(i)).then(null,()=>n(i).then(null,()=>{})),i},drain:function(e){return new tc((n,r)=>{let i=t.length;if(!i)return n(!0);const o=setTimeout(()=>{e&&e>0&&n(!1)},e);t.forEach(e=>{Ql(e).then(()=>{--i||(clearTimeout(o),n(!0))},r)})})}}}(e.bufferSize||30)){let r={};function i(i){const o=[];if(cc(i,(t,n)=>{const i=pc(n);if(function(e,t,n=Date.now()){return function(e,t){return e[t]||e.all||0}(e,t)>n}(r,i)){const r=uu(t,n);e.recordDroppedEvent("ratelimit_backoff",i,r)}else o.push(t)}),0===o.length)return Ql();const a=sc(i[0],o),s=t=>{cc(a,(n,r)=>{const i=uu(n,r);e.recordDroppedEvent(t,pc(r),i)})};return n.add(()=>t({body:dc(a,e.textEncoder)}).then(e=>(void 0!==e.statusCode&&(e.statusCode<200||e.statusCode>=300)&&mc&&Gs.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),r=function(e,{statusCode:t,headers:n},r=Date.now()){const i={...e},o=n&&n["x-sentry-rate-limits"],a=n&&n["retry-after"];if(o)for(const s of o.trim().split(",")){const[e,t,,,n]=s.split(":",5),o=parseInt(e,10),a=1e3*(isNaN(o)?60:o);if(t)for(const s of t.split(";"))"metric_bucket"===s?(!n||n.split(";").includes("custom"))&&(i[s]=r+a):i[s]=r+a;else i.all=r+a}else a?i.all=r+function(e,t=Date.now()){const n=parseInt(`${e}`,10);if(!isNaN(n))return 1e3*n;const r=Date.parse(`${e}`);return isNaN(r)?6e4:r-t}(a,r):429===t&&(i.all=r+6e4);return i}(r,e),e),e=>{throw s("network_error"),e})).then(e=>e,e=>{if(e instanceof Ks)return mc&&Gs.error("Skipped sending event because buffer is full."),s("queue_overflow"),Ql();throw e})}return i.__sentry__baseTransport__=!0,{send:i,flush:e=>n.drain(e)}}function uu(e,t){if("event"===t||"transaction"===t)return Array.isArray(e)?e[1]:void 0}function du(e,t,n=[t],r="npm"){const i=e._metadata||{};i.sdk||(i.sdk={name:`sentry.javascript.${t}`,packages:n.map(e=>({name:`${r}:@sentry/${e}`,version:Wc})),version:Wc}),e._metadata=i}const hu=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/],fu=[/^.*\/healthcheck$/,/^.*\/healthy$/,/^.*\/live$/,/^.*\/ready$/,/^.*\/heartbeat$/,/^.*\/health$/,/^.*\/healthz$/],pu="InboundFilters",gu=(e={})=>({name:pu,setupOnce(){},processEvent(t,n,r){const i=r.getOptions(),o=function(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:hu],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[],...e.disableTransactionDefaults?[]:fu],ignoreInternal:void 0===e.ignoreInternal||e.ignoreInternal}}(e,i);return function(e,t){return t.ignoreInternal&&function(e){try{return"SentryError"===e.exception.values[0].type}catch{}return!1}(e)?(mc&&Gs.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${wl(e)}`),!0):function(e,t){return!(e.type||!t||!t.length)&&function(e){const t=[];let n;e.message&&t.push(e.message);try{n=e.exception.values[e.exception.values.length-1]}catch{}return n&&n.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`)),mc&&0===t.length&&Gs.error(`Could not extract message for event ${wl(e)}`),t}(e).some(e=>Ts(e,t))}(e,t.ignoreErrors)?(mc&&Gs.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${wl(e)}`),!0):function(e,t){if("transaction"!==e.type||!t||!t.length)return!1;const n=e.transaction;return!!n&&Ts(n,t)}(e,t.ignoreTransactions)?(mc&&Gs.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${wl(e)}`),!0):function(e,t){if(!t||!t.length)return!1;const n=mu(e);return!!n&&Ts(n,t)}(e,t.denyUrls)?(mc&&Gs.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${wl(e)}.\nUrl: ${mu(e)}`),!0):!function(e,t){if(!t||!t.length)return!0;const n=mu(e);return!n||Ts(n,t)}(e,t.allowUrls)&&(mc&&Gs.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${wl(e)}.\nUrl: ${mu(e)}`),!0)}(t,o)?null:t}});function mu(e){try{let t;try{t=e.exception.values[0].stacktrace.frames}catch{}return t?function(e=[]){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n&&"<anonymous>"!==n.filename&&"[native code]"!==n.filename)return n.filename||null}return null}(t):null}catch{return mc&&Gs.error(`Cannot extract url for event ${wl(e)}`),null}}let vu;iu(pu,gu);const yu="FunctionToString",bu=new WeakMap,wu=()=>({name:yu,setupOnce(){vu=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=el(this),n=bu.has(jc())&&void 0!==t?t:this;return vu.apply(n,e)}}catch{}},setup(e){bu.set(e,!0)}});iu(yu,wu);const xu=Ls;let Cu=0;function _u(){return Cu>0}function Su(e,t={},n){if("function"!=typeof e)return e;try{const t=e.__sentry_wrapped__;if(t)return t;if(el(e))return e}catch{return e}const r=function(){const r=Array.prototype.slice.call(arguments);try{n&&"function"==typeof n&&n.apply(this,arguments);const i=r.map(e=>Su(e,t));return e.apply(this,i)}catch(e){throw Cu++,setTimeout(()=>{Cu--}),function(...e){const t=Kc();if(2===e.length){const[n,r]=e;return n?t.withScope(()=>(t.getStackTop().scope=n,r(n))):t.withScope(r)}t.withScope(e[0])}(i=>{i.addEventProcessor(e=>(t.mechanism&&(xl(e,void 0),Cl(e,t.mechanism)),e.extra={...e.extra,arguments:r},e)),function(e){Kc().captureException(e,void 0)}(e)}),e}};try{for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t])}catch{}Qs(r,e),Js(e,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get:()=>e.name})}catch{}return r}const Au=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function ku(e,t){const n=Iu(e,t),r={type:t&&t.name,value:Tu(t)};return n.length&&(r.stacktrace={frames:n}),void 0===r.type&&""===r.value&&(r.value="Unrecoverable error caught"),r}function Eu(e,t){return{exception:{values:[ku(e,t)]}}}function Iu(e,t){const n=t.stacktrace||t.stack||"",r=function(e){if(e){if("number"==typeof e.framesToPop)return e.framesToPop;if(ju.test(e.message))return 1}return 0}(t);try{return e(n,r)}catch{}return[]}const ju=/Minified React error #\d+;/i;function Tu(e){const t=e&&e.message;return t?t.error&&"string"==typeof t.error.message?t.error.message:t:"No error message"}function Fu(e,t,n,r,i){let o;if(ys(t)&&t.error)return Eu(e,t.error);if(bs(t)||function(e){return vs(e,"DOMException")}(t)){const i=t;if("stack"in t)o=Eu(e,t);else{const t=i.name||(bs(i)?"DOMError":"DOMException"),a=i.message?`${t}: ${i.message}`:t;o=Ou(e,a,n,r),xl(o,a)}return"code"in i&&(o.tags={...o.tags,"DOMException.code":`${i.code}`}),o}return ms(t)?Eu(e,t):_s(t)||Ss(t)?(o=function(e,t,n,r){const i=jc(),o=i&&i.getOptions().normalizeDepth,a={exception:{values:[{type:Ss(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:Mu(t,{isUnhandledRejection:r})}]},extra:{__serialized__:Kl(t,o)}};if(n){const t=Iu(e,n);t.length&&(a.exception.values[0].stacktrace={frames:t})}return a}(e,t,n,i),Cl(o,{synthetic:!0}),o):(o=Ou(e,t,n,r),xl(o,`${t}`),Cl(o,{synthetic:!0}),o)}function Ou(e,t,n,r){const i={};if(r&&n){const r=Iu(e,n);r.length&&(i.exception={values:[{value:t,stacktrace:{frames:r}}]})}if(xs(t)){const{__sentry_template_string__:e,__sentry_template_values__:n}=t;return i.logentry={message:e,params:n},i}return i.message=t,i}function Mu(e,{isUnhandledRejection:t}){const n=function(e,t=40){const n=Object.keys(tl(e));if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=t)return Is(n[0],t);for(let r=n.length;r>0;r--){const e=n.slice(0,r).join(", ");if(!(e.length>t))return r===n.length?e:Is(e,t)}return""}(e),r=t?"promise rejection":"exception";return ys(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:Ss(e)?`Event \`${function(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}class Pu extends au{constructor(e){du(e,"browser",["browser"],xu.SENTRY_SDK_SOURCE||"npm"),super(e),e.sendClientReports&&xu.document&&xu.document.addEventListener("visibilitychange",()=>{"hidden"===xu.document.visibilityState&&this._flushOutcomes()})}eventFromException(e,t){return function(e,t,n,r){const i=Fu(e,t,n&&n.syntheticException||void 0,r);return Cl(i),i.level="error",n&&n.event_id&&(i.event_id=n.event_id),Ql(i)}(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",n){return function(e,t,n="info",r,i){const o=Ou(e,t,r&&r.syntheticException||void 0,i);return o.level=n,r&&r.event_id&&(o.event_id=r.event_id),Ql(o)}(this._options.stackParser,e,t,n,this._options.attachStacktrace)}captureUserFeedback(e){if(!this._isEnabled())return void(Au&&Gs.warn("SDK not enabled, will not capture user feedback."));const t=function(e,{metadata:t,tunnel:n,dsn:r}){const i={event_id:e.event_id,sent_at:(new Date).toISOString(),...t&&t.sdk&&{sdk:{name:t.sdk.name,version:t.sdk.version}},...!!n&&!!r&&{dsn:Ys(r)}},o=function(e){return[{type:"user_report"},e]}(e);return sc(i,[o])}(e,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this._sendEnvelope(t)}_prepareEvent(e,t,n){return e.platform=e.platform||"javascript",super._prepareEvent(e,t,n)}_flushOutcomes(){const e=this._clearOutcomes();if(0===e.length)return void(Au&&Gs.log("No outcomes to send"));if(!this._dsn)return void(Au&&Gs.log("No dsn provided, will not send outcomes"));Au&&Gs.log("Sending outcomes:",e);const t=function(e,t){return sc(t?{dsn:t}:{},[[{type:"client_report"},{timestamp:oc(),discarded_events:e}]])}(e,this._options.tunnel&&Ys(this._dsn));this._sendEnvelope(t)}}let Ru;function Lu(e,t=function(){if(Ru)return Ru;if(Ml(xu.fetch))return Ru=xu.fetch.bind(xu);const e=xu.document;let t=xu.fetch;if(e&&"function"==typeof e.createElement)try{const n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n);const r=n.contentWindow;r&&r.fetch&&(t=r.fetch),e.head.removeChild(n)}catch(e){Au&&Gs.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return Ru=t.bind(xu)}()){let n=0,r=0;return cu(e,function(i){const o=i.body.length;n+=o,r++;const a={body:i.body,method:"POST",referrerPolicy:"origin",headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};try{return t(e.url,a).then(e=>(n-=o,r--,{statusCode:e.status,headers:{"x-sentry-rate-limits":e.headers.get("X-Sentry-Rate-Limits"),"retry-after":e.headers.get("Retry-After")}}))}catch(e){return Ru=void 0,n-=o,r--,ec(e)}})}function Nu(e){return cu(e,function(t){return new tc((n,r)=>{const i=new XMLHttpRequest;i.onerror=r,i.onreadystatechange=()=>{4===i.readyState&&n({statusCode:i.status,headers:{"x-sentry-rate-limits":i.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":i.getResponseHeader("Retry-After")}})},i.open("POST",e.url);for(const t in e.headers)Object.prototype.hasOwnProperty.call(e.headers,t)&&i.setRequestHeader(t,e.headers[t]);i.send(t.body)})})}const Du="?";function zu(e,t,n,r){const i={filename:e,function:t,in_app:!0};return void 0!==n&&(i.lineno=n),void 0!==r&&(i.colno=r),i}const Bu=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Uu=/\((\S*)(?::(\d+))(?::(\d+))\)/,Vu=[30,e=>{const t=Bu.exec(e);if(t){if(t[2]&&0===t[2].indexOf("eval")){const e=Uu.exec(t[2]);e&&(t[2]=e[1],t[3]=e[2],t[4]=e[3])}const[e,n]=Xu(t[1]||Du,t[2]);return zu(n,e,t[3]?+t[3]:void 0,t[4]?+t[4]:void 0)}}],Hu=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Wu=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,$u=[50,e=>{const t=Hu.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const e=Wu.exec(t[3]);e&&(t[1]=t[1]||"eval",t[3]=e[1],t[4]=e[2],t[5]="")}let e=t[3],n=t[1]||Du;return[n,e]=Xu(n,e),zu(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}],Gu=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,qu=[40,e=>{const t=Gu.exec(e);return t?zu(t[2],t[1]||Du,+t[3],t[4]?+t[4]:void 0):void 0}],Yu=ll(Vu,$u,qu),Xu=(e,t)=>{const n=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return n||r?[-1!==e.indexOf("@")?e.split("@")[0]:Du,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},Ku="Breadcrumbs",Zu=(e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:Ku,setupOnce(){},setup(e){t.console&&function(e){const t="console";pl(t,e),gl(t,vl)}(function(e){return function(t){if(jc()!==e)return;const n={category:"console",data:{arguments:t.args,logger:"console"},level:ic(t.level),message:js(t.args," ")};if("assert"===t.level){if(!1!==t.args[0])return;n.message=`Assertion failed: ${js(t.args.slice(1)," ")||"console.assert"}`,n.data.arguments=t.args.slice(1)}Ic(n,{input:t.args,level:t.level})}}(e)),t.dom&&function(e){pl("dom",e),gl("dom",jl)}(function(e,t){return function(n){if(jc()!==e)return;let r,i,o="object"==typeof t?t.serializeAttribute:void 0,a="object"==typeof t&&"number"==typeof t.maxStringLength?t.maxStringLength:void 0;a&&a>1024&&(Au&&Gs.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${a} was configured. Sentry will use 1024 instead.`),a=1024),"string"==typeof o&&(o=[o]);try{const e=n.event,t=function(e){return!!e&&!!e.target}(e)?e.target:e;r=Bs(t,{keyAttrs:o,maxStringLength:a}),i=function(e){if(!zs.HTMLElement)return null;let t=e;for(let n=0;n<5;n++){if(!t)return null;if(t instanceof HTMLElement&&t.dataset.sentryComponent)return t.dataset.sentryComponent;t=t.parentNode}return null}(t)}catch{r="<unknown>"}if(0===r.length)return;const s={category:`ui.${n.name}`,message:r};i&&(s.data={"ui.component_name":i}),Ic(s,{event:n.event,name:n.name,global:n.global})}}(e,t.dom)),t.xhr&&function(e){pl("xhr",e),gl("xhr",Yl)}(function(e){return function(t){if(jc()!==e)return;const{startTimestamp:n,endTimestamp:r}=t,i=t.xhr[ql];if(!n||!r||!i)return;const{method:o,url:a,status_code:s,body:l}=i;Ic({category:"xhr",data:{method:o,url:a,status_code:s},type:"http"},{xhr:t.xhr,input:l,startTimestamp:n,endTimestamp:r})}}(e)),t.fetch&&function(e){const t="fetch";pl(t,e),gl(t,Pl)}(function(e){return function(t){if(jc()!==e)return;const{startTimestamp:n,endTimestamp:r}=t;if(r&&(!t.fetchData.url.match(/sentry_key/)||"POST"!==t.fetchData.method))if(t.error)Ic({category:"fetch",data:t.fetchData,level:"error",type:"http"},{data:t.error,input:t.args,startTimestamp:n,endTimestamp:r});else{const e=t.response;Ic({category:"fetch",data:{...t.fetchData,status_code:e&&e.status},type:"http"},{input:t.args,response:e,startTimestamp:n,endTimestamp:r})}}}(e)),t.history&&Wl(function(e){return function(t){if(jc()!==e)return;let n=t.from,r=t.to;const i=nc(xu.location.href);let o=n?nc(n):void 0;const a=nc(r);(!o||!o.path)&&(o=i),i.protocol===a.protocol&&i.host===a.host&&(r=a.relative),i.protocol===o.protocol&&i.host===o.host&&(n=o.relative),Ic({category:"navigation",data:{from:n,to:r}})}}(e)),t.sentry&&e.on&&e.on("beforeSendEvent",function(e){return function(t){jc()===e&&Ic({category:"sentry."+("transaction"===t.type?"transaction":"event"),event_id:t.event_id,level:t.level,message:wl(t)},{event:t})}}(e))}}};iu(Ku,Zu);const Ju="Dedupe",Qu=()=>{let e;return{name:Ju,setupOnce(){},processEvent(t){if(t.type)return t;try{if(function(e,t){return!!t&&!(!function(e,t){const n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!td(e,t)||!ed(e,t))}(e,t)&&!function(e,t){const n=nd(t),r=nd(e);return!!(n&&r&&n.type===r.type&&n.value===r.value&&td(e,t)&&ed(e,t))}(e,t))}(t,e))return Au&&Gs.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}};function ed(e,t){let n=rd(e),r=rd(t);if(!n&&!r)return!0;if(n&&!r||!n&&r||r.length!==n.length)return!1;for(let i=0;i<r.length;i++){const e=r[i],t=n[i];if(e.filename!==t.filename||e.lineno!==t.lineno||e.colno!==t.colno||e.function!==t.function)return!1}return!0}function td(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;try{return n.join("")===r.join("")}catch{return!1}}function nd(e){return e.exception&&e.exception.values&&e.exception.values[0]}function rd(e){const t=e.exception;if(t)try{return t.values[0].stacktrace.frames}catch{return}}iu(Ju,Qu);const id="GlobalHandlers",od=(e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:id,setupOnce(){Error.stackTraceLimit=50},setup(e){t.onerror&&(function(e){!function(e){const t="error";pl(t,e),gl(t,Dl)}(t=>{const{stackParser:n,attachStacktrace:r}=ld();if(jc()!==e||_u())return;const{msg:i,url:o,line:a,column:s,error:l}=t,c=void 0===l&&ws(i)?function(e,t,n,r){let i=ys(e)?e.message:e,o="Error";const a=i.match(/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i);return a&&(o=a[1],i=a[2]),ad({exception:{values:[{type:o,value:i}]}},t,n,r)}(i,o,a,s):ad(Fu(n,l||i,void 0,r,!1),o,a,s);c.level="error",Ec(c,{originalException:l,mechanism:{handled:!1,type:"onerror"}})})}(e),sd("onerror")),t.onunhandledrejection&&(function(e){!function(e){const t="unhandledrejection";pl(t,e),gl(t,Bl)}(t=>{const{stackParser:n,attachStacktrace:r}=ld();if(jc()!==e||_u())return;const i=function(e){if(Cs(e))return e;const t=e;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch{}return e}(t),o=Cs(i)?function(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}(i):Fu(n,i,void 0,r,!0);o.level="error",Ec(o,{originalException:i,mechanism:{handled:!1,type:"onunhandledrejection"}})})}(e),sd("onunhandledrejection"))}}};function ad(e,t,n,r){const i=e.exception=e.exception||{},o=i.values=i.values||[],a=o[0]=o[0]||{},s=a.stacktrace=a.stacktrace||{},l=s.frames=s.frames||[],c=isNaN(parseInt(r,10))?void 0:r,u=isNaN(parseInt(n,10))?void 0:n,d=ws(t)&&t.length>0?t:function(){try{return zs.document.location.href}catch{return""}}();return 0===l.length&&l.push({colno:c,filename:d,function:"?",in_app:!0,lineno:u}),e}function sd(e){Au&&Gs.log(`Global Handler attached: ${e}`)}function ld(){const e=jc();return e&&e.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}iu(id,od);const cd="HttpContext",ud=()=>({name:cd,setupOnce(){},preprocessEvent(e){if(!xu.navigator&&!xu.location&&!xu.document)return;const t=e.request&&e.request.url||xu.location&&xu.location.href,{referrer:n}=xu.document||{},{userAgent:r}=xu.navigator||{},i={...e.request&&e.request.headers,...n&&{Referer:n},...r&&{"User-Agent":r}},o={...e.request,...t&&{url:t},headers:i};e.request=o}});iu(cd,ud);const dd="LinkedErrors",hd=(e={})=>{const t=e.limit||5,n=e.key||"cause";return{name:dd,setupOnce(){},preprocessEvent(e,r,i){const o=i.getOptions();Fs(ku,o.stackParser,o.maxValueLength,n,t,e,r)}}};iu(dd,hd);const fd=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],pd="TryCatch",gd=(e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...e};return{name:pd,setupOnce(){t.setTimeout&&Zs(xu,"setTimeout",md),t.setInterval&&Zs(xu,"setInterval",md),t.requestAnimationFrame&&Zs(xu,"requestAnimationFrame",vd),t.XMLHttpRequest&&"XMLHttpRequest"in xu&&Zs(XMLHttpRequest.prototype,"send",yd);const e=t.eventTarget;e&&(Array.isArray(e)?e:fd).forEach(bd)}}};function md(e){return function(...t){const n=t[0];return t[0]=Su(n,{mechanism:{data:{function:dl(e)},handled:!1,type:"instrument"}}),e.apply(this,t)}}function vd(e){return function(t){return e.apply(this,[Su(t,{mechanism:{data:{function:"requestAnimationFrame",handler:dl(e)},handled:!1,type:"instrument"}})])}}function yd(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(e=>{e in n&&"function"==typeof n[e]&&Zs(n,e,function(t){const n={mechanism:{data:{function:e,handler:dl(t)},handled:!1,type:"instrument"}},r=el(t);return r&&(n.mechanism.data.handler=dl(r)),Su(t,n)})}),e.apply(this,t)}}function bd(e){const t=xu,n=t[e]&&t[e].prototype;!n||!n.hasOwnProperty||!n.hasOwnProperty("addEventListener")||(Zs(n,"addEventListener",function(t){return function(n,r,i){try{"function"==typeof r.handleEvent&&(r.handleEvent=Su(r.handleEvent,{mechanism:{data:{function:"handleEvent",handler:dl(r),target:e},handled:!1,type:"instrument"}}))}catch{}return t.apply(this,[n,Su(r,{mechanism:{data:{function:"addEventListener",handler:dl(r),target:e},handled:!1,type:"instrument"}}),i])}}),Zs(n,"removeEventListener",function(e){return function(t,n,r){const i=n;try{const n=i&&i.__sentry_wrapped__;n&&e.call(this,t,n,r)}catch{}return e.call(this,t,i,r)}}))}iu(pd,gd);const wd=[gu(),wu(),gd(),Zu(),od(),hd(),Qu(),ud()];function xd(e={}){void 0===e.defaultIntegrations&&(e.defaultIntegrations=[...wd]),void 0===e.release&&("string"==typeof __SENTRY_RELEASE__&&(e.release=__SENTRY_RELEASE__),xu.SENTRY_RELEASE&&xu.SENTRY_RELEASE.id&&(e.release=xu.SENTRY_RELEASE.id)),void 0===e.autoSessionTracking&&(e.autoSessionTracking=!0),void 0===e.sendClientReports&&(e.sendClientReports=!0);const t={...e,stackParser:cl(e.stackParser||Yu),integrations:tu(e),transport:e.transport||(Ol()?Lu:Nu)};(function(e,t){!0===t.debug&&(mc?Gs.enable():$s(()=>{})),Tc().update(t.initialScope);const n=new e(t);(function(e){const t=Kc().getStackTop();t.client=e,t.scope.setClient(e)})(n),function(e){e.init?e.init():e.setupIntegrations&&e.setupIntegrations()}(n)})(Pu,t),e.autoSessionTracking&&(typeof xu.document>"u"?Au&&Gs.warn("Session tracking in non-browser environment with @sentry/browser is not supported."):(Fc({ignoreDuration:!0}),Pc(),Wl(({from:e,to:t})=>{void 0!==e&&e!==t&&(Fc({ignoreDuration:!0}),Pc())})))}var Cd=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof n.g<"u"?n.g:typeof self<"u"?self:{};function _d(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Sd=(e=>(e.INLINE="inline",e.OVERLAY="overlay",e))(Sd||{}),Ad=(e=>(e.TOP="top",e.BOTTOM="bottom",e.HIDDEN="",e))(Ad||{});function kd(e,t){return{...t,message:e}}const Ed={emoticons:kd("Emoticons"),doodles:kd("Doodles"),landmarks:kd("Landmarks"),bubbles:kd("Bubbles"),transportation:kd("Transportation"),beach:kd("Beach")},Id={fill:"#1565C0",opacity:1,backgroundColor:null,strokeWidth:.05,stroke:"#000"},jd=[1,8,15,20,25];var Td=(e=>(e.DARK="dark",e.LIGHT="light",e))(Td||{});const Fd=[{name:Td.LIGHT,colors:{"--be-foreground-base":"0 0 0","--be-primary-light":"191 219 254","--be-primary":"59 130 246","--be-primary-dark":"37 99 235","--be-on-primary":"255 255 255","--be-danger":"179 38 30","--be-on-danger":"255 255 255","--be-background":"255 255 255","--be-background-alt":"250 250 250","--be-paper":"255 255 255","--be-disabled-bg-opacity":"12%","--be-disabled-fg-opacity":"26%","--be-hover-opacity":"4%","--be-focus-opacity":"12%","--be-selected-opacity":"8%","--be-text-main-opacity":"87%","--be-text-muted-opacity":"60%","--be-divider-opacity":"12%"}},{name:Td.DARK,isDark:!0,colors:{"--be-foreground-base":"255 255 255","--be-primary-light":"239 246 255","--be-primary":"191 219 254","--be-primary-dark":"147 197 253","--be-on-primary":"56 30 114","--be-danger":"242 184 181","--be-on-danger":"96 20 16","--be-background":"20 21 23","--be-background-alt":"26 27 30","--be-paper":"44 46 51","--be-disabled-bg-opacity":"12%","--be-disabled-fg-opacity":"30%","--be-hover-opacity":"8%","--be-focus-opacity":"12%","--be-selected-opacity":"16%","--be-text-main-opacity":"100%","--be-text-muted-opacity":"70%","--be-divider-opacity":"12%"}}];var Od=(e=>(e.FILTER="filter",e.RESIZE="resize",e.CROP="crop",e.DRAW="draw",e.TEXT="text",e.SHAPES="shapes",e.STICKERS="stickers",e.FRAME="frame",e.CORNERS="corners",e.MERGE="merge",e))(Od||{});function Md(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Md(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Pd(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Md(e))&&(r&&(r+=" "),r+=t);return r}const Rd=(0,o.forwardRef)((e,t)=>{const{attr:n,size:r,title:o,className:a,color:s,style:l,children:c,viewBox:u,width:d,height:h,...f}=e;return(0,i.jsxs)("svg",{"aria-hidden":!o,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:u||"0 0 24 24",...n,...f,className:Pd("svg-icon",a,Ld(r)),style:{color:s,...l},ref:t,height:h||"1em",width:d||"1em",children:[o&&(0,i.jsx)("title",{children:o}),c]})});function Ld(e){switch(e){case"2xs":return"icon-2xs";case"xs":return"icon-xs";case"sm":return"icon-sm";case"md":return"icon-md";case"lg":return"icon-lg";case"xl":return"icon-xl";default:return e}}function Nd(e,t="",n){return o.memo(o.forwardRef((r,o)=>(0,i.jsx)(Rd,{"data-testid":`${t}Icon`,ref:o,viewBox:n,...r,size:r.size||"md",children:e})))}function Dd(e,t=""){return Nd(zd(e),t)}function zd(e){return(null==e?void 0:e.map)&&e.map((e,t)=>o.createElement(e.tag,{key:t,...e.attr},zd(e.child)))}const Bd=Nd((0,i.jsx)("path",{d:"M3 17v2h6v-2H3zM3 5v2h10V5H3zm10 16v-2h8v-2h-8v-2h-2v6h2zM7 9v2H3v2h4v2h2V9H7zm14 4v-2H11v2h10zm-6-4h2V7h4V5h-4V3h-2v6z"}),"TuneOutlined"),Ud=Nd((0,i.jsx)("path",{d:"M21 15h2v2h-2v-2zm0-4h2v2h-2v-2zm2 8h-2v2c1 0 2-1 2-2zM13 3h2v2h-2V3zm8 4h2v2h-2V7zm0-4v2h2c0-1-1-2-2-2zM1 7h2v2H1V7zm16-4h2v2h-2V3zm0 16h2v2h-2v-2zM3 3C2 3 1 4 1 5h2V3zm6 0h2v2H9V3zM5 3h2v2H5V3zm-4 8v8c0 1.1.9 2 2 2h12V11H1zm2 8 2.5-3.21 1.79 2.15 2.5-3.22L13 19H3z"}),"PhotoSizeSelectLargeOutlined"),Vd=Nd((0,i.jsx)("path",{d:"M17 15h2V7c0-1.1-.9-2-2-2H9v2h8v8zM7 17V1H5v4H1v2h4v10c0 1.1.9 2 2 2h10v4h2v-4h4v-2H7z"}),"CropOutlined"),Hd=Nd((0,i.jsx)("path",{d:"M2.5 4v3h5v12h3V7h5V4h-13zm19 5h-9v3h3v7h3v-7h3V9z"}),"TextFieldsOutlined"),Wd=Nd((0,i.jsx)("path",{d:"M10.5 4.5c.28 0 .5.22.5.5v2h6v6h2c.28 0 .5.22.5.5s-.22.5-.5.5h-2v6h-2.12c-.68-1.75-2.39-3-4.38-3s-3.7 1.25-4.38 3H4v-2.12c1.75-.68 3-2.39 3-4.38 0-1.99-1.24-3.7-2.99-4.38L4 7h6V5c0-.28.22-.5.5-.5m0-2C9.12 2.5 8 3.62 8 5H4c-1.1 0-1.99.9-1.99 2v3.8h.29c1.49 0 2.7 1.21 2.7 2.7s-1.21 2.7-2.7 2.7H2V20c0 1.1.9 2 2 2h3.8v-.3c0-1.49 1.21-2.7 2.7-2.7s2.7 1.21 2.7 2.7v.3H17c1.1 0 2-.9 2-2v-4c1.38 0 2.5-1.12 2.5-2.5S20.38 11 19 11V7c0-1.1-.9-2-2-2h-4c0-1.38-1.12-2.5-2.5-2.5z"}),"ExtensionOutlined"),$d=Nd((0,i.jsx)("path",{d:"M10.25 13c0 .69-.56 1.25-1.25 1.25S7.75 13.69 7.75 13s.56-1.25 1.25-1.25 1.25.56 1.25 1.25zM15 11.75c-.69 0-1.25.56-1.25 1.25s.56 1.25 1.25 1.25 1.25-.56 1.25-1.25-.56-1.25-1.25-1.25zm7 .25c0 5.52-4.48 10-10 10S2 17.52 2 12 6.48 2 12 2s10 4.48 10 10zM10.66 4.12C12.06 6.44 14.6 8 17.5 8c.46 0 .91-.05 1.34-.12C17.44 5.56 14.9 4 12 4c-.46 0-.91.05-1.34.12zM4.42 9.47c1.71-.97 3.03-2.55 3.66-4.44C6.37 6 5.05 7.58 4.42 9.47zM20 12c0-.78-.12-1.53-.33-2.24-.7.15-1.42.24-2.17.24-3.13 0-5.92-1.44-7.76-3.69C8.69 8.87 6.6 10.88 4 11.86c.01.04 0 .09 0 .14 0 4.41 3.59 8 8 8s8-3.59 8-8z"}),"FaceOutlined"),Gd=Nd((0,i.jsx)("path",{d:"M20 4h-4l-4-4-4 4H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H4V6h4.52l3.52-3.5L15.52 6H20v14zM6 18h12V8H6v10zm2-8h8v6H8v-6z"}),"FilterFramesOutlined"),qd=Nd((0,i.jsx)("path",{d:"M6.41 21 5 19.59l4.83-4.83c.75-.75 1.17-1.77 1.17-2.83v-5.1L9.41 8.41 8 7l4-4 4 4-1.41 1.41L13 6.83v5.1c0 1.06.42 2.08 1.17 2.83L19 19.59 17.59 21 12 15.41 6.41 21z"}),"MergeOutlined"),Yd=Nd((0,i.jsx)("path",{d:"M19 19h2v2h-2v-2zm0-2h2v-2h-2v2zM3 13h2v-2H3v2zm0 4h2v-2H3v2zm0-8h2V7H3v2zm0-4h2V3H3v2zm4 0h2V3H7v2zm8 16h2v-2h-2v2zm-4 0h2v-2h-2v2zm4 0h2v-2h-2v2zm-8 0h2v-2H7v2zm-4 0h2v-2H3v2zM21 8c0-2.76-2.24-5-5-5h-5v2h5c1.65 0 3 1.35 3 3v5h2V8z"}),"RoundedCornerOutlined"),Xd=Nd((0,i.jsx)("path",{d:"M20 4v12H8V4h12m0-2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-8.5 9.67 1.69 2.26 2.48-3.1L19 15H9zM2 6v14c0 1.1.9 2 2 2h14v-2H4V6H2z"}),"PhotoLibraryOutlined"),Kd=Nd((0,i.jsx)("path",{d:"M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.25 2.52.77-1.28-3.52-2.09V8z"}),"HistoryOutlined"),Zd=Nd([(0,i.jsx)("path",{d:"m2.53 19.65 1.34.56v-9.03l-2.43 5.86c-.41 1.02.08 2.19 1.09 2.61zm19.5-3.7L17.07 3.98c-.31-.75-1.04-1.21-1.81-1.23-.26 0-.53.04-.79.15L7.1 5.95c-.75.31-1.21 1.03-1.23 1.8-.01.27.04.54.15.8l4.96 11.97c.31.76 1.05 1.22 1.83 1.23.26 0 .52-.05.77-.15l7.36-3.05c1.02-.42 1.51-1.59 1.09-2.6zm-9.2 3.8L7.87 7.79l7.35-3.04h.01l4.95 11.95-7.35 3.05z"},"0"),(0,i.jsx)("circle",{cx:"11",cy:"9",r:"1"},"1"),(0,i.jsx)("path",{d:"M5.88 19.75c0 1.1.9 2 2 2h1.45l-3.45-8.34v6.34z"},"2")],"StyleOutlined"),Jd=Nd((0,i.jsx)("path",{d:"M16 9v10H8V9h8m-1.5-6h-5l-1 1H5v2h14V4h-3.5l-1-1zM18 7H6v12c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7z"}),"DeleteOutlined"),Qd=Nd((0,i.jsx)("path",{d:"M18.85,10.39l1.06-1.06c0.78-0.78,0.78-2.05,0-2.83L18.5,5.09c-0.78-0.78-2.05-0.78-2.83,0l-1.06,1.06L18.85,10.39z M14.61,11.81L7.41,19H6v-1.41l7.19-7.19L14.61,11.81z M13.19,7.56L4,16.76V21h4.24l9.19-9.19L13.19,7.56L13.19,7.56z M19,17.5 c0,2.19-2.54,3.5-5,3.5c-0.55,0-1-0.45-1-1s0.45-1,1-1c1.54,0,3-0.73,3-1.5c0-0.47-0.48-0.87-1.23-1.2l1.48-1.48 C18.32,15.45,19,16.29,19,17.5z M4.58,13.35C3.61,12.79,3,12.06,3,11c0-1.8,1.89-2.63,3.56-3.36C7.59,7.18,9,6.56,9,6 c0-0.41-0.78-1-2-1C5.74,5,5.2,5.61,5.17,5.64C4.82,6.05,4.19,6.1,3.77,5.76C3.36,5.42,3.28,4.81,3.62,4.38C3.73,4.24,4.76,3,7,3 c2.24,0,4,1.32,4,3c0,1.87-1.93,2.72-3.64,3.47C6.42,9.88,5,10.5,5,11c0,0.31,0.43,0.6,1.07,0.86L4.58,13.35z"}),"Draw"),eh=Nd((0,i.jsx)("path",{d:"m12 5.69 5 4.5V18h-2v-6H9v6H7v-7.81l5-4.5M12 3 2 12h3v8h6v-6h2v6h6v-8h3L12 3z"}),"HomeOutlined"),th={[Od.FILTER]:{name:kd("Applied Filters"),icon:Bd},[Od.RESIZE]:{name:kd("Resized Image"),icon:Ud},[Od.CROP]:{name:kd("Cropped Image"),icon:Vd},[Od.DRAW]:{name:kd("Added Drawing"),icon:Qd},[Od.TEXT]:{name:kd("Added Text"),icon:Hd},[Od.SHAPES]:{name:kd("Added Shape"),icon:Wd},[Od.STICKERS]:{name:kd("Added Sticker"),icon:$d},[Od.FRAME]:{name:kd("Added Frame"),icon:Gd},[Od.MERGE]:{name:kd("Merged Objects"),icon:qd},[Od.CORNERS]:{name:kd("Rounded Corner"),icon:Yd},bgImage:{name:kd("Replaced Background Image"),icon:Xd},overlayImage:{name:kd("Added Image"),icon:Xd},initial:{name:kd("Initial"),icon:eh},loadedState:{name:kd("Loaded State"),icon:Kd},objectStyle:{name:kd("Changed Style"),icon:Zd},deletedObject:{name:kd("Deleted object"),icon:Jd}},nh=Object.values(Od).map(e=>({name:e,icon:th[e].icon,action:e===Od.MERGE?e=>{e.tools.merge.apply()}:e})),rh={filter:kd("filter"),resize:kd("resize"),crop:kd("crop"),draw:kd("draw"),text:kd("text"),shapes:kd("shapes"),stickers:kd("stickers"),frame:kd("frame"),corners:kd("corners"),merge:kd("merge")},ih=Nd((0,i.jsx)("path",{d:"M18 15v3H6v-3H4v3c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-3h-2zm-1-4-1.41-1.41L13 12.17V4h-2v8.17L8.41 9.59 7 11l5 5 5-5z"}),"FileDownloadOutlined"),oh={selector:"pixie-editor",textureSize:4096,activeLanguage:"en",ui:{visible:!0,mode:Sd.INLINE,forceOverlayModeOnMobile:!0,activeTheme:Td.LIGHT,themes:Fd,allowEditorClose:!0,menubar:{items:[{type:"undoWidget",align:"left"},{type:"zoomWidget",align:"center",desktopOnly:!0},{type:"button",icon:Kd,align:"right",desktopOnly:!0,action:e=>{e.togglePanel("history")}},{type:"button",icon:ih,label:kd("Done"),align:"right",action:e=>{var t;null!=(t=e.state.config.ui)&&t.showExportPanel?e.state.togglePanel("export",!0):e.tools.export.save()}}]},nav:{position:Ad.BOTTOM,items:[...nh]},openImageDialog:{show:!0,sampleImages:[{url:"images/samples/sample1.jpg",thumbnail:"images/samples/sample1_thumbnail.jpg"},{url:"images/samples/sample2.jpg",thumbnail:"images/samples/sample2_thumbnail.jpg"},{url:"images/samples/sample3.jpg",thumbnail:"images/samples/sample3_thumbnail.jpg"}]},colorPresets:{items:["rgb(0,0,0)","rgb(255, 255, 255)","rgb(242, 38, 19)","rgb(249, 105, 14)","rgb(253, 227, 167)","rgb(4, 147, 114)","rgb(30, 139, 195)","rgb(142, 68, 173)"]}},objectDefaults:{global:{...Id},sticker:{fill:void 0},text:{textAlign:"initial",underline:!1,linethrough:!1,fontStyle:"normal",fontFamily:"Times New Roman",fontWeight:"normal",stroke:void 0,fontSize:40}},tools:{filter:{items:["grayscale","blackWhite","sharpen","invert","vintage","polaroid","kodachrome","technicolor","brownie","sepia","removeColor","brightness","gamma","noise","pixelate","blur","emboss","blendColor"]},zoom:{allowUserZoom:!0,fitImageToScreen:!0},crop:{allowCustomRatio:!0,defaultRatio:"1:1",presets:[{ratio:null,name:"Custom"},{ratio:"1:1",name:"Square"},{ratio:"4:3"},{ratio:"16:9"},{ratio:"5:3"},{ratio:"5:4"},{ratio:"6:4"},{ratio:"7:5"},{ratio:"10:8"}]},text:{defaultText:"Double click to edit",controlsPadding:6,items:[{family:"Roboto",src:"fonts/open-sans-v27-latin-ext_latin-regular.woff2"},{family:"Fuzzy Bubbles",src:"fonts/fuzzy-bubbles-v3-latin-700.woff2",descriptors:{weight:"700"}},{family:"Aleo Bold",src:"fonts/aleo-v4-latin-ext_latin-700.woff2",descriptors:{weight:"700"}},{family:"Amatic SC",src:"fonts/amatic-sc-v16-latin-ext_latin-regular.woff2"},{family:"Corinthia Bold",src:"fonts/corinthia-v7-latin-ext_latin-700.woff2"},{family:"Bungee Inline",src:"fonts/bungee-inline-v6-latin-ext_latin-regular.woff2"},{family:"Robot Slab Bold",src:"fonts/roboto-slab-v16-latin-ext_latin-500.woff2"},{family:"Carter One",src:"fonts/carter-one-v12-latin-regular.woff2"},{family:"Cody Star",src:"fonts/codystar-v10-latin-ext_latin-regular.woff2"},{family:"Fira Sans",src:"fonts/fira-sans-v11-latin-ext_latin_cyrillic-regular.woff2"},{family:"Krona One",src:"fonts/krona-one-v9-latin-ext_latin-regular.woff2"},{family:"Kumar One Outline",src:"fonts/kumar-one-outline-v8-latin-ext_latin-regular.woff2"},{family:"Lobster Two",src:"fonts/lobster-two-v13-latin-regular.woff2"},{family:"Molle Italic",src:"fonts/molle-v11-latin-ext_latin-italic.woff2"},{family:"Monoton",src:"fonts/monoton-v10-latin-regular.woff2"},{family:"Nixie One",src:"fonts/nixie-one-v11-latin-regular.woff2"},{family:"Permanent Marker",src:"fonts/permanent-marker-v10-latin-regular.woff2"},{family:"Sancreek",src:"fonts/sancreek-v13-latin-ext_latin-regular.woff2"},{family:"Stint Ultra Expanded",src:"fonts/stint-ultra-expanded-v10-latin-regular.woff2"},{family:"VT323",src:"fonts/vt323-v12-latin-ext_latin-regular.woff2"},{family:"Trash Hand",src:"fonts/TrashHand.ttf"}]},draw:{brushSizes:jd,brushTypes:["PencilBrush","EraserBrush","SprayBrush","CircleBrush","DiamondBrush","VLineBrush","HLineBrush","SquareBrush"]},shapes:{items:[{name:"circle",type:"Circle"},{name:"square",type:"Rect",options:{lockUniScaling:!1}},{name:"triangle",type:"Triangle"},{name:"ellipse",type:"Ellipse",options:{lockUniScaling:!1}},{name:"Arrow #1",type:"Path",options:{path:"M 294.9 16.4 l 15.7 42.2 c -171.4 70.3 -294 242.3 -289.1 437.4 l 14.7 -1 c 9.1 -0.6 18.1 -1.2 27.1 -1.9 l 14.7 -1 c -4.3 -170.1 102.5 -320 252 -381.3 l 15.7 42.2 c 34.7 -40.5 83.1 -76.6 144.8 -99.8 c -58.1 -26.2 -124.9 -39.6 -195.6 -36.8 z"}},{name:"Arrow #2",type:"Path",options:{path:"M 16 248.4 v 14.9 h 447.5 l -93.2 82.5 l 11.9 10.5 l 113.8 -100.2 l -113.6 -100.4 l -11.8 10.5 l 92.9 82.2 z"}},{name:"Arrow #3",type:"Path",options:{path:"M 496 256 l -118.6 -66 v 40.8 h -361.4 v 50.4 h 361.4 v 40.8 l 118.6 -66 z"}},{name:"Line",type:"Path",options:{path:"M 16 256 h 480",strokeWidth:10,stroke:"#000",padding:10}},{name:"Star",type:"Path",options:{path:"M 256 406.3 l 148.3 78 l -28.3 -165.2 l 120 -117 l -165.8 -24.1 l -74.2 -150.3 l -74.2 150.3 l -165.8 24.1 l 120 117 l -28.3 165.2 z"}},{name:"Polygon",type:"Path",options:{path:"M 256 19.6 l 156.6 57.1 l 83.4 144.3 l -28.9 164.2 l -127.7 107.2 h -166.8 l -127.7 -107.2 l -28.9 -164.2 l 83.4 -144.3 z"}},{name:"Badge",type:"Path",options:{path:"M 257.3 16.2 s -148 58.2 -204.4 81.4 c 0 75.7 -16.8 303.5 204.4 398.2 c 218.7 -94.6 201.9 -322.4 201.9 -398.2 c -62.1 -23.6 -201.9 -81.4 -201.9 -81.4 z"}}].slice()},stickers:{items:[{name:"emoticons",list:["afro-1","afro","agent","alien-1","alien","angel","angry-1","angry-2","angry-3","angry-4","angry-5","angry","arguing","arrogant","asian-1","asian","avatar","baby-1","baby-2","baby","bully","burglar","businessman","cheeky-1","cheeky","clown","confused-1","confused-2","confused-3","confused","creepy","crying-1","crying-2","crying-3","crying","dazed-1","dazed-2","dazed-3","dazed","dead-1","dead-2","dead-3","dead-4","dead-5","dead-6","dead","desperate-1","desperate","detective","dissapointment","doctor","drunk","dumb","emo-1","emo-2","emo","emoticon","evil","faint-1","faint","flirt-1","flirt-2","flirt","flirty","gangster","geek-1","geek","gentleman-1","gentleman-2","gentleman-3","gentleman-4","gentleman","ginger","girl-1","girl","goofy-1","goofy-2","goofy-3","goofy-4","goofy","grubby-1","grubby","happy-1","happy-10","happy-11","happy-12","happy-13","happy-14","happy-15","happy-16","happy-2","happy-3","happy-4","happy-5","happy-6","happy-7","happy-8","happy-9","happy","harry-potter","heisenberg","hipster-1","hipster-2","hipster","in-love-1","in-love-2","in-love-3","in-love-4","in-love-5","in-love-6","in-love","japan","jew","joyful-1","joyful-2","joyful","kiss-1","kiss-2","kiss-3","kiss-4","kiss","laughing-1","laughing-2","laughing-3","laughing","listening","love","manly","miserly-1","miserly","nerd-1","nerd-2","nerd-3","nerd-4","nerd","ninja","pirate-1","pirate-2","pirate","punk-1","punk-2","punk","rapper","relieved","rich-1","rich-2","rich","rockstar","sad-1","sad-2","sad-3","sad-4","sad-5","sad-6","sad","scared-1","scared-2","scared-3","scared","sceptic-1","sceptic-2","sceptic-3","sceptic-4","sceptic-5","sceptic-6","sceptic-7","sceptic","secret","shocked-1","shocked-2","shocked-3","shocked","sick-1","sick-2","sick-3","sick-4","sick","silent","skeleton","smile","smiling-1","smiling","smoked","smug-1","smug-2","smug-3","smug-4","smug-5","smug-6","smug","sporty","stunned","superhero-1","superhero-2","superhero-3","superhero-4","superhero","surprised-1","surprised","thinking","tired-1","tired-2","tired-3","tired","tough-1","tough","trendy","vampire-1","vampire","wink-1","wink-2","wink","winking-1","winking","yawning-1","yawning-2","yawning-3","yawning","yelling","zombie"],type:"svg",thumbnailUrl:"images/stickers/categories/emoticon.svg"},{name:"doodles",items:100,type:"svg",thumbnailUrl:"images/stickers/categories/doodles.svg"},{name:"landmarks",items:100,type:"svg",thumbnailUrl:"images/stickers/categories/landmark.svg",invertPreview:!0},{name:"bubbles",items:104,type:"png",thumbnailUrl:"images/stickers/categories/speech-bubble.svg"},{name:"transportation",items:22,type:"svg",thumbnailUrl:"images/stickers/categories/transportation.svg",invertPreview:!0},{name:"beach",items:22,type:"svg",thumbnailUrl:"images/stickers/categories/beach.svg",invertPreview:!0}]},import:{validImgExtensions:["png","jpg","jpeg","svg","gif"],fitOverlayToScreen:!0,openDroppedImageAsBackground:!1},export:{defaultFormat:"png",defaultQuality:.8,defaultName:"image"},frame:{items:[{name:"basic",mode:"basic",size:{min:1,max:35,default:10}},{name:"pine",mode:"stretch",size:{min:1,max:35,default:15}},{name:"oak",mode:"stretch",size:{min:1,max:35,default:15}},{name:"rainbow",mode:"stretch",size:{min:1,max:35,default:15}},{name:"grunge1",display_name:"grunge #1",mode:"stretch",size:{min:1,max:35,default:15}},{name:"grunge2",display_name:"grunge #2",mode:"stretch",size:{min:1,max:35,default:20}},{name:"ebony",mode:"stretch",size:{min:1,max:35,default:15}},{name:"art1",display_name:"Art #1",mode:"repeat",size:{min:10,max:70,default:55}},{name:"art2",display_name:"Art #2",mode:"repeat",size:{min:10,max:70,default:55}}]}}},ah=e=>{let t;const n=new Set,r=(e,r)=>{const i="function"==typeof e?e(t):e;if(!Object.is(i,t)){const e=t;t=r??("object"!=typeof i||null===i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,o={setState:r,getState:i,getInitialState:()=>a,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{n.clear()}},a=t=e(r,i,o);return o};var sh={exports:{}},lh={},ch={exports:{}},uh={},dh=o,hh="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},fh=dh.useState,ph=dh.useEffect,gh=dh.useLayoutEffect,mh=dh.useDebugValue;function vh(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!hh(e,n)}catch{return!0}}var yh=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?function(e,t){return t()}:function(e,t){var n=t(),r=fh({inst:{value:n,getSnapshot:t}}),i=r[0].inst,o=r[1];return gh(function(){i.value=n,i.getSnapshot=t,vh(i)&&o({inst:i})},[e,n,t]),ph(function(){return vh(i)&&o({inst:i}),e(function(){vh(i)&&o({inst:i})})},[e]),mh(n),n};uh.useSyncExternalStore=void 0!==dh.useSyncExternalStore?dh.useSyncExternalStore:yh,ch.exports=uh;var bh=ch.exports,wh=o,xh=bh,Ch="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},_h=xh.useSyncExternalStore,Sh=wh.useRef,Ah=wh.useEffect,kh=wh.useMemo,Eh=wh.useDebugValue;lh.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=Sh(null);if(null===o.current){var a={hasValue:!1,value:null};o.current=a}else a=o.current;o=kh(function(){function e(e){if(!l){if(l=!0,o=e,e=r(e),void 0!==i&&a.hasValue){var t=a.value;if(i(t,e))return s=t}return s=e}if(t=s,Ch(o,e))return t;var n=r(e);return void 0!==i&&i(t,n)?t:(o=e,s=n)}var o,s,l=!1,c=void 0===n?null:n;return[function(){return e(t())},null===c?void 0:function(){return e(c())}]},[t,n,r,i]);var s=_h(e,o[0],o[1]);return Ah(function(){a.hasValue=!0,a.value=s},[s]),Eh(s),s},sh.exports=lh;const Ih=_d(sh.exports),{useDebugValue:jh}=o,{useSyncExternalStoreWithSelector:Th}=Ih,Fh=e=>e,Oh=e=>{const t="function"==typeof e?(e=>e?ah(e):ah)(e):e,n=(e,n)=>function(e,t=Fh,n){const r=Th(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return jh(r),r}(t,e,n);return Object.assign(n,t),n},Mh=e=>Oh;var Ph=Symbol.for("immer-nothing"),Rh=Symbol.for("immer-draftable"),Lh=Symbol.for("immer-state");function Nh(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Dh=Object.getPrototypeOf;function zh(e){return!!e&&!!e[Lh]}function Bh(e){var t;return!!e&&(Vh(e)||Array.isArray(e)||!!e[Rh]||!(null==(t=e.constructor)||!t[Rh])||qh(e)||Yh(e))}var Uh=Object.prototype.constructor.toString();function Vh(e){if(!e||"object"!=typeof e)return!1;const t=Dh(e);if(null===t)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===Uh}function Hh(e,t){0===Wh(e)?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function Wh(e){const t=e[Lh];return t?t.type_:Array.isArray(e)?1:qh(e)?2:Yh(e)?3:0}function $h(e,t){return 2===Wh(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Gh(e,t,n){const r=Wh(e);2===r?e.set(t,n):3===r?e.add(n):e[t]=n}function qh(e){return e instanceof Map}function Yh(e){return e instanceof Set}function Xh(e){return e.copy_||e.base_}function Kh(e,t){if(qh(e))return new Map(e);if(Yh(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=Vh(e);if(!0===t||"class_only"===t&&!n){const t=Object.getOwnPropertyDescriptors(e);delete t[Lh];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){const i=n[r],o=t[i];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(t[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:e[i]})}return Object.create(Dh(e),t)}{const t=Dh(e);if(null!==t&&n)return{...e};const r=Object.create(t);return Object.assign(r,e)}}function Zh(e,t=!1){return Qh(e)||zh(e)||!Bh(e)||(Wh(e)>1&&(e.set=e.add=e.clear=e.delete=Jh),Object.freeze(e),t&&Object.entries(e).forEach(([e,t])=>Zh(t,!0))),e}function Jh(){Nh(2)}function Qh(e){return Object.isFrozen(e)}var ef,tf={};function nf(e){const t=tf[e];return t||Nh(0),t}function rf(){return ef}function of(e,t){t&&(nf("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function af(e){sf(e),e.drafts_.forEach(cf),e.drafts_=null}function sf(e){e===ef&&(ef=e.parent_)}function lf(e){return ef=function(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}(ef,e)}function cf(e){const t=e[Lh];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function uf(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return void 0!==e&&e!==n?(n[Lh].modified_&&(af(t),Nh(4)),Bh(e)&&(e=df(t,e),t.parent_||ff(t,e)),t.patches_&&nf("Patches").generateReplacementPatches_(n[Lh].base_,e,t.patches_,t.inversePatches_)):e=df(t,n,[]),af(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Ph?e:void 0}function df(e,t,n){if(Qh(t))return t;const r=t[Lh];if(!r)return Hh(t,(i,o)=>hf(e,r,t,i,o,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return ff(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const t=r.copy_;let i=t,o=!1;3===r.type_&&(i=new Set(t),t.clear(),o=!0),Hh(i,(i,a)=>hf(e,r,t,i,a,n,o)),ff(e,t,!1),n&&e.patches_&&nf("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function hf(e,t,n,r,i,o,a){if(zh(i)){const a=df(e,i,o&&t&&3!==t.type_&&!$h(t.assigned_,r)?o.concat(r):void 0);if(Gh(n,r,a),!zh(a))return;e.canAutoFreeze_=!1}else a&&n.add(i);if(Bh(i)&&!Qh(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;df(e,i),(!t||!t.scope_.parent_)&&"symbol"!=typeof r&&Object.prototype.propertyIsEnumerable.call(n,r)&&ff(e,i)}}function ff(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Zh(t,n)}var pf={get(e,t){if(t===Lh)return e;const n=Xh(e);if(!$h(n,t))return function(e,t,n){var r;const i=vf(t,n);return i?"value"in i?i.value:null==(r=i.get)?void 0:r.call(e.draft_):void 0}(e,n,t);const r=n[t];return e.finalized_||!Bh(r)?r:r===mf(e.base_,t)?(bf(e),e.copy_[t]=wf(r,e)):r},has:(e,t)=>t in Xh(e),ownKeys:e=>Reflect.ownKeys(Xh(e)),set(e,t,n){const r=vf(Xh(e),t);if(null!=r&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const r=mf(Xh(e),t),i=null==r?void 0:r[Lh];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}(n,r)&&(void 0!==n||$h(e.base_,t)))return!0;bf(e),yf(e)}return e.copy_[t]===n&&(void 0!==n||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty:(e,t)=>(void 0!==mf(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,bf(e),yf(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=Xh(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:r.enumerable,value:n[t]}},defineProperty(){Nh(11)},getPrototypeOf:e=>Dh(e.base_),setPrototypeOf(){Nh(12)}},gf={};function mf(e,t){const n=e[Lh];return(n?Xh(n):e)[t]}function vf(e,t){if(!(t in e))return;let n=Dh(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=Dh(n)}}function yf(e){e.modified_||(e.modified_=!0,e.parent_&&yf(e.parent_))}function bf(e){e.copy_||(e.copy_=Kh(e.base_,e.scope_.immer_.useStrictShallowCopy_))}function wf(e,t){const n=qh(e)?nf("MapSet").proxyMap_(e,t):Yh(e)?nf("MapSet").proxySet_(e,t):function(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:rf(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,o=pf;n&&(i=[r],o=gf);const{revoke:a,proxy:s}=Proxy.revocable(i,o);return r.draft_=s,r.revoke_=a,s}(e,t);return(t?t.scope_:rf()).drafts_.push(n),n}function xf(e){if(!Bh(e)||Qh(e))return e;const t=e[Lh];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Kh(e,t.scope_.immer_.useStrictShallowCopy_)}else n=Kh(e,!0);return Hh(n,(e,t)=>{Gh(n,e,xf(t))}),t&&(t.finalized_=!1),n}Hh(pf,(e,t)=>{gf[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),gf.deleteProperty=function(e,t){return gf.set.call(this,e,t,void 0)},gf.set=function(e,t,n){return pf.set.call(this,e[0],t,n,e[0])};var Cf=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,t,n)=>{if("function"==typeof e&&"function"!=typeof t){const n=t;t=e;const r=this;return function(e=n,...i){return r.produce(e,e=>t.call(this,e,...i))}}let r;if("function"!=typeof t&&Nh(6),void 0!==n&&"function"!=typeof n&&Nh(7),Bh(e)){const i=lf(this),o=wf(e,void 0);let a=!0;try{r=t(o),a=!1}finally{a?af(i):sf(i)}return of(i,n),uf(r,i)}if(!e||"object"!=typeof e){if(r=t(e),void 0===r&&(r=e),r===Ph&&(r=void 0),this.autoFreeze_&&Zh(r,!0),n){const t=[],i=[];nf("Patches").generateReplacementPatches_(e,r,t,i),n(t,i)}return r}Nh(1)},this.produceWithPatches=(e,t)=>{if("function"==typeof e)return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,r;return[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},"boolean"==typeof(null==e?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof(null==e?void 0:e.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){Bh(e)||Nh(8),zh(e)&&(e=function(e){return zh(e)||Nh(10),xf(e)}(e));const t=lf(this),n=wf(e,void 0);return n[Lh].isManual_=!0,sf(t),n}finishDraft(e,t){const n=e&&e[Lh];(!n||!n.isManual_)&&Nh(9);const{scope_:r}=n;return of(r,t),uf(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));const r=nf("Patches").applyPatches_;return zh(e)?r(e,t):this.produce(e,e=>r(e,t))}},_f=Cf.produce;Cf.produceWithPatches.bind(Cf),Cf.setAutoFreeze.bind(Cf),Cf.setUseStrictShallowCopy.bind(Cf),Cf.applyPatches.bind(Cf),Cf.createDraft.bind(Cf),Cf.finishDraft.bind(Cf);var Sf=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===Af}(e)}(e)},Af="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function kf(e,t){return!1!==t.clone&&t.isMergeableObject(e)?Tf(function(e){return Array.isArray(e)?[]:{}}(e),e,t):e}function Ef(e,t,n){return e.concat(t).map(function(e){return kf(e,n)})}function If(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}(e))}function jf(e,t){try{return t in e}catch{return!1}}function Tf(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||Ef,n.isMergeableObject=n.isMergeableObject||Sf,n.cloneUnlessOtherwiseSpecified=kf;var r=Array.isArray(t);return r===Array.isArray(e)?r?n.arrayMerge(e,t,n):function(e,t,n){var r={};return n.isMergeableObject(e)&&If(e).forEach(function(t){r[t]=kf(e[t],n)}),If(t).forEach(function(i){(function(e,t){return jf(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,i)||(jf(e,i)&&n.isMergeableObject(t[i])?r[i]=function(e,t){if(!t.customMerge)return Tf;var n=t.customMerge(e);return"function"==typeof n?n:Tf}(i,n)(e[i],t[i],n):r[i]=kf(t[i],n))}),r}(e,t,n):kf(t,n)}Tf.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(e,n){return Tf(e,n,t)},{})};const Ff=_d(Tf);function Of(e,t){return Mf(Ff(t,e),e)}function Mf(e,t){return Object.keys(e).forEach(n=>{if(n.startsWith("replaceDefault")&&e[n]){const r=function(e){return e.charAt(0).toLowerCase()+e.slice(1)}(n.replace("replaceDefault","")||"items");e[r]=t?t[r]:[],delete e[n]}else"object"==typeof e[n]&&null!==e[n]&&Mf(e[n],null==t?void 0:t[n])}),e}const Pf=(e,t)=>({history:{...Rf,updatePointerById:e=>{const n=t().history.items.findIndex(t=>t.id===e);t().history.update(n)},update:(t,n)=>{e(e=>{e.history.pointer=t,n&&(e.history.items=n),e.history.canUndo=e.history.pointer>0,e.history.canRedo=e.history.items.length>e.history.pointer+1})},reset:n=>{e({history:{...t().history,...n??Rf}})}}}),Rf={items:[],pointer:0,canUndo:!1,canRedo:!1};var Lf=(e=>(e.Filter="filter",e.Frame="frame",e.ActiveObject="activeObj",e.Text="text",e))(Lf||{});const Nf=(e,t)=>({filter:{...Df,select(t,n=!1){e(e=>{e.filter.selected=t,e.activeToolOverlay=n?Lf.Filter:null,e.dirty=!0})},deselect(n){t().filter.selected===n&&e(e=>{e.filter.selected=null,e.activeToolOverlay=null,e.dirty=!0})},reset(){e({filter:{...t().filter,...Df}})}}}),Df={selected:null,applied:[]},zf=(e,t)=>({crop:{...Bf,setCropzoneRect:t=>{e(e=>{e.crop.zoneRect=t})},setAspectRatio:t=>{e(e=>{e.crop.selectedAspectRatio=t})},setTransformAngle:t=>{e(e=>{e.crop.straightenAngle=t})},apply:async()=>{const e=t().crop.zoneRect;if(e){const n={width:Math.ceil(e.width/t().zoom),height:Math.ceil(e.height/t().zoom),left:Math.ceil(e.left/t().zoom),top:Math.ceil(e.top/t().zoom)};await t().editor.tools.crop.apply(n)}},reset:()=>{e({crop:{...t().crop,...Bf}})}}}),Bf={zoneRect:null,selectedAspectRatio:null,straightenAngle:0};function Uf(e){return"i-text"===(null==e?void 0:e.type)}var Vf=(e=>(e.Text="text",e.Shape="shape",e.Sticker="sticker",e.Drawing="drawing",e.Image="image",e.MainImage="mainImage",e.StraightenAnchor="straightenHelper",e))(Vf||{});const Hf={text:{name:kd("Text"),icon:th.text.icon},shape:{name:kd("Shape"),icon:th.shapes.icon},sticker:{name:kd("Sticker"),icon:th.stickers.icon},drawing:{name:kd("Drawing"),icon:th.draw.icon},image:{name:kd("Image"),icon:th.overlayImage.icon},mainImage:{name:kd("Background Image"),icon:th.bgImage.icon}},Wf={isMoving:!1,editableProps:{},id:null,isText:!1,isImage:!1,name:null},$f=(e,t)=>({objects:{...Gf,setActiveIsMoving:t=>{e(e=>{e.objects.active.isMoving=t})},setIsEditingText:t=>{e(e=>{e.objects.isEditingText=t})},setActive:n=>{e(n?e=>{e.objects.active.editableProps=function(e){if(!e)return{};const t={fill:e.fill,opacity:e.opacity,backgroundColor:e.backgroundColor,stroke:e.stroke,strokeWidth:e.strokeWidth},n=e.shadow;return n&&(t.shadow={color:n.color,blur:n.blur,offsetX:n.offsetX,offsetY:n.offsetY}),Uf(e)&&(t.textAlign=e.textAlign,t.underline=e.underline,t.linethrough=e.linethrough,t.fontStyle=e.fontStyle,t.fontFamily=e.fontFamily,t.fontWeight=e.fontWeight,t.fontSize=e.fontSize),t}(n),e.objects.active.id=n.data.id,e.objects.active.name=n.name??null,e.objects.active.isText=Uf(n),e.objects.active.isImage=function(e){return e.name===Vf.Image}(n)}:e=>{var n,r,i,o,a;const s={...null==(n=t().config.objectDefaults)?void 0:n.global,fontFamily:null==(i=null==(r=t().config.objectDefaults)?void 0:r.text)?void 0:i.fontFamily,fontSize:null==(a=null==(o=t().config.objectDefaults)?void 0:o.text)?void 0:a.fontSize};e.objects.active={...Wf,editableProps:s}})},reset(){e({objects:{...t().objects,...Gf}})}}}),Gf={all:[],isEditingText:!1,active:Wf},qf=(e,t)=>({frame:{...Yf,select:n=>{e(e=>{e.frame.active=n}),t().frame.showOptionsPanel()},deselect:()=>{e(e=>{e.frame.active=null,e.activeToolOverlay=null})},showOptionsPanel:()=>{t().activeTool===Od.FRAME&&e(e=>{e.activeToolOverlay=Lf.Frame})},reset(){e({frame:{...t().frame,...Yf}})}}}),Yf={active:null},Xf=(e,t)=>({resize:{...Kf,setFormValue:t=>{e(e=>{Object.entries(t).forEach(([t,n])=>{e.resize.formValue[t]=n})})},apply(){const e=t().resize.formValue,n=t().original;if(e.width===n.width&&e.height===n.height)return!1;t().editor.tools.resize.apply(e)},reset(){e({resize:{...t().resize,...Kf}})}}}),Kf={formValue:{width:1,height:1,maintainAspect:!0,usePercentages:!1}},Zf=(e,t)=>({corners:{...Jf,setRadius:t=>{e(e=>{e.corners.radius=t})},apply:()=>t().editor.tools.corners.apply(t().corners.radius),reset(){e({corners:{...t().corners,...Jf}})}}}),Jf={radius:50},Qf=e=>(t,n,r)=>(r.setState=(e,n,...r)=>{const i="function"==typeof e?_f(e):e;return t(i,n,...r)},e(r.setState,n,r));var ep={exports:{}},tp={exports:{}},np=function(e){return!(!e||"string"==typeof e)&&(e instanceof Array||Array.isArray(e)||e.length>=0&&(e.splice instanceof Function||Object.getOwnPropertyDescriptor(e,e.length-1)&&"String"!==e.constructor.name))},rp=Array.prototype.concat,ip=Array.prototype.slice,op=tp.exports=function(e){for(var t=[],n=0,r=e.length;n<r;n++){var i=e[n];np(i)?t=rp.call(t,ip.call(i)):t.push(i)}return t};op.wrap=function(e){return function(){return e(op(arguments))}};var ap=tp.exports,sp={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},lp=ap,cp=Object.hasOwnProperty,up=Object.create(null);for(var dp in sp)cp.call(sp,dp)&&(up[sp[dp]]=dp);var hp=ep.exports={to:{},get:{}};function fp(e,t,n){return Math.min(Math.max(t,e),n)}function pp(e){var t=Math.round(e).toString(16).toUpperCase();return t.length<2?"0"+t:t}hp.get=function(e){var t,n;switch(e.substring(0,3).toLowerCase()){case"hsl":t=hp.get.hsl(e),n="hsl";break;case"hwb":t=hp.get.hwb(e),n="hwb";break;default:t=hp.get.rgb(e),n="rgb"}return t?{model:n,value:t}:null},hp.get.rgb=function(e){if(!e)return null;var t,n,r,i=[0,0,0,1];if(t=e.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(r=t[2],t=t[1],n=0;n<3;n++){var o=2*n;i[n]=parseInt(t.slice(o,o+2),16)}r&&(i[3]=parseInt(r,16)/255)}else if(t=e.match(/^#([a-f0-9]{3,4})$/i)){for(r=(t=t[1])[3],n=0;n<3;n++)i[n]=parseInt(t[n]+t[n],16);r&&(i[3]=parseInt(r+r,16)/255)}else if(t=e.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(n=0;n<3;n++)i[n]=parseInt(t[n+1],0);t[4]&&(t[5]?i[3]=.01*parseFloat(t[4]):i[3]=parseFloat(t[4]))}else{if(!(t=e.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(t=e.match(/^(\w+)$/))?"transparent"===t[1]?[0,0,0,0]:cp.call(sp,t[1])?((i=sp[t[1]])[3]=1,i):null:null;for(n=0;n<3;n++)i[n]=Math.round(2.55*parseFloat(t[n+1]));t[4]&&(t[5]?i[3]=.01*parseFloat(t[4]):i[3]=parseFloat(t[4]))}for(n=0;n<3;n++)i[n]=fp(i[n],0,255);return i[3]=fp(i[3],0,1),i},hp.get.hsl=function(e){if(!e)return null;var t=e.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(t){var n=parseFloat(t[4]);return[(parseFloat(t[1])%360+360)%360,fp(parseFloat(t[2]),0,100),fp(parseFloat(t[3]),0,100),fp(isNaN(n)?1:n,0,1)]}return null},hp.get.hwb=function(e){if(!e)return null;var t=e.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(t){var n=parseFloat(t[4]);return[(parseFloat(t[1])%360+360)%360,fp(parseFloat(t[2]),0,100),fp(parseFloat(t[3]),0,100),fp(isNaN(n)?1:n,0,1)]}return null},hp.to.hex=function(){var e=lp(arguments);return"#"+pp(e[0])+pp(e[1])+pp(e[2])+(e[3]<1?pp(Math.round(255*e[3])):"")},hp.to.rgb=function(){var e=lp(arguments);return e.length<4||1===e[3]?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"},hp.to.rgb.percent=function(){var e=lp(arguments),t=Math.round(e[0]/255*100),n=Math.round(e[1]/255*100),r=Math.round(e[2]/255*100);return e.length<4||1===e[3]?"rgb("+t+"%, "+n+"%, "+r+"%)":"rgba("+t+"%, "+n+"%, "+r+"%, "+e[3]+")"},hp.to.hsl=function(){var e=lp(arguments);return e.length<4||1===e[3]?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"},hp.to.hwb=function(){var e=lp(arguments),t="";return e.length>=4&&1!==e[3]&&(t=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"},hp.to.keyword=function(e){return up[e.slice(0,3)]};var gp=ep.exports;const mp={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},vp={};for(const jM of Object.keys(mp))vp[mp[jM]]=jM;const yp={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};var bp=yp;for(const jM of Object.keys(yp)){if(!("channels"in yp[jM]))throw new Error("missing channels property: "+jM);if(!("labels"in yp[jM]))throw new Error("missing channel labels property: "+jM);if(yp[jM].labels.length!==yp[jM].channels)throw new Error("channel and label counts mismatch: "+jM);const{channels:e,labels:t}=yp[jM];delete yp[jM].channels,delete yp[jM].labels,Object.defineProperty(yp[jM],"channels",{value:e}),Object.defineProperty(yp[jM],"labels",{value:t})}function wp(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}yp.rgb.hsl=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=o-i;let s,l;o===i?s=0:t===o?s=(n-r)/a:n===o?s=2+(r-t)/a:r===o&&(s=4+(t-n)/a),s=Math.min(60*s,360),s<0&&(s+=360);const c=(i+o)/2;return l=o===i?0:c<=.5?a/(o+i):a/(2-o-i),[s,100*l,100*c]},yp.rgb.hsv=function(e){let t,n,r,i,o;const a=e[0]/255,s=e[1]/255,l=e[2]/255,c=Math.max(a,s,l),u=c-Math.min(a,s,l),d=function(e){return(c-e)/6/u+.5};return 0===u?(i=0,o=0):(o=u/c,t=d(a),n=d(s),r=d(l),a===c?i=r-n:s===c?i=1/3+t-r:l===c&&(i=2/3+n-t),i<0?i+=1:i>1&&(i-=1)),[360*i,100*o,100*c]},yp.rgb.hwb=function(e){const t=e[0],n=e[1];let r=e[2];const i=yp.rgb.hsl(e)[0],o=1/255*Math.min(t,Math.min(n,r));return r=1-1/255*Math.max(t,Math.max(n,r)),[i,100*o,100*r]},yp.rgb.cmyk=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(1-t,1-n,1-r);return[100*((1-t-i)/(1-i)||0),100*((1-n-i)/(1-i)||0),100*((1-r-i)/(1-i)||0),100*i]},yp.rgb.keyword=function(e){const t=vp[e];if(t)return t;let n,r=1/0;for(const i of Object.keys(mp)){const t=wp(e,mp[i]);t<r&&(r=t,n=i)}return n},yp.keyword.rgb=function(e){return mp[e]},yp.rgb.xyz=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255;return t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92,[100*(.4124*t+.3576*n+.1805*r),100*(.2126*t+.7152*n+.0722*r),100*(.0193*t+.1192*n+.9505*r)]},yp.rgb.lab=function(e){const t=yp.rgb.xyz(e);let n=t[0],r=t[1],i=t[2];return n/=95.047,r/=100,i/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,i=i>.008856?i**(1/3):7.787*i+16/116,[116*r-16,500*(n-r),200*(r-i)]},yp.hsl.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;let i,o,a;if(0===n)return a=255*r,[a,a,a];i=r<.5?r*(1+n):r+n-r*n;const s=2*r-i,l=[0,0,0];for(let c=0;c<3;c++)o=t+1/3*-(c-1),o<0&&o++,o>1&&o--,a=6*o<1?s+6*(i-s)*o:2*o<1?i:3*o<2?s+(i-s)*(2/3-o)*6:s,l[c]=255*a;return l},yp.hsl.hsv=function(e){const t=e[0];let n=e[1]/100,r=e[2]/100,i=n;const o=Math.max(r,.01);return r*=2,n*=r<=1?r:2-r,i*=o<=1?o:2-o,[t,100*(0===r?2*i/(o+i):2*n/(r+n)),(r+n)/2*100]},yp.hsv.rgb=function(e){const t=e[0]/60,n=e[1]/100;let r=e[2]/100;const i=Math.floor(t)%6,o=t-Math.floor(t),a=255*r*(1-n),s=255*r*(1-n*o),l=255*r*(1-n*(1-o));switch(r*=255,i){case 0:return[r,l,a];case 1:return[s,r,a];case 2:return[a,r,l];case 3:return[a,s,r];case 4:return[l,a,r];case 5:return[r,a,s]}},yp.hsv.hsl=function(e){const t=e[0],n=e[1]/100,r=e[2]/100,i=Math.max(r,.01);let o,a;a=(2-n)*r;const s=(2-n)*i;return o=n*i,o/=s<=1?s:2-s,o=o||0,a/=2,[t,100*o,100*a]},yp.hwb.rgb=function(e){const t=e[0]/360;let n=e[1]/100,r=e[2]/100;const i=n+r;let o;i>1&&(n/=i,r/=i);const a=Math.floor(6*t),s=1-r;o=6*t-a,1&a&&(o=1-o);const l=n+o*(s-n);let c,u,d;switch(a){default:case 6:case 0:c=s,u=l,d=n;break;case 1:c=l,u=s,d=n;break;case 2:c=n,u=s,d=l;break;case 3:c=n,u=l,d=s;break;case 4:c=l,u=n,d=s;break;case 5:c=s,u=n,d=l}return[255*c,255*u,255*d]},yp.cmyk.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100,i=e[3]/100;return[255*(1-Math.min(1,t*(1-i)+i)),255*(1-Math.min(1,n*(1-i)+i)),255*(1-Math.min(1,r*(1-i)+i))]},yp.xyz.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100;let i,o,a;return i=3.2406*t+-1.5372*n+-.4986*r,o=-.9689*t+1.8758*n+.0415*r,a=.0557*t+-.204*n+1.057*r,i=i>.0031308?1.055*i**(1/2.4)-.055:12.92*i,o=o>.0031308?1.055*o**(1/2.4)-.055:12.92*o,a=a>.0031308?1.055*a**(1/2.4)-.055:12.92*a,i=Math.min(Math.max(0,i),1),o=Math.min(Math.max(0,o),1),a=Math.min(Math.max(0,a),1),[255*i,255*o,255*a]},yp.xyz.lab=function(e){let t=e[0],n=e[1],r=e[2];return t/=95.047,n/=100,r/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,[116*n-16,500*(t-n),200*(n-r)]},yp.lab.xyz=function(e){let t,n,r;n=(e[0]+16)/116,t=e[1]/500+n,r=n-e[2]/200;const i=n**3,o=t**3,a=r**3;return n=i>.008856?i:(n-16/116)/7.787,t=o>.008856?o:(t-16/116)/7.787,r=a>.008856?a:(r-16/116)/7.787,t*=95.047,n*=100,r*=108.883,[t,n,r]},yp.lab.lch=function(e){const t=e[0],n=e[1],r=e[2];let i;return i=360*Math.atan2(r,n)/2/Math.PI,i<0&&(i+=360),[t,Math.sqrt(n*n+r*r),i]},yp.lch.lab=function(e){const t=e[0],n=e[1],r=e[2]/360*2*Math.PI;return[t,n*Math.cos(r),n*Math.sin(r)]},yp.rgb.ansi16=function(e,t=null){const[n,r,i]=e;let o=null===t?yp.rgb.hsv(e)[2]:t;if(o=Math.round(o/50),0===o)return 30;let a=30+(Math.round(i/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return 2===o&&(a+=60),a},yp.hsv.ansi16=function(e){return yp.rgb.ansi16(yp.hsv.rgb(e),e[2])},yp.rgb.ansi256=function(e){const t=e[0],n=e[1],r=e[2];return t===n&&n===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},yp.ansi16.rgb=function(e){let t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const n=.5*(1+~~(e>50));return[(1&t)*n*255,(t>>1&1)*n*255,(t>>2&1)*n*255]},yp.ansi256.rgb=function(e){if(e>=232){const t=10*(e-232)+8;return[t,t,t]}let t;return e-=16,[Math.floor(e/36)/5*255,Math.floor((t=e%36)/6)/5*255,t%6/5*255]},yp.rgb.hex=function(e){const t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t},yp.hex.rgb=function(e){const t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let n=t[0];3===t[0].length&&(n=n.split("").map(e=>e+e).join(""));const r=parseInt(n,16);return[r>>16&255,r>>8&255,255&r]},yp.rgb.hcg=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.max(Math.max(t,n),r),o=Math.min(Math.min(t,n),r),a=i-o;let s,l;return s=a<1?o/(1-a):0,l=a<=0?0:i===t?(n-r)/a%6:i===n?2+(r-t)/a:4+(t-n)/a,l/=6,l%=1,[360*l,100*a,100*s]},yp.hsl.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=n<.5?2*t*n:2*t*(1-n);let i=0;return r<1&&(i=(n-.5*r)/(1-r)),[e[0],100*r,100*i]},yp.hsv.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=t*n;let i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],100*r,100*i]},yp.hcg.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;if(0===n)return[255*r,255*r,255*r];const i=[0,0,0],o=t%1*6,a=o%1,s=1-a;let l=0;switch(Math.floor(o)){case 0:i[0]=1,i[1]=a,i[2]=0;break;case 1:i[0]=s,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=a;break;case 3:i[0]=0,i[1]=s,i[2]=1;break;case 4:i[0]=a,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=s}return l=(1-n)*r,[255*(n*i[0]+l),255*(n*i[1]+l),255*(n*i[2]+l)]},yp.hcg.hsv=function(e){const t=e[1]/100,n=t+e[2]/100*(1-t);let r=0;return n>0&&(r=t/n),[e[0],100*r,100*n]},yp.hcg.hsl=function(e){const t=e[1]/100,n=e[2]/100*(1-t)+.5*t;let r=0;return n>0&&n<.5?r=t/(2*n):n>=.5&&n<1&&(r=t/(2*(1-n))),[e[0],100*r,100*n]},yp.hcg.hwb=function(e){const t=e[1]/100,n=t+e[2]/100*(1-t);return[e[0],100*(n-t),100*(1-n)]},yp.hwb.hcg=function(e){const t=e[1]/100,n=1-e[2]/100,r=n-t;let i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],100*r,100*i]},yp.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},yp.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},yp.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},yp.gray.hsl=function(e){return[0,0,e[0]]},yp.gray.hsv=yp.gray.hsl,yp.gray.hwb=function(e){return[0,100,e[0]]},yp.gray.cmyk=function(e){return[0,0,0,e[0]]},yp.gray.lab=function(e){return[e[0],0,0]},yp.gray.hex=function(e){const t=255&Math.round(e[0]/100*255),n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(n.length)+n},yp.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};const xp=bp;function Cp(e,t){return function(n){return t(e(n))}}function _p(e,t){const n=[t[e].parent,e];let r=xp[t[e].parent][e],i=t[e].parent;for(;t[i].parent;)n.unshift(t[i].parent),r=Cp(xp[t[i].parent][i],r),i=t[i].parent;return r.conversion=n,r}const Sp=bp,Ap=function(e){const t=function(e){const t=function(){const e={},t=Object.keys(xp);for(let n=t.length,r=0;r<n;r++)e[t[r]]={distance:-1,parent:null};return e}(),n=[e];for(t[e].distance=0;n.length;){const e=n.pop(),r=Object.keys(xp[e]);for(let i=r.length,o=0;o<i;o++){const i=r[o],a=t[i];-1===a.distance&&(a.distance=t[e].distance+1,a.parent=e,n.unshift(i))}}return t}(e),n={},r=Object.keys(t);for(let i=r.length,o=0;o<i;o++){const e=r[o];null!==t[e].parent&&(n[e]=_p(e,t))}return n},kp={};Object.keys(Sp).forEach(e=>{kp[e]={},Object.defineProperty(kp[e],"channels",{value:Sp[e].channels}),Object.defineProperty(kp[e],"labels",{value:Sp[e].labels});const t=Ap(e);Object.keys(t).forEach(n=>{const r=t[n];kp[e][n]=function(e){const t=function(...t){const n=t[0];if(null==n)return n;n.length>1&&(t=n);const r=e(t);if("object"==typeof r)for(let e=r.length,i=0;i<e;i++)r[i]=Math.round(r[i]);return r};return"conversion"in e&&(t.conversion=e.conversion),t}(r),kp[e][n].raw=function(e){const t=function(...t){const n=t[0];return null==n?n:(n.length>1&&(t=n),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}(r)})});const Ep=gp,Ip=kp,jp=["keyword","gray","hex"],Tp={};for(const jM of Object.keys(Ip))Tp[[...Ip[jM].labels].sort().join("")]=jM;const Fp={};function Op(e,t){if(!(this instanceof Op))return new Op(e,t);if(t&&t in jp&&(t=null),t&&!(t in Ip))throw new Error("Unknown model: "+t);let n,r;if(null==e)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(e instanceof Op)this.model=e.model,this.color=[...e.color],this.valpha=e.valpha;else if("string"==typeof e){const t=Ep.get(e);if(null===t)throw new Error("Unable to parse color from string: "+e);this.model=t.model,r=Ip[this.model].channels,this.color=t.value.slice(0,r),this.valpha="number"==typeof t.value[r]?t.value[r]:1}else if(e.length>0){this.model=t||"rgb",r=Ip[this.model].channels;const n=Array.prototype.slice.call(e,0,r);this.color=Np(n,r),this.valpha="number"==typeof e[r]?e[r]:1}else if("number"==typeof e)this.model="rgb",this.color=[e>>16&255,e>>8&255,255&e],this.valpha=1;else{this.valpha=1;const t=Object.keys(e);"alpha"in e&&(t.splice(t.indexOf("alpha"),1),this.valpha="number"==typeof e.alpha?e.alpha:0);const r=t.sort().join("");if(!(r in Tp))throw new Error("Unable to parse color from object: "+JSON.stringify(e));this.model=Tp[r];const{labels:i}=Ip[this.model],o=[];for(n=0;n<i.length;n++)o.push(e[i[n]]);this.color=Np(o)}if(Fp[this.model])for(r=Ip[this.model].channels,n=0;n<r;n++){const e=Fp[this.model][n];e&&(this.color[n]=e(this.color[n]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}Op.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(e){let t=this.model in Ep.to?this:this.rgb();t=t.round("number"==typeof e?e:1);const n=1===t.valpha?t.color:[...t.color,this.valpha];return Ep.to[t.model](n)},percentString(e){const t=this.rgb().round("number"==typeof e?e:1),n=1===t.valpha?t.color:[...t.color,this.valpha];return Ep.to.rgb.percent(n)},array(){return 1===this.valpha?[...this.color]:[...this.color,this.valpha]},object(){const e={},{channels:t}=Ip[this.model],{labels:n}=Ip[this.model];for(let r=0;r<t;r++)e[n[r]]=this.color[r];return 1!==this.valpha&&(e.alpha=this.valpha),e},unitArray(){const e=this.rgb().color;return e[0]/=255,e[1]/=255,e[2]/=255,1!==this.valpha&&e.push(this.valpha),e},unitObject(){const e=this.rgb().object();return e.r/=255,e.g/=255,e.b/=255,1!==this.valpha&&(e.alpha=this.valpha),e},round(e){return e=Math.max(e||0,0),new Op([...this.color.map(Mp(e)),this.valpha],this.model)},alpha(e){return void 0!==e?new Op([...this.color,Math.max(0,Math.min(1,e))],this.model):this.valpha},red:Pp("rgb",0,Rp(255)),green:Pp("rgb",1,Rp(255)),blue:Pp("rgb",2,Rp(255)),hue:Pp(["hsl","hsv","hsl","hwb","hcg"],0,e=>(e%360+360)%360),saturationl:Pp("hsl",1,Rp(100)),lightness:Pp("hsl",2,Rp(100)),saturationv:Pp("hsv",1,Rp(100)),value:Pp("hsv",2,Rp(100)),chroma:Pp("hcg",1,Rp(100)),gray:Pp("hcg",2,Rp(100)),white:Pp("hwb",1,Rp(100)),wblack:Pp("hwb",2,Rp(100)),cyan:Pp("cmyk",0,Rp(100)),magenta:Pp("cmyk",1,Rp(100)),yellow:Pp("cmyk",2,Rp(100)),black:Pp("cmyk",3,Rp(100)),x:Pp("xyz",0,Rp(95.047)),y:Pp("xyz",1,Rp(100)),z:Pp("xyz",2,Rp(108.833)),l:Pp("lab",0,Rp(100)),a:Pp("lab",1),b:Pp("lab",2),keyword(e){return void 0!==e?new Op(e):Ip[this.model].keyword(this.color)},hex(e){return void 0!==e?new Op(e):Ep.to.hex(this.rgb().round().color)},hexa(e){if(void 0!==e)return new Op(e);const t=this.rgb().round().color;let n=Math.round(255*this.valpha).toString(16).toUpperCase();return 1===n.length&&(n="0"+n),Ep.to.hex(t)+n},rgbNumber(){const e=this.rgb().color;return(255&e[0])<<16|(255&e[1])<<8|255&e[2]},luminosity(){const e=this.rgb().color,t=[];for(const[n,r]of e.entries()){const e=r/255;t[n]=e<=.04045?e/12.92:((e+.055)/1.055)**2.4}return.2126*t[0]+.7152*t[1]+.0722*t[2]},contrast(e){const t=this.luminosity(),n=e.luminosity();return t>n?(t+.05)/(n+.05):(n+.05)/(t+.05)},level(e){const t=this.contrast(e);return t>=7?"AAA":t>=4.5?"AA":""},isDark(){const e=this.rgb().color;return(2126*e[0]+7152*e[1]+722*e[2])/1e4<128},isLight(){return!this.isDark()},negate(){const e=this.rgb();for(let t=0;t<3;t++)e.color[t]=255-e.color[t];return e},lighten(e){const t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken(e){const t=this.hsl();return t.color[2]-=t.color[2]*e,t},saturate(e){const t=this.hsl();return t.color[1]+=t.color[1]*e,t},desaturate(e){const t=this.hsl();return t.color[1]-=t.color[1]*e,t},whiten(e){const t=this.hwb();return t.color[1]+=t.color[1]*e,t},blacken(e){const t=this.hwb();return t.color[2]+=t.color[2]*e,t},grayscale(){const e=this.rgb().color,t=.3*e[0]+.59*e[1]+.11*e[2];return Op.rgb(t,t,t)},fade(e){return this.alpha(this.valpha-this.valpha*e)},opaquer(e){return this.alpha(this.valpha+this.valpha*e)},rotate(e){const t=this.hsl();let n=t.color[0];return n=(n+e)%360,n=n<0?360+n:n,t.color[0]=n,t},mix(e,t){if(!e||!e.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof e);const n=e.rgb(),r=this.rgb(),i=void 0===t?.5:t,o=2*i-1,a=n.alpha()-r.alpha(),s=((o*a===-1?o:(o+a)/(1+o*a))+1)/2,l=1-s;return Op.rgb(s*n.red()+l*r.red(),s*n.green()+l*r.green(),s*n.blue()+l*r.blue(),n.alpha()*i+r.alpha()*(1-i))}};for(const jM of Object.keys(Ip)){if(jp.includes(jM))continue;const{channels:e}=Ip[jM];Op.prototype[jM]=function(...e){return this.model===jM?new Op(this):e.length>0?new Op(e,jM):new Op([...Lp(Ip[this.model][jM].raw(this.color)),this.valpha],jM)},Op[jM]=function(...t){let n=t[0];return"number"==typeof n&&(n=Np(t,e)),new Op(n,jM)}}function Mp(e){return function(t){return function(e,t){return Number(e.toFixed(t))}(t,e)}}function Pp(e,t,n){e=Array.isArray(e)?e:[e];for(const r of e)(Fp[r]||(Fp[r]=[]))[t]=n;return e=e[0],function(r){let i;return void 0!==r?(n&&(r=n(r)),i=this[e](),i.color[t]=r,i):(i=this[e]().color[t],n&&(i=n(i)),i)}}function Rp(e){return function(t){return Math.max(0,Math.min(e,t))}}function Lp(e){return Array.isArray(e)?e:[e]}function Np(e,t){for(let n=0;n<t;n++)"number"!=typeof e[n]&&(e[n]=0);return e}const Dp=_d(Op);function zp(e){return e.endsWith("%")||3===e.split(" ").length?e:Dp(e).rgb().array().slice(0,3).join(" ")}let Bp=typeof document<"u"?document.getElementById("root")??document.body:void 0,Up=typeof document<"u"?document.documentElement:void 0;const Vp=Mh()(e=>({data:typeof window<"u"&&window.bootstrapData?Wp(window.bootstrapData):null,setData:t=>{const n="string"==typeof t?Wp(t):t;e({data:n})},mergeData:t=>{e(e=>({data:{...e.data,...t}}))}}));Vp.getState().setData;const Hp=Vp.getState().mergeData;function Wp(e){return"string"==typeof e?JSON.parse(e):e}const $p={top:0,right:0,bottom:0,left:0,width:0,height:0},Gp=Mh()((e=>(t,n,r)=>{const i=r.subscribe;return r.subscribe=(e,t,n)=>{let o=e;if(t){const i=(null==n?void 0:n.equalityFn)||Object.is;let a=e(r.getState());o=n=>{const r=e(n);if(!i(a,r)){const e=a;t(a=r,e)}},null!=n&&n.fireImmediately&&t(a,a)}return i(o)},e(t,n,r)})(Qf((e,t)=>({editor:null,fabric:null,config:oh,zoom:1,dirty:!1,original:{width:1,height:1},stageSize:$p,canvasSize:$p,canvasRef:null,activeTool:null,activeToolOverlay:null,loading:!1,openPanels:{newImage:!1,history:!1,objects:!1,export:!1},...Pf(e,t),...$f(e,t),...Nf(e,t),...zf(e,t),...qf(e,t),...Xf(e,t),...Zf(e,t),setZoom:t=>e(e=>{e.zoom=t}),setOriginal:(t,n)=>e(e=>{e.original={width:t,height:n}}),setDirty:t=>e(e=>{e.dirty=t}),toggleLoading:t=>e(e=>{e.loading=t}),setStageSize:t=>e(e=>{e.stageSize=t}),setCanvasSize:t=>e(e=>{e.canvasSize=t}),setActiveTool:(t,n)=>{e(e=>{e.activeTool=t,e.activeToolOverlay=n})},setConfig:n=>e(e=>{var r,i;const o=Of(n,t().config);e.config=o;const a=o.activeLanguage||"en",s=null==(r=o.languages)?void 0:r[a],l=((null==(i=o.ui)?void 0:i.themes)||[]).map(e=>function(e){const t=e.isDark?Fd.find(e=>e.isDark):Fd.find(e=>!e.isDark),n={...t,...e,colors:{...null==t?void 0:t.colors,...e.colors}},r=Object.entries(n.colors).map(([e,t])=>[e,zp(t)]);return{id:n.name,name:n.name,values:Object.fromEntries(r),is_dark:n.isDark}}(e)),c=l.find(e=>{var t;return e.id===(null==(t=o.ui)?void 0:t.activeTheme)});c&&function(e){Object.entries(e.values).forEach(([e,t])=>{!function(e,t){null==Up||Up.style.setProperty(e,t)}(e,t)}),e.is_dark?Up.classList.add("dark"):Up.classList.remove("dark")}(c),Hp({i18n:{language:a,name:a,id:0,lines:s},themes:{all:l}})}),togglePanel:(t,n)=>e(e=>{e.openPanels[t]=n??!e.openPanels[t]}),applyChanges:async()=>{var n;const r=t().activeTool;if(!r)return;const i=t()[r],o=await(null==(n=null==i?void 0:i.apply)?void 0:n.call(i));e(e=>{e.dirty=!1,e.activeTool=null,e.activeToolOverlay=null}),!1!==o&&t().editor.tools.history.addHistoryItem({name:r}),null==i||i.reset()},cancelChanges:async()=>{const n=t().activeTool;if(!n)return;const r=t().dirty;e(e=>{e.dirty=!1,e.activeTool=null,e.activeToolOverlay=null}),r&&await t().editor.tools.history.reload();const i=t()[n];null==i||i.reset()},reset:()=>{t().editor.tools.transform.resetStraightenAnchor(),e({activeTool:null,activeToolOverlay:null,zoom:1,dirty:!1,loading:!1,openPanels:{newImage:!1,history:!1,objects:!1,export:!1}}),t().history.reset(),t().objects.reset(),t().filter.reset(),t().crop.reset(),t().frame.reset(),t().resize.reset(),t().corners.reset()}}))));function qp(){return Gp.getState()}function Yp(){return qp().editor.tools}function Xp(){return qp().fabric}function Kp(e){var t,n,r,i,o;Yp().canvas.clear(),Yp().frame.remove();const a=!(null!=(t=qp().config.ui)&&t.visible);return qp().setConfig({image:void 0,blankCanvasSize:void 0,...e}),qp().reset(),null!=(n=qp().config.ui)&&n.defaultTool&&qp().setActiveTool(null==(r=qp().config.ui)?void 0:r.defaultTool,null),a&&(null==(o=(i=qp().config).onOpen)||o.call(i)),new Promise(e=>setTimeout(e))}async function Zp(e){return(await fetch(e)).json()}const Jp={selectable:!1,evented:!1,lockMovementX:!0,lockMovementY:!0,lockRotation:!0,lockScalingX:!0,lockScalingY:!0,lockUniScaling:!0,hasControls:!1,hasBorders:!1,hasRotatingPoint:!1,strokeWidth:0};function Qp(e=[]){var t;e=[...Object.keys(Jp),"crossOrigin","name","displayName","data",...e];const n=Xp().toJSON(e);return n.objects=n.objects.filter(e=>!e.data.pixieInternal).map(e=>("image"===e.type&&qp().config.crossOrigin&&(e.crossOrigin="anonymous"),Uf(e)&&(e.selectable=!0,e.lockMovementX=!1,e.lockMovementY=!1,e.lockUniScaling=!1),{...e,data:e.data?{...e.data}:{}})),{canvas:n,editor:{frame:Yp().frame.active.config?{name:Yp().frame.active.config.name,sizePercent:Yp().frame.active.currentSizeInPercent}:null,zoom:qp().zoom,activeObjectId:(null==(t=qp().objects.active)?void 0:t.id)||null},canvasWidth:qp().original.width,canvasHeight:qp().original.height}}function eg(e=null){if(qp().dirty)return;Yp().zoom.fitToScreen();const[t,n]=tg(Xp().getActiveObject());e?qp().setActiveTool(e,t===e?n:null):qp().setActiveTool(t,n)}function tg(e){switch(null==e?void 0:e.name){case Vf.Text:return[Od.TEXT,Lf.Text];case Vf.Sticker:return[Od.STICKERS,Lf.ActiveObject];case Vf.Image:return[null,Lf.ActiveObject];case Vf.Shape:return[Od.SHAPES,Lf.ActiveObject];default:return[null,null]}}let ng=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&n[e]];return t};class rg{constructor(e,t){is(this,"timerId"),is(this,"createdAt",0),this.callback=e,this.remaining=t,this.resume()}pause(){clearTimeout(this.timerId),this.remaining-=Date.now()-this.createdAt}resume(){this.createdAt=Date.now(),this.timerId&&clearTimeout(this.timerId),this.timerId=setTimeout(this.callback,this.remaining)}clear(){clearTimeout(this.timerId)}}const ig=Mh()(Qf((e,t)=>({toasts:[],add:(n,r)=>{const i=t().toasts.length+1-1;i>0&&e(e=>{e.toasts.splice(0,i)});const o=(null==r?void 0:r.id)||ng(6),a=(null==r?void 0:r.type)||"positive",s=(null==r?void 0:r.duration)??function(e){switch(e){case"danger":return 8e3;case"loading":return 0;default:return 3e3}}(a),l={timer:s>0?new rg(()=>t().remove(o),s):null,message:n,...r,id:o,type:a,position:(null==r?void 0:r.position)||"bottom-center",duration:s,disableExitAnimation:null==r?void 0:r.disableExitAnimation,disableEnterAnimation:null==r?void 0:r.disableEnterAnimation},c=t().toasts.findIndex(e=>e.id===l.id);e(c>-1?e=>{e.toasts[c]=l}:e=>{e.toasts.push(l)})},remove:n=>{const r=t().toasts.filter(e=>{var t;return n!==e.id||(null==(t=e.timer)||t.clear(),!1)});e(e=>{e.toasts=r})}})));function og(){return ig.getState()}function ag(e,t){og().add(e,t)}ag.danger=(e,t)=>{og().add(e,{...t,type:"danger"})},ag.positive=(e,t)=>{og().add(e,{...t,type:"positive"})},ag.loading=(e,t)=>{og().add(e,{...t,type:"loading"})};const sg=(0,o.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),lg=(0,o.createContext)({}),cg=(0,o.createContext)(null),ug=typeof document<"u",dg=ug?o.useLayoutEffect:o.useEffect,hg=(0,o.createContext)({strict:!1}),fg=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),pg="data-"+fg("framerAppearId");function gg(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function mg(e){return"string"==typeof e||Array.isArray(e)}function vg(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}const yg=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],bg=["initial",...yg];function wg(e){return vg(e.animate)||bg.some(t=>mg(e[t]))}function xg(e){return!(!wg(e)&&!e.variants)}function Cg(e){return Array.isArray(e)?e.join(" "):e}const _g={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Sg={};for(const jM in _g)Sg[jM]={isEnabled:e=>_g[jM].some(t=>!!e[t])};function Ag(e){for(const t in e)Sg[t]={...Sg[t],...e[t]}}const kg=(0,o.createContext)({}),Eg=(0,o.createContext)({}),Ig=Symbol.for("motionComponentSymbol");function jg({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){e&&Ag(e);const a=(0,o.forwardRef)(function(a,s){let l;const c={...(0,o.useContext)(sg),...a,layoutId:Tg(a)},{isStatic:u}=c,d=function(e){const{initial:t,animate:n}=function(e,t){if(wg(e)){const{initial:t,animate:n}=e;return{initial:!1===t||mg(t)?t:void 0,animate:mg(n)?n:void 0}}return!1!==e.inherit?t:{}}(e,(0,o.useContext)(lg));return(0,o.useMemo)(()=>({initial:t,animate:n}),[Cg(t),Cg(n)])}(a),h=r(a,u);if(!u&&ug){d.visualElement=function(e,t,n,r){const{visualElement:i}=(0,o.useContext)(lg),a=(0,o.useContext)(hg),s=(0,o.useContext)(cg),l=(0,o.useContext)(sg).reducedMotion,c=(0,o.useRef)();r=r||a.renderer,!c.current&&r&&(c.current=r(e,{visualState:t,parent:i,props:n,presenceContext:s,blockInitialAnimation:!!s&&!1===s.initial,reducedMotionConfig:l}));const u=c.current;(0,o.useInsertionEffect)(()=>{u&&u.update(n,s)});const d=(0,o.useRef)(!(!n[pg]||window.HandoffComplete));return dg(()=>{u&&(u.render(),d.current&&u.animationState&&u.animationState.animateChanges())}),(0,o.useEffect)(()=>{u&&(u.updateFeatures(),!d.current&&u.animationState&&u.animationState.animateChanges(),d.current&&(d.current=!1,window.HandoffComplete=!0))}),u}(i,h,c,t);const n=(0,o.useContext)(Eg),r=(0,o.useContext)(hg).strict;d.visualElement&&(l=d.visualElement.loadFeatures(c,r,e,n))}return o.createElement(lg.Provider,{value:d},l&&d.visualElement?o.createElement(l,{visualElement:d.visualElement,...c}):null,n(i,a,function(e,t,n){return(0,o.useCallback)(r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&("function"==typeof n?n(r):gg(n)&&(n.current=r))},[t])}(h,d.visualElement,s),h,u,d.visualElement))});return a[Ig]=i,a}function Tg({layoutId:e}){const t=(0,o.useContext)(kg).id;return t&&void 0!==e?t+"-"+e:e}const Fg=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Og(e){return"string"==typeof e&&!e.includes("-")&&!!(Fg.indexOf(e)>-1||/[A-Z]/.test(e))}const Mg={},Pg=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Rg=new Set(Pg);function Lg(e,{layout:t,layoutId:n}){return Rg.has(e)||e.startsWith("origin")||(t||void 0!==n)&&(!!Mg[e]||"opacity"===e)}const Ng=e=>!(!e||!e.getVelocity),Dg={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},zg=Pg.length,Bg=e=>t=>"string"==typeof t&&t.startsWith(e),Ug=Bg("--"),Vg=Bg("var(--"),Hg=(e,t)=>t&&"number"==typeof e?t.transform(e):e,Wg=(e,t,n)=>Math.min(Math.max(n,e),t),$g={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},Gg={...$g,transform:e=>Wg(0,1,e)},qg={...$g,default:1},Yg=e=>Math.round(1e5*e)/1e5,Xg=/(-)?([\d]*\.?[\d])+/g,Kg=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,Zg=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function Jg(e){return"string"==typeof e}const Qg=e=>({test:t=>Jg(t)&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),em=Qg("deg"),tm=Qg("%"),nm=Qg("px"),rm=Qg("vh"),im=Qg("vw"),om={...tm,parse:e=>tm.parse(e)/100,transform:e=>tm.transform(100*e)},am={...$g,transform:Math.round},sm={borderWidth:nm,borderTopWidth:nm,borderRightWidth:nm,borderBottomWidth:nm,borderLeftWidth:nm,borderRadius:nm,radius:nm,borderTopLeftRadius:nm,borderTopRightRadius:nm,borderBottomRightRadius:nm,borderBottomLeftRadius:nm,width:nm,maxWidth:nm,height:nm,maxHeight:nm,size:nm,top:nm,right:nm,bottom:nm,left:nm,padding:nm,paddingTop:nm,paddingRight:nm,paddingBottom:nm,paddingLeft:nm,margin:nm,marginTop:nm,marginRight:nm,marginBottom:nm,marginLeft:nm,rotate:em,rotateX:em,rotateY:em,rotateZ:em,scale:qg,scaleX:qg,scaleY:qg,scaleZ:qg,skew:em,skewX:em,skewY:em,distance:nm,translateX:nm,translateY:nm,translateZ:nm,x:nm,y:nm,z:nm,perspective:nm,transformPerspective:nm,opacity:Gg,originX:om,originY:om,originZ:nm,zIndex:am,fillOpacity:Gg,strokeOpacity:Gg,numOctaves:am};function lm(e,t,n,r){const{style:i,vars:o,transform:a,transformOrigin:s}=e;let l=!1,c=!1,u=!0;for(const d in t){const e=t[d];if(Ug(d)){o[d]=e;continue}const n=sm[d],r=Hg(e,n);if(Rg.has(d)){if(l=!0,a[d]=r,!u)continue;e!==(n.default||0)&&(u=!1)}else d.startsWith("origin")?(c=!0,s[d]=r):i[d]=r}if(t.transform||(l||r?i.transform=function(e,{enableHardwareAcceleration:t=!0,allowTransformNone:n=!0},r,i){let o="";for(let a=0;a<zg;a++){const t=Pg[a];void 0!==e[t]&&(o+=`${Dg[t]||t}(${e[t]}) `)}return t&&!e.z&&(o+="translateZ(0)"),o=o.trim(),i?o=i(e,r?"":o):n&&r&&(o="none"),o}(e.transform,n,u,r):i.transform&&(i.transform="none")),c){const{originX:e="50%",originY:t="50%",originZ:n=0}=s;i.transformOrigin=`${e} ${t} ${n}`}}function cm(e,t,n){for(const r in t)!Ng(t[r])&&!Lg(r,n)&&(e[r]=t[r])}function um(e,t,n){const r={},i=function(e,t,n){const r={};return cm(r,e.style||{},e),Object.assign(r,function({transformTemplate:e},t,n){return(0,o.useMemo)(()=>{const r={style:{},transform:{},transformOrigin:{},vars:{}};return lm(r,t,{enableHardwareAcceleration:!n},e),Object.assign({},r.vars,r.style)},[t])}(e,t,n)),e.transformValues?e.transformValues(r):r}(e,t,n);return e.drag&&!1!==e.dragListener&&(r.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===e.drag?"none":"pan-"+("x"===e.drag?"y":"x")),void 0===e.tabIndex&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=i,r}const dm=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function hm(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||dm.has(e)}let fm=e=>!hm(e);try{!function(e){e&&(fm=t=>t.startsWith("on")?!hm(t):e(t))}(n(36118).A)}catch{}function pm(e,t,n){const r={};for(const i in e)"values"===i&&"object"==typeof e.values||(fm(i)||!0===n&&hm(i)||!t&&!hm(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function gm(e,t,n){return"string"==typeof e?e:nm.transform(t+n*e)}const mm={offset:"stroke-dashoffset",array:"stroke-dasharray"},vm={offset:"strokeDashoffset",array:"strokeDasharray"};function ym(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:o,pathLength:a,pathSpacing:s=1,pathOffset:l=0,...c},u,d,h){if(lm(e,c,u,h),d)return void(e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox));e.attrs=e.style,e.style={};const{attrs:f,style:p,dimensions:g}=e;f.transform&&(g&&(p.transform=f.transform),delete f.transform),g&&(void 0!==i||void 0!==o||p.transform)&&(p.transformOrigin=function(e,t,n){return`${gm(t,e.x,e.width)} ${gm(n,e.y,e.height)}`}(g,void 0!==i?i:.5,void 0!==o?o:.5)),void 0!==t&&(f.x=t),void 0!==n&&(f.y=n),void 0!==r&&(f.scale=r),void 0!==a&&function(e,t,n=1,r=0,i=!0){e.pathLength=1;const o=i?mm:vm;e[o.offset]=nm.transform(-r);const a=nm.transform(t),s=nm.transform(n);e[o.array]=`${a} ${s}`}(f,a,s,l,!1)}const bm=e=>"string"==typeof e&&"svg"===e.toLowerCase();function wm(e,t,n,r){const i=(0,o.useMemo)(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return ym(n,t,{enableHardwareAcceleration:!1},bm(r),e.transformTemplate),{...n.attrs,style:{...n.style}}},[t]);if(e.style){const t={};cm(t,e.style,e),i.style={...t,...i.style}}return i}function xm(e=!1){return(t,n,r,{latestValues:i},a)=>{const s=(Og(t)?wm:um)(n,i,a,t),l={...pm(n,"string"==typeof t,e),...s,ref:r},{children:c}=n,u=(0,o.useMemo)(()=>Ng(c)?c.get():c,[c]);return(0,o.createElement)(t,{...l,children:u})}}function Cm(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const o in n)e.style.setProperty(o,n[o])}const _m=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Sm(e,t,n,r){Cm(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(_m.has(i)?i:fg(i),t.attrs[i])}function Am(e,t){const{style:n}=e,r={};for(const i in n)(Ng(n[i])||t.style&&Ng(t.style[i])||Lg(i,e))&&(r[i]=n[i]);return r}function km(e,t){const n=Am(e,t);for(const r in e)(Ng(e[r])||Ng(t[r]))&&(n[-1!==Pg.indexOf(r)?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r]=e[r]);return n}function Em(e,t,n,r={},i={}){return"function"==typeof t&&(t=t(void 0!==n?n:e.custom,r,i)),"string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t&&(t=t(void 0!==n?n:e.custom,r,i)),t}function Im(e){const t=(0,o.useRef)(null);return null===t.current&&(t.current=e()),t.current}const jm=e=>Array.isArray(e),Tm=e=>jm(e)?e[e.length-1]||0:e;function Fm(e){const t=Ng(e)?e.get():e;return(e=>!!(e&&"object"==typeof e&&e.mix&&e.toValue))(t)?t.toValue():t}const Om=e=>(t,n)=>{const r=(0,o.useContext)(lg),i=(0,o.useContext)(cg),a=()=>function({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},r,i,o){const a={latestValues:Mm(r,i,o,e),renderState:t()};return n&&(a.mount=e=>n(r,e,a)),a}(e,t,r,i);return n?a():Im(a)};function Mm(e,t,n,r){const i={},o=r(e,{});for(const h in o)i[h]=Fm(o[h]);let{initial:a,animate:s}=e;const l=wg(e),c=xg(e);t&&c&&!l&&!1!==e.inherit&&(void 0===a&&(a=t.initial),void 0===s&&(s=t.animate));let u=!!n&&!1===n.initial;u=u||!1===a;const d=u?s:a;return d&&"boolean"!=typeof d&&!vg(d)&&(Array.isArray(d)?d:[d]).forEach(t=>{const n=Em(e,t);if(!n)return;const{transitionEnd:r,transition:o,...a}=n;for(const e in a){let t=a[e];Array.isArray(t)&&(t=t[u?t.length-1:0]),null!==t&&(i[e]=t)}for(const e in r)i[e]=r[e]}),i}const Pm=e=>e;class Rm{constructor(){this.order=[],this.scheduled=new Set}add(e){if(!this.scheduled.has(e))return this.scheduled.add(e),this.order.push(e),!0}remove(e){const t=this.order.indexOf(e);-1!==t&&(this.order.splice(t,1),this.scheduled.delete(e))}clear(){this.order.length=0,this.scheduled.clear()}}const Lm=["prepare","read","update","preRender","render","postRender"],{schedule:Nm,cancel:Dm,state:zm}=function(e){let t=!1,n=!0;const r={delta:0,timestamp:0,isProcessing:!1},i=Lm.reduce((e,n)=>(e[n]=function(e){let t=new Rm,n=new Rm,r=0,i=!1,o=!1;const a=new WeakSet,s={schedule:(e,o=!1,s=!1)=>{const l=s&&i,c=l?t:n;return o&&a.add(e),c.add(e)&&l&&i&&(r=t.order.length),e},cancel:e=>{n.remove(e),a.delete(e)},process:l=>{if(i)o=!0;else{if(i=!0,[t,n]=[n,t],n.clear(),r=t.order.length,r)for(let n=0;n<r;n++){const r=t.order[n];r(l),a.has(r)&&(s.schedule(r),e())}i=!1,o&&(o=!1,s.process(l))}}};return s}(()=>t=!0),e),{}),o=e=>i[e].process(r),a=()=>{const i=performance.now();t=!1,r.delta=n?1e3/60:Math.max(Math.min(i-r.timestamp,40),1),r.timestamp=i,r.isProcessing=!0,Lm.forEach(o),r.isProcessing=!1,t&&(n=!1,e(a))};return{schedule:Lm.reduce((o,s)=>{const l=i[s];return o[s]=(i,o=!1,s=!1)=>(t||(t=!0,n=!0,r.isProcessing||e(a)),l.schedule(i,o,s)),o},{}),cancel:e=>Lm.forEach(t=>i[t].cancel(e)),state:r,steps:i}}(typeof requestAnimationFrame<"u"?requestAnimationFrame:Pm),Bm={useVisualState:Om({scrapeMotionValuesFromProps:km,createRenderState:()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}}),onMount:(e,t,{renderState:n,latestValues:r})=>{Nm.read(()=>{try{n.dimensions="function"==typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}}),Nm.render(()=>{ym(n,r,{enableHardwareAcceleration:!1},bm(t.tagName),e.transformTemplate),Sm(t,n)})}})},Um={useVisualState:Om({scrapeMotionValuesFromProps:Am,createRenderState:()=>({style:{},transform:{},transformOrigin:{},vars:{}})})};function Vm(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Hm(e,t="page"){return{point:{x:e[t+"X"],y:e[t+"Y"]}}}function Wm(e,t,n,r){return Vm(e,t,(e=>t=>(e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary)(t)&&e(t,Hm(t)))(n),r)}const $m=(e,t)=>n=>t(e(n)),Gm=(...e)=>e.reduce($m);function qm(e){let t=null;return()=>null===t&&(t=e,()=>{t=null})}const Ym=qm("dragHorizontal"),Xm=qm("dragVertical");function Km(){const e=function(){let e=!1;{const t=Ym(),n=Xm();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}();return!e||(e(),!1)}class Zm{constructor(e){this.isMounted=!1,this.node=e}update(){}}function Jm(e,t){const n="pointer"+(t?"enter":"leave"),r="onHover"+(t?"Start":"End");return Wm(e.current,n,(n,i)=>{if("touch"===n.pointerType||Km())return;const o=e.getProps();e.animationState&&o.whileHover&&e.animationState.setActive("whileHover",t),o[r]&&Nm.update(()=>o[r](n,i))},{passive:!e.getProps()[r]})}const Qm=(e,t)=>!!t&&(e===t||Qm(e,t.parentElement));function ev(e,t){if(!t)return;const n=new PointerEvent("pointer"+e);t(n,Hm(n))}const tv=new WeakMap,nv=new WeakMap,rv=e=>{const t=tv.get(e.target);t&&t(e)},iv=e=>{e.forEach(rv)};const ov={some:0,all:1},av={inView:{Feature:class extends Zm{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r="some",once:i}=e,o={root:t?t.current:void 0,rootMargin:n,threshold:"number"==typeof r?r:ov[r]};return function(e,t,n){const r=function({root:e,...t}){const n=e||document;nv.has(n)||nv.set(n,{});const r=nv.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(iv,{root:e,...t})),r[i]}(t);return tv.set(e,n),r.observe(e),()=>{tv.delete(e),r.unobserve(e)}}(this.node.current,o,e=>{const{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);const{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),o=t?n:r;o&&o(e)})}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:t}=this.node;["amount","margin","root"].some(function({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}(e,t))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends Zm{constructor(){super(...arguments),this.removeStartListeners=Pm,this.removeEndListeners=Pm,this.removeAccessibleListeners=Pm,this.startPointerPress=(e,t)=>{if(this.isPressing)return;this.removeEndListeners();const n=this.node.getProps(),r=Wm(window,"pointerup",(e,t)=>{if(!this.checkPressEnd())return;const{onTap:n,onTapCancel:r,globalTapTarget:i}=this.node.getProps();Nm.update(()=>{i||Qm(this.node.current,e.target)?n&&n(e,t):r&&r(e,t)})},{passive:!(n.onTap||n.onPointerUp)}),i=Wm(window,"pointercancel",(e,t)=>this.cancelPress(e,t),{passive:!(n.onTapCancel||n.onPointerCancel)});this.removeEndListeners=Gm(r,i),this.startPress(e,t)},this.startAccessiblePress=()=>{const e=Vm(this.node.current,"keydown",e=>{"Enter"!==e.key||this.isPressing||(this.removeEndListeners(),this.removeEndListeners=Vm(this.node.current,"keyup",e=>{"Enter"!==e.key||!this.checkPressEnd()||ev("up",(e,t)=>{const{onTap:n}=this.node.getProps();n&&Nm.update(()=>n(e,t))})}),ev("down",(e,t)=>{this.startPress(e,t)}))}),t=Vm(this.node.current,"blur",()=>{this.isPressing&&ev("cancel",(e,t)=>this.cancelPress(e,t))});this.removeAccessibleListeners=Gm(e,t)}}startPress(e,t){this.isPressing=!0;const{onTapStart:n,whileTap:r}=this.node.getProps();r&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),n&&Nm.update(()=>n(e,t))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!Km()}cancelPress(e,t){if(!this.checkPressEnd())return;const{onTapCancel:n}=this.node.getProps();n&&Nm.update(()=>n(e,t))}mount(){const e=this.node.getProps(),t=Wm(e.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(e.onTapStart||e.onPointerStart)}),n=Vm(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=Gm(t,n)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}},focus:{Feature:class extends Zm{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Gm(Vm(this.node.current,"focus",()=>this.onFocus()),Vm(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends Zm{mount(){this.unmount=Gm(Jm(this.node,!0),Jm(this.node,!1))}unmount(){}}}};function sv(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}function lv(e,t,n){const r=e.getProps();return Em(r,t,void 0!==n?n:r.custom,function(e){const t={};return e.values.forEach((e,n)=>t[n]=e.get()),t}(e),function(e){const t={};return e.values.forEach((e,n)=>t[n]=e.getVelocity()),t}(e))}let cv=Pm;const uv=e=>1e3*e,dv=e=>e/1e3,hv=e=>Array.isArray(e)&&"number"==typeof e[0];function fv(e){return!!(!e||"string"==typeof e&&gv[e]||hv(e)||Array.isArray(e)&&e.every(fv))}const pv=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,gv={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:pv([0,.65,.55,1]),circOut:pv([.55,0,1,.45]),backIn:pv([.31,.01,.66,-.59]),backOut:pv([.33,1.53,.69,.99])};function mv(e){if(e)return hv(e)?pv(e):Array.isArray(e)?e.map(mv):gv[e]}const vv=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function yv(e,t,n,r){if(e===t&&n===r)return Pm;const i=t=>function(e,t,n,r,i){let o,a,s=0;do{a=t+(n-t)/2,o=vv(a,r,i)-e,o>0?n=a:t=a}while(Math.abs(o)>1e-7&&++s<12);return a}(t,0,1,e,n);return e=>0===e||1===e?e:vv(i(e),t,r)}const bv=yv(.42,0,1,1),wv=yv(0,0,.58,1),xv=yv(.42,0,.58,1),Cv=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,_v=e=>t=>1-e(1-t),Sv=e=>1-Math.sin(Math.acos(e)),Av=_v(Sv),kv=Cv(Sv),Ev=yv(.33,1.53,.69,.99),Iv=_v(Ev),jv=Cv(Iv),Tv={linear:Pm,easeIn:bv,easeInOut:xv,easeOut:wv,circIn:Sv,circInOut:kv,circOut:Av,backIn:Iv,backInOut:jv,backOut:Ev,anticipate:e=>(e*=2)<1?.5*Iv(e):.5*(2-Math.pow(2,-10*(e-1)))},Fv=e=>{if(Array.isArray(e)){cv(4===e.length);const[t,n,r,i]=e;return yv(t,n,r,i)}return"string"==typeof e?Tv[e]:e},Ov=(e,t)=>n=>!!(Jg(n)&&Zg.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),Mv=(e,t,n)=>r=>{if(!Jg(r))return r;const[i,o,a,s]=r.match(Xg);return{[e]:parseFloat(i),[t]:parseFloat(o),[n]:parseFloat(a),alpha:void 0!==s?parseFloat(s):1}},Pv={...$g,transform:e=>Math.round((e=>Wg(0,255,e))(e))},Rv={test:Ov("rgb","red"),parse:Mv("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Pv.transform(e)+", "+Pv.transform(t)+", "+Pv.transform(n)+", "+Yg(Gg.transform(r))+")"},Lv={test:Ov("#"),parse:function(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}},transform:Rv.transform},Nv={test:Ov("hsl","hue"),parse:Mv("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+tm.transform(Yg(t))+", "+tm.transform(Yg(n))+", "+Yg(Gg.transform(r))+")"},Dv={test:e=>Rv.test(e)||Lv.test(e)||Nv.test(e),parse:e=>Rv.test(e)?Rv.parse(e):Nv.test(e)?Nv.parse(e):Lv.parse(e),transform:e=>Jg(e)?e:e.hasOwnProperty("red")?Rv.transform(e):Nv.transform(e)},zv=(e,t,n)=>-n*e+n*t+e;function Bv(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}const Uv=(e,t,n)=>{const r=e*e;return Math.sqrt(Math.max(0,n*(t*t-r)+r))},Vv=[Lv,Rv,Nv];function Hv(e){const t=(e=>Vv.find(t=>t.test(e)))(e);let n=t.parse(e);return t===Nv&&(n=function({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,n/=100;let i=0,o=0,a=0;if(t/=100){const r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=Bv(s,r,e+1/3),o=Bv(s,r,e),a=Bv(s,r,e-1/3)}else i=o=a=n;return{red:Math.round(255*i),green:Math.round(255*o),blue:Math.round(255*a),alpha:r}}(n)),n}const Wv=(e,t)=>{const n=Hv(e),r=Hv(t),i={...n};return e=>(i.red=Uv(n.red,r.red,e),i.green=Uv(n.green,r.green,e),i.blue=Uv(n.blue,r.blue,e),i.alpha=zv(n.alpha,r.alpha,e),Rv.transform(i))},$v={regex:/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g,countKey:"Vars",token:"${v}",parse:Pm},Gv={regex:Kg,countKey:"Colors",token:"${c}",parse:Dv.parse},qv={regex:Xg,countKey:"Numbers",token:"${n}",parse:$g.parse};function Yv(e,{regex:t,countKey:n,token:r,parse:i}){const o=e.tokenised.match(t);o&&(e["num"+n]=o.length,e.tokenised=e.tokenised.replace(t,r),e.values.push(...o.map(i)))}function Xv(e){const t=e.toString(),n={value:t,tokenised:t,values:[],numVars:0,numColors:0,numNumbers:0};return n.value.includes("var(--")&&Yv(n,$v),Yv(n,Gv),Yv(n,qv),n}function Kv(e){return Xv(e).values}function Zv(e){const{values:t,numColors:n,numVars:r,tokenised:i}=Xv(e),o=t.length;return e=>{let t=i;for(let i=0;i<o;i++)t=i<r?t.replace($v.token,e[i]):i<r+n?t.replace(Gv.token,Dv.transform(e[i])):t.replace(qv.token,Yg(e[i]));return t}}const Jv=e=>"number"==typeof e?0:e,Qv={test:function(e){var t,n;return isNaN(e)&&Jg(e)&&((null===(t=e.match(Xg))||void 0===t?void 0:t.length)||0)+((null===(n=e.match(Kg))||void 0===n?void 0:n.length)||0)>0},parse:Kv,createTransformer:Zv,getAnimatableNone:function(e){const t=Kv(e);return Zv(e)(t.map(Jv))}},ey=(e,t)=>n=>`${n>0?t:e}`;function ty(e,t){return"number"==typeof e?n=>zv(e,t,n):Dv.test(e)?Wv(e,t):e.startsWith("var(")?ey(e,t):iy(e,t)}const ny=(e,t)=>{const n=[...e],r=n.length,i=e.map((e,n)=>ty(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}},ry=(e,t)=>{const n={...e,...t},r={};for(const i in n)void 0!==e[i]&&void 0!==t[i]&&(r[i]=ty(e[i],t[i]));return e=>{for(const t in r)n[t]=r[t](e);return n}},iy=(e,t)=>{const n=Qv.createTransformer(t),r=Xv(e),i=Xv(t);return r.numVars===i.numVars&&r.numColors===i.numColors&&r.numNumbers>=i.numNumbers?Gm(ny(r.values,i.values),n):ey(e,t)},oy=(e,t,n)=>{const r=t-e;return 0===r?1:(n-e)/r},ay=(e,t)=>n=>zv(e,t,n);function sy(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const o=e.length;if(cv(o===t.length),1===o)return()=>t[0];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=function(e,t,n){const r=[],i=n||function(e){return"number"==typeof e?ay:"string"==typeof e?Dv.test(e)?Wv:iy:Array.isArray(e)?ny:"object"==typeof e?ry:ay}(e[0]),o=e.length-1;for(let a=0;a<o;a++){let n=i(e[a],e[a+1]);if(t){const e=Array.isArray(t)?t[a]||Pm:t;n=Gm(e,n)}r.push(n)}return r}(t,r,i),s=a.length,l=t=>{let n=0;if(s>1)for(;n<e.length-2&&!(t<e[n+1]);n++);const r=oy(e[n],e[n+1],t);return a[n](r)};return n?t=>l(Wg(e[0],e[o-1],t)):l}function ly(e,t){return e.map(()=>t||xv).splice(0,e.length-1)}function cy({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=(e=>Array.isArray(e)&&"number"!=typeof e[0])(r)?r.map(Fv):Fv(r),o={done:!1,value:t[0]},a=function(e,t){return e.map(e=>e*t)}(n&&n.length===t.length?n:function(e){const t=[0];return function(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=oy(0,t,r);e.push(zv(n,1,i))}}(t,e.length-1),t}(t),e),s=sy(a,t,{ease:Array.isArray(i)?i:ly(t,i)});return{calculatedDuration:e,next:t=>(o.value=s(t),o.done=t>=e,o)}}function uy(e,t){return t?e*(1e3/t):0}function dy(e,t,n){const r=Math.max(t-5,0);return uy(n-e(r),t-r)}const hy=.001;const fy=12;function py(e,t){return e*Math.sqrt(1-t*t)}const gy=["duration","bounce"],my=["stiffness","damping","mass"];function vy(e,t){return t.some(t=>void 0!==e[t])}function yy({keyframes:e,restDelta:t,restSpeed:n,...r}){const i=e[0],o=e[e.length-1],a={done:!1,value:i},{stiffness:s,damping:l,mass:c,duration:u,velocity:d,isResolvedFromDuration:h}=function(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!vy(e,my)&&vy(e,gy)){const n=function({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let i,o,a=1-t;a=Wg(.05,1,a),e=Wg(.01,10,dv(e)),a<1?(i=t=>{const r=t*a,i=r*e,o=r-n,s=py(t,a),l=Math.exp(-i);return hy-o/s*l},o=t=>{const r=t*a*e,o=r*n+n,s=Math.pow(a,2)*Math.pow(t,2)*e,l=Math.exp(-r),c=py(Math.pow(t,2),a);return(-i(t)+hy>0?-1:1)*((o-s)*l)/c}):(i=t=>Math.exp(-t*e)*((t-n)*e+1)-hy,o=t=>Math.exp(-t*e)*(e*e*(n-t)));const s=function(e,t,n){let r=n;for(let i=1;i<fy;i++)r-=e(r)/t(r);return r}(i,o,5/e);if(e=uv(e),isNaN(s))return{stiffness:100,damping:10,duration:e};{const t=Math.pow(s,2)*r;return{stiffness:t,damping:2*a*Math.sqrt(r*t),duration:e}}}(e);t={...t,...n,mass:1},t.isResolvedFromDuration=!0}return t}({...r,velocity:-dv(r.velocity||0)}),f=d||0,p=l/(2*Math.sqrt(s*c)),g=o-i,m=dv(Math.sqrt(s/c)),v=Math.abs(g)<5;let y;if(n||(n=v?.01:2),t||(t=v?.005:.5),p<1){const e=py(m,p);y=t=>{const n=Math.exp(-p*m*t);return o-n*((f+p*m*g)/e*Math.sin(e*t)+g*Math.cos(e*t))}}else if(1===p)y=e=>o-Math.exp(-m*e)*(g+(f+m*g)*e);else{const e=m*Math.sqrt(p*p-1);y=t=>{const n=Math.exp(-p*m*t),r=Math.min(e*t,300);return o-n*((f+p*m*g)*Math.sinh(r)+e*g*Math.cosh(r))/e}}return{calculatedDuration:h&&u||null,next:e=>{const r=y(e);if(h)a.done=e>=u;else{let i=f;0!==e&&(i=p<1?dy(y,e,r):0);const s=Math.abs(i)<=n,l=Math.abs(o-r)<=t;a.done=s&&l}return a.value=a.done?o:r,a}}}function by({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:a,min:s,max:l,restDelta:c=.5,restSpeed:u}){const d=e[0],h={done:!1,value:d},f=e=>void 0===s?l:void 0===l||Math.abs(s-e)<Math.abs(l-e)?s:l;let p=n*t;const g=d+p,m=void 0===a?g:a(g);m!==g&&(p=m-d);const v=e=>-p*Math.exp(-e/r),y=e=>m+v(e),b=e=>{const t=v(e),n=y(e);h.done=Math.abs(t)<=c,h.value=h.done?m:n};let w,x;const C=e=>{(e=>void 0!==s&&e<s||void 0!==l&&e>l)(h.value)&&(w=e,x=yy({keyframes:[h.value,f(h.value)],velocity:dy(y,e,h.value),damping:i,stiffness:o,restDelta:c,restSpeed:u}))};return C(0),{calculatedDuration:null,next:e=>{let t=!1;return!x&&void 0===w&&(t=!0,b(e),C(e)),void 0!==w&&e>w?x.next(e-w):(!t&&b(e),h)}}}const wy=e=>{const t=({timestamp:t})=>e(t);return{start:()=>Nm.update(t,!0),stop:()=>Dm(t),now:()=>zm.isProcessing?zm.timestamp:performance.now()}};function xy(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}const Cy={decay:by,inertia:by,tween:cy,keyframes:cy,spring:yy};function _y({autoplay:e=!0,delay:t=0,driver:n=wy,keyframes:r,type:i="keyframes",repeat:o=0,repeatDelay:a=0,repeatType:s="loop",onPlay:l,onStop:c,onComplete:u,onUpdate:d,...h}){let f,p,g=1,m=!1;const v=()=>{p=new Promise(e=>{f=e})};let y;v();const b=Cy[i]||cy;let w;b!==cy&&"number"!=typeof r[0]&&(w=sy([0,100],r,{clamp:!1}),r=[0,100]);const x=b({...h,keyframes:r});let C;"mirror"===s&&(C=b({...h,keyframes:[...r].reverse(),velocity:-(h.velocity||0)}));let _="idle",S=null,A=null,k=null;null===x.calculatedDuration&&o&&(x.calculatedDuration=xy(x));const{calculatedDuration:E}=x;let I=1/0,j=1/0;null!==E&&(I=E+a,j=I*(o+1)-a);let T=0;const F=e=>{if(null===A)return;g>0&&(A=Math.min(A,e)),g<0&&(A=Math.min(e-j/g,A)),T=null!==S?S:Math.round(e-A)*g;const n=T-t*(g>=0?1:-1),i=g>=0?n<0:n>j;T=Math.max(n,0),"finished"===_&&null===S&&(T=j);let l=T,c=x;if(o){const e=Math.min(T,j)/I;let t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),1===n&&t--,t=Math.min(t,o+1),!!(t%2)&&("reverse"===s?(n=1-n,a&&(n-=a/I)):"mirror"===s&&(c=C)),l=Wg(0,1,n)*I}const u=i?{done:!1,value:r[0]}:c.next(l);w&&(u.value=w(u.value));let{done:h}=u;!i&&null!==E&&(h=g>=0?T>=j:T<=0);const f=null===S&&("finished"===_||"running"===_&&h);return d&&d(u.value),f&&P(),u},O=()=>{y&&y.stop(),y=void 0},M=()=>{_="idle",O(),f(),v(),A=k=null},P=()=>{_="finished",u&&u(),O(),f()},R=()=>{if(m)return;y||(y=n(F));const e=y.now();l&&l(),null!==S?A=e-S:(!A||"finished"===_)&&(A=e),"finished"===_&&v(),k=A,S=null,_="running",y.start()};e&&R();const L={then:(e,t)=>p.then(e,t),get time(){return dv(T)},set time(e){e=uv(e),T=e,null===S&&y&&0!==g?A=y.now()-e/g:S=e},get duration(){const e=null===x.calculatedDuration?xy(x):x.calculatedDuration;return dv(e)},get speed(){return g},set speed(e){e===g||!y||(g=e,L.time=dv(T))},get state(){return _},play:R,pause:()=>{_="paused",S=T},stop:()=>{m=!0,"idle"!==_&&(_="idle",c&&c(),M())},cancel:()=>{null!==k&&F(k),M()},complete:()=>{_="finished"},sample:e=>(A=0,F(e))};return L}const Sy=function(){let e;return()=>(void 0===e&&(e=Object.hasOwnProperty.call(Element.prototype,"animate")),e)}(),Ay=new Set(["opacity","clipPath","filter","transform","backgroundColor"]);const ky={type:"spring",stiffness:500,damping:25,restSpeed:10},Ey={type:"keyframes",duration:.8},Iy={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},jy=(e,{keyframes:t})=>t.length>2?Ey:Rg.has(e)?e.startsWith("scale")?(e=>({type:"spring",stiffness:550,damping:0===e?2*Math.sqrt(550):30,restSpeed:10}))(t[1]):ky:Iy,Ty=(e,t)=>"zIndex"!==e&&!("number"!=typeof t&&!Array.isArray(t)&&("string"!=typeof t||!Qv.test(t)&&"0"!==t||t.startsWith("url("))),Fy=new Set(["brightness","contrast","saturate","opacity"]);function Oy(e){const[t,n]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;const[r]=n.match(Xg)||[];if(!r)return e;const i=n.replace(r,"");let o=Fy.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+i+")"}const My=/([a-z-]*)\(.*?\)/g,Py={...Qv,getAnimatableNone:e=>{const t=e.match(My);return t?t.map(Oy).join(" "):e}},Ry={...sm,color:Dv,backgroundColor:Dv,outlineColor:Dv,fill:Dv,stroke:Dv,borderColor:Dv,borderTopColor:Dv,borderRightColor:Dv,borderBottomColor:Dv,borderLeftColor:Dv,filter:Py,WebkitFilter:Py},Ly=e=>Ry[e];function Ny(e,t){let n=Ly(e);return n!==Py&&(n=Qv),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Dy=e=>/^0[^.\s]+$/.test(e);function zy(e){return"number"==typeof e?0===e:null!==e?"none"===e||"0"===e||Dy(e):void 0}function By(e,t){return e[t]||e.default||e}const Uy=(e,t,n,r={})=>i=>{const o=By(r,e)||{},a=o.delay||r.delay||0;let{elapsed:s=0}=r;s-=uv(a);const l=function(e,t,n,r){const i=Ty(t,n);let o;o=Array.isArray(n)?[...n]:[null,n];const a=void 0!==r.from?r.from:e.get();let s;const l=[];for(let c=0;c<o.length;c++)null===o[c]&&(o[c]=0===c?a:o[c-1]),zy(o[c])&&l.push(c),"string"==typeof o[c]&&"none"!==o[c]&&"0"!==o[c]&&(s=o[c]);if(i&&l.length&&s)for(let c=0;c<l.length;c++)o[l[c]]=Ny(t,s);return o}(t,e,n,o),c=l[0],u=l[l.length-1],d=Ty(e,c),h=Ty(e,u);let f={keyframes:l,velocity:t.getVelocity(),ease:"easeOut",...o,delay:-s,onUpdate:e=>{t.set(e),o.onUpdate&&o.onUpdate(e)},onComplete:()=>{i(),o.onComplete&&o.onComplete()}};if(function({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:o,repeatType:a,repeatDelay:s,from:l,elapsed:c,...u}){return!!Object.keys(u).length}(o)||(f={...f,...jy(e,f)}),f.duration&&(f.duration=uv(f.duration)),f.repeatDelay&&(f.repeatDelay=uv(f.repeatDelay)),!d||!h||!1===o.type)return function({keyframes:e,delay:t,onUpdate:n,onComplete:r}){const i=()=>(n&&n(e[e.length-1]),r&&r(),{time:0,speed:1,duration:0,play:Pm,pause:Pm,stop:Pm,then:e=>(e(),Promise.resolve()),cancel:Pm,complete:Pm});return t?_y({keyframes:[0,1],duration:0,delay:t,onComplete:i}):i()}(f);if(!r.isHandoff&&t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate){const n=function(e,t,{onUpdate:n,onComplete:r,...i}){if(!Sy()||!Ay.has(t)||i.repeatDelay||"mirror"===i.repeatType||0===i.damping||"inertia"===i.type)return!1;let o,a,s=!1,l=!1;const c=()=>{a=new Promise(e=>{o=e})};c();let{keyframes:u,duration:d=300,ease:h,times:f}=i;if(((e,t)=>"spring"===t.type||"backgroundColor"===e||!fv(t.ease))(t,i)){const e=_y({...i,repeat:0,delay:0});let t={done:!1,value:u[0]};const n=[];let r=0;for(;!t.done&&r<2e4;)t=e.sample(r),n.push(t.value),r+=10;f=void 0,u=n,d=r-10,h="linear"}const p=function(e,t,n,{delay:r=0,duration:i,repeat:o=0,repeatType:a="loop",ease:s,times:l}={}){const c={[t]:n};l&&(c.offset=l);const u=mv(s);return Array.isArray(u)&&(c.easing=u),e.animate(c,{delay:r,duration:i,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:o+1,direction:"reverse"===a?"alternate":"normal"})}(e.owner.current,t,u,{...i,duration:d,ease:h,times:f}),g=()=>{l=!1,p.cancel()},m=()=>{l=!0,Nm.update(g),o(),c()};return p.onfinish=()=>{l||(e.set(function(e,{repeat:t,repeatType:n="loop"}){return e[t&&"loop"!==n&&t%2==1?0:e.length-1]}(u,i)),r&&r(),m())},{then:(e,t)=>a.then(e,t),attachTimeline:e=>(p.timeline=e,p.onfinish=null,Pm),get time(){return dv(p.currentTime||0)},set time(e){p.currentTime=uv(e)},get speed(){return p.playbackRate},set speed(e){p.playbackRate=e},get duration(){return dv(d)},play:()=>{s||(p.play(),Dm(g))},pause:()=>p.pause(),stop:()=>{if(s=!0,"idle"===p.playState)return;const{currentTime:t}=p;if(t){const n=_y({...i,autoplay:!1});e.setWithVelocity(n.sample(t-10).value,n.sample(t).value,10)}m()},complete:()=>{l||p.finish()},cancel:m}}(t,e,f);if(n)return n}return _y(f)};function Vy(e){return!(!Ng(e)||!e.add)}const Hy=e=>/^\-?\d*\.?\d+$/.test(e);class Wy{constructor(){this.subscriptions=[]}add(e){return function(e,t){-1===e.indexOf(t)&&e.push(t)}(this.subscriptions,e),()=>function(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}(this.subscriptions,e)}notify(e,t,n){const r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){const r=this.subscriptions[i];r&&r(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}class $y{constructor(e,t={}){this.version="10.18.0",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(e,t=!0)=>{this.prev=this.current,this.current=e;const{delta:n,timestamp:r}=zm;this.lastUpdated!==r&&(this.timeDelta=n,this.lastUpdated=r,Nm.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),t&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>Nm.postRender(this.velocityCheck),this.velocityCheck=({timestamp:e})=>{e!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=e,this.canTrackVelocity=(e=>!isNaN(parseFloat(e)))(this.current),this.owner=t.owner}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new Wy);const n=this.events[e].add(t);return"change"===e?()=>{n(),Nm.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e,t=!0){t&&this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e,t)}setWithVelocity(e,t,n){this.set(t),this.prev=e,this.timeDelta=n}jump(e){this.updateAndNotify(e),this.prev=e,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?uy(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Gy(e,t){return new $y(e,t)}const qy=e=>t=>t.test(e),Yy=[$g,nm,tm,em,im,rm,{test:e=>"auto"===e,parse:e=>e}],Xy=e=>Yy.find(qy(e)),Ky=[...Yy,Dv,Qv],Zy=e=>Ky.find(qy(e));function Jy(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Gy(n))}function Qy(e,t){return t?(t[e]||t.default||t).from:void 0}function eb({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&!0!==t[n];return t[n]=!1,r}function tb(e,t){const n=e.get();if(!Array.isArray(t))return n!==t;for(let r=0;r<t.length;r++)if(t[r]!==n)return!0}function nb(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:o=e.getDefaultTransition(),transitionEnd:a,...s}=e.makeTargetAnimatable(t);const l=e.getValue("willChange");r&&(o=r);const c=[],u=i&&e.animationState&&e.animationState.getState()[i];for(const d in s){const t=e.getValue(d),r=s[d];if(!t||void 0===r||u&&eb(u,d))continue;const i={delay:n,elapsed:0,...By(o||{},d)};if(window.HandoffAppearAnimations){const n=e.getProps()[pg];if(n){const e=window.HandoffAppearAnimations(n,d,t,Nm);null!==e&&(i.elapsed=e,i.isHandoff=!0)}}let a=!i.isHandoff&&!tb(t,r);if("spring"===i.type&&(t.getVelocity()||i.velocity)&&(a=!1),t.animation&&(a=!1),a)continue;t.start(Uy(d,t,r,e.shouldReduceMotion&&Rg.has(d)?{type:!1}:i));const h=t.animation;Vy(l)&&(l.add(d),h.then(()=>l.remove(d))),c.push(h)}return a&&Promise.all(c).then(()=>{a&&function(e,t){const n=lv(e,t);let{transitionEnd:r={},transition:i={},...o}=n?e.makeTargetAnimatable(n,!1):{};o={...o,...r};for(const a in o)Jy(e,a,Tm(o[a]))}(e,a)}),c}function rb(e,t,n={}){const r=lv(e,t,n.custom);let{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const o=r?()=>Promise.all(nb(e,r,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(r=0)=>{const{delayChildren:o=0,staggerChildren:a,staggerDirection:s}=i;return function(e,t,n=0,r=0,i=1,o){const a=[],s=(e.variantChildren.size-1)*r,l=1===i?(e=0)=>e*r:(e=0)=>s-e*r;return Array.from(e.variantChildren).sort(ib).forEach((e,r)=>{e.notify("AnimationStart",t),a.push(rb(e,t,{...o,delay:n+l(r)}).then(()=>e.notify("AnimationComplete",t)))}),Promise.all(a)}(e,t,o+r,a,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){const[e,t]="beforeChildren"===s?[o,a]:[a,o];return e().then(()=>t())}return Promise.all([o(),a(n.delay)])}function ib(e,t){return e.sortNodePosition(t)}const ob=[...yg].reverse(),ab=yg.length;function sb(e){let t=function(e){return t=>Promise.all(t.map(({animation:t,options:n})=>function(e,t,n={}){let r;if(e.notify("AnimationStart",t),Array.isArray(t)){const i=t.map(t=>rb(e,t,n));r=Promise.all(i)}else if("string"==typeof t)r=rb(e,t,n);else{const i="function"==typeof t?lv(e,t,n.custom):t;r=Promise.all(nb(e,i,n))}return r.then(()=>e.notify("AnimationComplete",t))}(e,t,n)))}(e);const n={animate:cb(!0),whileInView:cb(),whileHover:cb(),whileTap:cb(),whileDrag:cb(),whileFocus:cb(),exit:cb()};let r=!0;const i=(t,n)=>{const r=lv(e,n);if(r){const{transition:e,transitionEnd:n,...i}=r;t={...t,...i,...n}}return t};function o(o,a){const s=e.getProps(),l=e.getVariantContext(!0)||{},c=[],u=new Set;let d={},h=1/0;for(let t=0;t<ab;t++){const f=ob[t],p=n[f],g=void 0!==s[f]?s[f]:l[f],m=mg(g),v=f===a?p.isActive:null;!1===v&&(h=t);let y=g===l[f]&&g!==s[f]&&m;if(y&&r&&e.manuallyAnimateOnMount&&(y=!1),p.protectedKeys={...d},!p.isActive&&null===v||!g&&!p.prevProp||vg(g)||"boolean"==typeof g)continue;let b=lb(p.prevProp,g)||f===a&&p.isActive&&!y&&m||t>h&&m,w=!1;const x=Array.isArray(g)?g:[g];let C=x.reduce(i,{});!1===v&&(C={});const{prevResolvedValues:_={}}=p,S={..._,...C},A=e=>{b=!0,u.has(e)&&(w=!0,u.delete(e)),p.needsAnimating[e]=!0};for(const e in S){const t=C[e],n=_[e];if(d.hasOwnProperty(e))continue;let r=!1;r=jm(t)&&jm(n)?!sv(t,n):t!==n,r?void 0!==t?A(e):u.add(e):void 0!==t&&u.has(e)?A(e):p.protectedKeys[e]=!0}p.prevProp=g,p.prevResolvedValues=C,p.isActive&&(d={...d,...C}),r&&e.blockInitialAnimation&&(b=!1),b&&(!y||w)&&c.push(...x.map(e=>({animation:e,options:{type:f,...o}})))}if(u.size){const t={};u.forEach(n=>{const r=e.getBaseTarget(n);void 0!==r&&(t[n]=r)}),c.push({animation:t})}let f=!!c.length;return r&&(!1===s.initial||s.initial===s.animate)&&!e.manuallyAnimateOnMount&&(f=!1),r=!1,f?t(c):Promise.resolve()}return{animateChanges:o,setActive:function(t,r,i){var a;if(n[t].isActive===r)return Promise.resolve();null===(a=e.variantChildren)||void 0===a||a.forEach(e=>{var n;return null===(n=e.animationState)||void 0===n?void 0:n.setActive(t,r)}),n[t].isActive=r;const s=o(i,t);for(const e in n)n[e].protectedKeys={};return s},setAnimateFunction:function(n){t=n(e)},getState:()=>n}}function lb(e,t){return"string"==typeof t?t!==e:!!Array.isArray(t)&&!sv(t,e)}function cb(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}let ub=0;const db={animation:{Feature:class extends Zm{constructor(e){super(e),e.animationState||(e.animationState=sb(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();this.unmount(),vg(e)&&(this.unmount=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){}}},exit:{Feature:class extends Zm{constructor(){super(...arguments),this.id=ub++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:t,custom:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;const i=this.node.animationState.setActive("exit",!e,{custom:n??this.node.getProps().custom});t&&!e&&i.then(()=>t(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}}},hb=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function fb(e,t,n=1){const[r,i]=function(e){const t=hb.exec(e);if(!t)return[,];const[,n,r]=t;return[n,r]}(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);if(o){const e=o.trim();return Hy(e)?parseFloat(e):e}return Vg(i)?fb(i,t,n+1):i}const pb=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),gb=e=>pb.has(e),mb=e=>e===$g||e===nm,vb=(e,t)=>parseFloat(e.split(", ")[t]),yb=(e,t)=>(n,{transform:r})=>{if("none"===r||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/);if(i)return vb(i[1],t);{const t=r.match(/^matrix\((.+)\)$/);return t?vb(t[1],e):0}},bb=new Set(["x","y","z"]),wb=Pg.filter(e=>!bb.has(e)),xb={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:yb(4,13),y:yb(5,14)};xb.translateX=xb.x,xb.translateY=xb.y;function Cb(e,t,n,r){return(e=>Object.keys(e).some(gb))(t)?((e,t,n={},r={})=>{t={...t},r={...r};const i=Object.keys(t).filter(gb);let o=[],a=!1;const s=[];if(i.forEach(i=>{const l=e.getValue(i);if(!e.hasValue(i))return;let c=n[i],u=Xy(c);const d=t[i];let h;if(jm(d)){const e=d.length,t=null===d[0]?1:0;c=d[t],u=Xy(c);for(let n=t;n<e&&null!==d[n];n++)h?cv(Xy(d[n])===h):h=Xy(d[n])}else h=Xy(d);if(u!==h)if(mb(u)&&mb(h)){const e=l.get();"string"==typeof e&&l.set(parseFloat(e)),"string"==typeof d?t[i]=parseFloat(d):Array.isArray(d)&&h===nm&&(t[i]=d.map(parseFloat))}else null!=u&&u.transform&&null!=h&&h.transform&&(0===c||0===d)?0===c?l.set(h.transform(c)):t[i]=u.transform(d):(a||(o=function(e){const t=[];return wb.forEach(n=>{const r=e.getValue(n);void 0!==r&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t.length&&e.render(),t}(e),a=!0),s.push(i),r[i]=void 0!==r[i]?r[i]:t[i],l.jump(d))}),s.length){const n=s.indexOf("height")>=0?window.pageYOffset:null,i=((e,t,n)=>{const r=t.measureViewportBox(),i=t.current,o=getComputedStyle(i),{display:a}=o,s={};"none"===a&&t.setStaticValue("display",e.display||"block"),n.forEach(e=>{s[e]=xb[e](r,o)}),t.render();const l=t.measureViewportBox();return n.forEach(n=>{const r=t.getValue(n);r&&r.jump(s[n]),e[n]=xb[n](l,o)}),e})(t,e,s);return o.length&&o.forEach(([t,n])=>{e.getValue(t).set(n)}),e.render(),ug&&null!==n&&window.scrollTo({top:n}),{target:i,transitionEnd:r}}return{target:t,transitionEnd:r}})(e,t,n,r):{target:t,transitionEnd:r}}const _b={current:null},Sb={current:!1},Ab=new WeakMap,kb=Object.keys(Sg),Eb=kb.length,Ib=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],jb=bg.length;class Tb{constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,visualState:i},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>Nm.render(this.render,!1,!0);const{latestValues:a,renderState:s}=i;this.latestValues=a,this.baseTarget={...a},this.initialValues=t.initial?{...a}:{},this.renderState=s,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.options=o,this.isControllingVariants=wg(t),this.isVariantNode=xg(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!(!e||!e.current);const{willChange:l,...c}=this.scrapeMotionValuesFromProps(t,{});for(const u in c){const e=c[u];void 0!==a[u]&&Ng(e)&&(e.set(a[u],!1),Vy(l)&&l.add(u))}}scrapeMotionValuesFromProps(e,t){return{}}mount(e){this.current=e,Ab.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),Sb.current||function(){if(Sb.current=!0,ug)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>_b.current=e.matches;e.addListener(t),t()}else _b.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||_b.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Ab.delete(this.current),this.projection&&this.projection.unmount(),Dm(this.notifyUpdate),Dm(this.render),this.valueSubscriptions.forEach(e=>e()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features)this.features[e].unmount();this.current=null}bindToMotionValue(e,t){const n=Rg.has(e),r=t.on("change",t=>{this.latestValues[e]=t,this.props.onUpdate&&Nm.update(this.notifyUpdate,!1,!0),n&&this.projection&&(this.projection.isTransformDirty=!0)}),i=t.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(e,()=>{r(),i()})}sortNodePosition(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}loadFeatures({children:e,...t},n,r,i){let o,a;for(let s=0;s<Eb;s++){const e=kb[s],{isEnabled:n,Feature:r,ProjectionNode:i,MeasureLayout:l}=Sg[e];i&&(o=i),n(t)&&(!this.features[e]&&r&&(this.features[e]=new r(this)),l&&(a=l))}if(("html"===this.type||"svg"===this.type)&&!this.projection&&o){this.projection=new o(this.latestValues,this.parent&&this.parent.projection);const{layoutId:e,layout:n,drag:r,dragConstraints:a,layoutScroll:s,layoutRoot:l}=t;this.projection.setOptions({layoutId:e,layout:n,alwaysMeasureLayout:!!r||a&&gg(a),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:i,layoutScroll:s,layoutRoot:l})}return a}updateFeatures(){for(const e in this.features){const t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}makeTargetAnimatable(e,t=!0){return this.makeTargetAnimatableFromInstance(e,this.props,t)}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let n=0;n<Ib.length;n++){const t=Ib[n];this.propEventSubscriptions[t]&&(this.propEventSubscriptions[t](),delete this.propEventSubscriptions[t]);const r=e["on"+t];r&&(this.propEventSubscriptions[t]=this.on(t,r))}this.prevMotionValues=function(e,t,n){const{willChange:r}=t;for(const i in t){const o=t[i],a=n[i];if(Ng(o))e.addValue(i,o),Vy(r)&&r.add(i);else if(Ng(a))e.addValue(i,Gy(o,{owner:e})),Vy(r)&&r.remove(i);else if(a!==o)if(e.hasValue(i)){const t=e.getValue(i);!t.hasAnimated&&t.set(o)}else{const t=e.getStaticValue(i);e.addValue(i,Gy(void 0!==t?t:o,{owner:e}))}}for(const i in n)void 0===t[i]&&e.removeValue(i);return t}(this,this.scrapeMotionValuesFromProps(e,this.prevProps),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}getVariantContext(e=!1){if(e)return this.parent?this.parent.getVariantContext():void 0;if(!this.isControllingVariants){const e=this.parent&&this.parent.getVariantContext()||{};return void 0!==this.props.initial&&(e.initial=this.props.initial),e}const t={};for(let n=0;n<jb;n++){const e=bg[n],r=this.props[e];(mg(r)||!1===r)&&(t[e]=r)}return t}addVariantChild(e){const t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){t!==this.values.get(e)&&(this.removeValue(e),this.bindToMotionValue(e,t)),this.values.set(e,t),this.latestValues[e]=t.get()}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return void 0===n&&void 0!==t&&(n=Gy(t,{owner:this}),this.addValue(e,n)),n}readValue(e){var t;return void 0===this.latestValues[e]&&this.current?null!==(t=this.getBaseTargetFromProps(this.props,e))&&void 0!==t?t:this.readValueFromInstance(this.current,e,this.options):this.latestValues[e]}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var t;const{initial:n}=this.props,r="string"==typeof n||"object"==typeof n?null===(t=Em(this.props,n))||void 0===t?void 0:t[e]:void 0;if(n&&void 0!==r)return r;const i=this.getBaseTargetFromProps(this.props,e);return void 0===i||Ng(i)?void 0!==this.initialValues[e]&&void 0===r?void 0:this.baseTarget[e]:i}on(e,t){return this.events[e]||(this.events[e]=new Wy),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}}class Fb extends Tb{sortInstanceNodePosition(e,t){return 2&e.compareDocumentPosition(t)?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}makeTargetAnimatableFromInstance({transition:e,transitionEnd:t,...n},{transformValues:r},i){let o=function(e,t,n){const r={};for(const i in e){const e=Qy(i,t);if(void 0!==e)r[i]=e;else{const e=n.getValue(i);e&&(r[i]=e.get())}}return r}(n,e||{},this);if(r&&(t&&(t=r(t)),n&&(n=r(n)),o&&(o=r(o))),i){!function(e,t,n){var r,i;const o=Object.keys(t).filter(t=>!e.hasValue(t)),a=o.length;if(a)for(let s=0;s<a;s++){const a=o[s],l=t[a];let c=null;Array.isArray(l)&&(c=l[0]),null===c&&(c=null!==(i=null!==(r=n[a])&&void 0!==r?r:e.readValue(a))&&void 0!==i?i:t[a]),null!=c&&("string"==typeof c&&(Hy(c)||Dy(c))?c=parseFloat(c):!Zy(c)&&Qv.test(l)&&(c=Ny(a,l)),e.addValue(a,Gy(c,{owner:e})),void 0===n[a]&&(n[a]=c),null!==c&&e.setBaseTarget(a,c))}}(this,n,o);const e=((e,t,n,r)=>{const i=function(e,{...t},n){const r=e.current;if(!(r instanceof Element))return{target:t,transitionEnd:n};n&&(n={...n}),e.values.forEach(e=>{const t=e.get();if(!Vg(t))return;const n=fb(t,r);n&&e.set(n)});for(const i in t){const e=t[i];if(!Vg(e))continue;const o=fb(e,r);o&&(t[i]=o,n||(n={}),void 0===n[i]&&(n[i]=e))}return{target:t,transitionEnd:n}}(e,t,r);return Cb(e,t=i.target,n,r=i.transitionEnd)})(this,n,o,t);t=e.transitionEnd,n=e.target}return{transition:e,transitionEnd:t,...n}}}class Ob extends Fb{constructor(){super(...arguments),this.type="html"}readValueFromInstance(e,t){if(Rg.has(t)){const e=Ly(t);return e&&e.default||0}{const n=function(e){return window.getComputedStyle(e)}(e),r=(Ug(t)?n.getPropertyValue(t):n[t])||0;return"string"==typeof r?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return function(e,t){return function({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}(function(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}(e.getBoundingClientRect(),t))}(e,t)}build(e,t,n,r){lm(e,t,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,t){return Am(e,t)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Ng(e)&&(this.childSubscription=e.on("change",e=>{this.current&&(this.current.textContent=`${e}`)}))}renderInstance(e,t,n,r){Cm(e,t,n,r)}}class Mb extends Fb{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(Rg.has(t)){const e=Ly(t);return e&&e.default||0}return t=_m.has(t)?t:fg(t),e.getAttribute(t)}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}scrapeMotionValuesFromProps(e,t){return km(e,t)}build(e,t,n,r){ym(e,t,n,this.isSVGTag,r.transformTemplate)}renderInstance(e,t,n,r){Sm(e,t,0,r)}mount(e){this.isSVGTag=bm(e.tagName),super.mount(e)}}const Pb=function(){function e(e,t={}){return jg(function(e,{forwardMotionProps:t=!1},n,r){return{...Og(e)?Bm:Um,preloadedFeatures:n,useRender:xm(t),createVisualElement:r,Component:e}}(e,t))}if(typeof Proxy>"u")return e;const t=new Map;return new Proxy(e,{get:(n,r)=>(t.has(r)||t.set(r,e(r)),t.get(r))})}();function Rb(){const e=(0,o.useRef)(!1);return dg(()=>(e.current=!0,()=>{e.current=!1}),[]),e}class Lb extends o.Component{getSnapshotBeforeUpdate(e){const t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){const e=this.props.sizeRef.current;e.height=t.offsetHeight||0,e.width=t.offsetWidth||0,e.top=t.offsetTop,e.left=t.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function Nb({children:e,isPresent:t}){const n=(0,o.useId)(),r=(0,o.useRef)(null),i=(0,o.useRef)({width:0,height:0,top:0,left:0});return(0,o.useInsertionEffect)(()=>{const{width:e,height:o,top:a,left:s}=i.current;if(t||!r.current||!e||!o)return;r.current.dataset.motionPopId=n;const l=document.createElement("style");return document.head.appendChild(l),l.sheet&&l.sheet.insertRule(`\n [data-motion-pop-id="${n}"] {\n position: absolute !important;\n width: ${e}px !important;\n height: ${o}px !important;\n top: ${a}px !important;\n left: ${s}px !important;\n }\n `),()=>{document.head.removeChild(l)}},[t]),o.createElement(Lb,{isPresent:t,childRef:r,sizeRef:i},o.cloneElement(e,{ref:r}))}const Db=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:s})=>{const l=Im(zb),c=(0,o.useId)(),u=(0,o.useMemo)(()=>({id:c,initial:t,isPresent:n,custom:i,onExitComplete:e=>{l.set(e,!0);for(const t of l.values())if(!t)return;r&&r()},register:e=>(l.set(e,!1),()=>l.delete(e))}),a?void 0:[n]);return(0,o.useMemo)(()=>{l.forEach((e,t)=>l.set(t,!1))},[n]),o.useEffect(()=>{!n&&!l.size&&r&&r()},[n]),"popLayout"===s&&(e=o.createElement(Nb,{isPresent:n},e)),o.createElement(cg.Provider,{value:u},e)};function zb(){return new Map}const Bb=e=>e.key||"",Ub=({children:e,custom:t,initial:n=!0,onExitComplete:r,exitBeforeEnter:i,presenceAffectsLayout:a=!0,mode:s="sync"})=>{const l=(0,o.useContext)(kg).forceRender||function(){const e=Rb(),[t,n]=(0,o.useState)(0),r=(0,o.useCallback)(()=>{e.current&&n(t+1)},[t]);return[(0,o.useCallback)(()=>Nm.postRender(r),[r]),t]}()[0],c=Rb(),u=function(e){const t=[];return o.Children.forEach(e,e=>{(0,o.isValidElement)(e)&&t.push(e)}),t}(e);let d=u;const h=(0,o.useRef)(new Map).current,f=(0,o.useRef)(d),p=(0,o.useRef)(new Map).current,g=(0,o.useRef)(!0);if(dg(()=>{g.current=!1,function(e,t){e.forEach(e=>{const n=Bb(e);t.set(n,e)})}(u,p),f.current=d}),(0,o.useEffect)(()=>()=>(g.current=!0,p.clear(),void h.clear()),[]),g.current)return o.createElement(o.Fragment,null,d.map(e=>o.createElement(Db,{key:Bb(e),isPresent:!0,initial:!!n&&void 0,presenceAffectsLayout:a,mode:s},e)));d=[...d];const m=f.current.map(Bb),v=u.map(Bb),y=m.length;for(let o=0;o<y;o++){const e=m[o];-1===v.indexOf(e)&&!h.has(e)&&h.set(e,void 0)}return"wait"===s&&h.size&&(d=[]),h.forEach((e,n)=>{if(-1!==v.indexOf(n))return;const i=p.get(n);if(!i)return;const g=m.indexOf(n);let y=e;if(!y){const e=()=>{h.delete(n);const e=Array.from(p.keys()).filter(e=>!v.includes(e));if(e.forEach(e=>p.delete(e)),f.current=u.filter(t=>{const r=Bb(t);return r===n||e.includes(r)}),!h.size){if(!1===c.current)return;l(),r&&r()}};y=o.createElement(Db,{key:Bb(i),isPresent:!1,onExitComplete:e,custom:t,presenceAffectsLayout:a,mode:s},i),h.set(n,y)}d.splice(g,0,y)}),d=d.map(e=>{const t=e.key;return h.has(t)?e:o.createElement(Db,{key:Bb(e),isPresent:!0,presenceAffectsLayout:a,mode:s},e)}),o.createElement(o.Fragment,null,h.size?d:d.map(e=>(0,o.cloneElement)(e)))};function Vb({children:e,features:t,strict:n=!1}){const[,r]=(0,o.useState)(!Hb(t)),i=(0,o.useRef)(void 0);if(!Hb(t)){const{renderer:e,...n}=t;i.current=e,Ag(n)}return(0,o.useEffect)(()=>{Hb(t)&&t().then(({renderer:e,...t})=>{Ag(t),i.current=e,r(!0)})},[]),o.createElement(hg.Provider,{value:{renderer:i.current,strict:n}},e)}function Hb(e){return"function"==typeof e}const Wb={renderer:(e,t)=>Og(e)?new Mb(t,{enableHardwareAcceleration:!1}):new Ob(t,{enableHardwareAcceleration:!0}),...db,...av},$b=typeof document<"u"?o.useLayoutEffect:()=>{},Gb=o.createContext(!1);function qb(){return!1}function Yb(){return!0}function Xb(e){return()=>{}}function Kb(){return"function"==typeof o.useSyncExternalStore?o.useSyncExternalStore(Xb,qb,Yb):(0,o.useContext)(Gb)}o.useId;let Zb=new Map;function Jb(e,t){if(e===t)return e;let n=Zb.get(e);if(n)return n(t),t;let r=Zb.get(t);return r?(r(e),e):t}function Qb(...e){return(...t)=>{for(let n of e)"function"==typeof n&&n(...t)}}const ew=e=>{var t;return null!==(t=null==e?void 0:e.ownerDocument)&&void 0!==t?t:document},tw=e=>e&&"window"in e&&e.window===e?e:ew(e).defaultView||window;function nw(...e){let t={...e[0]};for(let n=1;n<e.length;n++){let r=e[n];for(let e in r){let n=t[e],i=r[e];"function"==typeof n&&"function"==typeof i&&"o"===e[0]&&"n"===e[1]&&e.charCodeAt(2)>=65&&e.charCodeAt(2)<=90?t[e]=Qb(n,i):"className"!==e&&"UNSAFE_className"!==e||"string"!=typeof n||"string"!=typeof i?"id"===e&&n&&i?t.id=Jb(n,i):t[e]=void 0!==i?i:n:t[e]=Pd(n,i)}}return t}function rw(e){if(function(){if(null==iw){iw=!1;try{document.createElement("div").focus({get preventScroll(){return iw=!0,!0}})}catch{}}return iw}())e.focus({preventScroll:!0});else{let t=function(e){let t=e.parentNode,n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}(e);e.focus(),function(e){for(let{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}(t)}}let iw=null;function ow(){return function(){var e;return typeof window<"u"&&null!=window.navigator&&/^Mac/i.test((null===(e=window.navigator.userAgentData)||void 0===e?void 0:e.platform)||window.navigator.platform)}()}let aw=new Map,sw=new Set;function lw(){if(typeof window>"u")return;function e(e){return"propertyName"in e}let t=n=>{if(!e(n)||!n.target)return;let r=aw.get(n.target);if(r&&(r.delete(n.propertyName),0===r.size&&(n.target.removeEventListener("transitioncancel",t),aw.delete(n.target)),0===aw.size)){for(let e of sw)e();sw.clear()}};document.body.addEventListener("transitionrun",n=>{if(!e(n)||!n.target)return;let r=aw.get(n.target);r||(r=new Set,aw.set(n.target,r),n.target.addEventListener("transitioncancel",t,{once:!0})),r.add(n.propertyName)}),document.body.addEventListener("transitionend",t)}function cw(){let e=(0,o.useRef)(new Map),t=(0,o.useCallback)((t,n,r,i)=>{let o=null!=i&&i.once?(...t)=>{e.current.delete(r),r(...t)}:r;e.current.set(r,{type:n,eventTarget:t,fn:o,options:i}),t.addEventListener(n,r,i)},[]),n=(0,o.useCallback)((t,n,r,i)=>{var o;let a=(null===(o=e.current.get(r))||void 0===o?void 0:o.fn)||r;t.removeEventListener(n,a,i),e.current.delete(r)},[]),r=(0,o.useCallback)(()=>{e.current.forEach((e,t)=>{n(e.eventTarget,e.type,t,e.options)})},[n]);return(0,o.useEffect)(()=>r,[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}function uw(e){const t=(0,o.useRef)(null);return(0,o.useMemo)(()=>({get current(){return t.current},set current(n){t.current=n,"function"==typeof e?e(n):e&&(e.current=n)}}),[e])}typeof document<"u"&&("loading"!==document.readyState?lw():document.addEventListener("DOMContentLoaded",lw));let dw=typeof document<"u"&&window.visualViewport;function hw(){return{width:dw&&(null==dw?void 0:dw.width)||window.innerWidth,height:dw&&(null==dw?void 0:dw.height)||window.innerHeight}}function fw(e,t,n){let[r,i]=(0,o.useState)(e||t),a=(0,o.useRef)(void 0!==e),s=void 0!==e;(0,o.useEffect)(()=>{a.current;a.current=s},[s]);let l=s?e:r,c=(0,o.useCallback)((e,...t)=>{let r=(e,...t)=>{n&&(Object.is(l,e)||n(e,...t)),s||(l=e)};"function"==typeof e?i((n,...i)=>{let o=e(s?l:n,...i);return r(o,...t),s?n:o}):(s||i(e),r(e,...t))},[s,l,n]);return[l,c]}function pw(e,t=-1/0,n=1/0){return Math.min(Math.max(e,t),n)}function gw(e,t){let n=e,r=t.toString(),i=r.indexOf("."),o=i>=0?r.length-i:0;if(o>0){let e=Math.pow(10,o);n=Math.round(n*e)/e}return n}function mw(e,t,n=10){const r=Math.pow(n,t);return Math.round(e*r)/r}var vw={};const yw=function(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));!function(e){var t=t||{version:"5.3.0"};if(e.fabric=t,typeof document<"u"&&typeof window<"u")document instanceof(typeof HTMLDocument<"u"?HTMLDocument:Document)?t.document=document:t.document=document.implementation.createHTMLDocument(""),t.window=window;else{var n=new yw.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;t.document=n.document,t.jsdomImplForWrapper=yw.implForWrapper,t.nodeCanvas=yw.Canvas,t.window=n,DOMParser=t.window.DOMParser}function r(e,t){var n=e.canvas,r=t.targetCanvas,i=r.getContext("2d");i.translate(0,r.height),i.scale(1,-1);var o=n.height-r.height;i.drawImage(n,0,o,r.width,r.height,0,0,r.width,r.height)}function i(e,t){var n=t.targetCanvas.getContext("2d"),r=t.destinationWidth,i=t.destinationHeight,o=r*i*4,a=new Uint8Array(this.imageBuffer,0,o),s=new Uint8ClampedArray(this.imageBuffer,0,o);e.readPixels(0,0,r,i,e.RGBA,e.UNSIGNED_BYTE,a);var l=new ImageData(s,r,i);n.putImageData(l,0,0)}t.isTouchSupported="ontouchstart"in t.window||"ontouchstart"in t.document||t.window&&t.window.navigator&&t.window.navigator.maxTouchPoints>0,t.isLikelyNode=typeof he<"u"&&typeof window>"u",t.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"],t.DPI=96,t.reNum="(?:[-+]?(?:\\d+|\\d*\\.\\d+)(?:[eE][-+]?\\d+)?)",t.commaWsp="(?:\\s+,?\\s*|,\\s*)",t.rePathCommand=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,t.reNonWord=/[ \n\.,;!\?\-]/,t.fontPaths={},t.iMatrix=[1,0,0,1,0,0],t.svgNS="http://www.w3.org/2000/svg",t.perfLimitSizeTotal=2097152,t.maxCacheSideLimit=4096,t.minCacheSideLimit=256,t.charWidthsCache={},t.textureSize=2048,t.disableStyleCopyPaste=!1,t.enableGLFiltering=!0,t.devicePixelRatio=t.window.devicePixelRatio||t.window.webkitDevicePixelRatio||t.window.mozDevicePixelRatio||1,t.browserShadowBlurConstant=1,t.arcToSegmentsCache={},t.boundsOfCurveCache={},t.cachesBoundsOfCurve=!0,t.forceGLPutImageData=!1,t.initFilterBackend=function(){return t.enableGLFiltering&&t.isWebglSupported&&t.isWebglSupported(t.textureSize)?new t.WebglFilterBackend({tileSize:t.textureSize}):t.Canvas2dFilterBackend?new t.Canvas2dFilterBackend:void 0},typeof document<"u"&&typeof window<"u"&&(window.fabric=t),function(){function e(e,n){if(this.__eventListeners[e]){var r=this.__eventListeners[e];n?r[r.indexOf(n)]=!1:t.util.array.fill(r,!1)}}function n(e,t){var n=function(){t.apply(this,arguments),this.off(e,n)}.bind(this);this.on(e,n)}t.Observable={fire:function(e,t){if(!this.__eventListeners)return this;var n=this.__eventListeners[e];if(!n)return this;for(var r=0,i=n.length;r<i;r++)n[r]&&n[r].call(this,t||{});return this.__eventListeners[e]=n.filter(function(e){return!1!==e}),this},on:function(e,t){if(this.__eventListeners||(this.__eventListeners={}),1===arguments.length)for(var n in e)this.on(n,e[n]);else this.__eventListeners[e]||(this.__eventListeners[e]=[]),this.__eventListeners[e].push(t);return this},once:function(e,t){if(1===arguments.length)for(var r in e)n.call(this,r,e[r]);else n.call(this,e,t);return this},off:function(t,n){if(!this.__eventListeners)return this;if(0===arguments.length)for(t in this.__eventListeners)e.call(this,t);else if(1===arguments.length&&"object"==typeof arguments[0])for(var r in t)e.call(this,r,t[r]);else e.call(this,t,n);return this}}}(),t.Collection={_objects:[],add:function(){if(this._objects.push.apply(this._objects,arguments),this._onObjectAdded)for(var e=0,t=arguments.length;e<t;e++)this._onObjectAdded(arguments[e]);return this.renderOnAddRemove&&this.requestRenderAll(),this},insertAt:function(e,t,n){var r=this._objects;return n?r[t]=e:r.splice(t,0,e),this._onObjectAdded&&this._onObjectAdded(e),this.renderOnAddRemove&&this.requestRenderAll(),this},remove:function(){for(var e,t=this._objects,n=!1,r=0,i=arguments.length;r<i;r++)-1!==(e=t.indexOf(arguments[r]))&&(n=!0,t.splice(e,1),this._onObjectRemoved&&this._onObjectRemoved(arguments[r]));return this.renderOnAddRemove&&n&&this.requestRenderAll(),this},forEachObject:function(e,t){for(var n=this.getObjects(),r=0,i=n.length;r<i;r++)e.call(t,n[r],r,n);return this},getObjects:function(e){return typeof e>"u"?this._objects.concat():this._objects.filter(function(t){return t.type===e})},item:function(e){return this._objects[e]},isEmpty:function(){return 0===this._objects.length},size:function(){return this._objects.length},contains:function(e,t){return this._objects.indexOf(e)>-1||!!t&&this._objects.some(function(t){return"function"==typeof t.contains&&t.contains(e,!0)})},complexity:function(){return this._objects.reduce(function(e,t){return e+(t.complexity?t.complexity():0)},0)}},t.CommonMethods={_setOptions:function(e){for(var t in e)this.set(t,e[t])},_initGradient:function(e,n){e&&e.colorStops&&!(e instanceof t.Gradient)&&this.set(n,new t.Gradient(e))},_initPattern:function(e,n,r){!e||!e.source||e instanceof t.Pattern?r&&r():this.set(n,new t.Pattern(e,r))},_setObject:function(e){for(var t in e)this._set(t,e[t])},set:function(e,t){return"object"==typeof e?this._setObject(e):this._set(e,t),this},_set:function(e,t){this[e]=t},toggle:function(e){var t=this.get(e);return"boolean"==typeof t&&this.set(e,!t),this},get:function(e){return this[e]}},function(e){var n=Math.sqrt,r=Math.atan2,i=Math.pow,o=Math.PI/180,a=Math.PI/2;t.util={cos:function(e){if(0===e)return 1;switch(e<0&&(e=-e),e/a){case 1:case 3:return 0;case 2:return-1}return Math.cos(e)},sin:function(e){if(0===e)return 0;var t=1;switch(e<0&&(t=-1),e/a){case 1:return t;case 2:return 0;case 3:return-t}return Math.sin(e)},removeFromArray:function(e,t){var n=e.indexOf(t);return-1!==n&&e.splice(n,1),e},getRandomInt:function(e,t){return Math.floor(Math.random()*(t-e+1))+e},degreesToRadians:function(e){return e*o},radiansToDegrees:function(e){return e/o},rotatePoint:function(e,n,r){var i=new t.Point(e.x-n.x,e.y-n.y),o=t.util.rotateVector(i,r);return new t.Point(o.x,o.y).addEquals(n)},rotateVector:function(e,n){var r=t.util.sin(n),i=t.util.cos(n);return{x:e.x*i-e.y*r,y:e.x*r+e.y*i}},createVector:function(e,n){return new t.Point(n.x-e.x,n.y-e.y)},calcAngleBetweenVectors:function(e,t){return Math.acos((e.x*t.x+e.y*t.y)/(Math.hypot(e.x,e.y)*Math.hypot(t.x,t.y)))},getHatVector:function(e){return new t.Point(e.x,e.y).multiply(1/Math.hypot(e.x,e.y))},getBisector:function(e,n,r){var i=t.util.createVector(e,n),o=t.util.createVector(e,r),a=t.util.calcAngleBetweenVectors(i,o),s=a*(0===t.util.calcAngleBetweenVectors(t.util.rotateVector(i,a),o)?1:-1)/2;return{vector:t.util.getHatVector(t.util.rotateVector(i,s)),angle:a}},projectStrokeOnPoints:function(e,n,r){var i=[],o=n.strokeWidth/2,a=n.strokeUniform?new t.Point(1/n.scaleX,1/n.scaleY):new t.Point(1,1),s=function(e){var n=o/Math.hypot(e.x,e.y);return new t.Point(e.x*n*a.x,e.y*n*a.y)};return e.length<=1||e.forEach(function(l,c){var u,d,h=new t.Point(l.x,l.y);0===c?(d=e[c+1],u=r?s(t.util.createVector(d,h)).addEquals(h):e[e.length-1]):c===e.length-1?(u=e[c-1],d=r?s(t.util.createVector(u,h)).addEquals(h):e[0]):(u=e[c-1],d=e[c+1]);var f,p,g=t.util.getBisector(h,u,d),m=g.vector,v=g.angle;if("miter"===n.strokeLineJoin&&(f=-o/Math.sin(v/2),p=new t.Point(m.x*f*a.x,m.y*f*a.y),Math.hypot(p.x,p.y)/o<=n.strokeMiterLimit))return i.push(h.add(p)),void i.push(h.subtract(p));f=-o*Math.SQRT2,p=new t.Point(m.x*f*a.x,m.y*f*a.y),i.push(h.add(p)),i.push(h.subtract(p))}),i},transformPoint:function(e,n,r){return r?new t.Point(n[0]*e.x+n[2]*e.y,n[1]*e.x+n[3]*e.y):new t.Point(n[0]*e.x+n[2]*e.y+n[4],n[1]*e.x+n[3]*e.y+n[5])},makeBoundingBoxFromPoints:function(e,n){if(n)for(var r=0;r<e.length;r++)e[r]=t.util.transformPoint(e[r],n);var i=[e[0].x,e[1].x,e[2].x,e[3].x],o=t.util.array.min(i),a=t.util.array.max(i)-o,s=[e[0].y,e[1].y,e[2].y,e[3].y],l=t.util.array.min(s);return{left:o,top:l,width:a,height:t.util.array.max(s)-l}},invertTransform:function(e){var n=1/(e[0]*e[3]-e[1]*e[2]),r=[n*e[3],-n*e[1],-n*e[2],n*e[0]],i=t.util.transformPoint({x:e[4],y:e[5]},r,!0);return r[4]=-i.x,r[5]=-i.y,r},toFixed:function(e,t){return parseFloat(Number(e).toFixed(t))},parseUnit:function(e,n){var r=/\D{0,2}$/.exec(e),i=parseFloat(e);switch(n||(n=t.Text.DEFAULT_SVG_FONT_SIZE),r[0]){case"mm":return i*t.DPI/25.4;case"cm":return i*t.DPI/2.54;case"in":return i*t.DPI;case"pt":return i*t.DPI/72;case"pc":return i*t.DPI/72*12;case"em":return i*n;default:return i}},falseFunction:function(){return!1},getKlass:function(e,n){return e=t.util.string.camelize(e.charAt(0).toUpperCase()+e.slice(1)),t.util.resolveNamespace(n)[e]},getSvgAttributes:function(e){var t=["instantiated_by_use","style","id","class"];switch(e){case"linearGradient":t=t.concat(["x1","y1","x2","y2","gradientUnits","gradientTransform"]);break;case"radialGradient":t=t.concat(["gradientUnits","gradientTransform","cx","cy","r","fx","fy","fr"]);break;case"stop":t=t.concat(["offset","stop-color","stop-opacity"])}return t},resolveNamespace:function(n){if(!n)return t;var r,i=n.split("."),o=i.length,a=e||t.window;for(r=0;r<o;++r)a=a[i[r]];return a},loadImage:function(e,n,r,i){if(e){var o=t.util.createImage(),a=function(){n&&n.call(r,o,!1),o=o.onload=o.onerror=null};o.onload=a,o.onerror=function(){t.log("Error loading "+o.src),n&&n.call(r,null,!0),o=o.onload=o.onerror=null},0!==e.indexOf("data")&&null!=i&&(o.crossOrigin=i),"data:image/svg"===e.substring(0,14)&&(o.onload=null,t.util.loadImageInDom(o,a)),o.src=e}else n&&n.call(r,e)},loadImageInDom:function(e,n){var r=t.document.createElement("div");r.style.width=r.style.height="1px",r.style.left=r.style.top="-100%",r.style.position="absolute",r.appendChild(e),t.document.querySelector("body").appendChild(r),e.onload=function(){n(),r.parentNode.removeChild(r),r=null}},enlivenObjects:function(e,n,r,i){var o=[],a=0,s=(e=e||[]).length;function l(){++a===s&&n&&n(o.filter(function(e){return e}))}s?e.forEach(function(e,n){e&&e.type?t.util.getKlass(e.type,r).fromObject(e,function(t,r){r||(o[n]=t),i&&i(e,t,r),l()}):l()}):n&&n(o)},enlivenObjectEnlivables:function(e,n,r){var i=t.Object.ENLIVEN_PROPS.filter(function(t){return!!e[t]});t.util.enlivenObjects(i.map(function(t){return e[t]}),function(e){var t={};i.forEach(function(r,i){t[r]=e[i],n&&(n[r]=e[i])}),r&&r(t)})},enlivenPatterns:function(e,n){function r(){++o===a&&n&&n(i)}var i=[],o=0,a=(e=e||[]).length;a?e.forEach(function(e,n){e&&e.source?new t.Pattern(e,function(e){i[n]=e,r()}):(i[n]=e,r())}):n&&n(i)},groupSVGElements:function(e,n,r){var i;return e&&1===e.length?(typeof r<"u"&&(e[0].sourcePath=r),e[0]):(n&&(n.width&&n.height?n.centerPoint={x:n.width/2,y:n.height/2}:(delete n.width,delete n.height)),i=new t.Group(e,n),typeof r<"u"&&(i.sourcePath=r),i)},populateWithProperties:function(e,t,n){if(n&&Array.isArray(n))for(var r=0,i=n.length;r<i;r++)n[r]in e&&(t[n[r]]=e[n[r]])},createCanvasElement:function(){return t.document.createElement("canvas")},copyCanvasElement:function(e){var n=t.util.createCanvasElement();return n.width=e.width,n.height=e.height,n.getContext("2d").drawImage(e,0,0),n},toDataURL:function(e,t,n){return e.toDataURL("image/"+t,n)},createImage:function(){return t.document.createElement("img")},multiplyTransformMatrices:function(e,t,n){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],n?0:e[0]*t[4]+e[2]*t[5]+e[4],n?0:e[1]*t[4]+e[3]*t[5]+e[5]]},qrDecompose:function(e){var t=r(e[1],e[0]),a=i(e[0],2)+i(e[1],2),s=n(a),l=(e[0]*e[3]-e[2]*e[1])/s,c=r(e[0]*e[2]+e[1]*e[3],a);return{angle:t/o,scaleX:s,scaleY:l,skewX:c/o,skewY:0,translateX:e[4],translateY:e[5]}},calcRotateMatrix:function(e){if(!e.angle)return t.iMatrix.concat();var n=t.util.degreesToRadians(e.angle),r=t.util.cos(n),i=t.util.sin(n);return[r,i,-i,r,0,0]},calcDimensionsMatrix:function(e){var n=typeof e.scaleX>"u"?1:e.scaleX,r=typeof e.scaleY>"u"?1:e.scaleY,i=[e.flipX?-n:n,0,0,e.flipY?-r:r,0,0],o=t.util.multiplyTransformMatrices,a=t.util.degreesToRadians;return e.skewX&&(i=o(i,[1,0,Math.tan(a(e.skewX)),1],!0)),e.skewY&&(i=o(i,[1,Math.tan(a(e.skewY)),0,1],!0)),i},composeMatrix:function(e){var n=[1,0,0,1,e.translateX||0,e.translateY||0],r=t.util.multiplyTransformMatrices;return e.angle&&(n=r(n,t.util.calcRotateMatrix(e))),(1!==e.scaleX||1!==e.scaleY||e.skewX||e.skewY||e.flipX||e.flipY)&&(n=r(n,t.util.calcDimensionsMatrix(e))),n},resetObjectTransform:function(e){e.scaleX=1,e.scaleY=1,e.skewX=0,e.skewY=0,e.flipX=!1,e.flipY=!1,e.rotate(0)},saveObjectTransform:function(e){return{scaleX:e.scaleX,scaleY:e.scaleY,skewX:e.skewX,skewY:e.skewY,angle:e.angle,left:e.left,flipX:e.flipX,flipY:e.flipY,top:e.top}},isTransparent:function(e,t,n,r){r>0&&(t>r?t-=r:t=0,n>r?n-=r:n=0);var i,o=!0,a=e.getImageData(t,n,2*r||1,2*r||1),s=a.data.length;for(i=3;i<s&&!1!==(o=a.data[i]<=0);i+=4);return a=null,o},parsePreserveAspectRatioAttribute:function(e){var t,n="meet",r=e.split(" ");return r&&r.length&&("meet"!==(n=r.pop())&&"slice"!==n?(t=n,n="meet"):r.length&&(t=r.pop())),{meetOrSlice:n,alignX:"none"!==t?t.slice(1,4):"none",alignY:"none"!==t?t.slice(5,8):"none"}},clearFabricFontCache:function(e){(e=(e||"").toLowerCase())?t.charWidthsCache[e]&&delete t.charWidthsCache[e]:t.charWidthsCache={}},limitDimsByArea:function(e,t){var n=Math.sqrt(t*e),r=Math.floor(t/n);return{x:Math.floor(n),y:r}},capValue:function(e,t,n){return Math.max(e,Math.min(t,n))},findScaleToFit:function(e,t){return Math.min(t.width/e.width,t.height/e.height)},findScaleToCover:function(e,t){return Math.max(t.width/e.width,t.height/e.height)},matrixToSVG:function(e){return"matrix("+e.map(function(e){return t.util.toFixed(e,t.Object.NUM_FRACTION_DIGITS)}).join(" ")+")"},removeTransformFromObject:function(e,n){var r=t.util.invertTransform(n),i=t.util.multiplyTransformMatrices(r,e.calcOwnMatrix());t.util.applyTransformToObject(e,i)},addTransformToObject:function(e,n){t.util.applyTransformToObject(e,t.util.multiplyTransformMatrices(n,e.calcOwnMatrix()))},applyTransformToObject:function(e,n){var r=t.util.qrDecompose(n),i=new t.Point(r.translateX,r.translateY);e.flipX=!1,e.flipY=!1,e.set("scaleX",r.scaleX),e.set("scaleY",r.scaleY),e.skewX=r.skewX,e.skewY=r.skewY,e.angle=r.angle,e.setPositionByOrigin(i,"center","center")},sizeAfterTransform:function(e,n,r){var i=e/2,o=n/2,a=[{x:-i,y:-o},{x:i,y:-o},{x:-i,y:o},{x:i,y:o}],s=t.util.calcDimensionsMatrix(r),l=t.util.makeBoundingBoxFromPoints(a,s);return{x:l.width,y:l.height}},mergeClipPaths:function(e,n){var r=e,i=n;r.inverted&&!i.inverted&&(r=n,i=e),t.util.applyTransformToObject(i,t.util.multiplyTransformMatrices(t.util.invertTransform(r.calcTransformMatrix()),i.calcTransformMatrix()));var o=r.inverted&&i.inverted;return o&&(r.inverted=i.inverted=!1),new t.Group([r],{clipPath:i,inverted:o})},hasStyleChanged:function(e,t,n){return n=n||!1,e.fill!==t.fill||e.stroke!==t.stroke||e.strokeWidth!==t.strokeWidth||e.fontSize!==t.fontSize||e.fontFamily!==t.fontFamily||e.fontWeight!==t.fontWeight||e.fontStyle!==t.fontStyle||e.textBackgroundColor!==t.textBackgroundColor||e.deltaY!==t.deltaY||n&&(e.overline!==t.overline||e.underline!==t.underline||e.linethrough!==t.linethrough)},stylesToArray:function(e,n){e=t.util.object.clone(e,!0);for(var r=n.split("\n"),i=-1,o={},a=[],s=0;s<r.length;s++)if(e[s])for(var l=0;l<r[s].length;l++){i++;var c=e[s][l];c&&Object.keys(c).length>0&&(t.util.hasStyleChanged(o,c,!0)?a.push({start:i,end:i+1,style:c}):a[a.length-1].end++),o=c||{}}else i+=r[s].length;return a},stylesFromArray:function(e,t){if(!Array.isArray(e))return e;for(var n=t.split("\n"),r=-1,i=0,o={},a=0;a<n.length;a++)for(var s=0;s<n[a].length;s++)r++,e[i]&&e[i].start<=r&&r<e[i].end&&(o[a]=o[a]||{},o[a][s]=Object.assign({},e[i].style),r===e[i].end-1&&i++);return o}}}(e),function(){var e=Array.prototype.join,n={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7},r={m:"l",M:"L"};function i(e,n,r,i,o,a,s,l,c,u,d){var h=t.util.cos(e),f=t.util.sin(e),p=t.util.cos(n),g=t.util.sin(n),m=r*o*p-i*a*g+s,v=i*o*p+r*a*g+l;return["C",u+c*(-r*o*f-i*a*h),d+c*(-i*o*f+r*a*h),m+c*(r*o*g+i*a*p),v+c*(i*o*g-r*a*p),m,v]}function o(e,t,n,r){var i=Math.atan2(t,e),o=Math.atan2(r,n);return o>=i?o-i:2*Math.PI-(i-o)}function a(e,n,r){for(var a=r[1],s=r[2],l=r[3],c=r[4],u=r[5],d=function(e,n,r,a,s,l,c){var u=Math.PI,d=c*u/180,h=t.util.sin(d),f=t.util.cos(d),p=0,g=0,m=-f*e*.5-h*n*.5,v=-f*n*.5+h*e*.5,y=(r=Math.abs(r))*r,b=(a=Math.abs(a))*a,w=v*v,x=m*m,C=y*b-y*w-b*x,_=0;if(C<0){var S=Math.sqrt(1-C/(y*b));r*=S,a*=S}else _=(s===l?-1:1)*Math.sqrt(C/(y*w+b*x));var A=_*r*v/a,k=-_*a*m/r,E=f*A-h*k+.5*e,I=h*A+f*k+.5*n,j=o(1,0,(m-A)/r,(v-k)/a),T=o((m-A)/r,(v-k)/a,(-m-A)/r,(-v-k)/a);0===l&&T>0?T-=2*u:1===l&&T<0&&(T+=2*u);for(var F=Math.ceil(Math.abs(T/u*2)),O=[],M=T/F,P=8/3*Math.sin(M/4)*Math.sin(M/4)/Math.sin(M/2),R=j+M,L=0;L<F;L++)O[L]=i(j,R,f,h,r,a,E,I,P,p,g),p=O[L][5],g=O[L][6],j=R,R+=M;return O}(r[6]-e,r[7]-n,a,s,c,u,l),h=0,f=d.length;h<f;h++)d[h][1]+=e,d[h][2]+=n,d[h][3]+=e,d[h][4]+=n,d[h][5]+=e,d[h][6]+=n;return d}function s(e,t,n,r){return Math.sqrt((n-e)*(n-e)+(r-t)*(r-t))}function l(e,t,n,r,i,o,a,s){return function(l){var c=function(e){return e*e*e}(l),u=function(e){return 3*e*e*(1-e)}(l),d=function(e){return 3*e*(1-e)*(1-e)}(l),h=function(e){return(1-e)*(1-e)*(1-e)}(l);return{x:a*c+i*u+n*d+e*h,y:s*c+o*u+r*d+t*h}}}function c(e,t,n,r,i,o,a,s){return function(l){var c=1-l,u=3*c*c*(n-e)+6*c*l*(i-n)+3*l*l*(a-i),d=3*c*c*(r-t)+6*c*l*(o-r)+3*l*l*(s-o);return Math.atan2(d,u)}}function u(e,t,n,r,i,o){return function(a){var s=function(e){return e*e}(a),l=function(e){return 2*e*(1-e)}(a),c=function(e){return(1-e)*(1-e)}(a);return{x:i*s+n*l+e*c,y:o*s+r*l+t*c}}}function d(e,t,n,r,i,o){return function(a){var s=1-a,l=2*s*(n-e)+2*a*(i-n),c=2*s*(r-t)+2*a*(o-r);return Math.atan2(c,l)}}function h(e,t,n){var r,i,o={x:t,y:n},a=0;for(i=1;i<=100;i+=1)r=e(i/100),a+=s(o.x,o.y,r.x,r.y),o=r;return a}function f(e,t){for(var n,r,i,o=0,a=0,l=e.iterator,c={x:e.x,y:e.y},u=.01,d=e.angleFinder;a<t&&u>1e-4;)n=l(o),i=o,(r=s(c.x,c.y,n.x,n.y))+a>t?(o-=u,u/=2):(c=n,o+=u,a+=r);return n.angle=d(i),n}function p(e){for(var t,n,r,i,o=0,a=e.length,f=0,p=0,g=0,m=0,v=[],y=0;y<a;y++){switch(r={x:f,y:p,command:(t=e[y])[0]},t[0]){case"M":r.length=0,g=f=t[1],m=p=t[2];break;case"L":r.length=s(f,p,t[1],t[2]),f=t[1],p=t[2];break;case"C":n=l(f,p,t[1],t[2],t[3],t[4],t[5],t[6]),i=c(f,p,t[1],t[2],t[3],t[4],t[5],t[6]),r.iterator=n,r.angleFinder=i,r.length=h(n,f,p),f=t[5],p=t[6];break;case"Q":n=u(f,p,t[1],t[2],t[3],t[4]),i=d(f,p,t[1],t[2],t[3],t[4]),r.iterator=n,r.angleFinder=i,r.length=h(n,f,p),f=t[3],p=t[4];break;case"Z":case"z":r.destX=g,r.destY=m,r.length=s(f,p,g,m),f=g,p=m}o+=r.length,v.push(r)}return v.push({length:o,x:f,y:p}),v}t.util.joinPath=function(e){return e.map(function(e){return e.join(" ")}).join(" ")},t.util.parsePath=function(e){var i,o,a,s,l,c=[],u=[],d=t.rePathCommand,h="[-+]?(?:\\d*\\.\\d+|\\d+\\.?)(?:[eE][-+]?\\d+)?\\s*",f="("+h+")"+t.commaWsp,p="([01])"+t.commaWsp+"?",g=new RegExp(f+"?"+f+"?"+f+p+p+f+"?("+h+")","g");if(!e||!e.match)return c;for(var m,v=0,y=(l=e.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi)).length;v<y;v++){s=(i=l[v]).slice(1).trim(),u.length=0;var b=i.charAt(0);if(m=[b],"a"===b.toLowerCase())for(var w;w=g.exec(s);)for(var x=1;x<w.length;x++)u.push(w[x]);else for(;a=d.exec(s);)u.push(a[0]);x=0;for(var C=u.length;x<C;x++)o=parseFloat(u[x]),isNaN(o)||m.push(o);var _=n[b.toLowerCase()],S=r[b]||b;if(m.length-1>_)for(var A=1,k=m.length;A<k;A+=_)c.push([b].concat(m.slice(A,A+_))),b=S;else c.push(m)}return c},t.util.makePathSimpler=function(e){var t,n,r,i,o,s,l=0,c=0,u=e.length,d=0,h=0,f=[];for(n=0;n<u;++n){switch(r=!1,(t=e[n].slice(0))[0]){case"l":t[0]="L",t[1]+=l,t[2]+=c;case"L":l=t[1],c=t[2];break;case"h":t[1]+=l;case"H":t[0]="L",t[2]=c,l=t[1];break;case"v":t[1]+=c;case"V":t[0]="L",c=t[1],t[1]=l,t[2]=c;break;case"m":t[0]="M",t[1]+=l,t[2]+=c;case"M":l=t[1],c=t[2],d=t[1],h=t[2];break;case"c":t[0]="C",t[1]+=l,t[2]+=c,t[3]+=l,t[4]+=c,t[5]+=l,t[6]+=c;case"C":o=t[3],s=t[4],l=t[5],c=t[6];break;case"s":t[0]="S",t[1]+=l,t[2]+=c,t[3]+=l,t[4]+=c;case"S":"C"===i?(o=2*l-o,s=2*c-s):(o=l,s=c),l=t[3],c=t[4],t[0]="C",t[5]=t[3],t[6]=t[4],t[3]=t[1],t[4]=t[2],t[1]=o,t[2]=s,o=t[3],s=t[4];break;case"q":t[0]="Q",t[1]+=l,t[2]+=c,t[3]+=l,t[4]+=c;case"Q":o=t[1],s=t[2],l=t[3],c=t[4];break;case"t":t[0]="T",t[1]+=l,t[2]+=c;case"T":"Q"===i?(o=2*l-o,s=2*c-s):(o=l,s=c),t[0]="Q",l=t[1],c=t[2],t[1]=o,t[2]=s,t[3]=l,t[4]=c;break;case"a":t[0]="A",t[6]+=l,t[7]+=c;case"A":r=!0,f=f.concat(a(l,c,t)),l=t[6],c=t[7];break;case"z":case"Z":l=d,c=h}r||f.push(t),i=t[0]}return f},t.util.getSmoothPathFromPoints=function(e,n){var r,i=[],o=new t.Point(e[0].x,e[0].y),a=new t.Point(e[1].x,e[1].y),s=e.length,l=1,c=0,u=s>2;for(n=n||0,u&&(l=e[2].x<a.x?-1:e[2].x===a.x?0:1,c=e[2].y<a.y?-1:e[2].y===a.y?0:1),i.push(["M",o.x-l*n,o.y-c*n]),r=1;r<s;r++){if(!o.eq(a)){var d=o.midPointFrom(a);i.push(["Q",o.x,o.y,d.x,d.y])}o=e[r],r+1<e.length&&(a=e[r+1])}return u&&(l=o.x>e[r-2].x?1:o.x===e[r-2].x?0:-1,c=o.y>e[r-2].y?1:o.y===e[r-2].y?0:-1),i.push(["L",o.x+l*n,o.y+c*n]),i},t.util.getPathSegmentsInfo=p,t.util.getBoundsOfCurve=function(n,r,i,o,a,s,l,c){var u;if(t.cachesBoundsOfCurve&&(u=e.call(arguments),t.boundsOfCurveCache[u]))return t.boundsOfCurveCache[u];var d,h,f,p,g,m,v,y,b=Math.sqrt,w=Math.min,x=Math.max,C=Math.abs,_=[],S=[[],[]];h=6*n-12*i+6*a,d=-3*n+9*i-9*a+3*l,f=3*i-3*n;for(var A=0;A<2;++A)if(A>0&&(h=6*r-12*o+6*s,d=-3*r+9*o-9*s+3*c,f=3*o-3*r),C(d)<1e-12){if(C(h)<1e-12)continue;0<(p=-f/h)&&p<1&&_.push(p)}else!((v=h*h-4*f*d)<0)&&(0<(g=(-h+(y=b(v)))/(2*d))&&g<1&&_.push(g),0<(m=(-h-y)/(2*d))&&m<1&&_.push(m));for(var k,E,I,j=_.length,T=j;j--;)k=(I=1-(p=_[j]))*I*I*n+3*I*I*p*i+3*I*p*p*a+p*p*p*l,S[0][j]=k,E=I*I*I*r+3*I*I*p*o+3*I*p*p*s+p*p*p*c,S[1][j]=E;S[0][T]=n,S[1][T]=r,S[0][T+1]=l,S[1][T+1]=c;var F=[{x:w.apply(null,S[0]),y:w.apply(null,S[1])},{x:x.apply(null,S[0]),y:x.apply(null,S[1])}];return t.cachesBoundsOfCurve&&(t.boundsOfCurveCache[u]=F),F},t.util.getPointOnPath=function(e,n,r){r||(r=p(e));for(var i=0;n-r[i].length>0&&i<r.length-2;)n-=r[i].length,i++;var o,a=r[i],s=n/a.length,l=a.command,c=e[i];switch(l){case"M":return{x:a.x,y:a.y,angle:0};case"Z":case"z":return(o=new t.Point(a.x,a.y).lerp(new t.Point(a.destX,a.destY),s)).angle=Math.atan2(a.destY-a.y,a.destX-a.x),o;case"L":return(o=new t.Point(a.x,a.y).lerp(new t.Point(c[1],c[2]),s)).angle=Math.atan2(c[2]-a.y,c[1]-a.x),o;case"C":case"Q":return f(a,n)}},t.util.transformPath=function(e,n,r){return r&&(n=t.util.multiplyTransformMatrices(n,[1,0,0,1,-r.x,-r.y])),e.map(function(e){for(var r=e.slice(0),i={},o=1;o<e.length-1;o+=2)i.x=e[o],i.y=e[o+1],i=t.util.transformPoint(i,n),r[o]=i.x,r[o+1]=i.y;return r})}}(),function(){var e=Array.prototype.slice;function n(e,t,n){if(e&&0!==e.length){var r=e.length-1,i=t?e[r][t]:e[r];if(t)for(;r--;)n(e[r][t],i)&&(i=e[r][t]);else for(;r--;)n(e[r],i)&&(i=e[r]);return i}}t.util.array={fill:function(e,t){for(var n=e.length;n--;)e[n]=t;return e},invoke:function(t,n){for(var r=e.call(arguments,2),i=[],o=0,a=t.length;o<a;o++)i[o]=r.length?t[o][n].apply(t[o],r):t[o][n].call(t[o]);return i},min:function(e,t){return n(e,t,function(e,t){return e<t})},max:function(e,t){return n(e,t,function(e,t){return e>=t})}}}(),function(){function e(n,r,i){if(i)if(!t.isLikelyNode&&r instanceof Element)n=r;else if(r instanceof Array){n=[];for(var o=0,a=r.length;o<a;o++)n[o]=e({},r[o],i)}else if(r&&"object"==typeof r)for(var s in r)"canvas"===s||"group"===s?n[s]=null:r.hasOwnProperty(s)&&(n[s]=e({},r[s],i));else n=r;else for(var s in r)n[s]=r[s];return n}t.util.object={extend:e,clone:function(t,n){return e({},t,n)}},t.util.object.extend(t.util,t.Observable)}(),function(){function e(e,t){var n=e.charCodeAt(t);if(isNaN(n))return"";if(n<55296||n>57343)return e.charAt(t);if(55296<=n&&n<=56319){if(e.length<=t+1)throw"High surrogate without following low surrogate";var r=e.charCodeAt(t+1);if(56320>r||r>57343)throw"High surrogate without following low surrogate";return e.charAt(t)+e.charAt(t+1)}if(0===t)throw"Low surrogate without preceding high surrogate";var i=e.charCodeAt(t-1);if(55296>i||i>56319)throw"Low surrogate without preceding high surrogate";return!1}t.util.string={camelize:function(e){return e.replace(/-+(.)?/g,function(e,t){return t?t.toUpperCase():""})},capitalize:function(e,t){return e.charAt(0).toUpperCase()+(t?e.slice(1):e.slice(1).toLowerCase())},escapeXml:function(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")},graphemeSplit:function(t){var n,r=0,i=[];for(r=0;r<t.length;r++)!1!==(n=e(t,r))&&i.push(n);return i}}}(),function(){var e=Array.prototype.slice,n=function(){},r=function(){for(var e in{toString:1})if("toString"===e)return!1;return!0}(),i=function(e,t,n){for(var i in t)i in e.prototype&&"function"==typeof e.prototype[i]&&(t[i]+"").indexOf("callSuper")>-1?e.prototype[i]=function(e){return function(){var r=this.constructor.superclass;this.constructor.superclass=n;var i=t[e].apply(this,arguments);if(this.constructor.superclass=r,"initialize"!==e)return i}}(i):e.prototype[i]=t[i],r&&(t.toString!==Object.prototype.toString&&(e.prototype.toString=t.toString),t.valueOf!==Object.prototype.valueOf&&(e.prototype.valueOf=t.valueOf))};function o(){}function a(t){for(var n=null,r=this;r.constructor.superclass;){var i=r.constructor.superclass.prototype[t];if(r[t]!==i){n=i;break}r=r.constructor.superclass.prototype}return n?arguments.length>1?n.apply(this,e.call(arguments,1)):n.call(this):void 0}t.util.createClass=function(){var t=null,r=e.call(arguments,0);function s(){this.initialize.apply(this,arguments)}"function"==typeof r[0]&&(t=r.shift()),s.superclass=t,s.subclasses=[],t&&(o.prototype=t.prototype,s.prototype=new o,t.subclasses.push(s));for(var l=0,c=r.length;l<c;l++)i(s,r[l],t);return s.prototype.initialize||(s.prototype.initialize=n),s.prototype.constructor=s,s.prototype.callSuper=a,s}}(),function(){var e=!!t.document.createElement("div").attachEvent,n=["touchstart","touchmove","touchend"];t.util.addListener=function(t,n,r,i){t&&t.addEventListener(n,r,!e&&i)},t.util.removeListener=function(t,n,r,i){t&&t.removeEventListener(n,r,!e&&i)},t.util.getPointer=function(e){var n=e.target,r=t.util.getScrollLeftTop(n),i=function(e){var t=e.changedTouches;return t&&t[0]?t[0]:e}(e);return{x:i.clientX+r.left,y:i.clientY+r.top}},t.util.isTouchEvent=function(e){return n.indexOf(e.type)>-1||"touch"===e.pointerType}}(),function(){var e=t.document.createElement("div"),n="string"==typeof e.style.opacity,r="string"==typeof e.style.filter,i=/alpha\s*\(\s*opacity\s*=\s*([^\)]+)\)/,o=function(e){return e};n?o=function(e,t){return e.style.opacity=t,e}:r&&(o=function(e,t){var n=e.style;return e.currentStyle&&!e.currentStyle.hasLayout&&(n.zoom=1),i.test(n.filter)?(t=t>=.9999?"":"alpha(opacity="+100*t+")",n.filter=n.filter.replace(i,t)):n.filter+=" alpha(opacity="+100*t+")",e}),t.util.setStyle=function(e,t){var n=e.style;if(!n)return e;if("string"==typeof t)return e.style.cssText+=";"+t,t.indexOf("opacity")>-1?o(e,t.match(/opacity:\s*(\d?\.?\d*)/)[1]):e;for(var r in t)if("opacity"===r)o(e,t[r]);else{var i="float"===r||"cssFloat"===r?typeof n.styleFloat>"u"?"cssFloat":"styleFloat":r;n.setProperty(i,t[r])}return e}}(),function(){var e,n,r,i,o=Array.prototype.slice,a=function(e){return o.call(e,0)};try{e=a(t.document.childNodes)instanceof Array}catch{}function s(e,n){var r=t.document.createElement(e);for(var i in n)"class"===i?r.className=n[i]:"for"===i?r.htmlFor=n[i]:r.setAttribute(i,n[i]);return r}function l(e){for(var n=0,r=0,i=t.document.documentElement,o=t.document.body||{scrollLeft:0,scrollTop:0};e&&(e.parentNode||e.host)&&((e=e.parentNode||e.host)===t.document?(n=o.scrollLeft||i.scrollLeft||0,r=o.scrollTop||i.scrollTop||0):(n+=e.scrollLeft||0,r+=e.scrollTop||0),1!==e.nodeType||"fixed"!==e.style.position););return{left:n,top:r}}e||(a=function(e){for(var t=new Array(e.length),n=e.length;n--;)t[n]=e[n];return t}),n=t.document.defaultView&&t.document.defaultView.getComputedStyle?function(e,n){var r=t.document.defaultView.getComputedStyle(e,null);return r?r[n]:void 0}:function(e,t){var n=e.style[t];return!n&&e.currentStyle&&(n=e.currentStyle[t]),n},r=t.document.documentElement.style,i="userSelect"in r?"userSelect":"MozUserSelect"in r?"MozUserSelect":"WebkitUserSelect"in r?"WebkitUserSelect":"KhtmlUserSelect"in r?"KhtmlUserSelect":"",t.util.makeElementUnselectable=function(e){return typeof e.onselectstart<"u"&&(e.onselectstart=t.util.falseFunction),i?e.style[i]="none":"string"==typeof e.unselectable&&(e.unselectable="on"),e},t.util.makeElementSelectable=function(e){return typeof e.onselectstart<"u"&&(e.onselectstart=null),i?e.style[i]="":"string"==typeof e.unselectable&&(e.unselectable=""),e},t.util.setImageSmoothing=function(e,t){e.imageSmoothingEnabled=e.imageSmoothingEnabled||e.webkitImageSmoothingEnabled||e.mozImageSmoothingEnabled||e.msImageSmoothingEnabled||e.oImageSmoothingEnabled,e.imageSmoothingEnabled=t},t.util.getById=function(e){return"string"==typeof e?t.document.getElementById(e):e},t.util.toArray=a,t.util.addClass=function(e,t){e&&-1===(" "+e.className+" ").indexOf(" "+t+" ")&&(e.className+=(e.className?" ":"")+t)},t.util.makeElement=s,t.util.wrapElement=function(e,t,n){return"string"==typeof t&&(t=s(t,n)),e.parentNode&&e.parentNode.replaceChild(t,e),t.appendChild(e),t},t.util.getScrollLeftTop=l,t.util.getElementOffset=function(e){var t,r,i=e&&e.ownerDocument,o={left:0,top:0},a={left:0,top:0},s={borderLeftWidth:"left",borderTopWidth:"top",paddingLeft:"left",paddingTop:"top"};if(!i)return a;for(var c in s)a[s[c]]+=parseInt(n(e,c),10)||0;return t=i.documentElement,typeof e.getBoundingClientRect<"u"&&(o=e.getBoundingClientRect()),r=l(e),{left:o.left+r.left-(t.clientLeft||0)+a.left,top:o.top+r.top-(t.clientTop||0)+a.top}},t.util.getNodeCanvas=function(e){var n=t.jsdomImplForWrapper(e);return n._canvas||n._image},t.util.cleanUpJsdomNode=function(e){if(t.isLikelyNode){var n=t.jsdomImplForWrapper(e);n&&(n._image=null,n._canvas=null,n._currentSrc=null,n._attributes=null,n._classList=null)}}}(),function(){function e(){}t.util.request=function(n,r){r||(r={});var i=r.method?r.method.toUpperCase():"GET",o=r.onComplete||function(){},a=new t.window.XMLHttpRequest,s=r.body||r.parameters;return a.onreadystatechange=function(){4===a.readyState&&(o(a),a.onreadystatechange=e)},"GET"===i&&(s=null,"string"==typeof r.parameters&&(n=function(e,t){return e+(/\?/.test(e)?"&":"?")+t}(n,r.parameters))),a.open(i,n,!0),("POST"===i||"PUT"===i)&&a.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),a.send(s),a}}(),t.log=console.log,t.warn=console.warn,function(){var e=t.util.object.extend,n=t.util.object.clone,r=[];function i(){return!1}function o(e,t,n,r){return-n*Math.cos(e/r*(Math.PI/2))+n+t}t.util.object.extend(r,{cancelAll:function(){var e=this.splice(0);return e.forEach(function(e){e.cancel()}),e},cancelByCanvas:function(e){if(!e)return[];var t=this.filter(function(t){return"object"==typeof t.target&&t.target.canvas===e});return t.forEach(function(e){e.cancel()}),t},cancelByTarget:function(e){var t=this.findAnimationsByTarget(e);return t.forEach(function(e){e.cancel()}),t},findAnimationIndex:function(e){return this.indexOf(this.findAnimation(e))},findAnimation:function(e){return this.find(function(t){return t.cancel===e})},findAnimationsByTarget:function(e){return e?this.filter(function(t){return t.target===e}):[]}});var a=t.window.requestAnimationFrame||t.window.webkitRequestAnimationFrame||t.window.mozRequestAnimationFrame||t.window.oRequestAnimationFrame||t.window.msRequestAnimationFrame||function(e){return t.window.setTimeout(e,1e3/60)},s=t.window.cancelAnimationFrame||t.window.clearTimeout;function l(){return a.apply(t.window,arguments)}t.util.animate=function(r){r||(r={});var a,s=!1,c=function(){var e=t.runningAnimations.indexOf(a);return e>-1&&t.runningAnimations.splice(e,1)[0]};return a=e(n(r),{cancel:function(){return s=!0,c()},currentValue:"startValue"in r?r.startValue:0,completionRate:0,durationRate:0}),t.runningAnimations.push(a),l(function(e){var t,n=e||+new Date,u=r.duration||500,d=n+u,h=r.onChange||i,f=r.abort||i,p=r.onComplete||i,g=r.easing||o,m="startValue"in r&&r.startValue.length>0,v="startValue"in r?r.startValue:0,y="endValue"in r?r.endValue:100,b=r.byValue||(m?v.map(function(e,t){return y[t]-v[t]}):y-v);r.onStart&&r.onStart(),function e(r){var i=(t=r||+new Date)>d?u:t-n,o=i/u,w=m?v.map(function(e,t){return g(i,v[t],b[t],u)}):g(i,v,b,u),x=Math.abs(m?(w[0]-v[0])/b[0]:(w-v)/b);if(a.currentValue=m?w.slice():w,a.completionRate=x,a.durationRate=o,!s){if(f(w,x,o))return void c();if(t>d)return a.currentValue=m?y.slice():y,a.completionRate=1,a.durationRate=1,h(m?y.slice():y,1,1),p(y,1,1),void c();h(w,x,o),l(e)}}(n)}),a.cancel},t.util.requestAnimFrame=l,t.util.cancelAnimFrame=function(){return s.apply(t.window,arguments)},t.runningAnimations=r}(),function(){function e(e,t,n){var r="rgba("+parseInt(e[0]+n*(t[0]-e[0]),10)+","+parseInt(e[1]+n*(t[1]-e[1]),10)+","+parseInt(e[2]+n*(t[2]-e[2]),10);return(r+=","+(e&&t?parseFloat(e[3]+n*(t[3]-e[3])):1))+")"}t.util.animateColor=function(n,r,i,o){var a=new t.Color(n).getSource(),s=new t.Color(r).getSource(),l=o.onComplete,c=o.onChange;return o=o||{},t.util.animate(t.util.object.extend(o,{duration:i||500,startValue:a,endValue:s,byValue:s,easing:function(t,n,r,i){return e(n,r,o.colorEasing?o.colorEasing(t,i):1-Math.cos(t/i*(Math.PI/2)))},onComplete:function(t,n,r){if(l)return l(e(s,s,0),n,r)},onChange:function(t,n,r){if(c){if(Array.isArray(t))return c(e(t,t,0),n,r);c(t,n,r)}}}))}}(),function(){function e(e,t,n,r){return e<Math.abs(t)?(e=t,r=n/4):r=0===t&&0===e?n/(2*Math.PI)*Math.asin(1):n/(2*Math.PI)*Math.asin(t/e),{a:e,c:t,p:n,s:r}}function n(e,t,n){return e.a*Math.pow(2,10*(t-=1))*Math.sin((t*n-e.s)*(2*Math.PI)/e.p)}function r(e,t,n,r){return n-i(r-e,0,n,r)+t}function i(e,t,n,r){return(e/=r)<1/2.75?n*(7.5625*e*e)+t:e<2/2.75?n*(7.5625*(e-=1.5/2.75)*e+.75)+t:e<2.5/2.75?n*(7.5625*(e-=2.25/2.75)*e+.9375)+t:n*(7.5625*(e-=2.625/2.75)*e+.984375)+t}t.util.ease={easeInQuad:function(e,t,n,r){return n*(e/=r)*e+t},easeOutQuad:function(e,t,n,r){return-n*(e/=r)*(e-2)+t},easeInOutQuad:function(e,t,n,r){return(e/=r/2)<1?n/2*e*e+t:-n/2*(--e*(e-2)-1)+t},easeInCubic:function(e,t,n,r){return n*(e/=r)*e*e+t},easeOutCubic:function(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t},easeInOutCubic:function(e,t,n,r){return(e/=r/2)<1?n/2*e*e*e+t:n/2*((e-=2)*e*e+2)+t},easeInQuart:function(e,t,n,r){return n*(e/=r)*e*e*e+t},easeOutQuart:function(e,t,n,r){return-n*((e=e/r-1)*e*e*e-1)+t},easeInOutQuart:function(e,t,n,r){return(e/=r/2)<1?n/2*e*e*e*e+t:-n/2*((e-=2)*e*e*e-2)+t},easeInQuint:function(e,t,n,r){return n*(e/=r)*e*e*e*e+t},easeOutQuint:function(e,t,n,r){return n*((e=e/r-1)*e*e*e*e+1)+t},easeInOutQuint:function(e,t,n,r){return(e/=r/2)<1?n/2*e*e*e*e*e+t:n/2*((e-=2)*e*e*e*e+2)+t},easeInSine:function(e,t,n,r){return-n*Math.cos(e/r*(Math.PI/2))+n+t},easeOutSine:function(e,t,n,r){return n*Math.sin(e/r*(Math.PI/2))+t},easeInOutSine:function(e,t,n,r){return-n/2*(Math.cos(Math.PI*e/r)-1)+t},easeInExpo:function(e,t,n,r){return 0===e?t:n*Math.pow(2,10*(e/r-1))+t},easeOutExpo:function(e,t,n,r){return e===r?t+n:n*(1-Math.pow(2,-10*e/r))+t},easeInOutExpo:function(e,t,n,r){return 0===e?t:e===r?t+n:(e/=r/2)<1?n/2*Math.pow(2,10*(e-1))+t:n/2*(2-Math.pow(2,-10*--e))+t},easeInCirc:function(e,t,n,r){return-n*(Math.sqrt(1-(e/=r)*e)-1)+t},easeOutCirc:function(e,t,n,r){return n*Math.sqrt(1-(e=e/r-1)*e)+t},easeInOutCirc:function(e,t,n,r){return(e/=r/2)<1?-n/2*(Math.sqrt(1-e*e)-1)+t:n/2*(Math.sqrt(1-(e-=2)*e)+1)+t},easeInElastic:function(t,r,i,o){var a=0;return 0===t?r:1===(t/=o)?r+i:(a||(a=.3*o),-n(e(i,i,a,1.70158),t,o)+r)},easeOutElastic:function(t,n,r,i){var o=0;if(0===t)return n;if(1===(t/=i))return n+r;o||(o=.3*i);var a=e(r,r,o,1.70158);return a.a*Math.pow(2,-10*t)*Math.sin((t*i-a.s)*(2*Math.PI)/a.p)+a.c+n},easeInOutElastic:function(t,r,i,o){var a=0;if(0===t)return r;if(2===(t/=o/2))return r+i;a||(a=o*(.3*1.5));var s=e(i,i,a,1.70158);return t<1?-.5*n(s,t,o)+r:s.a*Math.pow(2,-10*(t-=1))*Math.sin((t*o-s.s)*(2*Math.PI)/s.p)*.5+s.c+r},easeInBack:function(e,t,n,r,i){return void 0===i&&(i=1.70158),n*(e/=r)*e*((i+1)*e-i)+t},easeOutBack:function(e,t,n,r,i){return void 0===i&&(i=1.70158),n*((e=e/r-1)*e*((i+1)*e+i)+1)+t},easeInOutBack:function(e,t,n,r,i){return void 0===i&&(i=1.70158),(e/=r/2)<1?n/2*(e*e*((1+(i*=1.525))*e-i))+t:n/2*((e-=2)*e*((1+(i*=1.525))*e+i)+2)+t},easeInBounce:r,easeOutBounce:i,easeInOutBounce:function(e,t,n,o){return e<o/2?.5*r(2*e,0,n,o)+t:.5*i(2*e-o,0,n,o)+.5*n+t}}}(),function(e){var t=e.fabric||(e.fabric={}),n=t.util.object.extend,r=t.util.object.clone,i=t.util.toFixed,o=t.util.parseUnit,a=t.util.multiplyTransformMatrices,s={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"},l={stroke:"strokeOpacity",fill:"fillOpacity"},c="font-size",u="clip-path";function d(e){return e in s?s[e]:e}function h(e,n,r,i){var s,l=Array.isArray(n);if("fill"!==e&&"stroke"!==e||"none"!==n){if("strokeUniform"===e)return"non-scaling-stroke"===n;if("strokeDashArray"===e)n="none"===n?null:n.replace(/,/g," ").split(/\s+/).map(parseFloat);else if("transformMatrix"===e)n=r&&r.transformMatrix?a(r.transformMatrix,t.parseTransformAttribute(n)):t.parseTransformAttribute(n);else if("visible"===e)n="none"!==n&&"hidden"!==n,r&&!1===r.visible&&(n=!1);else if("opacity"===e)n=parseFloat(n),r&&typeof r.opacity<"u"&&(n*=r.opacity);else if("textAnchor"===e)n="start"===n?"left":"end"===n?"right":"center";else if("charSpacing"===e)s=o(n,i)/i*1e3;else if("paintFirst"===e){var c=n.indexOf("fill"),u=n.indexOf("stroke");n="fill",(c>-1&&u>-1&&u<c||-1===c&&u>-1)&&(n="stroke")}else{if("href"===e||"xlink:href"===e||"font"===e)return n;if("imageSmoothing"===e)return"optimizeQuality"===n;s=l?n.map(o):o(n,i)}}else n="";return!l&&isNaN(s)?n:s}function f(e){return new RegExp("^("+e.join("|")+")\\b","i")}function p(e,t){var n,r,i,o,a=[];for(i=0,o=t.length;i<o;i++)n=t[i],r=e.getElementsByTagName(n),a=a.concat(Array.prototype.slice.call(r));return a}function g(e,t){var n,r=!0;return(n=m(e,t.pop()))&&t.length&&(r=function(e,t){for(var n,r=!0;e.parentNode&&1===e.parentNode.nodeType&&t.length;)r&&(n=t.pop()),r=m(e=e.parentNode,n);return 0===t.length}(e,t)),n&&r&&0===t.length}function m(e,t){var n,r,i=e.nodeName,o=e.getAttribute("class"),a=e.getAttribute("id");if(n=new RegExp("^"+i,"i"),t=t.replace(n,""),a&&t.length&&(n=new RegExp("#"+a+"(?![a-zA-Z\\-]+)","i"),t=t.replace(n,"")),o&&t.length)for(r=(o=o.split(" ")).length;r--;)n=new RegExp("\\."+o[r]+"(?![a-zA-Z\\-]+)","i"),t=t.replace(n,"");return 0===t.length}function v(e,t){var n;if(e.getElementById&&(n=e.getElementById(t)),n)return n;var r,i,o,a=e.getElementsByTagName("*");for(i=0,o=a.length;i<o;i++)if(t===(r=a[i]).getAttribute("id"))return r}t.svgValidTagNamesRegEx=f(["path","circle","polygon","polyline","ellipse","rect","line","image","text"]),t.svgViewBoxElementsRegEx=f(["symbol","image","marker","pattern","view","svg"]),t.svgInvalidAncestorsRegEx=f(["pattern","defs","symbol","metadata","clipPath","mask","desc"]),t.svgValidParentsRegEx=f(["symbol","g","a","svg","clipPath","defs"]),t.cssRules={},t.gradientDefs={},t.clipPaths={},t.parseTransformAttribute=function(){function e(e,n,r){e[r]=Math.tan(t.util.degreesToRadians(n[0]))}var n=t.iMatrix,r=t.reNum,i=t.commaWsp,o="(?:(?:(matrix)\\s*\\(\\s*("+r+")"+i+"("+r+")"+i+"("+r+")"+i+"("+r+")"+i+"("+r+")"+i+"("+r+")\\s*\\))|(?:(translate)\\s*\\(\\s*("+r+")(?:"+i+"("+r+"))?\\s*\\))|(?:(scale)\\s*\\(\\s*("+r+")(?:"+i+"("+r+"))?\\s*\\))|(?:(rotate)\\s*\\(\\s*("+r+")(?:"+i+"("+r+")"+i+"("+r+"))?\\s*\\))|(?:(skewX)\\s*\\(\\s*("+r+")\\s*\\))|(?:(skewY)\\s*\\(\\s*("+r+")\\s*\\)))",a=new RegExp("^\\s*(?:(?:"+o+"(?:"+i+"*"+o+")*)?)\\s*$"),s=new RegExp(o,"g");return function(r){var i=n.concat(),l=[];if(!r||r&&!a.test(r))return i;r.replace(s,function(r){var a=new RegExp(o).exec(r).filter(function(e){return!!e}),s=a[1],c=a.slice(2).map(parseFloat);switch(s){case"translate":!function(e,t){e[4]=t[0],2===t.length&&(e[5]=t[1])}(i,c);break;case"rotate":c[0]=t.util.degreesToRadians(c[0]),function(e,n){var r=t.util.cos(n[0]),i=t.util.sin(n[0]),o=0,a=0;3===n.length&&(o=n[1],a=n[2]),e[0]=r,e[1]=i,e[2]=-i,e[3]=r,e[4]=o-(r*o-i*a),e[5]=a-(i*o+r*a)}(i,c);break;case"scale":!function(e,t){var n=t[0],r=2===t.length?t[1]:t[0];e[0]=n,e[3]=r}(i,c);break;case"skewX":e(i,c,2);break;case"skewY":e(i,c,1);break;case"matrix":i=c}l.push(i.concat()),i=n.concat()});for(var c=l[0];l.length>1;)l.shift(),c=t.util.multiplyTransformMatrices(c,l[0]);return c}}();var y=new RegExp("^\\s*("+t.reNum+"+)\\s*,?\\s*("+t.reNum+"+)\\s*,?\\s*("+t.reNum+"+)\\s*,?\\s*("+t.reNum+"+)\\s*$");function b(e){if(!t.svgViewBoxElementsRegEx.test(e.nodeName))return{};var n,r,i,a,s,l,c=e.getAttribute("viewBox"),u=1,d=1,h=e.getAttribute("width"),f=e.getAttribute("height"),p=e.getAttribute("x")||0,g=e.getAttribute("y")||0,m=e.getAttribute("preserveAspectRatio")||"",v=!c||!(c=c.match(y)),b=!h||!f||"100%"===h||"100%"===f,w=v&&b,x={},C="",_=0,S=0;if(x.width=0,x.height=0,x.toBeParsed=w,v&&(p||g)&&e.parentNode&&"#document"!==e.parentNode.nodeName&&(C=" translate("+o(p)+" "+o(g)+") ",s=(e.getAttribute("transform")||"")+C,e.setAttribute("transform",s),e.removeAttribute("x"),e.removeAttribute("y")),w)return x;if(v)return x.width=o(h),x.height=o(f),x;if(n=-parseFloat(c[1]),r=-parseFloat(c[2]),i=parseFloat(c[3]),a=parseFloat(c[4]),x.minX=n,x.minY=r,x.viewBoxWidth=i,x.viewBoxHeight=a,b?(x.width=i,x.height=a):(x.width=o(h),x.height=o(f),u=x.width/i,d=x.height/a),"none"!==(m=t.util.parsePreserveAspectRatioAttribute(m)).alignX&&("meet"===m.meetOrSlice&&(d=u=u>d?d:u),"slice"===m.meetOrSlice&&(d=u=u>d?u:d),_=x.width-i*u,S=x.height-a*u,"Mid"===m.alignX&&(_/=2),"Mid"===m.alignY&&(S/=2),"Min"===m.alignX&&(_=0),"Min"===m.alignY&&(S=0)),1===u&&1===d&&0===n&&0===r&&0===p&&0===g)return x;if((p||g)&&"#document"!==e.parentNode.nodeName&&(C=" translate("+o(p)+" "+o(g)+") "),s=C+" matrix("+u+" 0 0 "+d+" "+(n*u+_)+" "+(r*d+S)+") ","svg"===e.nodeName){for(l=e.ownerDocument.createElementNS(t.svgNS,"g");e.firstChild;)l.appendChild(e.firstChild);e.appendChild(l)}else(l=e).removeAttribute("x"),l.removeAttribute("y"),s=l.getAttribute("transform")+s;return l.setAttribute("transform",s),x}function w(e,t){var n="xlink:href",r=v(e,t.getAttribute(n).slice(1));if(r&&r.getAttribute(n)&&w(e,r),["gradientTransform","x1","x2","y1","y2","gradientUnits","cx","cy","r","fx","fy"].forEach(function(e){r&&!t.hasAttribute(e)&&r.hasAttribute(e)&&t.setAttribute(e,r.getAttribute(e))}),!t.children.length)for(var i=r.cloneNode(!0);i.firstChild;)t.appendChild(i.firstChild);t.removeAttribute(n)}t.parseSVGDocument=function(e,n,i,o){if(e){!function(e){for(var n=p(e,["use","svg:use"]),r=0;n.length&&r<n.length;){var i=n[r],o=i.getAttribute("xlink:href")||i.getAttribute("href");if(null===o)return;var a,s,l,c,u=o.slice(1),d=i.getAttribute("x")||0,h=i.getAttribute("y")||0,f=v(e,u).cloneNode(!0),g=(f.getAttribute("transform")||"")+" translate("+d+", "+h+")",m=n.length,y=t.svgNS;if(b(f),/^svg$/i.test(f.nodeName)){var w=f.ownerDocument.createElementNS(y,"g");for(s=0,c=(l=f.attributes).length;s<c;s++)a=l.item(s),w.setAttributeNS(y,a.nodeName,a.nodeValue);for(;f.firstChild;)w.appendChild(f.firstChild);f=w}for(s=0,c=(l=i.attributes).length;s<c;s++)"x"!==(a=l.item(s)).nodeName&&"y"!==a.nodeName&&"xlink:href"!==a.nodeName&&"href"!==a.nodeName&&("transform"===a.nodeName?g=a.nodeValue+" "+g:f.setAttribute(a.nodeName,a.nodeValue));f.setAttribute("transform",g),f.setAttribute("instantiated_by_use","1"),f.removeAttribute("id"),i.parentNode.replaceChild(f,i),n.length===m&&r++}}(e);var a,s,l=t.Object.__uid++,c=b(e),u=t.util.toArray(e.getElementsByTagName("*"));if(c.crossOrigin=o&&o.crossOrigin,c.svgUid=l,0===u.length&&t.isLikelyNode){var d=[];for(a=0,s=(u=e.selectNodes('//*[name(.)!="svg"]')).length;a<s;a++)d[a]=u[a];u=d}var h=u.filter(function(e){return b(e),t.svgValidTagNamesRegEx.test(e.nodeName.replace("svg:",""))&&!function(e,t){for(;e&&(e=e.parentNode);)if(e.nodeName&&t.test(e.nodeName.replace("svg:",""))&&!e.getAttribute("instantiated_by_use"))return!0;return!1}(e,t.svgInvalidAncestorsRegEx)});if(!h||h&&!h.length)return void(n&&n([],{}));var f={};u.filter(function(e){return"clipPath"===e.nodeName.replace("svg:","")}).forEach(function(e){var n=e.getAttribute("id");f[n]=t.util.toArray(e.getElementsByTagName("*")).filter(function(e){return t.svgValidTagNamesRegEx.test(e.nodeName.replace("svg:",""))})}),t.gradientDefs[l]=t.getGradientDefs(e),t.cssRules[l]=t.getCSSRules(e),t.clipPaths[l]=f,t.parseElements(h,function(e,r){n&&(n(e,c,r,u),delete t.gradientDefs[l],delete t.cssRules[l],delete t.clipPaths[l])},r(c),i,o)}};var x=new RegExp("(normal|italic)?\\s*(normal|small-caps)?\\s*(normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900)?\\s*("+t.reNum+"(?:px|cm|mm|em|pt|pc|in)*)(?:\\/(normal|"+t.reNum+"))?\\s+(.*)");n(t,{parseFontDeclaration:function(e,t){var n=e.match(x);if(n){var r=n[1],i=n[3],a=n[4],s=n[5],l=n[6];r&&(t.fontStyle=r),i&&(t.fontWeight=isNaN(parseFloat(i))?i:parseFloat(i)),a&&(t.fontSize=o(a)),l&&(t.fontFamily=l),s&&(t.lineHeight="normal"===s?1:s)}},getGradientDefs:function(e){var t,n=p(e,["linearGradient","radialGradient","svg:linearGradient","svg:radialGradient"]),r=0,i={};for(r=n.length;r--;)(t=n[r]).getAttribute("xlink:href")&&w(e,t),i[t.getAttribute("id")]=t;return i},parseAttributes:function(e,r,a){if(e){var s,f,p,m={};typeof a>"u"&&(a=e.getAttribute("svgUid")),e.parentNode&&t.svgValidParentsRegEx.test(e.parentNode.nodeName)&&(m=t.parseAttributes(e.parentNode,r,a));var v=r.reduce(function(t,n){return(s=e.getAttribute(n))&&(t[n]=s),t},{}),y=n(function(e,n){var r={};for(var i in t.cssRules[n])if(g(e,i.split(" ")))for(var o in t.cssRules[n][i])r[o]=t.cssRules[n][i][o];return r}(e,a),t.parseStyleAttribute(e));v=n(v,y),y[u]&&e.setAttribute(u,y[u]),f=p=m.fontSize||t.Text.DEFAULT_SVG_FONT_SIZE,v[c]&&(v[c]=f=o(v[c],p));var b,w,x={};for(var C in v)w=h(b=d(C),v[C],m,f),x[b]=w;x&&x.font&&t.parseFontDeclaration(x.font,x);var _=n(m,x);return t.svgValidParentsRegEx.test(e.nodeName)?_:function(e){for(var n in l)if(!(typeof e[l[n]]>"u"||""===e[n])){if(typeof e[n]>"u"){if(!t.Object.prototype[n])continue;e[n]=t.Object.prototype[n]}if(0!==e[n].indexOf("url(")){var r=new t.Color(e[n]);e[n]=r.setAlpha(i(r.getAlpha()*e[l[n]],2)).toRgba()}}return e}(_)}},parseElements:function(e,n,r,i,o){new t.ElementsParser(e,n,r,i,o).parse()},parseStyleAttribute:function(e){var t={},n=e.getAttribute("style");return n&&("string"==typeof n?function(e,t){var n,r;e.replace(/;\s*$/,"").split(";").forEach(function(e){var i=e.split(":");n=i[0].trim().toLowerCase(),r=i[1].trim(),t[n]=r})}(n,t):function(e,t){var n,r;for(var i in e)typeof e[i]>"u"||(n=i.toLowerCase(),r=e[i],t[n]=r)}(n,t)),t},parsePointsAttribute:function(e){if(!e)return null;var t,n,r=[];for(t=0,n=(e=(e=e.replace(/,/g," ").trim()).split(/\s+/)).length;t<n;t+=2)r.push({x:parseFloat(e[t]),y:parseFloat(e[t+1])});return r},getCSSRules:function(e){var n,r,i=e.getElementsByTagName("style"),o={};for(n=0,r=i.length;n<r;n++){var a=i[n].textContent;""!==(a=a.replace(/\/\*[\s\S]*?\*\//g,"")).trim()&&a.split("}").filter(function(e){return e.trim()}).forEach(function(e){var i=e.split("{"),a={},s=i[1].trim().split(";").filter(function(e){return e.trim()});for(n=0,r=s.length;n<r;n++){var l=s[n].split(":"),c=l[0].trim(),u=l[1].trim();a[c]=u}(e=i[0].trim()).split(",").forEach(function(e){""!==(e=e.replace(/^svg/i,"").trim())&&(o[e]?t.util.object.extend(o[e],a):o[e]=t.util.object.clone(a))})})}return o},loadSVGFromURL:function(e,n,r,i){e=e.replace(/^\n\s*/,"").trim(),new t.util.request(e,{method:"get",onComplete:function(e){var o=e.responseXML;if(!o||!o.documentElement)return n&&n(null),!1;t.parseSVGDocument(o.documentElement,function(e,t,r,i){n&&n(e,t,r,i)},r,i)}})},loadSVGFromString:function(e,n,r,i){var o=(new t.window.DOMParser).parseFromString(e.trim(),"text/xml");t.parseSVGDocument(o.documentElement,function(e,t,r,i){n(e,t,r,i)},r,i)}})}(e),t.ElementsParser=function(e,t,n,r,i,o){this.elements=e,this.callback=t,this.options=n,this.reviver=r,this.svgUid=n&&n.svgUid||0,this.parsingOptions=i,this.regexUrl=/^url\(['"]?#([^'"]+)['"]?\)/g,this.doc=o},function(e){e.parse=function(){this.instances=new Array(this.elements.length),this.numElements=this.elements.length,this.createObjects()},e.createObjects=function(){var e=this;this.elements.forEach(function(t,n){t.setAttribute("svgUid",e.svgUid),e.createObject(t,n)})},e.findTag=function(e){return t[t.util.string.capitalize(e.tagName.replace("svg:",""))]},e.createObject=function(e,n){var r=this.findTag(e);if(r&&r.fromElement)try{r.fromElement(e,this.createCallback(n,e),this.options)}catch(e){t.log(e)}else this.checkIfDone()},e.createCallback=function(e,n){var r=this;return function(i){var o;r.resolveGradient(i,n,"fill"),r.resolveGradient(i,n,"stroke"),i instanceof t.Image&&i._originalElement&&(o=i.parsePreserveAspectRatioAttribute(n)),i._removeTransformMatrix(o),r.resolveClipPath(i,n),r.reviver&&r.reviver(n,i),r.instances[e]=i,r.checkIfDone()}},e.extractPropertyDefinition=function(e,n,r){var i=e[n],o=this.regexUrl;if(o.test(i)){o.lastIndex=0;var a=o.exec(i)[1];return o.lastIndex=0,t[r][this.svgUid][a]}},e.resolveGradient=function(e,n,r){var i=this.extractPropertyDefinition(e,r,"gradientDefs");if(i){var o=n.getAttribute(r+"-opacity"),a=t.Gradient.fromElement(i,e,o,this.options);e.set(r,a)}},e.createClipPathCallback=function(e,t){return function(e){e._removeTransformMatrix(),e.fillRule=e.clipRule,t.push(e)}},e.resolveClipPath=function(e,n){var r,i,o,a,s=this.extractPropertyDefinition(e,"clipPath","clipPaths");if(s){o=[],i=t.util.invertTransform(e.calcTransformMatrix());for(var l=s[0].parentNode,c=n;c.parentNode&&c.getAttribute("clip-path")!==e.clipPath;)c=c.parentNode;c.parentNode.appendChild(l);for(var u=0;u<s.length;u++)r=s[u],this.findTag(r).fromElement(r,this.createClipPathCallback(e,o),this.options);s=1===o.length?o[0]:new t.Group(o),a=t.util.multiplyTransformMatrices(i,s.calcTransformMatrix()),s.clipPath&&this.resolveClipPath(s,c);var d=t.util.qrDecompose(a);s.flipX=!1,s.flipY=!1,s.set("scaleX",d.scaleX),s.set("scaleY",d.scaleY),s.angle=d.angle,s.skewX=d.skewX,s.skewY=0,s.setPositionByOrigin({x:d.translateX,y:d.translateY},"center","center"),e.clipPath=s}else delete e.clipPath},e.checkIfDone=function(){0===--this.numElements&&(this.instances=this.instances.filter(function(e){return null!=e}),this.callback(this.instances,this.elements))}}(t.ElementsParser.prototype),function(e){var t=e.fabric||(e.fabric={});function n(e,t){this.x=e,this.y=t}t.Point?t.warn("fabric.Point is already defined"):(t.Point=n,n.prototype={type:"point",constructor:n,add:function(e){return new n(this.x+e.x,this.y+e.y)},addEquals:function(e){return this.x+=e.x,this.y+=e.y,this},scalarAdd:function(e){return new n(this.x+e,this.y+e)},scalarAddEquals:function(e){return this.x+=e,this.y+=e,this},subtract:function(e){return new n(this.x-e.x,this.y-e.y)},subtractEquals:function(e){return this.x-=e.x,this.y-=e.y,this},scalarSubtract:function(e){return new n(this.x-e,this.y-e)},scalarSubtractEquals:function(e){return this.x-=e,this.y-=e,this},multiply:function(e){return new n(this.x*e,this.y*e)},multiplyEquals:function(e){return this.x*=e,this.y*=e,this},divide:function(e){return new n(this.x/e,this.y/e)},divideEquals:function(e){return this.x/=e,this.y/=e,this},eq:function(e){return this.x===e.x&&this.y===e.y},lt:function(e){return this.x<e.x&&this.y<e.y},lte:function(e){return this.x<=e.x&&this.y<=e.y},gt:function(e){return this.x>e.x&&this.y>e.y},gte:function(e){return this.x>=e.x&&this.y>=e.y},lerp:function(e,t){return typeof t>"u"&&(t=.5),t=Math.max(Math.min(1,t),0),new n(this.x+(e.x-this.x)*t,this.y+(e.y-this.y)*t)},distanceFrom:function(e){var t=this.x-e.x,n=this.y-e.y;return Math.sqrt(t*t+n*n)},midPointFrom:function(e){return this.lerp(e)},min:function(e){return new n(Math.min(this.x,e.x),Math.min(this.y,e.y))},max:function(e){return new n(Math.max(this.x,e.x),Math.max(this.y,e.y))},toString:function(){return this.x+","+this.y},setXY:function(e,t){return this.x=e,this.y=t,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setFromPoint:function(e){return this.x=e.x,this.y=e.y,this},swap:function(e){var t=this.x,n=this.y;this.x=e.x,this.y=e.y,e.x=t,e.y=n},clone:function(){return new n(this.x,this.y)}})}(e),function(e){var t=e.fabric||(e.fabric={});function n(e){this.status=e,this.points=[]}t.Intersection?t.warn("fabric.Intersection is already defined"):(t.Intersection=n,t.Intersection.prototype={constructor:n,appendPoint:function(e){return this.points.push(e),this},appendPoints:function(e){return this.points=this.points.concat(e),this}},t.Intersection.intersectLineLine=function(e,r,i,o){var a,s=(o.x-i.x)*(e.y-i.y)-(o.y-i.y)*(e.x-i.x),l=(r.x-e.x)*(e.y-i.y)-(r.y-e.y)*(e.x-i.x),c=(o.y-i.y)*(r.x-e.x)-(o.x-i.x)*(r.y-e.y);if(0!==c){var u=s/c,d=l/c;0<=u&&u<=1&&0<=d&&d<=1?(a=new n("Intersection")).appendPoint(new t.Point(e.x+u*(r.x-e.x),e.y+u*(r.y-e.y))):a=new n}else a=new n(0===s||0===l?"Coincident":"Parallel");return a},t.Intersection.intersectLinePolygon=function(e,t,r){var i,o,a,s,l=new n,c=r.length;for(s=0;s<c;s++)i=r[s],o=r[(s+1)%c],a=n.intersectLineLine(e,t,i,o),l.appendPoints(a.points);return l.points.length>0&&(l.status="Intersection"),l},t.Intersection.intersectPolygonPolygon=function(e,t){var r,i=new n,o=e.length;for(r=0;r<o;r++){var a=e[r],s=e[(r+1)%o],l=n.intersectLinePolygon(a,s,t);i.appendPoints(l.points)}return i.points.length>0&&(i.status="Intersection"),i},t.Intersection.intersectPolygonRectangle=function(e,r,i){var o=r.min(i),a=r.max(i),s=new t.Point(a.x,o.y),l=new t.Point(o.x,a.y),c=n.intersectLinePolygon(o,s,e),u=n.intersectLinePolygon(s,a,e),d=n.intersectLinePolygon(a,l,e),h=n.intersectLinePolygon(l,o,e),f=new n;return f.appendPoints(c.points),f.appendPoints(u.points),f.appendPoints(d.points),f.appendPoints(h.points),f.points.length>0&&(f.status="Intersection"),f})}(e),function(e){var t=e.fabric||(e.fabric={});function n(e){e?this._tryParsingColor(e):this.setSource([0,0,0,1])}function r(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}t.Color?t.warn("fabric.Color is already defined."):(t.Color=n,t.Color.prototype={_tryParsingColor:function(e){var t;e in n.colorNameMap&&(e=n.colorNameMap[e]),"transparent"===e&&(t=[255,255,255,0]),t||(t=n.sourceFromHex(e)),t||(t=n.sourceFromRgb(e)),t||(t=n.sourceFromHsl(e)),t||(t=[0,0,0,1]),t&&this.setSource(t)},_rgbToHsl:function(e,n,r){e/=255,n/=255,r/=255;var i,o,a,s=t.util.array.max([e,n,r]),l=t.util.array.min([e,n,r]);if(a=(s+l)/2,s===l)i=o=0;else{var c=s-l;switch(o=a>.5?c/(2-s-l):c/(s+l),s){case e:i=(n-r)/c+(n<r?6:0);break;case n:i=(r-e)/c+2;break;case r:i=(e-n)/c+4}i/=6}return[Math.round(360*i),Math.round(100*o),Math.round(100*a)]},getSource:function(){return this._source},setSource:function(e){this._source=e},toRgb:function(){var e=this.getSource();return"rgb("+e[0]+","+e[1]+","+e[2]+")"},toRgba:function(){var e=this.getSource();return"rgba("+e[0]+","+e[1]+","+e[2]+","+e[3]+")"},toHsl:function(){var e=this.getSource(),t=this._rgbToHsl(e[0],e[1],e[2]);return"hsl("+t[0]+","+t[1]+"%,"+t[2]+"%)"},toHsla:function(){var e=this.getSource(),t=this._rgbToHsl(e[0],e[1],e[2]);return"hsla("+t[0]+","+t[1]+"%,"+t[2]+"%,"+e[3]+")"},toHex:function(){var e,t,n,r=this.getSource();return e=1===(e=r[0].toString(16)).length?"0"+e:e,t=1===(t=r[1].toString(16)).length?"0"+t:t,n=1===(n=r[2].toString(16)).length?"0"+n:n,e.toUpperCase()+t.toUpperCase()+n.toUpperCase()},toHexa:function(){var e,t=this.getSource();return e=1===(e=(e=Math.round(255*t[3])).toString(16)).length?"0"+e:e,this.toHex()+e.toUpperCase()},getAlpha:function(){return this.getSource()[3]},setAlpha:function(e){var t=this.getSource();return t[3]=e,this.setSource(t),this},toGrayscale:function(){var e=this.getSource(),t=parseInt((.3*e[0]+.59*e[1]+.11*e[2]).toFixed(0),10),n=e[3];return this.setSource([t,t,t,n]),this},toBlackWhite:function(e){var t=this.getSource(),n=(.3*t[0]+.59*t[1]+.11*t[2]).toFixed(0),r=t[3];return e=e||127,n=Number(n)<Number(e)?0:255,this.setSource([n,n,n,r]),this},overlayWith:function(e){e instanceof n||(e=new n(e));var t,r=[],i=this.getAlpha(),o=this.getSource(),a=e.getSource();for(t=0;t<3;t++)r.push(Math.round(.5*o[t]+.5*a[t]));return r[3]=i,this.setSource(r),this}},t.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,t.Color.reHSLa=/^hsla?\(\s*(\d{1,3})\s*,\s*(\d{1,3}\%)\s*,\s*(\d{1,3}\%)\s*(?:\s*,\s*(\d+(?:\.\d+)?)\s*)?\)$/i,t.Color.reHex=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,t.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"},t.Color.fromRgb=function(e){return n.fromSource(n.sourceFromRgb(e))},t.Color.sourceFromRgb=function(e){var t=e.match(n.reRGBa);if(t){var r=parseInt(t[1],10)/(/%$/.test(t[1])?100:1)*(/%$/.test(t[1])?255:1),i=parseInt(t[2],10)/(/%$/.test(t[2])?100:1)*(/%$/.test(t[2])?255:1),o=parseInt(t[3],10)/(/%$/.test(t[3])?100:1)*(/%$/.test(t[3])?255:1);return[parseInt(r,10),parseInt(i,10),parseInt(o,10),t[4]?parseFloat(t[4]):1]}},t.Color.fromRgba=n.fromRgb,t.Color.fromHsl=function(e){return n.fromSource(n.sourceFromHsl(e))},t.Color.sourceFromHsl=function(e){var t=e.match(n.reHSLa);if(t){var i,o,a,s=(parseFloat(t[1])%360+360)%360/360,l=parseFloat(t[2])/(/%$/.test(t[2])?100:1),c=parseFloat(t[3])/(/%$/.test(t[3])?100:1);if(0===l)i=o=a=c;else{var u=c<=.5?c*(l+1):c+l-c*l,d=2*c-u;i=r(d,u,s+1/3),o=r(d,u,s),a=r(d,u,s-1/3)}return[Math.round(255*i),Math.round(255*o),Math.round(255*a),t[4]?parseFloat(t[4]):1]}},t.Color.fromHsla=n.fromHsl,t.Color.fromHex=function(e){return n.fromSource(n.sourceFromHex(e))},t.Color.sourceFromHex=function(e){if(e.match(n.reHex)){var t=e.slice(e.indexOf("#")+1),r=3===t.length||4===t.length,i=8===t.length||4===t.length,o=r?t.charAt(0)+t.charAt(0):t.substring(0,2),a=r?t.charAt(1)+t.charAt(1):t.substring(2,4),s=r?t.charAt(2)+t.charAt(2):t.substring(4,6),l=i?r?t.charAt(3)+t.charAt(3):t.substring(6,8):"FF";return[parseInt(o,16),parseInt(a,16),parseInt(s,16),parseFloat((parseInt(l,16)/255).toFixed(2))]}},t.Color.fromSource=function(e){var t=new n;return t.setSource(e),t})}(e),function(e){var t=e.fabric||(e.fabric={}),n=["e","se","s","sw","w","nw","n","ne","e"],r=["ns","nesw","ew","nwse"],i={},o="left",a="top",s="right",l="bottom",c="center",u={top:l,bottom:a,left:s,right:o,center:c},d=t.util.radiansToDegrees,h=Math.sign||function(e){return(e>0)-(e<0)||+e};function f(e,t){var n=e.angle+d(Math.atan2(t.y,t.x))+360;return Math.round(n%360/45)}function p(e,n){var r=n.transform.target,i=r.canvas,o=t.util.object.clone(n);o.target=r,i&&i.fire("object:"+e,o),r.fire(e,n)}function g(e,t){var n=t.canvas,r=e[n.uniScaleKey];return n.uniformScaling&&!r||!n.uniformScaling&&r}function m(e){return e.originX===c&&e.originY===c}function v(e,t,n){var r=e.lockScalingX,i=e.lockScalingY;return!!(r&&i||!t&&(r||i)&&n||r&&"x"===t||i&&"y"===t)}function y(e,t,n,r){return{e:e,transform:t,pointer:{x:n,y:r}}}function b(e){return function(t,n,r,i){var o=n.target,a=o.getCenterPoint(),s=o.translateToOriginPoint(a,n.originX,n.originY),l=e(t,n,r,i);return o.setPositionByOrigin(s,n.originX,n.originY),l}}function w(e,t){return function(n,r,i,o){var a=t(n,r,i,o);return a&&p(e,y(n,r,i,o)),a}}function x(e,n,r,i,o){var a=e.target,s=a.controls[e.corner],l=a.canvas.getZoom(),c=a.padding/l,u=a.toLocalPoint(new t.Point(i,o),n,r);return u.x>=c&&(u.x-=c),u.x<=-c&&(u.x+=c),u.y>=c&&(u.y-=c),u.y<=c&&(u.y+=c),u.x-=s.offsetX,u.y-=s.offsetY,u}function C(e){return e.flipX!==e.flipY}function _(e,t,n,r,i){if(0!==e[t]){var o=i/e._getTransformedDimensions()[r]*e[n];e.set(n,o)}}function S(e,t,n,r){var i,c=t.target,u=c._getTransformedDimensions(0,c.skewY),h=x(t,t.originX,t.originY,n,r),f=Math.abs(2*h.x)-u.x,p=c.skewX;f<2?i=0:(i=d(Math.atan2(f/c.scaleX,u.y/c.scaleY)),t.originX===o&&t.originY===l&&(i=-i),t.originX===s&&t.originY===a&&(i=-i),C(c)&&(i=-i));var g=p!==i;if(g){var m=c._getTransformedDimensions().y;c.set("skewX",i),_(c,"skewY","scaleY","y",m)}return g}function A(e,t,n,r){var i,c=t.target,u=c._getTransformedDimensions(c.skewX,0),h=x(t,t.originX,t.originY,n,r),f=Math.abs(2*h.y)-u.y,p=c.skewY;f<2?i=0:(i=d(Math.atan2(f/c.scaleY,u.x/c.scaleX)),t.originX===o&&t.originY===l&&(i=-i),t.originX===s&&t.originY===a&&(i=-i),C(c)&&(i=-i));var g=p!==i;if(g){var m=c._getTransformedDimensions().x;c.set("skewY",i),_(c,"skewX","scaleX","x",m)}return g}function k(e,t,n,r,i){i=i||{};var o,a,s,l,c,d,f=t.target,p=f.lockScalingX,y=f.lockScalingY,b=i.by,w=g(e,f),C=v(f,b,w),_=t.gestureScale;if(C)return!1;if(_)a=t.scaleX*_,s=t.scaleY*_;else{if(o=x(t,t.originX,t.originY,n,r),c="y"!==b?h(o.x):1,d="x"!==b?h(o.y):1,t.signX||(t.signX=c),t.signY||(t.signY=d),f.lockScalingFlip&&(t.signX!==c||t.signY!==d))return!1;if(l=f._getTransformedDimensions(),w&&!b){var S=Math.abs(o.x)+Math.abs(o.y),A=t.original,k=S/(Math.abs(l.x*A.scaleX/f.scaleX)+Math.abs(l.y*A.scaleY/f.scaleY));a=A.scaleX*k,s=A.scaleY*k}else a=Math.abs(o.x*f.scaleX/l.x),s=Math.abs(o.y*f.scaleY/l.y);m(t)&&(a*=2,s*=2),t.signX!==c&&"y"!==b&&(t.originX=u[t.originX],a*=-1,t.signX=c),t.signY!==d&&"x"!==b&&(t.originY=u[t.originY],s*=-1,t.signY=d)}var E=f.scaleX,I=f.scaleY;return b?("x"===b&&f.set("scaleX",a),"y"===b&&f.set("scaleY",s)):(!p&&f.set("scaleX",a),!y&&f.set("scaleY",s)),E!==f.scaleX||I!==f.scaleY}i.scaleCursorStyleHandler=function(e,t,r){var i=g(e,r),o="";if(0!==t.x&&0===t.y?o="x":0===t.x&&0!==t.y&&(o="y"),v(r,o,i))return"not-allowed";var a=f(r,t);return n[a]+"-resize"},i.skewCursorStyleHandler=function(e,t,n){if(0!==t.x&&n.lockSkewingY||0!==t.y&&n.lockSkewingX)return"not-allowed";var i=f(n,t)%4;return r[i]+"-resize"},i.scaleSkewCursorStyleHandler=function(e,t,n){return e[n.canvas.altActionKey]?i.skewCursorStyleHandler(e,t,n):i.scaleCursorStyleHandler(e,t,n)},i.rotationWithSnapping=w("rotating",b(function(e,t,n,r){var i=t,o=i.target,a=o.translateToOriginPoint(o.getCenterPoint(),i.originX,i.originY);if(o.lockRotation)return!1;var s,l=Math.atan2(i.ey-a.y,i.ex-a.x),c=Math.atan2(r-a.y,n-a.x),u=d(c-l+i.theta);if(o.snapAngle>0){var h=o.snapAngle,f=o.snapThreshold||h,p=Math.ceil(u/h)*h,g=Math.floor(u/h)*h;Math.abs(u-g)<f?u=g:Math.abs(u-p)<f&&(u=p)}return u<0&&(u=360+u),u%=360,s=o.angle!==u,o.angle=u,s})),i.scalingEqually=w("scaling",b(function(e,t,n,r){return k(e,t,n,r)})),i.scalingX=w("scaling",b(function(e,t,n,r){return k(e,t,n,r,{by:"x"})})),i.scalingY=w("scaling",b(function(e,t,n,r){return k(e,t,n,r,{by:"y"})})),i.scalingYOrSkewingX=function(e,t,n,r){return e[t.target.canvas.altActionKey]?i.skewHandlerX(e,t,n,r):i.scalingY(e,t,n,r)},i.scalingXOrSkewingY=function(e,t,n,r){return e[t.target.canvas.altActionKey]?i.skewHandlerY(e,t,n,r):i.scalingX(e,t,n,r)},i.changeWidth=w("resizing",b(function(e,t,n,r){var i=t.target,o=x(t,t.originX,t.originY,n,r),a=i.strokeWidth/(i.strokeUniform?i.scaleX:1),s=m(t)?2:1,l=i.width,c=Math.abs(o.x*s/i.scaleX)-a;return i.set("width",Math.max(c,0)),l!==c})),i.skewHandlerX=function(e,t,n,r){var i,l=t.target,u=l.skewX,d=t.originY;return!l.lockSkewingX&&(0===u?i=x(t,c,c,n,r).x>0?o:s:(u>0&&(i=d===a?o:s),u<0&&(i=d===a?s:o),C(l)&&(i=i===o?s:o)),t.originX=i,w("skewing",b(S))(e,t,n,r))},i.skewHandlerY=function(e,t,n,r){var i,s=t.target,u=s.skewY,d=t.originX;return!s.lockSkewingY&&(0===u?i=x(t,c,c,n,r).y>0?a:l:(u>0&&(i=d===o?a:l),u<0&&(i=d===o?l:a),C(s)&&(i=i===a?l:a)),t.originY=i,w("skewing",b(A))(e,t,n,r))},i.dragHandler=function(e,t,n,r){var i=t.target,o=n-t.offsetX,a=r-t.offsetY,s=!i.get("lockMovementX")&&i.left!==o,l=!i.get("lockMovementY")&&i.top!==a;return s&&i.set("left",o),l&&i.set("top",a),(s||l)&&p("moving",y(e,t,n,r)),s||l},i.scaleOrSkewActionName=function(e,t,n){var r=e[n.canvas.altActionKey];return 0===t.x?r?"skewX":"scaleY":0===t.y?r?"skewY":"scaleX":void 0},i.rotationStyleHandler=function(e,t,n){return n.lockRotation?"not-allowed":t.cursorStyle},i.fireEvent=p,i.wrapWithFixedAnchor=b,i.wrapWithFireEvent=w,i.getLocalPoint=x,t.controlsUtils=i}(e),function(e){var t=e.fabric||(e.fabric={}),n=t.util.degreesToRadians,r=t.controlsUtils;r.renderCircleControl=function(e,t,n,r,i){r=r||{};var o,a=this.sizeX||r.cornerSize||i.cornerSize,s=this.sizeY||r.cornerSize||i.cornerSize,l=typeof r.transparentCorners<"u"?r.transparentCorners:i.transparentCorners,c=l?"stroke":"fill",u=!l&&(r.cornerStrokeColor||i.cornerStrokeColor),d=t,h=n;e.save(),e.fillStyle=r.cornerColor||i.cornerColor,e.strokeStyle=r.cornerStrokeColor||i.cornerStrokeColor,a>s?(o=a,e.scale(1,s/a),h=n*a/s):s>a?(o=s,e.scale(a/s,1),d=t*s/a):o=a,e.lineWidth=1,e.beginPath(),e.arc(d,h,o/2,0,2*Math.PI,!1),e[c](),u&&e.stroke(),e.restore()},r.renderSquareControl=function(e,t,r,i,o){i=i||{};var a=this.sizeX||i.cornerSize||o.cornerSize,s=this.sizeY||i.cornerSize||o.cornerSize,l=typeof i.transparentCorners<"u"?i.transparentCorners:o.transparentCorners,c=l?"stroke":"fill",u=!l&&(i.cornerStrokeColor||o.cornerStrokeColor),d=a/2,h=s/2;e.save(),e.fillStyle=i.cornerColor||o.cornerColor,e.strokeStyle=i.cornerStrokeColor||o.cornerStrokeColor,e.lineWidth=1,e.translate(t,r),e.rotate(n(o.angle)),e[c+"Rect"](-d,-h,a,s),u&&e.strokeRect(-d,-h,a,s),e.restore()}}(e),function(e){var t=e.fabric||(e.fabric={});t.Control=function(e){for(var t in e)this[t]=e[t]},t.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(e,t){return t.cursorStyle},getActionName:function(e,t){return t.actionName},getVisibility:function(e,t){var n=e._controlsVisibility;return n&&typeof n[t]<"u"?n[t]:this.visible},setVisibility:function(e){this.visible=e},positionHandler:function(e,n){return t.util.transformPoint({x:this.x*e.x+this.offsetX,y:this.y*e.y+this.offsetY},n)},calcCornerCoords:function(e,n,r,i,o){var a,s,l,c,u=o?this.touchSizeX:this.sizeX,d=o?this.touchSizeY:this.sizeY;if(u&&d&&u!==d){var h=Math.atan2(d,u),f=Math.sqrt(u*u+d*d)/2,p=h-t.util.degreesToRadians(e),g=Math.PI/2-h-t.util.degreesToRadians(e);a=f*t.util.cos(p),s=f*t.util.sin(p),l=f*t.util.cos(g),c=f*t.util.sin(g)}else f=.7071067812*(u&&d?u:n),p=t.util.degreesToRadians(45-e),a=l=f*t.util.cos(p),s=c=f*t.util.sin(p);return{tl:{x:r-c,y:i-l},tr:{x:r+a,y:i-s},bl:{x:r-a,y:i+s},br:{x:r+c,y:i+l}}},render:function(e,n,r,i,o){"circle"===((i=i||{}).cornerStyle||o.cornerStyle)?t.controlsUtils.renderCircleControl.call(this,e,n,r,i,o):t.controlsUtils.renderSquareControl.call(this,e,n,r,i,o)}}}(e),function(){function e(e,n){var r,i,o,a,s=e.getAttribute("style"),l=e.getAttribute("offset")||0;if(l=(l=parseFloat(l)/(/%$/.test(l)?100:1))<0?0:l>1?1:l,s){var c=s.split(/\s*;\s*/);for(""===c[c.length-1]&&c.pop(),a=c.length;a--;){var u=c[a].split(/\s*:\s*/),d=u[0].trim(),h=u[1].trim();"stop-color"===d?r=h:"stop-opacity"===d&&(o=h)}}return r||(r=e.getAttribute("stop-color")||"rgb(0,0,0)"),o||(o=e.getAttribute("stop-opacity")),i=(r=new t.Color(r)).getAlpha(),o=isNaN(parseFloat(o))?1:parseFloat(o),o*=i*n,{offset:l,color:r.toRgb(),opacity:o}}var n=t.util.object.clone;t.Gradient=t.util.createClass({offsetX:0,offsetY:0,gradientTransform:null,gradientUnits:"pixels",type:"linear",initialize:function(e){e||(e={}),e.coords||(e.coords={});var n,r=this;Object.keys(e).forEach(function(t){r[t]=e[t]}),this.id?this.id+="_"+t.Object.__uid++:this.id=t.Object.__uid++,n={x1:e.coords.x1||0,y1:e.coords.y1||0,x2:e.coords.x2||0,y2:e.coords.y2||0},"radial"===this.type&&(n.r1=e.coords.r1||0,n.r2=e.coords.r2||0),this.coords=n,this.colorStops=e.colorStops.slice()},addColorStop:function(e){for(var n in e){var r=new t.Color(e[n]);this.colorStops.push({offset:parseFloat(n),color:r.toRgb(),opacity:r.getAlpha()})}return this},toObject:function(e){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 t.util.populateWithProperties(this,n,e),n},toSVG:function(e,r){var i,o,a,s,l=n(this.coords,!0),c=(r=r||{},n(this.colorStops,!0)),u=l.r1>l.r2,d=this.gradientTransform?this.gradientTransform.concat():t.iMatrix.concat(),h=-this.offsetX,f=-this.offsetY,p=!!r.additionalTransform,g="pixels"===this.gradientUnits?"userSpaceOnUse":"objectBoundingBox";if(c.sort(function(e,t){return e.offset-t.offset}),"objectBoundingBox"===g?(h/=e.width,f/=e.height):(h+=e.width/2,f+=e.height/2),"path"===e.type&&"percentage"!==this.gradientUnits&&(h-=e.pathOffset.x,f-=e.pathOffset.y),d[4]-=h,d[5]-=f,s='id="SVGID_'+this.id+'" gradientUnits="'+g+'"',s+=' gradientTransform="'+(p?r.additionalTransform+" ":"")+t.util.matrixToSVG(d)+'" ',"linear"===this.type?a=["<linearGradient ",s,' x1="',l.x1,'" y1="',l.y1,'" x2="',l.x2,'" y2="',l.y2,'">\n']:"radial"===this.type&&(a=["<radialGradient ",s,' cx="',u?l.x1:l.x2,'" cy="',u?l.y1:l.y2,'" r="',u?l.r1:l.r2,'" fx="',u?l.x2:l.x1,'" fy="',u?l.y2:l.y1,'">\n']),"radial"===this.type){if(u)for((c=c.concat()).reverse(),i=0,o=c.length;i<o;i++)c[i].offset=1-c[i].offset;var m=Math.min(l.r1,l.r2);if(m>0){var v=m/Math.max(l.r1,l.r2);for(i=0,o=c.length;i<o;i++)c[i].offset+=v*(1-c[i].offset)}}for(i=0,o=c.length;i<o;i++){var y=c[i];a.push("<stop ",'offset="',100*y.offset+"%",'" style="stop-color:',y.color,typeof y.opacity<"u"?";stop-opacity: "+y.opacity:";",'"/>\n')}return a.push("linear"===this.type?"</linearGradient>\n":"</radialGradient>\n"),a.join("")},toLive:function(e){var n,r,i,o=t.util.object.clone(this.coords);if(this.type){for("linear"===this.type?n=e.createLinearGradient(o.x1,o.y1,o.x2,o.y2):"radial"===this.type&&(n=e.createRadialGradient(o.x1,o.y1,o.r1,o.x2,o.y2,o.r2)),r=0,i=this.colorStops.length;r<i;r++){var a=this.colorStops[r].color,s=this.colorStops[r].opacity,l=this.colorStops[r].offset;typeof s<"u"&&(a=new t.Color(a).setAlpha(s).toRgba()),n.addColorStop(l,a)}return n}}}),t.util.object.extend(t.Gradient,{fromElement:function(n,r,i,o){var a=parseFloat(i)/(/%$/.test(i)?100:1);a=a<0?0:a>1?1:a,isNaN(a)&&(a=1);var s,l,c,u,d=n.getElementsByTagName("stop"),h="userSpaceOnUse"===n.getAttribute("gradientUnits")?"pixels":"percentage",f=n.getAttribute("gradientTransform")||"",p=[],g=0,m=0;for("linearGradient"===n.nodeName||"LINEARGRADIENT"===n.nodeName?(s="linear",l=function(e){return{x1:e.getAttribute("x1")||0,y1:e.getAttribute("y1")||0,x2:e.getAttribute("x2")||"100%",y2:e.getAttribute("y2")||0}}(n)):(s="radial",l=function(e){return{x1:e.getAttribute("fx")||e.getAttribute("cx")||"50%",y1:e.getAttribute("fy")||e.getAttribute("cy")||"50%",r1:0,x2:e.getAttribute("cx")||"50%",y2:e.getAttribute("cy")||"50%",r2:e.getAttribute("r")||"50%"}}(n)),c=d.length;c--;)p.push(e(d[c],a));return u=t.parseTransformAttribute(f),function(e,t,n,r){var i,o;Object.keys(t).forEach(function(e){"Infinity"===(i=t[e])?o=1:"-Infinity"===i?o=0:(o=parseFloat(t[e],10),"string"==typeof i&&/^(\d+\.\d+)%|(\d+)%$/.test(i)&&(o*=.01,"pixels"===r&&(("x1"===e||"x2"===e||"r2"===e)&&(o*=n.viewBoxWidth||n.width),("y1"===e||"y2"===e)&&(o*=n.viewBoxHeight||n.height)))),t[e]=o})}(0,l,o,h),"pixels"===h&&(g=-r.left,m=-r.top),new t.Gradient({id:n.getAttribute("id"),type:s,coords:l,colorStops:p,gradientUnits:h,gradientTransform:u,offsetX:g,offsetY:m})}})}(),function(){var e=t.util.toFixed;t.Pattern=t.util.createClass({repeat:"repeat",offsetX:0,offsetY:0,crossOrigin:"",patternTransform:null,initialize:function(e,n){if(e||(e={}),this.id=t.Object.__uid++,this.setOptions(e),!e.source||e.source&&"string"!=typeof e.source)n&&n(this);else{var r=this;this.source=t.util.createImage(),t.util.loadImage(e.source,function(e,t){r.source=e,n&&n(r,t)},null,this.crossOrigin)}},toObject:function(n){var r,i,o=t.Object.NUM_FRACTION_DIGITS;return"string"==typeof this.source.src?r=this.source.src:"object"==typeof this.source&&this.source.toDataURL&&(r=this.source.toDataURL()),i={type:"pattern",source:r,repeat:this.repeat,crossOrigin:this.crossOrigin,offsetX:e(this.offsetX,o),offsetY:e(this.offsetY,o),patternTransform:this.patternTransform?this.patternTransform.concat():null},t.util.populateWithProperties(this,i,n),i},toSVG:function(e){var t="function"==typeof this.source?this.source():this.source,n=t.width/e.width,r=t.height/e.height,i=this.offsetX/e.width,o=this.offsetY/e.height,a="";return("repeat-x"===this.repeat||"no-repeat"===this.repeat)&&(r=1,o&&(r+=Math.abs(o))),("repeat-y"===this.repeat||"no-repeat"===this.repeat)&&(n=1,i&&(n+=Math.abs(i))),t.src?a=t.src:t.toDataURL&&(a=t.toDataURL()),'<pattern id="SVGID_'+this.id+'" x="'+i+'" y="'+o+'" width="'+n+'" height="'+r+'">\n<image x="0" y="0" width="'+t.width+'" height="'+t.height+'" xlink:href="'+a+'"></image>\n</pattern>\n'},setOptions:function(e){for(var t in e)this[t]=e[t]},toLive:function(e){var t=this.source;return!t||typeof t.src<"u"&&(!t.complete||0===t.naturalWidth||0===t.naturalHeight)?"":e.createPattern(t,this.repeat)}})}(),function(e){var t=e.fabric||(e.fabric={}),n=t.util.toFixed;t.Shadow?t.warn("fabric.Shadow is already defined."):(t.Shadow=t.util.createClass({color:"rgb(0,0,0)",blur:0,offsetX:0,offsetY:0,affectStroke:!1,includeDefaultValues:!0,nonScaling:!1,initialize:function(e){for(var n in"string"==typeof e&&(e=this._parseShadow(e)),e)this[n]=e[n];this.id=t.Object.__uid++},_parseShadow:function(e){var n=e.trim(),r=t.Shadow.reOffsetsAndBlur.exec(n)||[];return{color:(n.replace(t.Shadow.reOffsetsAndBlur,"")||"rgb(0,0,0)").trim(),offsetX:parseFloat(r[1],10)||0,offsetY:parseFloat(r[2],10)||0,blur:parseFloat(r[3],10)||0}},toString:function(){return[this.offsetX,this.offsetY,this.blur,this.color].join("px ")},toSVG:function(e){var r=40,i=40,o=t.Object.NUM_FRACTION_DIGITS,a=t.util.rotateVector({x:this.offsetX,y:this.offsetY},t.util.degreesToRadians(-e.angle)),s=new t.Color(this.color);return e.width&&e.height&&(r=100*n((Math.abs(a.x)+this.blur)/e.width,o)+20,i=100*n((Math.abs(a.y)+this.blur)/e.height,o)+20),e.flipX&&(a.x*=-1),e.flipY&&(a.y*=-1),'<filter id="SVGID_'+this.id+'" y="-'+i+'%" height="'+(100+2*i)+'%" x="-'+r+'%" width="'+(100+2*r)+'%" >\n\t<feGaussianBlur in="SourceAlpha" stdDeviation="'+n(this.blur?this.blur/2:0,o)+'"></feGaussianBlur>\n\t<feOffset dx="'+n(a.x,o)+'" dy="'+n(a.y,o)+'" result="oBlur" ></feOffset>\n\t<feFlood flood-color="'+s.toRgb()+'" flood-opacity="'+s.getAlpha()+'"/>\n\t<feComposite in2="oBlur" operator="in" />\n\t<feMerge>\n\t\t<feMergeNode></feMergeNode>\n\t\t<feMergeNode in="SourceGraphic"></feMergeNode>\n\t</feMerge>\n</filter>\n'},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 e={},n=t.Shadow.prototype;return["color","blur","offsetX","offsetY","affectStroke","nonScaling"].forEach(function(t){this[t]!==n[t]&&(e[t]=this[t])},this),e}}),t.Shadow.reOffsetsAndBlur=/(?:\s|^)(-?\d+(?:\.\d*)?(?:px)?(?:\s?|$))?(-?\d+(?:\.\d*)?(?:px)?(?:\s?|$))?(\d+(?:\.\d*)?(?:px)?)?(?:\s?|$)(?:$|\s)/)}(e),function(){if(t.StaticCanvas)t.warn("fabric.StaticCanvas is already defined.");else{var e=t.util.object.extend,n=t.util.getElementOffset,r=t.util.removeFromArray,i=t.util.toFixed,o=t.util.transformPoint,a=t.util.invertTransform,s=t.util.getNodeCanvas,l=t.util.createCanvasElement,c=new Error("Could not initialize `canvas` element");t.StaticCanvas=t.util.createClass(t.CommonMethods,{initialize:function(e,t){t||(t={}),this.renderAndResetBound=this.renderAndReset.bind(this),this.requestRenderAllBound=this.requestRenderAll.bind(this),this._initStatic(e,t)},backgroundColor:"",backgroundImage:null,overlayColor:"",overlayImage:null,includeDefaultValues:!0,stateful:!1,renderOnAddRemove:!0,controlsAboveOverlay:!1,allowTouchScrolling:!1,imageSmoothingEnabled:!0,viewportTransform:t.iMatrix.concat(),backgroundVpt:!0,overlayVpt:!0,enableRetinaScaling:!0,vptCoords:{},skipOffscreen:!0,clipPath:void 0,_initStatic:function(e,t){var n=this.requestRenderAllBound;this._objects=[],this._createLowerCanvas(e),this._initOptions(t),this.interactive||this._initRetinaScaling(),t.overlayImage&&this.setOverlayImage(t.overlayImage,n),t.backgroundImage&&this.setBackgroundImage(t.backgroundImage,n),t.backgroundColor&&this.setBackgroundColor(t.backgroundColor,n),t.overlayColor&&this.setOverlayColor(t.overlayColor,n),this.calcOffset()},_isRetinaScaling:function(){return t.devicePixelRatio>1&&this.enableRetinaScaling},getRetinaScaling:function(){return this._isRetinaScaling()?Math.max(1,t.devicePixelRatio):1},_initRetinaScaling:function(){if(this._isRetinaScaling()){var e=t.devicePixelRatio;this.__initRetinaScaling(e,this.lowerCanvasEl,this.contextContainer),this.upperCanvasEl&&this.__initRetinaScaling(e,this.upperCanvasEl,this.contextTop)}},__initRetinaScaling:function(e,t,n){t.setAttribute("width",this.width*e),t.setAttribute("height",this.height*e),n.scale(e,e)},calcOffset:function(){return this._offset=n(this.lowerCanvasEl),this},setOverlayImage:function(e,t,n){return this.__setBgOverlayImage("overlayImage",e,t,n)},setBackgroundImage:function(e,t,n){return this.__setBgOverlayImage("backgroundImage",e,t,n)},setOverlayColor:function(e,t){return this.__setBgOverlayColor("overlayColor",e,t)},setBackgroundColor:function(e,t){return this.__setBgOverlayColor("backgroundColor",e,t)},__setBgOverlayImage:function(e,n,r,i){return"string"==typeof n?t.util.loadImage(n,function(n,o){if(n){var a=new t.Image(n,i);this[e]=a,a.canvas=this}r&&r(n,o)},this,i&&i.crossOrigin):(i&&n.setOptions(i),this[e]=n,n&&(n.canvas=this),r&&r(n,!1)),this},__setBgOverlayColor:function(e,t,n){return this[e]=t,this._initGradient(t,e),this._initPattern(t,e,n),this},_createCanvasElement:function(){var e=l();if(!e||(e.style||(e.style={}),typeof e.getContext>"u"))throw c;return e},_initOptions:function(e){var t=this.lowerCanvasEl;this._setOptions(e),this.width=this.width||parseInt(t.width,10)||0,this.height=this.height||parseInt(t.height,10)||0,this.lowerCanvasEl.style&&(t.width=this.width,t.height=this.height,t.style.width=this.width+"px",t.style.height=this.height+"px",this.viewportTransform=this.viewportTransform.slice())},_createLowerCanvas:function(e){e&&e.getContext?this.lowerCanvasEl=e:this.lowerCanvasEl=t.util.getById(e)||this._createCanvasElement(),t.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(e,t){return this.setDimensions({width:e},t)},setHeight:function(e,t){return this.setDimensions({height:e},t)},setDimensions:function(e,t){var n;for(var r in t=t||{},e)n=e[r],t.cssOnly||(this._setBackstoreDimension(r,e[r]),n+="px",this.hasLostContext=!0),t.backstoreOnly||this._setCssDimension(r,n);return this._isCurrentlyDrawing&&this.freeDrawingBrush&&this.freeDrawingBrush._setBrushStyles(this.contextTop),this._initRetinaScaling(),this.calcOffset(),t.cssOnly||this.requestRenderAll(),this},_setBackstoreDimension:function(e,t){return this.lowerCanvasEl[e]=t,this.upperCanvasEl&&(this.upperCanvasEl[e]=t),this.cacheCanvasEl&&(this.cacheCanvasEl[e]=t),this[e]=t,this},_setCssDimension:function(e,t){return this.lowerCanvasEl.style[e]=t,this.upperCanvasEl&&(this.upperCanvasEl.style[e]=t),this.wrapperEl&&(this.wrapperEl.style[e]=t),this},getZoom:function(){return this.viewportTransform[0]},setViewportTransform:function(e){var t,n,r,i=this._activeObject,o=this.backgroundImage,a=this.overlayImage;for(this.viewportTransform=e,n=0,r=this._objects.length;n<r;n++)(t=this._objects[n]).group||t.setCoords(!0);return i&&i.setCoords(),o&&o.setCoords(!0),a&&a.setCoords(!0),this.calcViewportBoundaries(),this.renderOnAddRemove&&this.requestRenderAll(),this},zoomToPoint:function(e,t){var n=e,r=this.viewportTransform.slice(0);e=o(e,a(this.viewportTransform)),r[0]=t,r[3]=t;var i=o(e,r);return r[4]+=n.x-i.x,r[5]+=n.y-i.y,this.setViewportTransform(r)},setZoom:function(e){return this.zoomToPoint(new t.Point(0,0),e),this},absolutePan:function(e){var t=this.viewportTransform.slice(0);return t[4]=-e.x,t[5]=-e.y,this.setViewportTransform(t)},relativePan:function(e){return this.absolutePan(new t.Point(-e.x-this.viewportTransform[4],-e.y-this.viewportTransform[5]))},getElement:function(){return this.lowerCanvasEl},_onObjectAdded:function(e){this.stateful&&e.setupState(),e._set("canvas",this),e.setCoords(),this.fire("object:added",{target:e}),e.fire("added")},_onObjectRemoved:function(e){this.fire("object:removed",{target:e}),e.fire("removed"),delete e.canvas},clearContext:function(e){return e.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 e=this.contextContainer;return this.renderCanvas(e,this._objects),this},renderAndReset:function(){this.isRendering=0,this.renderAll()},requestRenderAll:function(){return this.isRendering||(this.isRendering=t.util.requestAnimFrame(this.renderAndResetBound)),this},calcViewportBoundaries:function(){var e={},n=this.width,r=this.height,i=a(this.viewportTransform);return e.tl=o({x:0,y:0},i),e.br=o({x:n,y:r},i),e.tr=new t.Point(e.br.x,e.tl.y),e.bl=new t.Point(e.tl.x,e.br.y),this.vptCoords=e,e},cancelRequestedRender:function(){this.isRendering&&(t.util.cancelAnimFrame(this.isRendering),this.isRendering=0)},renderCanvas:function(e,n){var r=this.viewportTransform,i=this.clipPath;this.cancelRequestedRender(),this.calcViewportBoundaries(),this.clearContext(e),t.util.setImageSmoothing(e,this.imageSmoothingEnabled),this.fire("before:render",{ctx:e}),this._renderBackground(e),e.save(),e.transform(r[0],r[1],r[2],r[3],r[4],r[5]),this._renderObjects(e,n),e.restore(),!this.controlsAboveOverlay&&this.interactive&&this.drawControls(e),i&&(i.canvas=this,i.shouldCache(),i._transformDone=!0,i.renderCache({forClipping:!0}),this.drawClipPathOnCanvas(e)),this._renderOverlay(e),this.controlsAboveOverlay&&this.interactive&&this.drawControls(e),this.fire("after:render",{ctx:e})},drawClipPathOnCanvas:function(e){var t=this.viewportTransform,n=this.clipPath;e.save(),e.transform(t[0],t[1],t[2],t[3],t[4],t[5]),e.globalCompositeOperation="destination-in",n.transform(e),e.scale(1/n.zoomX,1/n.zoomY),e.drawImage(n._cacheCanvas,-n.cacheTranslationX,-n.cacheTranslationY),e.restore()},_renderObjects:function(e,t){var n,r;for(n=0,r=t.length;n<r;++n)t[n]&&t[n].render(e)},_renderBackgroundOrOverlay:function(e,t){var n=this[t+"Color"],r=this[t+"Image"],i=this.viewportTransform,o=this[t+"Vpt"];if(n||r){if(n){e.save(),e.beginPath(),e.moveTo(0,0),e.lineTo(this.width,0),e.lineTo(this.width,this.height),e.lineTo(0,this.height),e.closePath(),e.fillStyle=n.toLive?n.toLive(e,this):n,o&&e.transform(i[0],i[1],i[2],i[3],i[4],i[5]),e.transform(1,0,0,1,n.offsetX||0,n.offsetY||0);var a=n.gradientTransform||n.patternTransform;a&&e.transform(a[0],a[1],a[2],a[3],a[4],a[5]),e.fill(),e.restore()}r&&(e.save(),o&&e.transform(i[0],i[1],i[2],i[3],i[4],i[5]),r.render(e),e.restore())}},_renderBackground:function(e){this._renderBackgroundOrOverlay(e,"background")},_renderOverlay:function(e){this._renderBackgroundOrOverlay(e,"overlay")},getCenter:function(){return{top:this.height/2,left:this.width/2}},getCenterPoint:function(){return new t.Point(this.width/2,this.height/2)},centerObjectH:function(e){return this._centerObject(e,new t.Point(this.getCenterPoint().x,e.getCenterPoint().y))},centerObjectV:function(e){return this._centerObject(e,new t.Point(e.getCenterPoint().x,this.getCenterPoint().y))},centerObject:function(e){var t=this.getCenterPoint();return this._centerObject(e,t)},viewportCenterObject:function(e){var t=this.getVpCenter();return this._centerObject(e,t)},viewportCenterObjectH:function(e){var n=this.getVpCenter();return this._centerObject(e,new t.Point(n.x,e.getCenterPoint().y)),this},viewportCenterObjectV:function(e){var n=this.getVpCenter();return this._centerObject(e,new t.Point(e.getCenterPoint().x,n.y))},getVpCenter:function(){var e=this.getCenterPoint(),t=a(this.viewportTransform);return o(e,t)},_centerObject:function(e,t){return e.setPositionByOrigin(t,"center","center"),e.setCoords(),this.renderOnAddRemove&&this.requestRenderAll(),this},toDatalessJSON:function(e){return this.toDatalessObject(e)},toObject:function(e){return this._toObjectMethod("toObject",e)},toDatalessObject:function(e){return this._toObjectMethod("toDatalessObject",e)},_toObjectMethod:function(n,r){var i=this.clipPath,o={version:t.version,objects:this._toObjects(n,r)};return i&&!i.excludeFromExport&&(o.clipPath=this._toObject(this.clipPath,n,r)),e(o,this.__serializeBgOverlay(n,r)),t.util.populateWithProperties(this,o,r),o},_toObjects:function(e,t){return this._objects.filter(function(e){return!e.excludeFromExport}).map(function(n){return this._toObject(n,e,t)},this)},_toObject:function(e,t,n){var r;this.includeDefaultValues||(r=e.includeDefaultValues,e.includeDefaultValues=!1);var i=e[t](n);return this.includeDefaultValues||(e.includeDefaultValues=r),i},__serializeBgOverlay:function(e,t){var n={},r=this.backgroundImage,i=this.overlayImage,o=this.backgroundColor,a=this.overlayColor;return o&&o.toObject?o.excludeFromExport||(n.background=o.toObject(t)):o&&(n.background=o),a&&a.toObject?a.excludeFromExport||(n.overlay=a.toObject(t)):a&&(n.overlay=a),r&&!r.excludeFromExport&&(n.backgroundImage=this._toObject(r,e,t)),i&&!i.excludeFromExport&&(n.overlayImage=this._toObject(i,e,t)),n},svgViewportTransformation:!0,toSVG:function(e,t){e||(e={}),e.reviver=t;var n=[];return this._setSVGPreamble(n,e),this._setSVGHeader(n,e),this.clipPath&&n.push('<g clip-path="url(#'+this.clipPath.clipPathId+')" >\n'),this._setSVGBgOverlayColor(n,"background"),this._setSVGBgOverlayImage(n,"backgroundImage",t),this._setSVGObjects(n,t),this.clipPath&&n.push("</g>\n"),this._setSVGBgOverlayColor(n,"overlay"),this._setSVGBgOverlayImage(n,"overlayImage",t),n.push("</svg>"),n.join("")},_setSVGPreamble:function(e,t){t.suppressPreamble||e.push('<?xml version="1.0" encoding="',t.encoding||"UTF-8",'" standalone="no" ?>\n','<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" ','"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')},_setSVGHeader:function(e,n){var r,o=n.width||this.width,a=n.height||this.height,s='viewBox="0 0 '+this.width+" "+this.height+'" ',l=t.Object.NUM_FRACTION_DIGITS;n.viewBox?s='viewBox="'+n.viewBox.x+" "+n.viewBox.y+" "+n.viewBox.width+" "+n.viewBox.height+'" ':this.svgViewportTransformation&&(r=this.viewportTransform,s='viewBox="'+i(-r[4]/r[0],l)+" "+i(-r[5]/r[3],l)+" "+i(this.width/r[0],l)+" "+i(this.height/r[3],l)+'" '),e.push("<svg ",'xmlns="http://www.w3.org/2000/svg" ','xmlns:xlink="http://www.w3.org/1999/xlink" ','version="1.1" ','width="',o,'" ','height="',a,'" ',s,'xml:space="preserve">\n',"<desc>Created with Fabric.js ",t.version,"</desc>\n","<defs>\n",this.createSVGFontFacesMarkup(),this.createSVGRefElementsMarkup(),this.createSVGClipPathMarkup(n),"</defs>\n")},createSVGClipPathMarkup:function(e){var n=this.clipPath;return n?(n.clipPathId="CLIPPATH_"+t.Object.__uid++,'<clipPath id="'+n.clipPathId+'" >\n'+this.clipPath.toClipPathSVG(e.reviver)+"</clipPath>\n"):""},createSVGRefElementsMarkup:function(){var e=this;return["background","overlay"].map(function(n){var r=e[n+"Color"];if(r&&r.toLive){var i=e[n+"Vpt"],o=e.viewportTransform,a={width:e.width/(i?o[0]:1),height:e.height/(i?o[3]:1)};return r.toSVG(a,{additionalTransform:i?t.util.matrixToSVG(o):""})}}).join("")},createSVGFontFacesMarkup:function(){var e,n,r,i,o,a,s,l,c="",u={},d=t.fontPaths,h=[];for(this._objects.forEach(function e(t){h.push(t),t._objects&&t._objects.forEach(e)}),s=0,l=h.length;s<l;s++)if(n=(e=h[s]).fontFamily,-1!==e.type.indexOf("text")&&!u[n]&&d[n]&&(u[n]=!0,e.styles))for(o in r=e.styles)for(a in i=r[o])!u[n=i[a].fontFamily]&&d[n]&&(u[n]=!0);for(var f in u)c+=["\t\t@font-face {\n","\t\t\tfont-family: '",f,"';\n","\t\t\tsrc: url('",d[f],"');\n","\t\t}\n"].join("");return c&&(c=['\t<style type="text/css">',"<![CDATA[\n",c,"]]>","</style>\n"].join("")),c},_setSVGObjects:function(e,t){var n,r,i,o=this._objects;for(r=0,i=o.length;r<i;r++)!(n=o[r]).excludeFromExport&&this._setSVGObject(e,n,t)},_setSVGObject:function(e,t,n){e.push(t.toSVG(n))},_setSVGBgOverlayImage:function(e,t,n){this[t]&&!this[t].excludeFromExport&&this[t].toSVG&&e.push(this[t].toSVG(n))},_setSVGBgOverlayColor:function(e,n){var r=this[n+"Color"],i=this.viewportTransform,o=this.width,a=this.height;if(r)if(r.toLive){var s=r.repeat,l=t.util.invertTransform(i),c=this[n+"Vpt"]?t.util.matrixToSVG(l):"";e.push('<rect transform="'+c+" translate(",o/2,",",a/2,')"',' x="',r.offsetX-o/2,'" y="',r.offsetY-a/2,'" ','width="',"repeat-y"===s||"no-repeat"===s?r.source.width:o,'" height="',"repeat-x"===s||"no-repeat"===s?r.source.height:a,'" fill="url(#SVGID_'+r.id+')"',"></rect>\n")}else e.push('<rect x="0" y="0" width="100%" height="100%" ','fill="',r,'"',"></rect>\n")},sendToBack:function(e){if(!e)return this;var t,n,i,o=this._activeObject;if(e===o&&"activeSelection"===e.type)for(t=(i=o._objects).length;t--;)n=i[t],r(this._objects,n),this._objects.unshift(n);else r(this._objects,e),this._objects.unshift(e);return this.renderOnAddRemove&&this.requestRenderAll(),this},bringToFront:function(e){if(!e)return this;var t,n,i,o=this._activeObject;if(e===o&&"activeSelection"===e.type)for(i=o._objects,t=0;t<i.length;t++)n=i[t],r(this._objects,n),this._objects.push(n);else r(this._objects,e),this._objects.push(e);return this.renderOnAddRemove&&this.requestRenderAll(),this},sendBackwards:function(e,t){if(!e)return this;var n,i,o,a,s,l=this._activeObject,c=0;if(e===l&&"activeSelection"===e.type)for(s=l._objects,n=0;n<s.length;n++)i=s[n],(o=this._objects.indexOf(i))>0+c&&(a=o-1,r(this._objects,i),this._objects.splice(a,0,i)),c++;else 0!==(o=this._objects.indexOf(e))&&(a=this._findNewLowerIndex(e,o,t),r(this._objects,e),this._objects.splice(a,0,e));return this.renderOnAddRemove&&this.requestRenderAll(),this},_findNewLowerIndex:function(e,t,n){var r,i;if(n){for(r=t,i=t-1;i>=0;--i)if(e.intersectsWithObject(this._objects[i])||e.isContainedWithinObject(this._objects[i])||this._objects[i].isContainedWithinObject(e)){r=i;break}}else r=t-1;return r},bringForward:function(e,t){if(!e)return this;var n,i,o,a,s,l=this._activeObject,c=0;if(e===l&&"activeSelection"===e.type)for(n=(s=l._objects).length;n--;)i=s[n],(o=this._objects.indexOf(i))<this._objects.length-1-c&&(a=o+1,r(this._objects,i),this._objects.splice(a,0,i)),c++;else(o=this._objects.indexOf(e))!==this._objects.length-1&&(a=this._findNewUpperIndex(e,o,t),r(this._objects,e),this._objects.splice(a,0,e));return this.renderOnAddRemove&&this.requestRenderAll(),this},_findNewUpperIndex:function(e,t,n){var r,i,o;if(n){for(r=t,i=t+1,o=this._objects.length;i<o;++i)if(e.intersectsWithObject(this._objects[i])||e.isContainedWithinObject(this._objects[i])||this._objects[i].isContainedWithinObject(e)){r=i;break}}else r=t+1;return r},moveTo:function(e,t){return r(this._objects,e),this._objects.splice(t,0,e),this.renderOnAddRemove&&this.requestRenderAll()},dispose:function(){return this.isRendering&&(t.util.cancelAnimFrame(this.isRendering),this.isRendering=0),this.forEachObject(function(e){e.dispose&&e.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"),t.util.setStyle(this.lowerCanvasEl,this._originalCanvasStyle),delete this._originalCanvasStyle,this.lowerCanvasEl.setAttribute("width",this.width),this.lowerCanvasEl.setAttribute("height",this.height),t.util.cleanUpJsdomNode(this.lowerCanvasEl),this.lowerCanvasEl=void 0,this},toString:function(){return"#<fabric.Canvas ("+this.complexity()+"): { objects: "+this._objects.length+" }>"}}),e(t.StaticCanvas.prototype,t.Observable),e(t.StaticCanvas.prototype,t.Collection),e(t.StaticCanvas.prototype,t.DataURLExporter),e(t.StaticCanvas,{EMPTY_JSON:'{"objects": [], "background": "white"}',supports:function(e){var t=l();if(!t||!t.getContext)return null;var n=t.getContext("2d");return n&&"setLineDash"===e?typeof n.setLineDash<"u":null}}),t.StaticCanvas.prototype.toJSON=t.StaticCanvas.prototype.toObject,t.isLikelyNode&&(t.StaticCanvas.prototype.createPNGStream=function(){var e=s(this.lowerCanvasEl);return e&&e.createPNGStream()},t.StaticCanvas.prototype.createJPEGStream=function(e){var t=s(this.lowerCanvasEl);return t&&t.createJPEGStream(e)})}}(),t.BaseBrush=t.util.createClass({color:"rgb(0, 0, 0)",width:1,shadow:null,strokeLineCap:"round",strokeLineJoin:"round",strokeMiterLimit:10,strokeDashArray:null,limitedToCanvasSize:!1,_setBrushStyles:function(e){e.strokeStyle=this.color,e.lineWidth=this.width,e.lineCap=this.strokeLineCap,e.miterLimit=this.strokeMiterLimit,e.lineJoin=this.strokeLineJoin,e.setLineDash(this.strokeDashArray||[])},_saveAndTransform:function(e){var t=this.canvas.viewportTransform;e.save(),e.transform(t[0],t[1],t[2],t[3],t[4],t[5])},_setShadow:function(){if(this.shadow){var e=this.canvas,n=this.shadow,r=e.contextTop,i=e.getZoom();e&&e._isRetinaScaling()&&(i*=t.devicePixelRatio),r.shadowColor=n.color,r.shadowBlur=n.blur*i,r.shadowOffsetX=n.offsetX*i,r.shadowOffsetY=n.offsetY*i}},needsFullRender:function(){return new t.Color(this.color).getAlpha()<1||!!this.shadow},_resetShadow:function(){var e=this.canvas.contextTop;e.shadowColor="",e.shadowBlur=e.shadowOffsetX=e.shadowOffsetY=0},_isOutSideCanvas:function(e){return e.x<0||e.x>this.canvas.getWidth()||e.y<0||e.y>this.canvas.getHeight()}}),t.PencilBrush=t.util.createClass(t.BaseBrush,{decimate:.4,drawStraightLine:!1,straightLineKey:"shiftKey",initialize:function(e){this.canvas=e,this._points=[]},needsFullRender:function(){return this.callSuper("needsFullRender")||this._hasStraightLine},_drawSegment:function(e,t,n){var r=t.midPointFrom(n);return e.quadraticCurveTo(t.x,t.y,r.x,r.y),r},onMouseDown:function(e,t){this.canvas._isMainEvent(t.e)&&(this.drawStraightLine=t.e[this.straightLineKey],this._prepareForDrawing(e),this._captureDrawingPath(e),this._render())},onMouseMove:function(e,t){if(this.canvas._isMainEvent(t.e)&&(this.drawStraightLine=t.e[this.straightLineKey],(!0!==this.limitedToCanvasSize||!this._isOutSideCanvas(e))&&this._captureDrawingPath(e)&&this._points.length>1))if(this.needsFullRender())this.canvas.clearContext(this.canvas.contextTop),this._render();else{var n=this._points,r=n.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,n[r-2],n[r-1],!0),i.stroke(),i.restore()}},onMouseUp:function(e){return!this.canvas._isMainEvent(e.e)||(this.drawStraightLine=!1,this.oldEnd=void 0,this._finalizeAndAddPath(),!1)},_prepareForDrawing:function(e){var n=new t.Point(e.x,e.y);this._reset(),this._addPoint(n),this.canvas.contextTop.moveTo(n.x,n.y)},_addPoint:function(e){return!(this._points.length>1&&e.eq(this._points[this._points.length-1])||(this.drawStraightLine&&this._points.length>1&&(this._hasStraightLine=!0,this._points.pop()),this._points.push(e),0))},_reset:function(){this._points=[],this._setBrushStyles(this.canvas.contextTop),this._setShadow(),this._hasStraightLine=!1},_captureDrawingPath:function(e){var n=new t.Point(e.x,e.y);return this._addPoint(n)},_render:function(e){var n,r,i=this._points[0],o=this._points[1];if(e=e||this.canvas.contextTop,this._saveAndTransform(e),e.beginPath(),2===this._points.length&&i.x===o.x&&i.y===o.y){var a=this.width/1e3;i=new t.Point(i.x,i.y),o=new t.Point(o.x,o.y),i.x-=a,o.x+=a}for(e.moveTo(i.x,i.y),n=1,r=this._points.length;n<r;n++)this._drawSegment(e,i,o),i=this._points[n],o=this._points[n+1];e.lineTo(i.x,i.y),e.stroke(),e.restore()},convertPointsToSVGPath:function(e){var n=this.width/1e3;return t.util.getSmoothPathFromPoints(e,n)},_isEmptySVGPath:function(e){return"M 0 0 Q 0 0 0 0 L 0 0"===t.util.joinPath(e)},createPath:function(e){var n=new t.Path(e,{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,n.shadow=new t.Shadow(this.shadow)),n},decimatePoints:function(e,t){if(e.length<=2)return e;var n,r=this.canvas.getZoom(),i=Math.pow(t/r,2),o=e.length-1,a=e[0],s=[a];for(n=1;n<o-1;n++)Math.pow(a.x-e[n].x,2)+Math.pow(a.y-e[n].y,2)>=i&&(a=e[n],s.push(a));return s.push(e[o]),s},_finalizeAndAddPath:function(){this.canvas.contextTop.closePath(),this.decimate&&(this._points=this.decimatePoints(this._points,this.decimate));var e=this.convertPointsToSVGPath(this._points);if(this._isEmptySVGPath(e))this.canvas.requestRenderAll();else{var t=this.createPath(e);this.canvas.clearContext(this.canvas.contextTop),this.canvas.fire("before:path:created",{path:t}),this.canvas.add(t),this.canvas.requestRenderAll(),t.setCoords(),this._resetShadow(),this.canvas.fire("path:created",{path:t})}}}),t.CircleBrush=t.util.createClass(t.BaseBrush,{width:10,initialize:function(e){this.canvas=e,this.points=[]},drawDot:function(e){var t=this.addPoint(e),n=this.canvas.contextTop;this._saveAndTransform(n),this.dot(n,t),n.restore()},dot:function(e,t){e.fillStyle=t.fill,e.beginPath(),e.arc(t.x,t.y,t.radius,0,2*Math.PI,!1),e.closePath(),e.fill()},onMouseDown:function(e){this.points.length=0,this.canvas.clearContext(this.canvas.contextTop),this._setShadow(),this.drawDot(e)},_render:function(){var e,t,n=this.canvas.contextTop,r=this.points;for(this._saveAndTransform(n),e=0,t=r.length;e<t;e++)this.dot(n,r[e]);n.restore()},onMouseMove:function(e){!0===this.limitedToCanvasSize&&this._isOutSideCanvas(e)||(this.needsFullRender()?(this.canvas.clearContext(this.canvas.contextTop),this.addPoint(e),this._render()):this.drawDot(e))},onMouseUp:function(){var e,n,r=this.canvas.renderOnAddRemove;this.canvas.renderOnAddRemove=!1;var i=[];for(e=0,n=this.points.length;e<n;e++){var o=this.points[e],a=new t.Circle({radius:o.radius,left:o.x,top:o.y,originX:"center",originY:"center",fill:o.fill});this.shadow&&(a.shadow=new t.Shadow(this.shadow)),i.push(a)}var s=new t.Group(i);s.canvas=this.canvas,this.canvas.fire("before:path:created",{path:s}),this.canvas.add(s),this.canvas.fire("path:created",{path:s}),this.canvas.clearContext(this.canvas.contextTop),this._resetShadow(),this.canvas.renderOnAddRemove=r,this.canvas.requestRenderAll()},addPoint:function(e){var n=new t.Point(e.x,e.y),r=t.util.getRandomInt(Math.max(0,this.width-20),this.width+20)/2,i=new t.Color(this.color).setAlpha(t.util.getRandomInt(0,100)/100).toRgba();return n.radius=r,n.fill=i,this.points.push(n),n}}),t.SprayBrush=t.util.createClass(t.BaseBrush,{width:10,density:20,dotWidth:1,dotWidthVariance:1,randomOpacity:!1,optimizeOverlapping:!0,initialize:function(e){this.canvas=e,this.sprayChunks=[]},onMouseDown:function(e){this.sprayChunks.length=0,this.canvas.clearContext(this.canvas.contextTop),this._setShadow(),this.addSprayChunk(e),this.render(this.sprayChunkPoints)},onMouseMove:function(e){!0===this.limitedToCanvasSize&&this._isOutSideCanvas(e)||(this.addSprayChunk(e),this.render(this.sprayChunkPoints))},onMouseUp:function(){var e=this.canvas.renderOnAddRemove;this.canvas.renderOnAddRemove=!1;for(var n=[],r=0,i=this.sprayChunks.length;r<i;r++)for(var o=this.sprayChunks[r],a=0,s=o.length;a<s;a++){var l=new t.Rect({width:o[a].width,height:o[a].width,left:o[a].x+1,top:o[a].y+1,originX:"center",originY:"center",fill:this.color});n.push(l)}this.optimizeOverlapping&&(n=this._getOptimizedRects(n));var c=new t.Group(n);this.shadow&&c.set("shadow",new t.Shadow(this.shadow)),this.canvas.fire("before:path:created",{path:c}),this.canvas.add(c),this.canvas.fire("path:created",{path:c}),this.canvas.clearContext(this.canvas.contextTop),this._resetShadow(),this.canvas.renderOnAddRemove=e,this.canvas.requestRenderAll()},_getOptimizedRects:function(e){var t,n,r,i={};for(n=0,r=e.length;n<r;n++)i[t=e[n].left+""+e[n].top]||(i[t]=e[n]);var o=[];for(t in i)o.push(i[t]);return o},render:function(e){var t,n,r=this.canvas.contextTop;for(r.fillStyle=this.color,this._saveAndTransform(r),t=0,n=e.length;t<n;t++){var i=e[t];typeof i.opacity<"u"&&(r.globalAlpha=i.opacity),r.fillRect(i.x,i.y,i.width,i.width)}r.restore()},_render:function(){var e,t,n=this.canvas.contextTop;for(n.fillStyle=this.color,this._saveAndTransform(n),e=0,t=this.sprayChunks.length;e<t;e++)this.render(this.sprayChunks[e]);n.restore()},addSprayChunk:function(e){this.sprayChunkPoints=[];var n,r,i,o,a=this.width/2;for(o=0;o<this.density;o++){n=t.util.getRandomInt(e.x-a,e.x+a),r=t.util.getRandomInt(e.y-a,e.y+a),i=this.dotWidthVariance?t.util.getRandomInt(Math.max(1,this.dotWidth-this.dotWidthVariance),this.dotWidth+this.dotWidthVariance):this.dotWidth;var s=new t.Point(n,r);s.width=i,this.randomOpacity&&(s.opacity=t.util.getRandomInt(0,100)/100),this.sprayChunkPoints.push(s)}this.sprayChunks.push(this.sprayChunkPoints)}}),t.PatternBrush=t.util.createClass(t.PencilBrush,{getPatternSrc:function(){var e=t.util.createCanvasElement(),n=e.getContext("2d");return e.width=e.height=25,n.fillStyle=this.color,n.beginPath(),n.arc(10,10,10,0,2*Math.PI,!1),n.closePath(),n.fill(),e},getPatternSrcFunction:function(){return String(this.getPatternSrc).replace("this.color",'"'+this.color+'"')},getPattern:function(e){return e.createPattern(this.source||this.getPatternSrc(),"repeat")},_setBrushStyles:function(e){this.callSuper("_setBrushStyles",e),e.strokeStyle=this.getPattern(e)},createPath:function(e){var n=this.callSuper("createPath",e),r=n._getLeftTopCoords().scalarAdd(n.strokeWidth/2);return n.stroke=new t.Pattern({source:this.source||this.getPatternSrcFunction(),offsetX:-r.x,offsetY:-r.y}),n}}),function(){var e=t.util.getPointer,n=t.util.degreesToRadians,r=t.util.isTouchEvent;for(var i in t.Canvas=t.util.createClass(t.StaticCanvas,{initialize:function(e,t){t||(t={}),this.renderAndResetBound=this.renderAndReset.bind(this),this.requestRenderAllBound=this.requestRenderAll.bind(this),this._initStatic(e,t),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",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:[],enablePointerEvents:!1,_hoveredTarget:null,_hoveredTargets:[],_initInteractive:function(){this._currentTransform=null,this._groupSelector=null,this._initWrapperElement(),this._createUpperCanvas(),this._initEventListeners(),this._initRetinaScaling(),this.freeDrawingBrush=t.PencilBrush&&new t.PencilBrush(this),this.calcOffset()},_chooseObjectsToRender:function(){var e,t,n,r=this.getActiveObjects();if(r.length>0&&!this.preserveObjectStacking){t=[],n=[];for(var i=0,o=this._objects.length;i<o;i++)e=this._objects[i],-1===r.indexOf(e)?t.push(e):n.push(e);r.length>1&&(this._activeObject._objects=n),t.push.apply(t,n)}else t=this._objects;return t},renderAll:function(){this.contextTopDirty&&!this._groupSelector&&!this.isDrawingMode&&(this.clearContext(this.contextTop),this.contextTopDirty=!1),this.hasLostContext&&(this.renderTopLayer(this.contextTop),this.hasLostContext=!1);var e=this.contextContainer;return this.renderCanvas(e,this._chooseObjectsToRender()),this},renderTopLayer:function(e){e.save(),this.isDrawingMode&&this._isCurrentlyDrawing&&(this.freeDrawingBrush&&this.freeDrawingBrush._render(),this.contextTopDirty=!0),this.selection&&this._groupSelector&&(this._drawSelection(e),this.contextTopDirty=!0),e.restore()},renderTop:function(){var e=this.contextTop;return this.clearContext(e),this.renderTopLayer(e),this.fire("after:render"),this},_normalizePointer:function(e,n){var r=e.calcTransformMatrix(),i=t.util.invertTransform(r),o=this.restorePointerVpt(n);return t.util.transformPoint(o,i)},isTargetTransparent:function(e,n,r){if(e.shouldCache()&&e._cacheCanvas&&e!==this._activeObject){var i=this._normalizePointer(e,{x:n,y:r}),o=Math.max(e.cacheTranslationX+i.x*e.zoomX,0),a=Math.max(e.cacheTranslationY+i.y*e.zoomY,0);return t.util.isTransparent(e._cacheContext,Math.round(o),Math.round(a),this.targetFindTolerance)}var s=this.contextCache,l=e.selectionBackgroundColor,c=this.viewportTransform;return e.selectionBackgroundColor="",this.clearContext(s),s.save(),s.transform(c[0],c[1],c[2],c[3],c[4],c[5]),e.render(s),s.restore(),e.selectionBackgroundColor=l,t.util.isTransparent(s,n,r,this.targetFindTolerance)},_isSelectionKeyPressed:function(e){return Array.isArray(this.selectionKey)?!!this.selectionKey.find(function(t){return!0===e[t]}):e[this.selectionKey]},_shouldClearSelection:function(e,t){var n=this.getActiveObjects(),r=this._activeObject;return!t||t&&r&&n.length>1&&-1===n.indexOf(t)&&r!==t&&!this._isSelectionKeyPressed(e)||t&&!t.evented||t&&!t.selectable&&r&&r!==t},_shouldCenterTransform:function(e,t,n){var r;if(e)return"scale"===t||"scaleX"===t||"scaleY"===t||"resizing"===t?r=this.centeredScaling||e.centeredScaling:"rotate"===t&&(r=this.centeredRotation||e.centeredRotation),r?!n:n},_getOriginFromCorner:function(e,t){var n={x:e.originX,y:e.originY};return"ml"===t||"tl"===t||"bl"===t?n.x="right":("mr"===t||"tr"===t||"br"===t)&&(n.x="left"),"tl"===t||"mt"===t||"tr"===t?n.y="bottom":("bl"===t||"mb"===t||"br"===t)&&(n.y="top"),n},_getActionFromCorner:function(e,t,n,r){if(!t||!e)return"drag";var i=r.controls[t];return i.getActionName(n,i,r)},_setupCurrentTransform:function(e,r,i){if(r){var o=this.getPointer(e),a=r.__corner,s=r.controls[a],l=i&&a?s.getActionHandler(e,r,s):t.controlsUtils.dragHandler,c=this._getActionFromCorner(i,a,e,r),u=this._getOriginFromCorner(r,a),d=e[this.centeredKey],h={target:r,action:c,actionHandler:l,corner:a,scaleX:r.scaleX,scaleY:r.scaleY,skewX:r.skewX,skewY:r.skewY,offsetX:o.x-r.left,offsetY:o.y-r.top,originX:u.x,originY:u.y,ex:o.x,ey:o.y,lastX:o.x,lastY:o.y,theta:n(r.angle),width:r.width*r.scaleX,shiftKey:e.shiftKey,altKey:d,original:t.util.saveObjectTransform(r)};this._shouldCenterTransform(r,c,d)&&(h.originX="center",h.originY="center"),h.original.originX=u.x,h.original.originY=u.y,this._currentTransform=h,this._beforeTransform(e)}},setCursor:function(e){this.upperCanvasEl.style.cursor=e},_drawSelection:function(e){var n=this._groupSelector,r=new t.Point(n.ex,n.ey),i=t.util.transformPoint(r,this.viewportTransform),o=new t.Point(n.ex+n.left,n.ey+n.top),a=t.util.transformPoint(o,this.viewportTransform),s=Math.min(i.x,a.x),l=Math.min(i.y,a.y),c=Math.max(i.x,a.x),u=Math.max(i.y,a.y),d=this.selectionLineWidth/2;this.selectionColor&&(e.fillStyle=this.selectionColor,e.fillRect(s,l,c-s,u-l)),this.selectionLineWidth&&this.selectionBorderColor&&(e.lineWidth=this.selectionLineWidth,e.strokeStyle=this.selectionBorderColor,s+=d,l+=d,c-=d,u-=d,t.Object.prototype._setLineDash.call(this,e,this.selectionDashArray),e.strokeRect(s,l,c-s,u-l))},findTarget:function(e,t){if(!this.skipTargetFind){var n,i,o=this.getPointer(e,!0),a=this._activeObject,s=this.getActiveObjects(),l=r(e),c=s.length>1&&!t||1===s.length;if(this.targets=[],c&&a._findTargetCorner(o,l)||s.length>1&&!t&&a===this._searchPossibleTargets([a],o))return a;if(1===s.length&&a===this._searchPossibleTargets([a],o)){if(!this.preserveObjectStacking)return a;n=a,i=this.targets,this.targets=[]}var u=this._searchPossibleTargets(this._objects,o);return e[this.altSelectionKey]&&u&&n&&u!==n&&(u=n,this.targets=i),u}},_checkTarget:function(e,t,n){if(t&&t.visible&&t.evented&&t.containsPoint(e)){if(!this.perPixelTargetFind&&!t.perPixelTargetFind||t.isEditing)return!0;if(!this.isTargetTransparent(t,n.x,n.y))return!0}},_searchPossibleTargets:function(e,n){for(var r,i,o=e.length;o--;){var a=e[o],s=a.group?this._normalizePointer(a.group,n):n;if(this._checkTarget(s,a,n)){(r=e[o]).subTargetCheck&&r instanceof t.Group&&(i=this._searchPossibleTargets(r._objects,n))&&this.targets.push(i);break}}return r},restorePointerVpt:function(e){return t.util.transformPoint(e,t.util.invertTransform(this.viewportTransform))},getPointer:function(t,n){if(this._absolutePointer&&!n)return this._absolutePointer;if(this._pointer&&n)return this._pointer;var r,i=e(t),o=this.upperCanvasEl,a=o.getBoundingClientRect(),s=a.width||0,l=a.height||0;(!s||!l)&&("top"in a&&"bottom"in a&&(l=Math.abs(a.top-a.bottom)),"right"in a&&"left"in a&&(s=Math.abs(a.right-a.left))),this.calcOffset(),i.x=i.x-this._offset.left,i.y=i.y-this._offset.top,n||(i=this.restorePointerVpt(i));var c=this.getRetinaScaling();return 1!==c&&(i.x/=c,i.y/=c),r=0===s||0===l?{width:1,height:1}:{width:o.width/s,height:o.height/l},{x:i.x*r.width,y:i.y*r.height}},_createUpperCanvas:function(){var e=this.lowerCanvasEl.className.replace(/\s*lower-canvas\s*/,""),n=this.lowerCanvasEl,r=this.upperCanvasEl;r?r.className="":(r=this._createCanvasElement(),this.upperCanvasEl=r),t.util.addClass(r,"upper-canvas "+e),this.wrapperEl.appendChild(r),this._copyCanvasStyle(n,r),this._applyCanvasStyle(r),this.contextTop=r.getContext("2d")},getTopContext:function(){return this.contextTop},_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=t.util.wrapElement(this.lowerCanvasEl,"div",{class:this.containerClass}),t.util.setStyle(this.wrapperEl,{width:this.width+"px",height:this.height+"px",position:"relative"}),t.util.makeElementUnselectable(this.wrapperEl)},_applyCanvasStyle:function(e){var n=this.width||e.width,r=this.height||e.height;t.util.setStyle(e,{position:"absolute",width:n+"px",height:r+"px",left:0,top:0,"touch-action":this.allowTouchScrolling?"manipulation":"none","-ms-touch-action":this.allowTouchScrolling?"manipulation":"none"}),e.width=n,e.height=r,t.util.makeElementUnselectable(e)},_copyCanvasStyle:function(e,t){t.style.cssText=e.style.cssText},getSelectionContext:function(){return this.contextTop},getSelectionElement:function(){return this.upperCanvasEl},getActiveObject:function(){return this._activeObject},getActiveObjects:function(){var e=this._activeObject;return e?"activeSelection"===e.type&&e._objects?e._objects.slice(0):[e]:[]},_onObjectRemoved:function(e){e===this._activeObject&&(this.fire("before:selection:cleared",{target:e}),this._discardActiveObject(),this.fire("selection:cleared",{target:e}),e.fire("deselected")),e===this._hoveredTarget&&(this._hoveredTarget=null,this._hoveredTargets=[]),this.callSuper("_onObjectRemoved",e)},_fireSelectionEvents:function(e,t){var n=!1,r=this.getActiveObjects(),i=[],o=[];e.forEach(function(e){-1===r.indexOf(e)&&(n=!0,e.fire("deselected",{e:t,target:e}),o.push(e))}),r.forEach(function(r){-1===e.indexOf(r)&&(n=!0,r.fire("selected",{e:t,target:r}),i.push(r))}),e.length>0&&r.length>0?n&&this.fire("selection:updated",{e:t,selected:i,deselected:o}):r.length>0?this.fire("selection:created",{e:t,selected:i}):e.length>0&&this.fire("selection:cleared",{e:t,deselected:o})},setActiveObject:function(e,t){var n=this.getActiveObjects();return this._setActiveObject(e,t),this._fireSelectionEvents(n,t),this},_setActiveObject:function(e,t){return!(this._activeObject===e||!this._discardActiveObject(t,e)||e.onSelect({e:t}))&&(this._activeObject=e,!0)},_discardActiveObject:function(e,t){var n=this._activeObject;if(n){if(n.onDeselect({e:e,object:t}))return!1;this._activeObject=null}return!0},discardActiveObject:function(e){var t=this.getActiveObjects(),n=this.getActiveObject();return t.length&&this.fire("before:selection:cleared",{target:n,e:e}),this._discardActiveObject(e),this._fireSelectionEvents(t,e),this},dispose:function(){var e=this.wrapperEl;return this.removeListeners(),e.removeChild(this.upperCanvasEl),e.removeChild(this.lowerCanvasEl),this.contextCache=null,this.contextTop=null,["upperCanvasEl","cacheCanvasEl"].forEach(function(e){t.util.cleanUpJsdomNode(this[e]),this[e]=void 0}.bind(this)),e.parentNode&&e.parentNode.replaceChild(this.lowerCanvasEl,this.wrapperEl),delete this.wrapperEl,t.StaticCanvas.prototype.dispose.call(this),this},clear:function(){return this.discardActiveObject(),this.clearContext(this.contextTop),this.callSuper("clear")},drawControls:function(e){var t=this._activeObject;t&&t._renderControls(e)},_toObject:function(e,t,n){var r=this._realizeGroupTransformOnObject(e),i=this.callSuper("_toObject",e,t,n);return this._unwindGroupTransformOnObject(e,r),i},_realizeGroupTransformOnObject:function(e){if(e.group&&"activeSelection"===e.group.type&&this._activeObject===e.group){var n={};return["angle","flipX","flipY","left","scaleX","scaleY","skewX","skewY","top"].forEach(function(t){n[t]=e[t]}),t.util.addTransformToObject(e,this._activeObject.calcOwnMatrix()),n}return null},_unwindGroupTransformOnObject:function(e,t){t&&e.set(t)},_setSVGObject:function(e,t,n){var r=this._realizeGroupTransformOnObject(t);this.callSuper("_setSVGObject",e,t,n),this._unwindGroupTransformOnObject(t,r)},setViewportTransform:function(e){this.renderOnAddRemove&&this._activeObject&&this._activeObject.isEditing&&this._activeObject.clearContextTop(),t.StaticCanvas.prototype.setViewportTransform.call(this,e)}}),t.StaticCanvas)"prototype"!==i&&(t.Canvas[i]=t.StaticCanvas[i])}(),function(){var e=t.util.addListener,n=t.util.removeListener,r={passive:!1};function i(e,t){return e.button&&e.button===t-1}t.util.object.extend(t.Canvas.prototype,{mainTouchId:null,_initEventListeners:function(){this.removeListeners(),this._bindEvents(),this.addOrRemove(e,"add")},_getEventPrefix:function(){return this.enablePointerEvents?"pointer":"mouse"},addOrRemove:function(e,n){var i=this.upperCanvasEl,o=this._getEventPrefix();e(t.window,"resize",this._onResize),e(i,o+"down",this._onMouseDown),e(i,o+"move",this._onMouseMove,r),e(i,o+"out",this._onMouseOut),e(i,o+"enter",this._onMouseEnter),e(i,"wheel",this._onMouseWheel),e(i,"contextmenu",this._onContextMenu),e(i,"dblclick",this._onDoubleClick),e(i,"dragover",this._onDragOver),e(i,"dragenter",this._onDragEnter),e(i,"dragleave",this._onDragLeave),e(i,"drop",this._onDrop),this.enablePointerEvents||e(i,"touchstart",this._onTouchStart,r),typeof eventjs<"u"&&n in eventjs&&(eventjs[n](i,"gesture",this._onGesture),eventjs[n](i,"drag",this._onDrag),eventjs[n](i,"orientation",this._onOrientationChange),eventjs[n](i,"shake",this._onShake),eventjs[n](i,"longpress",this._onLongPress))},removeListeners:function(){this.addOrRemove(n,"remove");var e=this._getEventPrefix();n(t.document,e+"up",this._onMouseUp),n(t.document,"touchend",this._onTouchEnd,r),n(t.document,e+"move",this._onMouseMove,r),n(t.document,"touchmove",this._onMouseMove,r)},_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._onDrop.bind(this),this.eventsBound=!0)},_onGesture:function(e,t){this.__onTransformGesture&&this.__onTransformGesture(e,t)},_onDrag:function(e,t){this.__onDrag&&this.__onDrag(e,t)},_onMouseWheel:function(e){this.__onMouseWheel(e)},_onMouseOut:function(e){var t=this._hoveredTarget;this.fire("mouse:out",{target:t,e:e}),this._hoveredTarget=null,t&&t.fire("mouseout",{e:e});var n=this;this._hoveredTargets.forEach(function(r){n.fire("mouse:out",{target:t,e:e}),r&&t.fire("mouseout",{e:e})}),this._hoveredTargets=[]},_onMouseEnter:function(e){!this._currentTransform&&!this.findTarget(e)&&(this.fire("mouse:over",{target:null,e:e}),this._hoveredTarget=null,this._hoveredTargets=[])},_onOrientationChange:function(e,t){this.__onOrientationChange&&this.__onOrientationChange(e,t)},_onShake:function(e,t){this.__onShake&&this.__onShake(e,t)},_onLongPress:function(e,t){this.__onLongPress&&this.__onLongPress(e,t)},_onDragOver:function(e){e.preventDefault();var t=this._simpleEventHandler("dragover",e);this._fireEnterLeaveEvents(t,e)},_onDrop:function(e){return this._simpleEventHandler("drop:before",e),this._simpleEventHandler("drop",e)},_onContextMenu:function(e){return this.stopContextMenu&&(e.stopPropagation(),e.preventDefault()),!1},_onDoubleClick:function(e){this._cacheTransformEventData(e),this._handleEvent(e,"dblclick"),this._resetTransformEventData(e)},getPointerId:function(e){var t=e.changedTouches;return t?t[0]&&t[0].identifier:this.enablePointerEvents?e.pointerId:-1},_isMainEvent:function(e){return!0===e.isPrimary||!1!==e.isPrimary&&("touchend"===e.type&&0===e.touches.length||!e.changedTouches||e.changedTouches[0].identifier===this.mainTouchId)},_onTouchStart:function(i){i.preventDefault(),null===this.mainTouchId&&(this.mainTouchId=this.getPointerId(i)),this.__onMouseDown(i),this._resetTransformEventData();var o=this.upperCanvasEl,a=this._getEventPrefix();e(t.document,"touchend",this._onTouchEnd,r),e(t.document,"touchmove",this._onMouseMove,r),n(o,a+"down",this._onMouseDown)},_onMouseDown:function(i){this.__onMouseDown(i),this._resetTransformEventData();var o=this.upperCanvasEl,a=this._getEventPrefix();n(o,a+"move",this._onMouseMove,r),e(t.document,a+"up",this._onMouseUp),e(t.document,a+"move",this._onMouseMove,r)},_onTouchEnd:function(i){if(!(i.touches.length>0)){this.__onMouseUp(i),this._resetTransformEventData(),this.mainTouchId=null;var o=this._getEventPrefix();n(t.document,"touchend",this._onTouchEnd,r),n(t.document,"touchmove",this._onMouseMove,r);var a=this;this._willAddMouseDown&&clearTimeout(this._willAddMouseDown),this._willAddMouseDown=setTimeout(function(){e(a.upperCanvasEl,o+"down",a._onMouseDown),a._willAddMouseDown=0},400)}},_onMouseUp:function(i){this.__onMouseUp(i),this._resetTransformEventData();var o=this.upperCanvasEl,a=this._getEventPrefix();this._isMainEvent(i)&&(n(t.document,a+"up",this._onMouseUp),n(t.document,a+"move",this._onMouseMove,r),e(o,a+"move",this._onMouseMove,r))},_onMouseMove:function(e){!this.allowTouchScrolling&&e.preventDefault&&e.preventDefault(),this.__onMouseMove(e)},_onResize:function(){this.calcOffset()},_shouldRender:function(e){var t=this._activeObject;return!!(!!t!=!!e||t&&e&&t!==e)||(t&&t.isEditing,!1)},__onMouseUp:function(e){var n,r=this._currentTransform,o=this._groupSelector,a=!1,s=!o||0===o.left&&0===o.top;if(this._cacheTransformEventData(e),n=this._target,this._handleEvent(e,"up:before"),i(e,3))this.fireRightClick&&this._handleEvent(e,"up",3,s);else{if(i(e,2))return this.fireMiddleClick&&this._handleEvent(e,"up",2,s),void this._resetTransformEventData();if(this.isDrawingMode&&this._isCurrentlyDrawing)this._onMouseUpInDrawingMode(e);else if(this._isMainEvent(e)){if(r&&(this._finalizeCurrentTransform(e),a=r.actionPerformed),!s){var l=n===this._activeObject;this._maybeGroupObjects(e),a||(a=this._shouldRender(n)||!l&&n===this._activeObject)}var c,u;if(n){if(c=n._findTargetCorner(this.getPointer(e,!0),t.util.isTouchEvent(e)),n.selectable&&n!==this._activeObject&&"up"===n.activeOn)this.setActiveObject(n,e),a=!0;else{var d=n.controls[c],h=d&&d.getMouseUpHandler(e,n,d);h&&h(e,r,(u=this.getPointer(e)).x,u.y)}n.isMoving=!1}if(r&&(r.target!==n||r.corner!==c)){var f=r.target&&r.target.controls[r.corner],p=f&&f.getMouseUpHandler(e,n,d);u=u||this.getPointer(e),p&&p(e,r,u.x,u.y)}this._setCursorFromEvent(e,n),this._handleEvent(e,"up",1,s),this._groupSelector=null,this._currentTransform=null,n&&(n.__corner=0),a?this.requestRenderAll():s||this.renderTop()}}},_simpleEventHandler:function(e,t){var n=this.findTarget(t),r=this.targets,i={e:t,target:n,subTargets:r};if(this.fire(e,i),n&&n.fire(e,i),!r)return n;for(var o=0;o<r.length;o++)r[o].fire(e,i);return n},_handleEvent:function(e,t,n,r){var i=this._target,o=this.targets||[],a={e:e,target:i,subTargets:o,button:n||1,isClick:r||!1,pointer:this._pointer,absolutePointer:this._absolutePointer,transform:this._currentTransform};"up"===t&&(a.currentTarget=this.findTarget(e),a.currentSubTargets=this.targets),this.fire("mouse:"+t,a),i&&i.fire("mouse"+t,a);for(var s=0;s<o.length;s++)o[s].fire("mouse"+t,a)},_finalizeCurrentTransform:function(e){var t=this._currentTransform,n=t.target,r={e:e,target:n,transform:t,action:t.action};n._scaling&&(n._scaling=!1),n.setCoords(),(t.actionPerformed||this.stateful&&n.hasStateChanged())&&this._fire("modified",r)},_onMouseDownInDrawingMode:function(e){this._isCurrentlyDrawing=!0,this.getActiveObject()&&this.discardActiveObject(e).requestRenderAll();var t=this.getPointer(e);this.freeDrawingBrush.onMouseDown(t,{e:e,pointer:t}),this._handleEvent(e,"down")},_onMouseMoveInDrawingMode:function(e){if(this._isCurrentlyDrawing){var t=this.getPointer(e);this.freeDrawingBrush.onMouseMove(t,{e:e,pointer:t})}this.setCursor(this.freeDrawingCursor),this._handleEvent(e,"move")},_onMouseUpInDrawingMode:function(e){var t=this.getPointer(e);this._isCurrentlyDrawing=this.freeDrawingBrush.onMouseUp({e:e,pointer:t}),this._handleEvent(e,"up")},__onMouseDown:function(e){this._cacheTransformEventData(e),this._handleEvent(e,"down:before");var n=this._target;if(i(e,3))this.fireRightClick&&this._handleEvent(e,"down",3);else if(i(e,2))this.fireMiddleClick&&this._handleEvent(e,"down",2);else if(this.isDrawingMode)this._onMouseDownInDrawingMode(e);else if(this._isMainEvent(e)&&!this._currentTransform){var r=this._pointer;this._previousPointer=r;var o=this._shouldRender(n),a=this._shouldGroup(e,n);if(this._shouldClearSelection(e,n)?this.discardActiveObject(e):a&&(this._handleGrouping(e,n),n=this._activeObject),this.selection&&(!n||!n.selectable&&!n.isEditing&&n!==this._activeObject)&&(this._groupSelector={ex:this._absolutePointer.x,ey:this._absolutePointer.y,top:0,left:0}),n){var s=n===this._activeObject;n.selectable&&"down"===n.activeOn&&this.setActiveObject(n,e);var l=n._findTargetCorner(this.getPointer(e,!0),t.util.isTouchEvent(e));if(n.__corner=l,n===this._activeObject&&(l||!a)){this._setupCurrentTransform(e,n,s);var c=n.controls[l],u=(r=this.getPointer(e),c&&c.getMouseDownHandler(e,n,c));u&&u(e,this._currentTransform,r.x,r.y)}}this._handleEvent(e,"down"),(o||a)&&this.requestRenderAll()}},_resetTransformEventData:function(){this._target=null,this._pointer=null,this._absolutePointer=null},_cacheTransformEventData:function(e){this._resetTransformEventData(),this._pointer=this.getPointer(e,!0),this._absolutePointer=this.restorePointerVpt(this._pointer),this._target=this._currentTransform?this._currentTransform.target:this.findTarget(e)||null},_beforeTransform:function(e){var t=this._currentTransform;this.stateful&&t.target.saveState(),this.fire("before:transform",{e:e,transform:t})},__onMouseMove:function(e){var t,n;if(this._handleEvent(e,"move:before"),this._cacheTransformEventData(e),this.isDrawingMode)this._onMouseMoveInDrawingMode(e);else if(this._isMainEvent(e)){var r=this._groupSelector;r?(n=this._absolutePointer,r.left=n.x-r.ex,r.top=n.y-r.ey,this.renderTop()):this._currentTransform?this._transformObject(e):(t=this.findTarget(e)||null,this._setCursorFromEvent(e,t),this._fireOverOutEvents(t,e)),this._handleEvent(e,"move"),this._resetTransformEventData()}},_fireOverOutEvents:function(e,t){var n=this._hoveredTarget,r=this._hoveredTargets,i=this.targets,o=Math.max(r.length,i.length);this.fireSyntheticInOutEvents(e,t,{oldTarget:n,evtOut:"mouseout",canvasEvtOut:"mouse:out",evtIn:"mouseover",canvasEvtIn:"mouse:over"});for(var a=0;a<o;a++)this.fireSyntheticInOutEvents(i[a],t,{oldTarget:r[a],evtOut:"mouseout",evtIn:"mouseover"});this._hoveredTarget=e,this._hoveredTargets=this.targets.concat()},_fireEnterLeaveEvents:function(e,t){var n=this._draggedoverTarget,r=this._hoveredTargets,i=this.targets,o=Math.max(r.length,i.length);this.fireSyntheticInOutEvents(e,t,{oldTarget:n,evtOut:"dragleave",evtIn:"dragenter"});for(var a=0;a<o;a++)this.fireSyntheticInOutEvents(i[a],t,{oldTarget:r[a],evtOut:"dragleave",evtIn:"dragenter"});this._draggedoverTarget=e},fireSyntheticInOutEvents:function(e,t,n){var r,i,o,a=n.oldTarget,s=a!==e,l=n.canvasEvtIn,c=n.canvasEvtOut;s&&(r={e:t,target:e,previousTarget:a},i={e:t,target:a,nextTarget:e}),o=e&&s,a&&s&&(c&&this.fire(c,i),a.fire(n.evtOut,i)),o&&(l&&this.fire(l,r),e.fire(n.evtIn,r))},__onMouseWheel:function(e){this._cacheTransformEventData(e),this._handleEvent(e,"wheel"),this._resetTransformEventData()},_transformObject:function(e){var t=this.getPointer(e),n=this._currentTransform;n.reset=!1,n.shiftKey=e.shiftKey,n.altKey=e[this.centeredKey],this._performTransformAction(e,n,t),n.actionPerformed&&this.requestRenderAll()},_performTransformAction:function(e,t,n){var r=n.x,i=n.y,o=t.action,a=!1,s=t.actionHandler;s&&(a=s(e,t,r,i)),"drag"===o&&a&&(t.target.isMoving=!0,this.setCursor(t.target.moveCursor||this.moveCursor)),t.actionPerformed=t.actionPerformed||a},_fire:t.controlsUtils.fireEvent,_setCursorFromEvent:function(e,t){if(!t)return this.setCursor(this.defaultCursor),!1;var n=t.hoverCursor||this.hoverCursor,r=this._activeObject&&"activeSelection"===this._activeObject.type?this._activeObject:null,i=(!r||!r.contains(t))&&t._findTargetCorner(this.getPointer(e,!0));i?this.setCursor(this.getCornerCursor(i,t,e)):(t.subTargetCheck&&this.targets.concat().reverse().map(function(e){n=e.hoverCursor||n}),this.setCursor(n))},getCornerCursor:function(e,t,n){var r=t.controls[e];return r.cursorStyleHandler(n,r,t)}})}(),function(){var e=Math.min,n=Math.max;t.util.object.extend(t.Canvas.prototype,{_shouldGroup:function(e,t){var n=this._activeObject;return n&&this._isSelectionKeyPressed(e)&&t&&t.selectable&&this.selection&&(n!==t||"activeSelection"===n.type)&&!t.onSelect({e:e})},_handleGrouping:function(e,t){var n=this._activeObject;n.__corner||t===n&&(!(t=this.findTarget(e,!0))||!t.selectable)||(n&&"activeSelection"===n.type?this._updateActiveSelection(t,e):this._createActiveSelection(t,e))},_updateActiveSelection:function(e,t){var n=this._activeObject,r=n._objects.slice(0);n.contains(e)?(n.removeWithUpdate(e),this._hoveredTarget=e,this._hoveredTargets=this.targets.concat(),1===n.size()&&this._setActiveObject(n.item(0),t)):(n.addWithUpdate(e),this._hoveredTarget=n,this._hoveredTargets=this.targets.concat()),this._fireSelectionEvents(r,t)},_createActiveSelection:function(e,t){var n=this.getActiveObjects(),r=this._createGroup(e);this._hoveredTarget=r,this._setActiveObject(r,t),this._fireSelectionEvents(n,t)},_createGroup:function(e){var n=this._objects,r=n.indexOf(this._activeObject)<n.indexOf(e)?[this._activeObject,e]:[e,this._activeObject];return this._activeObject.isEditing&&this._activeObject.exitEditing(),new t.ActiveSelection(r,{canvas:this})},_groupSelectedObjects:function(e){var n,r=this._collectObjects(e);1===r.length?this.setActiveObject(r[0],e):r.length>1&&(n=new t.ActiveSelection(r.reverse(),{canvas:this}),this.setActiveObject(n,e))},_collectObjects:function(r){for(var i,o=[],a=this._groupSelector.ex,s=this._groupSelector.ey,l=a+this._groupSelector.left,c=s+this._groupSelector.top,u=new t.Point(e(a,l),e(s,c)),d=new t.Point(n(a,l),n(s,c)),h=!this.selectionFullyContained,f=a===l&&s===c,p=this._objects.length;p--&&!((i=this._objects[p])&&i.selectable&&i.visible&&(h&&i.intersectsWithRect(u,d,!0)||i.isContainedWithinRect(u,d,!0)||h&&i.containsPoint(u,null,!0)||h&&i.containsPoint(d,null,!0))&&(o.push(i),f)););return o.length>1&&(o=o.filter(function(e){return!e.onSelect({e:r})})),o},_maybeGroupObjects:function(e){this.selection&&this._groupSelector&&this._groupSelectedObjects(e),this.setCursor(this.defaultCursor),this._groupSelector=null}})}(),t.util.object.extend(t.StaticCanvas.prototype,{toDataURL:function(e){e||(e={});var n=e.format||"png",r=e.quality||1,i=(e.multiplier||1)*(e.enableRetinaScaling?this.getRetinaScaling():1),o=this.toCanvasElement(i,e);return t.util.toDataURL(o,n,r)},toCanvasElement:function(e,n){e=e||1;var r=((n=n||{}).width||this.width)*e,i=(n.height||this.height)*e,o=this.getZoom(),a=this.width,s=this.height,l=o*e,c=this.viewportTransform,u=(c[4]-(n.left||0))*e,d=(c[5]-(n.top||0))*e,h=this.interactive,f=[l,0,0,l,u,d],p=this.enableRetinaScaling,g=t.util.createCanvasElement(),m=this.contextTop;return g.width=r,g.height=i,this.contextTop=null,this.enableRetinaScaling=!1,this.interactive=!1,this.viewportTransform=f,this.width=r,this.height=i,this.calcViewportBoundaries(),this.renderCanvas(g.getContext("2d"),this._objects),this.viewportTransform=c,this.width=a,this.height=s,this.calcViewportBoundaries(),this.interactive=h,this.enableRetinaScaling=p,this.contextTop=m,g}}),t.util.object.extend(t.StaticCanvas.prototype,{loadFromJSON:function(e,n,r){if(e){var i="string"==typeof e?JSON.parse(e):t.util.object.clone(e),o=this,a=i.clipPath,s=this.renderOnAddRemove;return this.renderOnAddRemove=!1,delete i.clipPath,this._enlivenObjects(i.objects,function(e){o.clear(),o._setBgOverlay(i,function(){a?o._enlivenObjects([a],function(t){o.clipPath=t[0],o.__setupCanvas.call(o,i,e,s,n)}):o.__setupCanvas.call(o,i,e,s,n)})},r),this}},__setupCanvas:function(e,t,n,r){var i=this;t.forEach(function(e,t){i.insertAt(e,t)}),this.renderOnAddRemove=n,delete e.objects,delete e.backgroundImage,delete e.overlayImage,delete e.background,delete e.overlay,this._setOptions(e),this.renderAll(),r&&r()},_setBgOverlay:function(e,t){var n={backgroundColor:!1,overlayColor:!1,backgroundImage:!1,overlayImage:!1};if(e.backgroundImage||e.overlayImage||e.background||e.overlay){var r=function(){n.backgroundImage&&n.overlayImage&&n.backgroundColor&&n.overlayColor&&t&&t()};this.__setBgOverlay("backgroundImage",e.backgroundImage,n,r),this.__setBgOverlay("overlayImage",e.overlayImage,n,r),this.__setBgOverlay("backgroundColor",e.background,n,r),this.__setBgOverlay("overlayColor",e.overlay,n,r)}else t&&t()},__setBgOverlay:function(e,n,r,i){var o=this;if(!n)return r[e]=!0,void(i&&i());"backgroundImage"===e||"overlayImage"===e?t.util.enlivenObjects([n],function(t){o[e]=t[0],r[e]=!0,i&&i()}):this["set"+t.util.string.capitalize(e,!0)](n,function(){r[e]=!0,i&&i()})},_enlivenObjects:function(e,n,r){e&&0!==e.length?t.util.enlivenObjects(e,function(e){n&&n(e)},null,r):n&&n([])},_toDataURL:function(e,t){this.clone(function(n){t(n.toDataURL(e))})},_toDataURLWithMultiplier:function(e,t,n){this.clone(function(r){n(r.toDataURLWithMultiplier(e,t))})},clone:function(e,t){var n=JSON.stringify(this.toJSON(t));this.cloneWithoutData(function(t){t.loadFromJSON(n,function(){e&&e(t)})})},cloneWithoutData:function(e){var n=t.util.createCanvasElement();n.width=this.width,n.height=this.height;var r=new t.Canvas(n);this.backgroundImage?(r.setBackgroundImage(this.backgroundImage.src,function(){r.renderAll(),e&&e(r)}),r.backgroundImageOpacity=this.backgroundImageOpacity,r.backgroundImageStretch=this.backgroundImageStretch):e&&e(r)}}),function(e){var t=e.fabric||(e.fabric={}),n=t.util.object.extend,r=t.util.object.clone,i=t.util.toFixed,o=t.util.string.capitalize,a=t.util.degreesToRadians,s=!t.isLikelyNode;t.Object||(t.Object=t.util.createClass(t.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:s,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(e){e&&this.setOptions(e)},_createCacheCanvas:function(){this._cacheProperties={},this._cacheCanvas=t.util.createCanvasElement(),this._cacheContext=this._cacheCanvas.getContext("2d"),this._updateCacheCanvas(),this.dirty=!0},_limitCacheSize:function(e){var n=t.perfLimitSizeTotal,r=e.width,i=e.height,o=t.maxCacheSideLimit,a=t.minCacheSideLimit;if(r<=o&&i<=o&&r*i<=n)return r<a&&(e.width=a),i<a&&(e.height=a),e;var s=r/i,l=t.util.limitDimsByArea(s,n),c=t.util.capValue,u=c(a,l.x,o),d=c(a,l.y,o);return r>u&&(e.zoomX/=r/u,e.width=u,e.capped=!0),i>d&&(e.zoomY/=i/d,e.height=d,e.capped=!0),e},_getCacheCanvasDimensions:function(){var e=this.getTotalObjectScaling(),t=this._getTransformedDimensions(0,0),n=t.x*e.scaleX/this.scaleX,r=t.y*e.scaleY/this.scaleY;return{width:n+2,height:r+2,zoomX:e.scaleX,zoomY:e.scaleY,x:n,y:r}},_updateCacheCanvas:function(){var e=this.canvas;if(this.noScaleCache&&e&&e._currentTransform){var n=e._currentTransform.target,r=e._currentTransform.action;if(this===n&&r.slice&&"scale"===r.slice(0,5))return!1}var i,o,a=this._cacheCanvas,s=this._limitCacheSize(this._getCacheCanvasDimensions()),l=t.minCacheSideLimit,c=s.width,u=s.height,d=s.zoomX,h=s.zoomY,f=c!==this.cacheWidth||u!==this.cacheHeight,p=this.zoomX!==d||this.zoomY!==h,g=f||p,m=0,v=0,y=!1;if(f){var b=this._cacheCanvas.width,w=this._cacheCanvas.height,x=c>b||u>w;y=x||(c<.9*b||u<.9*w)&&b>l&&w>l,x&&!s.capped&&(c>l||u>l)&&(m=.1*c,v=.1*u)}return this instanceof t.Text&&this.path&&(g=!0,y=!0,m+=this.getHeightOfLine(0)*this.zoomX,v+=this.getHeightOfLine(0)*this.zoomY),!!g&&(y?(a.width=Math.ceil(c+m),a.height=Math.ceil(u+v)):(this._cacheContext.setTransform(1,0,0,1,0,0),this._cacheContext.clearRect(0,0,a.width,a.height)),i=s.x/2,o=s.y/2,this.cacheTranslationX=Math.round(a.width/2-i)+i,this.cacheTranslationY=Math.round(a.height/2-o)+o,this.cacheWidth=c,this.cacheHeight=u,this._cacheContext.translate(this.cacheTranslationX,this.cacheTranslationY),this._cacheContext.scale(d,h),this.zoomX=d,this.zoomY=h,!0)},setOptions:function(e){this._setOptions(e),this._initGradient(e.fill,"fill"),this._initGradient(e.stroke,"stroke"),this._initPattern(e.fill,"fill"),this._initPattern(e.stroke,"stroke")},transform:function(e){var t=this.group&&!this.group._transformDone||this.group&&this.canvas&&e===this.canvas.contextTop,n=this.calcTransformMatrix(!t);e.transform(n[0],n[1],n[2],n[3],n[4],n[5])},toObject:function(e){var n=t.Object.NUM_FRACTION_DIGITS,r={type:this.type,version:t.version,originX:this.originX,originY:this.originY,left:i(this.left,n),top:i(this.top,n),width:i(this.width,n),height:i(this.height,n),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,n),strokeDashArray:this.strokeDashArray?this.strokeDashArray.concat():this.strokeDashArray,strokeLineCap:this.strokeLineCap,strokeDashOffset:this.strokeDashOffset,strokeLineJoin:this.strokeLineJoin,strokeUniform:this.strokeUniform,strokeMiterLimit:i(this.strokeMiterLimit,n),scaleX:i(this.scaleX,n),scaleY:i(this.scaleY,n),angle:i(this.angle,n),flipX:this.flipX,flipY:this.flipY,opacity:i(this.opacity,n),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,n),skewY:i(this.skewY,n)};return this.clipPath&&!this.clipPath.excludeFromExport&&(r.clipPath=this.clipPath.toObject(e),r.clipPath.inverted=this.clipPath.inverted,r.clipPath.absolutePositioned=this.clipPath.absolutePositioned),t.util.populateWithProperties(this,r,e),this.includeDefaultValues||(r=this._removeDefaultValues(r)),r},toDatalessObject:function(e){return this.toObject(e)},_removeDefaultValues:function(e){var n=t.util.getKlass(e.type).prototype;return n.stateProperties.forEach(function(t){"left"===t||"top"===t||(e[t]===n[t]&&delete e[t],Array.isArray(e[t])&&Array.isArray(n[t])&&0===e[t].length&&0===n[t].length&&delete e[t])}),e},toString:function(){return"#<fabric."+o(this.type)+">"},getObjectScaling:function(){if(!this.group)return{scaleX:this.scaleX,scaleY:this.scaleY};var e=t.util.qrDecompose(this.calcTransformMatrix());return{scaleX:Math.abs(e.scaleX),scaleY:Math.abs(e.scaleY)}},getTotalObjectScaling:function(){var e=this.getObjectScaling(),t=e.scaleX,n=e.scaleY;if(this.canvas){var r=this.canvas.getZoom(),i=this.canvas.getRetinaScaling();t*=r*i,n*=r*i}return{scaleX:t,scaleY:n}},getObjectOpacity:function(){var e=this.opacity;return this.group&&(e*=this.group.getObjectOpacity()),e},_set:function(e,n){var r="scaleX"===e||"scaleY"===e,i=this[e]!==n,o=!1;return r&&(n=this._constrainScale(n)),"scaleX"===e&&n<0?(this.flipX=!this.flipX,n*=-1):"scaleY"===e&&n<0?(this.flipY=!this.flipY,n*=-1):"shadow"!==e||!n||n instanceof t.Shadow?"dirty"===e&&this.group&&this.group.set("dirty",n):n=new t.Shadow(n),this[e]=n,i&&(o=this.group&&this.group.isOnACache(),this.cacheProperties.indexOf(e)>-1?(this.dirty=!0,o&&this.group.set("dirty",!0)):o&&this.stateProperties.indexOf(e)>-1&&this.group.set("dirty",!0)),this},setOnGroup:function(){},getViewportTransform:function(){return this.canvas&&this.canvas.viewportTransform?this.canvas.viewportTransform:t.iMatrix.concat()},isNotVisible:function(){return 0===this.opacity||!this.width&&!this.height&&0===this.strokeWidth||!this.visible},render:function(e){this.isNotVisible()||this.canvas&&this.canvas.skipOffscreen&&!this.group&&!this.isOnScreen()||(e.save(),this._setupCompositeOperation(e),this.drawSelectionBackground(e),this.transform(e),this._setOpacity(e),this._setShadow(e,this),this.shouldCache()?(this.renderCache(),this.drawCacheOnCanvas(e)):(this._removeCacheCanvas(),this.dirty=!1,this.drawObject(e),this.objectCaching&&this.statefullCache&&this.saveState({propertySet:"cacheProperties"})),e.restore())},renderCache:function(e){e=e||{},(!this._cacheCanvas||!this._cacheContext)&&this._createCacheCanvas(),this.isCacheDirty()&&(this.statefullCache&&this.saveState({propertySet:"cacheProperties"}),this.drawObject(this._cacheContext,e.forClipping),this.dirty=!1)},_removeCacheCanvas:function(){this._cacheCanvas=null,this._cacheContext=null,this.cacheWidth=0,this.cacheHeight=0},hasStroke:function(){return this.stroke&&"transparent"!==this.stroke&&0!==this.strokeWidth},hasFill:function(){return this.fill&&"transparent"!==this.fill},needsItsOwnCache:function(){return!!("stroke"===this.paintFirst&&this.hasFill()&&this.hasStroke()&&"object"==typeof this.shadow||this.clipPath)},shouldCache:function(){return this.ownCaching=this.needsItsOwnCache()||this.objectCaching&&(!this.group||!this.group.isOnACache()),this.ownCaching},willDrawShadow:function(){return!!this.shadow&&(0!==this.shadow.offsetX||0!==this.shadow.offsetY)},drawClipPathOnCache:function(e,n){if(e.save(),n.inverted?e.globalCompositeOperation="destination-out":e.globalCompositeOperation="destination-in",n.absolutePositioned){var r=t.util.invertTransform(this.calcTransformMatrix());e.transform(r[0],r[1],r[2],r[3],r[4],r[5])}n.transform(e),e.scale(1/n.zoomX,1/n.zoomY),e.drawImage(n._cacheCanvas,-n.cacheTranslationX,-n.cacheTranslationY),e.restore()},drawObject:function(e,t){var n=this.fill,r=this.stroke;t?(this.fill="black",this.stroke="",this._setClippingProperties(e)):this._renderBackground(e),this._render(e),this._drawClipPath(e,this.clipPath),this.fill=n,this.stroke=r},_drawClipPath:function(e,t){t&&(t.canvas=this.canvas,t.shouldCache(),t._transformDone=!0,t.renderCache({forClipping:!0}),this.drawClipPathOnCache(e,t))},drawCacheOnCanvas:function(e){e.scale(1/this.zoomX,1/this.zoomY),e.drawImage(this._cacheCanvas,-this.cacheTranslationX,-this.cacheTranslationY)},isCacheDirty:function(e){if(this.isNotVisible())return!1;if(this._cacheCanvas&&this._cacheContext&&!e&&this._updateCacheCanvas())return!0;if(this.dirty||this.clipPath&&this.clipPath.absolutePositioned||this.statefullCache&&this.hasStateChanged("cacheProperties")){if(this._cacheCanvas&&this._cacheContext&&!e){var t=this.cacheWidth/this.zoomX,n=this.cacheHeight/this.zoomY;this._cacheContext.clearRect(-t/2,-n/2,t,n)}return!0}return!1},_renderBackground:function(e){if(this.backgroundColor){var t=this._getNonTransformedDimensions();e.fillStyle=this.backgroundColor,e.fillRect(-t.x/2,-t.y/2,t.x,t.y),this._removeShadow(e)}},_setOpacity:function(e){this.group&&!this.group._transformDone?e.globalAlpha=this.getObjectOpacity():e.globalAlpha*=this.opacity},_setStrokeStyles:function(e,t){var n=t.stroke;n&&(e.lineWidth=t.strokeWidth,e.lineCap=t.strokeLineCap,e.lineDashOffset=t.strokeDashOffset,e.lineJoin=t.strokeLineJoin,e.miterLimit=t.strokeMiterLimit,n.toLive?"percentage"===n.gradientUnits||n.gradientTransform||n.patternTransform?this._applyPatternForTransformedGradient(e,n):(e.strokeStyle=n.toLive(e,this),this._applyPatternGradientTransform(e,n)):e.strokeStyle=t.stroke)},_setFillStyles:function(e,t){var n=t.fill;n&&(n.toLive?(e.fillStyle=n.toLive(e,this),this._applyPatternGradientTransform(e,t.fill)):e.fillStyle=n)},_setClippingProperties:function(e){e.globalAlpha=1,e.strokeStyle="transparent",e.fillStyle="#000000"},_setLineDash:function(e,t){!t||0===t.length||(1&t.length&&t.push.apply(t,t),e.setLineDash(t))},_renderControls:function(e,n){var r,i,o,s=this.getViewportTransform(),l=this.calcTransformMatrix();i=typeof(n=n||{}).hasBorders<"u"?n.hasBorders:this.hasBorders,o=typeof n.hasControls<"u"?n.hasControls:this.hasControls,l=t.util.multiplyTransformMatrices(s,l),r=t.util.qrDecompose(l),e.save(),e.translate(r.translateX,r.translateY),e.lineWidth=1*this.borderScaleFactor,this.group||(e.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1),this.flipX&&(r.angle-=180),e.rotate(a(this.group?r.angle:this.angle)),n.forActiveSelection||this.group?i&&this.drawBordersInGroup(e,r,n):i&&this.drawBorders(e,n),o&&this.drawControls(e,n),e.restore()},_setShadow:function(e){if(this.shadow){var n,r=this.shadow,i=this.canvas,o=i&&i.viewportTransform[0]||1,a=i&&i.viewportTransform[3]||1;n=r.nonScaling?{scaleX:1,scaleY:1}:this.getObjectScaling(),i&&i._isRetinaScaling()&&(o*=t.devicePixelRatio,a*=t.devicePixelRatio),e.shadowColor=r.color,e.shadowBlur=r.blur*t.browserShadowBlurConstant*(o+a)*(n.scaleX+n.scaleY)/4,e.shadowOffsetX=r.offsetX*o*n.scaleX,e.shadowOffsetY=r.offsetY*a*n.scaleY}},_removeShadow:function(e){this.shadow&&(e.shadowColor="",e.shadowBlur=e.shadowOffsetX=e.shadowOffsetY=0)},_applyPatternGradientTransform:function(e,t){if(!t||!t.toLive)return{offsetX:0,offsetY:0};var n=t.gradientTransform||t.patternTransform,r=-this.width/2+t.offsetX||0,i=-this.height/2+t.offsetY||0;return"percentage"===t.gradientUnits?e.transform(this.width,0,0,this.height,r,i):e.transform(1,0,0,1,r,i),n&&e.transform(n[0],n[1],n[2],n[3],n[4],n[5]),{offsetX:r,offsetY:i}},_renderPaintInOrder:function(e){"stroke"===this.paintFirst?(this._renderStroke(e),this._renderFill(e)):(this._renderFill(e),this._renderStroke(e))},_render:function(){},_renderFill:function(e){this.fill&&(e.save(),this._setFillStyles(e,this),"evenodd"===this.fillRule?e.fill("evenodd"):e.fill(),e.restore())},_renderStroke:function(e){if(this.stroke&&0!==this.strokeWidth){if(this.shadow&&!this.shadow.affectStroke&&this._removeShadow(e),e.save(),this.strokeUniform&&this.group){var t=this.getObjectScaling();e.scale(1/t.scaleX,1/t.scaleY)}else this.strokeUniform&&e.scale(1/this.scaleX,1/this.scaleY);this._setLineDash(e,this.strokeDashArray),this._setStrokeStyles(e,this),e.stroke(),e.restore()}},_applyPatternForTransformedGradient:function(e,n){var r,i=this._limitCacheSize(this._getCacheCanvasDimensions()),o=t.util.createCanvasElement(),a=this.canvas.getRetinaScaling(),s=i.x/this.scaleX/a,l=i.y/this.scaleY/a;o.width=s,o.height=l,(r=o.getContext("2d")).beginPath(),r.moveTo(0,0),r.lineTo(s,0),r.lineTo(s,l),r.lineTo(0,l),r.closePath(),r.translate(s/2,l/2),r.scale(i.zoomX/this.scaleX/a,i.zoomY/this.scaleY/a),this._applyPatternGradientTransform(r,n),r.fillStyle=n.toLive(e),r.fill(),e.translate(-this.width/2-this.strokeWidth/2,-this.height/2-this.strokeWidth/2),e.scale(a*this.scaleX/i.zoomX,a*this.scaleY/i.zoomY),e.strokeStyle=r.createPattern(o,"no-repeat")},_findCenterFromElement:function(){return{x:this.left+this.width/2,y:this.top+this.height/2}},_assignTransformMatrixProps:function(){if(this.transformMatrix){var e=t.util.qrDecompose(this.transformMatrix);this.flipX=!1,this.flipY=!1,this.set("scaleX",e.scaleX),this.set("scaleY",e.scaleY),this.angle=e.angle,this.skewX=e.skewX,this.skewY=0}},_removeTransformMatrix:function(e){var n=this._findCenterFromElement();this.transformMatrix&&(this._assignTransformMatrixProps(),n=t.util.transformPoint(n,this.transformMatrix)),this.transformMatrix=null,e&&(this.scaleX*=e.scaleX,this.scaleY*=e.scaleY,this.cropX=e.cropX,this.cropY=e.cropY,n.x+=e.offsetLeft,n.y+=e.offsetTop,this.width=e.width,this.height=e.height),this.setPositionByOrigin(n,"center","center")},clone:function(e,n){var r=this.toObject(n);this.constructor.fromObject?this.constructor.fromObject(r,e):t.Object._fromObject("Object",r,e)},cloneAsImage:function(e,n){var r=this.toCanvasElement(n);return e&&e(new t.Image(r)),this},toCanvasElement:function(e){e||(e={});var n=t.util,r=n.saveObjectTransform(this),i=this.group,o=this.shadow,a=Math.abs,s=(e.multiplier||1)*(e.enableRetinaScaling?t.devicePixelRatio:1);delete this.group,e.withoutTransform&&n.resetObjectTransform(this),e.withoutShadow&&(this.shadow=null);var l,c,u,d,h=t.util.createCanvasElement(),f=this.getBoundingRect(!0,!0),p=this.shadow,g={x:0,y:0};p&&(c=p.blur,l=p.nonScaling?{scaleX:1,scaleY:1}:this.getObjectScaling(),g.x=2*Math.round(a(p.offsetX)+c)*a(l.scaleX),g.y=2*Math.round(a(p.offsetY)+c)*a(l.scaleY)),u=f.width+g.x,d=f.height+g.y,h.width=Math.ceil(u),h.height=Math.ceil(d);var m=new t.StaticCanvas(h,{enableRetinaScaling:!1,renderOnAddRemove:!1,skipOffscreen:!1});"jpeg"===e.format&&(m.backgroundColor="#fff"),this.setPositionByOrigin(new t.Point(m.width/2,m.height/2),"center","center");var v=this.canvas;m.add(this);var y=m.toCanvasElement(s||1,e);return this.shadow=o,this.set("canvas",v),i&&(this.group=i),this.set(r).setCoords(),m._objects=[],m.dispose(),m=null,y},toDataURL:function(e){return e||(e={}),t.util.toDataURL(this.toCanvasElement(e),e.format||"png",e.quality||1)},isType:function(e){return arguments.length>1?Array.from(arguments).includes(this.type):this.type===e},complexity:function(){return 1},toJSON:function(e){return this.toObject(e)},rotate:function(e){var t=("center"!==this.originX||"center"!==this.originY)&&this.centeredRotation;return t&&this._setOriginToCenter(),this.set("angle",e),t&&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(e,n){n=n||this.canvas.getPointer(e);var r=new t.Point(n.x,n.y),i=this._getLeftTopCoords();return this.angle&&(r=t.util.rotatePoint(r,i,a(-this.angle))),{x:r.x-i.x,y:r.y-i.y}},_setupCompositeOperation:function(e){this.globalCompositeOperation&&(e.globalCompositeOperation=this.globalCompositeOperation)},dispose:function(){t.runningAnimations&&t.runningAnimations.cancelByTarget(this)}}),t.util.createAccessors&&t.util.createAccessors(t.Object),n(t.Object.prototype,t.Observable),t.Object.NUM_FRACTION_DIGITS=2,t.Object.ENLIVEN_PROPS=["clipPath"],t.Object._fromObject=function(e,n,i,o){var a=t[e];n=r(n,!0),t.util.enlivenPatterns([n.fill,n.stroke],function(e){typeof e[0]<"u"&&(n.fill=e[0]),typeof e[1]<"u"&&(n.stroke=e[1]),t.util.enlivenObjectEnlivables(n,n,function(){var e=o?new a(n[o],n):new a(n);i&&i(e)})})},t.Object.__uid=0)}(e),function(){var e=t.util.degreesToRadians,n={left:-.5,center:0,right:.5},r={top:-.5,center:0,bottom:.5};t.util.object.extend(t.Object.prototype,{translateToGivenOrigin:function(e,i,o,a,s){var l,c,u,d=e.x,h=e.y;return"string"==typeof i?i=n[i]:i-=.5,"string"==typeof a?a=n[a]:a-=.5,"string"==typeof o?o=r[o]:o-=.5,"string"==typeof s?s=r[s]:s-=.5,c=s-o,((l=a-i)||c)&&(u=this._getTransformedDimensions(),d=e.x+l*u.x,h=e.y+c*u.y),new t.Point(d,h)},translateToCenterPoint:function(n,r,i){var o=this.translateToGivenOrigin(n,r,i,"center","center");return this.angle?t.util.rotatePoint(o,n,e(this.angle)):o},translateToOriginPoint:function(n,r,i){var o=this.translateToGivenOrigin(n,"center","center",r,i);return this.angle?t.util.rotatePoint(o,n,e(this.angle)):o},getCenterPoint:function(){var e=new t.Point(this.left,this.top);return this.translateToCenterPoint(e,this.originX,this.originY)},getPointByOrigin:function(e,t){var n=this.getCenterPoint();return this.translateToOriginPoint(n,e,t)},toLocalPoint:function(n,r,i){var o,a,s=this.getCenterPoint();return o=typeof r<"u"&&typeof i<"u"?this.translateToGivenOrigin(s,"center","center",r,i):new t.Point(this.left,this.top),a=new t.Point(n.x,n.y),this.angle&&(a=t.util.rotatePoint(a,s,-e(this.angle))),a.subtractEquals(o)},setPositionByOrigin:function(e,t,n){var r=this.translateToCenterPoint(e,t,n),i=this.translateToOriginPoint(r,this.originX,this.originY);this.set("left",i.x),this.set("top",i.y)},adjustPosition:function(r){var i,o,a=e(this.angle),s=this.getScaledWidth(),l=t.util.cos(a)*s,c=t.util.sin(a)*s;i="string"==typeof this.originX?n[this.originX]:this.originX-.5,o="string"==typeof r?n[r]:r-.5,this.left+=l*(o-i),this.top+=c*(o-i),this.setCoords(),this.originX=r},_setOriginToCenter:function(){this._originalOriginX=this.originX,this._originalOriginY=this.originY;var e=this.getCenterPoint();this.originX="center",this.originY="center",this.left=e.x,this.top=e.y},_resetOrigin:function(){var e=this.translateToOriginPoint(this.getCenterPoint(),this._originalOriginX,this._originalOriginY);this.originX=this._originalOriginX,this.originY=this._originalOriginY,this.left=e.x,this.top=e.y,this._originalOriginX=null,this._originalOriginY=null},_getLeftTopCoords:function(){return this.translateToOriginPoint(this.getCenterPoint(),"left","top")}})}(),function(){var e=t.util,n=e.degreesToRadians,r=e.multiplyTransformMatrices,i=e.transformPoint;e.object.extend(t.Object.prototype,{oCoords:null,aCoords:null,lineCoords:null,ownMatrixCache:null,matrixCache:null,controls:{},_getCoords:function(e,t){return t?e?this.calcACoords():this.calcLineCoords():((!this.aCoords||!this.lineCoords)&&this.setCoords(!0),e?this.aCoords:this.lineCoords)},getCoords:function(e,n){return function(e){return[new t.Point(e.tl.x,e.tl.y),new t.Point(e.tr.x,e.tr.y),new t.Point(e.br.x,e.br.y),new t.Point(e.bl.x,e.bl.y)]}(this._getCoords(e,n))},intersectsWithRect:function(e,n,r,i){var o=this.getCoords(r,i);return"Intersection"===t.Intersection.intersectPolygonRectangle(o,e,n).status},intersectsWithObject:function(e,n,r){return"Intersection"===t.Intersection.intersectPolygonPolygon(this.getCoords(n,r),e.getCoords(n,r)).status||e.isContainedWithinObject(this,n,r)||this.isContainedWithinObject(e,n,r)},isContainedWithinObject:function(e,t,n){for(var r=this.getCoords(t,n),i=t?e.aCoords:e.lineCoords,o=0,a=e._getImageLines(i);o<4;o++)if(!e.containsPoint(r[o],a))return!1;return!0},isContainedWithinRect:function(e,t,n,r){var i=this.getBoundingRect(n,r);return i.left>=e.x&&i.left+i.width<=t.x&&i.top>=e.y&&i.top+i.height<=t.y},containsPoint:function(e,t,n,r){var i=this._getCoords(n,r),o=(t=t||this._getImageLines(i),this._findCrossPoints(e,t));return 0!==o&&o%2==1},isOnScreen:function(e){if(!this.canvas)return!1;var t=this.canvas.vptCoords.tl,n=this.canvas.vptCoords.br;return!(!this.getCoords(!0,e).some(function(e){return e.x<=n.x&&e.x>=t.x&&e.y<=n.y&&e.y>=t.y})&&!this.intersectsWithRect(t,n,!0,e))||this._containsCenterOfCanvas(t,n,e)},_containsCenterOfCanvas:function(e,t,n){var r={x:(e.x+t.x)/2,y:(e.y+t.y)/2};return!!this.containsPoint(r,null,!0,n)},isPartiallyOnScreen:function(e){if(!this.canvas)return!1;var t=this.canvas.vptCoords.tl,n=this.canvas.vptCoords.br;return!!this.intersectsWithRect(t,n,!0,e)||this.getCoords(!0,e).every(function(e){return(e.x>=n.x||e.x<=t.x)&&(e.y>=n.y||e.y<=t.y)})&&this._containsCenterOfCanvas(t,n,e)},_getImageLines:function(e){return{topline:{o:e.tl,d:e.tr},rightline:{o:e.tr,d:e.br},bottomline:{o:e.br,d:e.bl},leftline:{o:e.bl,d:e.tl}}},_findCrossPoints:function(e,t){var n,r,i,o,a,s=0;for(var l in t)if(!((a=t[l]).o.y<e.y&&a.d.y<e.y||a.o.y>=e.y&&a.d.y>=e.y||(a.o.x===a.d.x&&a.o.x>=e.x?o=a.o.x:(n=(a.d.y-a.o.y)/(a.d.x-a.o.x),r=e.y-0*e.x,i=a.o.y-n*a.o.x,o=-(r-i)/(0-n)),o>=e.x&&(s+=1),2!==s)))break;return s},getBoundingRect:function(t,n){var r=this.getCoords(t,n);return e.makeBoundingBoxFromPoints(r)},getScaledWidth:function(){return this._getTransformedDimensions().x},getScaledHeight:function(){return this._getTransformedDimensions().y},_constrainScale:function(e){return Math.abs(e)<this.minScaleLimit?e<0?-this.minScaleLimit:this.minScaleLimit:0===e?1e-4:e},scale:function(e){return this._set("scaleX",e),this._set("scaleY",e),this.setCoords()},scaleToWidth:function(e,t){var n=this.getBoundingRect(t).width/this.getScaledWidth();return this.scale(e/this.width/n)},scaleToHeight:function(e,t){var n=this.getBoundingRect(t).height/this.getScaledHeight();return this.scale(e/this.height/n)},calcLineCoords:function(){var t=this.getViewportTransform(),r=this.padding,o=n(this.angle),a=e.cos(o)*r,s=e.sin(o)*r,l=a+s,c=a-s,u=this.calcACoords(),d={tl:i(u.tl,t),tr:i(u.tr,t),bl:i(u.bl,t),br:i(u.br,t)};return r&&(d.tl.x-=c,d.tl.y-=l,d.tr.x+=l,d.tr.y-=c,d.bl.x-=l,d.bl.y+=c,d.br.x+=c,d.br.y+=l),d},calcOCoords:function(){var e=this._calcRotateMatrix(),t=this._calcTranslateMatrix(),n=this.getViewportTransform(),i=r(n,t),o=r(i,e),a=(o=r(o,[1/n[0],0,0,1/n[3],0,0]),this._calculateCurrentDimensions()),s={};return this.forEachControl(function(e,t,n){s[t]=e.positionHandler(a,o,n)}),s},calcACoords:function(){var e=this._calcRotateMatrix(),t=this._calcTranslateMatrix(),n=r(t,e),o=this._getTransformedDimensions(),a=o.x/2,s=o.y/2;return{tl:i({x:-a,y:-s},n),tr:i({x:a,y:-s},n),bl:i({x:-a,y:s},n),br:i({x:a,y:s},n)}},setCoords:function(e){return this.aCoords=this.calcACoords(),this.lineCoords=this.group?this.aCoords:this.calcLineCoords(),e||(this.oCoords=this.calcOCoords(),this._setCornerCoords&&this._setCornerCoords()),this},_calcRotateMatrix:function(){return e.calcRotateMatrix(this)},_calcTranslateMatrix:function(){var e=this.getCenterPoint();return[1,0,0,1,e.x,e.y]},transformMatrixKey:function(e){var t="_",n="";return!e&&this.group&&(n=this.group.transformMatrixKey(e)+t),n+this.top+t+this.left+t+this.scaleX+t+this.scaleY+t+this.skewX+t+this.skewY+t+this.angle+t+this.originX+t+this.originY+t+this.width+t+this.height+t+this.strokeWidth+this.flipX+this.flipY},calcTransformMatrix:function(e){var t=this.calcOwnMatrix();if(e||!this.group)return t;var n=this.transformMatrixKey(e),i=this.matrixCache||(this.matrixCache={});return i.key===n?i.value:(this.group&&(t=r(this.group.calcTransformMatrix(!1),t)),i.key=n,i.value=t,t)},calcOwnMatrix:function(){var t=this.transformMatrixKey(!0),n=this.ownMatrixCache||(this.ownMatrixCache={});if(n.key===t)return n.value;var r=this._calcTranslateMatrix(),i={angle:this.angle,translateX:r[4],translateY:r[5],scaleX:this.scaleX,scaleY:this.scaleY,skewX:this.skewX,skewY:this.skewY,flipX:this.flipX,flipY:this.flipY};return n.key=t,n.value=e.composeMatrix(i),n.value},_getNonTransformedDimensions:function(){var e=this.strokeWidth;return{x:this.width+e,y:this.height+e}},_getTransformedDimensions:function(t,n){typeof t>"u"&&(t=this.skewX),typeof n>"u"&&(n=this.skewY);var r,i,o,a=0===t&&0===n;if(this.strokeUniform?(i=this.width,o=this.height):(i=(r=this._getNonTransformedDimensions()).x,o=r.y),a)return this._finalizeDimensions(i*this.scaleX,o*this.scaleY);var s=e.sizeAfterTransform(i,o,{scaleX:this.scaleX,scaleY:this.scaleY,skewX:t,skewY:n});return this._finalizeDimensions(s.x,s.y)},_finalizeDimensions:function(e,t){return this.strokeUniform?{x:e+this.strokeWidth,y:t+this.strokeWidth}:{x:e,y:t}},_calculateCurrentDimensions:function(){var e=this.getViewportTransform(),t=this._getTransformedDimensions();return i(t,e,!0).scalarAdd(2*this.padding)}})}(),t.util.object.extend(t.Object.prototype,{sendToBack:function(){return this.group?t.StaticCanvas.prototype.sendToBack.call(this.group,this):this.canvas&&this.canvas.sendToBack(this),this},bringToFront:function(){return this.group?t.StaticCanvas.prototype.bringToFront.call(this.group,this):this.canvas&&this.canvas.bringToFront(this),this},sendBackwards:function(e){return this.group?t.StaticCanvas.prototype.sendBackwards.call(this.group,this,e):this.canvas&&this.canvas.sendBackwards(this,e),this},bringForward:function(e){return this.group?t.StaticCanvas.prototype.bringForward.call(this.group,this,e):this.canvas&&this.canvas.bringForward(this,e),this},moveTo:function(e){return this.group&&"activeSelection"!==this.group.type?t.StaticCanvas.prototype.moveTo.call(this.group,this,e):this.canvas&&this.canvas.moveTo(this,e),this}}),function(){function e(e,n){if(n){if(n.toLive)return e+": url(#SVGID_"+n.id+"); ";var r=new t.Color(n),i=e+": "+r.toRgb()+"; ",o=r.getAlpha();return 1!==o&&(i+=e+"-opacity: "+o.toString()+"; "),i}return e+": none; "}var n=t.util.toFixed;t.util.object.extend(t.Object.prototype,{getSvgStyles:function(t){var n=this.fillRule?this.fillRule:"nonzero",r=this.strokeWidth?this.strokeWidth:"0",i=this.strokeDashArray?this.strokeDashArray.join(" "):"none",o=this.strokeDashOffset?this.strokeDashOffset:"0",a=this.strokeLineCap?this.strokeLineCap:"butt",s=this.strokeLineJoin?this.strokeLineJoin:"miter",l=this.strokeMiterLimit?this.strokeMiterLimit:"4",c=typeof this.opacity<"u"?this.opacity:"1",u=this.visible?"":" visibility: hidden;",d=t?"":this.getSvgFilter(),h=e("fill",this.fill);return[e("stroke",this.stroke),"stroke-width: ",r,"; ","stroke-dasharray: ",i,"; ","stroke-linecap: ",a,"; ","stroke-dashoffset: ",o,"; ","stroke-linejoin: ",s,"; ","stroke-miterlimit: ",l,"; ",h,"fill-rule: ",n,"; ","opacity: ",c,";",d,u].join("")},getSvgSpanStyles:function(t,n){var r="; ",i=t.fontFamily?"font-family: "+(-1===t.fontFamily.indexOf("'")&&-1===t.fontFamily.indexOf('"')?"'"+t.fontFamily+"'":t.fontFamily)+r:"",o=t.strokeWidth?"stroke-width: "+t.strokeWidth+r:"",a=t.fontSize?"font-size: "+t.fontSize+"px"+r:"",s=t.fontStyle?"font-style: "+t.fontStyle+r:"",l=t.fontWeight?"font-weight: "+t.fontWeight+r:"",c=t.fill?e("fill",t.fill):"",u=t.stroke?e("stroke",t.stroke):"",d=this.getSvgTextDecoration(t);return d&&(d="text-decoration: "+d+r),[u,o,i,a,s,l,d,c,t.deltaY?"baseline-shift: "+-t.deltaY+"; ":"",n?"white-space: pre; ":""].join("")},getSvgTextDecoration:function(e){return["overline","underline","line-through"].filter(function(t){return e[t.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(e,n){var r=e?this.calcTransformMatrix():this.calcOwnMatrix();return'transform="'+t.util.matrixToSVG(r)+(n||"")+'" '},_setSVGBg:function(e){if(this.backgroundColor){var r=t.Object.NUM_FRACTION_DIGITS;e.push("\t\t<rect ",this._getFillAttributes(this.backgroundColor),' x="',n(-this.width/2,r),'" y="',n(-this.height/2,r),'" width="',n(this.width,r),'" height="',n(this.height,r),'"></rect>\n')}},toSVG:function(e){return this._createBaseSVGMarkup(this._toSVG(e),{reviver:e})},toClipPathSVG:function(e){return"\t"+this._createBaseClipPathSVGMarkup(this._toSVG(e),{reviver:e})},_createBaseClipPathSVGMarkup:function(e,t){var n=(t=t||{}).reviver,r=t.additionalTransform||"",i=[this.getSvgTransform(!0,r),this.getSvgCommons()].join(""),o=e.indexOf("COMMON_PARTS");return e[o]=i,n?n(e.join("")):e.join("")},_createBaseSVGMarkup:function(e,n){var r,i,o=(n=n||{}).noStyle,a=n.reviver,s=o?"":'style="'+this.getSvgStyles()+'" ',l=n.withShadow?'style="'+this.getSvgFilter()+'" ':"",c=this.clipPath,u=this.strokeUniform?'vector-effect="non-scaling-stroke" ':"",d=c&&c.absolutePositioned,h=this.stroke,f=this.fill,p=this.shadow,g=[],m=e.indexOf("COMMON_PARTS"),v=n.additionalTransform;return c&&(c.clipPathId="CLIPPATH_"+t.Object.__uid++,i='<clipPath id="'+c.clipPathId+'" >\n'+c.toClipPathSVG(a)+"</clipPath>\n"),d&&g.push("<g ",l,this.getSvgCommons()," >\n"),g.push("<g ",this.getSvgTransform(!1),d?"":l+this.getSvgCommons()," >\n"),r=[s,u,o?"":this.addPaintOrder()," ",v?'transform="'+v+'" ':""].join(""),e[m]=r,f&&f.toLive&&g.push(f.toSVG(this)),h&&h.toLive&&g.push(h.toSVG(this)),p&&g.push(p.toSVG(this)),c&&g.push(i),g.push(e.join("")),g.push("</g>\n"),d&&g.push("</g>\n"),a?a(g.join("")):g.join("")},addPaintOrder:function(){return"fill"!==this.paintFirst?' paint-order="'+this.paintFirst+'" ':""}})}(),function(){var e=t.util.object.extend,n="stateProperties";function r(t,n,r){var i={};r.forEach(function(e){i[e]=t[e]}),e(t[n],i,!0)}function i(e,t,n){if(e===t)return!0;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(var r=0,o=e.length;r<o;r++)if(!i(e[r],t[r]))return!1;return!0}if(e&&"object"==typeof e){var a,s=Object.keys(e);if(!t||"object"!=typeof t||!n&&s.length!==Object.keys(t).length)return!1;for(r=0,o=s.length;r<o;r++)if("canvas"!==(a=s[r])&&"group"!==a&&!i(e[a],t[a]))return!1;return!0}}t.util.object.extend(t.Object.prototype,{hasStateChanged:function(e){var t="_"+(e=e||n);return Object.keys(this[t]).length<this[e].length||!i(this[t],this,!0)},saveState:function(e){var t=e&&e.propertySet||n,i="_"+t;return this[i]?(r(this,i,this[t]),e&&e.stateProperties&&r(this,i,e.stateProperties),this):this.setupState(e)},setupState:function(e){var t=(e=e||{}).propertySet||n;return e.propertySet=t,this["_"+t]={},this.saveState(e),this}})}(),function(){var e=t.util.degreesToRadians;t.util.object.extend(t.Object.prototype,{_findTargetCorner:function(e,t){if(!this.hasControls||this.group||!this.canvas||this.canvas._activeObject!==this)return!1;var n,r,i,o=e.x,a=e.y,s=Object.keys(this.oCoords),l=s.length-1;for(this.__corner=0;l>=0;l--)if(i=s[l],this.isControlVisible(i)&&(r=this._getImageLines(t?this.oCoords[i].touchCorner:this.oCoords[i].corner),0!==(n=this._findCrossPoints({x:o,y:a},r))&&n%2==1))return this.__corner=i,i;return!1},forEachControl:function(e){for(var t in this.controls)e(this.controls[t],t,this)},_setCornerCoords:function(){var e=this.oCoords;for(var t in e){var n=this.controls[t];e[t].corner=n.calcCornerCoords(this.angle,this.cornerSize,e[t].x,e[t].y,!1),e[t].touchCorner=n.calcCornerCoords(this.angle,this.touchCornerSize,e[t].x,e[t].y,!0)}},drawSelectionBackground:function(t){if(!this.selectionBackgroundColor||this.canvas&&!this.canvas.interactive||this.canvas&&this.canvas._activeObject!==this)return this;t.save();var n=this.getCenterPoint(),r=this._calculateCurrentDimensions(),i=this.canvas.viewportTransform;return t.translate(n.x,n.y),t.scale(1/i[0],1/i[3]),t.rotate(e(this.angle)),t.fillStyle=this.selectionBackgroundColor,t.fillRect(-r.x/2,-r.y/2,r.x,r.y),t.restore(),this},drawBorders:function(e,t){t=t||{};var n=this._calculateCurrentDimensions(),r=this.borderScaleFactor,i=n.x+r,o=n.y+r,a=typeof t.hasControls<"u"?t.hasControls:this.hasControls,s=!1;return e.save(),e.strokeStyle=t.borderColor||this.borderColor,this._setLineDash(e,t.borderDashArray||this.borderDashArray),e.strokeRect(-i/2,-o/2,i,o),a&&(e.beginPath(),this.forEachControl(function(t,n,r){t.withConnection&&t.getVisibility(r,n)&&(s=!0,e.moveTo(t.x*i,t.y*o),e.lineTo(t.x*i+t.offsetX,t.y*o+t.offsetY))}),s&&e.stroke()),e.restore(),this},drawBordersInGroup:function(e,n,r){r=r||{};var i=t.util.sizeAfterTransform(this.width,this.height,n),o=this.strokeWidth,a=this.strokeUniform,s=this.borderScaleFactor,l=i.x+o*(a?this.canvas.getZoom():n.scaleX)+s,c=i.y+o*(a?this.canvas.getZoom():n.scaleY)+s;return e.save(),this._setLineDash(e,r.borderDashArray||this.borderDashArray),e.strokeStyle=r.borderColor||this.borderColor,e.strokeRect(-l/2,-c/2,l,c),e.restore(),this},drawControls:function(e,n){n=n||{},e.save();var r,i,o=this.canvas.getRetinaScaling();return e.setTransform(o,0,0,o,0,0),e.strokeStyle=e.fillStyle=n.cornerColor||this.cornerColor,this.transparentCorners||(e.strokeStyle=n.cornerStrokeColor||this.cornerStrokeColor),this._setLineDash(e,n.cornerDashArray||this.cornerDashArray),this.setCoords(),this.group&&(r=this.group.calcTransformMatrix()),this.forEachControl(function(o,a,s){i=s.oCoords[a],o.getVisibility(s,a)&&(r&&(i=t.util.transformPoint(i,r)),o.render(e,i.x,i.y,n,s))}),e.restore(),this},isControlVisible:function(e){return this.controls[e]&&this.controls[e].getVisibility(this,e)},setControlVisible:function(e,t){return this._controlsVisibility||(this._controlsVisibility={}),this._controlsVisibility[e]=t,this},setControlsVisibility:function(e){for(var t in e||(e={}),e)this.setControlVisible(t,e[t]);return this},onDeselect:function(){},onSelect:function(){}})}(),t.util.object.extend(t.StaticCanvas.prototype,{FX_DURATION:500,fxCenterObjectH:function(e,n){var r=function(){},i=(n=n||{}).onComplete||r,o=n.onChange||r,a=this;return t.util.animate({target:this,startValue:e.left,endValue:this.getCenterPoint().x,duration:this.FX_DURATION,onChange:function(t){e.set("left",t),a.requestRenderAll(),o()},onComplete:function(){e.setCoords(),i()}})},fxCenterObjectV:function(e,n){var r=function(){},i=(n=n||{}).onComplete||r,o=n.onChange||r,a=this;return t.util.animate({target:this,startValue:e.top,endValue:this.getCenterPoint().y,duration:this.FX_DURATION,onChange:function(t){e.set("top",t),a.requestRenderAll(),o()},onComplete:function(){e.setCoords(),i()}})},fxRemove:function(e,n){var r=function(){},i=(n=n||{}).onComplete||r,o=n.onChange||r,a=this;return t.util.animate({target:this,startValue:e.opacity,endValue:0,duration:this.FX_DURATION,onChange:function(t){e.set("opacity",t),a.requestRenderAll(),o()},onComplete:function(){a.remove(e),i()}})}}),t.util.object.extend(t.Object.prototype,{animate:function(){if(arguments[0]&&"object"==typeof arguments[0]){var e,t,n=[],r=[];for(e in arguments[0])n.push(e);for(var i=0,o=n.length;i<o;i++)e=n[i],t=i!==o-1,r.push(this._animate(e,arguments[0][e],arguments[1],t));return r}return this._animate.apply(this,arguments)},_animate:function(e,n,r,i){var o,a=this;n=n.toString(),r=r?t.util.object.clone(r):{},~e.indexOf(".")&&(o=e.split("."));var s=a.colorProperties.indexOf(e)>-1||o&&a.colorProperties.indexOf(o[1])>-1,l=o?this.get(o[0])[o[1]]:this.get(e);"from"in r||(r.from=l),s||(n=~n.indexOf("=")?l+parseFloat(n.replace("=","")):parseFloat(n));var c={target:this,startValue:r.from,endValue:n,byValue:r.by,easing:r.easing,duration:r.duration,abort:r.abort&&function(e,t,n){return r.abort.call(a,e,t,n)},onChange:function(t,n,s){o?a[o[0]][o[1]]=t:a.set(e,t),!i&&r.onChange&&r.onChange(t,n,s)},onComplete:function(e,t,n){i||(a.setCoords(),r.onComplete&&r.onComplete(e,t,n))}};return s?t.util.animateColor(c.startValue,c.endValue,c.duration,c):t.util.animate(c)}}),function(e){var t=e.fabric||(e.fabric={}),n=t.util.object.extend,r=t.util.object.clone,i={x1:1,x2:1,y1:1,y2:1};function o(e,t){var n=e.origin,r=e.axis1,i=e.axis2,o=e.dimension,a=t.nearest,s=t.center,l=t.farthest;return function(){switch(this.get(n)){case a:return Math.min(this.get(r),this.get(i));case s:return Math.min(this.get(r),this.get(i))+.5*this.get(o);case l:return Math.max(this.get(r),this.get(i))}}}t.Line?t.warn("fabric.Line is already defined"):(t.Line=t.util.createClass(t.Object,{type:"line",x1:0,y1:0,x2:0,y2:0,cacheProperties:t.Object.prototype.cacheProperties.concat("x1","x2","y1","y2"),initialize:function(e,t){e||(e=[0,0,0,0]),this.callSuper("initialize",t),this.set("x1",e[0]),this.set("y1",e[1]),this.set("x2",e[2]),this.set("y2",e[3]),this._setWidthHeight(t)},_setWidthHeight:function(e){e||(e={}),this.width=Math.abs(this.x2-this.x1),this.height=Math.abs(this.y2-this.y1),this.left="left"in e?e.left:this._getLeftToOriginX(),this.top="top"in e?e.top:this._getTopToOriginY()},_set:function(e,t){return this.callSuper("_set",e,t),typeof i[e]<"u"&&this._setWidthHeight(),this},_getLeftToOriginX:o({origin:"originX",axis1:"x1",axis2:"x2",dimension:"width"},{nearest:"left",center:"center",farthest:"right"}),_getTopToOriginY:o({origin:"originY",axis1:"y1",axis2:"y2",dimension:"height"},{nearest:"top",center:"center",farthest:"bottom"}),_render:function(e){e.beginPath();var t=this.calcLinePoints();e.moveTo(t.x1,t.y1),e.lineTo(t.x2,t.y2),e.lineWidth=this.strokeWidth;var n=e.strokeStyle;e.strokeStyle=this.stroke||e.fillStyle,this.stroke&&this._renderStroke(e),e.strokeStyle=n},_findCenterFromElement:function(){return{x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2}},toObject:function(e){return n(this.callSuper("toObject",e),this.calcLinePoints())},_getNonTransformedDimensions:function(){var e=this.callSuper("_getNonTransformedDimensions");return"butt"===this.strokeLineCap&&(0===this.width&&(e.y-=this.strokeWidth),0===this.height&&(e.x-=this.strokeWidth)),e},calcLinePoints:function(){var e=this.x1<=this.x2?-1:1,t=this.y1<=this.y2?-1:1,n=e*this.width*.5,r=t*this.height*.5;return{x1:n,x2:e*this.width*-.5,y1:r,y2:t*this.height*-.5}},_toSVG:function(){var e=this.calcLinePoints();return["<line ","COMMON_PARTS",'x1="',e.x1,'" y1="',e.y1,'" x2="',e.x2,'" y2="',e.y2,'" />\n']}}),t.Line.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat("x1 y1 x2 y2".split(" ")),t.Line.fromElement=function(e,r,i){i=i||{};var o=t.parseAttributes(e,t.Line.ATTRIBUTE_NAMES),a=[o.x1||0,o.y1||0,o.x2||0,o.y2||0];r(new t.Line(a,n(o,i)))},t.Line.fromObject=function(e,n){var i=r(e,!0);i.points=[e.x1,e.y1,e.x2,e.y2],t.Object._fromObject("Line",i,function(e){delete e.points,n&&n(e)},"points")})}(e),function(e){var t=e.fabric||(e.fabric={}),n=t.util.degreesToRadians;t.Circle?t.warn("fabric.Circle is already defined."):(t.Circle=t.util.createClass(t.Object,{type:"circle",radius:0,startAngle:0,endAngle:360,cacheProperties:t.Object.prototype.cacheProperties.concat("radius","startAngle","endAngle"),_set:function(e,t){return this.callSuper("_set",e,t),"radius"===e&&this.setRadius(t),this},toObject:function(e){return this.callSuper("toObject",["radius","startAngle","endAngle"].concat(e))},_toSVG:function(){var e,r=(this.endAngle-this.startAngle)%360;if(0===r)e=["<circle ","COMMON_PARTS",'cx="0" cy="0" ','r="',this.radius,'" />\n'];else{var i=n(this.startAngle),o=n(this.endAngle),a=this.radius;e=['<path d="M '+t.util.cos(i)*a+" "+t.util.sin(i)*a," A "+a+" "+a," 0 ",+(r>180?"1":"0")+" 1"," "+t.util.cos(o)*a+" "+t.util.sin(o)*a,'" ',"COMMON_PARTS"," />\n"]}return e},_render:function(e){e.beginPath(),e.arc(0,0,this.radius,n(this.startAngle),n(this.endAngle),!1),this._renderPaintInOrder(e)},getRadiusX:function(){return this.get("radius")*this.get("scaleX")},getRadiusY:function(){return this.get("radius")*this.get("scaleY")},setRadius:function(e){return this.radius=e,this.set("width",2*e).set("height",2*e)}}),t.Circle.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat("cx cy r".split(" ")),t.Circle.fromElement=function(e,n){var r=t.parseAttributes(e,t.Circle.ATTRIBUTE_NAMES);if(!function(e){return"radius"in e&&e.radius>=0}(r))throw new Error("value of `r` attribute is required and can not be negative");r.left=(r.left||0)-r.radius,r.top=(r.top||0)-r.radius,n(new t.Circle(r))},t.Circle.fromObject=function(e,n){t.Object._fromObject("Circle",e,n)})}(e),function(e){var t=e.fabric||(e.fabric={});t.Triangle?t.warn("fabric.Triangle is already defined"):(t.Triangle=t.util.createClass(t.Object,{type:"triangle",width:100,height:100,_render:function(e){var t=this.width/2,n=this.height/2;e.beginPath(),e.moveTo(-t,n),e.lineTo(0,-n),e.lineTo(t,n),e.closePath(),this._renderPaintInOrder(e)},_toSVG:function(){var e=this.width/2,t=this.height/2;return["<polygon ","COMMON_PARTS",'points="',[-e+" "+t,"0 "+-t,e+" "+t].join(","),'" />']}}),t.Triangle.fromObject=function(e,n){return t.Object._fromObject("Triangle",e,n)})}(e),function(e){var t=e.fabric||(e.fabric={}),n=2*Math.PI;t.Ellipse?t.warn("fabric.Ellipse is already defined."):(t.Ellipse=t.util.createClass(t.Object,{type:"ellipse",rx:0,ry:0,cacheProperties:t.Object.prototype.cacheProperties.concat("rx","ry"),initialize:function(e){this.callSuper("initialize",e),this.set("rx",e&&e.rx||0),this.set("ry",e&&e.ry||0)},_set:function(e,t){switch(this.callSuper("_set",e,t),e){case"rx":this.rx=t,this.set("width",2*t);break;case"ry":this.ry=t,this.set("height",2*t)}return this},getRx:function(){return this.get("rx")*this.get("scaleX")},getRy:function(){return this.get("ry")*this.get("scaleY")},toObject:function(e){return this.callSuper("toObject",["rx","ry"].concat(e))},_toSVG:function(){return["<ellipse ","COMMON_PARTS",'cx="0" cy="0" ','rx="',this.rx,'" ry="',this.ry,'" />\n']},_render:function(e){e.beginPath(),e.save(),e.transform(1,0,0,this.ry/this.rx,0,0),e.arc(0,0,this.rx,0,n,!1),e.restore(),this._renderPaintInOrder(e)}}),t.Ellipse.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat("cx cy rx ry".split(" ")),t.Ellipse.fromElement=function(e,n){var r=t.parseAttributes(e,t.Ellipse.ATTRIBUTE_NAMES);r.left=(r.left||0)-r.rx,r.top=(r.top||0)-r.ry,n(new t.Ellipse(r))},t.Ellipse.fromObject=function(e,n){t.Object._fromObject("Ellipse",e,n)})}(e),function(e){var t=e.fabric||(e.fabric={}),n=t.util.object.extend;t.Rect?t.warn("fabric.Rect is already defined"):(t.Rect=t.util.createClass(t.Object,{stateProperties:t.Object.prototype.stateProperties.concat("rx","ry"),type:"rect",rx:0,ry:0,cacheProperties:t.Object.prototype.cacheProperties.concat("rx","ry"),initialize:function(e){this.callSuper("initialize",e),this._initRxRy()},_initRxRy:function(){this.rx&&!this.ry?this.ry=this.rx:this.ry&&!this.rx&&(this.rx=this.ry)},_render:function(e){var t=this.rx?Math.min(this.rx,this.width/2):0,n=this.ry?Math.min(this.ry,this.height/2):0,r=this.width,i=this.height,o=-this.width/2,a=-this.height/2,s=0!==t||0!==n,l=.4477152502;e.beginPath(),e.moveTo(o+t,a),e.lineTo(o+r-t,a),s&&e.bezierCurveTo(o+r-l*t,a,o+r,a+l*n,o+r,a+n),e.lineTo(o+r,a+i-n),s&&e.bezierCurveTo(o+r,a+i-l*n,o+r-l*t,a+i,o+r-t,a+i),e.lineTo(o+t,a+i),s&&e.bezierCurveTo(o+l*t,a+i,o,a+i-l*n,o,a+i-n),e.lineTo(o,a+n),s&&e.bezierCurveTo(o,a+l*n,o+l*t,a,o+t,a),e.closePath(),this._renderPaintInOrder(e)},toObject:function(e){return this.callSuper("toObject",["rx","ry"].concat(e))},_toSVG:function(){return["<rect ","COMMON_PARTS",'x="',-this.width/2,'" y="',-this.height/2,'" rx="',this.rx,'" ry="',this.ry,'" width="',this.width,'" height="',this.height,'" />\n']}}),t.Rect.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat("x y rx ry width height".split(" ")),t.Rect.fromElement=function(e,r,i){if(!e)return r(null);i=i||{};var o=t.parseAttributes(e,t.Rect.ATTRIBUTE_NAMES);o.left=o.left||0,o.top=o.top||0,o.height=o.height||0,o.width=o.width||0;var a=new t.Rect(n(i?t.util.object.clone(i):{},o));a.visible=a.visible&&a.width>0&&a.height>0,r(a)},t.Rect.fromObject=function(e,n){return t.Object._fromObject("Rect",e,n)})}(e),function(e){var t=e.fabric||(e.fabric={}),n=t.util.object.extend,r=t.util.array.min,i=t.util.array.max,o=t.util.toFixed,a=t.util.projectStrokeOnPoints;t.Polyline?t.warn("fabric.Polyline is already defined"):(t.Polyline=t.util.createClass(t.Object,{type:"polyline",points:null,exactBoundingBox:!1,cacheProperties:t.Object.prototype.cacheProperties.concat("points"),initialize:function(e,t){t=t||{},this.points=e||[],this.callSuper("initialize",t),this._setPositionDimensions(t)},_projectStrokeOnPoints:function(){return a(this.points,this,!0)},_setPositionDimensions:function(e){var t,n=this._calcDimensions(e),r=this.exactBoundingBox?this.strokeWidth:0;this.width=n.width-r,this.height=n.height-r,e.fromSVG||(t=this.translateToGivenOrigin({x:n.left-this.strokeWidth/2+r/2,y:n.top-this.strokeWidth/2+r/2},"left","top",this.originX,this.originY)),typeof e.left>"u"&&(this.left=e.fromSVG?n.left:t.x),typeof e.top>"u"&&(this.top=e.fromSVG?n.top:t.y),this.pathOffset={x:n.left+this.width/2+r/2,y:n.top+this.height/2+r/2}},_calcDimensions:function(){var e=this.exactBoundingBox?this._projectStrokeOnPoints():this.points,t=r(e,"x")||0,n=r(e,"y")||0;return{left:t,top:n,width:(i(e,"x")||0)-t,height:(i(e,"y")||0)-n}},toObject:function(e){return n(this.callSuper("toObject",e),{points:this.points.concat()})},_toSVG:function(){for(var e=[],n=this.pathOffset.x,r=this.pathOffset.y,i=t.Object.NUM_FRACTION_DIGITS,a=0,s=this.points.length;a<s;a++)e.push(o(this.points[a].x-n,i),",",o(this.points[a].y-r,i)," ");return["<"+this.type+" ","COMMON_PARTS",'points="',e.join(""),'" />\n']},commonRender:function(e){var t,n=this.points.length,r=this.pathOffset.x,i=this.pathOffset.y;if(!n||isNaN(this.points[n-1].y))return!1;e.beginPath(),e.moveTo(this.points[0].x-r,this.points[0].y-i);for(var o=0;o<n;o++)t=this.points[o],e.lineTo(t.x-r,t.y-i);return!0},_render:function(e){this.commonRender(e)&&this._renderPaintInOrder(e)},complexity:function(){return this.get("points").length}}),t.Polyline.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat(),t.Polyline.fromElementGenerator=function(e){return function(r,i,o){if(!r)return i(null);o||(o={});var a=t.parsePointsAttribute(r.getAttribute("points")),s=t.parseAttributes(r,t[e].ATTRIBUTE_NAMES);s.fromSVG=!0,i(new t[e](a,n(s,o)))}},t.Polyline.fromElement=t.Polyline.fromElementGenerator("Polyline"),t.Polyline.fromObject=function(e,n){return t.Object._fromObject("Polyline",e,n,"points")})}(e),function(e){var t=e.fabric||(e.fabric={}),n=t.util.projectStrokeOnPoints;t.Polygon?t.warn("fabric.Polygon is already defined"):(t.Polygon=t.util.createClass(t.Polyline,{type:"polygon",_projectStrokeOnPoints:function(){return n(this.points,this)},_render:function(e){this.commonRender(e)&&(e.closePath(),this._renderPaintInOrder(e))}}),t.Polygon.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat(),t.Polygon.fromElement=t.Polyline.fromElementGenerator("Polygon"),t.Polygon.fromObject=function(e,n){t.Object._fromObject("Polygon",e,n,"points")})}(e),function(e){var t=e.fabric||(e.fabric={}),n=t.util.array.min,r=t.util.array.max,i=t.util.object.extend,o=t.util.object.clone,a=t.util.toFixed;t.Path?t.warn("fabric.Path is already defined"):(t.Path=t.util.createClass(t.Object,{type:"path",path:null,cacheProperties:t.Object.prototype.cacheProperties.concat("path","fillRule"),stateProperties:t.Object.prototype.stateProperties.concat("path"),initialize:function(e,t){delete(t=o(t||{})).path,this.callSuper("initialize",t),this._setPath(e||[],t)},_setPath:function(e,n){this.path=t.util.makePathSimpler(Array.isArray(e)?e:t.util.parsePath(e)),t.Polyline.prototype._setPositionDimensions.call(this,n||{})},_renderPathCommands:function(e){var t,n=0,r=0,i=0,o=0,a=0,s=0,l=-this.pathOffset.x,c=-this.pathOffset.y;e.beginPath();for(var u=0,d=this.path.length;u<d;++u)switch(t=this.path[u],t[0]){case"L":i=t[1],o=t[2],e.lineTo(i+l,o+c);break;case"M":n=i=t[1],r=o=t[2],e.moveTo(i+l,o+c);break;case"C":i=t[5],o=t[6],a=t[3],s=t[4],e.bezierCurveTo(t[1]+l,t[2]+c,a+l,s+c,i+l,o+c);break;case"Q":e.quadraticCurveTo(t[1]+l,t[2]+c,t[3]+l,t[4]+c),i=t[3],o=t[4],a=t[1],s=t[2];break;case"z":case"Z":i=n,o=r,e.closePath()}},_render:function(e){this._renderPathCommands(e),this._renderPaintInOrder(e)},toString:function(){return"#<fabric.Path ("+this.complexity()+'): { "top": '+this.top+', "left": '+this.left+" }>"},toObject:function(e){return i(this.callSuper("toObject",e),{path:this.path.map(function(e){return e.slice()})})},toDatalessObject:function(e){var t=this.toObject(["sourcePath"].concat(e));return t.sourcePath&&delete t.path,t},_toSVG:function(){return["<path ","COMMON_PARTS",'d="',t.util.joinPath(this.path),'" stroke-linecap="round" ',"/>\n"]},_getOffsetTransform:function(){var e=t.Object.NUM_FRACTION_DIGITS;return" translate("+a(-this.pathOffset.x,e)+", "+a(-this.pathOffset.y,e)+")"},toClipPathSVG:function(e){var t=this._getOffsetTransform();return"\t"+this._createBaseClipPathSVGMarkup(this._toSVG(),{reviver:e,additionalTransform:t})},toSVG:function(e){var t=this._getOffsetTransform();return this._createBaseSVGMarkup(this._toSVG(),{reviver:e,additionalTransform:t})},complexity:function(){return this.path.length},_calcDimensions:function(){for(var e,i,o=[],a=[],s=0,l=0,c=0,u=0,d=0,h=this.path.length;d<h;++d){switch((e=this.path[d])[0]){case"L":c=e[1],u=e[2],i=[];break;case"M":s=c=e[1],l=u=e[2],i=[];break;case"C":i=t.util.getBoundsOfCurve(c,u,e[1],e[2],e[3],e[4],e[5],e[6]),c=e[5],u=e[6];break;case"Q":i=t.util.getBoundsOfCurve(c,u,e[1],e[2],e[1],e[2],e[3],e[4]),c=e[3],u=e[4];break;case"z":case"Z":c=s,u=l}i.forEach(function(e){o.push(e.x),a.push(e.y)}),o.push(c),a.push(u)}var f=n(o)||0,p=n(a)||0;return{left:f,top:p,width:(r(o)||0)-f,height:(r(a)||0)-p}}}),t.Path.fromObject=function(e,n){if("string"==typeof e.sourcePath){var r=e.sourcePath;t.loadSVGFromURL(r,function(r){var i=r[0];i.setOptions(e),e.clipPath?t.util.enlivenObjects([e.clipPath],function(e){i.clipPath=e[0],n&&n(i)}):n&&n(i)})}else t.Object._fromObject("Path",e,n,"path")},t.Path.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat(["d"]),t.Path.fromElement=function(e,n,r){var o=t.parseAttributes(e,t.Path.ATTRIBUTE_NAMES);o.fromSVG=!0,n(new t.Path(o.d,i(o,r)))})}(e),function(e){var t=e.fabric||(e.fabric={}),n=t.util.array.min,r=t.util.array.max;t.Group||(t.Group=t.util.createClass(t.Object,t.Collection,{type:"group",strokeWidth:0,subTargetCheck:!1,cacheProperties:[],useSetOnGroup:!1,initialize:function(e,t,n){t=t||{},this._objects=[],n&&this.callSuper("initialize",t),this._objects=e||[];for(var r=this._objects.length;r--;)this._objects[r].group=this;if(n)this._updateObjectsACoords();else{var i=t&&t.centerPoint;void 0!==t.originX&&(this.originX=t.originX),void 0!==t.originY&&(this.originY=t.originY),i||this._calcBounds(),this._updateObjectsCoords(i),delete t.centerPoint,this.callSuper("initialize",t)}this.setCoords()},_updateObjectsACoords:function(){for(var e=this._objects.length;e--;)this._objects[e].setCoords(!0)},_updateObjectsCoords:function(e){e=e||this.getCenterPoint();for(var t=this._objects.length;t--;)this._updateObjectCoords(this._objects[t],e)},_updateObjectCoords:function(e,t){var n=e.left,r=e.top;e.set({left:n-t.x,top:r-t.y}),e.group=this,e.setCoords(!0)},toString:function(){return"#<fabric.Group: ("+this.complexity()+")>"},addWithUpdate:function(e){var n=!!this.group;return this._restoreObjectsState(),t.util.resetObjectTransform(this),e&&(n&&t.util.removeTransformFromObject(e,this.group.calcTransformMatrix()),this._objects.push(e),e.group=this,e._set("canvas",this.canvas)),this._calcBounds(),this._updateObjectsCoords(),this.dirty=!0,n?this.group.addWithUpdate():this.setCoords(),this},removeWithUpdate:function(e){return this._restoreObjectsState(),t.util.resetObjectTransform(this),this.remove(e),this._calcBounds(),this._updateObjectsCoords(),this.setCoords(),this.dirty=!0,this},_onObjectAdded:function(e){this.dirty=!0,e.group=this,e._set("canvas",this.canvas)},_onObjectRemoved:function(e){this.dirty=!0,delete e.group},_set:function(e,n){var r=this._objects.length;if(this.useSetOnGroup)for(;r--;)this._objects[r].setOnGroup(e,n);if("canvas"===e)for(;r--;)this._objects[r]._set(e,n);t.Object.prototype._set.call(this,e,n)},toObject:function(e){var n=this.includeDefaultValues,r=this._objects.filter(function(e){return!e.excludeFromExport}).map(function(t){var r=t.includeDefaultValues;t.includeDefaultValues=n;var i=t.toObject(e);return t.includeDefaultValues=r,i}),i=t.Object.prototype.toObject.call(this,e);return i.objects=r,i},toDatalessObject:function(e){var n,r=this.sourcePath;if(r)n=r;else{var i=this.includeDefaultValues;n=this._objects.map(function(t){var n=t.includeDefaultValues;t.includeDefaultValues=i;var r=t.toDatalessObject(e);return t.includeDefaultValues=n,r})}var o=t.Object.prototype.toDatalessObject.call(this,e);return o.objects=n,o},render:function(e){this._transformDone=!0,this.callSuper("render",e),this._transformDone=!1},shouldCache:function(){var e=t.Object.prototype.shouldCache.call(this);if(e)for(var n=0,r=this._objects.length;n<r;n++)if(this._objects[n].willDrawShadow())return this.ownCaching=!1,!1;return e},willDrawShadow:function(){if(t.Object.prototype.willDrawShadow.call(this))return!0;for(var e=0,n=this._objects.length;e<n;e++)if(this._objects[e].willDrawShadow())return!0;return!1},isOnACache:function(){return this.ownCaching||this.group&&this.group.isOnACache()},drawObject:function(e){for(var t=0,n=this._objects.length;t<n;t++)this._objects[t].render(e);this._drawClipPath(e,this.clipPath)},isCacheDirty:function(e){if(this.callSuper("isCacheDirty",e))return!0;if(!this.statefullCache)return!1;for(var t=0,n=this._objects.length;t<n;t++)if(this._objects[t].isCacheDirty(!0)){if(this._cacheCanvas){var r=this.cacheWidth/this.zoomX,i=this.cacheHeight/this.zoomY;this._cacheContext.clearRect(-r/2,-i/2,r,i)}return!0}return!1},_restoreObjectsState:function(){var e=this.calcOwnMatrix();return this._objects.forEach(function(n){t.util.addTransformToObject(n,e),delete n.group,n.setCoords()}),this},destroy:function(){return this._objects.forEach(function(e){e.set("dirty",!0)}),this._restoreObjectsState()},dispose:function(){this.callSuper("dispose"),this.forEachObject(function(e){e.dispose&&e.dispose()}),this._objects=[]},toActiveSelection:function(){if(this.canvas){var e=this._objects,n=this.canvas;this._objects=[];var r=this.toObject();delete r.objects;var i=new t.ActiveSelection([]);return i.set(r),i.type="activeSelection",n.remove(this),e.forEach(function(e){e.group=i,e.dirty=!0,n.add(e)}),i.canvas=n,i._objects=e,n._activeObject=i,i.setCoords(),i}},ungroupOnCanvas:function(){return this._restoreObjectsState()},setObjectsCoords:function(){return this.forEachObject(function(e){e.setCoords(!0)}),this},_calcBounds:function(e){for(var t,n,r,i,o=[],a=[],s=["tr","br","bl","tl"],l=0,c=this._objects.length,u=s.length;l<c;++l){for(r=(t=this._objects[l]).calcACoords(),i=0;i<u;i++)n=s[i],o.push(r[n].x),a.push(r[n].y);t.aCoords=r}this._getBounds(o,a,e)},_getBounds:function(e,i,o){var a=new t.Point(n(e),n(i)),s=new t.Point(r(e),r(i)),l=a.y||0,c=a.x||0,u=s.x-a.x||0,d=s.y-a.y||0;this.width=u,this.height=d,o||this.setPositionByOrigin({x:c,y:l},"left","top")},_toSVG:function(e){for(var t=["<g ","COMMON_PARTS"," >\n"],n=0,r=this._objects.length;n<r;n++)t.push("\t\t",this._objects[n].toSVG(e));return t.push("</g>\n"),t},getSvgStyles:function(){var e=typeof this.opacity<"u"&&1!==this.opacity?"opacity: "+this.opacity+";":"",t=this.visible?"":" visibility: hidden;";return[e,this.getSvgFilter(),t].join("")},toClipPathSVG:function(e){for(var t=[],n=0,r=this._objects.length;n<r;n++)t.push("\t",this._objects[n].toClipPathSVG(e));return this._createBaseClipPathSVGMarkup(t,{reviver:e})}}),t.Group.fromObject=function(e,n){var r=e.objects,i=t.util.object.clone(e,!0);delete i.objects,"string"!=typeof r?t.util.enlivenObjects(r,function(r){t.util.enlivenObjectEnlivables(e,i,function(){n&&n(new t.Group(r,i,!0))})}):t.loadSVGFromURL(r,function(o){var a=t.util.groupSVGElements(o,e,r),s=i.clipPath;delete i.clipPath,a.set(i),s?t.util.enlivenObjects([s],function(e){a.clipPath=e[0],n&&n(a)}):n&&n(a)})})}(e),function(e){var t=e.fabric||(e.fabric={});t.ActiveSelection||(t.ActiveSelection=t.util.createClass(t.Group,{type:"activeSelection",initialize:function(e,n){n=n||{},this._objects=e||[];for(var r=this._objects.length;r--;)this._objects[r].group=this;n.originX&&(this.originX=n.originX),n.originY&&(this.originY=n.originY),this._calcBounds(),this._updateObjectsCoords(),t.Object.prototype.initialize.call(this,n),this.setCoords()},toGroup:function(){var e=this._objects.concat();this._objects=[];var n=t.Object.prototype.toObject.call(this),r=new t.Group([]);if(delete n.type,r.set(n),e.forEach(function(e){e.canvas.remove(e),e.group=r}),r._objects=e,!this.canvas)return r;var i=this.canvas;return i.add(r),i._activeObject=r,r.setCoords(),r},onDeselect:function(){return this.destroy(),!1},toString:function(){return"#<fabric.ActiveSelection: ("+this.complexity()+")>"},shouldCache:function(){return!1},isOnACache:function(){return!1},_renderControls:function(e,t,n){e.save(),e.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1,this.callSuper("_renderControls",e,t),typeof(n=n||{}).hasControls>"u"&&(n.hasControls=!1),n.forActiveSelection=!0;for(var r=0,i=this._objects.length;r<i;r++)this._objects[r]._renderControls(e,n);e.restore()}}),t.ActiveSelection.fromObject=function(e,n){t.util.enlivenObjects(e.objects,function(r){delete e.objects,n&&n(new t.ActiveSelection(r,e,!0))})})}(e),function(e){var n=t.util.object.extend;e.fabric||(e.fabric={}),e.fabric.Image?t.warn("fabric.Image is already defined."):(t.Image=t.util.createClass(t.Object,{type:"image",strokeWidth:0,srcFromAttribute:!1,_lastScaleX:1,_lastScaleY:1,_filterScalingX:1,_filterScalingY:1,minimumScaleTrigger:.5,stateProperties:t.Object.prototype.stateProperties.concat("cropX","cropY"),cacheProperties:t.Object.prototype.cacheProperties.concat("cropX","cropY"),cacheKey:"",cropX:0,cropY:0,imageSmoothing:!0,initialize:function(e,n){n||(n={}),this.filters=[],this.cacheKey="texture"+t.Object.__uid++,this.callSuper("initialize",n),this._initElement(e,n)},getElement:function(){return this._element||{}},setElement:function(e,t){return this.removeTexture(this.cacheKey),this.removeTexture(this.cacheKey+"_filtered"),this._element=e,this._originalElement=e,this._initConfig(t),0!==this.filters.length&&this.applyFilters(),this.resizeFilter&&this.applyResizeFilters(),this},removeTexture:function(e){var n=t.filterBackend;n&&n.evictCachesForKey&&n.evictCachesForKey(e)},dispose:function(){this.callSuper("dispose"),this.removeTexture(this.cacheKey),this.removeTexture(this.cacheKey+"_filtered"),this._cacheContext=void 0,["_originalElement","_element","_filteredEl","_cacheCanvas"].forEach(function(e){t.util.cleanUpJsdomNode(this[e]),this[e]=void 0}.bind(this))},getCrossOrigin:function(){return this._originalElement&&(this._originalElement.crossOrigin||null)},getOriginalSize:function(){var e=this.getElement();return{width:e.naturalWidth||e.width,height:e.naturalHeight||e.height}},_stroke:function(e){if(this.stroke&&0!==this.strokeWidth){var t=this.width/2,n=this.height/2;e.beginPath(),e.moveTo(-t,-n),e.lineTo(t,-n),e.lineTo(t,n),e.lineTo(-t,n),e.lineTo(-t,-n),e.closePath()}},toObject:function(e){var t=[];this.filters.forEach(function(e){e&&t.push(e.toObject())});var r=n(this.callSuper("toObject",["cropX","cropY"].concat(e)),{src:this.getSrc(),crossOrigin:this.getCrossOrigin(),filters:t});return this.resizeFilter&&(r.resizeFilter=this.resizeFilter.toObject()),r},hasCrop:function(){return this.cropX||this.cropY||this.width<this._element.width||this.height<this._element.height},_toSVG:function(){var e,n=[],r=[],i=this._element,o=-this.width/2,a=-this.height/2,s="",l="";if(!i)return[];if(this.hasCrop()){var c=t.Object.__uid++;n.push('<clipPath id="imageCrop_'+c+'">\n','\t<rect x="'+o+'" y="'+a+'" width="'+this.width+'" height="'+this.height+'" />\n',"</clipPath>\n"),s=' clip-path="url(#imageCrop_'+c+')" '}if(this.imageSmoothing||(l='" image-rendering="optimizeSpeed'),r.push("\t<image ","COMMON_PARTS",'xlink:href="',this.getSvgSrc(!0),'" x="',o-this.cropX,'" y="',a-this.cropY,'" width="',i.width||i.naturalWidth,'" height="',i.height||i.height,l,'"',s,"></image>\n"),this.stroke||this.strokeDashArray){var u=this.fill;this.fill=null,e=["\t<rect ",'x="',o,'" y="',a,'" width="',this.width,'" height="',this.height,'" style="',this.getSvgStyles(),'"/>\n'],this.fill=u}return"fill"!==this.paintFirst?n.concat(e,r):n.concat(r,e)},getSrc:function(e){var t=e?this._element:this._originalElement;return t?t.toDataURL?t.toDataURL():this.srcFromAttribute?t.getAttribute("src"):t.src:this.src||""},setSrc:function(e,n,r){return t.util.loadImage(e,function(e,t){this.setElement(e,r),this._setWidthHeight(),n&&n(this,t)},this,r&&r.crossOrigin),this},toString:function(){return'#<fabric.Image: { src: "'+this.getSrc()+'" }>'},applyResizeFilters:function(){var e=this.resizeFilter,n=this.minimumScaleTrigger,r=this.getTotalObjectScaling(),i=r.scaleX,o=r.scaleY,a=this._filteredEl||this._originalElement;if(this.group&&this.set("dirty",!0),!e||i>n&&o>n)return this._element=a,this._filterScalingX=1,this._filterScalingY=1,this._lastScaleX=i,void(this._lastScaleY=o);t.filterBackend||(t.filterBackend=t.initFilterBackend());var s=t.util.createCanvasElement(),l=this._filteredEl?this.cacheKey+"_filtered":this.cacheKey,c=a.width,u=a.height;s.width=c,s.height=u,this._element=s,this._lastScaleX=e.scaleX=i,this._lastScaleY=e.scaleY=o,t.filterBackend.applyFilters([e],a,c,u,this._element,l),this._filterScalingX=s.width/this._originalElement.width,this._filterScalingY=s.height/this._originalElement.height},applyFilters:function(e){if(e=(e=e||this.filters||[]).filter(function(e){return e&&!e.isNeutralState()}),this.set("dirty",!0),this.removeTexture(this.cacheKey+"_filtered"),0===e.length)return this._element=this._originalElement,this._filteredEl=null,this._filterScalingX=1,this._filterScalingY=1,this;var n=this._originalElement,r=n.naturalWidth||n.width,i=n.naturalHeight||n.height;if(this._element===this._originalElement){var o=t.util.createCanvasElement();o.width=r,o.height=i,this._element=o,this._filteredEl=o}else this._element=this._filteredEl,this._filteredEl.getContext("2d").clearRect(0,0,r,i),this._lastScaleX=1,this._lastScaleY=1;return t.filterBackend||(t.filterBackend=t.initFilterBackend()),t.filterBackend.applyFilters(e,this._originalElement,r,i,this._element,this.cacheKey),(this._originalElement.width!==this._element.width||this._originalElement.height!==this._element.height)&&(this._filterScalingX=this._element.width/this._originalElement.width,this._filterScalingY=this._element.height/this._originalElement.height),this},_render:function(e){t.util.setImageSmoothing(e,this.imageSmoothing),!0!==this.isMoving&&this.resizeFilter&&this._needsResize()&&this.applyResizeFilters(),this._stroke(e),this._renderPaintInOrder(e)},drawCacheOnCanvas:function(e){t.util.setImageSmoothing(e,this.imageSmoothing),t.Object.prototype.drawCacheOnCanvas.call(this,e)},shouldCache:function(){return this.needsItsOwnCache()},_renderFill:function(e){var t=this._element;if(t){var n=this._filterScalingX,r=this._filterScalingY,i=this.width,o=this.height,a=Math.min,s=Math.max,l=s(this.cropX,0),c=s(this.cropY,0),u=t.naturalWidth||t.width,d=t.naturalHeight||t.height,h=l*n,f=c*r,p=a(i*n,u-h),g=a(o*r,d-f),m=-i/2,v=-o/2,y=a(i,u/n-l),b=a(o,d/r-c);t&&e.drawImage(t,h,f,p,g,m,v,y,b)}},_needsResize:function(){var e=this.getTotalObjectScaling();return e.scaleX!==this._lastScaleX||e.scaleY!==this._lastScaleY},_resetWidthHeight:function(){this.set(this.getOriginalSize())},_initElement:function(e,n){this.setElement(t.util.getById(e),n),t.util.addClass(this.getElement(),t.Image.CSS_CANVAS)},_initConfig:function(e){e||(e={}),this.setOptions(e),this._setWidthHeight(e)},_initFilters:function(e,n){e&&e.length?t.util.enlivenObjects(e,function(e){n&&n(e)},"fabric.Image.filters"):n&&n()},_setWidthHeight:function(e){e||(e={});var t=this.getElement();this.width=e.width||t.naturalWidth||t.width||0,this.height=e.height||t.naturalHeight||t.height||0},parsePreserveAspectRatioAttribute:function(){var e,n=t.util.parsePreserveAspectRatioAttribute(this.preserveAspectRatio||""),r=this._element.width,i=this._element.height,o=1,a=1,s=0,l=0,c=0,u=0,d=this.width,h=this.height,f={width:d,height:h};return!n||"none"===n.alignX&&"none"===n.alignY?(o=d/r,a=h/i):("meet"===n.meetOrSlice&&(e=(d-r*(o=a=t.util.findScaleToFit(this._element,f)))/2,"Min"===n.alignX&&(s=-e),"Max"===n.alignX&&(s=e),e=(h-i*a)/2,"Min"===n.alignY&&(l=-e),"Max"===n.alignY&&(l=e)),"slice"===n.meetOrSlice&&(e=r-d/(o=a=t.util.findScaleToCover(this._element,f)),"Mid"===n.alignX&&(c=e/2),"Max"===n.alignX&&(c=e),e=i-h/a,"Mid"===n.alignY&&(u=e/2),"Max"===n.alignY&&(u=e),r=d/o,i=h/a)),{width:r,height:i,scaleX:o,scaleY:a,offsetLeft:s,offsetTop:l,cropX:c,cropY:u}}}),t.Image.CSS_CANVAS="canvas-img",t.Image.prototype.getSvgSrc=t.Image.prototype.getSrc,t.Image.fromObject=function(e,n){var r=t.util.object.clone(e);t.util.loadImage(r.src,function(e,i){i?n&&n(null,!0):t.Image.prototype._initFilters.call(r,r.filters,function(i){r.filters=i||[],t.Image.prototype._initFilters.call(r,[r.resizeFilter],function(i){r.resizeFilter=i[0],t.util.enlivenObjectEnlivables(r,r,function(){var i=new t.Image(e,r);n(i,!1)})})})},null,r.crossOrigin)},t.Image.fromURL=function(e,n,r){t.util.loadImage(e,function(e,i){n&&n(new t.Image(e,r),i)},null,r&&r.crossOrigin)},t.Image.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat("x y width height preserveAspectRatio xlink:href crossOrigin image-rendering".split(" ")),t.Image.fromElement=function(e,r,i){var o=t.parseAttributes(e,t.Image.ATTRIBUTE_NAMES);t.Image.fromURL(o["xlink:href"],r,n(i?t.util.object.clone(i):{},o))})}(e),t.util.object.extend(t.Object.prototype,{_getAngleValueForStraighten:function(){var e=this.angle%360;return e>0?90*Math.round((e-1)/90):90*Math.round(e/90)},straighten:function(){return this.rotate(this._getAngleValueForStraighten())},fxStraighten:function(e){var n=function(){},r=(e=e||{}).onComplete||n,i=e.onChange||n,o=this;return t.util.animate({target:this,startValue:this.get("angle"),endValue:this._getAngleValueForStraighten(),duration:this.FX_DURATION,onChange:function(e){o.rotate(e),i()},onComplete:function(){o.setCoords(),r()}})}}),t.util.object.extend(t.StaticCanvas.prototype,{straightenObject:function(e){return e.straighten(),this.requestRenderAll(),this},fxStraightenObject:function(e){return e.fxStraighten({onChange:this.requestRenderAllBound})}}),function(){function e(e,t){var n="precision "+t+" float;\nvoid main(){}",r=e.createShader(e.FRAGMENT_SHADER);return e.shaderSource(r,n),e.compileShader(r),!!e.getShaderParameter(r,e.COMPILE_STATUS)}function n(e){e&&e.tileSize&&(this.tileSize=e.tileSize),this.setupGLContext(this.tileSize,this.tileSize),this.captureGPUInfo()}t.isWebglSupported=function(n){if(t.isLikelyNode)return!1;n=n||t.WebglFilterBackend.prototype.tileSize;var r=document.createElement("canvas"),i=r.getContext("webgl")||r.getContext("experimental-webgl"),o=!1;if(i){t.maxTextureSize=i.getParameter(i.MAX_TEXTURE_SIZE),o=t.maxTextureSize>=n;for(var a=["highp","mediump","lowp"],s=0;s<3;s++)if(e(i,a[s])){t.webGlPrecision=a[s];break}}return this.isSupported=o,o},t.WebglFilterBackend=n,n.prototype={tileSize:2048,resources:{},setupGLContext:function(e,t){this.dispose(),this.createWebGLCanvas(e,t),this.aPosition=new Float32Array([0,0,0,1,1,0,1,1]),this.chooseFastestCopyGLTo2DMethod(e,t)},chooseFastestCopyGLTo2DMethod:function(e,n){var o,a=typeof window.performance<"u";try{new ImageData(1,1),o=!0}catch{o=!1}var s=typeof ArrayBuffer<"u",l=typeof Uint8ClampedArray<"u";if(a&&o&&s&&l){var c=t.util.createCanvasElement(),u=new ArrayBuffer(e*n*4);if(t.forceGLPutImageData)return this.imageBuffer=u,void(this.copyGLTo2D=i);var d,h,f={imageBuffer:u,destinationWidth:e,destinationHeight:n,targetCanvas:c};c.width=e,c.height=n,d=window.performance.now(),r.call(f,this.gl,f),h=window.performance.now()-d,d=window.performance.now(),i.call(f,this.gl,f),h>window.performance.now()-d?(this.imageBuffer=u,this.copyGLTo2D=i):this.copyGLTo2D=r}},createWebGLCanvas:function(e,n){var r=t.util.createCanvasElement();r.width=e,r.height=n;var i={alpha:!0,premultipliedAlpha:!1,depth:!1,stencil:!1,antialias:!1},o=r.getContext("webgl",i);o||(o=r.getContext("experimental-webgl",i)),o&&(o.clearColor(0,0,0,0),this.canvas=r,this.gl=o)},applyFilters:function(e,t,n,r,i,o){var a,s=this.gl;o&&(a=this.getCachedTexture(o,t));var l={originalWidth:t.width||t.originalWidth,originalHeight:t.height||t.originalHeight,sourceWidth:n,sourceHeight:r,destinationWidth:n,destinationHeight:r,context:s,sourceTexture:this.createTexture(s,n,r,!a&&t),targetTexture:this.createTexture(s,n,r),originalTexture:a||this.createTexture(s,n,r,!a&&t),passes:e.length,webgl:!0,aPosition:this.aPosition,programCache:this.programCache,pass:0,filterBackend:this,targetCanvas:i},c=s.createFramebuffer();return s.bindFramebuffer(s.FRAMEBUFFER,c),e.forEach(function(e){e&&e.applyTo(l)}),function(e){var t=e.targetCanvas,n=t.width,r=t.height,i=e.destinationWidth,o=e.destinationHeight;(n!==i||r!==o)&&(t.width=i,t.height=o)}(l),this.copyGLTo2D(s,l),s.bindTexture(s.TEXTURE_2D,null),s.deleteTexture(l.sourceTexture),s.deleteTexture(l.targetTexture),s.deleteFramebuffer(c),i.getContext("2d").setTransform(1,0,0,1,0,0),l},dispose:function(){this.canvas&&(this.canvas=null,this.gl=null),this.clearWebGLCaches()},clearWebGLCaches:function(){this.programCache={},this.textureCache={}},createTexture:function(e,t,n,r,i){var o=e.createTexture();return e.bindTexture(e.TEXTURE_2D,o),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,i||e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,i||e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),r?e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,r):e.texImage2D(e.TEXTURE_2D,0,e.RGBA,t,n,0,e.RGBA,e.UNSIGNED_BYTE,null),o},getCachedTexture:function(e,t){if(this.textureCache[e])return this.textureCache[e];var n=this.createTexture(this.gl,t.width,t.height,t);return this.textureCache[e]=n,n},evictCachesForKey:function(e){this.textureCache[e]&&(this.gl.deleteTexture(this.textureCache[e]),delete this.textureCache[e])},copyGLTo2D:r,captureGPUInfo:function(){if(this.gpuInfo)return this.gpuInfo;var e=this.gl,t={renderer:"",vendor:""};if(!e)return t;var n=e.getExtension("WEBGL_debug_renderer_info");if(n){var r=e.getParameter(n.UNMASKED_RENDERER_WEBGL),i=e.getParameter(n.UNMASKED_VENDOR_WEBGL);r&&(t.renderer=r.toLowerCase()),i&&(t.vendor=i.toLowerCase())}return this.gpuInfo=t,t}}}(),function(){var e=function(){};function n(){}t.Canvas2dFilterBackend=n,n.prototype={evictCachesForKey:e,dispose:e,clearWebGLCaches:e,resources:{},applyFilters:function(e,t,n,r,i){var o=i.getContext("2d");o.drawImage(t,0,0,n,r);var a={sourceWidth:n,sourceHeight:r,imageData:o.getImageData(0,0,n,r),originalEl:t,originalImageData:o.getImageData(0,0,n,r),canvasEl:i,ctx:o,filterBackend:this};return e.forEach(function(e){e.applyTo(a)}),(a.imageData.width!==n||a.imageData.height!==r)&&(i.width=a.imageData.width,i.height=a.imageData.height),o.putImageData(a.imageData,0,0),a}}}(),t.Image=t.Image||{},t.Image.filters=t.Image.filters||{},t.Image.filters.BaseFilter=t.util.createClass({type:"BaseFilter",vertexSource:"attribute vec2 aPosition;\nvarying vec2 vTexCoord;\nvoid main() {\nvTexCoord = aPosition;\ngl_Position = vec4(aPosition * 2.0 - 1.0, 0.0, 1.0);\n}",fragmentSource:"precision highp float;\nvarying vec2 vTexCoord;\nuniform sampler2D uTexture;\nvoid main() {\ngl_FragColor = texture2D(uTexture, vTexCoord);\n}",initialize:function(e){e&&this.setOptions(e)},setOptions:function(e){for(var t in e)this[t]=e[t]},createProgram:function(e,n,r){n=n||this.fragmentSource,r=r||this.vertexSource,"highp"!==t.webGlPrecision&&(n=n.replace(/precision highp float/g,"precision "+t.webGlPrecision+" float"));var i=e.createShader(e.VERTEX_SHADER);if(e.shaderSource(i,r),e.compileShader(i),!e.getShaderParameter(i,e.COMPILE_STATUS))throw new Error("Vertex shader compile error for "+this.type+": "+e.getShaderInfoLog(i));var o=e.createShader(e.FRAGMENT_SHADER);if(e.shaderSource(o,n),e.compileShader(o),!e.getShaderParameter(o,e.COMPILE_STATUS))throw new Error("Fragment shader compile error for "+this.type+": "+e.getShaderInfoLog(o));var a=e.createProgram();if(e.attachShader(a,i),e.attachShader(a,o),e.linkProgram(a),!e.getProgramParameter(a,e.LINK_STATUS))throw new Error('Shader link error for "${this.type}" '+e.getProgramInfoLog(a));var s=this.getAttributeLocations(e,a),l=this.getUniformLocations(e,a)||{};return l.uStepW=e.getUniformLocation(a,"uStepW"),l.uStepH=e.getUniformLocation(a,"uStepH"),{program:a,attributeLocations:s,uniformLocations:l}},getAttributeLocations:function(e,t){return{aPosition:e.getAttribLocation(t,"aPosition")}},getUniformLocations:function(){return{}},sendAttributeData:function(e,t,n){var r=t.aPosition,i=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,i),e.enableVertexAttribArray(r),e.vertexAttribPointer(r,2,e.FLOAT,!1,0,0),e.bufferData(e.ARRAY_BUFFER,n,e.STATIC_DRAW)},_setupFrameBuffer:function(e){var t,n,r=e.context;e.passes>1?(t=e.destinationWidth,n=e.destinationHeight,(e.sourceWidth!==t||e.sourceHeight!==n)&&(r.deleteTexture(e.targetTexture),e.targetTexture=e.filterBackend.createTexture(r,t,n)),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,e.targetTexture,0)):(r.bindFramebuffer(r.FRAMEBUFFER,null),r.finish())},_swapTextures:function(e){e.passes--,e.pass++;var t=e.targetTexture;e.targetTexture=e.sourceTexture,e.sourceTexture=t},isNeutralState:function(){var e=this.mainParameter,n=t.Image.filters[this.type].prototype;if(e){if(Array.isArray(n[e])){for(var r=n[e].length;r--;)if(this[e][r]!==n[e][r])return!1;return!0}return n[e]===this[e]}return!1},applyTo:function(e){e.webgl?(this._setupFrameBuffer(e),this.applyToWebGL(e),this._swapTextures(e)):this.applyTo2d(e)},retrieveShader:function(e){return e.programCache.hasOwnProperty(this.type)||(e.programCache[this.type]=this.createProgram(e.context)),e.programCache[this.type]},applyToWebGL:function(e){var t=e.context,n=this.retrieveShader(e);0===e.pass&&e.originalTexture?t.bindTexture(t.TEXTURE_2D,e.originalTexture):t.bindTexture(t.TEXTURE_2D,e.sourceTexture),t.useProgram(n.program),this.sendAttributeData(t,n.attributeLocations,e.aPosition),t.uniform1f(n.uniformLocations.uStepW,1/e.sourceWidth),t.uniform1f(n.uniformLocations.uStepH,1/e.sourceHeight),this.sendUniformData(t,n.uniformLocations),t.viewport(0,0,e.destinationWidth,e.destinationHeight),t.drawArrays(t.TRIANGLE_STRIP,0,4)},bindAdditionalTexture:function(e,t,n){e.activeTexture(n),e.bindTexture(e.TEXTURE_2D,t),e.activeTexture(e.TEXTURE0)},unbindAdditionalTexture:function(e,t){e.activeTexture(t),e.bindTexture(e.TEXTURE_2D,null),e.activeTexture(e.TEXTURE0)},getMainParameter:function(){return this[this.mainParameter]},setMainParameter:function(e){this[this.mainParameter]=e},sendUniformData:function(){},createHelpLayer:function(e){if(!e.helpLayer){var t=document.createElement("canvas");t.width=e.sourceWidth,t.height=e.sourceHeight,e.helpLayer=t}},toObject:function(){var e={type:this.type},t=this.mainParameter;return t&&(e[t]=this[t]),e},toJSON:function(){return this.toObject()}}),t.Image.filters.BaseFilter.fromObject=function(e,n){var r=new t.Image.filters[e.type](e);return n&&n(r),r},function(e){var t=e.fabric||(e.fabric={}),n=t.Image.filters,r=t.util.createClass;n.ColorMatrix=r(n.BaseFilter,{type:"ColorMatrix",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nvarying vec2 vTexCoord;\nuniform mat4 uColorMatrix;\nuniform vec4 uConstants;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\ncolor *= uColorMatrix;\ncolor += uConstants;\ngl_FragColor = color;\n}",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(e){this.callSuper("initialize",e),this.matrix=this.matrix.slice(0)},applyTo2d:function(e){var t,n,r,i,o,a=e.imageData.data,s=a.length,l=this.matrix,c=this.colorsOnly;for(o=0;o<s;o+=4)t=a[o],n=a[o+1],r=a[o+2],c?(a[o]=t*l[0]+n*l[1]+r*l[2]+255*l[4],a[o+1]=t*l[5]+n*l[6]+r*l[7]+255*l[9],a[o+2]=t*l[10]+n*l[11]+r*l[12]+255*l[14]):(i=a[o+3],a[o]=t*l[0]+n*l[1]+r*l[2]+i*l[3]+255*l[4],a[o+1]=t*l[5]+n*l[6]+r*l[7]+i*l[8]+255*l[9],a[o+2]=t*l[10]+n*l[11]+r*l[12]+i*l[13]+255*l[14],a[o+3]=t*l[15]+n*l[16]+r*l[17]+i*l[18]+255*l[19])},getUniformLocations:function(e,t){return{uColorMatrix:e.getUniformLocation(t,"uColorMatrix"),uConstants:e.getUniformLocation(t,"uConstants")}},sendUniformData:function(e,t){var n=this.matrix,r=[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]],i=[n[4],n[9],n[14],n[19]];e.uniformMatrix4fv(t.uColorMatrix,!1,r),e.uniform4fv(t.uConstants,i)}}),t.Image.filters.ColorMatrix.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),n=t.Image.filters,r=t.util.createClass;n.Brightness=r(n.BaseFilter,{type:"Brightness",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uBrightness;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\ncolor.rgb += uBrightness;\ngl_FragColor = color;\n}",brightness:0,mainParameter:"brightness",applyTo2d:function(e){if(0!==this.brightness){var t,n=e.imageData.data,r=n.length,i=Math.round(255*this.brightness);for(t=0;t<r;t+=4)n[t]=n[t]+i,n[t+1]=n[t+1]+i,n[t+2]=n[t+2]+i}},getUniformLocations:function(e,t){return{uBrightness:e.getUniformLocation(t,"uBrightness")}},sendUniformData:function(e,t){e.uniform1f(t.uBrightness,this.brightness)}}),t.Image.filters.Brightness.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),n=t.util.object.extend,r=t.Image.filters,i=t.util.createClass;r.Convolute=i(r.BaseFilter,{type:"Convolute",opaque:!1,matrix:[0,0,0,0,1,0,0,0,0],fragmentSource:{Convolute_3_1:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[9];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 0);\nfor (float h = 0.0; h < 3.0; h+=1.0) {\nfor (float w = 0.0; w < 3.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 1), uStepH * (h - 1));\ncolor += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 3.0 + w)];\n}\n}\ngl_FragColor = color;\n}",Convolute_3_0:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[9];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 1);\nfor (float h = 0.0; h < 3.0; h+=1.0) {\nfor (float w = 0.0; w < 3.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 1.0), uStepH * (h - 1.0));\ncolor.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 3.0 + w)];\n}\n}\nfloat alpha = texture2D(uTexture, vTexCoord).a;\ngl_FragColor = color;\ngl_FragColor.a = alpha;\n}",Convolute_5_1:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[25];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 0);\nfor (float h = 0.0; h < 5.0; h+=1.0) {\nfor (float w = 0.0; w < 5.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 2.0), uStepH * (h - 2.0));\ncolor += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 5.0 + w)];\n}\n}\ngl_FragColor = color;\n}",Convolute_5_0:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[25];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 1);\nfor (float h = 0.0; h < 5.0; h+=1.0) {\nfor (float w = 0.0; w < 5.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 2.0), uStepH * (h - 2.0));\ncolor.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 5.0 + w)];\n}\n}\nfloat alpha = texture2D(uTexture, vTexCoord).a;\ngl_FragColor = color;\ngl_FragColor.a = alpha;\n}",Convolute_7_1:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[49];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 0);\nfor (float h = 0.0; h < 7.0; h+=1.0) {\nfor (float w = 0.0; w < 7.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 3.0), uStepH * (h - 3.0));\ncolor += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 7.0 + w)];\n}\n}\ngl_FragColor = color;\n}",Convolute_7_0:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[49];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 1);\nfor (float h = 0.0; h < 7.0; h+=1.0) {\nfor (float w = 0.0; w < 7.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 3.0), uStepH * (h - 3.0));\ncolor.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 7.0 + w)];\n}\n}\nfloat alpha = texture2D(uTexture, vTexCoord).a;\ngl_FragColor = color;\ngl_FragColor.a = alpha;\n}",Convolute_9_1:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[81];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 0);\nfor (float h = 0.0; h < 9.0; h+=1.0) {\nfor (float w = 0.0; w < 9.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 4.0), uStepH * (h - 4.0));\ncolor += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 9.0 + w)];\n}\n}\ngl_FragColor = color;\n}",Convolute_9_0:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[81];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 1);\nfor (float h = 0.0; h < 9.0; h+=1.0) {\nfor (float w = 0.0; w < 9.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 4.0), uStepH * (h - 4.0));\ncolor.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 9.0 + w)];\n}\n}\nfloat alpha = texture2D(uTexture, vTexCoord).a;\ngl_FragColor = color;\ngl_FragColor.a = alpha;\n}"},retrieveShader:function(e){var t=Math.sqrt(this.matrix.length),n=this.type+"_"+t+"_"+(this.opaque?1:0),r=this.fragmentSource[n];return e.programCache.hasOwnProperty(n)||(e.programCache[n]=this.createProgram(e.context,r)),e.programCache[n]},applyTo2d:function(e){var t,n,r,i,o,a,s,l,c,u,d,h,f,p=e.imageData,g=p.data,m=this.matrix,v=Math.round(Math.sqrt(m.length)),y=Math.floor(v/2),b=p.width,w=p.height,x=e.ctx.createImageData(b,w),C=x.data,_=this.opaque?1:0;for(d=0;d<w;d++)for(u=0;u<b;u++){for(o=4*(d*b+u),t=0,n=0,r=0,i=0,f=0;f<v;f++)for(h=0;h<v;h++)a=u+h-y,!((s=d+f-y)<0||s>=w||a<0||a>=b)&&(l=4*(s*b+a),c=m[f*v+h],t+=g[l]*c,n+=g[l+1]*c,r+=g[l+2]*c,_||(i+=g[l+3]*c));C[o]=t,C[o+1]=n,C[o+2]=r,C[o+3]=_?g[o+3]:i}e.imageData=x},getUniformLocations:function(e,t){return{uMatrix:e.getUniformLocation(t,"uMatrix"),uOpaque:e.getUniformLocation(t,"uOpaque"),uHalfSize:e.getUniformLocation(t,"uHalfSize"),uSize:e.getUniformLocation(t,"uSize")}},sendUniformData:function(e,t){e.uniform1fv(t.uMatrix,this.matrix)},toObject:function(){return n(this.callSuper("toObject"),{opaque:this.opaque,matrix:this.matrix})}}),t.Image.filters.Convolute.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),n=t.Image.filters,r=t.util.createClass;n.Grayscale=r(n.BaseFilter,{type:"Grayscale",fragmentSource:{average:"precision highp float;\nuniform sampler2D uTexture;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nfloat average = (color.r + color.b + color.g) / 3.0;\ngl_FragColor = vec4(average, average, average, color.a);\n}",lightness:"precision highp float;\nuniform sampler2D uTexture;\nuniform int uMode;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 col = texture2D(uTexture, vTexCoord);\nfloat average = (max(max(col.r, col.g),col.b) + min(min(col.r, col.g),col.b)) / 2.0;\ngl_FragColor = vec4(average, average, average, col.a);\n}",luminosity:"precision highp float;\nuniform sampler2D uTexture;\nuniform int uMode;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 col = texture2D(uTexture, vTexCoord);\nfloat average = 0.21 * col.r + 0.72 * col.g + 0.07 * col.b;\ngl_FragColor = vec4(average, average, average, col.a);\n}"},mode:"average",mainParameter:"mode",applyTo2d:function(e){var t,n,r=e.imageData.data,i=r.length,o=this.mode;for(t=0;t<i;t+=4)"average"===o?n=(r[t]+r[t+1]+r[t+2])/3:"lightness"===o?n=(Math.min(r[t],r[t+1],r[t+2])+Math.max(r[t],r[t+1],r[t+2]))/2:"luminosity"===o&&(n=.21*r[t]+.72*r[t+1]+.07*r[t+2]),r[t]=n,r[t+1]=n,r[t+2]=n},retrieveShader:function(e){var t=this.type+"_"+this.mode;if(!e.programCache.hasOwnProperty(t)){var n=this.fragmentSource[this.mode];e.programCache[t]=this.createProgram(e.context,n)}return e.programCache[t]},getUniformLocations:function(e,t){return{uMode:e.getUniformLocation(t,"uMode")}},sendUniformData:function(e,t){e.uniform1i(t.uMode,1)},isNeutralState:function(){return!1}}),t.Image.filters.Grayscale.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),n=t.Image.filters,r=t.util.createClass;n.Invert=r(n.BaseFilter,{type:"Invert",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform int uInvert;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nif (uInvert == 1) {\ngl_FragColor = vec4(1.0 - color.r,1.0 -color.g,1.0 -color.b,color.a);\n} else {\ngl_FragColor = color;\n}\n}",invert:!0,mainParameter:"invert",applyTo2d:function(e){var t,n=e.imageData.data,r=n.length;for(t=0;t<r;t+=4)n[t]=255-n[t],n[t+1]=255-n[t+1],n[t+2]=255-n[t+2]},isNeutralState:function(){return!this.invert},getUniformLocations:function(e,t){return{uInvert:e.getUniformLocation(t,"uInvert")}},sendUniformData:function(e,t){e.uniform1i(t.uInvert,this.invert)}}),t.Image.filters.Invert.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),n=t.util.object.extend,r=t.Image.filters,i=t.util.createClass;r.Noise=i(r.BaseFilter,{type:"Noise",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uStepH;\nuniform float uNoise;\nuniform float uSeed;\nvarying vec2 vTexCoord;\nfloat rand(vec2 co, float seed, float vScale) {\nreturn fract(sin(dot(co.xy * vScale ,vec2(12.9898 , 78.233))) * 43758.5453 * (seed + 0.01) / 2.0);\n}\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\ncolor.rgb += (0.5 - rand(vTexCoord, uSeed, 0.1 / uStepH)) * uNoise;\ngl_FragColor = color;\n}",mainParameter:"noise",noise:0,applyTo2d:function(e){if(0!==this.noise){var t,n,r=e.imageData.data,i=r.length,o=this.noise;for(t=0,i=r.length;t<i;t+=4)n=(.5-Math.random())*o,r[t]+=n,r[t+1]+=n,r[t+2]+=n}},getUniformLocations:function(e,t){return{uNoise:e.getUniformLocation(t,"uNoise"),uSeed:e.getUniformLocation(t,"uSeed")}},sendUniformData:function(e,t){e.uniform1f(t.uNoise,this.noise/255),e.uniform1f(t.uSeed,Math.random())},toObject:function(){return n(this.callSuper("toObject"),{noise:this.noise})}}),t.Image.filters.Noise.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),n=t.Image.filters,r=t.util.createClass;n.Pixelate=r(n.BaseFilter,{type:"Pixelate",blocksize:4,mainParameter:"blocksize",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uBlocksize;\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nfloat blockW = uBlocksize * uStepW;\nfloat blockH = uBlocksize * uStepW;\nint posX = int(vTexCoord.x / blockW);\nint posY = int(vTexCoord.y / blockH);\nfloat fposX = float(posX);\nfloat fposY = float(posY);\nvec2 squareCoords = vec2(fposX * blockW, fposY * blockH);\nvec4 color = texture2D(uTexture, squareCoords);\ngl_FragColor = color;\n}",applyTo2d:function(e){var t,n,r,i,o,a,s,l,c,u,d,h=e.imageData,f=h.data,p=h.height,g=h.width;for(n=0;n<p;n+=this.blocksize)for(r=0;r<g;r+=this.blocksize)for(i=f[t=4*n*g+4*r],o=f[t+1],a=f[t+2],s=f[t+3],u=Math.min(n+this.blocksize,p),d=Math.min(r+this.blocksize,g),l=n;l<u;l++)for(c=r;c<d;c++)f[t=4*l*g+4*c]=i,f[t+1]=o,f[t+2]=a,f[t+3]=s},isNeutralState:function(){return 1===this.blocksize},getUniformLocations:function(e,t){return{uBlocksize:e.getUniformLocation(t,"uBlocksize"),uStepW:e.getUniformLocation(t,"uStepW"),uStepH:e.getUniformLocation(t,"uStepH")}},sendUniformData:function(e,t){e.uniform1f(t.uBlocksize,this.blocksize)}}),t.Image.filters.Pixelate.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),n=t.util.object.extend,r=t.Image.filters,i=t.util.createClass;r.RemoveColor=i(r.BaseFilter,{type:"RemoveColor",color:"#FFFFFF",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform vec4 uLow;\nuniform vec4 uHigh;\nvarying vec2 vTexCoord;\nvoid main() {\ngl_FragColor = texture2D(uTexture, vTexCoord);\nif(all(greaterThan(gl_FragColor.rgb,uLow.rgb)) && all(greaterThan(uHigh.rgb,gl_FragColor.rgb))) {\ngl_FragColor.a = 0.0;\n}\n}",distance:.02,useAlpha:!1,applyTo2d:function(e){var n,r,i,o,a=e.imageData.data,s=255*this.distance,l=new t.Color(this.color).getSource(),c=[l[0]-s,l[1]-s,l[2]-s],u=[l[0]+s,l[1]+s,l[2]+s];for(n=0;n<a.length;n+=4)r=a[n],i=a[n+1],o=a[n+2],r>c[0]&&i>c[1]&&o>c[2]&&r<u[0]&&i<u[1]&&o<u[2]&&(a[n+3]=0)},getUniformLocations:function(e,t){return{uLow:e.getUniformLocation(t,"uLow"),uHigh:e.getUniformLocation(t,"uHigh")}},sendUniformData:function(e,n){var r=new t.Color(this.color).getSource(),i=parseFloat(this.distance),o=[0+r[0]/255-i,0+r[1]/255-i,0+r[2]/255-i,1],a=[r[0]/255+i,r[1]/255+i,r[2]/255+i,1];e.uniform4fv(n.uLow,o),e.uniform4fv(n.uHigh,a)},toObject:function(){return n(this.callSuper("toObject"),{color:this.color,distance:this.distance})}}),t.Image.filters.RemoveColor.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),n=t.Image.filters,r=t.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 o in i)n[o]=r(n.ColorMatrix,{type:o,matrix:i[o],mainParameter:!1,colorsOnly:!0}),t.Image.filters[o].fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric,n=t.Image.filters,r=t.util.createClass;n.BlendColor=r(n.BaseFilter,{type:"BlendColor",color:"#F95C63",mode:"multiply",alpha:1,fragmentSource:{multiply:"gl_FragColor.rgb *= uColor.rgb;\n",screen:"gl_FragColor.rgb = 1.0 - (1.0 - gl_FragColor.rgb) * (1.0 - uColor.rgb);\n",add:"gl_FragColor.rgb += uColor.rgb;\n",diff:"gl_FragColor.rgb = abs(gl_FragColor.rgb - uColor.rgb);\n",subtract:"gl_FragColor.rgb -= uColor.rgb;\n",lighten:"gl_FragColor.rgb = max(gl_FragColor.rgb, uColor.rgb);\n",darken:"gl_FragColor.rgb = min(gl_FragColor.rgb, uColor.rgb);\n",exclusion:"gl_FragColor.rgb += uColor.rgb - 2.0 * (uColor.rgb * gl_FragColor.rgb);\n",overlay:"if (uColor.r < 0.5) {\ngl_FragColor.r *= 2.0 * uColor.r;\n} else {\ngl_FragColor.r = 1.0 - 2.0 * (1.0 - gl_FragColor.r) * (1.0 - uColor.r);\n}\nif (uColor.g < 0.5) {\ngl_FragColor.g *= 2.0 * uColor.g;\n} else {\ngl_FragColor.g = 1.0 - 2.0 * (1.0 - gl_FragColor.g) * (1.0 - uColor.g);\n}\nif (uColor.b < 0.5) {\ngl_FragColor.b *= 2.0 * uColor.b;\n} else {\ngl_FragColor.b = 1.0 - 2.0 * (1.0 - gl_FragColor.b) * (1.0 - uColor.b);\n}\n",tint:"gl_FragColor.rgb *= (1.0 - uColor.a);\ngl_FragColor.rgb += uColor.rgb;\n"},buildSource:function(e){return"precision highp float;\nuniform sampler2D uTexture;\nuniform vec4 uColor;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\ngl_FragColor = color;\nif (color.a > 0.0) {\n"+this.fragmentSource[e]+"}\n}"},retrieveShader:function(e){var t,n=this.type+"_"+this.mode;return e.programCache.hasOwnProperty(n)||(t=this.buildSource(this.mode),e.programCache[n]=this.createProgram(e.context,t)),e.programCache[n]},applyTo2d:function(e){var n,r,i,o,a,s,l,c=e.imageData.data,u=c.length,d=1-this.alpha;n=(l=new t.Color(this.color).getSource())[0]*this.alpha,r=l[1]*this.alpha,i=l[2]*this.alpha;for(var h=0;h<u;h+=4)switch(o=c[h],a=c[h+1],s=c[h+2],this.mode){case"multiply":c[h]=o*n/255,c[h+1]=a*r/255,c[h+2]=s*i/255;break;case"screen":c[h]=255-(255-o)*(255-n)/255,c[h+1]=255-(255-a)*(255-r)/255,c[h+2]=255-(255-s)*(255-i)/255;break;case"add":c[h]=o+n,c[h+1]=a+r,c[h+2]=s+i;break;case"diff":case"difference":c[h]=Math.abs(o-n),c[h+1]=Math.abs(a-r),c[h+2]=Math.abs(s-i);break;case"subtract":c[h]=o-n,c[h+1]=a-r,c[h+2]=s-i;break;case"darken":c[h]=Math.min(o,n),c[h+1]=Math.min(a,r),c[h+2]=Math.min(s,i);break;case"lighten":c[h]=Math.max(o,n),c[h+1]=Math.max(a,r),c[h+2]=Math.max(s,i);break;case"overlay":c[h]=n<128?2*o*n/255:255-2*(255-o)*(255-n)/255,c[h+1]=r<128?2*a*r/255:255-2*(255-a)*(255-r)/255,c[h+2]=i<128?2*s*i/255:255-2*(255-s)*(255-i)/255;break;case"exclusion":c[h]=n+o-2*n*o/255,c[h+1]=r+a-2*r*a/255,c[h+2]=i+s-2*i*s/255;break;case"tint":c[h]=n+o*d,c[h+1]=r+a*d,c[h+2]=i+s*d}},getUniformLocations:function(e,t){return{uColor:e.getUniformLocation(t,"uColor")}},sendUniformData:function(e,n){var r=new t.Color(this.color).getSource();r[0]=this.alpha*r[0]/255,r[1]=this.alpha*r[1]/255,r[2]=this.alpha*r[2]/255,r[3]=this.alpha,e.uniform4fv(n.uColor,r)},toObject:function(){return{type:this.type,color:this.color,mode:this.mode,alpha:this.alpha}}}),t.Image.filters.BlendColor.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric,n=t.Image.filters,r=t.util.createClass;n.BlendImage=r(n.BaseFilter,{type:"BlendImage",image:null,mode:"multiply",alpha:1,vertexSource:"attribute vec2 aPosition;\nvarying vec2 vTexCoord;\nvarying vec2 vTexCoord2;\nuniform mat3 uTransformMatrix;\nvoid main() {\nvTexCoord = aPosition;\nvTexCoord2 = (uTransformMatrix * vec3(aPosition, 1.0)).xy;\ngl_Position = vec4(aPosition * 2.0 - 1.0, 0.0, 1.0);\n}",fragmentSource:{multiply:"precision highp float;\nuniform sampler2D uTexture;\nuniform sampler2D uImage;\nuniform vec4 uColor;\nvarying vec2 vTexCoord;\nvarying vec2 vTexCoord2;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nvec4 color2 = texture2D(uImage, vTexCoord2);\ncolor.rgba *= color2.rgba;\ngl_FragColor = color;\n}",mask:"precision highp float;\nuniform sampler2D uTexture;\nuniform sampler2D uImage;\nuniform vec4 uColor;\nvarying vec2 vTexCoord;\nvarying vec2 vTexCoord2;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nvec4 color2 = texture2D(uImage, vTexCoord2);\ncolor.a = color2.a;\ngl_FragColor = color;\n}"},retrieveShader:function(e){var t=this.type+"_"+this.mode,n=this.fragmentSource[this.mode];return e.programCache.hasOwnProperty(t)||(e.programCache[t]=this.createProgram(e.context,n)),e.programCache[t]},applyToWebGL:function(e){var t=e.context,n=this.createTexture(e.filterBackend,this.image);this.bindAdditionalTexture(t,n,t.TEXTURE1),this.callSuper("applyToWebGL",e),this.unbindAdditionalTexture(t,t.TEXTURE1)},createTexture:function(e,t){return e.getCachedTexture(t.cacheKey,t._element)},calculateMatrix:function(){var e=this.image,t=e._element.width,n=e._element.height;return[1/e.scaleX,0,0,0,1/e.scaleY,0,-e.left/t,-e.top/n,1]},applyTo2d:function(e){var n,r,i,o,a,s,l,c,u,d,h,f=e.imageData,p=e.filterBackend.resources,g=f.data,m=g.length,v=f.width,y=f.height,b=this.image;p.blendImage||(p.blendImage=t.util.createCanvasElement()),d=(u=p.blendImage).getContext("2d"),u.width!==v||u.height!==y?(u.width=v,u.height=y):d.clearRect(0,0,v,y),d.setTransform(b.scaleX,0,0,b.scaleY,b.left,b.top),d.drawImage(b._element,0,0,v,y),h=d.getImageData(0,0,v,y).data;for(var w=0;w<m;w+=4)switch(a=g[w],s=g[w+1],l=g[w+2],c=g[w+3],n=h[w],r=h[w+1],i=h[w+2],o=h[w+3],this.mode){case"multiply":g[w]=a*n/255,g[w+1]=s*r/255,g[w+2]=l*i/255,g[w+3]=c*o/255;break;case"mask":g[w+3]=o}},getUniformLocations:function(e,t){return{uTransformMatrix:e.getUniformLocation(t,"uTransformMatrix"),uImage:e.getUniformLocation(t,"uImage")}},sendUniformData:function(e,t){var n=this.calculateMatrix();e.uniform1i(t.uImage,1),e.uniformMatrix3fv(t.uTransformMatrix,!1,n)},toObject:function(){return{type:this.type,image:this.image&&this.image.toObject(),mode:this.mode,alpha:this.alpha}}}),t.Image.filters.BlendImage.fromObject=function(e,n){t.Image.fromObject(e.image,function(r){var i=t.util.object.clone(e);i.image=r,n(new t.Image.filters.BlendImage(i))})}}(e),function(e){var t=e.fabric||(e.fabric={}),n=Math.pow,r=Math.floor,i=Math.sqrt,o=Math.abs,a=Math.round,s=Math.sin,l=Math.ceil,c=t.Image.filters,u=t.util.createClass;c.Resize=u(c.BaseFilter,{type:"Resize",resizeType:"hermite",scaleX:1,scaleY:1,lanczosLobes:3,getUniformLocations:function(e,t){return{uDelta:e.getUniformLocation(t,"uDelta"),uTaps:e.getUniformLocation(t,"uTaps")}},sendUniformData:function(e,t){e.uniform2fv(t.uDelta,this.horizontal?[1/this.width,0]:[0,1/this.height]),e.uniform1fv(t.uTaps,this.taps)},retrieveShader:function(e){var t=this.getFilterWindow(),n=this.type+"_"+t;if(!e.programCache.hasOwnProperty(n)){var r=this.generateShader(t);e.programCache[n]=this.createProgram(e.context,r)}return e.programCache[n]},getFilterWindow:function(){var e=this.tempScale;return Math.ceil(this.lanczosLobes/e)},getTaps:function(){for(var e=this.lanczosCreate(this.lanczosLobes),t=this.tempScale,n=this.getFilterWindow(),r=new Array(n),i=1;i<=n;i++)r[i-1]=e(i*t);return r},generateShader:function(e){for(var t=new Array(e),n=this.fragmentSourceTOP,r=1;r<=e;r++)t[r-1]=r+".0 * uDelta";return n+="uniform float uTaps["+e+"];\n",n+="void main() {\n",n+=" vec4 color = texture2D(uTexture, vTexCoord);\n",n+=" float sum = 1.0;\n",t.forEach(function(e,t){n+=" color += texture2D(uTexture, vTexCoord + "+e+") * uTaps["+t+"];\n",n+=" color += texture2D(uTexture, vTexCoord - "+e+") * uTaps["+t+"];\n",n+=" sum += 2.0 * uTaps["+t+"];\n"}),n+=" gl_FragColor = color / sum;\n",n+="}"},fragmentSourceTOP:"precision highp float;\nuniform sampler2D uTexture;\nuniform vec2 uDelta;\nvarying vec2 vTexCoord;\n",applyTo:function(e){e.webgl?(e.passes++,this.width=e.sourceWidth,this.horizontal=!0,this.dW=Math.round(this.width*this.scaleX),this.dH=e.sourceHeight,this.tempScale=this.dW/this.width,this.taps=this.getTaps(),e.destinationWidth=this.dW,this._setupFrameBuffer(e),this.applyToWebGL(e),this._swapTextures(e),e.sourceWidth=e.destinationWidth,this.height=e.sourceHeight,this.horizontal=!1,this.dH=Math.round(this.height*this.scaleY),this.tempScale=this.dH/this.height,this.taps=this.getTaps(),e.destinationHeight=this.dH,this._setupFrameBuffer(e),this.applyToWebGL(e),this._swapTextures(e),e.sourceHeight=e.destinationHeight):this.applyTo2d(e)},isNeutralState:function(){return 1===this.scaleX&&1===this.scaleY},lanczosCreate:function(e){return function(t){if(t>=e||t<=-e)return 0;if(t<1.1920929e-7&&t>-1.1920929e-7)return 1;var n=(t*=Math.PI)/e;return s(t)/t*s(n)/n}},applyTo2d:function(e){var t=e.imageData,n=this.scaleX,r=this.scaleY;this.rcpScaleX=1/n,this.rcpScaleY=1/r;var i,o=t.width,s=t.height,l=a(o*n),c=a(s*r);"sliceHack"===this.resizeType?i=this.sliceByTwo(e,o,s,l,c):"hermite"===this.resizeType?i=this.hermiteFastResize(e,o,s,l,c):"bilinear"===this.resizeType?i=this.bilinearFiltering(e,o,s,l,c):"lanczos"===this.resizeType&&(i=this.lanczosResize(e,o,s,l,c)),e.imageData=i},sliceByTwo:function(e,n,i,o,a){var s,l,c=e.imageData,u=.5,d=!1,h=!1,f=n*u,p=i*u,g=t.filterBackend.resources,m=0,v=0,y=n,b=0;for(g.sliceByTwo||(g.sliceByTwo=document.createElement("canvas")),((s=g.sliceByTwo).width<1.5*n||s.height<i)&&(s.width=1.5*n,s.height=i),(l=s.getContext("2d")).clearRect(0,0,1.5*n,i),l.putImageData(c,0,0),o=r(o),a=r(a);!d||!h;)n=f,i=p,o<r(f*u)?f=r(f*u):(f=o,d=!0),a<r(p*u)?p=r(p*u):(p=a,h=!0),l.drawImage(s,m,v,n,i,y,b,f,p),m=y,v=b,b+=p;return l.getImageData(m,v,o,a)},lanczosResize:function(e,t,a,s,c){var u=e.imageData.data,d=e.ctx.createImageData(s,c),h=d.data,f=this.lanczosCreate(this.lanczosLobes),p=this.rcpScaleX,g=this.rcpScaleY,m=2/this.rcpScaleX,v=2/this.rcpScaleY,y=l(p*this.lanczosLobes/2),b=l(g*this.lanczosLobes/2),w={},x={},C={};return function e(l){var _,S,A,k,E,I,j,T,F,O,M;for(x.x=(l+.5)*p,C.x=r(x.x),_=0;_<c;_++){for(x.y=(_+.5)*g,C.y=r(x.y),E=0,I=0,j=0,T=0,F=0,S=C.x-y;S<=C.x+y;S++)if(!(S<0||S>=t)){O=r(1e3*o(S-x.x)),w[O]||(w[O]={});for(var P=C.y-b;P<=C.y+b;P++)P<0||P>=a||(M=r(1e3*o(P-x.y)),w[O][M]||(w[O][M]=f(i(n(O*m,2)+n(M*v,2))/1e3)),(A=w[O][M])>0&&(E+=A,I+=A*u[k=4*(P*t+S)],j+=A*u[k+1],T+=A*u[k+2],F+=A*u[k+3]))}h[k=4*(_*s+l)]=I/E,h[k+1]=j/E,h[k+2]=T/E,h[k+3]=F/E}return++l<s?e(l):d}(0)},bilinearFiltering:function(e,t,n,i,o){var a,s,l,c,u,d,h,f,p,g=0,m=this.rcpScaleX,v=this.rcpScaleY,y=4*(t-1),b=e.imageData.data,w=e.ctx.createImageData(i,o),x=w.data;for(l=0;l<o;l++)for(c=0;c<i;c++)for(u=m*c-(a=r(m*c)),d=v*l-(s=r(v*l)),p=4*(s*t+a),h=0;h<4;h++)f=b[p+h]*(1-u)*(1-d)+b[p+4+h]*u*(1-d)+b[p+y+h]*d*(1-u)+b[p+y+4+h]*u*d,x[g++]=f;return w},hermiteFastResize:function(e,t,n,a,s){for(var c=this.rcpScaleX,u=this.rcpScaleY,d=l(c/2),h=l(u/2),f=e.imageData.data,p=e.ctx.createImageData(a,s),g=p.data,m=0;m<s;m++)for(var v=0;v<a;v++){for(var y=4*(v+m*a),b=0,w=0,x=0,C=0,_=0,S=0,A=0,k=(m+.5)*u,E=r(m*u);E<(m+1)*u;E++)for(var I=o(k-(E+.5))/h,j=(v+.5)*c,T=I*I,F=r(v*c);F<(v+1)*c;F++){var O=o(j-(F+.5))/d,M=i(T+O*O);M>1&&M<-1||(b=2*M*M*M-3*M*M+1)>0&&(A+=b*f[3+(O=4*(F+E*t))],x+=b,f[O+3]<255&&(b=b*f[O+3]/250),C+=b*f[O],_+=b*f[O+1],S+=b*f[O+2],w+=b)}g[y]=C/w,g[y+1]=_/w,g[y+2]=S/w,g[y+3]=A/x}return p},toObject:function(){return{type:this.type,scaleX:this.scaleX,scaleY:this.scaleY,resizeType:this.resizeType,lanczosLobes:this.lanczosLobes}}}),t.Image.filters.Resize.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),n=t.Image.filters,r=t.util.createClass;n.Contrast=r(n.BaseFilter,{type:"Contrast",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uContrast;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nfloat contrastF = 1.015 * (uContrast + 1.0) / (1.0 * (1.015 - uContrast));\ncolor.rgb = contrastF * (color.rgb - 0.5) + 0.5;\ngl_FragColor = color;\n}",contrast:0,mainParameter:"contrast",applyTo2d:function(e){if(0!==this.contrast){var t,n=e.imageData.data,r=n.length,i=Math.floor(255*this.contrast),o=259*(i+255)/(255*(259-i));for(t=0;t<r;t+=4)n[t]=o*(n[t]-128)+128,n[t+1]=o*(n[t+1]-128)+128,n[t+2]=o*(n[t+2]-128)+128}},getUniformLocations:function(e,t){return{uContrast:e.getUniformLocation(t,"uContrast")}},sendUniformData:function(e,t){e.uniform1f(t.uContrast,this.contrast)}}),t.Image.filters.Contrast.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),n=t.Image.filters,r=t.util.createClass;n.Saturation=r(n.BaseFilter,{type:"Saturation",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uSaturation;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nfloat rgMax = max(color.r, color.g);\nfloat rgbMax = max(rgMax, color.b);\ncolor.r += rgbMax != color.r ? (rgbMax - color.r) * uSaturation : 0.00;\ncolor.g += rgbMax != color.g ? (rgbMax - color.g) * uSaturation : 0.00;\ncolor.b += rgbMax != color.b ? (rgbMax - color.b) * uSaturation : 0.00;\ngl_FragColor = color;\n}",saturation:0,mainParameter:"saturation",applyTo2d:function(e){if(0!==this.saturation){var t,n,r=e.imageData.data,i=r.length,o=-this.saturation;for(t=0;t<i;t+=4)n=Math.max(r[t],r[t+1],r[t+2]),r[t]+=n!==r[t]?(n-r[t])*o:0,r[t+1]+=n!==r[t+1]?(n-r[t+1])*o:0,r[t+2]+=n!==r[t+2]?(n-r[t+2])*o:0}},getUniformLocations:function(e,t){return{uSaturation:e.getUniformLocation(t,"uSaturation")}},sendUniformData:function(e,t){e.uniform1f(t.uSaturation,-this.saturation)}}),t.Image.filters.Saturation.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),n=t.Image.filters,r=t.util.createClass;n.Vibrance=r(n.BaseFilter,{type:"Vibrance",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uVibrance;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nfloat max = max(color.r, max(color.g, color.b));\nfloat avg = (color.r + color.g + color.b) / 3.0;\nfloat amt = (abs(max - avg) * 2.0) * uVibrance;\ncolor.r += max != color.r ? (max - color.r) * amt : 0.00;\ncolor.g += max != color.g ? (max - color.g) * amt : 0.00;\ncolor.b += max != color.b ? (max - color.b) * amt : 0.00;\ngl_FragColor = color;\n}",vibrance:0,mainParameter:"vibrance",applyTo2d:function(e){if(0!==this.vibrance){var t,n,r,i,o=e.imageData.data,a=o.length,s=-this.vibrance;for(t=0;t<a;t+=4)n=Math.max(o[t],o[t+1],o[t+2]),r=(o[t]+o[t+1]+o[t+2])/3,i=2*Math.abs(n-r)/255*s,o[t]+=n!==o[t]?(n-o[t])*i:0,o[t+1]+=n!==o[t+1]?(n-o[t+1])*i:0,o[t+2]+=n!==o[t+2]?(n-o[t+2])*i:0}},getUniformLocations:function(e,t){return{uVibrance:e.getUniformLocation(t,"uVibrance")}},sendUniformData:function(e,t){e.uniform1f(t.uVibrance,-this.vibrance)}}),t.Image.filters.Vibrance.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),n=t.Image.filters,r=t.util.createClass;n.Blur=r(n.BaseFilter,{type:"Blur",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform vec2 uDelta;\nvarying vec2 vTexCoord;\nconst float nSamples = 15.0;\nvec3 v3offset = vec3(12.9898, 78.233, 151.7182);\nfloat random(vec3 scale) {\nreturn fract(sin(dot(gl_FragCoord.xyz, scale)) * 43758.5453);\n}\nvoid main() {\nvec4 color = vec4(0.0);\nfloat total = 0.0;\nfloat offset = random(v3offset);\nfor (float t = -nSamples; t <= nSamples; t++) {\nfloat percent = (t + offset - 0.5) / nSamples;\nfloat weight = 1.0 - abs(percent);\ncolor += texture2D(uTexture, vTexCoord + uDelta * percent) * weight;\ntotal += weight;\n}\ngl_FragColor = color / total;\n}",blur:0,mainParameter:"blur",applyTo:function(e){e.webgl?(this.aspectRatio=e.sourceWidth/e.sourceHeight,e.passes++,this._setupFrameBuffer(e),this.horizontal=!0,this.applyToWebGL(e),this._swapTextures(e),this._setupFrameBuffer(e),this.horizontal=!1,this.applyToWebGL(e),this._swapTextures(e)):this.applyTo2d(e)},applyTo2d:function(e){e.imageData=this.simpleBlur(e)},simpleBlur:function(e){var n,r,i=e.filterBackend.resources,o=e.imageData.width,a=e.imageData.height;i.blurLayer1||(i.blurLayer1=t.util.createCanvasElement(),i.blurLayer2=t.util.createCanvasElement()),n=i.blurLayer1,r=i.blurLayer2,(n.width!==o||n.height!==a)&&(r.width=n.width=o,r.height=n.height=a);var s,l,c,u,d=n.getContext("2d"),h=r.getContext("2d"),f=15,p=.06*this.blur*.5;for(d.putImageData(e.imageData,0,0),h.clearRect(0,0,o,a),u=-f;u<=f;u++)c=p*(l=u/f)*o+(s=(Math.random()-.5)/4),h.globalAlpha=1-Math.abs(l),h.drawImage(n,c,s),d.drawImage(r,0,0),h.globalAlpha=1,h.clearRect(0,0,r.width,r.height);for(u=-f;u<=f;u++)c=p*(l=u/f)*a+(s=(Math.random()-.5)/4),h.globalAlpha=1-Math.abs(l),h.drawImage(n,s,c),d.drawImage(r,0,0),h.globalAlpha=1,h.clearRect(0,0,r.width,r.height);e.ctx.drawImage(n,0,0);var g=e.ctx.getImageData(0,0,n.width,n.height);return d.globalAlpha=1,d.clearRect(0,0,n.width,n.height),g},getUniformLocations:function(e,t){return{delta:e.getUniformLocation(t,"uDelta")}},sendUniformData:function(e,t){var n=this.chooseRightDelta();e.uniform2fv(t.delta,n)},chooseRightDelta:function(){var e,t=1,n=[0,0];return this.horizontal?this.aspectRatio>1&&(t=1/this.aspectRatio):this.aspectRatio<1&&(t=this.aspectRatio),e=t*this.blur*.12,this.horizontal?n[0]=e:n[1]=e,n}}),n.Blur.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),n=t.Image.filters,r=t.util.createClass;n.Gamma=r(n.BaseFilter,{type:"Gamma",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform vec3 uGamma;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nvec3 correction = (1.0 / uGamma);\ncolor.r = pow(color.r, correction.r);\ncolor.g = pow(color.g, correction.g);\ncolor.b = pow(color.b, correction.b);\ngl_FragColor = color;\ngl_FragColor.rgb *= color.a;\n}",gamma:[1,1,1],mainParameter:"gamma",initialize:function(e){this.gamma=[1,1,1],n.BaseFilter.prototype.initialize.call(this,e)},applyTo2d:function(e){var t,n=e.imageData.data,r=this.gamma,i=n.length,o=1/r[0],a=1/r[1],s=1/r[2];for(this.rVals||(this.rVals=new Uint8Array(256),this.gVals=new Uint8Array(256),this.bVals=new Uint8Array(256)),t=0,i=256;t<i;t++)this.rVals[t]=255*Math.pow(t/255,o),this.gVals[t]=255*Math.pow(t/255,a),this.bVals[t]=255*Math.pow(t/255,s);for(t=0,i=n.length;t<i;t+=4)n[t]=this.rVals[n[t]],n[t+1]=this.gVals[n[t+1]],n[t+2]=this.bVals[n[t+2]]},getUniformLocations:function(e,t){return{uGamma:e.getUniformLocation(t,"uGamma")}},sendUniformData:function(e,t){e.uniform3fv(t.uGamma,this.gamma)}}),t.Image.filters.Gamma.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),n=t.Image.filters,r=t.util.createClass;n.Composed=r(n.BaseFilter,{type:"Composed",subFilters:[],initialize:function(e){this.callSuper("initialize",e),this.subFilters=this.subFilters.slice(0)},applyTo:function(e){e.passes+=this.subFilters.length-1,this.subFilters.forEach(function(t){t.applyTo(e)})},toObject:function(){return t.util.object.extend(this.callSuper("toObject"),{subFilters:this.subFilters.map(function(e){return e.toObject()})})},isNeutralState:function(){return!this.subFilters.some(function(e){return!e.isNeutralState()})}}),t.Image.filters.Composed.fromObject=function(e,n){var r=(e.subFilters||[]).map(function(e){return new t.Image.filters[e.type](e)}),i=new t.Image.filters.Composed({subFilters:r});return n&&n(i),i}}(e),function(e){var t=e.fabric||(e.fabric={}),n=t.Image.filters,r=t.util.createClass;n.HueRotation=r(n.ColorMatrix,{type:"HueRotation",rotation:0,mainParameter:"rotation",calculateMatrix:function(){var e=this.rotation*Math.PI,n=t.util.cos(e),r=t.util.sin(e),i=1/3,o=Math.sqrt(i)*r,a=1-n;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]=n+a/3,this.matrix[1]=i*a-o,this.matrix[2]=i*a+o,this.matrix[5]=i*a+o,this.matrix[6]=n+i*a,this.matrix[7]=i*a-o,this.matrix[10]=i*a-o,this.matrix[11]=i*a+o,this.matrix[12]=n+i*a},isNeutralState:function(e){return this.calculateMatrix(),n.BaseFilter.prototype.isNeutralState.call(this,e)},applyTo:function(e){this.calculateMatrix(),n.BaseFilter.prototype.applyTo.call(this,e)}}),t.Image.filters.HueRotation.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),n=t.util.object.clone;if(t.Text)t.warn("fabric.Text is already defined");else{var r="fontFamily fontWeight fontSize text underline overline linethrough textAlign fontStyle lineHeight textBackgroundColor charSpacing styles direction path pathStartOffset pathSide pathAlign".split(" ");t.Text=t.util.createClass(t.Object,{_dimensionAffectingProps:["fontSize","fontWeight","fontFamily","fontStyle","lineHeight","text","charSpacing","textAlign","styles","path","pathStartOffset","pathSide","pathAlign"],_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:t.Object.prototype.stateProperties.concat(r),cacheProperties:t.Object.prototype.cacheProperties.concat(r),stroke:null,shadow:null,path:null,pathStartOffset:0,pathSide:"left",pathAlign:"baseline",_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(e,t){this.styles=t&&t.styles||{},this.text=e,this.__skipDimension=!0,this.callSuper("initialize",t),this.path&&this.setPathInfo(),this.__skipDimension=!1,this.initDimensions(),this.setCoords(),this.setupState({propertySet:"_dimensionAffectingProps"})},setPathInfo:function(){var e=this.path;e&&(e.segmentsInfo=t.util.getPathSegmentsInfo(e.path))},getMeasuringContext:function(){return t._measuringContext||(t._measuringContext=this.canvas&&this.canvas.contextCache||t.util.createCanvasElement().getContext("2d")),t._measuringContext},_splitText:function(){var e=this._splitTextIntoLines(this.text);return this.textLines=e.lines,this._textLines=e.graphemeLines,this._unwrappedTextLines=e._unwrappedLines,this._text=e.graphemeText,e},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()),-1!==this.textAlign.indexOf("justify")&&this.enlargeSpaces(),this.saveState({propertySet:"_dimensionAffectingProps"}))},enlargeSpaces:function(){for(var e,t,n,r,i,o,a,s=0,l=this._textLines.length;s<l;s++)if(("justify"===this.textAlign||s!==l-1&&!this.isEndOfWrapping(s))&&(r=0,i=this._textLines[s],(t=this.getLineWidth(s))<this.width&&(a=this.textLines[s].match(this._reSpacesAndTabs)))){n=a.length,e=(this.width-t)/n;for(var c=0,u=i.length;c<=u;c++)o=this.__charBounds[s][c],this._reSpaceAndTab.test(i[c])?(o.width+=e,o.kernedWidth+=e,o.left+=r,r+=e):o.left+=r}},isEndOfWrapping:function(e){return e===this._textLines.length-1},missingNewlineOffset:function(){return 1},toString:function(){return"#<fabric.Text ("+this.complexity()+'): { "text": "'+this.text+'", "fontFamily": "'+this.fontFamily+'" }>'},_getCacheCanvasDimensions:function(){var e=this.callSuper("_getCacheCanvasDimensions"),t=this.fontSize;return e.width+=t*e.zoomX,e.height+=t*e.zoomY,e},_render:function(e){var t=this.path;t&&!t.isNotVisible()&&t._render(e),this._setTextStyles(e),this._renderTextLinesBackground(e),this._renderTextDecoration(e,"underline"),this._renderText(e),this._renderTextDecoration(e,"overline"),this._renderTextDecoration(e,"linethrough")},_renderText:function(e){"stroke"===this.paintFirst?(this._renderTextStroke(e),this._renderTextFill(e)):(this._renderTextFill(e),this._renderTextStroke(e))},_setTextStyles:function(e,t,n){if(e.textBaseline="alphabetical",this.path)switch(this.pathAlign){case"center":e.textBaseline="middle";break;case"ascender":e.textBaseline="top";break;case"descender":e.textBaseline="bottom"}e.font=this._getFontDeclaration(t,n)},calcTextWidth:function(){for(var e=this.getLineWidth(0),t=1,n=this._textLines.length;t<n;t++){var r=this.getLineWidth(t);r>e&&(e=r)}return e},_renderTextLine:function(e,t,n,r,i,o){this._renderChars(e,t,n,r,i,o)},_renderTextLinesBackground:function(e){if(this.textBackgroundColor||this.styleHas("textBackgroundColor")){for(var t,n,r,i,o,a,s,l=e.fillStyle,c=this._getLeftOffset(),u=this._getTopOffset(),d=0,h=0,f=this.path,p=0,g=this._textLines.length;p<g;p++)if(t=this.getHeightOfLine(p),this.textBackgroundColor||this.styleHas("textBackgroundColor",p)){r=this._textLines[p],n=this._getLineLeftOffset(p),h=0,d=0,i=this.getValueOfPropertyAt(p,0,"textBackgroundColor");for(var m=0,v=r.length;m<v;m++)o=this.__charBounds[p][m],a=this.getValueOfPropertyAt(p,m,"textBackgroundColor"),f?(e.save(),e.translate(o.renderLeft,o.renderTop),e.rotate(o.angle),e.fillStyle=a,a&&e.fillRect(-o.width/2,-t/this.lineHeight*(1-this._fontSizeFraction),o.width,t/this.lineHeight),e.restore()):a!==i?(s=c+n+d,"rtl"===this.direction&&(s=this.width-s-h),e.fillStyle=i,i&&e.fillRect(s,u,h,t/this.lineHeight),d=o.left,h=o.width,i=a):h+=o.kernedWidth;a&&!f&&(s=c+n+d,"rtl"===this.direction&&(s=this.width-s-h),e.fillStyle=a,e.fillRect(s,u,h,t/this.lineHeight)),u+=t}else u+=t;e.fillStyle=l,this._removeShadow(e)}},getFontCache:function(e){var n=e.fontFamily.toLowerCase();t.charWidthsCache[n]||(t.charWidthsCache[n]={});var r=t.charWidthsCache[n],i=e.fontStyle.toLowerCase()+"_"+(e.fontWeight+"").toLowerCase();return r[i]||(r[i]={}),r[i]},_measureChar:function(e,t,n,r){var i,o,a,s,l=this.getFontCache(t),c=n+e,u=this._getFontDeclaration(t)===this._getFontDeclaration(r),d=t.fontSize/this.CACHE_FONT_SIZE;if(n&&void 0!==l[n]&&(a=l[n]),void 0!==l[e]&&(s=i=l[e]),u&&void 0!==l[c]&&(s=(o=l[c])-a),void 0===i||void 0===a||void 0===o){var h=this.getMeasuringContext();this._setTextStyles(h,t,!0)}return void 0===i&&(s=i=h.measureText(e).width,l[e]=i),void 0===a&&u&&n&&(a=h.measureText(n).width,l[n]=a),u&&void 0===o&&(o=h.measureText(c).width,l[c]=o,s=o-a),{width:i*d,kernedWidth:s*d}},getHeightOfChar:function(e,t){return this.getValueOfPropertyAt(e,t,"fontSize")},measureLine:function(e){var t=this._measureLine(e);return 0!==this.charSpacing&&(t.width-=this._getWidthOfCharSpacing()),t.width<0&&(t.width=0),t},_measureLine:function(e){var n,r,i,o,a,s,l=0,c=this._textLines[e],u=new Array(c.length),d=0,h=this.path,f="right"===this.pathSide;for(this.__charBounds[e]=u,n=0;n<c.length;n++)r=c[n],o=this._getGraphemeBox(r,e,n,i),u[n]=o,l+=o.kernedWidth,i=r;if(u[n]={left:o?o.left+o.width:0,width:0,kernedWidth:0,height:this.fontSize},h){switch(s=h.segmentsInfo[h.segmentsInfo.length-1].length,(a=t.util.getPointOnPath(h.path,0,h.segmentsInfo)).x+=h.pathOffset.x,a.y+=h.pathOffset.y,this.textAlign){case"left":d=f?s-l:0;break;case"center":d=(s-l)/2;break;case"right":d=f?0:s-l}for(d+=this.pathStartOffset*(f?-1:1),n=f?c.length-1:0;f?n>=0:n<c.length;f?n--:n++)o=u[n],d>s?d%=s:d<0&&(d+=s),this._setGraphemeOnPath(d,o,a),d+=o.kernedWidth}return{width:l,numOfSpaces:0}},_setGraphemeOnPath:function(e,n,r){var i=e+n.kernedWidth/2,o=this.path,a=t.util.getPointOnPath(o.path,i,o.segmentsInfo);n.renderLeft=a.x-r.x,n.renderTop=a.y-r.y,n.angle=a.angle+("right"===this.pathSide?Math.PI:0)},_getGraphemeBox:function(e,t,n,r,i){var o,a=this.getCompleteStyleDeclaration(t,n),s=r?this.getCompleteStyleDeclaration(t,n-1):{},l=this._measureChar(e,a,r,s),c=l.kernedWidth,u=l.width;0!==this.charSpacing&&(u+=o=this._getWidthOfCharSpacing(),c+=o);var d={width:u,left:0,height:a.fontSize,kernedWidth:c,deltaY:a.deltaY};if(n>0&&!i){var h=this.__charBounds[t][n-1];d.left=h.left+h.width+l.kernedWidth-l.width}return d},getHeightOfLine:function(e){if(this.__lineHeights[e])return this.__lineHeights[e];for(var t=this._textLines[e],n=this.getHeightOfChar(e,0),r=1,i=t.length;r<i;r++)n=Math.max(this.getHeightOfChar(e,r),n);return this.__lineHeights[e]=n*this.lineHeight*this._fontSizeMult},calcTextHeight:function(){for(var e,t=0,n=0,r=this._textLines.length;n<r;n++)e=this.getHeightOfLine(n),t+=n===r-1?e/this.lineHeight:e;return t},_getLeftOffset:function(){return"ltr"===this.direction?-this.width/2:this.width/2},_getTopOffset:function(){return-this.height/2},_renderTextCommon:function(e,t){e.save();for(var n=0,r=this._getLeftOffset(),i=this._getTopOffset(),o=0,a=this._textLines.length;o<a;o++){var s=this.getHeightOfLine(o),l=s/this.lineHeight,c=this._getLineLeftOffset(o);this._renderTextLine(t,e,this._textLines[o],r+c,i+n+l,o),n+=s}e.restore()},_renderTextFill:function(e){!this.fill&&!this.styleHas("fill")||this._renderTextCommon(e,"fillText")},_renderTextStroke:function(e){(!this.stroke||0===this.strokeWidth)&&this.isEmptyStyles()||(this.shadow&&!this.shadow.affectStroke&&this._removeShadow(e),e.save(),this._setLineDash(e,this.strokeDashArray),e.beginPath(),this._renderTextCommon(e,"strokeText"),e.closePath(),e.restore())},_renderChars:function(e,n,r,i,o,a){var s,l,c,u,d,h=this.getHeightOfLine(a),f=-1!==this.textAlign.indexOf("justify"),p="",g=0,m=this.path,v=!f&&0===this.charSpacing&&this.isEmptyStyles(a)&&!m,y="ltr"===this.direction,b="ltr"===this.direction?1:-1,w=n.canvas.getAttribute("dir");if(n.save(),w!==this.direction&&(n.canvas.setAttribute("dir",y?"ltr":"rtl"),n.direction=y?"ltr":"rtl",n.textAlign=y?"left":"right"),o-=h*this._fontSizeFraction/this.lineHeight,v)return this._renderChar(e,n,a,0,r.join(""),i,o,h),void n.restore();for(var x=0,C=r.length-1;x<=C;x++)u=x===C||this.charSpacing||m,p+=r[x],c=this.__charBounds[a][x],0===g?(i+=b*(c.kernedWidth-c.width),g+=c.width):g+=c.kernedWidth,f&&!u&&this._reSpaceAndTab.test(r[x])&&(u=!0),u||(s=s||this.getCompleteStyleDeclaration(a,x),l=this.getCompleteStyleDeclaration(a,x+1),u=t.util.hasStyleChanged(s,l,!1)),u&&(m?(n.save(),n.translate(c.renderLeft,c.renderTop),n.rotate(c.angle),this._renderChar(e,n,a,x,p,-g/2,0,h),n.restore()):(d=i,this._renderChar(e,n,a,x,p,d,o,h)),p="",s=l,i+=b*g,g=0);n.restore()},_applyPatternGradientTransformText:function(e){var n,r=t.util.createCanvasElement(),i=this.width+this.strokeWidth,o=this.height+this.strokeWidth;return r.width=i,r.height=o,(n=r.getContext("2d")).beginPath(),n.moveTo(0,0),n.lineTo(i,0),n.lineTo(i,o),n.lineTo(0,o),n.closePath(),n.translate(i/2,o/2),n.fillStyle=e.toLive(n),this._applyPatternGradientTransform(n,e),n.fill(),n.createPattern(r,"no-repeat")},handleFiller:function(e,t,n){var r,i;return n.toLive?"percentage"===n.gradientUnits||n.gradientTransform||n.patternTransform?(r=-this.width/2,i=-this.height/2,e.translate(r,i),e[t]=this._applyPatternGradientTransformText(n),{offsetX:r,offsetY:i}):(e[t]=n.toLive(e,this),this._applyPatternGradientTransform(e,n)):(e[t]=n,{offsetX:0,offsetY:0})},_setStrokeStyles:function(e,t){return e.lineWidth=t.strokeWidth,e.lineCap=this.strokeLineCap,e.lineDashOffset=this.strokeDashOffset,e.lineJoin=this.strokeLineJoin,e.miterLimit=this.strokeMiterLimit,this.handleFiller(e,"strokeStyle",t.stroke)},_setFillStyles:function(e,t){return this.handleFiller(e,"fillStyle",t.fill)},_renderChar:function(e,t,n,r,i,o,a){var s,l,c=this._getStyleDeclaration(n,r),u=this.getCompleteStyleDeclaration(n,r),d="fillText"===e&&u.fill,h="strokeText"===e&&u.stroke&&u.strokeWidth;!h&&!d||(t.save(),d&&(s=this._setFillStyles(t,u)),h&&(l=this._setStrokeStyles(t,u)),t.font=this._getFontDeclaration(u),c&&c.textBackgroundColor&&this._removeShadow(t),c&&c.deltaY&&(a+=c.deltaY),d&&t.fillText(i,o-s.offsetX,a-s.offsetY),h&&t.strokeText(i,o-l.offsetX,a-l.offsetY),t.restore())},setSuperscript:function(e,t){return this._setScript(e,t,this.superscript)},setSubscript:function(e,t){return this._setScript(e,t,this.subscript)},_setScript:function(e,t,n){var r=this.get2DCursorLocation(e,!0),i=this.getValueOfPropertyAt(r.lineIndex,r.charIndex,"fontSize"),o=this.getValueOfPropertyAt(r.lineIndex,r.charIndex,"deltaY"),a={fontSize:i*n.size,deltaY:o+i*n.baseline};return this.setSelectionStyles(a,e,t),this},_getLineLeftOffset:function(e){var t=this.getLineWidth(e),n=this.width-t,r=this.textAlign,i=this.direction,o=0,a=this.isEndOfWrapping(e);return"justify"===r||"justify-center"===r&&!a||"justify-right"===r&&!a||"justify-left"===r&&!a?0:("center"===r&&(o=n/2),"right"===r&&(o=n),"justify-center"===r&&(o=n/2),"justify-right"===r&&(o=n),"rtl"===i&&(o-=n),o)},_clearCache:function(){this.__lineWidths=[],this.__lineHeights=[],this.__charBounds=[]},_shouldClearDimensionCache:function(){var e=this._forceClearCache;return e||(e=this.hasStateChanged("_dimensionAffectingProps")),e&&(this.dirty=!0,this._forceClearCache=!1),e},getLineWidth:function(e){if(void 0!==this.__lineWidths[e])return this.__lineWidths[e];var t=this.measureLine(e).width;return this.__lineWidths[e]=t,t},_getWidthOfCharSpacing:function(){return 0!==this.charSpacing?this.fontSize*this.charSpacing/1e3:0},getValueOfPropertyAt:function(e,t,n){var r=this._getStyleDeclaration(e,t);return r&&typeof r[n]<"u"?r[n]:this[n]},_renderTextDecoration:function(e,t){if(this[t]||this.styleHas(t)){for(var n,r,i,o,a,s,l,c,u,d,h,f,p,g,m,v,y=this._getLeftOffset(),b=this._getTopOffset(),w=this.path,x=this._getWidthOfCharSpacing(),C=this.offsets[t],_=0,S=this._textLines.length;_<S;_++)if(n=this.getHeightOfLine(_),this[t]||this.styleHas(t,_)){l=this._textLines[_],g=n/this.lineHeight,o=this._getLineLeftOffset(_),d=0,h=0,c=this.getValueOfPropertyAt(_,0,t),v=this.getValueOfPropertyAt(_,0,"fill"),u=b+g*(1-this._fontSizeFraction),r=this.getHeightOfChar(_,0),a=this.getValueOfPropertyAt(_,0,"deltaY");for(var A=0,k=l.length;A<k;A++)if(f=this.__charBounds[_][A],p=this.getValueOfPropertyAt(_,A,t),m=this.getValueOfPropertyAt(_,A,"fill"),i=this.getHeightOfChar(_,A),s=this.getValueOfPropertyAt(_,A,"deltaY"),w&&p&&m)e.save(),e.fillStyle=v,e.translate(f.renderLeft,f.renderTop),e.rotate(f.angle),e.fillRect(-f.kernedWidth/2,C*i+s,f.kernedWidth,this.fontSize/15),e.restore();else if((p!==c||m!==v||i!==r||s!==a)&&h>0){var E=y+o+d;"rtl"===this.direction&&(E=this.width-E-h),c&&v&&(e.fillStyle=v,e.fillRect(E,u+C*r+a,h,this.fontSize/15)),d=f.left,h=f.width,c=p,v=m,r=i,a=s}else h+=f.kernedWidth;E=y+o+d,"rtl"===this.direction&&(E=this.width-E-h),e.fillStyle=m,p&&m&&e.fillRect(E,u+C*r+a,h-x,this.fontSize/15),b+=n}else b+=n;this._removeShadow(e)}},_getFontDeclaration:function(e,n){var r=e||this,i=this.fontFamily,o=t.Text.genericFonts.indexOf(i.toLowerCase())>-1,a=void 0===i||i.indexOf("'")>-1||i.indexOf(",")>-1||i.indexOf('"')>-1||o?r.fontFamily:'"'+r.fontFamily+'"';return[t.isLikelyNode?r.fontWeight:r.fontStyle,t.isLikelyNode?r.fontStyle:r.fontWeight,n?this.CACHE_FONT_SIZE+"px":r.fontSize+"px",a].join(" ")},render:function(e){this.visible&&(this.canvas&&this.canvas.skipOffscreen&&!this.group&&!this.isOnScreen()||(this._shouldClearDimensionCache()&&this.initDimensions(),this.callSuper("render",e)))},_splitTextIntoLines:function(e){for(var n=e.split(this._reNewline),r=new Array(n.length),i=["\n"],o=[],a=0;a<n.length;a++)r[a]=t.util.string.graphemeSplit(n[a]),o=o.concat(r[a],i);return o.pop(),{_unwrappedLines:r,lines:n,graphemeText:o,graphemeLines:r}},toObject:function(e){var n=r.concat(e),i=this.callSuper("toObject",n);return i.styles=t.util.stylesToArray(this.styles,this.text),i.path&&(i.path=this.path.toObject()),i},set:function(e,t){this.callSuper("set",e,t);var n=!1,r=!1;if("object"==typeof e)for(var i in e)"path"===i&&this.setPathInfo(),n=n||-1!==this._dimensionAffectingProps.indexOf(i),r=r||"path"===i;else n=-1!==this._dimensionAffectingProps.indexOf(e),r="path"===e;return r&&this.setPathInfo(),n&&(this.initDimensions(),this.setCoords()),this},complexity:function(){return 1}}),t.Text.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat("x y dx dy font-family font-style font-weight font-size letter-spacing text-decoration text-anchor".split(" ")),t.Text.DEFAULT_SVG_FONT_SIZE=16,t.Text.fromElement=function(e,r,i){if(!e)return r(null);var o=t.parseAttributes(e,t.Text.ATTRIBUTE_NAMES),a=o.textAnchor||"left";if((i=t.util.object.extend(i?n(i):{},o)).top=i.top||0,i.left=i.left||0,o.textDecoration){var s=o.textDecoration;-1!==s.indexOf("underline")&&(i.underline=!0),-1!==s.indexOf("overline")&&(i.overline=!0),-1!==s.indexOf("line-through")&&(i.linethrough=!0),delete i.textDecoration}"dx"in o&&(i.left+=o.dx),"dy"in o&&(i.top+=o.dy),"fontSize"in i||(i.fontSize=t.Text.DEFAULT_SVG_FONT_SIZE);var l="";"textContent"in e?l=e.textContent:"firstChild"in e&&null!==e.firstChild&&"data"in e.firstChild&&null!==e.firstChild.data&&(l=e.firstChild.data),l=l.replace(/^\s+|\s+$|\n+/g,"").replace(/\s+/g," ");var c=i.strokeWidth;i.strokeWidth=0;var u=new t.Text(l,i),d=u.getScaledHeight()/u.height,h=((u.height+u.strokeWidth)*u.lineHeight-u.height)*d,f=u.getScaledHeight()+h,p=0;"center"===a&&(p=u.getScaledWidth()/2),"right"===a&&(p=u.getScaledWidth()),u.set({left:u.left-p,top:u.top-(f-u.fontSize*(.07+u._fontSizeFraction))/u.lineHeight,strokeWidth:typeof c<"u"?c:1}),r(u)},t.Text.fromObject=function(e,r){var i=n(e),o=e.path;return delete i.path,t.Object._fromObject("Text",i,function(n){n.styles=t.util.stylesFromArray(e.styles,e.text),o?t.Object._fromObject("Path",o,function(e){n.set("path",e),r(n)},"path"):r(n)},"text")},t.Text.genericFonts=["sans-serif","serif","cursive","fantasy","monospace"],t.util.createAccessors&&t.util.createAccessors(t.Text)}}(e),t.util.object.extend(t.Text.prototype,{isEmptyStyles:function(e){if(!this.styles||typeof e<"u"&&!this.styles[e])return!0;var t=typeof e>"u"?this.styles:{line:this.styles[e]};for(var n in t)for(var r in t[n])for(var i in t[n][r])return!1;return!0},styleHas:function(e,t){if(!this.styles||!e||""===e||typeof t<"u"&&!this.styles[t])return!1;var n=typeof t>"u"?this.styles:{0:this.styles[t]};for(var r in n)for(var i in n[r])if(typeof n[r][i][e]<"u")return!0;return!1},cleanStyle:function(e){if(!this.styles||!e||""===e)return!1;var t,n,r=this.styles,i=0,o=!0,a=0;for(var s in r){for(var l in t=0,r[s]){var c;i++,(c=r[s][l]).hasOwnProperty(e)?(n?c[e]!==n&&(o=!1):n=c[e],c[e]===this[e]&&delete c[e]):o=!1,0!==Object.keys(c).length?t++:delete r[s][l]}0===t&&delete r[s]}for(var u=0;u<this._textLines.length;u++)a+=this._textLines[u].length;o&&i===a&&(this[e]=n,this.removeStyle(e))},removeStyle:function(e){if(this.styles&&e&&""!==e){var t,n,r,i=this.styles;for(n in i){for(r in t=i[n])delete t[r][e],0===Object.keys(t[r]).length&&delete t[r];0===Object.keys(t).length&&delete i[n]}}},_extendStyles:function(e,n){var r=this.get2DCursorLocation(e);this._getLineStyle(r.lineIndex)||this._setLineStyle(r.lineIndex),this._getStyleDeclaration(r.lineIndex,r.charIndex)||this._setStyleDeclaration(r.lineIndex,r.charIndex,{}),t.util.object.extend(this._getStyleDeclaration(r.lineIndex,r.charIndex),n)},get2DCursorLocation:function(e,t){typeof e>"u"&&(e=this.selectionStart);for(var n=t?this._unwrappedTextLines:this._textLines,r=n.length,i=0;i<r;i++){if(e<=n[i].length)return{lineIndex:i,charIndex:e};e-=n[i].length+this.missingNewlineOffset(i)}return{lineIndex:i-1,charIndex:n[i-1].length<e?n[i-1].length:e}},getSelectionStyles:function(e,t,n){typeof e>"u"&&(e=this.selectionStart||0),typeof t>"u"&&(t=this.selectionEnd||e);for(var r=[],i=e;i<t;i++)r.push(this.getStyleAtPosition(i,n));return r},getStyleAtPosition:function(e,t){var n=this.get2DCursorLocation(e);return(t?this.getCompleteStyleDeclaration(n.lineIndex,n.charIndex):this._getStyleDeclaration(n.lineIndex,n.charIndex))||{}},setSelectionStyles:function(e,t,n){typeof t>"u"&&(t=this.selectionStart||0),typeof n>"u"&&(n=this.selectionEnd||t);for(var r=t;r<n;r++)this._extendStyles(r,e);return this._forceClearCache=!0,this},_getStyleDeclaration:function(e,t){var n=this.styles&&this.styles[e];return n?n[t]:null},getCompleteStyleDeclaration:function(e,t){for(var n,r=this._getStyleDeclaration(e,t)||{},i={},o=0;o<this._styleProperties.length;o++)i[n=this._styleProperties[o]]=typeof r[n]>"u"?this[n]:r[n];return i},_setStyleDeclaration:function(e,t,n){this.styles[e][t]=n},_deleteStyleDeclaration:function(e,t){delete this.styles[e][t]},_getLineStyle:function(e){return!!this.styles[e]},_setLineStyle:function(e){this.styles[e]={}},_deleteLineStyle:function(e){delete this.styles[e]}}),function(){function e(e){e.textDecoration&&(e.textDecoration.indexOf("underline")>-1&&(e.underline=!0),e.textDecoration.indexOf("line-through")>-1&&(e.linethrough=!0),e.textDecoration.indexOf("overline")>-1&&(e.overline=!0),delete e.textDecoration)}t.IText=t.util.createClass(t.Text,t.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(e,t){this.callSuper("initialize",e,t),this.initBehavior()},setSelectionStart:function(e){e=Math.max(e,0),this._updateAndFire("selectionStart",e)},setSelectionEnd:function(e){e=Math.min(e,this.text.length),this._updateAndFire("selectionEnd",e)},_updateAndFire:function(e,t){this[e]!==t&&(this._fireSelectionChanged(),this[e]=t),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(e){this.clearContextTop(),this.callSuper("render",e),this.cursorOffsetCache={},this.renderCursorOrSelection()},_render:function(e){this.callSuper("_render",e)},clearContextTop:function(e){if(this.isEditing&&this.canvas&&this.canvas.contextTop){var t=this.canvas.contextTop,n=this.canvas.viewportTransform;t.save(),t.transform(n[0],n[1],n[2],n[3],n[4],n[5]),this.transform(t),this._clearTextArea(t),e||t.restore()}},renderCursorOrSelection:function(){if(this.isEditing&&this.canvas&&this.canvas.contextTop){var e=this._getCursorBoundaries(),t=this.canvas.contextTop;this.clearContextTop(!0),this.selectionStart===this.selectionEnd?this.renderCursor(e,t):this.renderSelection(e,t),t.restore()}},_clearTextArea:function(e){var t=this.width+4,n=this.height+4;e.clearRect(-t/2,-n/2,t,n)},_getCursorBoundaries:function(e){typeof e>"u"&&(e=this.selectionStart);var t=this._getLeftOffset(),n=this._getTopOffset(),r=this._getCursorBoundariesOffsets(e);return{left:t,top:n,leftOffset:r.left,topOffset:r.top}},_getCursorBoundariesOffsets:function(e){if(this.cursorOffsetCache&&"top"in this.cursorOffsetCache)return this.cursorOffsetCache;var t,n,r,i,o=0,a=0,s=this.get2DCursorLocation(e);r=s.charIndex,n=s.lineIndex;for(var l=0;l<n;l++)o+=this.getHeightOfLine(l);t=this._getLineLeftOffset(n);var c=this.__charBounds[n][r];return c&&(a=c.left),0!==this.charSpacing&&r===this._textLines[n].length&&(a-=this._getWidthOfCharSpacing()),i={top:o,left:t+(a>0?a:0)},"rtl"===this.direction&&(i.left*=-1),this.cursorOffsetCache=i,this.cursorOffsetCache},renderCursor:function(e,t){var n=this.get2DCursorLocation(),r=n.lineIndex,i=n.charIndex>0?n.charIndex-1:0,o=this.getValueOfPropertyAt(r,i,"fontSize"),a=this.scaleX*this.canvas.getZoom(),s=this.cursorWidth/a,l=e.topOffset,c=this.getValueOfPropertyAt(r,i,"deltaY");l+=(1-this._fontSizeFraction)*this.getHeightOfLine(r)/this.lineHeight-o*(1-this._fontSizeFraction),this.inCompositionMode&&this.renderSelection(e,t),t.fillStyle=this.cursorColor||this.getValueOfPropertyAt(r,i,"fill"),t.globalAlpha=this.__isMousedown?1:this._currentCursorOpacity,t.fillRect(e.left+e.leftOffset-s/2,l+e.top+c,s,o)},renderSelection:function(e,t){for(var n=this.inCompositionMode?this.hiddenTextarea.selectionStart:this.selectionStart,r=this.inCompositionMode?this.hiddenTextarea.selectionEnd:this.selectionEnd,i=-1!==this.textAlign.indexOf("justify"),o=this.get2DCursorLocation(n),a=this.get2DCursorLocation(r),s=o.lineIndex,l=a.lineIndex,c=o.charIndex<0?0:o.charIndex,u=a.charIndex<0?0:a.charIndex,d=s;d<=l;d++){var h,f=this._getLineLeftOffset(d)||0,p=this.getHeightOfLine(d),g=0,m=0;if(d===s&&(g=this.__charBounds[s][c].left),d>=s&&d<l)m=i&&!this.isEndOfWrapping(d)?this.width:this.getLineWidth(d)||5;else if(d===l)if(0===u)m=this.__charBounds[l][u].left;else{var v=this._getWidthOfCharSpacing();m=this.__charBounds[l][u-1].left+this.__charBounds[l][u-1].width-v}h=p,(this.lineHeight<1||d===l&&this.lineHeight>1)&&(p/=this.lineHeight);var y=e.left+f+g,b=m-g,w=p,x=0;this.inCompositionMode?(t.fillStyle=this.compositionColor||"black",w=1,x=p):t.fillStyle=this.selectionColor,"rtl"===this.direction&&(y=this.width-y-b),t.fillRect(y,e.top+e.topOffset+x,b,w),e.topOffset+=h}},getCurrentCharFontSize:function(){var e=this._getCurrentCharIndex();return this.getValueOfPropertyAt(e.l,e.c,"fontSize")},getCurrentCharColor:function(){var e=this._getCurrentCharIndex();return this.getValueOfPropertyAt(e.l,e.c,"fill")},_getCurrentCharIndex:function(){var e=this.get2DCursorLocation(this.selectionStart,!0),t=e.charIndex>0?e.charIndex-1:0;return{l:e.lineIndex,c:t}}}),t.IText.fromObject=function(n,r){var i=t.util.stylesFromArray(n.styles,n.text),o=Object.assign({},n,{styles:i});if(e(o),o.styles)for(var a in o.styles)for(var s in o.styles[a])e(o.styles[a][s]);t.Object._fromObject("IText",o,r,"text")}}(),function(){var e=t.util.object.clone;t.util.object.extend(t.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 e=this;this.on("added",function(){var t=e.canvas;t&&(t._hasITextHandlers||(t._hasITextHandlers=!0,e._initCanvasHandlers(t)),t._iTextInstances=t._iTextInstances||[],t._iTextInstances.push(e))})},initRemovedHandler:function(){var e=this;this.on("removed",function(){var n=e.canvas;n&&(n._iTextInstances=n._iTextInstances||[],t.util.removeFromArray(n._iTextInstances,e),0===n._iTextInstances.length&&(n._hasITextHandlers=!1,e._removeCanvasHandlers(n)))})},_initCanvasHandlers:function(e){e._mouseUpITextHandler=function(){e._iTextInstances&&e._iTextInstances.forEach(function(e){e.__isMousedown=!1})},e.on("mouse:up",e._mouseUpITextHandler)},_removeCanvasHandlers:function(e){e.off("mouse:up",e._mouseUpITextHandler)},_tick:function(){this._currentTickState=this._animateCursor(this,1,this.cursorDuration,"_onTickComplete")},_animateCursor:function(e,t,n,r){var i;return i={isAborted:!1,abort:function(){this.isAborted=!0}},e.animate("_currentCursorOpacity",t,{duration:n,onComplete:function(){i.isAborted||e[r]()},onChange:function(){e.canvas&&e.selectionStart===e.selectionEnd&&e.renderCursorOrSelection()},abort:function(){return i.isAborted}}),i},_onTickComplete:function(){var e=this;this._cursorTimeout1&&clearTimeout(this._cursorTimeout1),this._cursorTimeout1=setTimeout(function(){e._currentTickCompleteState=e._animateCursor(e,0,this.cursorDuration/2,"_tick")},100)},initDelayedCursor:function(e){var t=this,n=e?0:this.cursorDelay;this.abortCursorAnimation(),this._currentCursorOpacity=1,this._cursorTimeout2=setTimeout(function(){t._tick()},n)},abortCursorAnimation:function(){var e=this._currentTickState||this._currentTickCompleteState,t=this.canvas;this._currentTickState&&this._currentTickState.abort(),this._currentTickCompleteState&&this._currentTickCompleteState.abort(),clearTimeout(this._cursorTimeout1),clearTimeout(this._cursorTimeout2),this._currentCursorOpacity=0,e&&t&&t.clearContext(t.contextTop||t.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(e){var t=0,n=e-1;if(this._reSpace.test(this._text[n]))for(;this._reSpace.test(this._text[n]);)t++,n--;for(;/\S/.test(this._text[n])&&n>-1;)t++,n--;return e-t},findWordBoundaryRight:function(e){var t=0,n=e;if(this._reSpace.test(this._text[n]))for(;this._reSpace.test(this._text[n]);)t++,n++;for(;/\S/.test(this._text[n])&&n<this._text.length;)t++,n++;return e+t},findLineBoundaryLeft:function(e){for(var t=0,n=e-1;!/\n/.test(this._text[n])&&n>-1;)t++,n--;return e-t},findLineBoundaryRight:function(e){for(var t=0,n=e;!/\n/.test(this._text[n])&&n<this._text.length;)t++,n++;return e+t},searchWordBoundary:function(e,n){for(var r=this._text,i=this._reSpace.test(r[e])?e-1:e,o=r[i],a=t.reNonWord;!a.test(o)&&i>0&&i<r.length;)o=r[i+=n];return a.test(o)&&(i+=1===n?0:1),i},selectWord:function(e){e=e||this.selectionStart;var t=this.searchWordBoundary(e,-1),n=this.searchWordBoundary(e,1);this.selectionStart=t,this.selectionEnd=n,this._fireSelectionChanged(),this._updateTextarea(),this.renderCursorOrSelection()},selectLine:function(e){e=e||this.selectionStart;var t=this.findLineBoundaryLeft(e),n=this.findLineBoundaryRight(e);return this.selectionStart=t,this.selectionEnd=n,this._fireSelectionChanged(),this._updateTextarea(),this},enterEditing:function(e){if(!this.isEditing&&this.editable)return this.canvas&&(this.canvas.calcOffset(),this.exitEditingOnOthers(this.canvas)),this.isEditing=!0,this.initHiddenTextarea(e),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(e){e._iTextInstances&&e._iTextInstances.forEach(function(e){e.selected=!1,e.isEditing&&e.exitEditing()})},initMouseMoveHandler:function(){this.canvas.on("mouse:move",this.mouseMoveHandler)},mouseMoveHandler:function(e){if(this.__isMousedown&&this.isEditing){document.activeElement!==this.hiddenTextarea&&this.hiddenTextarea.focus();var t=this.getSelectionStartFromPointer(e.e),n=this.selectionStart,r=this.selectionEnd;(t!==this.__selectionStartOnMouseDown||n===r)&&(n===t||r===t)||(t>this.__selectionStartOnMouseDown?(this.selectionStart=this.__selectionStartOnMouseDown,this.selectionEnd=t):(this.selectionStart=t,this.selectionEnd=this.__selectionStartOnMouseDown),(this.selectionStart!==n||this.selectionEnd!==r)&&(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(e,n,r){var i=r.slice(0,e),o=t.util.string.graphemeSplit(i).length;if(e===n)return{selectionStart:o,selectionEnd:o};var a=r.slice(e,n);return{selectionStart:o,selectionEnd:o+t.util.string.graphemeSplit(a).length}},fromGraphemeToStringSelection:function(e,t,n){var r=n.slice(0,e).join("").length;return e===t?{selectionStart:r,selectionEnd:r}:{selectionStart:r,selectionEnd:r+n.slice(e,t).join("").length}},_updateTextarea:function(){if(this.cursorOffsetCache={},this.hiddenTextarea){if(!this.inCompositionMode){var e=this.fromGraphemeToStringSelection(this.selectionStart,this.selectionEnd,this._text);this.hiddenTextarea.selectionStart=e.selectionStart,this.hiddenTextarea.selectionEnd=e.selectionEnd}this.updateTextareaPosition()}},updateFromTextArea:function(){if(this.hiddenTextarea){this.cursorOffsetCache={},this.text=this.hiddenTextarea.value,this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords());var e=this.fromStringToGraphemeSelection(this.hiddenTextarea.selectionStart,this.hiddenTextarea.selectionEnd,this.hiddenTextarea.value);this.selectionEnd=this.selectionStart=e.selectionEnd,this.inCompositionMode||(this.selectionStart=e.selectionStart),this.updateTextareaPosition()}},updateTextareaPosition:function(){if(this.selectionStart===this.selectionEnd){var e=this._calcTextareaPosition();this.hiddenTextarea.style.left=e.left,this.hiddenTextarea.style.top=e.top}},_calcTextareaPosition:function(){if(!this.canvas)return{x:1,y:1};var e=this.inCompositionMode?this.compositionStart:this.selectionStart,n=this._getCursorBoundaries(e),r=this.get2DCursorLocation(e),i=r.lineIndex,o=r.charIndex,a=this.getValueOfPropertyAt(i,o,"fontSize")*this.lineHeight,s=n.leftOffset,l=this.calcTransformMatrix(),c={x:n.left+s,y:n.top+n.topOffset+a},u=this.canvas.getRetinaScaling(),d=this.canvas.upperCanvasEl,h=d.width/u,f=d.height/u,p=h-a,g=f-a,m=d.clientWidth/h,v=d.clientHeight/f;return c=t.util.transformPoint(c,l),(c=t.util.transformPoint(c,this.canvas.viewportTransform)).x*=m,c.y*=v,c.x<0&&(c.x=0),c.x>p&&(c.x=p),c.y<0&&(c.y=0),c.y>g&&(c.y=g),c.x+=this.canvas._offset.left,c.y+=this.canvas._offset.top,{left:c.x+"px",top:c.y+"px",fontSize:a+"px",charHeight:a}},_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 e=this._textBeforeEdit!==this.text,t=this.hiddenTextarea;return this.selected=!1,this.isEditing=!1,this.selectionEnd=this.selectionStart,t&&(t.blur&&t.blur(),t.parentNode&&t.parentNode.removeChild(t)),this.hiddenTextarea=null,this.abortCursorAnimation(),this._restoreEditingProps(),this._currentCursorOpacity=0,this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this.fire("editing:exited"),e&&this.fire("modified"),this.canvas&&(this.canvas.off("mouse:move",this.mouseMoveHandler),this.canvas.fire("text:editing:exited",{target:this}),e&&this.canvas.fire("object:modified",{target:this})),this},_removeExtraneousStyles:function(){for(var e in this.styles)this._textLines[e]||delete this.styles[e]},removeStyleFromTo:function(e,t){var n,r,i=this.get2DCursorLocation(e,!0),o=this.get2DCursorLocation(t,!0),a=i.lineIndex,s=i.charIndex,l=o.lineIndex,c=o.charIndex;if(a!==l){if(this.styles[a])for(n=s;n<this._unwrappedTextLines[a].length;n++)delete this.styles[a][n];if(this.styles[l])for(n=c;n<this._unwrappedTextLines[l].length;n++)(r=this.styles[l][n])&&(this.styles[a]||(this.styles[a]={}),this.styles[a][s+n-c]=r);for(n=a+1;n<=l;n++)delete this.styles[n];this.shiftLineStyles(l,a-l)}else if(this.styles[a]){r=this.styles[a];var u,d,h=c-s;for(n=s;n<c;n++)delete r[n];for(d in this.styles[a])(u=parseInt(d,10))>=c&&(r[u-h]=r[d],delete r[d])}},shiftLineStyles:function(t,n){var r=e(this.styles);for(var i in this.styles){var o=parseInt(i,10);o>t&&(this.styles[o+n]=r[o],r[o-n]||delete this.styles[o])}},restartCursorIfNeeded:function(){(!this._currentTickState||this._currentTickState.isAborted||!this._currentTickCompleteState||this._currentTickCompleteState.isAborted)&&this.initDelayedCursor()},insertNewlineStyleObject:function(t,n,r,i){var o,a={},s=!1,l=this._unwrappedTextLines[t].length===n;for(var c in r||(r=1),this.shiftLineStyles(t,r),this.styles[t]&&(o=this.styles[t][0===n?n:n-1]),this.styles[t]){var u=parseInt(c,10);u>=n&&(s=!0,a[u-n]=this.styles[t][c],l&&0===n||delete this.styles[t][c])}var d=!1;for(s&&!l&&(this.styles[t+r]=a,d=!0),d&&r--;r>0;)i&&i[r-1]?this.styles[t+r]={0:e(i[r-1])}:o?this.styles[t+r]={0:e(o)}:delete this.styles[t+r],r--;this._forceClearCache=!0},insertCharStyleObject:function(t,n,r,i){this.styles||(this.styles={});var o=this.styles[t],a=o?e(o):{};for(var s in r||(r=1),a){var l=parseInt(s,10);l>=n&&(o[l+r]=a[l],a[l-r]||delete o[l])}if(this._forceClearCache=!0,i)for(;r--;)Object.keys(i[r]).length&&(this.styles[t]||(this.styles[t]={}),this.styles[t][n+r]=e(i[r]));else if(o)for(var c=o[n?n-1:1];c&&r--;)this.styles[t][n+r]=e(c)},insertNewStyleBlock:function(e,t,n){for(var r=this.get2DCursorLocation(t,!0),i=[0],o=0,a=0;a<e.length;a++)"\n"===e[a]?i[++o]=0:i[o]++;for(i[0]>0&&(this.insertCharStyleObject(r.lineIndex,r.charIndex,i[0],n),n=n&&n.slice(i[0]+1)),o&&this.insertNewlineStyleObject(r.lineIndex,r.charIndex+i[0],o),a=1;a<o;a++)i[a]>0?this.insertCharStyleObject(r.lineIndex+a,0,i[a],n):n&&this.styles[r.lineIndex+a]&&n[0]&&(this.styles[r.lineIndex+a][0]=n[0]),n=n&&n.slice(i[a]+1);i[a]>0&&this.insertCharStyleObject(r.lineIndex+a,0,i[a],n)},setSelectionStartEndWithShift:function(e,t,n){n<=e?(t===e?this._selectionDirection="left":"right"===this._selectionDirection&&(this._selectionDirection="left",this.selectionEnd=e),this.selectionStart=n):n>e&&n<t?"right"===this._selectionDirection?this.selectionEnd=n:this.selectionStart=n:(t===e?this._selectionDirection="right":"left"===this._selectionDirection&&(this._selectionDirection="right",this.selectionStart=t),this.selectionEnd=n)},setSelectionInBoundaries:function(){var e=this.text.length;this.selectionStart>e?this.selectionStart=e:this.selectionStart<0&&(this.selectionStart=0),this.selectionEnd>e?this.selectionEnd=e:this.selectionEnd<0&&(this.selectionEnd=0)}})}(),t.util.object.extend(t.IText.prototype,{initDoubleClickSimulation:function(){this.__lastClickTime=+new Date,this.__lastLastClickTime=+new Date,this.__lastPointer={},this.on("mousedown",this.onMouseDown)},onMouseDown:function(e){if(this.canvas){this.__newClickTime=+new Date;var t=e.pointer;this.isTripleClick(t)&&(this.fire("tripleclick",e),this._stopEvent(e.e)),this.__lastLastClickTime=this.__lastClickTime,this.__lastClickTime=this.__newClickTime,this.__lastPointer=t,this.__lastIsEditing=this.isEditing,this.__lastSelected=this.selected}},isTripleClick:function(e){return this.__newClickTime-this.__lastClickTime<500&&this.__lastClickTime-this.__lastLastClickTime<500&&this.__lastPointer.x===e.x&&this.__lastPointer.y===e.y},_stopEvent:function(e){e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation()},initCursorSelectionHandlers:function(){this.initMousedownHandler(),this.initMouseupHandler(),this.initClicks()},doubleClickHandler:function(e){this.isEditing&&this.selectWord(this.getSelectionStartFromPointer(e.e))},tripleClickHandler:function(e){this.isEditing&&this.selectLine(this.getSelectionStartFromPointer(e.e))},initClicks:function(){this.on("mousedblclick",this.doubleClickHandler),this.on("tripleclick",this.tripleClickHandler)},_mouseDownHandler:function(e){!this.canvas||!this.editable||e.e.button&&1!==e.e.button||(this.__isMousedown=!0,this.selected&&(this.inCompositionMode=!1,this.setCursorByClick(e.e)),this.isEditing&&(this.__selectionStartOnMouseDown=this.selectionStart,this.selectionStart===this.selectionEnd&&this.abortCursorAnimation(),this.renderCursorOrSelection()))},_mouseDownHandlerBefore:function(e){!this.canvas||!this.editable||e.e.button&&1!==e.e.button||(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(e){if(this.__isMousedown=!1,!(!this.editable||this.group||e.transform&&e.transform.actionPerformed||e.e.button&&1!==e.e.button)){if(this.canvas){var t=this.canvas._activeObject;if(t&&t!==this)return}this.__lastSelected&&!this.__corner?(this.selected=!1,this.__lastSelected=!1,this.enterEditing(e.e),this.selectionStart===this.selectionEnd?this.initDelayedCursor(!0):this.renderCursorOrSelection()):this.selected=!0}},setCursorByClick:function(e){var t=this.getSelectionStartFromPointer(e),n=this.selectionStart,r=this.selectionEnd;e.shiftKey?this.setSelectionStartEndWithShift(n,r,t):(this.selectionStart=t,this.selectionEnd=t),this.isEditing&&(this._fireSelectionChanged(),this._updateTextarea())},getSelectionStartFromPointer:function(e){for(var t,n=this.getLocalPointer(e),r=0,i=0,o=0,a=0,s=0,l=0,c=this._textLines.length;l<c&&o<=n.y;l++)o+=this.getHeightOfLine(l)*this.scaleY,s=l,l>0&&(a+=this._textLines[l-1].length+this.missingNewlineOffset(l-1));i=this._getLineLeftOffset(s)*this.scaleX,t=this._textLines[s],"rtl"===this.direction&&(n.x=this.width*this.scaleX-n.x+i);for(var u=0,d=t.length;u<d&&(r=i,(i+=this.__charBounds[s][u].kernedWidth*this.scaleX)<=n.x);u++)a++;return this._getNewSelectionStartFromOffset(n,r,i,a,d)},_getNewSelectionStartFromOffset:function(e,t,n,r,i){var o=e.x-t,a=n-e.x,s=r+(a>o||a<0?0:1);return this.flipX&&(s=i-s),s>this._text.length&&(s=this._text.length),s}}),t.util.object.extend(t.IText.prototype,{initHiddenTextarea:function(){this.hiddenTextarea=t.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 e=this._calcTextareaPosition();this.hiddenTextarea.style.cssText="position: absolute; top: "+e.top+"; left: "+e.left+"; z-index: -999; opacity: 0; width: 1px; height: 1px; font-size: 1px; padding-top: "+e.fontSize+";",this.hiddenTextareaContainer?this.hiddenTextareaContainer.appendChild(this.hiddenTextarea):t.document.body.appendChild(this.hiddenTextarea),t.util.addListener(this.hiddenTextarea,"keydown",this.onKeyDown.bind(this)),t.util.addListener(this.hiddenTextarea,"keyup",this.onKeyUp.bind(this)),t.util.addListener(this.hiddenTextarea,"input",this.onInput.bind(this)),t.util.addListener(this.hiddenTextarea,"copy",this.copy.bind(this)),t.util.addListener(this.hiddenTextarea,"cut",this.copy.bind(this)),t.util.addListener(this.hiddenTextarea,"paste",this.paste.bind(this)),t.util.addListener(this.hiddenTextarea,"compositionstart",this.onCompositionStart.bind(this)),t.util.addListener(this.hiddenTextarea,"compositionupdate",this.onCompositionUpdate.bind(this)),t.util.addListener(this.hiddenTextarea,"compositionend",this.onCompositionEnd.bind(this)),!this._clickHandlerInitialized&&this.canvas&&(t.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(e){if(this.isEditing){var t="rtl"===this.direction?this.keysMapRtl:this.keysMap;if(e.keyCode in t)this[t[e.keyCode]](e);else{if(!(e.keyCode in this.ctrlKeysMapDown)||!e.ctrlKey&&!e.metaKey)return;this[this.ctrlKeysMapDown[e.keyCode]](e)}e.stopImmediatePropagation(),e.preventDefault(),e.keyCode>=33&&e.keyCode<=40?(this.inCompositionMode=!1,this.clearContextTop(),this.renderCursorOrSelection()):this.canvas&&this.canvas.requestRenderAll()}},onKeyUp:function(e){!this.isEditing||this._copyDone||this.inCompositionMode?this._copyDone=!1:e.keyCode in this.ctrlKeysMapUp&&(e.ctrlKey||e.metaKey)&&(this[this.ctrlKeysMapUp[e.keyCode]](e),e.stopImmediatePropagation(),e.preventDefault(),this.canvas&&this.canvas.requestRenderAll())},onInput:function(e){var n=this.fromPaste;if(this.fromPaste=!1,e&&e.stopPropagation(),this.isEditing){var r,i,o,a,s,l=this._splitTextIntoLines(this.hiddenTextarea.value).graphemeText,c=this._text.length,u=l.length,d=u-c,h=this.selectionStart,f=this.selectionEnd,p=h!==f;if(""===this.hiddenTextarea.value)return this.styles={},this.updateFromTextArea(),this.fire("changed"),void(this.canvas&&(this.canvas.fire("text:changed",{target:this}),this.canvas.requestRenderAll()));var g=this.fromStringToGraphemeSelection(this.hiddenTextarea.selectionStart,this.hiddenTextarea.selectionEnd,this.hiddenTextarea.value),m=h>g.selectionStart;p?(r=this._text.slice(h,f),d+=f-h):u<c&&(r=m?this._text.slice(f+d,f):this._text.slice(h,h-d)),i=l.slice(g.selectionEnd-d,g.selectionEnd),r&&r.length&&(i.length&&(o=this.getSelectionStyles(h,h+1,!1),o=i.map(function(){return o[0]})),p?(a=h,s=f):m?(a=f-r.length,s=f):(a=f,s=f+r.length),this.removeStyleFromTo(a,s)),i.length&&(n&&i.join("")===t.copiedText&&!t.disableStyleCopyPaste&&(o=t.copiedTextStyle),this.insertNewStyleBlock(i,h,o)),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(e){this.compositionStart=e.target.selectionStart,this.compositionEnd=e.target.selectionEnd,this.updateTextareaPosition()},copy:function(){this.selectionStart!==this.selectionEnd&&(t.copiedText=this.getSelectedText(),t.disableStyleCopyPaste?t.copiedTextStyle=null:t.copiedTextStyle=this.getSelectionStyles(this.selectionStart,this.selectionEnd,!0),this._copyDone=!0)},paste:function(){this.fromPaste=!0},_getClipboardData:function(e){return e&&e.clipboardData||t.window.clipboardData},_getWidthBeforeCursor:function(e,t){var n,r=this._getLineLeftOffset(e);return t>0&&(r+=(n=this.__charBounds[e][t-1]).left+n.width),r},getDownCursorOffset:function(e,t){var n=this._getSelectionForOffset(e,t),r=this.get2DCursorLocation(n),i=r.lineIndex;if(i===this._textLines.length-1||e.metaKey||34===e.keyCode)return this._text.length-n;var o=r.charIndex,a=this._getWidthBeforeCursor(i,o),s=this._getIndexOnLine(i+1,a);return this._textLines[i].slice(o).length+s+1+this.missingNewlineOffset(i)},_getSelectionForOffset:function(e,t){return e.shiftKey&&this.selectionStart!==this.selectionEnd&&t?this.selectionEnd:this.selectionStart},getUpCursorOffset:function(e,t){var n=this._getSelectionForOffset(e,t),r=this.get2DCursorLocation(n),i=r.lineIndex;if(0===i||e.metaKey||33===e.keyCode)return-n;var o=r.charIndex,a=this._getWidthBeforeCursor(i,o),s=this._getIndexOnLine(i-1,a),l=this._textLines[i].slice(0,o),c=this.missingNewlineOffset(i-1);return-this._textLines[i-1].length+s-l.length+(1-c)},_getIndexOnLine:function(e,t){for(var n,r,i=this._textLines[e],o=this._getLineLeftOffset(e),a=0,s=0,l=i.length;s<l;s++)if((o+=n=this.__charBounds[e][s].width)>t){r=!0;var c=o-n,u=o,d=Math.abs(c-t);a=Math.abs(u-t)<d?s:s-1;break}return r||(a=i.length-1),a},moveCursorDown:function(e){this.selectionStart>=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorUpOrDown("Down",e)},moveCursorUp:function(e){0===this.selectionStart&&0===this.selectionEnd||this._moveCursorUpOrDown("Up",e)},_moveCursorUpOrDown:function(e,t){var n=this["get"+e+"CursorOffset"](t,"right"===this._selectionDirection);t.shiftKey?this.moveCursorWithShift(n):this.moveCursorWithoutShift(n),0!==n&&(this.setSelectionInBoundaries(),this.abortCursorAnimation(),this._currentCursorOpacity=1,this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea())},moveCursorWithShift:function(e){var t="left"===this._selectionDirection?this.selectionStart+e:this.selectionEnd+e;return this.setSelectionStartEndWithShift(this.selectionStart,this.selectionEnd,t),0!==e},moveCursorWithoutShift:function(e){return e<0?(this.selectionStart+=e,this.selectionEnd=this.selectionStart):(this.selectionEnd+=e,this.selectionStart=this.selectionEnd),0!==e},moveCursorLeft:function(e){0===this.selectionStart&&0===this.selectionEnd||this._moveCursorLeftOrRight("Left",e)},_move:function(e,t,n){var r;if(e.altKey)r=this["findWordBoundary"+n](this[t]);else{if(!e.metaKey&&35!==e.keyCode&&36!==e.keyCode)return this[t]+="Left"===n?-1:1,!0;r=this["findLineBoundary"+n](this[t])}if(typeof r<"u"&&this[t]!==r)return this[t]=r,!0},_moveLeft:function(e,t){return this._move(e,t,"Left")},_moveRight:function(e,t){return this._move(e,t,"Right")},moveCursorLeftWithoutShift:function(e){var t=!0;return this._selectionDirection="left",this.selectionEnd===this.selectionStart&&0!==this.selectionStart&&(t=this._moveLeft(e,"selectionStart")),this.selectionEnd=this.selectionStart,t},moveCursorLeftWithShift:function(e){return"right"===this._selectionDirection&&this.selectionStart!==this.selectionEnd?this._moveLeft(e,"selectionEnd"):0!==this.selectionStart?(this._selectionDirection="left",this._moveLeft(e,"selectionStart")):void 0},moveCursorRight:function(e){this.selectionStart>=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorLeftOrRight("Right",e)},_moveCursorLeftOrRight:function(e,t){var n="moveCursor"+e+"With";this._currentCursorOpacity=1,t.shiftKey?n+="Shift":n+="outShift",this[n](t)&&(this.abortCursorAnimation(),this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea())},moveCursorRightWithShift:function(e){return"left"===this._selectionDirection&&this.selectionStart!==this.selectionEnd?this._moveRight(e,"selectionStart"):this.selectionEnd!==this._text.length?(this._selectionDirection="right",this._moveRight(e,"selectionEnd")):void 0},moveCursorRightWithoutShift:function(e){var t=!0;return this._selectionDirection="right",this.selectionStart===this.selectionEnd?(t=this._moveRight(e,"selectionStart"),this.selectionEnd=this.selectionStart):this.selectionStart=this.selectionEnd,t},removeChars:function(e,t){typeof t>"u"&&(t=e+1),this.removeStyleFromTo(e,t),this._text.splice(e,t-e),this.text=this._text.join(""),this.set("dirty",!0),this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this._removeExtraneousStyles()},insertChars:function(e,n,r,i){typeof i>"u"&&(i=r),i>r&&this.removeStyleFromTo(r,i);var o=t.util.string.graphemeSplit(e);this.insertNewStyleBlock(o,r,n),this._text=[].concat(this._text.slice(0,r),o,this._text.slice(i)),this.text=this._text.join(""),this.set("dirty",!0),this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this._removeExtraneousStyles()}}),function(){var e=t.util.toFixed,n=/ +/g;t.util.object.extend(t.Text.prototype,{_toSVG:function(){var e=this._getSVGLeftTopOffsets(),t=this._getSVGTextAndBg(e.textTop,e.textLeft);return this._wrapSVGTextAndBg(t)},toSVG:function(e){return this._createBaseSVGMarkup(this._toSVG(),{reviver:e,noStyle:!0,withShadow:!0})},_getSVGLeftTopOffsets:function(){return{textLeft:-this.width/2,textTop:-this.height/2,lineTop:this.getHeightOfLine(0)}},_wrapSVGTextAndBg:function(e){var t=this.getSvgTextDecoration(this);return[e.textBgRects.join(""),'\t\t<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+'" ':"",t?'text-decoration="'+t+'" ':"",'style="',this.getSvgStyles(!0),'"',this.addPaintOrder()," >",e.textSpans.join(""),"</text>\n"]},_getSVGTextAndBg:function(e,t){var n,r=[],i=[],o=e;this._setSVGBg(i);for(var a=0,s=this._textLines.length;a<s;a++)n=this._getLineLeftOffset(a),(this.textBackgroundColor||this.styleHas("textBackgroundColor",a))&&this._setSVGTextLineBg(i,a,t+n,o),this._setSVGTextLineText(r,a,t+n,o),o+=this.getHeightOfLine(a);return{textSpans:r,textBgRects:i}},_createTextCharSpan:function(r,i,o,a){var s=r!==r.trim()||r.match(n),l=this.getSvgSpanStyles(i,s),c=l?'style="'+l+'"':"",u=i.deltaY,d="",h=t.Object.NUM_FRACTION_DIGITS;return u&&(d=' dy="'+e(u,h)+'" '),['<tspan x="',e(o,h),'" y="',e(a,h),'" ',d,c,">",t.util.string.escapeXml(r),"</tspan>"].join("")},_setSVGTextLineText:function(e,n,r,i){var o,a,s,l,c,u=this.getHeightOfLine(n),d=-1!==this.textAlign.indexOf("justify"),h="",f=0,p=this._textLines[n];i+=u*(1-this._fontSizeFraction)/this.lineHeight;for(var g=0,m=p.length-1;g<=m;g++)c=g===m||this.charSpacing,h+=p[g],s=this.__charBounds[n][g],0===f?(r+=s.kernedWidth-s.width,f+=s.width):f+=s.kernedWidth,d&&!c&&this._reSpaceAndTab.test(p[g])&&(c=!0),c||(o=o||this.getCompleteStyleDeclaration(n,g),a=this.getCompleteStyleDeclaration(n,g+1),c=t.util.hasStyleChanged(o,a,!0)),c&&(l=this._getStyleDeclaration(n,g)||{},e.push(this._createTextCharSpan(h,l,r,i)),h="",o=a,r+=f,f=0)},_pushTextBgRect:function(n,r,i,o,a,s){var l=t.Object.NUM_FRACTION_DIGITS;n.push("\t\t<rect ",this._getFillAttributes(r),' x="',e(i,l),'" y="',e(o,l),'" width="',e(a,l),'" height="',e(s,l),'"></rect>\n')},_setSVGTextLineBg:function(e,t,n,r){for(var i,o,a=this._textLines[t],s=this.getHeightOfLine(t)/this.lineHeight,l=0,c=0,u=this.getValueOfPropertyAt(t,0,"textBackgroundColor"),d=0,h=a.length;d<h;d++)i=this.__charBounds[t][d],(o=this.getValueOfPropertyAt(t,d,"textBackgroundColor"))!==u?(u&&this._pushTextBgRect(e,u,n+c,r,l,s),c=i.left,l=i.width,u=o):l+=i.kernedWidth;o&&this._pushTextBgRect(e,o,n+c,r,l,s)},_getFillAttributes:function(e){var n=e&&"string"==typeof e?new t.Color(e):"";return n&&n.getSource()&&1!==n.getAlpha()?'opacity="'+n.getAlpha()+'" fill="'+n.setAlpha(1).toRgb()+'"':'fill="'+e+'"'},_getSVGLineTopOffset:function(e){for(var t,n=0,r=0;r<e;r++)n+=this.getHeightOfLine(r);return t=this.getHeightOfLine(r),{lineTop:n,offset:(this._fontSizeMult-this._fontSizeFraction)*t/(this.lineHeight*this._fontSizeMult)}},getSvgStyles:function(e){return t.Object.prototype.getSvgStyles.call(this,e)+" white-space: pre;"}})}(),function(e){var t=e.fabric||(e.fabric={});t.Textbox=t.util.createClass(t.IText,t.Observable,{type:"textbox",minWidth:20,dynamicMinWidth:2,__cachedLines:null,lockScalingFlip:!0,noScaleCache:!1,_dimensionAffectingProps:t.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),-1!==this.textAlign.indexOf("justify")&&this.enlargeSpaces(),this.height=this.calcTextHeight(),this.saveState({propertySet:"_dimensionAffectingProps"}))},_generateStyleMap:function(e){for(var t=0,n=0,r=0,i={},o=0;o<e.graphemeLines.length;o++)"\n"===e.graphemeText[r]&&o>0?(n=0,r++,t++):!this.splitByGrapheme&&this._reSpaceAndTab.test(e.graphemeText[r])&&o>0&&(n++,r++),i[o]={line:t,offset:n},r+=e.graphemeLines[o].length,n+=e.graphemeLines[o].length;return i},styleHas:function(e,n){if(this._styleMap&&!this.isWrapping){var r=this._styleMap[n];r&&(n=r.line)}return t.Text.prototype.styleHas.call(this,e,n)},isEmptyStyles:function(e){if(!this.styles)return!0;var t,n,r=0,i=!1,o=this._styleMap[e],a=this._styleMap[e+1];for(var s in o&&(e=o.line,r=o.offset),a&&(i=a.line===e,t=a.offset),n=typeof e>"u"?this.styles:{line:this.styles[e]})for(var l in n[s])if(l>=r&&(!i||l<t))for(var c in n[s][l])return!1;return!0},_getStyleDeclaration:function(e,t){if(this._styleMap&&!this.isWrapping){var n=this._styleMap[e];if(!n)return null;e=n.line,t=n.offset+t}return this.callSuper("_getStyleDeclaration",e,t)},_setStyleDeclaration:function(e,t,n){var r=this._styleMap[e];e=r.line,t=r.offset+t,this.styles[e][t]=n},_deleteStyleDeclaration:function(e,t){var n=this._styleMap[e];e=n.line,t=n.offset+t,delete this.styles[e][t]},_getLineStyle:function(e){var t=this._styleMap[e];return!!this.styles[t.line]},_setLineStyle:function(e){var t=this._styleMap[e];this.styles[t.line]={}},_wrapText:function(e,t){var n,r=[];for(this.isWrapping=!0,n=0;n<e.length;n++)r=r.concat(this._wrapLine(e[n],n,t));return this.isWrapping=!1,r},_measureWord:function(e,t,n){var r,i=0;n=n||0;for(var o=0,a=e.length;o<a;o++)i+=this._getGraphemeBox(e[o],t,o+n,r,!0).kernedWidth,r=e[o];return i},_wrapLine:function(e,n,r,i){var o=0,a=this.splitByGrapheme,s=[],l=[],c=a?t.util.string.graphemeSplit(e):e.split(this._wordJoiners),u="",d=0,h=a?"":" ",f=0,p=0,g=0,m=!0,v=this._getWidthOfCharSpacing();i=i||0,0===c.length&&c.push([]),r-=i;for(var y=0;y<c.length;y++)u=a?c[y]:t.util.string.graphemeSplit(c[y]),f=this._measureWord(u,n,d),d+=u.length,(o+=p+f-v)>r&&!m?(s.push(l),l=[],o=f,m=!0):o+=v,!m&&!a&&l.push(h),l=l.concat(u),p=a?0:this._measureWord([h],n,d),d++,m=!1,f>g&&(g=f);return y&&s.push(l),g+i>this.dynamicMinWidth&&(this.dynamicMinWidth=g-v+i),s},isEndOfWrapping:function(e){return!this._styleMap[e+1]||this._styleMap[e+1].line!==this._styleMap[e].line},missingNewlineOffset:function(e){return this.splitByGrapheme?this.isEndOfWrapping(e)?1:0:1},_splitTextIntoLines:function(e){for(var n=t.Text.prototype._splitTextIntoLines.call(this,e),r=this._wrapText(n.lines,this.width),i=new Array(r.length),o=0;o<r.length;o++)i[o]=r[o].join("");return n.lines=i,n.graphemeLines=r,n},getMinWidth:function(){return Math.max(this.minWidth,this.dynamicMinWidth)},_removeExtraneousStyles:function(){var e={};for(var t in this._styleMap)this._textLines[t]&&(e[this._styleMap[t].line]=1);for(var t in this.styles)e[t]||delete this.styles[t]},toObject:function(e){return this.callSuper("toObject",["minWidth","splitByGrapheme"].concat(e))}}),t.Textbox.fromObject=function(e,n){var r=t.util.stylesFromArray(e.styles,e.text),i=Object.assign({},e,{styles:r});return t.Object._fromObject("Textbox",i,n,"text")}}(e),function(){var e=t.controlsUtils,n=e.scaleSkewCursorStyleHandler,r=e.scaleCursorStyleHandler,i=e.scalingEqually,o=e.scalingYOrSkewingX,a=e.scalingXOrSkewingY,s=e.scaleOrSkewActionName,l=t.Object.prototype.controls;if(l.ml=new t.Control({x:-.5,y:0,cursorStyleHandler:n,actionHandler:a,getActionName:s}),l.mr=new t.Control({x:.5,y:0,cursorStyleHandler:n,actionHandler:a,getActionName:s}),l.mb=new t.Control({x:0,y:.5,cursorStyleHandler:n,actionHandler:o,getActionName:s}),l.mt=new t.Control({x:0,y:-.5,cursorStyleHandler:n,actionHandler:o,getActionName:s}),l.tl=new t.Control({x:-.5,y:-.5,cursorStyleHandler:r,actionHandler:i}),l.tr=new t.Control({x:.5,y:-.5,cursorStyleHandler:r,actionHandler:i}),l.bl=new t.Control({x:-.5,y:.5,cursorStyleHandler:r,actionHandler:i}),l.br=new t.Control({x:.5,y:.5,cursorStyleHandler:r,actionHandler:i}),l.mtr=new t.Control({x:0,y:-.5,actionHandler:e.rotationWithSnapping,cursorStyleHandler:e.rotationStyleHandler,offsetY:-40,withConnection:!0,actionName:"rotate"}),t.Textbox){var c=t.Textbox.prototype.controls={};c.mtr=l.mtr,c.tr=l.tr,c.br=l.br,c.tl=l.tl,c.bl=l.bl,c.mt=l.mt,c.mb=l.mb,c.mr=new t.Control({x:.5,y:0,actionHandler:e.changeWidth,cursorStyleHandler:n,actionName:"resizing"}),c.ml=new t.Control({x:-.5,y:0,actionHandler:e.changeWidth,cursorStyleHandler:n,actionName:"resizing"})}}()}(vw);const bw={lockScalingFlip:!0,originY:"center",originX:"center",lockMovementX:!0,lockMovementY:!0,borderColor:"transparent"};function ww(e=36){let t="";for(let n=0;n<e;n+=1)t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(Math.floor(62*Math.random()));return t}let xw=null;function Cw(e){xw=e}class _w{constructor(){is(this,"maxZoom",2),is(this,"minZoom",1),is(this,"step",.05),this.allowUserZoom&&this.bindMouseWheel(),Gp.subscribe(e=>e.stageSize,()=>{setTimeout(()=>{this.fitToScreen()},1)})}get allowUserZoom(){var e,t,n;return(null==(n=null==(t=null==(e=qp().config)?void 0:e.tools)?void 0:t.zoom)?void 0:n.allowUserZoom)??!0}get currentZoom(){return qp().zoom}zoomIn(e=this.step){this.set(this.currentZoom+e)}canZoomIn(e=this.step){return this.currentZoom+e<=this.maxZoom}canZoomOut(e=this.step){return this.currentZoom-e>=this.minZoom}zoomOut(e=this.step){this.set(this.currentZoom-e)}set(e,t=!0){if(e<this.minZoom||e>this.maxZoom)return;const n=fs(qp().original.width*e,0),r=fs(qp().original.height*e,0);Xp().setZoom(e),t&&Xp().setDimensions({width:n,height:r}),qp().setZoom(e)}fitToScreen(){var e,t;if(null==(t=null==(e=qp().config.tools)?void 0:e.zoom)||!t.fitImageToScreen)return;const{width:n,height:r}=qp().stageSize,i=Math.max(r,1),o=Math.max(n,1);if(qp().original.height>i||qp().original.width>o){const e=Math.min(i/qp().original.height,o/qp().original.width);this.minZoom=Math.min(e,1)}else this.minZoom=1;this.set(this.minZoom)}bindMouseWheel(){Xp().on("mouse:wheel",e=>{e.e.preventDefault(),e.e.stopPropagation(),null==xw&&(e.e.deltaY<0?this.zoomIn():this.zoomOut())})}}function Sw(e){return new Promise(t=>{vw.fabric.util.loadImage(e,e=>t(new vw.fabric.Image(e)),null,qp().config.crossOrigin?"anonymous":void 0)})}function Aw(){return!(qp().config.image||qp().config.blankCanvasSize||Xp()&&0!==Xp().getObjects().length)}class kw{constructor(){is(this,"minWidth",50),is(this,"minHeight",50)}resize(e,t,{applyZoom:n=!1,resizeHelper:r=!0}={}){const i=qp().zoom;Xp().setWidth(e*(n?i:1)),Xp().setHeight(t*(n?i:1)),qp().setOriginal(e,t),r&&Yp().transform.resetStraightenAnchor()}async addMainImage(e,t="mainImage"){var n,r;qp().toggleLoading(t);const i=await Sw(e);if(i)return this.clear(),i.set(Jp),i.name=Vf.MainImage,Xp().add(i),this.resize(i.width,i.height),i.center(),i.setCoords(),Yp().zoom.fitToScreen(),qp().toggleLoading(!1),null==(r=(n=qp().config).onMainImageLoaded)||r.call(n,i),i}openNew(e,t,n){return e=Math.max(this.minWidth,e),t=Math.max(this.minHeight,t),this.clear(),this.resize(e,t),Xp().backgroundColor=n,Yp().zoom.fitToScreen(),qp().toggleLoading("newCanvas"),requestAnimationFrame(()=>{qp().toggleLoading(!1)}),Promise.resolve({width:e,height:t})}getMainImage(){return Xp().getObjects().find(e=>e.name===Vf.MainImage)}render(){Xp().requestRenderAll()}async loadInitialContent(){var e,t;const n=qp().config.image,r=qp().config.blankCanvasSize,i=qp().config.state;if(n&&n.endsWith("json")){const e=await Zp(n);await Yp().import.loadState(e)}else n&&n.startsWith('{"canvas')?await Yp().import.loadState(n):n?await this.addMainImage(n):i?await Yp().import.loadState(i):r&&await this.openNew(r.width,r.height);return Aw()&&null!=(t=null==(e=qp().config.ui)?void 0:e.openImageDialog)&&t.show&&qp().togglePanel("newImage",!0),new Promise(e=>{setTimeout(()=>{Yp().history.addInitial(),e()},10)})}clear(){Xp().clear(),Yp().frame.remove(),Yp().transform.resetStraightenAnchor()}}const Ew=["fontSize","fontFamily","left","top","width","height","scaleX","scaleY","flipX","flipY","angle","src","strokeWidth"];function Iw(e={}){Xp().fire("object:modified",function(e){return{values:e,sizeOrPositionChanged:jw(e)}}(e))}function jw(e){return Object.keys(e).some(e=>Ew.includes(e))}function Tw(e){var t,n;const[r]=tg(null==(t=e.selected)?void 0:t[0]),i=r===qp().activeTool;return!(!qp().dirty||null!=(n=e.selected)&&n[0]&&i)&&(e.deselected&&Yp().objects.select(e.deselected[0]),!0)}function Fw(e){(null==e?void 0:e.data.id)!==qp().objects.active.id&&(qp().objects.setActive(e??null),qp().activeTool!==Od.DRAW&&eg())}class Ow{constructor(){this.syncObjects(),qp().fabric.on("selection:created",e=>{var t;null!=(t=e.selected)&&t[0]&&!Tw(e)&&Fw(e.selected[0])}),qp().fabric.on("selection:updated",e=>{var t;Tw(e)||Fw(null==(t=e.selected)?void 0:t[0])}),qp().fabric.on("selection:cleared",()=>{Fw()}),qp().fabric.on("text:editing:entered",()=>{qp().objects.setIsEditingText(!0)}),qp().fabric.on("text:editing:exited",()=>{qp().objects.setIsEditingText(!1)}),qp().fabric.on("object:added",()=>{this.syncObjects()}),qp().fabric.on("object:removed",()=>{this.syncObjects()})}getAll(){return Xp().getObjects().filter(e=>{var t;return!(null!=(t=null==e?void 0:e.data)&&t.pixieInternal)})}get(e){return this.getAll().find(t=>t.name===e)}getById(e){return this.getAll().find(t=>t.data.id===e)}isActive(e){var t;const n="string"==typeof e?e:e.data.id;return(null==(t=qp().objects.active)?void 0:t.id)===n}getActive(){return Xp().getActiveObject()}has(e){return this.getAll().findIndex(t=>t.name===e)>-1}select(e){const t="string"==typeof e?this.getById(e):e;t&&(Xp().setActiveObject(t),Xp().requestRenderAll())}deselectActive(){Xp().discardActiveObject(),Xp().requestRenderAll()}setValues(e,t){if(!(t=t||this.getActive()))return;let n=!1;(function(e){return e.name===Vf.Sticker&&"forEachObject"in e})(t)&&e.fill&&e.fill!==t.fill&&t.forEachObject(t=>t.set("fill",e.fill)),Uf(t)?((e.fontFamily!==t.fontFamily||e.fontSize!==t.fontSize)&&(n=!0),t.selectionStart!==t.selectionEnd?t.setSelectionStyles(e):t.set(e)):t.set(e),n?setTimeout(()=>{Xp().requestRenderAll()},50):Xp().requestRenderAll(),qp().objects.setActive(t),Iw(e)}move(e,t=1,n){(n=n||this.getActive())&&("up"===e?this.setValues({top:n.top-t}):"down"===e?this.setValues({top:n.top+t}):"left"===e?this.setValues({left:n.left-t}):"right"===e&&this.setValues({left:n.left+t}),Yp().canvas.render())}bringToFront(e){(e=e||this.getActive())&&(e.bringToFront(),Yp().canvas.render())}sendToBack(e){(e=e||this.getActive())&&(e.sendToBack(),Yp().canvas.render())}flipHorizontally(e){(e=e||this.getActive())&&(this.setValues({flipX:!e.flipX}),Yp().canvas.render())}duplicate(e){const t=e||this.getActive();t&&(this.deselectActive(),t.clone(e=>{e.set({left:t.left+40,top:t.top+40,data:{...t.data,id:ww(10)},name:t.name}),Xp().add(e),this.select(e),Yp().canvas.render()}))}delete(e){(e=e||this.getActive())&&(this.deselectActive(),Xp().remove(e),Xp().requestRenderAll(),Yp().history.addHistoryItem({name:"deletedObject"}))}syncObjects(){const e=this.getAll().map(e=>({name:e.name,selectable:e.selectable??!1,id:e.data.id}));Gp.setState({objects:{...qp().objects,all:e}})}}const Mw={frame:null,fonts:[]};function Pw(e){return e.state||(e.state=Qp()),{...e.state||Qp(),name:e.name,id:ww(15)}}function Rw(e){return!!e&&/^[a-zA-Z][a-zA-Z\d+\-.]*?:/.test(e)}function Lw(e){return e?Rw(e)?e:`${qp().config.baseUrl?`${qp().config.baseUrl}/`:""}${e}`:""}function Nw(e,t){return t||btoa(e.split("/").pop())}const Dw=new class{constructor(){is(this,"loadedAssets",{})}loadAsset(e,t={type:"js"}){var n;e=e.startsWith("//")?`${window.location.protocol}${e}`:e;const r=null==(n=this.loadedAssets[e])?void 0:n.state;return"loaded"!==r||t.force?!r||this.loadedAssets[e].doc!==t.document||t.force&&"loaded"===r?(this.loadedAssets[e]={state:new Promise(n=>{const r={url:Rw(e)?e:`assets/${e}`,id:Nw(e,t.id),resolve:n,parentEl:t.parentEl,document:t.document};"css"===t.type?this.loadStyleAsset(r):this.loadScriptAsset(r)}),doc:t.document},this.loadedAssets[e].state):this.loadedAssets[e].state:new Promise(e=>e())}isLoadingOrLoaded(e){return null!=this.loadedAssets[e]}loadStyleAsset(e){var t;const n=e.document||document,r=e.parentEl||n.head,i=n.createElement("link"),o=Nw(e.url,e.id);i.rel="stylesheet",i.id=o,i.href=e.url;try{r.querySelector(`#${o}`)&&(null==(t=r.querySelector(`#${o}`))||t.remove())}catch{}i.onload=()=>{this.loadedAssets[e.url].state="loaded",e.resolve()},r.appendChild(i)}loadScriptAsset(e){var t;const n=e.document||document,r=e.parentEl||n.body,i=n.createElement("script"),o=Nw(e.url,e.id);i.async=!0,i.id=o,i.src=e.url;try{r.querySelector(`#${o}`)&&(null==(t=r.querySelector(`#${o}`))||t.remove())}catch{}i.onload=()=>{this.loadedAssets[e.url].state="loaded",e.resolve()},(r||r).appendChild(i)}};function zw(e){return`be-fonts-${e}`}function Bw(e,t){const n=t.document||document,r=[],i=[];let o=[];if(e.forEach(e=>{"google"in e&&e.google?r.push(e):"src"in e&&i.push(e)}),null!=r&&r.length){const r=t.weights||[400],i=e.map(e=>`${e.family}:${r.join(",")}`).join("|"),a=Dw.loadAsset(`https://fonts.googleapis.com/css?family=${i}&display=swap`,{type:"css",id:zw(t.id),force:t.forceAssetLoad,document:n});o.push(a)}if(null!=i&&i.length){const e=i.map(async e=>{const r=Array.from(n.fonts.values()).find(t=>t.family===e.family);if(r)return r.loaded;const i=new FontFace(e.family,`url(${null!=t&&t.prefixSrc?t.prefixSrc(e.src):e.src})`,e.descriptors);return n.fonts.add(i),i.load()});o=o.concat(e)}return Promise.all(o)}class Uw{async undo(){if(this.canUndo()){const e=qp().history.items[qp().history.pointer-1];await this.load(e)}}async redo(){if(this.canRedo()){const e=qp().history.items[qp().history.pointer+1];await this.load(e)}}canUndo(){return qp().history.canUndo}canRedo(){return qp().history.canRedo}reload(){return this.load(qp().history.items[qp().history.pointer])}replaceCurrent(){const e=qp().history.items[qp().history.pointer];[...qp().history.items][qp().history.pointer]=Pw({name:e.name,state:e})}addHistoryItem(e){const t=Pw(e),n=[...qp().history.items.slice(0,qp().history.pointer+1),t];qp().history.update(n.length-1,n)}load(e){return e={...e,editor:e.editor||Mw},new Promise(t=>{Bw(function(e){const t=[];return e.forEach(e=>{var n,r,i;if(!Uf(e))return;const o=null==(i=null==(r=null==(n=qp().config.tools)?void 0:n.text)?void 0:r.items)?void 0:i.find(t=>t.family===e.fontFamily);o&&t.push(o)}),t}(e.canvas.objects),{prefixSrc:Lw,id:"pixie-fonts"}).finally(()=>{Xp().loadFromJSON(e.canvas,()=>{Yp().zoom.set(1),e.canvasWidth&&e.canvasHeight&&Yp().canvas.resize(e.canvasWidth,e.canvasHeight,{resizeHelper:!1,applyZoom:!1}),Yp().frame.remove(),e.editor.frame&&Yp().frame.add(e.editor.frame.name,e.editor.frame.sizePercent),Yp().objects.syncObjects(),Yp().objects.getAll().forEach(e=>{var t,n;if(!e.data.pixieInternal&&"left"===e.originX&&"top"===e.originY){const t=e.getPointByOrigin("center","center");e.set("left",t.x),e.set("top",t.y)}e.set({...bw}),"i-text"===e.type&&(e.padding=null==(n=null==(t=qp().config.tools)?void 0:t.text)?void 0:n.controlsPadding)}),Yp().canvas.render(),Xp().calcOffset(),Yp().zoom.fitToScreen(),qp().history.updatePointerById(e.id),Yp().transform.resetStraightenAnchor(),t()})})})}addInitial(e){!qp().history.items.find(e=>"initial"===e.name)&&(e||!Aw())&&this.addHistoryItem({name:"initial",state:e})}}class Vw{canMerge(){return Yp().objects.getAll().filter(e=>e.name!==Vf.MainImage).length>0}async apply(){qp().toggleLoading("merge");const e=Yp().export.getDataUrl();e&&await Yp().canvas.addMainImage(e,"merge")}}const Hw=[{name:"grayscale"},{name:"blackWhite",fabricType:"blackwhite"},{name:"sharpen",uses:"Convolute",matrix:[0,-1,0,-1,5,-1,0,-1,0]},{name:"invert"},{name:"vintage"},{name:"polaroid"},{name:"kodachrome"},{name:"technicolor"},{name:"brownie"},{name:"sepia"},{name:"removeColor",fabricType:"removecolor",options:{distance:{type:"slider",current:.1,min:0,max:1,step:.01},color:{current:"#fff",type:"colorPicker"}}},{name:"brightness",options:{brightness:{type:"slider",current:.1,min:-1,max:1,step:.1}}},{name:"gamma",options:{red:{type:"slider",current:.1,min:.2,max:2.2,step:.003921},green:{type:"slider",current:.1,min:.2,max:2.2,step:.003921},blue:{type:"slider",current:.1,min:.2,max:2.2,step:.003921}},apply:e=>{e.gamma=[e.red,e.green,e.blue]}},{name:"noise",options:{noise:{type:"slider",current:40,min:1,max:600}}},{name:"pixelate",options:{blocksize:{type:"slider",min:1,max:40,current:6}}},{name:"blur",uses:"Convolute",matrix:[1/9,1/9,1/9,1/9,1/9,1/9,1/9,1/9,1/9]},{name:"emboss",uses:"Convolute",matrix:[1,1,1,1,.7,-1,-1,-1,-1]},{name:"blendColor",fabricType:"blendcolor",options:{alpha:{type:"slider",current:.5,min:.1,max:1,step:.1},mode:{current:"add",type:"select",available:[{key:"add"},{key:"multiply"},{key:"subtract"},{key:"diff"},{key:"screen"},{key:"lighten"},{key:"darken"}]},color:{type:"colorPicker",current:"#FF4081"}}}],Ww={grayscale:kd("grayscale"),blackWhite:kd("Black & White"),sharpen:kd("Sharpen"),invert:kd("Invert"),vintage:kd("Vintage"),polaroid:kd("Polaroid"),kodachrome:kd("Kodachrome"),technicolor:kd("Technicolor"),brownie:kd("Brownie"),sepia:kd("Sepia"),removeColor:kd("Remove Color"),brightness:kd("Brightness"),gamma:kd("Gamma"),noise:kd("Noise"),pixelate:kd("Pixelate"),blur:kd("Blur"),emboss:kd("Emboss"),blendColor:kd("Blend Color")},$w={distance:kd("distance"),color:kd("color"),brightness:kd("brightness"),red:kd("red"),green:kd("green"),blue:kd("blue"),noise:kd("noise"),blocksize:kd("blocksize"),mode:kd("mode"),alpha:kd("alpha")};function Gw(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}class qw{constructor(){Gp.subscribe(e=>e.history.pointer,()=>{this.syncState()})}apply(e){qp().filter.select(e,this.hasOptions(e));const t=this.getByName(e);if(this.isApplied(t.name))return void this.remove(t.name);const n=this.create(t);this.getImages().forEach(e=>{var t;null==(t=e.filters)||t.push(n),e.applyFilters()}),this.syncState(),Yp().canvas.render()}remove(e){qp().filter.deselect(e);const t=this.getByName(e);this.getImages().forEach(e=>{var n;const r=this.findFilterIndex(t.name,e.filters);null==(n=e.filters)||n.splice(r,1),e.applyFilters()}),this.syncState(),Yp().canvas.render()}getAll(){return Hw}getByName(e){return Hw.find(t=>t.name===e)}isApplied(e){const t=Yp().canvas.getMainImage();return!!t&&this.findFilterIndex(e,t.filters)>-1}applyValue(e,t,n){const r=this.getByName(e);this.getImages().forEach(e=>{const i=(e.filters||[]).find(e=>e.type.toLowerCase()===r.name.toLowerCase());i&&(i[t]=n,r.apply&&r.apply(i,t,n),e.applyFilters())}),Yp().canvas.render()}addCustom(e,t,n,r){const i=vw.fabric.Image.filters;i[Gw(e)]=vw.fabric.util.createClass(i.BaseFilter,t),i[Gw(e)].fromObject=i.BaseFilter.fromObject,Hw.push({name:e,options:n,initialConfig:r})}create(e){const t=e.initialConfig||{};let n;return e.uses?(t.matrix=e.matrix,n=new(vw.fabric.Image.filters[Gw(e.uses)])(t)):(Object.entries(e.options||{}).forEach(([e,n])=>{t[e]=n.current}),n=new(vw.fabric.Image.filters[Gw(e.name)])(t)),n.name=e.name,n}hasOptions(e){return!!this.getByName(e).options}findFilterIndex(e,t){if(null==t||!t.length)return-1;const n=this.getByName(e);return t.findIndex(e=>this.configMatchesFabricFilter(n,e))}syncState(){var e;const t=[];((null==(e=this.getImages()[0])?void 0:e.filters)||[]).forEach(e=>{const n=this.getByFabricFilter(e);n&&t.push(n.name)}),Gp.setState({filter:{...qp().filter,applied:t}})}getByFabricFilter(e){return Hw.find(t=>this.configMatchesFabricFilter(t,e))}configMatchesFabricFilter(e,t){const n=t.type.toLowerCase().replace(" ","");return n===e.fabricType||n===e.name||"convolute"===n&&this.matrixAreEqual(e.matrix,t.matrix)}matrixAreEqual(e,t){if(!e||!t||e.length!==t.length)return!1;for(let n=e.length;n--;)if(e[n]!==t[n])return!1;return!0}getImages(){return Yp().objects.getAll().filter(e=>e.name===Vf.Image||e.name===Vf.MainImage)}}function Yw(e){var t,n;const r=(null==(n=null==(t=qp().config.tools)?void 0:t.resize)?void 0:n.minWidth)||50;return e?Math.ceil(100*r/qp().original.width):r}function Xw(e){var t,n;const r=(null==(n=null==(t=qp().config.tools)?void 0:t.resize)?void 0:n.maxWidth)||2400;return e?Math.ceil(100*r/qp().original.width):r}function Kw(e){var t,n;const r=(null==(n=null==(t=qp().config.tools)?void 0:t.resize)?void 0:n.minHeight)||50;return e?Math.ceil(100*r/qp().original.height):r}function Zw(e){var t,n;const r=(null==(n=null==(t=qp().config.tools)?void 0:t.resize)?void 0:n.maxHeight)||2400;return e?Math.ceil(100*r/qp().original.height):r}function Jw(e,t){if(t)return e;const n=qp().original.height/e;return Math.floor(qp().original.width/n)}function Qw(e,t){if(t)return e;const n=qp().original.width/e;return Math.floor(qp().original.height/n)}class ex{apply(e){const{width:t,height:n,usePercentages:r}=function(e){return e.width<Yw(e.usePercentages)&&(e.width=Yw(e.usePercentages),e.maintainAspect&&(e.height=Qw(e.width,e.usePercentages))),e.width>Xw(e.usePercentages)&&(e.width=Xw(e.usePercentages),e.maintainAspect&&(e.height=Qw(e.width,e.usePercentages))),e.height<Kw(e.usePercentages)&&(e.height=Kw(e.usePercentages),e.maintainAspect&&(e.width=Jw(e.height,e.usePercentages))),e.height>Zw(e.usePercentages)&&(e.height=Zw(e.usePercentages),e.maintainAspect&&(e.width=Jw(e.height,e.usePercentages))),e}(e),i=Math.ceil(qp().original.width),o=Math.ceil(qp().original.height),a=Math.ceil(t),s=Math.ceil(n);let l,c;r?(l=t/100,c=n/100):(l=t/qp().original.width,c=n/qp().original.height),(i!==a||o!==s)&&this.resize(l,c)}resize(e,t){Yp().zoom.set(1,!1);const n=Math.round(qp().original.height*t),r=Math.round(qp().original.width*e);Yp().canvas.resize(r,n,{applyZoom:!1,resizeHelper:!0}),Yp().objects.getAll().forEach(n=>{const r=n.scaleX||1,i=n.scaleY||1,o=n.left||0,a=n.top||0,s=r*e,l=i*t,c=o*e,u=a*t;n.scaleX=s,n.scaleY=l,n.left=c,n.top=u,n.setCoords()}),Yp().zoom.fitToScreen(),Xp().requestRenderAll()}}function tx(e,t,n){let r=t,i=n;return e&&(n*e>t?i=t/e:r=n*e),{width:Math.floor(r),height:Math.floor(i)}}function nx(e){if(!e)return null;const t=e.split(":");return parseInt(t[0])/parseInt(t[1])}class rx{constructor(){is(this,"refs",null)}apply(e){var t;const n=null==(t=Yp().frame.active.config)?void 0:t.name,r=Yp().frame.active.currentSizeInPercent;return Yp().frame.active.hide(),Yp().merge.apply().then(()=>{Yp().canvas.resize(Math.round(e.width),Math.round(e.height),{applyZoom:!0,resizeHelper:!0});const t=Yp().canvas.getMainImage();t.cropX=Math.round(e.left),t.cropY=Math.round(e.top),t.width=Math.round(e.width),t.height=Math.round(e.height),t.viewportCenter(),n&&Yp().frame.add(n,r),Yp().zoom.fitToScreen(),Yp().canvas.render()})}drawZone(e){var t;null!=(t=this.refs)&&t.current&&(qp().crop.setCropzoneRect(e),function(e,t){null!==t.innerZone&&(function(e,t){t.innerZone.style.width=`${e.width}px`,t.innerZone.style.height=`${e.height}px`,t.innerZone.style.transform=`translate(${e.left}px, ${e.top}px)`}(e,t),function(e,t){const n=qp().canvasSize.width,r=qp().canvasSize.height;t.maskTop.style.height=`${e.top}px`,t.maskTop.style.width=`${n}px`,t.maskLeft.style.top=`${e.top}px`,t.maskLeft.style.height=`${e.height}px`,t.maskLeft.style.width=`${e.left}px`;const i=e.left+e.width;t.maskRight.style.left=`${i}px`,t.maskRight.style.top=`${e.top}px`,t.maskRight.style.height=`${e.height}px`,t.maskRight.style.width=n-i+"px",t.maskBottom.style.height=r-(e.top+e.height)+"px",t.maskBottom.style.width=`${n}px`}(e,t),function(e,t){const n=(e.width-2)/3;t.lineVer1.style.height=`${e.height}px`,t.lineVer1.style.transform=`translate(${n}px, 0)`,t.lineVer2.style.height=`${e.height}px`,t.lineVer2.style.transform=`translate(${2*n}px, 0)`;const r=(e.height-2)/3;t.lineHor1.style.width=`${e.width}px`,t.lineHor1.style.transform=`translate(0, ${r}px)`,t.lineHor2.style.width=`${e.width}px`,t.lineHor2.style.transform=`translate(0, ${2*r}px)`}(e,t))}(e,this.refs.current))}resetCropzone(e){const t=qp().canvasSize,n=nx(e);if(!t)return;qp().crop.setAspectRatio(e);const r=function(e,t=null){const n={width:e.width,height:e.height,top:0,left:0,angle:0};if(t){const e=tx(t,n.width,n.height);n.width=e.width,n.height=e.height}return n.left=(e.width-n.width)/2,n.top=(e.height-n.height)/2,n}(t,n);this.drawZone(r)}registerRefs(e){this.refs=e}}class ix{getShapeByName(e){var t,n;const r=null==(n=null==(t=qp().config.tools)?void 0:t.shapes)?void 0:n.items;return(null==r?void 0:r.find(t=>t.name===e))||null}addBasicShape(e){var t;const n=this.getShapeByName(e);if(!n)return null;const{width:r,height:i,...o}=(null==(t=qp().config.objectDefaults)?void 0:t.shape)||{},a={...o,...n.options};let s;if("circle"===n.name)s=new vw.fabric.Circle({...a,radius:100});else if("ellipse"===n.name)s=new vw.fabric.Ellipse({...a,rx:100,ry:50});else if("Path"===n.type)s=new vw.fabric.Path(a.path,{displayName:n.name,...a});else{const e=n.type;s=new vw.fabric[e]({...a,width:150,height:150})}return this.addAndPositionShape(s,Vf.Shape,{width:r,height:i}),s}addSticker(e,t){var n,r,i;const o=null==(i=null==(r=null==(n=qp().config.tools)?void 0:n.stickers)?void 0:r.items)?void 0:i.find(t=>t.name===e);if(!o)return Promise.resolve();if("svg"===o.type){const e=ox(o,t);return this.addSvgSticker(e)}return this.addRegularSticker(o,t)}addRegularSticker(e,t){return new Promise(n=>{vw.fabric.util.loadImage(ox(e,t),e=>{var t;const{width:r,height:i,...o}=(null==(t=qp().config.objectDefaults)?void 0:t.sticker)||{},a=new vw.fabric.Image(e,o);this.addAndPositionShape(a,Vf.Sticker,{width:r,height:i}),n()})})}addSvgSticker(e,t=Vf.Sticker){return new Promise(n=>{vw.fabric.loadSVGFromURL(e,(e,r)=>{var i;const{width:o,height:a,...s}=(null==(i=qp().config.objectDefaults)?void 0:i.sticker)||{},l=vw.fabric.util.groupSVGElements(e,r);l.set(s),this.addAndPositionShape(l,t,{width:o,height:a}),n()})})}addAndPositionShape(e,t,{width:n}){e.name=t,e.scaleX=1,e.scaleY=1,Xp().add(e);const r=n||qp().original.width*qp().zoom/4;e.scaleToWidth(Math.min(150,r)),e.viewportCenter(),e.setCoords(),Yp().canvas.render(),Xp().setActiveObject(e)}}function ox(e,t){return Lw(`images/stickers/${e.name}/${t}.${e.type}`)}class ax{constructor(e){is(this,"patternCache",[]),this.activeFrame=e}fillParts(e){this.patternCache.forEach(t=>{this.fillPartWithPattern(t,e)})}fillPartWithPattern(e,t){if(!this.activeFrame.parts)return;e.canvas=new vw.fabric.StaticCanvas(null),e.canvas.add(e.img);const n=new vw.fabric.Pattern({source:e.canvas.getElement(),repeat:"repeat"===t?"repeat":"no-repeat"});this.activeFrame.parts[e.name]&&this.activeFrame.parts[e.name].set("fill",n)}scale(e){if(!this.activeFrame.config||!this.patternCache)return;const t=this.activeFrame.config.mode;e/=Xp().getRetinaScaling(),this.patternCache.forEach(n=>{this.activeFrame.parts&&("top"===n.name||"bottom"===n.name?"stretch"===t?(this.scalePatternToWidth(n.img,this.activeFrame.parts.top.getScaledWidth()),this.scalePatternToHeight(n.img,e)):n.img.scaleToHeight(e):"left"===n.name||"right"===n.name?"stretch"===t?(this.scalePatternToWidth(n.img,e),this.scalePatternToHeight(n.img,this.activeFrame.parts.left.getScaledHeight())):n.img.scaleToWidth(e):"stretch"===t?(this.scalePatternToWidth(n.img,e),this.scalePatternToHeight(n.img,e)):n.img.scaleToWidth(e),n.canvas.setDimensions({width:n.img.getScaledWidth(),height:n.img.getScaledHeight()}))}),Yp().canvas.render()}scalePatternToWidth(e,t){if(!e.width)return;const n=e.getBoundingRect().width/e.getScaledWidth();e.set("scaleX",t/e.width/n),e.setCoords()}scalePatternToHeight(e,t){if(!e.height)return;const n=e.getBoundingRect().height/e.getScaledHeight();e.set("scaleY",t/e.height/n),e.setCoords()}load(e){const t=this.activeFrame.getPartNames().map(t=>new Promise(n=>{const r={...Jp,originX:"left",originY:"top"};qp().config.crossOrigin&&(r.crossOrigin="anonymous"),vw.fabric.Image.fromURL(this.getPartUrl(e,t),e=>{n({name:t,img:e})},r)}));return Promise.all(t).then(t=>{this.patternCache=t,this.fillParts(e.mode)})}getPartUrl(e,t){return Lw(`images/frames/${e.name}/${t}.png`)}}class sx{constructor(e,t){this.activeFrame=e,this.patterns=t}get defaultColor(){var e,t;return null==(t=null==(e=qp().config.objectDefaults)?void 0:e.global)?void 0:t.fill}build(e,t){this.createParts(e),this.resize(t),this.activeFrame.config=e,"basic"!==e.mode?this.patterns.load(e).then(()=>{this.patterns.scale(t),Yp().canvas.render()}):Yp().canvas.render()}createParts(e){const t={};this.activeFrame.getPartNames().forEach(n=>{const r="basic"===e.mode?this.defaultColor:void 0;t[n]=new vw.fabric.Rect({...Jp,fill:r,originX:"left",originY:"top",name:`frame.rect.${n}`,objectCaching:!1,data:{pixieInternal:!0}}),Xp().add(t[n])}),this.activeFrame.parts=t}resize(e){const t=qp().original.width,n=qp().original.height,r=this.activeFrame,i=e;r.parts&&(r.parts.topLeft.set({width:i,height:i}),r.parts.topRight.set({left:t-r.parts.topLeft.getScaledWidth(),width:i,height:i}),r.parts.top.set({left:r.parts.topLeft.getScaledWidth()-1,width:t-r.parts.topLeft.getScaledWidth()-r.parts.topRight.getScaledWidth()+3,height:i}),r.parts.bottomLeft.set({top:n-r.parts.topLeft.getScaledHeight(),width:i,height:i}),r.parts.left.set({top:r.parts.topLeft.getScaledHeight()-1,width:i,height:n-r.parts.topLeft.getScaledHeight()-r.parts.bottomLeft.getScaledHeight()+3}),r.parts.bottomRight.set({left:t-r.parts.bottomLeft.getScaledWidth(),top:n-r.parts.topRight.getScaledWidth(),width:i,height:i}),r.parts.bottom.set({left:r.parts.top.left,top:n-r.parts.top.getScaledHeight(),width:r.parts.top.getScaledWidth(),height:i}),r.parts.right.set({left:t-r.parts.left.getScaledWidth(),top:r.parts.left.top,width:r.parts.left.width,height:r.parts.left.getScaledHeight()}))}}class lx{constructor(){is(this,"corners",["topLeft","topRight","bottomLeft","bottomRight"]),is(this,"sides",["top","right","bottom","left"]),is(this,"parts",null),is(this,"config",null),is(this,"currentSizeInPercent",100)}getPartNames(){return[...this.corners,...this.sides]}hide(){this.parts&&(Object.values(this.parts).forEach(e=>e.set({visible:!1})),Yp().canvas.render())}show(){this.parts&&(Object.values(this.parts).forEach(e=>e.set({visible:!0})),Yp().canvas.render())}remove(){this.parts&&(this.config=null,Object.values(this.parts).forEach(e=>{Xp().remove(e)}),this.parts=null,Yp().canvas.render())}is(e){return!!this.config&&this.config.name===e.name}changeColor(e){var t;"basic"!==(null==(t=this.config)?void 0:t.mode)||!this.parts||(Object.values(this.parts).forEach(t=>{t.set("fill",e)}),Yp().canvas.render())}getMinSize(){var e;return(null==(e=this.config)?void 0:e.size.min)??1}getMaxSize(){var e;return(null==(e=this.config)?void 0:e.size.max)??35}}class cx{constructor(){is(this,"patterns"),is(this,"builder"),is(this,"active"),this.active=new lx,this.patterns=new ax(this.active),this.builder=new sx(this.active,this.patterns),Xp().on("object:added",()=>{Object.values(this.active.parts||[]).forEach(e=>e.moveTo(98))})}add(e,t){const n=this.getByName(e);if(!n||this.active.is(n))return;this.active.remove(),this.active.currentSizeInPercent=t??n.size.default;const r=this.calcFrameSizeInPixels(this.active.currentSizeInPercent);this.builder.build(n,r),qp().frame.select(n)}resize(e){if(!this.active.parts||!this.active.config)return;e?this.active.currentSizeInPercent=e:e=this.active.currentSizeInPercent;const t=this.calcFrameSizeInPixels(e);this.builder.resize(t),this.patterns.scale(t),Yp().canvas.render()}changeColor(e){this.active.changeColor(e)}remove(){this.active.remove(),qp().frame.deselect()}getByName(e){var t,n;const r=null==(n=null==(t=qp().config.tools)?void 0:t.frame)?void 0:n.items;if(r)return r.find(t=>t.name===e)}getActiveFrameConfig(){return this.active.config}calcFrameSizeInPixels(e){const t=Math.min(qp().original.width,qp().original.height);return Math.ceil(e/100*t)}}class ux{constructor(){is(this,"minWidth",250)}add(e,t={}){var n,r,i,o,a;if(!(e=e||(null==(r=null==(n=qp().config.tools)?void 0:n.text)?void 0:r.defaultText)))return;const s={...null==(i=qp().config.objectDefaults)?void 0:i.text,...t,name:Vf.Text,padding:null==(a=null==(o=qp().config.tools)?void 0:o.text)?void 0:a.controlsPadding,editingBorderColor:Id.fill},l=new vw.fabric.IText(e,s);Xp().add(l),null==t.left&&null==t.top&&this.autoPositionText(l),Yp().objects.select(l)}autoPositionText(e){const t=Xp().getWidth(),n=Xp().getHeight(),r=Math.min(Xp().getWidth(),this.minWidth);e.scaleToWidth(Math.max(t/3,r)),e.getScaledHeight()>n&&e.scaleToHeight(n-e.getScaledHeight()-20),e.viewportCenter(),Xp().getObjects("i-text").forEach(t=>{if(t!==e&&t.intersectsWithObject(e)){const n=t.top-e.top+t.getScaledHeight();let r=e.top+n;r>qp().original.height-t.getScaledHeight()&&(r=0),e.set("top",r),e.setCoords()}})}selectOrAddText(e,t={}){if(qp().objects.active.isText)return!1;const n=Yp().objects.getAll().find(e=>Uf(e));return n?(Yp().objects.select(n),!1):(this.add(e,t),!0)}}const dx=e=>{const t=new vw.fabric.PatternBrush(e);return t.getPatternSrc=function(){const e=vw.fabric.document.createElement("canvas");e.width=10,e.height=10;const t=e.getContext("2d");return t.strokeStyle=this.color,t.lineWidth=5,t.beginPath(),t.moveTo(0,5),t.lineTo(10,5),t.closePath(),t.stroke(),e},t},hx=e=>{const t=new vw.fabric.PatternBrush(e);return t.getPatternSrc=function(){const e=document.createElement("canvas");e.width=10,e.height=10;const t=e.getContext("2d");return t.strokeStyle=this.color,t.lineWidth=5,t.beginPath(),t.moveTo(5,0),t.lineTo(5,10),t.closePath(),t.stroke(),e},t},fx=e=>{const t=new vw.fabric.PatternBrush(e);return t.getPatternSrc=function(){const e=this.width/2,t=document.createElement("canvas"),n=new vw.fabric.Rect({width:e,height:e,angle:45,fill:this.color}),r=n.getBoundingRect().width;t.width=r+5,t.height=r+5,n.set({left:r/2,top:r/2});const i=t.getContext("2d");return n.render(i),t},t},px=e=>{const t=new vw.fabric.PatternBrush(e);return t.getPatternSrc=function(){const e=document.createElement("canvas");e.width=12,e.height=12;const t=e.getContext("2d");return t.fillStyle=this.color,t.fillRect(0,0,10,10),e},t};var gx,mx;class vx{constructor(){is(this,"customBrushes",{VLineBrush:dx,HLineBrush:hx,DiamondBrush:fx,SquareBrush:px}),is(this,"currentBrush",{type:"PencilBrush",color:null==(mx=null==(gx=qp().config.objectDefaults)?void 0:gx.global)?void 0:mx.fill,width:jd[1]}),is(this,"onPathCreated",e=>{e.path.name=Vf.Drawing,e.path.set(function(){const e={...Jp};return delete e.strokeWidth,e}()),qp().setDirty(!0)})}enable(){Xp().on("path:created",this.onPathCreated),Xp().isDrawingMode=!0,this.setBrushType(this.currentBrush.type),this.setBrushSize(this.currentBrush.width)}disable(){Xp().off("path:created",this.onPathCreated),Xp().isDrawingMode=!1}getBrushType(){return this.currentBrush.type}setBrushType(e){this.currentBrush.type=e,Xp().freeDrawingBrush=e in vw.fabric?new vw.fabric[e](Xp()):this.customBrushes[e](Xp()),this.applyBrushStyles()}applyBrushStyles(){Object.keys(this.currentBrush).forEach(e=>{Xp().freeDrawingBrush[e]=this.currentBrush[e]});const e=Xp().freeDrawingBrush;e.getPatternSrc&&(e.source=e.getPatternSrc.call(e))}setBrushSize(e){this.currentBrush.width=e,this.applyBrushStyles()}getBrushSize(){return this.currentBrush.width}setBrushColor(e){this.currentBrush.color=e,this.applyBrushStyles()}getBrushColor(){return this.currentBrush.color}}async function yx(e,t=!0,n=!0){const r=await Sw(e);if(r)return new Promise(e=>{r.name=Vf.Image,r.opacity=0;const i=qp().original.width,o=qp().original.height;if(t&&(r.width>=i||r.height>=o)){const e=i-.1*i,t=o-.1*o,n=1/Math.min(t/r.getScaledHeight(),e/r.getScaledWidth());r.scaleX*=1/n,r.scaleY*=1/n}qp().fabric.add(r),n&&qp().fabric.setActiveObject(r),r.viewportCenter(),r.setCoords(),qp().fabric.requestRenderAll(),Yp().zoom.fitToScreen(),r.animate("opacity","1",{duration:425,onChange:()=>{qp().fabric.requestRenderAll()},onComplete:()=>{e(r)}})})}function bx(e){var t;return(null==(t=/(?:\.([^.]+))?$/.exec(e))?void 0:t[1])||""}class wx{constructor(e,t){is(this,"id"),is(this,"fingerprint"),is(this,"name"),is(this,"relativePath",""),is(this,"size"),is(this,"mime",""),is(this,"extension",""),is(this,"native"),is(this,"lastModified"),is(this,"cachedData"),this.id=ng(),this.name=e.name,this.size=e.size,this.mime=function(e){const t={md:"text/markdown",markdown:"text/markdown",mp4:"video/mp4",mp3:"audio/mp3",svg:"image/svg+xml",jpg:"image/jpeg",png:"image/png",gif:"image/gif",yaml:"text/yaml",yml:"text/yaml",log:"text/plain"},n=e.name?bx(e.name):null;return e.type?e.type:n&&n in t?t[n]:"application/octet-stream"}(e),this.lastModified=e.lastModified,this.extension=bx(e.name)||"bin",this.native=e,(t=(t=t||e.webkitRelativePath||"").replace(/^\/+/g,""))&&t.split("/").length>1&&(this.relativePath=t),this.fingerprint=function({name:e,mime:t,size:n,relativePath:r,lastModified:i}){let o="be";return"string"==typeof e&&(o+=`-${xx(e.toLowerCase())}`),t&&(o+=`-${t}`),"string"==typeof r&&(o+=`-${xx(r.toLowerCase())}`),void 0!==n&&(o+=`-${n}`),void 0!==i&&(o+=`-${i}`),o}({name:this.name,size:this.size,mime:this.mime,lastModified:this.lastModified})}get data(){return new Promise(e=>{this.cachedData&&e(this.cachedData);const t=new FileReader;t.addEventListener("load",()=>{this.cachedData=t.result,e(this.cachedData)}),"json"===this.extension?t.readAsText(this.native):t.readAsDataURL(this.native)})}}function xx(e){let t="";return e.replace(/[^A-Z0-9]/gi,e=>(t+=`-${function(e){return e.charCodeAt(0).toString(32)}(e)}`,"/"))+t}var Cx=(e=>(e.image="image/*",e.audio="audio/*",e.text="text/*",e.json="application/json",e.video="video/mp4,video/mpeg,video/x-m4v,video/*",e))(Cx||{});function _x(e,t=1){if(null==e||Number.isNaN(e))return"";const n=e<0,r=["B","KB","MB","GB","TB","PB","EB","ZB","YB"];if(n&&(e=-e),e<1)return(n?"-":"")+e+" B";const i=Math.min(Math.floor(Math.log(e)/Math.log(1024)),r.length-1);e=Number(e/Math.pow(1024,i));const o=r[i];return e>=10||e%1==0?`${(n?"-":"")+e.toFixed(0)} ${o}`:`${(n?"-":"")+e.toFixed(t)} ${o}`}function Sx(e,t){this.text=e=e||"",this.hasWild=~e.indexOf("*"),this.separator=t,this.parts=e.split(t)}Sx.prototype.match=function(e){var t,n,r=!0,i=this.parts,o=i.length;if("string"==typeof e||e instanceof String)if(this.hasWild||this.text==e){for(n=(e||"").split(this.separator),t=0;r&&t<o;t++)"*"!==i[t]&&(r=t<n.length&&i[t]===n[t]);r=r&&n}else r=!1;else if("function"==typeof e.splice)for(r=[],t=e.length;t--;)this.match(e[t])&&(r[r.length]=e[t]);else if("object"==typeof e)for(var a in r={},e)this.match(a)&&(r[a]=e[a]);return r};var Ax=/[\/\+\.]/;const kx=_d(function(e,t){function n(t){var n=function(e,t,n){var r=new Sx(e,n||/[\/\.]/);return typeof t<"u"?r.match(t):r}(t,e,Ax);return n&&n.length>=2}return t?n(t.split(";")[0]):n});function Ex(e,t){return t.map(e=>e.split(",")).flat().some(t=>{if(t.includes("/"))return!!e.mime&&kx(e.mime.replace(/;.*?$/,""),t);const n=t.replace(".","").toLowerCase();return!(!n||!e.extension)&&e.extension.toLowerCase()===n})}class Ix{async uploadAndAddImage(e=!0){const t=await this.openUploadWindow();await this.openUploadedFile(t,e)}async uploadAndReplaceMainImage(){const e=await this.openUploadWindow();e&&await this.openBackgroundImage(e)}async uploadAndOpenStateFile(){const e=await this.openUploadWindow(jx);e&&await this.loadState(await e.data)}async addImageFromUrl(e,t=!0){var n,r;await yx(e,(null==(r=null==(n=qp().config.tools)?void 0:n.import)?void 0:r.fitOverlayToScreen)??!0,t),Yp().history.addHistoryItem({name:"overlayImage"})}async addImageFromData(e,t=!0){var n,r;await yx(e,(null==(r=null==(n=qp().config.tools)?void 0:n.import)?void 0:r.fitOverlayToScreen)??!0,t),Yp().history.addHistoryItem({name:"overlayImage"})}async openUploadedFile(e,t=!0){if(!e)return;const n=await e.data;switch(e.extension){case"json":await this.loadState(n);break;case"svg":await Yp().shape.addSvgSticker(n,Vf.Image),Yp().history.addHistoryItem({name:"overlayImage"});break;default:await this.addImageFromData(n,t)}}async loadState(e){let t;qp().toggleLoading("state"),await Kp(),t="string"==typeof e?e.endsWith(".json")?await Zp(e):JSON.parse(e):e,t.history?qp().history.reset(t.history):await Yp().history.addInitial(t),await Yp().history.reload(),qp().toggleLoading(!1)}async openUploadWindow(e){var t,n;e=e||function(){var e,t;const n=null==(t=null==(e=qp().config.tools)?void 0:e.import)?void 0:t.validImgExtensions;return n?{extensions:n}:{types:[Cx.image]}}();const r=(await function(e={}){return new Promise(t=>{const n=function(e={}){const t=document.querySelector("#hidden-file-upload-input");t&&t.remove();const n=document.createElement("input");return n.type="file",n.multiple=e.multiple??!1,n.classList.add("hidden"),n.style.display="none",n.style.visibility="hidden",n.id="hidden-file-upload-input",n.accept=function({extensions:e=[],types:t=[]}){const n=[];return null!=e&&e.length&&(e=e.map(e=>e.startsWith(".")?e:`.${e}`),n.push(e.join(","))),null!=t&&t.length&&n.push(t.join(",")),n.join(",")}(e),e.directory&&(n.webkitdirectory=!0),document.body.appendChild(n),n}(e);n.onchange=e=>{const r=e.target.files;if(!r)return t([]);const i=Array.from(r).filter(e=>".DS_Store"!==e.name).map(e=>new wx(e));t(i),n.remove()},document.body.appendChild(n),n.click()})}(e))[0];return this.fileIsValid(r)?(null==(n=(t=qp().config).onFileOpen)||n.call(t,r),r):null}async openBackgroundImage(e){let t;await Kp(),t=e instanceof HTMLImageElement?e.src:e instanceof wx?await e.data:e;const n=await Yp().canvas.addMainImage(t);return await Yp().history.addInitial(),n}fileIsValid(e){var t,n,r,i;const o=function(e,t){if(!t)return;const{maxFileSize:n,allowedFileTypes:r,blockedFileTypes:i}=t;return n&&null!=e.size&&e.size>n?kd("`:file` exceeds maximum allowed size of :size",{values:{file:e.name,size:_x(n)}}):null!=r&&r.length&&!Ex(e,r)||null!=i&&i.length&&Ex(e,i)?kd("This file type is not allowed"):void 0}(e,{maxFileSize:(null==(n=null==(t=qp().config.tools)?void 0:t.import)?void 0:n.maxFileSize)??10485760,allowedFileTypes:[...(null==(i=null==(r=qp().config.tools)?void 0:r.import)?void 0:i.validImgExtensions)??[],"json"]});return!o||(ag.danger(o),!1)}}const jx={types:[".json",Cx.json]};class Tx{constructor(){is(this,"watermark",null),is(this,"lineStyle",{stroke:"rgba(255,255,255,0.3)",strokeWidth:5,strokeLineCap:"round",strokeLineJoin:"round"})}add(e){this.createGroup(),this.addText(e),this.addLines(),Xp().add(this.watermark),Yp().canvas.render()}remove(){this.watermark&&(Xp().remove(this.watermark),this.watermark=null,Yp().canvas.render())}createGroup(){this.watermark=new vw.fabric.Group(void 0,{...Jp,width:qp().original.width,height:qp().original.height,excludeFromExport:!0,top:0,left:0,originX:"left",originY:"top"})}addText(e){var t;const n=new vw.fabric.Text(e,{fill:"rgba(255,255,255,0.3)",strokeWidth:2,stroke:"rgba(255,255,255,0.4)",originX:"center",originY:"center",fontWeight:600,fontSize:150,fontFamily:"Courier New"});n.scaleToWidth(qp().original.width/2),null==(t=this.watermark)||t.add(n)}addLines(){var e;if(!this.watermark)return;const t=null==(e=this.watermark)?void 0:e.getObjects("text")[0],n=qp().original.width/2,r=qp().original.height/2,i=100,o=t.width/4,a=new vw.fabric.Line(void 0,this.lineStyle),s=new vw.fabric.Line(void 0,this.lineStyle),l=new vw.fabric.Line(void 0,this.lineStyle),c=new vw.fabric.Line(void 0,this.lineStyle);this.watermark.add(a,s,l,c),a.set({x1:o,y1:-i,x2:n,y2:-r}),s.set({x1:o,y1:i,x2:n,y2:r}),l.set({x1:-o,y1:-i,x2:-n,y2:-r}),c.set({x1:-o,y1:i,x2:-n,y2:r})}}var Fx={exports:{}};!function(e){!function(){function t(e,t,n){var r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){a(r.response,t,n)},r.onerror=function(){},r.send()}function n(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch{}return 200<=t.status&&299>=t.status}function r(e){try{e.dispatchEvent(new MouseEvent("click"))}catch{var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var i="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof Cd&&Cd.global===Cd?Cd:void 0,o=i.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),a=i.saveAs||("object"!=typeof window||window!==i?function(){}:"download"in HTMLAnchorElement.prototype&&!o?function(e,o,a){var s=i.URL||i.webkitURL,l=document.createElement("a");o=o||e.name||"download",l.download=o,l.rel="noopener","string"==typeof e?(l.href=e,l.origin===location.origin?r(l):n(l.href)?t(e,o,a):r(l,l.target="_blank")):(l.href=s.createObjectURL(e),setTimeout(function(){s.revokeObjectURL(l.href)},4e4),setTimeout(function(){r(l)},0))}:"msSaveOrOpenBlob"in navigator?function(e,i,o){if(i=i||e.name||"download","string"!=typeof e)navigator.msSaveOrOpenBlob(function(e,t){return typeof t>"u"?t={autoBom:!1}:"object"!=typeof t&&(t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\ufeff",e],{type:e.type}):e}(e,o),i);else if(n(e))t(e,i,o);else{var a=document.createElement("a");a.href=e,a.target="_blank",setTimeout(function(){r(a)})}}:function(e,n,r,a){if((a=a||open("","_blank"))&&(a.document.title=a.document.body.innerText="downloading..."),"string"==typeof e)return t(e,n,r);var s="application/octet-stream"===e.type,l=/constructor/i.test(i.HTMLElement)||i.safari,c=/CriOS\/[\d]+/.test(navigator.userAgent);if((c||s&&l||o)&&typeof FileReader<"u"){var u=new FileReader;u.onloadend=function(){var e=u.result;e=c?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),a?a.location.href=e:location=e,a=null},u.readAsDataURL(e)}else{var d=i.URL||i.webkitURL,h=d.createObjectURL(e);a?a.location=h:location.href=h,a=null,setTimeout(function(){d.revokeObjectURL(h)},4e4)}});i.saveAs=a.saveAs=a,e.exports=a}()}(Fx);var Ox=Fx.exports;class Mx{save(e,t,n){var r,i,o;const a=null==(r=qp().config.tools)?void 0:r.export;e=e||(null==a?void 0:a.defaultName),t=this.getFormat(t),n=this.getQuality(n);const s=`${e}.${t}`;this.applyWaterMark();const l="json"===t?this.getJsonState():this.getDataUrl(t,n);if(Yp().watermark.remove(),l)if(qp().config.saveUrl)fetch(qp().config.saveUrl,{method:"POST",body:JSON.stringify({data:l,filename:s,format:t})});else if(qp().config.onSave)null==(o=(i=qp().config).onSave)||o.call(i,l,s,t);else{const e=this.getCanvasBlob(t,l);Ox.saveAs(e,s)}}getDataUrl(e,t){try{return"svg"===e?Xp().toSVG():Xp().toDataURL({format:this.getFormat(e),quality:this.getQuality(t),multiplier:Math.max(qp().original.width/Xp().width,qp().original.height/Xp().height)})}catch(e){e.message.toLowerCase().includes("tainted")&&ag.danger(kd("Could not export canvas with external image."))}return null}getCanvasBlob(e,t){if("json"===e)return new Blob([t],{type:"application/json"});if("svg"===e)return new Blob([t],{type:"image/svg+xml"});const n=`image/${e}`;return function(e,t,n){t=t||"",n=n||512;const r=atob(e),i=[];for(let o=0;o<r.length;o+=n){const e=r.slice(o,o+n),t=new Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);const a=new Uint8Array(t);i.push(a)}return new Blob(i,{type:t})}(t=t.replace(/data:image\/([a-z]*)?;base64,/,""),n)}getJsonState(){return JSON.stringify({...Qp(),history:qp().history})}applyWaterMark(){const e=qp().config.watermarkText;e&&Yp().watermark.add(e)}getFormat(e){var t;const n=null==(t=qp().config.tools)?void 0:t.export;return"jpg"===(e=e||(null==n?void 0:n.defaultFormat)||"png")&&(e="jpeg"),e}getQuality(e){var t;const n=null==(t=qp().config.tools)?void 0:t.export;return e||(null==n?void 0:n.defaultQuality)||.8}}class Px{constructor(){is(this,"previewRect",null)}async apply(e){this.previewRect||this.showPreview(),this.updatePreview(e),Xp().remove(this.previewRect),Xp().clipPath=this.previewRect;const t=Yp().export.getDataUrl();t&&Yp().canvas.clear(),this.hidePreview(),t&&await Yp().canvas.addMainImage(t),Xp().clipPath=void 0}getPreviewRadius(){var e;return(null==(e=this.previewRect)?void 0:e.rx)||0}updatePreview(e){this.previewRect&&(this.previewRect.set({rx:e,ry:e}),Yp().canvas.render())}showPreview(){const e=.04*qp().original.width;this.previewRect=new vw.fabric.Rect({width:qp().original.width,height:qp().original.height,rx:e,ry:e,objectCaching:!1,fill:"transparent",name:"round.rect",data:{pixieInternal:!0},stroke:"rgba(255,255,255,0.8)",strokeWidth:3,strokeDashArray:[4,4],selectable:!1,evented:!1}),Xp().add(this.previewRect),this.previewRect.moveTo(99),this.previewRect.viewportCenter(),Yp().canvas.render()}hidePreview(){this.previewRect&&(Xp().remove(this.previewRect),Yp().canvas.render(),this.previewRect=null)}}class Rx{get straightenAnchor(){return Xp().getObjects().find(e=>e.name===Vf.StraightenAnchor)}rotateLeft(){this.rotateFixed(-90)}rotateRight(){this.rotateFixed(90)}straighten(e){this.storeObjectsRelationToHelper(),Yp().objects.deselectActive();const t=(this.straightenAnchor.data.rotateAngle||0)+e,n=this.getImageScale(t,this.straightenAnchor);this.straightenAnchor.angle=t,this.straightenAnchor.scaleX=n,this.straightenAnchor.scaleY=n,this.straightenAnchor.data.straightenAngle=e,this.transformObjectsBasedOnHelper()}flip(e){const t="horizontal"===e?"flipY":"flipX";Yp().objects.getAll().forEach(e=>{e[t]=!e[t]}),Yp().canvas.render()}rotateFixed(e){Yp().zoom.set(1,!1),Yp().objects.deselectActive();const t=this.straightenAnchor.data.rotateAngle||0;e=90*Math.round(e/90);const n=t+(this.straightenAnchor.data.straightenAngle||0)+e;Yp().canvas.resize(qp().original.height,qp().original.width,{applyZoom:!1,resizeHelper:!1}),this.storeObjectsRelationToHelper(),this.straightenAnchor.rotate(n),this.straightenAnchor.data.rotateAngle=t+e,this.straightenAnchor.center(),this.transformObjectsBasedOnHelper(),Yp().frame.resize(Yp().frame.active.currentSizeInPercent),requestAnimationFrame(()=>{Yp().zoom.fitToScreen()})}getImageScale(e,t){e=vw.fabric.util.degreesToRadians(e);const n=qp().original.width/2,r=qp().original.height/2,i=t.width/2,o=t.height/2,a=Math.sqrt(n**2+r**2),s=Math.asin(r/a);let l=(e%(2*Math.PI)+4*Math.PI)%(2*Math.PI);l>Math.PI&&(l-=Math.PI),l>Math.PI/2&&l<=Math.PI&&(l=Math.PI/2-(l-Math.PI/2));const c=Math.PI/2-s-Math.abs(l),u=Math.abs(s-Math.abs(l)),d=Math.cos(c)*a,h=Math.cos(u)*a;return Math.max(h/i,d/o)}storeObjectsRelationToHelper(){Yp().objects.getAll().forEach(e=>{if(e!==this.straightenAnchor){const t=vw.fabric.util.multiplyTransformMatrices(vw.fabric.util.invertTransform(this.straightenAnchor.calcTransformMatrix()),e.calcTransformMatrix());e.data={...e.data,relationToCanvas:t}}})}transformObjectsBasedOnHelper(){Yp().objects.getAll().forEach(e=>{if(e.data.relationToCanvas){const t=vw.fabric.util.multiplyTransformMatrices(this.straightenAnchor.calcTransformMatrix(),e.data.relationToCanvas),n=vw.fabric.util.qrDecompose(t);e.set({flipX:!1,flipY:!1}),e.setPositionByOrigin({x:n.translateX,y:n.translateY},"center","center"),e.set(n),e.setCoords(),e.data.relationToCanvas=null}})}resetStraightenAnchor(){const e=this.straightenAnchor;e&&Xp().remove(e);const t=new vw.fabric.Rect({...Jp,name:Vf.StraightenAnchor,visible:!1,width:qp().original.width,height:qp().original.height,data:{pixieInternal:!0,straightenAngle:0,rotateAngle:0}});Xp().add(t),t.viewportCenter()}}function Lx(e,t){const n=new ResizeObserver(e=>{const n=e[0].contentRect;t({width:n.width,height:n.height})});return e.current&&n.observe(e.current),()=>{e.current&&n.unobserve(e.current)}}function Nx(e){const t=e.getBoundingClientRect();return{top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height}}const Dx="flex flex-shrink-0 items-center justify-between px-12 py-[9px] w-full h-[54px]",zx={initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,position:"absolute"},transition:{type:"tween",duration:.15}};function Bx(e,{padding:t,equalWidth:n,variant:r}={}){switch(e){case"2xs":return"link"===r?"text-xs":`text-xs h-24 ${n?"w-24":t||"px-10"}`;case"xs":return"link"===r?"text-xs":`text-xs h-30 ${n?"w-30":t||"px-14"}`;case"sm":return"link"===r?"text-sm":`text-sm h-36 ${n?"w-36":t||"px-18"}`;case"md":return"link"===r?"text-base":`text-base h-42 ${n?"w-42":t||"px-22"}`;case"lg":return"link"===r?"text-lg":`text-base h-50 ${n?"w-50":t||"px-26"}`;case"xl":return"link"===r?"text-xl":`text-lg h-60 ${n?"w-60":t||"px-32"}`;default:return e||""}}function Ux(e){const{variant:t,shadow:n,whitespace:r="whitespace-nowrap",display:i="inline-flex"}=e,o={...e,border:e.border||"border"};let a=[];return"outline"===t?a=function({color:e,border:t}){const n="disabled:text-disabled disabled:bg-transparent disabled:border-disabled-bg";switch(e){case"primary":return[`text-primary bg-transparent ${t} border-primary/50`,"hover:bg-primary/hover hover:border-primary",n];case"danger":return[`text-danger bg-transparent ${t} border-danger/50`,"hover:bg-danger/4 hover:border-danger",n];case"positive":return[`text-positive bg-transparent ${t} border-positive/50`,"hover:bg-positive/4 hover:border-positive",n];case"paper":return[`text bg-paper ${t}`,"hover:bg-hover",n];case"white":return["text-white bg-transparent border border-white","hover:bg-white/20","disabled:text-white/70 disabled:border-white/70 disabled:bg-transparent"];default:return[`bg-transparent ${t}`,"hover:bg-hover",n]}}(o):"text"===t?a=function({color:e}){const t="disabled:text-disabled disabled:bg-transparent";switch(e){case"primary":return["text-primary bg-transparent border-transparent","hover:bg-primary/4",t];case"danger":return["text-danger bg-transparent border-transparent","hover:bg-danger/4",t];case"positive":return["text-positive bg-transparent border-transparent","hover:bg-positive/4",t];case"white":return["text-white bg-transparent border-transparent","hover:bg-white/20","disabled:text-white/70 disabled:bg-transparent"];default:return["bg-transparent border-transparent","hover:bg-hover",t]}}(o):"flat"===t||"raised"===t?a=function({color:e,border:t}){const n="disabled:text-disabled disabled:bg-disabled disabled:border-transparent disabled:shadow-none";switch(e){case"primary":return[`text-on-primary bg-primary ${t} border-primary`,"hover:bg-primary-dark hover:border-primary-dark",n];case"danger":return[`text-white bg-danger ${t} border-danger`,"hover:bg-danger/90 hover:border-danger/90",n];case"chip":return[`text-main bg-chip ${t} border-chip`,"hover:bg-chip/90 hover:border-chip/90",n];case"paper":return[`text-main bg-paper ${t} border-paper`,"hover:bg-paper/90 hover:border-paper/90",n];case"white":return[`text-black bg-white ${t} border-white`,"hover:bg-white",n];default:return[`bg ${t} border-background`,"hover:bg-hover",n]}}(o):"link"===t&&(a=function({color:e}){switch(e){case"primary":return["text-primary","hover:underline","disabled:text-disabled"];case"danger":return["text-danger","hover:underline","disabled:text-disabled"];default:return["text-main","hover:underline","disabled:text-disabled"]}}(o)),[...a,n||"raised"===t&&"shadow-md",r,i,t&&"align-middle flex-shrink-0 items-center transition-button duration-200","select-none appearance-none no-underline outline-none disabled:pointer-events-none disabled:cursor-default"]}function Vx(e){return e&&(t=>{t.currentTarget.contains(t.target)&&e(t)})}const Hx=(0,o.forwardRef)((e,t)=>{const{children:n,color:r=null,variant:o,radius:a,shadow:s,whitespace:l,justify:c="justify-center",className:u,href:d,form:h,border:f,elementType:p,to:g,relative:m,replace:v,end:y,display:b,type:w="button",onClick:x,onPointerDown:C,onPointerUp:_,onKeyDown:S,...A}=e,k=p||(d?"a":"button"),E="a"===k;return(0,i.jsx)(k,{ref:t,form:E?void 0:h,href:d,to:g,relative:m,type:E?void 0:w,replace:v,end:y,onPointerDown:Vx(C),onPointerUp:Vx(_),onClick:Vx(x),onKeyDown:Vx(S),className:Pd("focus-visible:ring",Ux({variant:o,color:r,border:f,whitespace:l,display:b}),a,c,u),...A,children:n})}),Wx=o.forwardRef(({children:e,startIcon:t,endIcon:n,size:r="sm",sizeClassName:o,className:a,equalWidth:s=!1,radius:l="rounded-button",variant:c="text",disabled:u,elementType:d,to:h,replace:f,href:p,download:g,...m},v)=>{const y=Pd("font-semibold",o||Bx(r,{equalWidth:s,variant:c}),a);return(0,i.jsxs)(Hx,{className:y,ref:v,radius:l,variant:c,disabled:u,to:u?void 0:h,href:u?void 0:p,download:u?void 0:g,elementType:u?void 0:d,replace:u?void 0:f,...m,children:[t&&(0,i.jsx)($x,{position:"start",icon:t,size:r}),e,n&&(0,i.jsx)($x,{position:"end",icon:n,size:r})]})});function $x({icon:e,position:t,size:n}){const r=Pd("m-auto",{"-ml-4 mr-8":"start"===t,"-mr-4 ml-8":"end"===t},e.props.className);return o.cloneElement(e,{className:r,size:n})}const Gx=(0,o.createContext)(null);function qx(){return(0,o.useContext)(Gx)}const Yx=Nd((0,i.jsx)("path",{d:"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"}),"CheckOutlined"),Xx=o.forwardRef((e,t)=>{let{startIcon:n,capitalizeFirst:r,children:o,description:a,endIcon:s,endSection:l,isDisabled:c,isActive:u,isSelected:d,showCheckmark:h,elementType:f="div",radius:p,padding:g,...m}=e;!n&&h&&(n=(0,i.jsx)(Yx,{size:"sm",className:Pd("text-primary",!d&&"invisible")}));const v=Pd("icon-sm rounded overflow-hidden flex-shrink-0",!c&&"text-muted"),y=Pd(!c&&"text-muted");return(0,i.jsxs)(f,{...m,"aria-disabled":c,className:Kx(e),ref:t,children:[n&&(0,i.jsx)("div",{className:v,children:n}),(0,i.jsxs)("div",{className:Pd("min-w-auto mr-auto w-full overflow-hidden overflow-ellipsis",r&&"first-letter:capitalize"),children:[o,a&&(0,i.jsx)("div",{className:Pd("mt-4 whitespace-normal text-xs",c?"text-disabled":"text-muted"),children:a})]}),(s||l)&&(0,i.jsx)("div",{className:s?v:y,children:s||l})]})});function Kx({className:e,isSelected:t,isActive:n,isDisabled:r,showCheckmark:i,endIcon:o,endSection:a,radius:s,padding:l}){let c,u="";return u=r?"text-disabled pointer-events-none":t?n?"bg-primary/focus":"bg-primary/selected hover:bg-primary/focus":n?"hover:bg-fg-base/15 bg-focus":"hover:bg-hover",c=l||(i?o||a?"pl-8 pr-8 py-8":"pl-8 pr-24 py-8":"px-20 py-8"),Pd("w-full select-none outline-none cursor-pointer","text-sm truncate flex items-center gap-10",!r&&"text-main",c,u,e,s)}function Zx({children:e,value:t,startIcon:n,endIcon:r,endSection:o,description:a,capitalizeFirst:s,textLabel:l,isDisabled:c,onSelected:u,onClick:d,...h}){var f;const{collection:p,showCheckmark:g,virtualFocus:m,listboxId:v,role:y,listItemsRef:b,handleItemSelection:w,state:{selectedValues:x,activeIndex:C,setActiveIndex:_}}=qx(),S=x.includes(t),A=null==(f=p.get(t))?void 0:f.index,k=C===A;return null==A?null:(0,i.jsx)(Xx,{...h,onFocus:()=>{m||_(A)},onPointerEnter:e=>{_(A),m||e.currentTarget.focus()},onPointerDown:e=>{m&&e.preventDefault()},onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),w(t),null==u||u())},onClick:e=>{w(t),null==u||u(),null==d||d(e)},ref:e=>b.current[A]=e,id:`${v}-${A}`,role:"menu"===y?"menuitem":"option",tabIndex:m?void 0:k&&!c?-1:0,"aria-selected":k&&S,showCheckmark:g,isDisabled:c,isActive:k,isSelected:S,startIcon:n,description:a,endIcon:r,endSection:o,capitalizeFirst:s,"data-value":t,children:e})}var Jx={exports:{}};!function(e){(function(){var t=Object.assign;function n(e,n){n||(n={});var r,i,o,a=n.vargs||function(e){var t=e+"",n=t.indexOf("...");return n>=0&&(n<t.indexOf(")")||t.indexOf("arguments")>=0)}(e),s=Object.create(null),l=[],c=[],u=new WeakMap,d=n.maxAge>0&&n.maxAge<1/0?function(e,t,r){return setTimeout(function(){if(r)return t.splice(e,1),void r.splice(e,1);t instanceof WeakMap?t.delete(e):delete t[e]},n.maxAge)}:0,h=n.equals?n.equals:function(e,t){return e===t},f=n.maxArgs,p=n.serializer;return 1!==e.length||n.equals||a?i=function(){var t=arguments.length;if(!t&&null!=r)return c[r];var n,i=f||t;for(n=l.length-1;n>=0;n--)if(f||l[n].length===i)for(var o=i-1;o>=0&&h(l[n][o],arguments[o]);o--)if(0===o)return c[n];return n=l.length-(n+1),!t&&null==r&&(r=n),!d||d(n,c,l),c[n]=e.apply(this,l[n]=arguments)}.bind(this):(i=function(t){var n,r=typeof t;if(!p&&("object"===r&&t||"function"===r))return u.get(t)||(!d||d(t,u),u.set(t,n=e.call(this,t)),n);var i="number"===r||"boolean"===r||null==t?t:"string"===r?JSON.stringify(t):p(t);return s[i]||(!d||d(i,s),s[i]=e.call(this,t))}.bind(this),o=1),i.clear=function(){u=new WeakMap,s=Object.create(null),l=[],c=[],r=void 0},i.keys=function(){return o?null:l.slice()},i.values=function(){return o?null:c.slice()},i.keyValues=function(){return o?{primitives:t({},s),objects:u}:null},i}"function"!=typeof t&&(t=function(){var e=arguments,t=arguments[0];if(null==t)throw new TypeError("Cannot convert undefined or null to object");t=Object(t);for(var n=1;n<e.length;n++)if(e[n]&&"object"==typeof e[n])for(var r in e[n])t[r]=e[n][r];return t}),e.exports=n,typeof window<"u"&&(window.nanomemoize=n)}).call(Cd)}(Jx);const Qx=_d(Jx.exports);function eC({children:e,label:t,index:n}){const r=(0,o.useId)();return(0,i.jsxs)("div",{role:"group",className:Pd(0!==n&&"border-t my-4"),"aria-labelledby":t?`be-select-${r}`:void 0,children:[t&&(0,i.jsx)("div",{className:"block uppercase text-muted text-xs px-16 py-10",role:"presentation",id:`be-select-${r}`,"aria-hidden":"true",children:t}),e]})}const tC=Qx(({maxItems:e,children:t,items:n,inputValue:r})=>{let i=rC({children:t,items:n}),o=nC({collection:i,inputValue:r});return e&&(i=new Map([...i.entries()].slice(0,e)),o=new Map([...o.entries()].slice(0,e))),{collection:i,filteredCollection:o}}),nC=Qx(({collection:e,inputValue:t})=>{let n=new Map;const r=t?`${t}`.toLowerCase().trim():"";if(r){let t=0;e.forEach((e,i)=>{(e.item?JSON.stringify(e.item):e.textLabel).toLowerCase().trim().includes(r)&&n.set(i,{...e,index:t++})})}else n=e;return n}),rC=Qx(({children:e,items:t})=>{let n;n=t&&"function"==typeof e?t.map(t=>e(t)):e;const r=new Map;let i=0;const a=(e,n,o,a)=>{const s=i++,l=n?null==t?void 0:t[o].items[a]:null==t?void 0:t[s];r.set(e.props.value,{index:s,element:e,textLabel:iC(e),item:l,section:n,isDisabled:e.props.isDisabled,value:e.props.value})};return o.Children.forEach(n,(e,t)=>{(0,o.isValidElement)(e)&&(e.type===eC?o.Children.forEach(e.props.children,(n,r)=>{a(n,e,t,r)}):a(e))}),r});function iC(e){var t;const n=e.props.children;return e.props.textLabel?e.props.textLabel:null!=(t=null==n?void 0:n.props)&&t.message?n.props.message:`${n}`||""}const oC=Math.min,aC=Math.max,sC=Math.round,lC=Math.floor,cC=e=>({x:e,y:e}),uC={left:"right",right:"left",bottom:"top",top:"bottom"},dC={start:"end",end:"start"};function hC(e,t,n){return aC(e,oC(t,n))}function fC(e,t){return"function"==typeof e?e(t):e}function pC(e){return e.split("-")[0]}function gC(e){return e.split("-")[1]}function mC(e){return"x"===e?"y":"x"}function vC(e){return"y"===e?"height":"width"}function yC(e){return["top","bottom"].includes(pC(e))?"y":"x"}function bC(e){return mC(yC(e))}function wC(e){return e.replace(/start|end/g,e=>dC[e])}function xC(e){return e.replace(/left|right|bottom|top/g,e=>uC[e])}function CC(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function _C(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function SC(e,t,n){let{reference:r,floating:i}=e;const o=yC(t),a=bC(t),s=vC(a),l=pC(t),c="y"===o,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,h=r[s]/2-i[s]/2;let f;switch(l){case"top":f={x:u,y:r.y-i.height};break;case"bottom":f={x:u,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-i.width,y:d};break;default:f={x:r.x,y:r.y}}switch(gC(t)){case"start":f[a]-=h*(n&&c?-1:1);break;case"end":f[a]+=h*(n&&c?-1:1)}return f}async function AC(e,t){var n;void 0===t&&(t={});const{x:r,y:i,platform:o,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:f=0}=fC(t,e),p=CC(f),g=s[h?"floating"===d?"reference":"floating":d],m=_C(await o.getClippingRect({element:null==(n=await(null==o.isElement?void 0:o.isElement(g)))||n?g:g.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),v="floating"===d?{x:r,y:i,width:a.floating.width,height:a.floating.height}:a.reference,y=await(null==o.getOffsetParent?void 0:o.getOffsetParent(s.floating)),b=await(null==o.isElement?void 0:o.isElement(y))&&await(null==o.getScale?void 0:o.getScale(y))||{x:1,y:1},w=_C(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:y,strategy:l}):v);return{top:(m.top-w.top+p.top)/b.y,bottom:(w.bottom-m.bottom+p.bottom)/b.y,left:(m.left-w.left+p.left)/b.x,right:(w.right-m.right+p.right)/b.x}}function kC(e){return jC(e)?(e.nodeName||"").toLowerCase():"#document"}function EC(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function IC(e){var t;return null==(t=(jC(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function jC(e){return e instanceof Node||e instanceof EC(e).Node}function TC(e){return e instanceof Element||e instanceof EC(e).Element}function FC(e){return e instanceof HTMLElement||e instanceof EC(e).HTMLElement}function OC(e){return!(typeof ShadowRoot>"u")&&(e instanceof ShadowRoot||e instanceof EC(e).ShadowRoot)}function MC(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=DC(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function PC(e){return["table","td","th"].includes(kC(e))}function RC(e){const t=LC(),n=DC(e);return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some(e=>(n.willChange||"").includes(e))||["paint","layout","strict","content"].some(e=>(n.contain||"").includes(e))}function LC(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function NC(e){return["html","body","#document"].includes(kC(e))}function DC(e){return EC(e).getComputedStyle(e)}function zC(e){return TC(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function BC(e){if("html"===kC(e))return e;const t=e.assignedSlot||e.parentNode||OC(e)&&e.host||IC(e);return OC(t)?t.host:t}function UC(e){const t=BC(e);return NC(t)?e.ownerDocument?e.ownerDocument.body:e.body:FC(t)&&MC(t)?t:UC(t)}function VC(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const i=UC(e),o=i===(null==(r=e.ownerDocument)?void 0:r.body),a=EC(i);return o?t.concat(a,a.visualViewport||[],MC(i)?i:[],a.frameElement&&n?VC(a.frameElement):[]):t.concat(i,VC(i,[],n))}function HC(e){const t=DC(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=FC(e),o=i?e.offsetWidth:n,a=i?e.offsetHeight:r,s=sC(n)!==o||sC(r)!==a;return s&&(n=o,r=a),{width:n,height:r,$:s}}function WC(e){return TC(e)?e:e.contextElement}function $C(e){const t=WC(e);if(!FC(t))return cC(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=HC(t);let a=(o?sC(n.width):n.width)/r,s=(o?sC(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const GC=cC(0);function qC(e){const t=EC(e);return LC()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:GC}function YC(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const i=e.getBoundingClientRect(),o=WC(e);let a=cC(1);t&&(r?TC(r)&&(a=$C(r)):a=$C(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==EC(e))&&t}(o,n,r)?qC(o):cC(0);let l=(i.left+s.x)/a.x,c=(i.top+s.y)/a.y,u=i.width/a.x,d=i.height/a.y;if(o){const e=EC(o),t=r&&TC(r)?EC(r):r;let n=e,i=n.frameElement;for(;i&&r&&t!==n;){const e=$C(i),t=i.getBoundingClientRect(),r=DC(i),o=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,a=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=o,c+=a,n=EC(i),i=n.frameElement}}return _C({width:u,height:d,x:l,y:c})}const XC=[":popover-open",":modal"];function KC(e){return XC.some(t=>{try{return e.matches(t)}catch{return!1}})}function ZC(e){return YC(IC(e)).left+zC(e).scrollLeft}function JC(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=EC(e),r=IC(e),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;const e=LC();(!e||e&&"fixed"===t)&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s,y:l}}(e,n);else if("document"===t)r=function(e){const t=IC(e),n=zC(e),r=e.ownerDocument.body,i=aC(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=aC(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+ZC(e);const s=-n.scrollTop;return"rtl"===DC(r).direction&&(a+=aC(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:a,y:s}}(IC(e));else if(TC(t))r=function(e,t){const n=YC(e,!0,"fixed"===t),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=FC(e)?$C(e):cC(1);return{width:e.clientWidth*o.x,height:e.clientHeight*o.y,x:i*o.x,y:r*o.y}}(t,n);else{const n=qC(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return _C(r)}function QC(e,t){const n=BC(e);return!(n===t||!TC(n)||NC(n))&&("fixed"===DC(n).position||QC(n,t))}function e_(e,t){const n=t.get(e);if(n)return n;let r=VC(e,[],!1).filter(e=>TC(e)&&"body"!==kC(e)),i=null;const o="fixed"===DC(e).position;let a=o?BC(e):e;for(;TC(a)&&!NC(a);){const t=DC(a),n=RC(a);!n&&"fixed"===t.position&&(i=null),(o?!n&&!i:!n&&"static"===t.position&&i&&["absolute","fixed"].includes(i.position)||MC(a)&&!n&&QC(e,a))?r=r.filter(e=>e!==a):i=t,a=BC(a)}return t.set(e,r),r}function t_(e,t,n){const r=FC(t),i=IC(t),o="fixed"===n,a=YC(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const l=cC(0);if(r||!r&&!o)if(("body"!==kC(t)||MC(i))&&(s=zC(t)),r){const e=YC(t,!0,o,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else i&&(l.x=ZC(i));return{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function n_(e){return"static"===DC(e).position}function r_(e,t){return FC(e)&&"fixed"!==DC(e).position?t?t(e):e.offsetParent:null}function i_(e,t){const n=EC(e);if(KC(e))return n;if(!FC(e)){let t=BC(e);for(;t&&!NC(t);){if(TC(t)&&!n_(t))return t;t=BC(t)}return n}let r=r_(e,t);for(;r&&PC(r)&&n_(r);)r=r_(r,t);return r&&NC(r)&&n_(r)&&!RC(r)?n:r||function(e){let t=BC(e);for(;FC(t)&&!NC(t);){if(RC(t))return t;t=BC(t)}return null}(e)||n}const o_={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o="fixed"===i,a=IC(r),s=!!t&&KC(t.floating);if(r===a||s&&o)return n;let l={scrollLeft:0,scrollTop:0},c=cC(1);const u=cC(0),d=FC(r);if((d||!d&&!o)&&(("body"!==kC(r)||MC(a))&&(l=zC(r)),FC(r))){const e=YC(r);c=$C(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x,y:n.y*c.y-l.scrollTop*c.y+u.y}},getDocumentElement:IC,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[..."clippingAncestors"===n?KC(t)?[]:e_(t,this._c):[].concat(n),r],a=o[0],s=o.reduce((e,n)=>{const r=JC(t,n,i);return e.top=aC(r.top,e.top),e.right=oC(r.right,e.right),e.bottom=oC(r.bottom,e.bottom),e.left=aC(r.left,e.left),e},JC(t,a,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:i_,getElementRects:async function(e){const t=this.getOffsetParent||i_,n=this.getDimensions,r=await n(e.floating);return{reference:t_(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=HC(e);return{width:t,height:n}},getScale:$C,isElement:TC,isRTL:function(e){return"rtl"===DC(e).direction}};function a_(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=WC(e),u=i||o?[...c?VC(c):[],...VC(t)]:[];u.forEach(e=>{i&&e.addEventListener("scroll",n,{passive:!0}),o&&e.addEventListener("resize",n)});const d=c&&s?function(e,t){let n,r=null;const i=IC(e);function o(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function a(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),o();const{left:c,top:u,width:d,height:h}=e.getBoundingClientRect();if(s||t(),!d||!h)return;const f={rootMargin:-lC(u)+"px "+-lC(i.clientWidth-(c+d))+"px "+-lC(i.clientHeight-(u+h))+"px "+-lC(c)+"px",threshold:aC(0,oC(1,l))||1};let p=!0;function g(e){const t=e[0].intersectionRatio;if(t!==l){if(!p)return a();t?a(!1,t):n=setTimeout(()=>{a(!1,1e-7)},1e3)}p=!1}try{r=new IntersectionObserver(g,{...f,root:i.ownerDocument})}catch{r=new IntersectionObserver(g,f)}r.observe(e)}(!0),o}(c,n):null;let h=-1,f=null;a&&(f=new ResizeObserver(e=>{let[r]=e;r&&r.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var e;null==(e=f)||e.observe(t)})),n()}),c&&!l&&f.observe(c),f.observe(t));let p,g=l?YC(e):null;return l&&function t(){const r=YC(e);g&&(r.x!==g.x||r.y!==g.y||r.width!==g.width||r.height!==g.height)&&n(),g=r,p=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener("scroll",n),o&&e.removeEventListener("resize",n)}),null==d||d(),null==(e=f)||e.disconnect(),f=null,l&&cancelAnimationFrame(p)}}const s_=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:a,middlewareData:s}=t,l=await async function(e,t){const{placement:n,platform:r,elements:i}=e,o=await(null==r.isRTL?void 0:r.isRTL(i.floating)),a=pC(n),s=gC(n),l="y"===yC(n),c=["left","top"].includes(a)?-1:1,u=o&&l?-1:1,d=fC(t,e);let{mainAxis:h,crossAxis:f,alignmentAxis:p}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return s&&"number"==typeof p&&(f="end"===s?-1*p:p),l?{x:f*u,y:h*c}:{x:h*c,y:f*u}}(t,e);return a===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:a}}}}},l_=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=fC(e,t),c={x:n,y:r},u=await AC(t,l),d=yC(pC(i)),h=mC(d);let f=c[h],p=c[d];if(o){const e="y"===h?"bottom":"right";f=hC(f+u["y"===h?"top":"left"],f,f-u[e])}if(a){const e="y"===d?"bottom":"right";p=hC(p+u["y"===d?"top":"left"],p,p-u[e])}const g=s.fn({...t,[h]:f,[d]:p});return{...g,data:{x:g.x-n,y:g.y-r}}}}},c_=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:a,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:g=!0,...m}=fC(e,t);if(null!=(n=o.arrow)&&n.alignmentOffset)return{};const v=pC(i),y=pC(s)===s,b=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=h||(y||!g?[xC(s)]:function(e){const t=xC(e);return[wC(e),t,wC(t)]}(s));!h&&"none"!==p&&w.push(...function(e,t,n,r){const i=gC(e);let o=function(e,t,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?o:a;default:return[]}}(pC(e),"start"===n,r);return i&&(o=o.map(e=>e+"-"+i),t&&(o=o.concat(o.map(wC)))),o}(s,g,p,b));const x=[s,...w],C=await AC(t,m),_=[];let S=(null==(r=o.flip)?void 0:r.overflows)||[];if(u&&_.push(C[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=gC(e),i=bC(e),o=vC(i);let a="x"===i?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=xC(a)),[a,xC(a)]}(i,a,b);_.push(C[e[0]],C[e[1]])}if(S=[...S,{placement:i,overflows:_}],!_.every(e=>e<=0)){var A,k;const e=((null==(A=o.flip)?void 0:A.index)||0)+1,t=x[e];if(t)return{data:{index:e,overflows:S},reset:{placement:t}};let n=null==(k=S.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:k.placement;if(!n)switch(f){case"bestFit":{var E;const e=null==(E=S.map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:E[0];e&&(n=e);break}case"initialPlacement":n=s}if(i!==n)return{reset:{placement:n}}}return{}}}},u_=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:i,elements:o}=t,{apply:a=()=>{},...s}=fC(e,t),l=await AC(t,s),c=pC(n),u=gC(n),d="y"===yC(n),{width:h,height:f}=r.floating;let p,g;"top"===c||"bottom"===c?(p=c,g=u===(await(null==i.isRTL?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(g=c,p="end"===u?"top":"bottom");const m=f-l.top-l.bottom,v=h-l.left-l.right,y=oC(f-l[p],m),b=oC(h-l[g],v),w=!t.middlewareData.shift;let x=y,C=b;if(d?C=u||w?oC(b,v):v:x=u||w?oC(y,m):m,w&&!u){const e=aC(l.left,0),t=aC(l.right,0),n=aC(l.top,0),r=aC(l.bottom,0);d?C=h-2*(0!==e||0!==t?e+t:aC(l.left,l.right)):x=f-2*(0!==n||0!==r?n+r:aC(l.top,l.bottom))}await a({...t,availableWidth:C,availableHeight:x});const _=await i.getDimensions(o.floating);return h!==_.width||f!==_.height?{reset:{rects:!0}}:{}}}},d_=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:a,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=fC(e,t)||{};if(null==c)return{};const d=CC(u),h={x:n,y:r},f=bC(i),p=vC(f),g=await a.getDimensions(c),m="y"===f,v=m?"top":"left",y=m?"bottom":"right",b=m?"clientHeight":"clientWidth",w=o.reference[p]+o.reference[f]-h[f]-o.floating[p],x=h[f]-o.reference[f],C=await(null==a.getOffsetParent?void 0:a.getOffsetParent(c));let _=C?C[b]:0;(!_||!await(null==a.isElement?void 0:a.isElement(C)))&&(_=s.floating[b]||o.floating[p]);const S=w/2-x/2,A=_/2-g[p]/2-1,k=oC(d[v],A),E=oC(d[y],A),I=k,j=_-g[p]-E,T=_/2-g[p]/2+S,F=hC(I,T,j),O=!l.arrow&&null!=gC(i)&&T!==F&&o.reference[p]/2-(T<I?k:E)-g[p]/2<0,M=O?T<I?T-I:T-j:0;return{[f]:h[f]+M,data:{[f]:F,centerOffset:T-F-M,...O&&{alignmentOffset:M}},reset:O}}});var h_=typeof document<"u"?o.useLayoutEffect:o.useEffect;function f_(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;0!==r--;)if(!f_(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;0!==r--;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;0!==r--;){const n=i[r];if(!("_owner"===n&&e.$$typeof||f_(e[n],t[n])))return!1}return!0}return e!=e&&t!=t}function p_(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function g_(e,t){const n=p_(e);return Math.round(t*n)/n}function m_(e){const t=o.useRef(e);return h_(()=>{t.current=e}),t}function v_({floatingWidth:e,ref:t,disablePositioning:n=!1,placement:r="bottom",offset:i=2,showArrow:a=!1,maxHeight:s,shiftCrossAxis:l=!0,fallbackPlacements:c}){const u=(0,o.useRef)(null),d={placement:r,strategy:"fixed"};n||(d.whileElementsMounted=a_,d.middleware=[s_(i),l_({padding:16,crossAxis:l,mainAxis:!0}),c_({padding:16,fallbackPlacements:c}),u_({apply({rects:t,availableHeight:n,availableWidth:r,elements:i}){"matchTrigger"===e&&null!=s?Object.assign(i.floating.style,{width:`${t.reference.width}px`,maxWidth:`${r}`,maxHeight:`${Math.min(n,s)}px`}):null!=s&&Object.assign(i.floating.style,{maxHeight:`${Math.min(n,s)}px`})},padding:16})],a&&d.middleware.push((e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&function(e){return{}.hasOwnProperty.call(e,"current")}(n)?null!=n.current?d_({element:n.current,padding:r}).fn(t):{}:n?d_({element:n,padding:r}).fn(t):{}}}))({element:u})));const h=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:a,floating:s}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,h]=o.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=o.useState(r);f_(f,r)||p(r);const[g,m]=o.useState(null),[v,y]=o.useState(null),b=o.useCallback(e=>{e!=_.current&&(_.current=e,m(e))},[m]),w=o.useCallback(e=>{e!==S.current&&(S.current=e,y(e))},[y]),x=a||g,C=s||v,_=o.useRef(null),S=o.useRef(null),A=o.useRef(d),k=m_(c),E=m_(i),I=o.useCallback(()=>{if(!_.current||!S.current)return;const e={placement:t,strategy:n,middleware:f};E.current&&(e.platform=E.current),((e,t,n)=>{const r=new Map,i={platform:o_,...n},o={...i.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=o.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=SC(c,r,l),h=r,f={},p=0;for(let g=0;g<s.length;g++){const{name:n,fn:o}=s[g],{x:m,y:v,data:y,reset:b}=await o({x:u,y:d,initialPlacement:r,placement:h,strategy:i,middlewareData:f,rects:c,platform:a,elements:{reference:e,floating:t}});u=m??u,d=v??d,f={...f,[n]:{...f[n],...y}},b&&p<=50&&(p++,"object"==typeof b&&(b.placement&&(h=b.placement),b.rects&&(c=!0===b.rects?await a.getElementRects({reference:e,floating:t,strategy:i}):b.rects),({x:u,y:d}=SC(c,h,l))),g=-1)}return{x:u,y:d,placement:h,strategy:i,middlewareData:f}})(e,t,{...i,platform:o})})(_.current,S.current,e).then(e=>{const t={...e,isPositioned:!0};j.current&&!f_(A.current,t)&&(A.current=t,de.flushSync(()=>{h(t)}))})},[f,t,n,E]);h_(()=>{!1===u&&A.current.isPositioned&&(A.current.isPositioned=!1,h(e=>({...e,isPositioned:!1})))},[u]);const j=o.useRef(!1);h_(()=>(j.current=!0,()=>{j.current=!1}),[]),h_(()=>{if(x&&(_.current=x),C&&(S.current=C),x&&C){if(k.current)return k.current(x,C,I);I()}},[x,C,I,k]);const T=o.useMemo(()=>({reference:_,floating:S,setReference:b,setFloating:w}),[b,w]),F=o.useMemo(()=>({reference:x,floating:C}),[x,C]),O=o.useMemo(()=>{const e={position:n,left:0,top:0};if(!F.floating)return e;const t=g_(F.floating,d.x),r=g_(F.floating,d.y);return l?{...e,transform:"translate("+t+"px, "+r+"px)",...p_(F.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,l,F.floating,d.x,d.y]);return o.useMemo(()=>({...d,update:I,refs:T,elements:F,floatingStyles:O}),[d,I,T,F,O])}(d),f=(0,o.useMemo)(()=>function(e){return t=>{e.forEach(e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})}}([t,h.refs.setReference]),[h.refs.setReference,t]),{x:p,y:g}=h.middlewareData.arrow||{},m={top:"bottom",right:"left",bottom:"top",left:"right"}[h.placement.split("-")[0]],v={left:p,top:g,right:"",bottom:"",[m]:"-4px"};return{...h,reference:f,arrowRef:u,arrowStyle:v}}function y_(e,t){const{children:n,items:r,role:i="listbox",virtualFocus:a,focusLoopingMode:s="stay",autoFocusFirstItem:l=!0,onItemSelected:c,clearInputOnItemSelection:u,blurReferenceOnItemSelection:d,floatingWidth:h="matchTrigger",floatingMinWidth:f,floatingMaxHeight:p,offset:g,placement:m,showCheckmark:v,showEmptyMessage:y,maxItems:b,isAsync:w,allowCustomValue:x,clearSelectionOnInputClear:C}=e,_=e.selectionMode||"none",S=`${(0,o.useId)()}-listbox`,[A,k]=fw(e.inputValue,e.defaultInputValue||"",e.onInputValueChange),[E,I]=(0,o.useState)("all"),j=tC({children:n,items:r,inputValue:w?void 0:A,maxItems:b}),T="all"===E?j.collection:j.filteredCollection,F=(0,o.useRef)([]),O=(0,o.useMemo)(()=>[...T.values()].map(e=>e.isDisabled?null:e.textLabel),[T]),{selectedValues:M,selectValues:P}=function(e){const{selectionMode:t,allowEmptySelection:n}=e,r="single"===t||"multiple"===t,[i,a]=fw(r?e.selectedValue:void 0,r?e.defaultSelectedValue:void 0,r?e.onSelectionChange:void 0),s=(0,o.useMemo)(()=>typeof i>"u"?[]:Array.isArray(i)?i:[i],[i]),l=(0,o.useCallback)(e=>{const r=Array.isArray(e)?e:[e];"single"===t?a(r[0]):r.forEach(e=>{const t=s.indexOf(e);-1===t?(s.push(e),a([...s])):(s.length>1||n)&&(s.splice(t,1),a([...s]))})},[n,s,t,a]);return{selectedValues:s,selectValues:l}}(e),[R,L]=fw(e.isOpen,e.defaultIsOpen,e.onOpenChange),[N,D]=(0,o.useState)(null),z=v_({floatingWidth:h,ref:t,placement:m,offset:g,maxHeight:p??420,shiftCrossAxis:!a}),{refs:B,strategy:U,x:V,y:H}=z,W="none"===_?void 0:T.get(M[0]),$="none"===_||null==W?void 0:W.index,G=(0,o.useCallback)((e,t)=>{var n,r;const i=[...T.values()],o=!i.find(e=>!e.isDisabled),l=T.size-1;null==t||!T.size||t>l||t<0||o?D(null):(t=function(e,t,n,r){var i;const o=e.length-1;for(;null!=(i=e[t])&&i.isDisabled;)if("increment"===r){if(++t>=o){if("loop"!==n)return"stay"===n?t-1:null;t=0}}else if(--t<0){if("loop"!==n)return"stay"===n?t+1:null;t=o}return t}(i,t,s,e),D(t),null!=t&&(a?null==(n=F.current[t])||n.scrollIntoView({block:"nearest"}):null==(r=F.current[t])||r.focus()))},[T,a,s]);return{handleItemSelection:e=>{const t=B.reference.current;"none"!==_?P(e):t&&"focus"in t&&t.focus(),a&&(k(u?"":`${e}`),d&&t&&"blur"in t&&t.blur()),I("all"),L(!1),null==c||c(e),D(null)},onInputChange:(0,o.useCallback)(e=>{k(e.target.value),I(e.target.value.trim()?"filtered":"all"),e.target.value?L(!0):C&&P(""),l&&null==N?G("increment",0):D(null)},[k,L,I,P,C,G,l,N]),focusLoopingMode:s,floatingWidth:h,floatingMinWidth:f,floatingMaxHeight:p,showCheckmark:v,collection:T,collections:j,virtualFocus:a,focusItem:G,showEmptyMessage:y&&!!A,allowCustomValue:x,refs:B,reference:z.reference,floating:B.setFloating,positionStyle:{position:U,top:H??"",left:V??""},listContent:O,listItemsRef:F,listboxId:S,role:i,state:{activeIndex:N,setActiveIndex:D,selectedIndex:$,setSelectedIndex:e=>{if("none"!==_){const t=[...T.values()][e];t&&P(t.value)}},selectionMode:_,selectedValues:M,selectValues:P,inputValue:A,setInputValue:k,isOpen:R,setIsOpen:L,setActiveCollection:I}}}let b_=null,w_=new Set,x_=new Map,C_=!1,__=!1;function S_(e,t){for(let n of w_)n(e,t)}function A_(e){C_=!0,function(e){return!(e.metaKey||!ow()&&e.altKey||e.ctrlKey||"Control"===e.key||"Shift"===e.key||"Meta"===e.key)}(e)&&(b_="keyboard",S_("keyboard",e))}function k_(e){b_="pointer",("mousedown"===e.type||"pointerdown"===e.type)&&(C_=!0,S_("pointer",e))}function E_(e){(function(e){return!(0!==e.mozInputSource||!e.isTrusted)||(function(e){var t;return!(typeof window>"u"||null==window.navigator)&&((null===(t=window.navigator.userAgentData)||void 0===t?void 0:t.brands.some(t=>e.test(t.brand)))||e.test(window.navigator.userAgent))}(/Android/i)&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)})(e)&&(C_=!0,b_="virtual")}function I_(e){e.target===window||e.target===document||(!C_&&!__&&(b_="virtual",S_("virtual",e)),C_=!1,__=!1)}function j_(){C_=!1,__=!0}function T_(e){if(typeof window>"u"||x_.get(tw(e)))return;const t=tw(e),n=ew(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){C_=!0,r.apply(this,arguments)},n.addEventListener("keydown",A_,!0),n.addEventListener("keyup",A_,!0),n.addEventListener("click",E_,!0),t.addEventListener("focus",I_,!0),t.addEventListener("blur",j_,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",k_,!0),n.addEventListener("pointermove",k_,!0),n.addEventListener("pointerup",k_,!0)):(n.addEventListener("mousedown",k_,!0),n.addEventListener("mousemove",k_,!0),n.addEventListener("mouseup",k_,!0)),t.addEventListener("beforeunload",()=>{F_(e)},{once:!0}),x_.set(t,{focus:r})}const F_=(e,t)=>{const n=tw(e),r=ew(e);t&&r.removeEventListener("DOMContentLoaded",t),x_.has(n)&&(n.HTMLElement.prototype.focus=x_.get(n).focus,r.removeEventListener("keydown",A_,!0),r.removeEventListener("keyup",A_,!0),r.removeEventListener("click",E_,!0),n.removeEventListener("focus",I_,!0),n.removeEventListener("blur",j_,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",k_,!0),r.removeEventListener("pointermove",k_,!0),r.removeEventListener("pointerup",k_,!0)):(r.removeEventListener("mousedown",k_,!0),r.removeEventListener("mousemove",k_,!0),r.removeEventListener("mouseup",k_,!0)),x_.delete(n))};function O_(e,t){return"#comment"!==e.nodeName&&function(e){const t=tw(e);if(!(e instanceof t.HTMLElement||e instanceof t.SVGElement))return!1;let{display:n,visibility:r}=e.style,i="none"!==n&&"hidden"!==r&&"collapse"!==r;if(i){const{getComputedStyle:t}=e.ownerDocument.defaultView;let{display:n,visibility:r}=t(e);i="none"!==n&&"hidden"!==r&&"collapse"!==r}return i}(e)&&function(e,t){return!e.hasAttribute("hidden")&&!e.hasAttribute("data-react-aria-prevent-focus")&&("DETAILS"!==e.nodeName||!t||"SUMMARY"===t.nodeName||e.hasAttribute("open"))}(e,t)&&(!e.parentElement||O_(e.parentElement,e))}typeof document<"u"&&function(e){const t=ew(e);let n;"loading"!==t.readyState?T_(e):(n=()=>{T_(e)},t.addEventListener("DOMContentLoaded",n))}();const M_=o.createContext(null);let P_=null;function R_(e){let{children:t,contain:n,restoreFocus:r,autoFocus:i}=e,a=(0,o.useRef)(null),s=(0,o.useRef)(null),l=(0,o.useRef)([]),{parentNode:c}=(0,o.useContext)(M_)||{},u=(0,o.useMemo)(()=>new X_({scopeRef:l}),[l]);$b(()=>{let e=c||K_.root;if(K_.getTreeNode(e.scopeRef)&&P_&&!W_(P_,e.scopeRef)){let t=K_.getTreeNode(P_);t&&(e=t)}e.addChild(u),K_.addNode(u)},[u,c]),$b(()=>{let e=K_.getTreeNode(l);e&&(e.contain=!!n)},[n]),$b(()=>{var e;let t=null===(e=a.current)||void 0===e?void 0:e.nextSibling,n=[];for(;t&&t!==s.current;)n.push(t),t=t.nextSibling;l.current=n},[t]),function(e,t,n){$b(()=>{if(t||n)return;let r=e.current;const i=ew(r?r[0]:void 0);let o=t=>{let n=t.target;V_(n,e.current)?P_=e:U_(n)||(P_=null)};return i.addEventListener("focusin",o,!1),null==r||r.forEach(e=>e.addEventListener("focusin",o,!1)),()=>{i.removeEventListener("focusin",o,!1),null==r||r.forEach(e=>e.removeEventListener("focusin",o,!1))}},[e,t,n])}(l,r,n),function(e,t){let n=(0,o.useRef)(),r=(0,o.useRef)();$b(()=>{let i=e.current;if(!t)return void(r.current&&(cancelAnimationFrame(r.current),r.current=void 0));const o=ew(i?i[0]:void 0);let a=t=>{if("Tab"!==t.key||t.altKey||t.ctrlKey||t.metaKey||!B_(e)||t.isComposing)return;let n=o.activeElement,r=e.current;if(!r||!V_(n,r))return;let i=q_(z_(r),{tabbable:!0},r);if(!n)return;i.currentNode=n;let a=t.shiftKey?i.previousNode():i.nextNode();a||(i.currentNode=t.shiftKey?r[r.length-1].nextElementSibling:r[0].previousElementSibling,a=t.shiftKey?i.previousNode():i.nextNode()),t.preventDefault(),a&&$_(a,!0)},s=t=>{P_&&!W_(P_,e)||!V_(t.target,e.current)?B_(e)&&!H_(t.target,e)?n.current?n.current.focus():P_&&P_.current&&G_(P_.current):B_(e)&&(n.current=t.target):(P_=e,n.current=t.target)},l=t=>{r.current&&cancelAnimationFrame(r.current),r.current=requestAnimationFrame(()=>{if(o.activeElement&&B_(e)&&!H_(o.activeElement,e))if(P_=e,o.body.contains(t.target)){var r;n.current=t.target,null===(r=n.current)||void 0===r||r.focus()}else P_.current&&G_(P_.current)})};return o.addEventListener("keydown",a,!1),o.addEventListener("focusin",s,!1),null==i||i.forEach(e=>e.addEventListener("focusin",s,!1)),null==i||i.forEach(e=>e.addEventListener("focusout",l,!1)),()=>{o.removeEventListener("keydown",a,!1),o.removeEventListener("focusin",s,!1),null==i||i.forEach(e=>e.removeEventListener("focusin",s,!1)),null==i||i.forEach(e=>e.removeEventListener("focusout",l,!1))}},[e,t]),$b(()=>()=>{r.current&&cancelAnimationFrame(r.current)},[r])}(l,n),function(e,t,n){const r=(0,o.useRef)(typeof document<"u"?ew(e.current?e.current[0]:void 0).activeElement:null);$b(()=>{let r=e.current;const i=ew(r?r[0]:void 0);if(!t||n)return;let o=()=>{(!P_||W_(P_,e))&&V_(i.activeElement,e.current)&&(P_=e)};return i.addEventListener("focusin",o,!1),null==r||r.forEach(e=>e.addEventListener("focusin",o,!1)),()=>{i.removeEventListener("focusin",o,!1),null==r||r.forEach(e=>e.removeEventListener("focusin",o,!1))}},[e,n]),$b(()=>{const r=ew(e.current?e.current[0]:void 0);if(!t)return;let i=t=>{if("Tab"!==t.key||t.altKey||t.ctrlKey||t.metaKey||!B_(e)||t.isComposing)return;let n=r.activeElement;if(!V_(n,e.current))return;let i=K_.getTreeNode(e);if(!i)return;let o=i.nodeToRestore,a=q_(r.body,{tabbable:!0});a.currentNode=n;let s=t.shiftKey?a.previousNode():a.nextNode();if((!o||!r.body.contains(o)||o===r.body)&&(o=void 0,i.nodeToRestore=void 0),(!s||!V_(s,e.current))&&o){a.currentNode=o;do{s=t.shiftKey?a.previousNode():a.nextNode()}while(V_(s,e.current));t.preventDefault(),t.stopPropagation(),s?$_(s,!0):U_(o)?$_(o,!0):n.blur()}};return n||r.addEventListener("keydown",i,!0),()=>{n||r.removeEventListener("keydown",i,!0)}},[e,t,n]),$b(()=>{const n=ew(e.current?e.current[0]:void 0);if(!t)return;let i=K_.getTreeNode(e);var o;return i?(i.nodeToRestore=null!==(o=r.current)&&void 0!==o?o:void 0,()=>{let r=K_.getTreeNode(e);if(!r)return;let i=r.nodeToRestore;if(t&&i&&(V_(n.activeElement,e.current)||n.activeElement===n.body&&function(e){let t=K_.getTreeNode(P_);for(;t&&t.scopeRef!==e;){if(t.nodeToRestore)return!1;t=t.parent}return(null==t?void 0:t.scopeRef)===e}(e))){let t=K_.clone();requestAnimationFrame(()=>{if(n.activeElement===n.body){let n=t.getTreeNode(e);for(;n;){if(n.nodeToRestore&&n.nodeToRestore.isConnected)return void $_(n.nodeToRestore);n=n.parent}for(n=t.getTreeNode(e);n;){if(n.scopeRef&&n.scopeRef.current&&K_.getTreeNode(n.scopeRef))return void G_(n.scopeRef.current,!0);n=n.parent}}})}}):void 0},[e,t])}(l,r,n),function(e,t){const n=o.useRef(t);(0,o.useEffect)(()=>{n.current&&(P_=e,!V_(ew(e.current?e.current[0]:void 0).activeElement,P_.current)&&e.current&&G_(e.current)),n.current=!1},[e])}(l,i),(0,o.useEffect)(()=>{const e=ew(l.current?l.current[0]:void 0).activeElement;let t=null;if(V_(e,l.current)){for(let n of K_.traverse())n.scopeRef&&V_(e,n.scopeRef.current)&&(t=n);t===K_.getTreeNode(l)&&(P_=t.scopeRef)}},[l]),$b(()=>()=>{var e,t,n;let r=null!==(n=null===(t=K_.getTreeNode(l))||void 0===t||null===(e=t.parent)||void 0===e?void 0:e.scopeRef)&&void 0!==n?n:null;(l===P_||W_(l,P_))&&(!r||K_.getTreeNode(r))&&(P_=r),K_.removeTreeNode(l)},[l]);let d=(0,o.useMemo)(()=>function(e){return{focusNext(t={}){let n=e.current,{from:r,tabbable:i,wrap:o,accept:a}=t,s=r||ew(n[0]).activeElement,l=n[0].previousElementSibling,c=q_(z_(n),{tabbable:i,accept:a},n);c.currentNode=V_(s,n)?s:l;let u=c.nextNode();return!u&&o&&(c.currentNode=l,u=c.nextNode()),u&&$_(u,!0),u},focusPrevious(t={}){let n=e.current,{from:r,tabbable:i,wrap:o,accept:a}=t,s=r||ew(n[0]).activeElement,l=n[n.length-1].nextElementSibling,c=q_(z_(n),{tabbable:i,accept:a},n);c.currentNode=V_(s,n)?s:l;let u=c.previousNode();return!u&&o&&(c.currentNode=l,u=c.previousNode()),u&&$_(u,!0),u},focusFirst(t={}){let n=e.current,{tabbable:r,accept:i}=t,o=q_(z_(n),{tabbable:r,accept:i},n);o.currentNode=n[0].previousElementSibling;let a=o.nextNode();return a&&$_(a,!0),a},focusLast(t={}){let n=e.current,{tabbable:r,accept:i}=t,o=q_(z_(n),{tabbable:r,accept:i},n);o.currentNode=n[n.length-1].nextElementSibling;let a=o.previousNode();return a&&$_(a,!0),a}}}(l),[]),h=(0,o.useMemo)(()=>({focusManager:d,parentNode:u}),[u,d]);return o.createElement(M_.Provider,{value:h},o.createElement("span",{"data-focus-scope-start":!0,hidden:!0,ref:a}),t,o.createElement("span",{"data-focus-scope-end":!0,hidden:!0,ref:s}))}const L_=["input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[contenteditable]"],N_=L_.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])";L_.push('[tabindex]:not([tabindex="-1"]):not([disabled])');const D_=L_.join(':not([hidden]):not([tabindex="-1"]),');function z_(e){return e[0].parentElement}function B_(e){let t=K_.getTreeNode(P_);for(;t&&t.scopeRef!==e;){if(t.contain)return!1;t=t.parent}return!0}function U_(e){return H_(e)}function V_(e,t){return!(!e||!t)&&t.some(t=>t.contains(e))}function H_(e,t=null){if(e instanceof Element&&e.closest("[data-react-aria-top-layer]"))return!0;for(let{scopeRef:n}of K_.traverse(K_.getTreeNode(t)))if(n&&V_(e,n.current))return!0;return!1}function W_(e,t){var n;let r=null===(n=K_.getTreeNode(t))||void 0===n?void 0:n.parent;for(;r;){if(r.scopeRef===e)return!0;r=r.parent}return!1}function $_(e,t=!1){if(null==e||t){if(null!=e)try{e.focus()}catch{}}else try{!function(e){const t=ew(e);if("virtual"===b_){let n=t.activeElement;!function(e){requestAnimationFrame(()=>{0===aw.size?e():sw.add(e)})}(()=>{t.activeElement===n&&e.isConnected&&rw(e)})}else rw(e)}(e)}catch{}}function G_(e,t=!0){let n=e[0].previousElementSibling,r=z_(e),i=q_(r,{tabbable:t},e);i.currentNode=n;let o=i.nextNode();t&&!o&&(r=z_(e),i=q_(r,{tabbable:!1},e),i.currentNode=n,o=i.nextNode()),$_(o)}function q_(e,t,n){let r=null!=t&&t.tabbable?D_:N_,i=ew(e).createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(e){var i;return null!=t&&null!==(i=t.from)&&void 0!==i&&i.contains(e)?NodeFilter.FILTER_REJECT:!e.matches(r)||!O_(e)||n&&!V_(e,n)||null!=t&&t.accept&&!t.accept(e)?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT}});return null!=t&&t.from&&(i.currentNode=t.from),i}class Y_{get size(){return this.fastMap.size}getTreeNode(e){return this.fastMap.get(e)}addTreeNode(e,t,n){let r=this.fastMap.get(t??null);if(!r)return;let i=new X_({scopeRef:e});r.addChild(i),i.parent=r,this.fastMap.set(e,i),n&&(i.nodeToRestore=n)}addNode(e){this.fastMap.set(e.scopeRef,e)}removeTreeNode(e){if(null===e)return;let t=this.fastMap.get(e);if(!t)return;let n=t.parent;for(let i of this.traverse())i!==t&&t.nodeToRestore&&i.nodeToRestore&&t.scopeRef&&t.scopeRef.current&&V_(i.nodeToRestore,t.scopeRef.current)&&(i.nodeToRestore=t.nodeToRestore);let r=t.children;n&&(n.removeChild(t),r.size>0&&r.forEach(e=>n&&n.addChild(e))),this.fastMap.delete(t.scopeRef)}*traverse(e=this.root){if(null!=e.scopeRef&&(yield e),e.children.size>0)for(let t of e.children)yield*this.traverse(t)}clone(){var e;let t=new Y_;var n;for(let r of this.traverse())t.addTreeNode(r.scopeRef,null!==(n=null===(e=r.parent)||void 0===e?void 0:e.scopeRef)&&void 0!==n?n:null,r.nodeToRestore);return t}constructor(){this.fastMap=new Map,this.root=new X_({scopeRef:null}),this.fastMap.set(null,this.root)}}class X_{addChild(e){this.children.add(e),e.parent=this}removeChild(e){this.children.delete(e),e.parent=void 0}constructor(e){this.children=new Set,this.contain=!1,this.scopeRef=e.scopeRef}}let K_=new Y_;function Z_(){const{width:e,height:t}=function(){let e=Kb(),[t,n]=(0,o.useState)(()=>e?{width:0,height:0}:hw());return(0,o.useEffect)(()=>{let e=()=>{n(e=>{let t=hw();return t.width===e.width&&t.height===e.height?e:t})};return dw?dw.addEventListener("resize",e):window.addEventListener("resize",e),()=>{dw?dw.removeEventListener("resize",e):window.removeEventListener("resize",e)}},[]),t}();return{"--be-viewport-height":`${t}px`,"--be-viewport-width":`${e}px`}}const J_={initial:{opacity:0,y:5},animate:{opacity:1,y:0},exit:{opacity:0,y:5},transition:{type:"tween",duration:.125}},Q_=(0,o.forwardRef)(({children:e,style:t,autoFocus:n=!1,restoreFocus:r=!0,isDismissable:a,isContextMenu:s,isOpen:l,onClose:c,triggerRef:u,arrowRef:d,arrowStyle:h,onPointerLeave:f,onPointerEnter:p},g)=>{const m=Z_(),v=uw(g),{domProps:y}=function({onClose:e,isDismissable:t=!0,triggerRef:n,isContextMenu:r=!1},i){const a=(0,o.useRef)({isPointerDown:!1,isContextMenu:r,onClose:e}),s=a.current;s.isContextMenu=r,s.onClose=e;const l=(0,o.useCallback)(e=>{const t=e.target;if(t){const e=t.ownerDocument;if(!e||!e.documentElement.contains(t))return!1}return i.current&&!i.current.contains(t)},[i]),c=(0,o.useCallback)(()=>eS[eS.length-1]===i,[i]),u=(0,o.useCallback)(()=>{c()&&s.onClose()},[c,s]),d=(0,o.useCallback)(e=>{var t,r;return!(!n.current||!("contains"in n.current))&&(null==(r=(t=n.current).contains)?void 0:r.call(t,e))},[n]),h=(0,o.useCallback)(e=>{d(e.target)||c()&&(e.stopPropagation(),e.preventDefault())},[d,c]),f=(0,o.useCallback)(e=>{d(e.target)||(c()&&(e.stopPropagation(),e.preventDefault()),(!s.isContextMenu||2!==e.button)&&u())},[d,u,s,c]);return(0,o.useEffect)(()=>{eS.push(i);const e=e=>{l(e)&&(h(e),a.current.isPointerDown=!0)},t=e=>{a.current.isPointerDown&&l(e)&&(a.current.isPointerDown=!1,f(e))},r=e=>{e.preventDefault(),l(e)&&u()},o=e=>{if(!n.current)return;const t=e.target;let r;n.current instanceof Node?r=n.current:"contextElement"in n.current&&(r=n.current.contextElement),(!(t instanceof Node)||!r||t.contains(r))&&s.onClose()};return document.addEventListener("pointerdown",e,!0),document.addEventListener("pointerup",t,!0),document.addEventListener("contextmenu",r,!0),document.addEventListener("scroll",o,!0),()=>{const n=eS.indexOf(i);n>=0&&eS.splice(n,1),document.removeEventListener("pointerdown",e,!0),document.removeEventListener("pointerup",t,!0),document.removeEventListener("contextmenu",r,!0),document.removeEventListener("scroll",o,!0)}},[i,l,s,f,h,n,d,u]),{domProps:{onKeyDown:e=>{"Escape"===e.key&&(e.stopPropagation(),e.preventDefault(),u())}}}}({isDismissable:a,onClose:c,triggerRef:u,isContextMenu:s},v);return(0,i.jsx)(Pb.div,{className:"isolate z-popover",role:"presentation",ref:v,style:{...m,...t,position:"fixed"},...J_,...nw(y,{onPointerLeave:f,onPointerEnter:p}),children:(0,i.jsx)(R_,{restoreFocus:r,autoFocus:n,contain:!1,children:e})})}),eS=[],tS={initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2}};function nS({position:e="absolute",className:t,isTransparent:n=!1,disableInitialTransition:r,...o}){return(0,i.jsx)(Pb.div,{...o,className:Pd(t,!n&&"bg-background/80","inset-0 z-10 h-full w-full",e,"backdrop-blur-sm"),"aria-hidden":!0,initial:r?void 0:{opacity:0},animate:{opacity:1},exit:{opacity:0},...tS,transition:{duration:.15}})}const rS=(0,o.forwardRef)(({children:e,autoFocus:t=!1,restoreFocus:n=!0,isDismissable:r,isOpen:o,onClose:a},s)=>{const l=Z_(),c=uw(s);return(0,i.jsxs)("div",{className:"fixed inset-0 isolate z-tray",style:l,children:[(0,i.jsx)(nS,{onClick:()=>{r&&a()}},"tray-underlay"),(0,i.jsx)(Pb.div,{ref:c,className:"absolute bottom-0 left-0 right-0 z-20 mx-auto max-h-tray w-full max-w-375 overflow-hidden rounded-t pb-safe-area",role:"presentation",initial:{opacity:0,y:"100%"},animate:{opacity:1,y:0},exit:{opacity:0,y:"100%"},transition:{type:"tween",duration:.2},children:(0,i.jsx)(R_,{restoreFocus:n,autoFocus:t,contain:!0,children:e})})]})});function iS(e,t){if(e===t)return!0;if(!e||!t)return!1;const n=Object.keys(e),r=Object.keys(t),i=n.length;if(r.length!==i)return!1;for(let o=0;o<i;o++){const r=n[o];if(e[r]!==t[r]||!Object.prototype.hasOwnProperty.call(t,r))return!1}return!0}function oS(){const{i18n:e}=Vp(e=>e.data);return{locale:e,localeCode:(null==e?void 0:e.language)||"en",lines:null==e?void 0:e.lines}}function aS(e,{message:t,values:n}){const r=t.match(/\[(.+?)]/),i=null==n?void 0:n.count;if(r&&r[1]&&!Number.isNaN(i)){const[n,o]=r,a=o.split("|");if(!a.length)return t;const s=sS(e).select(i);let l=a.find(e=>e.startsWith(s));l||(l=a[0]);const c=l.substring(l.indexOf(" ")+1);return t.replace(n,c)}return t}const sS=Qx(e=>new Intl.PluralRules(e));function lS(e,t){return null!=e&&(void 0!==Object.hasOwn?Object.hasOwn(e,t):Object.hasOwnProperty(t))}const cS=(0,o.memo)(e=>{const{message:t,values:n}=e,{lines:r,localeCode:a}=oS();let s;if(s=lS(r,t)?null==r?void 0:r[t]:lS(r,null==t?void 0:t.toLowerCase())?null==r?void 0:r[null==t?void 0:t.toLowerCase()]:t,!n||!s)return(0,i.jsx)(o.Fragment,{children:s});s=aS(a,{message:s,values:n});const l=[],c=[];if(Object.entries(n).forEach(([e,t])=>{"function"==typeof t?c.push(e):(0,o.isValidElement)(t)?l.push(e):null!=t&&(s=null==s?void 0:s.replace(`:${e}`,`${t}`))}),c.length||l.length){const e=[];if(c.length){const t=c.join("");e.push(`(<[${t}]>.+?<\\/[${t}]>)`)}if(l.length){const t=l.join("|");e.push(`(:(?:${t}))`)}const t=new RegExp(e.join("|"),"gm"),r=s.split(t).filter(Boolean).map((e,t)=>{if(e.startsWith("<")&&e.endsWith(">")){const r=e.match(/<([a-z]+)>(.+?)<\/([a-z]+)>/);if(r){const[,e,i]=r,a=null==n?void 0:n[e];if("function"==typeof a){const e=a(i);return(0,o.cloneElement)(e,{key:t})}}}if(e.startsWith(":")){const r=e.replace(":",""),i=null==n?void 0:n[r];if((0,o.isValidElement)(i))return(0,o.cloneElement)(i,{key:t})}return e});return(0,i.jsx)(o.Fragment,{children:r})}return(0,i.jsx)(o.Fragment,{children:s})},function(e,t){const{values:n,...r}=e,{values:i,...o}=t;return iS(i,n)&&iS(r,o)});function uS({listbox:e,children:t,isLoading:n,mobileOverlay:r=rS,searchField:a,onClose:s,prepend:l,className:c,...u}){const d=Kb()||typeof window>"u"?Vp.getState().data.is_mobile_device??!1:window.screen.width<=768,{floatingWidth:h,floatingMinWidth:f="min-w-180",collection:p,showEmptyMessage:g,state:{isOpen:m,setIsOpen:v},positionStyle:y,floating:b,refs:w}=e,x=!l&&d?r:Q_,C=Pd("text-base sm:text-sm outline-none bg max-h-inherit flex flex-col",!l&&"shadow-xl border py-4",c,x===Q_&&"rounded-panel",x===Q_&&"auto"===h?`max-w-288 ${f}`:""),_=(0,o.useMemo)(()=>{let e=0;const t=[];return[...p.values()].reduce((n,r)=>{if(r.section){if(!t.includes(r.section)){const i=(0,o.cloneElement)(r.section,{key:r.section.key||e,index:e});n.push(i),t.push(r.section),e++}}else n.push((0,o.cloneElement)(r.element,{key:r.element.key||r.element.props.value}));return n},[])},[p]),S=_.length>0||g&&!n,A=S?(0,i.jsxs)("div",{className:C,role:"presentation",children:[a,(0,i.jsx)(dS,{isLoading:n,...u,children:_})]}):null;return(0,i.jsxs)(Gx.Provider,{value:e,children:[t,l?A:Bp&&(0,de.createPortal)((0,i.jsx)(Ub,{children:m&&S&&(0,i.jsx)(x,{triggerRef:w.reference,restoreFocus:!0,isOpen:m,onClose:()=>{null==s||s(),v(!1)},isDismissable:!0,style:y,ref:b,children:A})}),Bp)]})}function dS({className:e,children:t,isLoading:n,...r}){const{role:a,listboxId:s,virtualFocus:l,focusItem:c,state:{activeIndex:u,setActiveIndex:d,selectedIndex:h}}=qx(),f=(0,o.useRef)(!0),p=(0,o.useRef)(null);return(0,o.useEffect)(()=>()=>d(null),[d]),(0,o.useEffect)(()=>{if(f.current){const e=u??h;null!=e||l?null!=e&&requestAnimationFrame(()=>{c("increment",e)}):requestAnimationFrame(()=>{var e;null==(e=p.current)||e.focus({preventScroll:!0})})}f.current=!1},[u,h,c,l]),(0,i.jsx)("div",{tabIndex:l?void 0:-1,role:a,id:s,className:"flex-auto overflow-y-auto overscroll-contain outline-none",ref:p,...r,children:t.length?t:(0,i.jsx)(hS,{})})}function hS(){return(0,i.jsx)("div",{className:"px-8 py-4 text-sm italic text-muted",children:(0,i.jsx)(cS,{message:"There are no items matching your query"})})}function fS({state:{isOpen:e,setIsOpen:t,selectedIndex:n,activeIndex:r,setInputValue:i,setActiveIndex:o},focusLoopingMode:a,collection:s,focusItem:l,handleItemSelection:c,allowCustomValue:u}){const d=r=>{if(!e&&r.currentTarget.contains(r.target)){if("ArrowDown"===r.key)return r.preventDefault(),t(!0),l("increment",n??0),!0;if("ArrowUp"===r.key)return r.preventDefault(),t(!0),l("decrement",n??s.size-1),!0;if("Enter"===r.key||"Space"===r.key)return r.preventDefault(),t(!0),l("increment",n??0),!0}},h=n=>{const i=Math.max(0,s.size-1);if(e&&n.currentTarget.contains(n.target))switch(n.key){case"ArrowDown":return n.preventDefault(),null==r?l("increment",0):r>=i?"loop"===a?l("increment",0):"deselect"===a&&o(null):l("increment",r+1),!0;case"ArrowUp":return n.preventDefault(),null==r?l("decrement",i):r<=0?"loop"===a?l("decrement",i):"deselect"===a&&o(null):l("decrement",r-1),!0;case"Home":return n.preventDefault(),l("increment",0),!0;case"End":return n.preventDefault(),l("decrement",i),!0;case"Tab":return t(!1),!0}};return{handleTriggerKeyDown:d,handleListboxKeyboardNavigation:h,handleListboxSearchFieldKeydown:n=>{var o,a;if("Enter"===n.key&&null!=r&&s.size){n.preventDefault();const[e,t]=[...s.entries()][r];return void(e&&(c(e),null==(a=(o=t.element.props).onSelected)||a.call(o)))}"Escape"===n.key&&e&&(t(!1),u||i("")),d(n)||h(n)}}}const pS=new Map;function gS(){const e=function(e){const{localeCode:t}=oS(),n=t+(e?Object.entries(e).sort((e,t)=>e[0]<t[0]?-1:1).join():"");if(pS.has(n))return pS.get(n);const r=new Intl.Collator(t,e);return pS.set(n,r),r}({usage:"search",sensitivity:"base"}),t=(0,o.useRef)({search:"",timeout:void 0}).current,n=(n,r)=>{let i=r??0;for(;null!=i;){const r=n[i],o=null==r?void 0:r.slice(0,t.search.length);if(o&&0===e.compare(o,t.search))return i;if(!(i<n.length-1))return null;i++}return null};return{findMatchingItem:(e,r,i=0)=>{const o=function(e){return 1!==e.length&&/^[A-Z]/i.test(e)?"":e}(e.key);if(!o||e.ctrlKey||e.metaKey)return null;" "===o&&t.search.trim().length>0&&(e.preventDefault(),e.stopPropagation()),t.search+=o;let a=n(r,i);return null==a&&(a=n(r,0)),clearTimeout(t.timeout),t.timeout=setTimeout(()=>{t.search=""},500),a??null}}}function mS(e){return function(e,{noSSR:t}={noSSR:!0}){const n=typeof window<"u"&&"function"==typeof window.matchMedia,[r,i]=(0,o.useState)(t?()=>!!n&&window.matchMedia(e).matches:null);return(0,o.useEffect)(()=>{if(!n)return;const r=window.matchMedia(e),o=()=>{i(r.matches)};return r.addEventListener("change",o),t||o(),()=>{r.removeEventListener("change",o)}},[n,e,t]),typeof window>"u"?null:r}("(max-width: 768px)",e)}const vS=Nd((0,i.jsx)("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),"SearchOutlined");var yS=e=>null==e,bS=e=>!yS(e)&&!Array.isArray(e)&&(e=>"object"==typeof e)(e)&&!(e=>e instanceof Date)(e),wS=e=>bS(e)&&e.target?(e=>"checkbox"===e.type)(e.target)?e.target.checked:e.target.value:e,xS=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function CS(e){let t;const n=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else{if(xS&&(e instanceof Blob||e instanceof FileList)||!n&&!bS(e))return e;if(t=n?[]:{},n||(e=>{const t=e.constructor&&e.constructor.prototype;return bS(t)&&t.hasOwnProperty("isPrototypeOf")})(e))for(const n in e)e.hasOwnProperty(n)&&(t[n]=CS(e[n]));else t=e}return t}var _S=e=>Array.isArray(e)?e.filter(Boolean):[],SS=e=>void 0===e,AS=(e,t,n)=>{if(!t||!bS(e))return n;const r=_S(t.split(/[,[\].]+?/)).reduce((e,t)=>yS(e)?e:e[t],e);return SS(r)||r===e?SS(e[t])?n:e[t]:r},kS=e=>"boolean"==typeof e,ES=(e,t,n)=>{let r=-1;const i=(e=>/^\w*$/.test(e))(t)?[t]:(e=>_S(e.replace(/["|']|\]/g,"").split(/\.|\[/)))(t),o=i.length,a=o-1;for(;++r<o;){const t=i[r];let o=n;if(r!==a){const n=e[t];o=bS(n)||Array.isArray(n)?n:isNaN(+i[r+1])?{}:[]}if("__proto__"===t)return;e[t]=o,e=e[t]}return e};const IS=o.createContext(null),jS=()=>o.useContext(IS);var TS=(e,t,n)=>!e||!t||e===t||(e=>Array.isArray(e)?e:[e])(e).some(e=>e&&(n?e===t:e.startsWith(t)||t.startsWith(e)));function FS(e){const t=o.useRef(e);t.current=e,o.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}function OS(e){const t=jS(),{control:n=t.control,disabled:r,name:i,exact:a}=e||{},[s,l]=o.useState(n._formState),c=o.useRef(!0),u=o.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),d=o.useRef(i);return d.current=i,FS({disabled:r,next:e=>c.current&&TS(d.current,e.name,a)&&((e,t,n)=>{n(e);const{name:r,...i}=e;return(e=>bS(e)&&!Object.keys(e).length)(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(e=>!0===t[e])})(e,u.current,n._updateFormState)&&l({...n._formState,...e}),subject:n._subjects.state}),o.useEffect(()=>(c.current=!0,u.current.isValid&&n._updateValid(!0),()=>{c.current=!1}),[n]),((e,t,n,r=!0)=>{const i={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(i,o,{get:()=>{const i=o;return"all"!==t._proxyFormState[i]&&(t._proxyFormState[i]=!r||"all"),n&&(n[i]=!0),e[i]}});return i})(s,n,u.current,!1)}function MS(e={}){const{size:t="md",startAppend:n,endAppend:r,className:i,labelPosition:o,labelDisplay:a="block",inputClassName:s,inputWrapperClassName:l,unstyled:c,invalid:u,disabled:d,background:h="bg-transparent",flexibleHeight:f,inputShadow:p="shadow-sm",descriptionPosition:g="bottom",inputRing:m,inputFontSize:v,labelSuffix:y}={...e};if(c)return{label:"",input:s||"",wrapper:i||"",inputWrapper:l||"",adornment:"",append:{size:"",radius:""},size:{font:"",height:""},description:"",error:""};const b=function({size:e,flexibleHeight:t}){switch(e){case"2xs":return{font:"text-xs",height:t?"min-h-24":"h-24"};case"xs":return{font:"text-xs",height:t?"min-h-30":"h-30"};case"sm":return{font:"text-sm",height:t?"min-h-36":"h-36"};case"lg":return{font:"text-md md:text-lg",height:t?"min-h-50":"h-50"};case"xl":return{font:"text-xl",height:t?"min-h-60":"h-60"};default:return{font:"text-sm",height:t?"min-h-42":"h-42"}}}({size:e.size,flexibleHeight:f});v&&(b.font=v);const w=n||r,x=m||"focus:ring "+(u?"focus:ring-danger/focus focus:border-danger/60":"focus:ring-primary/focus focus:border-primary/60"),C=function(e){const{startAppend:t,endAppend:n,inputRadius:r}=e,i=t||n;return"rounded-full"===r?{input:Pd(!i&&"rounded-full",t&&"rounded-r-full rounded-l-none",n&&"rounded-l-full rounded-r-none"),append:t?"rounded-l-full":"rounded-r-full"}:"rounded-none"===r?{input:"",append:""}:r?{input:r,append:r}:{input:Pd(!i&&"rounded-input",t&&"rounded-r-input rounded-l-none",n&&"rounded-l-input rounded-r-none"),append:t?"rounded-l-input":"rounded-r-input"}}(e);return{label:Pd(a,"first-letter:capitalize text-left whitespace-nowrap",d&&"text-disabled",b.font,y?"":"side"===o?"mr-16":"mb-4"),input:Pd("block text-left relative w-full appearance-none transition-shadow text",h,C.input,PS(e),!d&&`${x} focus:outline-none ${p}`,d&&"text-disabled cursor-not-allowed",s,b.font,b.height,RS(e)),adornment:LS(t),append:{size:Bx(t),radius:C.append},wrapper:Pd(i,b.font,{"flex items-center":"side"===o}),inputWrapper:Pd("isolate relative",l,w&&"flex items-stretch"),size:b,description:`text-muted ${"bottom"===g?"pt-10":"pb-10"} text-xs`,error:"text-danger pt-10 text-xs"}}function PS({startAppend:e,endAppend:t,inputBorder:n,invalid:r}){if(n)return n;const i=r?"border-danger":"border-divider";return e||t?e?`${i} border-y border-r`:`${i} border-y border-l`:`${i} border`}function RS({startAdornment:e,endAdornment:t,inputRadius:n}){return"rounded-full"===n?Pd(e?"pl-54":"pl-28",t?"pr-54":"pr-28"):Pd(e?"pl-46":"pl-12",t?"pr-46":"pr-12")}function LS(e){switch(e){case"2xs":return"icon-2xs";case"xs":return"icon-xs";case"sm":case"md":return"icon-sm";case"lg":return"icon-lg";case"xl":return"icon-xl";default:return""}}function NS({children:e,direction:t,className:n,position:r=("start"===t?"left-0":"right-0")}){return e?(0,i.jsx)("div",{className:Pd("pointer-events-none absolute top-0 z-10 flex h-full min-w-42 items-center justify-center text-muted",r,n),children:e}):null}function DS(e,t){const n={...e};return Object.keys(n).forEach(e=>{const t=e;(null==n[t]||""===n[t])&&delete n[t]}),n}const zS=o.forwardRef((e,t)=>{const{children:n,description:r,errorMessage:o,descriptionProps:a={},errorMessageProps:s={},startAdornment:l,endAdornment:c,adornmentPosition:u,startAppend:d,endAppend:h,fieldClassNames:f,disabled:p,wrapperProps:g}=e;return(0,i.jsxs)("div",{className:f.wrapper,ref:t,...g,children:[(0,i.jsx)(BS,{...e}),(0,i.jsxs)("div",{className:f.inputWrapper,children:[(0,i.jsx)(NS,{direction:"start",className:f.adornment,position:u,children:l}),d&&(0,i.jsx)(US,{style:f.append,disabled:p,children:d}),n,h&&(0,i.jsx)(US,{style:f.append,disabled:p,children:h}),(0,i.jsx)(NS,{direction:"end",className:f.adornment,position:u,children:c})]}),r&&!o&&(0,i.jsx)("div",{className:f.description,...a,children:r}),o&&(0,i.jsx)("div",{className:f.error,...s,children:o})]})});function BS({labelElementType:e,fieldClassNames:t,labelProps:n,label:r,labelSuffix:o,labelSuffixPosition:a="spaced",required:s}){if(!r)return null;const l=(0,i.jsxs)(e||"label",{className:t.label,...n,children:[r,s&&(0,i.jsx)("span",{className:"text-danger",children:" *"})]});return o?(0,i.jsxs)("div",{className:Pd("mb-4 flex w-full gap-4","spaced"===a?"items-end":"items-center"),children:[l,(0,i.jsx)("div",{className:Pd("text-xs text-muted","spaced"===a?"ml-auto":""),children:o})]}):l}function US({children:e,style:t,disabled:n}){return o.cloneElement(e,{...e.props,disabled:e.props.disabled||n,...DS(t)})}function VS({autoFocus:e,autoSelectText:t},n){const r=(0,o.useRef)(e);(0,o.useEffect)(()=>{r.current&&n.current&&requestAnimationFrame(()=>{var e,r;null==(e=n.current)||e.focus(),t&&"input"===(null==(r=n.current)?void 0:r.nodeName.toLowerCase())&&n.current.select()}),r.current=!1},[n,t])}function HS(e){const{focusRef:t,labelElementType:n="label",label:r,labelSuffix:i,labelSuffixPosition:a,autoFocus:s,autoSelectText:l,labelPosition:c,descriptionPosition:u,size:d,errorMessage:h,description:f,flexibleHeight:p,startAdornment:g,endAdornment:m,startAppend:v,adornmentPosition:y,endAppend:b,className:w,inputClassName:x,inputWrapperClassName:C,unstyled:_,background:S,invalid:A,disabled:k,id:E,inputRadius:I,inputBorder:j,inputShadow:T,inputRing:F,inputFontSize:O,...M}=e;VS(e,t);const P=(0,o.useId)(),R=E||P,L={id:`${R}-label`,htmlFor:"label"===n?R:void 0},N={id:`${R}-description`},D={id:`${R}-error`},z={"aria-label":e.label||e["aria-label"]||!e.placeholder?e["aria-label"]:e.placeholder,"aria-invalid":A||void 0,id:R,disabled:k,...M},B=[];r&&B.push(L.id),z["aria-labelledby"]&&B.push(z["aria-labelledby"]),z["aria-labelledby"]=B.length?B.join(" "):void 0;const U=[];return f&&U.push(N.id),h&&U.push(D.id),z["aria-describedby"]&&U.push(z["aria-describedby"]),z["aria-describedby"]=U.length?U.join(" "):void 0,{fieldProps:{errorMessageProps:D,descriptionProps:N,labelProps:L,disabled:k,label:r,labelSuffix:i,labelSuffixPosition:a,autoFocus:s,autoSelectText:l,labelPosition:c,descriptionPosition:u,size:d,errorMessage:h,description:f,flexibleHeight:p,startAdornment:g,endAdornment:m,startAppend:v,adornmentPosition:y,endAppend:b,className:w,inputClassName:x,inputWrapperClassName:C,unstyled:_,background:S,invalid:A},inputProps:z}}const WS=(0,o.forwardRef)(({inputElementType:e="input",flexibleHeight:t,inputRef:n,inputTestId:r,...o},a)=>{const s=uw(n),{fieldProps:l,inputProps:c}=HS({...o,focusRef:s}),u="textarea"===e,d=u?"textarea":"input",h=MS({...o,flexibleHeight:t||"textarea"===e});return"textarea"===e&&!o.unstyled&&(h.input=`${h.input} py-12`),(0,i.jsx)(zS,{ref:a,fieldClassNames:h,...l,children:(0,i.jsx)(d,{"data-testid":r,ref:s,...c,rows:u?c.rows||4:void 0,className:h.input})})});o.forwardRef(({name:e,...t},n)=>{const{field:{onChange:r,onBlur:a,value:s="",ref:l},fieldState:{invalid:c,error:u}}=function(e){const t=jS(),{name:n,disabled:r,control:i=t.control,shouldUnregister:a}=e,s=((e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)))(i._names.array,n),l=function(e){const t=jS(),{control:n=t.control,name:r,defaultValue:i,disabled:a,exact:s}=e||{},l=o.useRef(r);l.current=r,FS({disabled:a,subject:n._subjects.values,next:e=>{TS(l.current,e.name,s)&&u(CS(((e,t,n,r,i)=>(e=>"string"==typeof e)(e)?AS(n,e,i):Array.isArray(e)?e.map(e=>AS(n,e)):n)(l.current,n._names,e.values||n._formValues,0,i)))}});const[c,u]=o.useState(n._getWatch(r,i));return o.useEffect(()=>n._removeUnmounted()),c}({control:i,name:n,defaultValue:AS(i._formValues,n,AS(i._defaultValues,n,e.defaultValue)),exact:!0}),c=OS({control:i,name:n}),u=o.useRef(i.register(n,{...e.rules,value:l,...kS(e.disabled)?{disabled:e.disabled}:{}}));return o.useEffect(()=>{const e=i._options.shouldUnregister||a,t=(e,t)=>{const n=AS(i._fields,e);n&&(n._f.mount=t)};if(t(n,!0),e){const e=CS(AS(i._options.defaultValues,n));ES(i._defaultValues,n,e),SS(AS(i._formValues,n))&&ES(i._formValues,n,e)}return()=>{(s?e&&!i._state.action:e)?i.unregister(n):t(n,!1)}},[n,i,s,a]),o.useEffect(()=>{AS(i._fields,n)&&i._updateDisabledField({disabled:r,fields:i._fields,name:n,value:AS(i._fields,n)._f.value})},[r,n,i]),{field:{name:n,value:l,...kS(r)||c.disabled?{disabled:c.disabled||r}:{},onChange:o.useCallback(e=>u.current.onChange({target:{value:wS(e),name:n},type:"change"}),[n]),onBlur:o.useCallback(()=>u.current.onBlur({target:{value:AS(i._formValues,n),name:n},type:"blur"}),[n,i]),ref:e=>{const t=AS(i._fields,n);t&&e&&(t._f.ref={focus:()=>e.focus(),select:()=>e.select(),setCustomValidity:t=>e.setCustomValidity(t),reportValidity:()=>e.reportValidity()})}},formState:c,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!AS(c.errors,n)},isDirty:{enumerable:!0,get:()=>!!AS(c.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!AS(c.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!AS(c.validatingFields,n)},error:{enumerable:!0,get:()=>AS(c.errors,n)}})}}({name:e}),d={onChange:r,onBlur:a,value:s??"",invalid:c,errorMessage:null==u?void 0:u.message,inputRef:l,name:e};return(0,i.jsx)(WS,{ref:n,...nw(d,t)})});const $S=(0,o.forwardRef)((e,t)=>{const{searchPlaceholder:n,showSearchField:r,children:[a,s],floatingWidth:l="auto",isLoading:c}=e,u=(0,o.useId)(),d=mS(),h=y_({...e,clearInputOnItemSelection:!0,showEmptyMessage:r,floatingWidth:d?"auto":l,virtualFocus:r,role:r?"listbox":"menu",focusLoopingMode:r?"stay":"loop",children:s.props.children},t),{state:{isOpen:f,setIsOpen:p,activeIndex:g,inputValue:m,setInputValue:v},listboxId:y,focusItem:b,listContent:w,reference:x,onInputChange:C}=h,{handleTriggerKeyDown:_,handleListboxKeyboardNavigation:S,handleListboxSearchFieldKeydown:A}=fS(h),{findMatchingItem:k}=gS();return(0,i.jsx)(uS,{onClick:e=>e.stopPropagation(),listbox:h,onKeyDownCapture:r?void 0:e=>{if(!f)return;const t=k(e,w,g);null!=t&&b("increment",t)},onKeyDown:S,onClose:r?()=>v(""):void 0,"aria-labelledby":u,isLoading:c,searchField:r?(0,i.jsx)(WS,{size:"sm",placeholder:n,startAdornment:(0,i.jsx)(vS,{}),className:"flex-shrink-0 px-8 pb-8 pt-4",autoFocus:!0,"aria-expanded":f?"true":"false","aria-haspopup":"listbox","aria-controls":f?y:void 0,"aria-autocomplete":"list",autoComplete:"off",autoCorrect:"off",spellCheck:"false",value:m,onChange:C,onKeyDown:e=>{A(e)}}):null,children:(0,o.cloneElement)(a,{id:u,"aria-expanded":f?"true":"false","aria-haspopup":"menu","aria-controls":f?y:void 0,ref:x,onKeyDown:_,onClick:Vx(e=>{var t,n;null==(n=null==(t=a.props)?void 0:t.onClick)||n.call(t,e),p(!f)})})})});function GS({children:e}){return e}function qS({item:e,button:t}){return(0,i.jsxs)($S,{children:[t,(0,i.jsx)(GS,{children:(e.menuItems||[]).map(e=>(0,i.jsx)(Zx,{value:e.label,onSelected:()=>{e.action(qp().editor)},children:e.label},e.label))})]})}const YS=(0,o.forwardRef)(({children:e,size:t="md",iconSize:n=(t&&t.length<=3?t:"md"),variant:r="text",radius:a="rounded-button",className:s,padding:l,equalWidth:c=!0,badge:u,...d},h)=>{const f=Pd(Bx(t,{padding:l,equalWidth:c,variant:r}),s,u&&"relative");return(0,i.jsxs)(Hx,{...d,ref:h,radius:a,variant:r,className:f,children:[(0,o.cloneElement)(e,{size:n}),u]})}),XS=o.memo(function({icon:e,className:t,size:n}){let r;return r=o.isValidElement(e)?o.cloneElement(e,{className:"svg-iconEl"}):"string"==typeof e?(0,i.jsx)("img",{className:"w-font h-font",src:e,alt:""}):Array.isArray(e)?o.createElement(Dd(e),{size:n}):o.createElement(e,{size:n}),(0,i.jsx)("span",{className:Pd(t,"leading-none"),children:r})});function KS({value:e}){return e?(0,i.jsx)(cS,"string"==typeof e?{message:e}:{...e}):null}function ZS({item:e}){const t=e.label?(0,i.jsx)(QS,{item:e}):(0,i.jsx)(JS,{item:e});return e.menuItems?(0,i.jsx)(qS,{item:e,button:t}):o.cloneElement(t,{onClick:()=>{var t;null==(t=e.action)||t.call(e,qp().editor)}})}const JS=(0,o.forwardRef)(({item:e,...t},n)=>(0,i.jsx)(YS,{ref:n,radius:"rounded-full",size:"sm",...t,children:(0,i.jsx)(XS,{icon:e.icon})})),QS=(0,o.forwardRef)(({item:e,...t},n)=>(0,i.jsx)(Wx,{ref:n,radius:"rounded-full",size:"xs",color:e.buttonColor||"primary",variant:e.buttonVariant||"flat",startIcon:e.icon&&(0,i.jsx)(XS,{icon:e.icon}),...t,children:(0,i.jsx)(KS,{value:e.label})}));function eA({children:e,color:t,variant:n,radius:r="rounded-button",size:a,className:s,value:l,onChange:c,multiple:u,disabled:d}){const h=o.Children.map(e,(i,s)=>{if(o.isValidElement(i)){const h=(e=>void 0!==l&&(u?l.includes(e):e===l))(i.props.value),f=h?"primary":t;return o.cloneElement(i,{color:h?"primary":t,variant:n,size:a,radius:null,disabled:i.props.disabled||d,...i.props,onClick:e=>{i.props.onClick&&i.props.onClick(e),c&&(u?null==c||c((e=>{const t=[...l],n=l.indexOf(e);return n>-1?t.splice(n,1):t.push(e),t})(i.props.value)):null==c||c(i.props.value))},className:Pd(i.props.className,h?"z-20":"z-10",tA(s,e,r,f))})}});return(0,i.jsx)("div",{className:Pd(r,"isolate inline-flex",s),children:h})}function tA(e,t,n,r){return 0===e?Pd(n,"rounded-tr-none rounded-br-none",!r&&"border-r-transparent disabled:border-r-transparent"):e===t.length-1?Pd(n,"rounded-tl-none rounded-bl-none -ml-1"):Pd("rounded-none -ml-1",!r&&"border-r-transparent disabled:border-r-transparent")}const nA=Nd((0,i.jsx)("path",{d:"M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"}),"UndoOutlined"),rA=Nd((0,i.jsx)("path",{d:"M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16c1.05-3.19 4.05-5.5 7.6-5.5 1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"}),"RedoOutlined");function iA(){const e=Gp(e=>e.history.canUndo),t=Gp(e=>e.history.canRedo);return(0,i.jsxs)(eA,{variant:"outline",children:[(0,i.jsx)(YS,{equalWidth:!1,size:"xs",padding:"pl-12 pr-10",radius:"rounded-full",disabled:!e,onClick:()=>{Yp().history.undo()},children:(0,i.jsx)(nA,{})},"undo"),(0,i.jsx)(YS,{equalWidth:!1,padding:"pl-10 pr-12",size:"xs",radius:"rounded-full",disabled:!t,onClick:()=>{Yp().history.redo()},children:(0,i.jsx)(rA,{})},"redo")]})}const oA=Nd((0,i.jsx)("path",{d:"M19 13H5v-2h14v2z"}),"RemoveOutlined"),aA=Nd((0,i.jsx)("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}),"AddOutlined");function sA(){var e,t;const n=Gp(e=>e.zoom)||1;return Gp(e=>{var t,n;return null==(n=null==(t=e.config.tools)?void 0:t.zoom)?void 0:n.allowUserZoom})??1?(0,i.jsxs)("div",{className:"flex items-center select-none",children:[(0,i.jsx)(YS,{size:"sm",disabled:!(null!=(e=Yp().zoom)&&e.canZoomOut()),onClick:()=>{Yp().zoom.zoomOut(Yp().zoom.step)},children:(0,i.jsx)(oA,{})}),(0,i.jsxs)("div",{className:"w-[4ch] text-sm text-center",children:[Math.round(100*n),"%"]}),(0,i.jsx)(YS,{size:"sm",disabled:!(null!=(t=Yp().zoom)&&t.canZoomIn()),onClick:()=>{Yp().zoom.zoomIn(Yp().zoom.step)},children:(0,i.jsx)(aA,{})})]}):null}function lA({item:e}){switch(e.type){case"undoWidget":return(0,i.jsx)(iA,{});case"zoomWidget":return(0,i.jsx)(sA,{});case"button":return(0,i.jsx)(ZS,{item:e});case"image":return(0,i.jsx)("img",{className:"h-30 object-cover",src:Lw(e.src),alt:""});default:return null}}const cA=Nd((0,i.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"}),"CloseOutlined");function uA(){var e;let t=Gp(e=>{var t;return(null==(t=e.config.ui)?void 0:t.mode)===Sd.OVERLAY});const{width:n}=Gp(e=>e.stageSize),r=n<=700;return r&&null!=(e=qp().config.ui)&&e.forceOverlayModeOnMobile&&(t=!0),{isModal:t,isMobile:r}}function dA(){const{isModal:e,isMobile:t}=uA(),n=Gp(e=>{var t;return null==(t=e.config.ui)?void 0:t.allowEditorClose})??!0,r=Gp(e=>{var t,n;return null==(n=null==(t=e.config.ui)?void 0:t.menubar)?void 0:n.items}),{left:a,center:s,right:l}=(0,o.useMemo)(()=>function(e,t){const n={left:[],center:[],right:[]};(e||[]).filter(e=>!t&&!e.mobileOnly||t&&!e.desktopOnly).forEach(e=>{"left"===e.align?n.left.push({...e,position:e.position??1}):"right"===e.align?n.right.push({...e,position:e.position??1}):n.center.push({...e,position:e.position??1})});const r=Object.entries(n).map(([e,t])=>[e,t.sort((e,t)=>(e.position??0)-(t.position??0))]);return Object.fromEntries(r)}(r||[],t),[r,t]),c=e&&t&&n&&(0,i.jsx)(YS,{size:"sm",className:"ml-10",onClick:()=>{qp().editor.close()},children:(0,i.jsx)(cA,{})});return(0,i.jsxs)(Pb.div,{className:Dx,...zx,children:[(0,i.jsx)("div",{className:"mr-auto flex items-center gap-8",children:a.map((e,t)=>(0,i.jsx)(lA,{item:e},t))}),(0,i.jsx)("div",{className:"flex items-center gap-10",children:s.map((e,t)=>(0,i.jsx)(lA,{item:e},t))}),(0,i.jsx)("div",{className:"ml-auto flex items-center gap-8",children:l.map((e,t)=>(0,i.jsx)(lA,{item:e},t))}),c]})}function hA(){const e=Gp(e=>{var t;return null==(t=e.crop.zoneRect)?void 0:t.width})||1,t=Gp(e=>{var t;return null==(t=e.crop.zoneRect)?void 0:t.height})||1;return(0,i.jsx)("div",{className:"text-sm",children:`${e}x${t}`})}function fA(){const e=Gp(e=>e.activeTool);return(0,i.jsxs)(Pb.div,{className:Dx,...zx,children:[(0,i.jsx)(pA,{}),gA(e),(0,i.jsx)(mA,{})]})}function pA(){const{isMobile:e}=uA(),t=Gp(e=>e.dirty);return e?(0,i.jsx)(YS,{size:"sm",onClick:()=>{qp().cancelChanges()},children:(0,i.jsx)(cA,{})}):(0,i.jsx)(Wx,{variant:"outline",size:"xs",startIcon:(0,i.jsx)(cA,{}),radius:"rounded-full",className:"min-w-92",onClick:()=>{qp().cancelChanges()},children:(0,i.jsx)(cS,t?{message:"Cancel"}:{message:"Close"})})}function gA(e){var t,n;if(!e)return null;const r=(0,i.jsx)("div",{className:"capitalize text-sm",children:(0,i.jsx)(cS,{message:e})});return e===Od.CROP&&((null==(n=null==(t=qp().config.tools)?void 0:t.crop)?void 0:n.allowCustomRatio)??1)?(0,i.jsx)(hA,{}):r}function mA(){const{isMobile:e}=uA(),t=Gp(e=>e.dirty);return e?(0,i.jsx)(YS,{size:"sm",disabled:!t,onClick:()=>{qp().applyChanges()},children:(0,i.jsx)(Yx,{})}):(0,i.jsx)(Wx,{variant:"flat",color:"primary",size:"xs",disabled:!t,startIcon:(0,i.jsx)(Yx,{}),radius:"rounded-full",onClick:()=>{qp().applyChanges()},children:(0,i.jsx)(cS,{message:"Apply"})})}function vA(){const e=Gp(e=>e.activeTool);return(0,i.jsx)(Ub,{initial:!1,children:e?(0,i.jsx)(fA,{},"activeToolbar"):(0,i.jsx)(dA,{},"mainToolbar")})}const yA={newCanvas:kd("Loading Canvas"),mainImage:kd("Loading Image"),state:kd("Loading State"),merge:kd("Processing Image")};function bA(){const[e,t]=(0,o.useState)(!1);return(0,o.useEffect)(()=>{Gp.subscribe(e=>e.loading,e=>{e&&t(e)})},[]),(0,i.jsx)(Ub,{children:e&&(0,i.jsx)(Pb.div,{initial:{y:"60%",opacity:0},animate:{y:0,opacity:1},exit:{y:"-60%",opacity:0},transition:{type:"tween",duration:.3},onAnimationComplete:()=>{setTimeout(()=>{t(!1)},400)},className:"absolute z-loading-indicator inset-0 m-auto p-6 w-144 h-32 text-center text-sm bg-paper rounded-full shadow-lg",children:(0,i.jsx)(cS,{...yA[e]})})})}const wA={toVector:(e,t)=>(void 0===e&&(e=t),Array.isArray(e)?e:[e,e]),add:(e,t)=>[e[0]+t[0],e[1]+t[1]],sub:(e,t)=>[e[0]-t[0],e[1]-t[1]],addTo(e,t){e[0]+=t[0],e[1]+=t[1]},subTo(e,t){e[0]-=t[0],e[1]-=t[1]}};function xA(e,t,n){return 0===t||Math.abs(t)===1/0?Math.pow(e,5*n):e*t*n/(t+n*e)}function CA(e,t,n,r=.15){return 0===r?function(e,t,n){return Math.max(t,Math.min(e,n))}(e,t,n):e<t?-xA(t-e,n-t,r)+t:e>n?+xA(e-n,n-t,r)+n:e}function _A(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function AA(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?SA(Object(n),!0).forEach(function(t){_A(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SA(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const kA={pointer:{start:"down",change:"move",end:"up"},mouse:{start:"down",change:"move",end:"up"},touch:{start:"start",change:"move",end:"end"},gesture:{start:"start",change:"change",end:"end"}};function EA(e){return e?e[0].toUpperCase()+e.slice(1):""}const IA=["enter","leave"];const jA=["gotpointercapture","lostpointercapture"];function TA(e){let t=e.substring(2).toLowerCase();const n=!!~t.indexOf("passive");n&&(t=t.replace("passive",""));const r=jA.includes(t)?"capturecapture":"capture",i=!!~t.indexOf(r);return i&&(t=t.replace("capture","")),{device:t,capture:i,passive:n}}function FA(e){return"touches"in e}function OA(e){return FA(e)?"touch":"pointerType"in e?e.pointerType:"mouse"}function MA(e){return FA(e)?function(e){return"touchend"===e.type||"touchcancel"===e.type?e.changedTouches:e.targetTouches}(e)[0]:e}function PA(e,t){try{const n=t.clientX-e.clientX,r=t.clientY-e.clientY,i=(t.clientX+e.clientX)/2,o=(t.clientY+e.clientY)/2,a=Math.hypot(n,r);return{angle:-180*Math.atan2(n,r)/Math.PI,distance:a,origin:[i,o]}}catch{}return null}function RA(e,t){const[n,r]=Array.from(e.touches).filter(e=>t.includes(e.identifier));return PA(n,r)}function LA(e){const t=MA(e);return FA(e)?t.identifier:t.pointerId}function NA(e){const t=MA(e);return[t.clientX,t.clientY]}function DA(e){let{deltaX:t,deltaY:n,deltaMode:r}=e;return 1===r?(t*=40,n*=40):2===r&&(t*=800,n*=800),[t,n]}function zA(e,...t){return"function"==typeof e?e(...t):e}function BA(){}function UA(...e){return 0===e.length?BA:1===e.length?e[0]:function(){let t;for(const n of e)t=n.apply(this,arguments)||t;return t}}function VA(e,t){return Object.assign({},t,e||{})}class HA{constructor(e,t,n){this.ctrl=e,this.args=t,this.key=n,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(e){this.ctrl.state[this.key]=e}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:e,shared:t,ingKey:n,args:r}=this;t[n]=e._active=e.active=e._blocked=e._force=!1,e._step=[!1,!1],e.intentional=!1,e._movement=[0,0],e._distance=[0,0],e._direction=[0,0],e._delta=[0,0],e._bounds=[[-1/0,1/0],[-1/0,1/0]],e.args=r,e.axis=void 0,e.memo=void 0,e.elapsedTime=e.timeDelta=0,e.direction=[0,0],e.distance=[0,0],e.overflow=[0,0],e._movementBound=[!1,!1],e.velocity=[0,0],e.movement=[0,0],e.delta=[0,0],e.timeStamp=0}start(e){const t=this.state,n=this.config;t._active||(this.reset(),this.computeInitial(),t._active=!0,t.target=e.target,t.currentTarget=e.currentTarget,t.lastOffset=n.from?zA(n.from,t):t.offset,t.offset=t.lastOffset,t.startTime=t.timeStamp=e.timeStamp)}computeValues(e){const t=this.state;t._values=e,t.values=this.config.transform(e)}computeInitial(){const e=this.state;e._initial=e._values,e.initial=e.values}compute(e){const{state:t,config:n,shared:r}=this;t.args=this.args;let i=0;if(e&&(t.event=e,n.preventDefault&&e.cancelable&&t.event.preventDefault(),t.type=e.type,r.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,r.locked=!!document.pointerLockElement,Object.assign(r,function(e){const t={};if("buttons"in e&&(t.buttons=e.buttons),"shiftKey"in e){const{shiftKey:n,altKey:r,metaKey:i,ctrlKey:o}=e;Object.assign(t,{shiftKey:n,altKey:r,metaKey:i,ctrlKey:o})}return t}(e)),r.down=r.pressed=r.buttons%2==1||r.touches>0,i=e.timeStamp-t.timeStamp,t.timeStamp=e.timeStamp,t.elapsedTime=t.timeStamp-t.startTime),t._active){const e=t._delta.map(Math.abs);wA.addTo(t._distance,e)}this.axisIntent&&this.axisIntent(e);const[o,a]=t._movement,[s,l]=n.threshold,{_step:c,values:u}=t;if(n.hasCustomTransform?(!1===c[0]&&(c[0]=Math.abs(o)>=s&&u[0]),!1===c[1]&&(c[1]=Math.abs(a)>=l&&u[1])):(!1===c[0]&&(c[0]=Math.abs(o)>=s&&Math.sign(o)*s),!1===c[1]&&(c[1]=Math.abs(a)>=l&&Math.sign(a)*l)),t.intentional=!1!==c[0]||!1!==c[1],!t.intentional)return;const d=[0,0];if(n.hasCustomTransform){const[e,t]=u;d[0]=!1!==c[0]?e-c[0]:0,d[1]=!1!==c[1]?t-c[1]:0}else d[0]=!1!==c[0]?o-c[0]:0,d[1]=!1!==c[1]?a-c[1]:0;this.restrictToAxis&&!t._blocked&&this.restrictToAxis(d);const h=t.offset,f=t._active&&!t._blocked||t.active;f&&(t.first=t._active&&!t.active,t.last=!t._active&&t.active,t.active=r[this.ingKey]=t._active,e&&(t.first&&("bounds"in n&&(t._bounds=zA(n.bounds,t)),this.setup&&this.setup()),t.movement=d,this.computeOffset()));const[p,g]=t.offset,[[m,v],[y,b]]=t._bounds;t.overflow=[p<m?-1:p>v?1:0,g<y?-1:g>b?1:0],t._movementBound[0]=!!t.overflow[0]&&(!1===t._movementBound[0]?t._movement[0]:t._movementBound[0]),t._movementBound[1]=!!t.overflow[1]&&(!1===t._movementBound[1]?t._movement[1]:t._movementBound[1]);const w=t._active&&n.rubberband||[0,0];if(t.offset=function(e,[t,n],[r,i]){const[[o,a],[s,l]]=e;return[CA(t,o,a,r),CA(n,s,l,i)]}(t._bounds,t.offset,w),t.delta=wA.sub(t.offset,h),this.computeMovement(),f&&(!t.last||i>32)){t.delta=wA.sub(t.offset,h);const e=t.delta.map(Math.abs);wA.addTo(t.distance,e),t.direction=t.delta.map(Math.sign),t._direction=t._delta.map(Math.sign),!t.first&&i>0&&(t.velocity=[e[0]/i,e[1]/i],t.timeDelta=i)}}emit(){const e=this.state,t=this.shared,n=this.config;if(e._active||this.clean(),(e._blocked||!e.intentional)&&!e._force&&!n.triggerAllEvents)return;const r=this.handler(AA(AA(AA({},t),e),{},{[this.aliasKey]:e.values}));void 0!==r&&(e.memo=r)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}class WA extends HA{constructor(...e){super(...e),_A(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=wA.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=wA.sub(this.state.offset,this.state.lastOffset)}axisIntent(e){const t=this.state,n=this.config;if(!t.axis&&e){const r="object"==typeof n.axisThreshold?n.axisThreshold[OA(e)]:n.axisThreshold;t.axis=function([e,t],n){const r=Math.abs(e),i=Math.abs(t);return r>i&&r>n?"x":i>r&&i>n?"y":void 0}(t._movement,r)}t._blocked=(n.lockDirection||!!n.axis)&&!t.axis||!!n.axis&&n.axis!==t.axis}restrictToAxis(e){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":e[1]=0;break;case"y":e[0]=0}}}const $A=e=>e,GA={enabled:(e=!0)=>e,eventOptions:(e,t,n)=>AA(AA({},n.shared.eventOptions),e),preventDefault:(e=!1)=>e,triggerAllEvents:(e=!1)=>e,rubberband(e=0){switch(e){case!0:return[.15,.15];case!1:return[0,0];default:return wA.toVector(e)}},from:e=>"function"==typeof e?e:null!=e?wA.toVector(e):void 0,transform(e,t,n){const r=e||n.shared.transform;return this.hasCustomTransform=!!r,r||$A},threshold:e=>wA.toVector(e,0)},qA=AA(AA({},GA),{},{axis(e,t,{axis:n}){if(this.lockDirection="lock"===n,!this.lockDirection)return n},axisThreshold:(e=0)=>e,bounds(e={}){if("function"==typeof e)return t=>qA.bounds(e(t));if("current"in e)return()=>e.current;if("function"==typeof HTMLElement&&e instanceof HTMLElement)return e;const{left:t=-1/0,right:n=1/0,top:r=-1/0,bottom:i=1/0}=e;return[[t,n],[r,i]]}}),YA={ArrowRight:(e,t=1)=>[e*t,0],ArrowLeft:(e,t=1)=>[-1*e*t,0],ArrowUp:(e,t=1)=>[0,-1*e*t],ArrowDown:(e,t=1)=>[0,e*t]},XA=typeof window<"u"&&window.document&&window.document.createElement;function KA(){return XA&&"ontouchstart"in window}const ZA={isBrowser:XA,gesture:function(){try{return"constructor"in GestureEvent}catch{return!1}}(),touch:KA(),touchscreen:KA()||XA&&window.navigator.maxTouchPoints>1,pointer:XA&&"onpointerdown"in window,pointerLock:XA&&"exitPointerLock"in window.document},JA={mouse:0,touch:0,pen:8},QA=AA(AA({},qA),{},{device(e,t,{pointer:{touch:n=!1,lock:r=!1,mouse:i=!1}={}}){return this.pointerLock=r&&ZA.pointerLock,ZA.touch&&n?"touch":this.pointerLock?"mouse":ZA.pointer&&!i?"pointer":ZA.touch?"touch":"mouse"},preventScrollAxis(e,t,{preventScroll:n}){if(this.preventScrollDelay="number"==typeof n?n:n||void 0===n&&e?250:void 0,ZA.touchscreen&&!1!==n)return e||(void 0!==n?"y":void 0)},pointerCapture(e,t,{pointer:{capture:n=!0,buttons:r=1,keys:i=!0}={}}){return this.pointerButtons=r,this.keys=i,!this.pointerLock&&"pointer"===this.device&&n},threshold(e,t,{filterTaps:n=!1,tapsThreshold:r=3,axis:i}){const o=wA.toVector(e,n?r:i?1:0);return this.filterTaps=n,this.tapsThreshold=r,o},swipe({velocity:e=.5,distance:t=50,duration:n=250}={}){return{velocity:this.transform(wA.toVector(e)),distance:this.transform(wA.toVector(t)),duration:n}},delay(e=0){switch(e){case!0:return 180;case!1:return 0;default:return e}},axisThreshold:e=>e?AA(AA({},JA),e):JA,keyboardDisplacement:(e=10)=>e}),ek=AA(AA({},GA),{},{device(e,t,{shared:n,pointer:{touch:r=!1}={}}){if(n.target&&!ZA.touch&&ZA.gesture)return"gesture";if(ZA.touch&&r)return"touch";if(ZA.touchscreen){if(ZA.pointer)return"pointer";if(ZA.touch)return"touch"}},bounds(e,t,{scaleBounds:n={},angleBounds:r={}}){const i=e=>{const t=VA(zA(n,e),{min:-1/0,max:1/0});return[t.min,t.max]},o=e=>{const t=VA(zA(r,e),{min:-1/0,max:1/0});return[t.min,t.max]};return"function"!=typeof n&&"function"!=typeof r?[i(),o()]:e=>[i(e),o(e)]},threshold(e,t,n){return this.lockDirection="lock"===n.axis,wA.toVector(e,this.lockDirection?[.1,3]:0)},modifierKey:e=>void 0===e?"ctrlKey":e,pinchOnWheel:(e=!0)=>e});AA(AA({},qA),{},{mouseOnly:(e=!0)=>e}),AA(AA({},qA),{},{mouseOnly:(e=!0)=>e});const tk=new Map,nk=new Map;function rk(e){tk.set(e.key,e.engine),nk.set(e.key,e.resolver)}const ik={key:"drag",engine:class extends WA{constructor(...e){super(...e),_A(this,"ingKey","dragging")}reset(){super.reset();const e=this.state;e._pointerId=void 0,e._pointerActive=!1,e._keyboardActive=!1,e._preventScroll=!1,e._delayed=!1,e.swipe=[0,0],e.tap=!1,e.canceled=!1,e.cancel=this.cancel.bind(this)}setup(){const e=this.state;if(e._bounds instanceof HTMLElement){const t=e._bounds.getBoundingClientRect(),n=e.currentTarget.getBoundingClientRect(),r={left:t.left-n.left+e.offset[0],right:t.right-n.right+e.offset[0],top:t.top-n.top+e.offset[1],bottom:t.bottom-n.bottom+e.offset[1]};e._bounds=qA.bounds(r)}}cancel(){const e=this.state;e.canceled||(e.canceled=!0,e._active=!1,setTimeout(()=>{this.compute(),this.emit()},0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(e){const t=this.config,n=this.state;if(null!=e.buttons&&(Array.isArray(t.pointerButtons)?!t.pointerButtons.includes(e.buttons):-1!==t.pointerButtons&&t.pointerButtons!==e.buttons))return;const r=this.ctrl.setEventIds(e);t.pointerCapture&&e.target.setPointerCapture(e.pointerId),!(r&&r.size>1&&n._pointerActive)&&(this.start(e),this.setupPointer(e),n._pointerId=LA(e),n._pointerActive=!0,this.computeValues(NA(e)),this.computeInitial(),t.preventScrollAxis&&"mouse"!==OA(e)?(n._active=!1,this.setupScrollPrevention(e)):t.delay>0?(this.setupDelayTrigger(e),t.triggerAllEvents&&(this.compute(e),this.emit())):this.startPointerDrag(e))}startPointerDrag(e){const t=this.state;t._active=!0,t._preventScroll=!0,t._delayed=!1,this.compute(e),this.emit()}pointerMove(e){const t=this.state,n=this.config;if(!t._pointerActive)return;const r=LA(e);if(void 0!==t._pointerId&&r!==t._pointerId)return;const i=NA(e);return document.pointerLockElement===e.target?t._delta=[e.movementX,e.movementY]:(t._delta=wA.sub(i,t._values),this.computeValues(i)),wA.addTo(t._movement,t._delta),this.compute(e),t._delayed&&t.intentional?(this.timeoutStore.remove("dragDelay"),t.active=!1,void this.startPointerDrag(e)):n.preventScrollAxis&&!t._preventScroll?t.axis?t.axis===n.preventScrollAxis||"xy"===n.preventScrollAxis?(t._active=!1,void this.clean()):(this.timeoutStore.remove("startPointerDrag"),void this.startPointerDrag(e)):void 0:void this.emit()}pointerUp(e){this.ctrl.setEventIds(e);try{this.config.pointerCapture&&e.target.hasPointerCapture(e.pointerId)&&e.target.releasePointerCapture(e.pointerId)}catch{}const t=this.state,n=this.config;if(!t._active||!t._pointerActive)return;const r=LA(e);if(void 0!==t._pointerId&&r!==t._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(e);const[i,o]=t._distance;if(t.tap=i<=n.tapsThreshold&&o<=n.tapsThreshold,t.tap&&n.filterTaps)t._force=!0;else{const[e,r]=t._delta,[i,o]=t._movement,[a,s]=n.swipe.velocity,[l,c]=n.swipe.distance,u=n.swipe.duration;if(t.elapsedTime<u){const n=Math.abs(e/t.timeDelta),u=Math.abs(r/t.timeDelta);n>a&&Math.abs(i)>l&&(t.swipe[0]=Math.sign(e)),u>s&&Math.abs(o)>c&&(t.swipe[1]=Math.sign(r))}}this.emit()}pointerClick(e){!this.state.tap&&e.detail>0&&(e.preventDefault(),e.stopPropagation())}setupPointer(e){const t=this.config,n=t.device;t.pointerLock&&e.currentTarget.requestPointerLock(),t.pointerCapture||(this.eventStore.add(this.sharedConfig.window,n,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,n,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,n,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(e){this.state._preventScroll&&e.cancelable&&e.preventDefault()}setupScrollPrevention(e){this.state._preventScroll=!1,function(e){"persist"in e&&"function"==typeof e.persist&&e.persist()}(e);const t=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",t),this.eventStore.add(this.sharedConfig.window,"touch","cancel",t),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,e)}setupDelayTrigger(e){this.state._delayed=!0,this.timeoutStore.add("dragDelay",()=>{this.state._step=[0,0],this.startPointerDrag(e)},this.config.delay)}keyDown(e){const t=YA[e.key];if(t){const n=this.state,r=e.shiftKey?10:e.altKey?.1:1;this.start(e),n._delta=t(this.config.keyboardDisplacement,r),n._keyboardActive=!0,wA.addTo(n._movement,n._delta),this.compute(e),this.emit()}}keyUp(e){e.key in YA&&(this.state._keyboardActive=!1,this.setActive(),this.compute(e),this.emit())}bind(e){const t=this.config.device;e(t,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(e(t,"change",this.pointerMove.bind(this)),e(t,"end",this.pointerUp.bind(this)),e(t,"cancel",this.pointerUp.bind(this)),e("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(e("key","down",this.keyDown.bind(this)),e("key","up",this.keyUp.bind(this))),this.config.filterTaps&&e("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}},resolver:QA},ok={key:"pinch",engine:class extends HA{constructor(...e){super(...e),_A(this,"ingKey","pinching"),_A(this,"aliasKey","da")}init(){this.state.offset=[1,0],this.state.lastOffset=[1,0],this.state._pointerEvents=new Map}reset(){super.reset();const e=this.state;e._touchIds=[],e.canceled=!1,e.cancel=this.cancel.bind(this),e.turns=0}computeOffset(){const{type:e,movement:t,lastOffset:n}=this.state;this.state.offset="wheel"===e?wA.add(t,n):[(1+t[0])*n[0],t[1]+n[1]]}computeMovement(){const{offset:e,lastOffset:t}=this.state;this.state.movement=[e[0]/t[0],e[1]-t[1]]}axisIntent(){const e=this.state,[t,n]=e._movement;if(!e.axis){const r=30*Math.abs(t)-Math.abs(n);r<0?e.axis="angle":r>0&&(e.axis="scale")}}restrictToAxis(e){this.config.lockDirection&&("scale"===this.state.axis?e[1]=0:"angle"===this.state.axis&&(e[0]=0))}cancel(){const e=this.state;e.canceled||setTimeout(()=>{e.canceled=!0,e._active=!1,this.compute(),this.emit()},0)}touchStart(e){this.ctrl.setEventIds(e);const t=this.state,n=this.ctrl.touchIds;if(t._active&&t._touchIds.every(e=>n.has(e))||n.size<2)return;this.start(e),t._touchIds=Array.from(n).slice(0,2);const r=RA(e,t._touchIds);r&&this.pinchStart(e,r)}pointerStart(e){if(null!=e.buttons&&e.buttons%2!=1)return;this.ctrl.setEventIds(e),e.target.setPointerCapture(e.pointerId);const t=this.state,n=t._pointerEvents,r=this.ctrl.pointerIds;if(t._active&&Array.from(n.keys()).every(e=>r.has(e))||(n.size<2&&n.set(e.pointerId,e),t._pointerEvents.size<2))return;this.start(e);const i=PA(...Array.from(n.values()));i&&this.pinchStart(e,i)}pinchStart(e,t){this.state.origin=t.origin,this.computeValues([t.distance,t.angle]),this.computeInitial(),this.compute(e),this.emit()}touchMove(e){if(!this.state._active)return;const t=RA(e,this.state._touchIds);t&&this.pinchMove(e,t)}pointerMove(e){const t=this.state._pointerEvents;if(t.has(e.pointerId)&&t.set(e.pointerId,e),!this.state._active)return;const n=PA(...Array.from(t.values()));n&&this.pinchMove(e,n)}pinchMove(e,t){const n=this.state,r=n._values[1],i=t.angle-r;let o=0;Math.abs(i)>270&&(o+=Math.sign(i)),this.computeValues([t.distance,t.angle-360*o]),n.origin=t.origin,n.turns=o,n._movement=[n._values[0]/n._initial[0]-1,n._values[1]-n._initial[1]],this.compute(e),this.emit()}touchEnd(e){this.ctrl.setEventIds(e),this.state._active&&this.state._touchIds.some(e=>!this.ctrl.touchIds.has(e))&&(this.state._active=!1,this.compute(e),this.emit())}pointerEnd(e){const t=this.state;this.ctrl.setEventIds(e);try{e.target.releasePointerCapture(e.pointerId)}catch{}t._pointerEvents.has(e.pointerId)&&t._pointerEvents.delete(e.pointerId),t._active&&t._pointerEvents.size<2&&(t._active=!1,this.compute(e),this.emit())}gestureStart(e){e.cancelable&&e.preventDefault();const t=this.state;t._active||(this.start(e),this.computeValues([e.scale,e.rotation]),t.origin=[e.clientX,e.clientY],this.compute(e),this.emit())}gestureMove(e){if(e.cancelable&&e.preventDefault(),!this.state._active)return;const t=this.state;this.computeValues([e.scale,e.rotation]),t.origin=[e.clientX,e.clientY];const n=t._movement;t._movement=[e.scale-1,e.rotation],t._delta=wA.sub(t._movement,n),this.compute(e),this.emit()}gestureEnd(e){this.state._active&&(this.state._active=!1,this.compute(e),this.emit())}wheel(e){const t=this.config.modifierKey;t&&(Array.isArray(t)?!t.find(t=>e[t]):!e[t])||(this.state._active?this.wheelChange(e):this.wheelStart(e),this.timeoutStore.add("wheelEnd",this.wheelEnd.bind(this)))}wheelStart(e){this.start(e),this.wheelChange(e)}wheelChange(e){"uv"in e||e.cancelable&&e.preventDefault();const t=this.state;t._delta=[-DA(e)[1]/100*t.offset[0],0],wA.addTo(t._movement,t._delta),function(e){const[t,n]=e.overflow,[r,i]=e._delta,[o,a]=e._direction;(t<0&&r>0&&o<0||t>0&&r<0&&o>0)&&(e._movement[0]=e._movementBound[0]),(n<0&&i>0&&a<0||n>0&&i<0&&a>0)&&(e._movement[1]=e._movementBound[1])}(t),this.state.origin=[e.clientX,e.clientY],this.compute(e),this.emit()}wheelEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(e){const t=this.config.device;t&&(e(t,"start",this[t+"Start"].bind(this)),e(t,"change",this[t+"Move"].bind(this)),e(t,"end",this[t+"End"].bind(this)),e(t,"cancel",this[t+"End"].bind(this)),e("lostPointerCapture","",this[t+"End"].bind(this))),this.config.pinchOnWheel&&e("wheel","",this.wheel.bind(this),{passive:!1})}},resolver:ek};const ak={target(e){if(e)return()=>"current"in e?e.current:e},enabled:(e=!0)=>e,window:(e=(ZA.isBrowser?window:void 0))=>e,eventOptions:({passive:e=!0,capture:t=!1}={})=>({passive:e,capture:t}),transform:e=>e},sk=["target","eventOptions","window","enabled","transform"];function lk(e={},t){const n={};for(const[r,i]of Object.entries(t))switch(typeof i){case"function":n[r]=i.call(n,e[r],r,e);break;case"object":n[r]=lk(e[r],i);break;case"boolean":i&&(n[r]=e[r])}return n}class ck{constructor(e,t){_A(this,"_listeners",new Set),this._ctrl=e,this._gestureKey=t}add(e,t,n,r,i){const o=this._listeners,a=function(e,t=""){const n=kA[e];return e+(n&&n[t]||t)}(t,n),s=AA(AA({},this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{}),i);e.addEventListener(a,r,s);const l=()=>{e.removeEventListener(a,r,s),o.delete(l)};return o.add(l),l}clean(){this._listeners.forEach(e=>e()),this._listeners.clear()}}class uk{constructor(){_A(this,"_timeouts",new Map)}add(e,t,n=140,...r){this.remove(e),this._timeouts.set(e,window.setTimeout(t,n,...r))}remove(e){const t=this._timeouts.get(e);t&&window.clearTimeout(t)}clean(){this._timeouts.forEach(e=>{window.clearTimeout(e)}),this._timeouts.clear()}}class dk{constructor(e){_A(this,"gestures",new Set),_A(this,"_targetEventStore",new ck(this)),_A(this,"gestureEventStores",{}),_A(this,"gestureTimeoutStores",{}),_A(this,"handlers",{}),_A(this,"config",{}),_A(this,"pointerIds",new Set),_A(this,"touchIds",new Set),_A(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),function(e,t){t.drag&&hk(e,"drag"),t.wheel&&hk(e,"wheel"),t.scroll&&hk(e,"scroll"),t.move&&hk(e,"move"),t.pinch&&hk(e,"pinch"),t.hover&&hk(e,"hover")}(this,e)}setEventIds(e){return FA(e)?(this.touchIds=new Set(function(e){return function(e){return Array.from(e.touches).filter(t=>{var n,r;return t.target===e.currentTarget||(null===(n=e.currentTarget)||void 0===n||null===(r=n.contains)||void 0===r?void 0:r.call(n,t.target))})}(e).map(e=>e.identifier)}(e)),this.touchIds):"pointerId"in e?("pointerup"===e.type||"pointercancel"===e.type?this.pointerIds.delete(e.pointerId):"pointerdown"===e.type&&this.pointerIds.add(e.pointerId),this.pointerIds):void 0}applyHandlers(e,t){this.handlers=e,this.nativeHandlers=t}applyConfig(e,t){this.config=function(e,t,n={}){const r=e,{target:i,eventOptions:o,window:a,enabled:s,transform:l}=r,c=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(r,sk);if(n.shared=lk({target:i,eventOptions:o,window:a,enabled:s,transform:l},ak),t){const e=nk.get(t);n[t]=lk(AA({shared:n.shared},c),e)}else for(const u in c){const e=nk.get(u);e&&(n[u]=lk(AA({shared:n.shared},c[u]),e))}return n}(e,t,this.config)}clean(){this._targetEventStore.clean();for(const e of this.gestures)this.gestureEventStores[e].clean(),this.gestureTimeoutStores[e].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...e){const t=this.config.shared,n={};let r;if(!t.target||(r=t.target(),r)){if(t.enabled){for(const t of this.gestures){const i=this.config[t],o=fk(n,i.eventOptions,!!r);i.enabled&&new(tk.get(t))(this,e,t).bind(o)}const i=fk(n,t.eventOptions,!!r);for(const t in this.nativeHandlers)i(t,"",n=>this.nativeHandlers[t](AA(AA({},this.state.shared),{},{event:n,args:e})),void 0,!0)}for(const e in n)n[e]=UA(...n[e]);if(!r)return n;for(const e in n){const{device:t,capture:i,passive:o}=TA(e);this._targetEventStore.add(r,t,"",n[e],{capture:i,passive:o})}}}}function hk(e,t){e.gestures.add(t),e.gestureEventStores[t]=new ck(e,t),e.gestureTimeoutStores[t]=new uk}const fk=(e,t,n)=>(r,i,o,a={},s=!1)=>{var l,c;const u=null!==(l=a.capture)&&void 0!==l?l:t.capture,d=null!==(c=a.passive)&&void 0!==c?c:t.passive;let h=s?r:function(e,t="",n=!1){const r=kA[e],i=r&&r[t]||t;return"on"+EA(e)+EA(i)+(function(e=!1,t){return e&&!IA.includes(t)}(n,i)?"Capture":"")}(r,i,u);n&&d&&(h+="Passive"),e[h]=e[h]||[],e[h].push(o)},pk=/^on(Drag|Wheel|Scroll|Move|Pinch|Hover)/;function gk(e,t,n,r,i,o){if(!e.has(n)||!tk.has(r))return;const a=n+"Start",s=n+"End";i[r]=e=>{let r;return e.first&&a in t&&t[a](e),n in t&&(r=t[n](e)),e.last&&s in t&&t[s](e),r},o[r]=o[r]||{}}function mk({e:e,rect:t,deltaX:n,deltaY:r}){return{rect:t,x:e.clientX,y:e.clientY,deltaX:n??0,deltaY:r??0,nativeEvent:e}}function vk({onMoveStart:e,onMove:t,onMoveEnd:n,minimumMovement:r=0,preventDefault:i,stopPropagation:a=!0,onPress:s,onLongPress:l,...c}){const u=(0,o.useRef)({lastPosition:{x:0,y:0},started:!1,longPressTriggered:!1}).current,{addGlobalListener:d,removeGlobalListener:h}=cw(),f=n=>{if(n.pointerId===u.id){const i=n.clientX-u.lastPosition.x,o=n.clientY-u.lastPosition.y;(Math.abs(i)>=r||Math.abs(o)>=r)&&!u.started&&(t=>{!u.el||!1===(null==e?void 0:e(t,u.el))||(u.originalTouchAction=u.el.style.touchAction,u.el.style.touchAction="none",u.originalUserSelect=document.documentElement.style.userSelect,document.documentElement.style.userSelect="none",u.started=!0)})(n),u.started&&(null==t||t(n,i,o),u.lastPosition={x:n.clientX,y:n.clientY})}},p=e=>{var t;if(e.pointerId===u.id){u.longPressTimer&&clearTimeout(u.longPressTimer);const r=u.longPressTriggered;u.longPressTriggered=!1,u.started&&(null==n||n(e)),u.el&&("pointercancel"!==e.type&&(null==(t=c.onPointerUp)||t.call(c,e,u.el),e.target&&u.el.contains(e.target)&&(r?null==l||l(e,u.el):null==s||s(e,u.el))),document.documentElement.style.userSelect=u.originalUserSelect||"",u.el.style.touchAction=u.originalTouchAction||""),u.id=void 0,u.started=!1,h(window,"pointermove",f,!1),h(window,"pointerup",p,!1),h(window,"pointercancel",p,!1)}};return{domProps:{onPointerDown:Vx(n=>{var r;if(0===n.button&&null==u.id){if(u.started=!1,!1===(null==(r=c.onPointerDown)?void 0:r.call(c,n)))return;a&&n.stopPropagation(),i&&n.preventDefault(),u.id=n.pointerId,u.el=n.currentTarget,u.lastPosition={x:n.clientX,y:n.clientY},l&&(u.longPressTimer=setTimeout(()=>{l(n,u.el),u.longPressTriggered=!0},400)),(e||t)&&d(window,"pointermove",f,!1),d(window,"pointerup",p,!1),d(window,"pointercancel",p,!1)}})}}}function yk(e){return{left:e.left,top:e.top,width:e.width,height:e.height}}var bk=(e=>(e.topLeft="topLeft",e.topRight="topRight",e.bottomLeft="bottomLeft",e.bottomRight="bottomRight",e))(bk||{});let wk={};const xk=(e={})=>{Cw(null),wk=e};function Ck({aspectRatio:e,boundaryRef:t,boundaryRect:n,restrictWithinBoundary:r=!0,minWidth:i=50,minHeight:o=50,...a}){const s={onMoveStart:(e,r)=>{var i;const o=e.target;if(!o.dataset.resizeHandle||xw||(xk({currentRect:yk(r.getBoundingClientRect()),resizeDir:o.dataset.resizeHandle}),!wk.currentRect))return!1;Cw("resize"),n?wk.boundaryRect=n:null!=t&&t.current&&(wk.boundaryRect=yk(t.current.getBoundingClientRect())),wk.currentRect&&wk.boundaryRect&&(wk.currentRect.left-=wk.boundaryRect.left,wk.currentRect.top-=wk.boundaryRect.top),wk.initialAspectRatio=wk.currentRect.width/wk.currentRect.height,null==(i=a.onResizeStart)||i.call(a,mk({rect:wk.currentRect,e:e}))},onMove:(t,n,r)=>{var s;if(!wk.resizeDir||!wk.currentRect)return;const l="initial"===e?wk.initialAspectRatio:e,c=function(e,t,n,r){const i={...e},o={...e};return"topRight"===wk.resizeDir?(o.width=Math.floor(o.width+t),o.height=r?Math.floor(o.width/r):Math.floor(o.height-n),o.top=Math.floor(o.top+(i.height-o.height))):"bottomRight"===wk.resizeDir?(o.width=Math.floor(o.width+t),o.height=r?Math.floor(o.width/r):Math.floor(o.height+n)):"topLeft"===wk.resizeDir?(o.width=Math.floor(o.width-t),o.height=r?Math.floor(o.width/r):Math.floor(o.height-n),o.left=Math.floor(o.left+(i.width-o.width)),o.top=Math.floor(o.top+(i.height-o.height))):"bottomLeft"===wk.resizeDir&&(o.width=Math.floor(o.width-t),o.height=r?Math.floor(o.width/r):Math.floor(o.height+n),o.left=Math.floor(o.left+t)),o}(wk.currentRect,n,r,l),u=function(e,t,n,r){const i="bottomLeft"===wk.resizeDir||"topLeft"===wk.resizeDir,o="topRight"===wk.resizeDir||"topLeft"===wk.resizeDir;let a={...e};a.width=Math.max(t,e.width),a.height=Math.max(n,e.height);const s=a.width-e.width;i&&s>0&&(a.left-=s);const l=a.height-e.height;if(o&&l>0&&(a.top-=l),wk.boundaryRect&&(a=function(e,t){const n={...e};n.left=Math.max(0,n.left);const r=n.left-e.left;r>0&&(n.width-=r),n.top=Math.max(0,n.top);const i=n.top-e.top;return i>0&&(n.height-=i),n.width=Math.min(n.width,t.width-n.left),n.height=Math.min(n.height,t.height-n.top),n}(a,wk.boundaryRect)),r){const e=a.width,t=a.height,n=tx(r,a.width,a.height);a.width=n.width,a.height=n.height,o&&(a.top+=t-a.height),i&&(a.left+=e-a.width)}return a}(c,i,o,l);null==(s=a.onResize)||s.call(a,mk({rect:u,e:t,deltaX:n,deltaY:r})),wk.currentRect=c},onMoveEnd:e=>{var t;wk.currentRect&&(null==(t=a.onResizeEnd)||t.call(a,mk({rect:wk.currentRect,e:e}))),xk()}},{domProps:l}=vk(s);return{resizeProps:l}}function _k({position:e,inset:t=!1}){const n=function(e,t){const n=t?"left-0":"-left-5",r=t?"top-0":"-top-5",i=t?"bottom-0":"-bottom-5",o=t?"right-0":"-right-5";switch(e){case bk.topLeft:return`${n} ${r} border-l-4 border-t-4 cursor-nwse-resize`;case bk.topRight:return`${o} ${r} border-r-4 border-t-4 cursor-nesw-resize`;case bk.bottomRight:return`${o} ${i} border-r-4 border-b-4 cursor-se-resize`;case bk.bottomLeft:return`${n} ${i} border-l-4 border-b-4 cursor-sw-resize`;default:return""}}(e,t);return(0,i.jsx)("div",{"data-resize-handle":e,className:`border-white absolute w-20 h-20 ${n}`})}var Sk=(e=>(e.top="maskTop",e.right="maskRight",e.bottom="maskBottom",e.left="maskLeft",e))(Sk||{});function Ak({position:e,refs:t}){const n=function(e){switch(e){case"maskTop":return"left-0 top-0";case"maskBottom":return"bottom-0 left-0";default:return""}}(e);return(0,i.jsx)("div",{className:`cropzone-transition bg-black/50 bottom absolute ${n}`,ref:n=>t.current[e]=n})}function kk({name:e,refs:t}){const n=Pd("cropzone-transition pointer-events-none absolute left-0 top-0 bg-white/50",e.startsWith("lineHor")?"h-px":"w-px");return(0,i.jsx)("div",{className:n,ref:n=>{t.current[e]=n}})}function Ek(e,t,n){return Math.min(Math.max(e,t),n)}let Ik={};function jk({boundaryRef:e,boundaryRect:t,minimumMovement:n,restrictWithinBoundary:r=!0,...i}){const o={minimumMovement:n,onMoveStart:(n,r)=>{var o;if(xw)return!1;Ik={currentRect:yk(r.getBoundingClientRect())},Cw("move"),t?Ik.boundaryRect=t:null!=e&&e.current&&(Ik.boundaryRect=yk(e.current.getBoundingClientRect())),Ik.currentRect&&Ik.boundaryRect&&(Ik.currentRect.left-=Ik.boundaryRect.left,Ik.currentRect.top-=Ik.boundaryRect.top),null==(o=i.onMoveStart)||o.call(i,mk({rect:Ik.currentRect,e:n}))},onMove:(e,t,n)=>{var o;if(!Ik.currentRect)return;const a={...Ik.currentRect,left:Ik.currentRect.left+t,top:Ik.currentRect.top+n},s={...a};Ik.boundaryRect&&r&&(s.left=Ek(a.left,0,Ik.boundaryRect.width-a.width),s.top=Ek(a.top,0,Ik.boundaryRect.height-a.height)),null==(o=i.onMove)||o.call(i,mk({rect:s,e:e,deltaX:t,deltaY:n})),Ik.currentRect=a},onMoveEnd:e=>{var t;Ik.currentRect&&(null==(t=i.onMoveEnd)||t.call(i,mk({rect:Ik.currentRect,e:e})),Cw(null),Ik={})}},{domProps:a}=vk(o);return{moveProps:a}}function Tk(){const e=(0,o.useRef)({}),[t,n]=(0,o.useState)(!0),r=Gp(e=>e.canvasSize),a=Gp(e=>{var t,n;return null==(n=null==(t=e.config.tools)?void 0:t.crop)?void 0:n.cropzone}),s=Gp(e=>{var t,n;return null==(n=null==(t=e.config.tools)?void 0:t.crop)?void 0:n.defaultRatio})||null,l=Gp(e=>e.crop.selectedAspectRatio)||null,{moveProps:c}=jk({boundaryRect:r,onMoveStart:()=>n(!0),onMove:e=>Yp().crop.drawZone(e.rect),onMoveEnd:()=>n(!1)}),{resizeProps:u}=Ck({boundaryRect:r,minHeight:50,minWidth:50,aspectRatio:nx(l),onResizeStart:()=>n(!0),onResize:e=>Yp().crop.drawZone(e.rect),onResizeEnd:()=>n(!1)});(0,o.useLayoutEffect)(()=>{Yp().crop.registerRefs(e),Yp().crop.resetCropzone(s)},[s,r]);const d=Pd("cropzone absolute z-cropzone isolate left-0 top-0 w-full h-full overflow-hidden",t&&"moving");return(0,i.jsxs)("div",{className:d,onPointerDown:e=>{e.stopPropagation(),e.preventDefault()},children:[(0,i.jsxs)("div",{className:"cropzone-transition border-white/50 absolute z-10 left-0 top-0 border",...nw(u,c),ref:t=>e.current.innerZone=t,children:[!(null!=a&&a.hideTopLeft)&&(0,i.jsx)(_k,{position:bk.topLeft,inset:!0}),!(null!=a&&a.hideTopRight)&&(0,i.jsx)(_k,{position:bk.topRight,inset:!0}),!(null!=a&&a.hideBottomLeft)&&(0,i.jsx)(_k,{position:bk.bottomLeft,inset:!0}),!(null!=a&&a.hideBottomRight)&&(0,i.jsx)(_k,{position:bk.bottomRight,inset:!0}),(0,i.jsx)(kk,{name:"lineVer1",refs:e}),(0,i.jsx)(kk,{name:"lineVer2",refs:e}),(0,i.jsx)(kk,{name:"lineHor1",refs:e}),(0,i.jsx)(kk,{name:"lineHor2",refs:e})]}),(0,i.jsx)(Ak,{refs:e,position:Sk.top}),(0,i.jsx)(Ak,{refs:e,position:Sk.left}),(0,i.jsx)(Ak,{refs:e,position:Sk.right}),(0,i.jsx)(Ak,{refs:e,position:Sk.bottom})]})}const Fk=Nd((0,i.jsx)("path",{d:"M 7 2 C 6.448 2 6 2.448 6 3 C 6 3.552 6.448 4 7 4 L 20 4 L 20 17 C 20 17.552 20.448 18 21 18 C 21.552 18 22 17.552 22 17 L 22 4 C 22 2.895 21.105 2 20 2 L 7 2 z M 4 6 C 2.895 6 2 6.895 2 8 L 2 20 C 2 21.105 2.895 22 4 22 L 16 22 C 17.105 22 18 21.105 18 20 L 18 8 C 18 6.895 17.105 6 16 6 L 4 6 z M 10 10 C 10.552 10 11 10.448 11 11 L 11 13 L 13 13 C 13.552 13 14 13.448 14 14 C 14 14.552 13.552 15 13 15 L 11 15 L 11 17 C 11 17.552 10.552 18 10 18 C 9.448 18 9 17.552 9 17 L 9 15 L 7 15 C 6.448 15 6 14.552 6 14 C 6 13.448 6.448 13 7 13 L 9 13 L 9 11 C 9 10.448 9.448 10 10 10 z"})),Ok=Nd((0,i.jsx)("path",{d:"M 11 3 L 2 21 L 11 21 L 11 3 z M 13 3 L 13 21 L 22 21 L 13 3 z M 9 11.472656 L 9 19 L 5.2363281 19 L 9 11.472656 z"})),Mk=Nd((0,i.jsx)("path",{d:"M 16.476562 2.4511719 C 16.392047 2.4657656 16.308531 2.5061719 16.238281 2.5761719 L 14.130859 4.6835938 C 13.956859 4.8575938 13.956859 5.1394531 14.130859 5.3144531 L 16.238281 7.4238281 C 16.519281 7.7048281 17 7.5054219 17 7.1074219 L 17 6 L 20 6 L 20 9 A 1.0001 1.0001 0 1 0 22 9 L 22 6 C 22 4.9069372 21.093063 4 20 4 L 17 4 L 17 2.8925781 C 17 2.5940781 16.730109 2.4073906 16.476562 2.4511719 z M 4 5 C 2.9069372 5 2 5.9069372 2 7 L 2 14 C 2 15.093063 2.9069372 16 4 16 L 7 16 L 7 19 C 7 20.105 7.895 21 9 21 L 16 21 C 17.105 21 18 20.105 18 19 L 18 12 C 18 10.895 17.105 10 16 10 L 13 10 L 13 7 C 13 5.9069372 12.093063 5 11 5 L 4 5 z M 4 7 L 11 7 L 11 14 L 4 14 L 4 7 z"})),Pk=Nd((0,i.jsx)("path",{d:"M 10 2 L 9 3 L 3 3 L 3 5 L 21 5 L 21 3 L 15 3 L 14 2 L 10 2 z M 4.3652344 7 L 5.8925781 20.263672 C 6.0245781 21.253672 6.877 22 7.875 22 L 16.123047 22 C 17.121047 22 17.974422 21.254859 18.107422 20.255859 L 19.634766 7 L 4.3652344 7 z"})),Rk={width:120,height:30},Lk=[{name:"Duplicate",icon:Fk,onClick:()=>{Yp().objects.duplicate()}},{name:"Flip",icon:Ok,onClick:()=>{Yp().objects.flipHorizontally()}},{name:"Bring to front",icon:Mk,onClick:()=>{Yp().objects.bringToFront()}},{name:"Delete",icon:Pk,onClick:()=>{Yp().objects.delete()}}],Nk=o.forwardRef((e,t)=>{const n=Gp(e=>e.objects.active.isMoving)?"opacity-0":"opacity-100";return(0,i.jsx)("div",{ref:t,className:`${n} absolute z-obj-box left-0 top-0 flex items-center text-white bg-controls rounded shadow transition-opacity overflow-hidden`,children:Lk.map(e=>{const t=e.icon;return(0,i.jsx)(YS,{size:"sm",className:"w-30 h-30 hover:bg-white/hover",radius:"rounded-none",onClick:e.onClick,children:(0,i.jsx)(t,{})},e.name)})})});function Dk(e,t){const n=Yp().objects.getActive();if(!n||!e.current)return;const r=e.current,i=vw.fabric.util.degreesToRadians(n.angle??0);let o=Math.round(n.getScaledWidth()*qp().zoom),a=Math.round(n.getScaledHeight()*qp().zoom),s=Math.round((n.left??0)*qp().zoom),l=Math.round((n.top??0)*qp().zoom);const c="center"===n.originX?o/2:0,u="center"===n.originY?a/2:0;n.padding&&(o+=2*n.padding,a+=2*n.padding,s-=n.padding,l-=n.padding),r.style.width=`${o}px`,r.style.height=`${a}px`,r.style.transform=`translate(${s-c}px, ${l-u}px) rotate(${i}rad)`,Yp().canvas.render(),function(e,t){if(!t)return;const n=e.angle||0,r=n>168&&n<188?-30:-15,i=qp().canvasSize,o=qp().stageSize,a=Rk,s=i.top-o.top,l=i.left-o.left,c=o.width-(l+i.width),u=o.height-(s+i.height),d=-s,h=-(i.left-o.left),f=i.width-a.width+c,p=i.height-a.height+u,g=e.getBoundingRect();let m=g.top-a.height+r,v=g.left+g.width/2-a.width/2;m=Math.min(p,Math.max(d,m)),v=Math.min(f,Math.max(h,v)),t.style.transform=`translate(${v}px, ${m}px) rotate(0deg)`}(n,t.current)}function zk(){return(0,i.jsx)("div",{className:"absolute -bottom-20 left-1/2 w-2 h-20 bg-white cursor-default -translate-x-1/2",children:(0,i.jsx)("div",{"data-rotate-handle":!0,className:"w-18 h-18 absolute -bottom-10 -left-8 bg-white rounded-full cursor-move"})})}let Bk={};function Uk(e){const t=Bk.centerX||0,n=Bk.centerY||0;return Math.atan2(n-e.pageY,t-e.pageX)-(Bk.startAngle||0)}const Vk=(e={})=>{Cw(null),Bk=e};function Hk(){const e=(0,o.useRef)(null),t=(0,o.useRef)(null),n=Gp(e=>e.objects.active.id),r=Gp(e=>e.objects.isEditingText),a=Gp(e=>e.zoom),s=function(){const e=Yp().objects.getActive();if(!e||!e.name)return{};const t=qp().config.objectControls||{},n=e.name;return{...t.global,...t[n]}}(),l=(0,o.useRef)(null),c=(0,o.useCallback)(()=>{l.current?(clearTimeout(l.current),l.current=null,function(){var e;const t=Yp().objects.getActive();Uf(t)&&(t.enterEditing(),null==(e=t.hiddenTextarea)||e.focus())}()):l.current=setTimeout(()=>{l.current=null},300)},[]);let{moveProps:u}=jk({boundaryRef:qp().canvasRef,restrictWithinBoundary:!1,onMoveEnd:()=>{qp().objects.setActiveIsMoving(!1)},onMove:e=>{qp().objects.setActiveIsMoving(!0),function(e){const t=e.rect.width/2,n=e.rect.height/2;Yp().objects.setValues({left:(e.rect.left+t)/qp().zoom,top:(e.rect.top+n)/qp().zoom})}(e)}});s.lockMovement&&(u={});const{resizeProps:d}=Ck({minWidth:50,minHeight:50,aspectRatio:s.unlockAspectRatio?null:"initial",boundaryRef:s.containWithinCanvas?qp().canvasRef:void 0,restrictWithinBoundary:!1,onResizeEnd:()=>{qp().objects.setActiveIsMoving(!1)},onResize:e=>{qp().objects.setActiveIsMoving(!0),function(e){const t=Yp().objects.getActive();if(!t)return;const n={};Uf(t)?(e.deltaX>0||t.getScaledHeight()>=20&&t.getScaledWidth()>=20)&&(n.fontSize=(t.fontSize||1)+e.deltaX):(t.width&&(n.scaleX=e.rect.width/qp().zoom/t.width),t.height&&(n.scaleY=e.rect.height/qp().zoom/t.height)),Yp().objects.setValues(n)}(e)}}),{rotateProps:h}=function(e){const t={onMoveStart:(t,n)=>{var r,i;if(!t.target.dataset.rotateHandle||xw)return!1;const o=yk(n.getBoundingClientRect());if(!o)return!1;const a=null==(r=n.style.transform.match(/rotate\((.+?)\)/))?void 0:r[1],[s="0"]=a?a.split(","):[];Vk({currentRect:o,centerX:o.left+o.width/2,centerY:o.top+o.height/2,startAngle:parseFloat(s)}),Cw("rotate"),Bk.startAngle=Uk(t),null==(i=e.onRotateStart)||i.call(e,mk({rect:o,e:t}))},onMove:(t,n,r)=>{var i;if(!Bk.currentRect)return;const o={...Bk.currentRect};o.angle=Uk(t),o.left+=n,o.top+=r,null==(i=e.onRotate)||i.call(e,mk({rect:o,e:t,deltaX:n,deltaY:r})),Bk.currentRect=o},onMoveEnd:t=>{var n;Bk.currentRect&&(null==(n=e.onRotateEnd)||n.call(e,mk({rect:Bk.currentRect,e:t}))),Vk()}},{domProps:n}=vk(t);return{rotateProps:n}}({boundaryRef:qp().canvasRef,onRotateEnd:()=>{qp().objects.setActiveIsMoving(!1)},onRotate:e=>{qp().objects.setActiveIsMoving(!0),function(e){const t=Yp().objects.getActive();if(!t||!e.rect.angle)return;const n=vw.fabric.util.radiansToDegrees(e.rect.angle);n!==t.angle&&Yp().objects.setValues({angle:n})}(e)}});return(0,o.useEffect)(()=>{Xp()&&qp().editor.on("object:modified",n=>{n.sizeOrPositionChanged&&Dk(e,t)})},[]),(0,o.useEffect)(()=>{Dk(e,t)},[n,a,r]),(0,i.jsxs)("div",{className:n&&!r?"block":"hidden",children:[(0,i.jsxs)("div",{ref:e,...nw(h,d,u),onClick:c,className:"absolute z-obj-box border-2 border-white shadow-md cursor-move",children:[!s.hideTopLeft&&(0,i.jsx)(_k,{position:bk.topLeft}),!s.hideTopRight&&(0,i.jsx)(_k,{position:bk.topRight}),!s.hideBottomLeft&&(0,i.jsx)(_k,{position:bk.bottomLeft}),!s.hideBottomRight&&(0,i.jsx)(_k,{position:bk.bottomRight}),!s.hideRotatingPoint&&(0,i.jsx)(zk,{})]}),(0,i.jsx)(Nk,{ref:t})]})}function Wk(){const e=Gp(e=>e.activeTool===Od.CROP),t=Gp(e=>e.objects.active.id);return(0,i.jsxs)("div",{children:[e&&(0,i.jsx)(Tk,{}),t&&(0,i.jsx)(Hk,{})]})}const $k=function(e){return e.forEach(rk),function(e,t){const{handlers:n,nativeHandlers:r,config:i}=function(e,t){const[n,r,i]=function(e){const t={},n={},r=new Set;for(let i in e)pk.test(i)?(r.add(RegExp.lastMatch),n[i]=e[i]):t[i]=e[i];return[n,t,r]}(e),o={};return gk(i,n,"onDrag","drag",o,t),gk(i,n,"onWheel","wheel",o,t),gk(i,n,"onScroll","scroll",o,t),gk(i,n,"onPinch","pinch",o,t),gk(i,n,"onMove","move",o,t),gk(i,n,"onHover","hover",o,t),{handlers:o,config:t,nativeHandlers:r}}(e,t||{});return function(e,t={},n,r){const i=o.useMemo(()=>new dk(e),[]);if(i.applyHandlers(e,r),i.applyConfig(t,n),o.useEffect(i.effect.bind(i)),o.useEffect(()=>i.clean.bind(i),[]),void 0===t.target)return i.bind.bind(i)}(n,i,void 0,r)}}([ik,ok]),Gk=o.forwardRef((e,t)=>{const[n,r]=(0,o.useState)(!1);return(0,o.useEffect)(()=>Gp.subscribe(e=>e.loading,e=>{r(!e)}),[]),(0,i.jsx)(qk,{children:(0,i.jsxs)(Pb.div,{initial:{opacity:0},variants:{visible:{opacity:1,transition:{duration:.35,delay:.5}},hidden:{opacity:0,transition:{duration:0}}},animate:n?"visible":"hidden",className:"relative m-auto w-max",style:{backgroundImage:`url(${Lw("images/empty-canvas-bg.png")})`},children:[(0,i.jsx)(Wk,{}),(0,i.jsx)("canvas",{ref:t})]})})});function qk({children:e}){const t=(0,o.useRef)(null),n=$k({onPinch:e=>{if(!Yp().zoom.allowUserZoom||!Yk(e))return e.cancel();1===e.direction[0]?Yp().zoom.zoomIn(.01):Yp().zoom.zoomOut(.01),e.event.stopPropagation(),e.event.preventDefault()},onDrag:e=>{if(e.pinching||!Yk(e))return e.cancel();t.current.scrollLeft-=e.delta[0],t.current.scrollTop-=e.delta[1]}});return(0,i.jsx)("div",{ref:t,className:"w-full h-full overflow-hidden touch-none flex",...n(),children:e})}function Yk(e){return!(Xp().findTarget(e.event,!1)||Xp().isDrawingMode)}function Xk({actionBtn:e,children:t,className:n}){return(0,i.jsxs)("div",{className:Pd(n,"flex gap-16 items-center h-full"),children:[e&&(0,i.jsx)("div",{className:"flex-shrink-0",children:e}),(0,i.jsx)("div",{className:"w-full flex-auto",children:t}),e&&(0,i.jsx)("div",{className:"w-96"})]})}function Kk(){return(Kk=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Zk(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)t.indexOf(n=o[r])>=0||(i[n]=e[n]);return i}function Jk(e){var t=(0,o.useRef)(e),n=(0,o.useRef)(function(e){t.current&&t.current(e)});return t.current=e,n.current}var Qk,eE,tE,nE,rE,iE,oE,aE,sE,lE,cE,uE,dE,hE,fE,pE,gE,mE,vE,yE,bE,wE,xE,CE,_E,SE,AE,kE,EE,IE,jE,TE,FE,OE,ME,PE=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e<t?t:e},RE=function(e){return"touches"in e},LE=function(e){return e&&e.ownerDocument.defaultView||self},NE=function(e,t,n){var r=e.getBoundingClientRect(),i=RE(t)?function(e,t){for(var n=0;n<e.length;n++)if(e[n].identifier===t)return e[n];return e[0]}(t.touches,n):t;return{left:PE((i.pageX-(r.left+LE(e).pageXOffset))/r.width),top:PE((i.pageY-(r.top+LE(e).pageYOffset))/r.height)}},DE=function(e){!RE(e)&&e.preventDefault()},zE=o.memo(function(e){var t=e.onMove,n=e.onKey,r=Zk(e,["onMove","onKey"]),i=(0,o.useRef)(null),a=Jk(t),s=Jk(n),l=(0,o.useRef)(null),c=(0,o.useRef)(!1),u=(0,o.useMemo)(function(){var e=function(e){DE(e),(RE(e)?e.touches.length>0:e.buttons>0)&&i.current?a(NE(i.current,e,l.current)):n(!1)},t=function(){return n(!1)};function n(n){var r=c.current,o=LE(i.current),a=n?o.addEventListener:o.removeEventListener;a(r?"touchmove":"mousemove",e),a(r?"touchend":"mouseup",t)}return[function(e){var t,r=e.nativeEvent,o=i.current;if(o&&(DE(r),t=r,(!c.current||RE(t))&&o)){if(RE(r)){c.current=!0;var s=r.changedTouches||[];s.length&&(l.current=s[0].identifier)}o.focus(),a(NE(o,r,l.current)),n(!0)}},function(e){var t=e.which||e.keyCode;t<37||t>40||(e.preventDefault(),s({left:39===t?.05:37===t?-.05:0,top:40===t?.05:38===t?-.05:0}))},n]},[s,a]),d=u[0],h=u[1],f=u[2];return(0,o.useEffect)(function(){return f},[f]),o.createElement("div",Kk({},r,{onTouchStart:d,onMouseDown:d,className:"react-colorful__interactive",ref:i,onKeyDown:h,tabIndex:0,role:"slider"}))}),BE=function(e){return e.filter(Boolean).join(" ")},UE=function(e){var t=e.color,n=e.left,r=e.top,i=void 0===r?.5:r,a=BE(["react-colorful__pointer",e.className]);return o.createElement("div",{className:a,style:{top:100*i+"%",left:100*n+"%"}},o.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},VE=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n},HE=function(e){return"#"===e[0]&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?VE(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:8===e.length?VE(parseInt(e.substring(6,8),16)/255,2):1}},WE=function(e){var t=function(e){var t=e.s,n=e.v,r=e.a,i=(200-t)*n/100;return{h:VE(e.h),s:VE(i>0&&i<200?t*n/100/(i<=100?i:200-i)*100:0),l:VE(i/2),a:VE(r,2)}}(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},$E=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},GE=o.memo(function(e){var t=e.hue,n=e.onChange,r=BE(["react-colorful__hue",e.className]);return o.createElement("div",{className:r},o.createElement(zE,{onMove:function(e){n({h:360*e.left})},onKey:function(e){n({h:PE(t+360*e.left,0,360)})},"aria-label":"Hue","aria-valuenow":VE(t),"aria-valuemax":"360","aria-valuemin":"0"},o.createElement(UE,{className:"react-colorful__hue-pointer",left:t/360,color:WE({h:t,s:100,v:100,a:1})})))}),qE=o.memo(function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:WE({h:t.h,s:100,v:100,a:1})};return o.createElement("div",{className:"react-colorful__saturation",style:r},o.createElement(zE,{onMove:function(e){n({s:100*e.left,v:100-100*e.top})},onKey:function(e){n({s:PE(t.s+100*e.left,0,100),v:PE(t.v-100*e.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+VE(t.s)+"%, Brightness "+VE(t.v)+"%"},o.createElement(UE,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:WE(t)})))}),YE=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0},XE=typeof window<"u"?o.useLayoutEffect:o.useEffect,KE=new Map,ZE=function(e){var t=e.className,r=e.colorModel,i=e.color,a=void 0===i?r.defaultColor:i,s=e.onChange,l=Zk(e,["className","colorModel","color","onChange"]),c=(0,o.useRef)(null);!function(e){XE(function(){var t=e.current?e.current.ownerDocument:document;if(void 0!==t&&!KE.has(t)){var r=t.createElement("style");r.innerHTML='.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url(\'data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>\')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}',KE.set(t,r);var i=n.nc;i&&r.setAttribute("nonce",i),t.head.appendChild(r)}},[])}(c);var u=function(e,t,n){var r=Jk(n),i=(0,o.useState)(function(){return e.toHsva(t)}),a=i[0],s=i[1],l=(0,o.useRef)({color:t,hsva:a});(0,o.useEffect)(function(){if(!e.equal(t,l.current.color)){var n=e.toHsva(t);l.current={hsva:n,color:t},s(n)}},[t,e]),(0,o.useEffect)(function(){var t;YE(a,l.current.hsva)||e.equal(t=e.fromHsva(a),l.current.color)||(l.current={hsva:a,color:t},r(t))},[a,e,r]);var c=(0,o.useCallback)(function(e){s(function(t){return Object.assign({},t,e)})},[]);return[a,c]}(r,a,s),d=u[0],h=u[1],f=BE(["react-colorful",t]);return o.createElement("div",Kk({},l,{ref:c,className:f}),o.createElement(qE,{hsva:d,onChange:h}),o.createElement(GE,{hue:d.h,onChange:h,className:"react-colorful__last-control"}))},JE={defaultColor:"000",toHsva:function(e){return function(e){var t=e.r,n=e.g,r=e.b,i=e.a,o=Math.max(t,n,r),a=o-Math.min(t,n,r),s=a?o===t?(n-r)/a:o===n?2+(r-t)/a:4+(t-n)/a:0;return{h:VE(60*(s<0?s+6:s)),s:VE(o?a/o*100:0),v:VE(o/255*100),a:i}}(HE(e))},fromHsva:function(e){return function(e){return function(e){var t=e.r,n=e.g,r=e.b,i=e.a,o=i<1?$E(VE(255*i)):"";return"#"+$E(t)+$E(n)+$E(r)+o}(function(e){var t=e.h,n=e.s,r=e.v,i=e.a;t=t/360*6,n/=100,r/=100;var o=Math.floor(t),a=r*(1-n),s=r*(1-(t-o)*n),l=r*(1-(1-t+o)*n),c=o%6;return{r:VE(255*[r,s,a,a,l,r][c]),g:VE(255*[l,r,r,s,a,a][c]),b:VE(255*[a,a,l,r,r,s][c]),a:VE(i,2)}}(e))}({h:e.h,s:e.s,v:e.v,a:1})},equal:function(e,t){return e.toLowerCase()===t.toLowerCase()||YE(HE(e),HE(t))}},QE=function(e){return o.createElement(ZE,Kk({},e,{colorModel:JE}))},eI=/^#?([0-9A-F]{3,8})$/i,tI=function(e){var t=e.color,n=void 0===t?"":t,r=e.onChange,i=e.onBlur,a=e.escape,s=e.validate,l=e.format,c=e.process,u=Zk(e,["color","onChange","onBlur","escape","validate","format","process"]),d=(0,o.useState)(function(){return a(n)}),h=d[0],f=d[1],p=Jk(r),g=Jk(i),m=(0,o.useCallback)(function(e){var t=a(e.target.value);f(t),s(t)&&p(c?c(t):t)},[a,c,s,p]),v=(0,o.useCallback)(function(e){s(e.target.value)||f(a(n)),g(e)},[n,a,s,g]);return(0,o.useEffect)(function(){f(a(n))},[n,a]),o.createElement("input",Kk({},u,{value:l?l(h):h,spellCheck:"false",onChange:m,onBlur:v}))},nI=function(e){return"#"+e},rI=function(e){var t=e.prefixed,n=e.alpha,r=Zk(e,["prefixed","alpha"]),i=(0,o.useCallback)(function(e){return e.replace(/([^0-9A-F]+)/gi,"").substring(0,n?8:6)},[n]),a=(0,o.useCallback)(function(e){return function(e,t){var n=eI.exec(e),r=n?n[1].length:0;return 3===r||6===r||!!t&&4===r||!!t&&8===r}(e,n)},[n]);return o.createElement(tI,Kk({},r,{escape:i,format:t?nI:void 0,process:nI,validate:a}))};Qk={alpha:"\u0623\u0644\u0641\u0627",black:"\u0623\u0633\u0648\u062f",blue:"\u0623\u0632\u0631\u0642","blue purple":"\u0623\u0631\u062c\u0648\u0627\u0646\u064a \u0645\u0632\u0631\u0642",brightness:"\u0627\u0644\u0633\u0637\u0648\u0639",brown:"\u0628\u0646\u064a","brown yellow":"\u0623\u0635\u0641\u0631 \u0628\u0646\u064a",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"\u0633\u0645\u0627\u0648\u064a","cyan blue":"\u0623\u0632\u0631\u0642 \u0633\u0645\u0627\u0648\u064a",dark:"\u062f\u0627\u0643\u0646",gray:"\u0631\u0645\u0627\u062f\u064a",grayish:"\u0645\u0627\u0626\u0644 \u0644\u0644\u0631\u0645\u0627\u062f\u064a",green:"\u0623\u062e\u0636\u0631","green cyan":"\u0633\u0645\u0627\u0648\u064a \u0645\u062e\u0636\u0631",hue:"\u062f\u0631\u062c\u0629 \u0627\u0644\u0644\u0648\u0646",light:"\u0641\u0627\u062a\u062d",lightness:"\u0627\u0644\u0625\u0636\u0627\u0621\u0629",magenta:"\u0623\u0631\u062c\u0648\u0627\u0646\u064a","magenta pink":"\u0623\u0631\u062c\u0648\u0627\u0646\u064a \u0648\u0631\u062f\u064a",orange:"\u0628\u0631\u062a\u0642\u0627\u0644\u064a","orange yellow":"\u0623\u0635\u0641\u0631 \u0628\u0631\u062a\u0642\u0627\u0644\u064a",pale:"\u0628\u0627\u0647\u062a",pink:"\u0648\u0631\u062f\u064a","pink red":"\u0623\u062d\u0645\u0631 \u0648\u0631\u062f\u064a",purple:"\u0623\u0631\u062c\u0648\u0627\u0646\u064a","purple magenta":"\u0628\u0646\u0641\u0633\u062c\u064a",red:"\u0623\u062d\u0645\u0631","red orange":"\u0628\u0631\u062a\u0642\u0627\u0644\u064a \u0645\u062d\u0645\u0631",saturation:"\u0627\u0644\u062a\u0634\u0628\u0639",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} \u0634\u0641\u0627\u0641`,"very dark":"\u062f\u0627\u0643\u0646 \u062c\u062f\u064b\u0627","very light":"\u0641\u0627\u062a\u062d \u062c\u062f\u064b\u0627",vibrant:"\u0633\u0627\u0637\u0639",white:"\u0623\u0628\u064a\u0636",yellow:"\u0623\u0635\u0641\u0631","yellow green":"\u0623\u062e\u0636\u0631 \u0645\u0635\u0641\u0631"},eE={alpha:"\u0410\u043b\u0444\u0430",black:"\u0447\u0435\u0440\u043d\u043e",blue:"\u0421\u0438\u043d\u044c\u043e","blue purple":"\u0441\u0438\u043d\u044c\u043e \u043b\u0438\u043b\u0430\u0432\u043e",brightness:"\u042f\u0440\u043a\u043e\u0441\u0442",brown:"\u043a\u0430\u0444\u044f\u0432\u043e","brown yellow":"\u043a\u0430\u0444\u044f\u0432\u043e \u0436\u044a\u043b\u0442\u043e",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"\u0446\u0438\u0430\u043d","cyan blue":"\u0446\u0438\u0430\u043d \u0441\u0438\u043d\u044c\u043e",dark:"\u0442\u044a\u043c\u043d\u043e",gray:"\u0441\u0438\u0432\u043e",grayish:"\u0441\u0438\u0432\u043a\u0430\u0432",green:"\u0417\u0435\u043b\u0435\u043d\u043e","green cyan":"\u0437\u0435\u043b\u0435\u043d \u0446\u0438\u0430\u043d",hue:"\u041e\u0442\u0442\u0435\u043d\u044a\u043a",light:"\u0441\u0432\u0435\u0442\u043b\u043e",lightness:"\u041b\u0435\u043a\u043e\u0442\u0430",magenta:"\u043c\u0430\u0433\u0435\u043d\u0442\u0430","magenta pink":"\u043c\u0430\u0433\u0435\u043d\u0442\u0430 \u0440\u043e\u0437\u043e\u0432\u043e",orange:"\u043e\u0440\u0430\u043d\u0436\u0435\u0432\u043e","orange yellow":"\u043e\u0440\u0430\u043d\u0436\u0435\u0432\u043e \u0436\u044a\u043b\u0442\u043e",pale:"\u0431\u043b\u0435\u0434\u043e",pink:"\u0440\u043e\u0437\u043e\u0432\u043e","pink red":"\u0440\u043e\u0437\u043e\u0432\u043e \u0447\u0435\u0440\u0432\u0435\u043d\u043e",purple:"\u043b\u0438\u043b\u0430\u0432\u043e","purple magenta":"\u043b\u0438\u043b\u0430\u0432\u043e \u043c\u0430\u0433\u0435\u043d\u0442\u0430",red:"\u0427\u0435\u0440\u0432\u0435\u043d\u043e","red orange":"\u0447\u0435\u0440\u0432\u0435\u043d \u043f\u043e\u0440\u0442\u043e\u043a\u0430\u043b",saturation:"\u041d\u0430\u0441\u0438\u0442\u0435\u043d\u043e\u0441\u0442",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u0435\u043d`,"very dark":"\u043c\u043d\u043e\u0433\u043e \u0442\u044a\u043c\u043d\u043e","very light":"\u043c\u043d\u043e\u0433\u043e \u0441\u0432\u0435\u0442\u043b\u043e",vibrant:" \u044f\u0440\u043a\u043e",white:"\u0431\u044f\u043b\u043e",yellow:"\u0436\u044a\u043b\u0442\u043e","yellow green":"\u0436\u044a\u043b\u0442\u043e \u0437\u0435\u043b\u0435\u043d"},tE={alpha:"Alfa",black:"\u010dern\xe1",blue:"Modr\xe1","blue purple":"modrofialov\xe1",brightness:"Jas",brown:"hn\u011bd\xe1","brown yellow":"hn\u011bdo\u017elut\xe1",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"tyrkysov\xe1","cyan blue":"tyrkysovomodr\xe1",dark:"tmav\xe1",gray:"\u0161ed\xe1",grayish:"na\u0161edl\xe1",green:"Zelen\xe1","green cyan":"zelenotyrkysov\xe1",hue:"Odst\xedn",light:"sv\u011btl\xe1",lightness:"Sv\u011btlost",magenta:"purpurov\xe1","magenta pink":"purpurov\u011b r\u016f\u017eov\xe1",orange:"oran\u017eov\xe1","orange yellow":"oran\u017eovo\u017elut\xe1",pale:"bled\xe1",pink:"r\u016f\u017eov\xe1","pink red":"r\u016f\u017eovo\u010derven\xe1",purple:"fialov\xe1","purple magenta":"fialov\u011b purpurov\xe1",red:"\u010cerven\xe1","red orange":"\u010dervenooran\u017eov\xe1",saturation:"Sytost",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} pr\u016fhledn\xe9`,"very dark":"velmi tmav\xe1","very light":"velmi sv\u011btl\xe1",vibrant:"z\xe1\u0159iv\xe1",white:"b\xedl\xe1",yellow:"\u017elut\xe1","yellow green":"\u017elutozelen\xe1"},nE={alpha:"Alfa",black:"sort",blue:"Bl\xe5","blue purple":"bl\xe5lilla",brightness:"Lysstyrke",brown:"brun","brown yellow":"brungul",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"cyan","cyan blue":"cyan bl\xe5",dark:"m\xf8rk",gray:"gr\xe5",grayish:"gr\xe5lig",green:"Gr\xf8n","green cyan":"gr\xf8n cyan",hue:"Tone",light:"lys",lightness:"Lyshed",magenta:"magenta","magenta pink":"magenta pink",orange:"orange","orange yellow":"orangegul",pale:"bleg",pink:"lyser\xf8d","pink red":"lyser\xf8dlig r\xf8d",purple:"lilla","purple magenta":"lilla magenta",red:"R\xf8d","red orange":"r\xf8dorange",saturation:"Farvem\xe6tning",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} gennemsigtig`,"very dark":"meget m\xf8rk","very light":"meget lys",vibrant:"klar",white:"hvid",yellow:"gul","yellow green":"gulgr\xf8n"},rE={alpha:"Alpha",black:"Schwarz",blue:"Blau","blue purple":"Blaulila",brightness:"Helligkeit",brown:"Braun","brown yellow":"Braungelb",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"Cyan","cyan blue":"Cyanblau",dark:"dunkles",gray:"Grau",grayish:"gr\xe4uliches",green:"Gr\xfcn","green cyan":"Gr\xfcncyan",hue:"Farbton",light:"helles",lightness:"Leuchtkraft",magenta:"Magenta","magenta pink":"Magentarosa",orange:"Orange","orange yellow":"Orangegelb",pale:"blasses",pink:"Rosa","pink red":"Rosarot",purple:"Lila","purple magenta":"Lilamagenta",red:"Rot","red orange":"Rotorange",saturation:"S\xe4ttigung",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, zu ${e.percentTransparent} transparent`,"very dark":"sehr dunkles","very light":"sehr helles",vibrant:"lebhaftes",white:"Wei\xdf",yellow:"Gelb","yellow green":"Gelbgr\xfcn"},iE={alpha:"\u0386\u03bb\u03c6\u03b1",black:"\u03bc\u03b1\u03cd\u03c1\u03bf",blue:"\u039c\u03c0\u03bb\u03b5","blue purple":"\u03bc\u03c0\u03bb\u03b5 \u03bc\u03c9\u03b2",brightness:"\u03a6\u03c9\u03c4\u03b5\u03b9\u03bd\u03cc\u03c4\u03b7\u03c4\u03b1",brown:"\u03ba\u03b1\u03c6\u03ad","brown yellow":"\u03ba\u03b1\u03c6\u03ad \u03ba\u03af\u03c4\u03c1\u03b9\u03bd\u03bf",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"\u03ba\u03c5\u03b1\u03bd\u03cc","cyan blue":"\u03ba\u03c5\u03b1\u03bd\u03cc \u03bc\u03c0\u03bb\u03b5",dark:"\u03c3\u03ba\u03bf\u03cd\u03c1\u03bf",gray:"\u03b3\u03ba\u03c1\u03b9",grayish:"\u03b3\u03ba\u03c1\u03b9\u03b6\u03c9\u03c0\u03cc",green:"\u03a0\u03c1\u03ac\u03c3\u03b9\u03bd\u03bf","green cyan":"\u03c0\u03c1\u03ac\u03c3\u03b9\u03bd\u03bf \u03ba\u03c5\u03b1\u03bd\u03cc",hue:"\u03a4\u03cc\u03bd\u03bf\u03c2",light:"\u03b1\u03bd\u03bf\u03b9\u03c7\u03c4\u03cc",lightness:"\u03a6\u03c9\u03c4\u03b5\u03b9\u03bd\u03cc\u03c4\u03b7\u03c4\u03b1",magenta:"\u03bc\u03b1\u03c4\u03b6\u03ad\u03bd\u03c4\u03b1","magenta pink":"\u03bc\u03b1\u03c4\u03b6\u03ad\u03bd\u03c4\u03b1 \u03c1\u03bf\u03b6",orange:"\u03c0\u03bf\u03c1\u03c4\u03bf\u03ba\u03b1\u03bb\u03af","orange yellow":"\u03c0\u03bf\u03c1\u03c4\u03bf\u03ba\u03b1\u03bb\u03af \u03ba\u03af\u03c4\u03c1\u03b9\u03bd\u03bf",pale:"\u03b1\u03bd\u03bf\u03b9\u03c7\u03c4\u03cc",pink:"\u03c1\u03bf\u03b6","pink red":"\u03c1\u03bf\u03b6 \u03ba\u03cc\u03ba\u03ba\u03b9\u03bd\u03bf",purple:"\u03bc\u03c9\u03b2","purple magenta":"\u03bc\u03c9\u03b2 \u03bc\u03b1\u03c4\u03b6\u03ad\u03bd\u03c4\u03b1",red:"\u039a\u03cc\u03ba\u03ba\u03b9\u03bd\u03bf","red orange":"\u03ba\u03cc\u03ba\u03ba\u03b9\u03bd\u03bf \u03c0\u03bf\u03c1\u03c4\u03bf\u03ba\u03b1\u03bb\u03af",saturation:"\u039a\u03bf\u03c1\u03b5\u03c3\u03bc\u03cc\u03c2",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} \u03b4\u03b9\u03b1\u03c6\u03b1\u03bd\u03ad\u03c2`,"very dark":"\u03c0\u03bf\u03bb\u03cd \u03c3\u03ba\u03bf\u03cd\u03c1\u03bf","very light":"\u03c0\u03bf\u03bb\u03cd \u03b1\u03bd\u03bf\u03b9\u03c7\u03c4\u03cc",vibrant:"\u03ad\u03bd\u03c4\u03bf\u03bd\u03bf",white:"\u03bb\u03b5\u03c5\u03ba\u03cc",yellow:"\u03ba\u03af\u03c4\u03c1\u03b9\u03bd\u03bf","yellow green":"\u03ba\u03af\u03c4\u03c1\u03b9\u03bd\u03bf \u03c0\u03c1\u03ac\u03c3\u03b9\u03bd\u03bf"},oE={hue:"Hue",saturation:"Saturation",lightness:"Lightness",brightness:"Brightness",red:"Red",green:"Green",blue:"Blue",alpha:"Alpha",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} transparent`,"very dark":"very dark",dark:"dark",light:"light","very light":"very light",pale:"pale",grayish:"grayish",vibrant:"vibrant",black:"black",white:"white",gray:"gray",pink:"pink","pink red":"pink red","red orange":"red orange",brown:"brown",orange:"orange","orange yellow":"orange yellow","brown yellow":"brown yellow",yellow:"yellow","yellow green":"yellow green","green cyan":"green cyan",cyan:"cyan","cyan blue":"cyan blue","blue purple":"blue purple",purple:"purple","purple magenta":"purple magenta",magenta:"magenta","magenta pink":"magenta pink"},aE={alpha:"Alpha",black:"negro",blue:"Azul","blue purple":"p\xfarpura azulado",brightness:"Brillo",brown:"marr\xf3n","brown yellow":"amarillo amarronado",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"cian","cyan blue":"azul cian",dark:"oscuro",gray:"gris",grayish:"gris\xe1ceo",green:"Verde","green cyan":"cian verdoso",hue:"Tono",light:"claro",lightness:"Luminosidad",magenta:"magenta","magenta pink":"rosa magenta",orange:"naranja","orange yellow":"amarillo anaranjado",pale:"p\xe1lido",pink:"rosa","pink red":"rojo rosado",purple:"morado","purple magenta":"magenta viol\xe1ceo",red:"Rojo","red orange":"naranja rojizo",saturation:"Saturaci\xf3n",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} transparente`,"very dark":"muy oscuro","very light":"muy claro",vibrant:"intenso",white:"blanco",yellow:"amarillo","yellow green":"verde amarillento"},sE={alpha:"Alfa",black:"must",blue:"Sinine","blue purple":"sinakaslilla",brightness:"Heledus",brown:"pruun","brown yellow":"pruunikaskollane",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"ts\xfcaan","cyan blue":"ts\xfcaansinine",dark:"tume",gray:"hall",grayish:"hallikas",green:"Roheline","green cyan":"ts\xfcaanroheline",hue:"V\xe4rv",light:"valgus",lightness:"Valgus",magenta:"magentapunane","magenta pink":"magentaroosa",orange:"oran\u017e","orange yellow":"oran\u017eikaskollane",pale:"kahvatu",pink:"roosa","pink red":"vaarikapunane",purple:"lilla","purple magenta":"purpurne magenta",red:"Punane","red orange":"punakasoran\u017e",saturation:"K\xfcllastus",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} l\xe4bipaistev`,"very dark":"v\xe4ga tume","very light":"v\xe4ga hele",vibrant:"ere",white:"valge",yellow:"kollane","yellow green":"kollakasroheline"},lE={alpha:"Alpha",black:"musta",blue:"Sininen","blue purple":"sinivioletti",brightness:"Kirkkaus",brown:"ruskea","brown yellow":"ruskeankeltainen",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"syaani","cyan blue":"syaaninsininen",dark:"tumma",gray:"harmaa",grayish:"harmahtava",green:"Vihre\xe4","green cyan":"vihre\xe4nsyaani",hue:"S\xe4vy",light:"vaalea",lightness:"Valom\xe4\xe4r\xe4",magenta:"magenta","magenta pink":"magentapinkki",orange:"oranssi","orange yellow":"oranssinkeltainen",pale:"vaalea",pink:"pinkki","pink red":"vaaleanpunainen",purple:"violetti","purple magenta":"violettimagenta",red:"Punainen","red orange":"punaoranssi",saturation:"V\xe4rikyll\xe4isyys",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} l\xe4pin\xe4kyv\xe4`,"very dark":"hyvin tumma","very light":"eritt\xe4in vaalea",vibrant:"eloisa",white:"valkea",yellow:"keltainen","yellow green":"keltavihre\xe4"},cE={alpha:"Alpha",black:"Noir",blue:"Bleu","blue purple":"Violet bleu",brightness:"Luminosit\xe9",brown:"Brun","brown yellow":"Jaune brun",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"Cyan","cyan blue":"Bleu cyan",dark:"Sombre",gray:"Gris",grayish:"Gris\xe2tre",green:"Vert","green cyan":"Cyan vert",hue:"Teinte",light:"Clair",lightness:"Luminosit\xe9",magenta:"Magenta","magenta pink":"Rose magenta",orange:"Orange","orange yellow":"Jaune orang\xe9",pale:"P\xe2le",pink:"Rose","pink red":"Rouge ros\xe9",purple:"Violet","purple magenta":"Magenta violet",red:"Rouge","red orange":"Orange rouge",saturation:"Saturation",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} transparent`,"very dark":"Tr\xe8s sombre","very light":"Tr\xe8s clair",vibrant:"Vif",white:"Blanc",yellow:"Jaune","yellow green":"Vert jaune"},uE={alpha:"\u05d0\u05dc\u05e4\u05d0",black:"\u05e9\u05d7\u05d5\u05e8",blue:"\u05db\u05d7\u05d5\u05dc","blue purple":"\u05db\u05d7\u05d5\u05dc \u05e1\u05d2\u05d5\u05dc",brightness:"\u05d1\u05d4\u05d9\u05e8\u05d5\u05ea",brown:"\u05d7\u05d5\u05dd","brown yellow":"\u05d7\u05d5\u05dd \u05e6\u05d4\u05d5\u05d1",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"\u05d8\u05d5\u05e8\u05e7\u05d9\u05d6","cyan blue":"\u05db\u05d7\u05d5\u05dc \u05e6\u05d9\u05d0\u05df",dark:"\u05db\u05d4\u05d4",gray:"\u05d0\u05e4\u05d5\u05e8",grayish:"\u05d0\u05e4\u05e8\u05e4\u05e8",green:"\u05d9\u05e8\u05d5\u05e7","green cyan":"\u05e6\u05d9\u05d0\u05df \u05d9\u05e8\u05d5\u05e7",hue:"\u05d2\u05d5\u05d5\u05df",light:"\u05d0\u05d5\u05e8",lightness:"\u05db\u05de\u05d5\u05ea \u05d0\u05d5\u05e8",magenta:"\u05de\u05d2'\u05e0\u05d8\u05d4","magenta pink":"\u05d5\u05e8\u05d5\u05d3 \u05de\u05d2'\u05e0\u05d8\u05d4",orange:"\u05db\u05ea\u05d5\u05dd","orange yellow":"\u05db\u05ea\u05d5\u05dd \u05e6\u05d4\u05d5\u05d1",pale:"\u05d7\u05d9\u05d5\u05d5\u05e8",pink:"\u05d5\u05e8\u05d5\u05d3","pink red":"\u05d5\u05e8\u05d5\u05d3 \u05d0\u05d3\u05d5\u05dd",purple:"\u05e1\u05d2\u05d5\u05dc","purple magenta":"\u05de\u05d2'\u05e0\u05d8\u05d4 \u05e1\u05d2\u05d5\u05dc",red:"\u05d0\u05d3\u05d5\u05dd","red orange":"\u05db\u05ea\u05d5\u05dd \u05d0\u05d3\u05d5\u05dd",saturation:"\u05e8\u05d5\u05d5\u05d9\u05d4",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} \u05e9\u05e7\u05d5\u05e3`,"very dark":"\u05db\u05d4\u05d4 \u05de\u05d0\u05d5\u05d3","very light":"\u05d1\u05d4\u05d9\u05e8 \u05de\u05d0\u05d5\u05d3",vibrant:"\u05ea\u05d5\u05e1\u05e1",white:"\u05dc\u05d1\u05df",yellow:"\u05e6\u05d4\u05d5\u05d1","yellow green":"\u05e6\u05d4\u05d5\u05d1 \u05d9\u05e8\u05d5\u05e7"},dE={alpha:"Alfa",black:"crno",blue:"Plava","blue purple":"plavo ljubi\u010dasta",brightness:"Svjetlina",brown:"sme\u0111a","brown yellow":"sme\u0111e \u017euta",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"cijan","cyan blue":"cijan plava",dark:"tamno",gray:"siva",grayish:"sivkasto",green:"Zelena","green cyan":"zelena cijan",hue:"Nijansa",light:"svjetlo",lightness:"Osvijetljenost",magenta:"magenta","magenta pink":"magentno ru\u017ei\u010dasta",orange:"naran\u010dasta","orange yellow":"naran\u010dasto \u017euta",pale:"blijeda",pink:"ru\u017ei\u010dasta","pink red":"ru\u017ei\u010dasto crvena",purple:"ljubi\u010dasta","purple magenta":"ljubi\u010dasta magenta",red:"Crvena","red orange":"crveno naran\u010dasta",saturation:"Zasi\u0107enost",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} prozirnosti`,"very dark":"jako tamna","very light":"vrlo svijetlo",vibrant:"vibrantna",white:"bijela",yellow:"\u017euto","yellow green":"\u017euto zelena"},hE={alpha:"Alfa",black:"fekete",blue:"K\xe9k","blue purple":"k\xe9k lila",brightness:"F\xe9nyess\xe9g",brown:"barna","brown yellow":"barna s\xe1rga",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"ci\xe1nk\xe9k","cyan blue":"ci\xe1nk\xe9k",dark:"s\xf6t\xe9t",gray:"sz\xfcrke",grayish:"sz\xfcrk\xe9s",green:"Z\xf6ld","green cyan":"z\xf6ld ci\xe1nk\xe9k",hue:"Sz\xedn\xe1rnyalat",light:"vil\xe1gos",lightness:"Vil\xe1goss\xe1g",magenta:"b\xedbor","magenta pink":"b\xedbor r\xf3zsasz\xedn",orange:"narancs","orange yellow":"narancss\xe1rga",pale:"halv\xe1ny",pink:"r\xf3zsasz\xedn","pink red":"r\xf3zsasz\xedn piros",purple:"lila","purple magenta":"lila b\xedbor",red:"Piros","red orange":"piros narancs",saturation:"Tel\xedtetts\xe9g",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} \xe1tl\xe1tsz\xf3`,"very dark":"nagyon s\xf6t\xe9t","very light":"nagyon vil\xe1gos",vibrant:"\xe9l\xe9nk",white:"feh\xe9r",yellow:"s\xe1rga","yellow green":"s\xe1rga z\xf6ld"},fE={alpha:"Alfa",black:"nero",blue:"Blu","blue purple":"blu viola",brightness:"Luminosit\xe0",brown:"marrone","brown yellow":"giallo bruno",colorName:e=>`${e.hue} ${e.chroma} ${e.lightness}`,cyan:"ciano","cyan blue":"blu ciano",dark:"scuro",gray:"grigio",grayish:"grigiastro",green:"Verde","green cyan":"verde ciano",hue:"Tonalit\xe0",light:"chiaro",lightness:"Luminosit\xe0",magenta:"magenta","magenta pink":"rosa magenta",orange:"arancio","orange yellow":"giallo arancio",pale:"tenue",pink:"rosa","pink red":"rosa rosso",purple:"viola","purple magenta":"viola magenta",red:"Rosso","red orange":"rosso arancio",saturation:"Saturazione",transparentColorName:e=>`${e.hue} ${e.chroma} ${e.lightness}, trasparenza ${e.percentTransparent}`,"very dark":"molto scuro","very light":"molto chiaro",vibrant:"vivace",white:"bianco",yellow:"giallo","yellow green":"giallo verde"},pE={alpha:"\u30a2\u30eb\u30d5\u30a1",black:"\u30d6\u30e9\u30c3\u30af",blue:"\u9752","blue purple":"\u30d6\u30eb\u30fc\u30d1\u30fc\u30d7\u30eb",brightness:"\u660e\u308b\u3055",brown:"\u30d6\u30e9\u30a6\u30f3","brown yellow":"\u30d6\u30e9\u30a6\u30f3\u30a4\u30a8\u30ed\u30fc",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"\u30b7\u30a2\u30f3","cyan blue":"\u30b7\u30a2\u30f3\u30d6\u30eb\u30fc",dark:"\u30c0\u30fc\u30af",gray:"\u30b0\u30ec\u30fc",grayish:"\u30b0\u30ec\u30a4\u30c3\u30b7\u30e5",green:"\u7dd1","green cyan":"\u30b0\u30ea\u30fc\u30f3\u30b7\u30a2\u30f3",hue:"\u8272\u76f8",light:"\u30e9\u30a4\u30c8",lightness:"\u660e\u5ea6",magenta:"\u30de\u30bc\u30f3\u30bf","magenta pink":"\u30de\u30bc\u30f3\u30bf\u30d4\u30f3\u30af",orange:"\u30aa\u30ec\u30f3\u30b8","orange yellow":"\u30aa\u30ec\u30f3\u30b8\u30a4\u30a8\u30ed\u30fc",pale:"\u30da\u30fc\u30eb",pink:"\u30d4\u30f3\u30af","pink red":"\u30d4\u30f3\u30af\u30ec\u30c3\u30c9",purple:"\u30d1\u30fc\u30d7\u30eb","purple magenta":"\u30d1\u30fc\u30d7\u30eb\u30de\u30bc\u30f3\u30bf",red:"\u8d64","red orange":"\u30ec\u30c3\u30c9\u30aa\u30ec\u30f3\u30b8",saturation:"\u5f69\u5ea6",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} \u900f\u660e`,"very dark":"\u6700\u3082\u6697\u3044","very light":"\u30d9\u30ea\u30fc\u30e9\u30a4\u30c8",vibrant:"\u9bae\u3084\u304b",white:"\u30db\u30ef\u30a4\u30c8",yellow:"\u30a4\u30a8\u30ed\u30fc","yellow green":"\u30a4\u30a8\u30ed\u30fc\u30b0\u30ea\u30fc\u30f3"},gE={alpha:"\uc54c\ud30c",black:"\uac80\uc740\uc0c9",blue:"\ud30c\ub791","blue purple":"\uccad\uc790\uc0c9",brightness:"\uba85\ub3c4",brown:"\uac08\uc0c9","brown yellow":"\ud669\uac08\uc0c9",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"\uccad\ub85d\uc0c9","cyan blue":"\uccad\ub85d\uc0c9",dark:"\ub2e4\ud06c",gray:"\ud68c\uc0c9",grayish:"\ud68c\uac08\uc0c9",green:"\ucd08\ub85d","green cyan":"\uccad\ub85d\uc0c9",hue:"\uc0c9\uc870",light:"\ub77c\uc774\ud2b8",lightness:"\ubc1d\uae30",magenta:"\uc790\ud64d\uc0c9","magenta pink":"\ub9c8\uc820\ud0c0 \ud551\ud06c",orange:"\uc8fc\ud669\uc0c9","orange yellow":"\ubd88\uadf8\uc2a4\ub984\ud55c \ub178\ub791",pale:"\ud759\uc0c9",pink:"\ubd84\ud64d\uc0c9","pink red":"\ud551\ud06c \ub808\ub4dc",purple:"\uc790\uc8fc\uc0c9","purple magenta":"\ubcf4\ub77c\ube5b \uc790\ud64d\uc0c9",red:"\ube68\uac15","red orange":"\ubd89\uc740 \uc8fc\ud669\uc0c9",saturation:"\ucc44\ub3c4",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} \ud22c\uba85\ub3c4`,"very dark":"\ub9e4\uc6b0 \uc5b4\ub450\uc6b4","very light":"\ub9e4\uc6b0 \uc5f0\ud568",vibrant:"\uac15\ub82c\ud55c",white:"\ud770\uc0c9",yellow:"\ub178\ub780\uc0c9","yellow green":"\uc5f0\ub450\uc0c9"},mE={alpha:"Alfa",black:"juoda",blue:"M\u0117lyna","blue purple":"melsvai violetin\u0117",brightness:"Ry\u0161kumas",brown:"ruda","brown yellow":"rusvai geltona",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"\u017ealsvai m\u0117lyna","cyan blue":"\u017ealsvai m\u0117lyna",dark:"tamsi",gray:"pilka",grayish:"pilk\u0161va",green:"\u017dalia","green cyan":"\u017ealsvai m\u0117lyna",hue:"Atspalvis",light:"\u0161viesi",lightness:"\u0160viesumas",magenta:"rausvai raudona","magenta pink":"purpurin\u0117",orange:"oran\u017ein\u0117","orange yellow":"oran\u017einio atspalvio geltona",pale:"bly\u0161ki",pink:"ro\u017ein\u0117","pink red":"ro\u017ein\u0117 raudona",purple:"violetin\u0117","purple magenta":"purpurin\u0117 rausvai raudona",red:"Raudona","red orange":"rausvai oran\u017ein\u0117",saturation:"\u012esotinimas",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} skaidri`,"very dark":"labai tamsi","very light":"labai \u0161viesi",vibrant:"ry\u0161ki",white:"balta",yellow:"geltona","yellow green":"gelsvai \u017ealia"},vE={alpha:"Alfa",black:"melns",blue:"Zila","blue purple":"zili violets",brightness:"Spilgtums",brown:"br\u016bns","brown yellow":"br\u016bni dzeltens",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"ci\u0101ns","cyan blue":"ci\u0101na zils",dark:"tum\u0161s",gray:"pel\u0113ks",grayish:"pel\u0113c\u012bgs",green:"Za\u013ca","green cyan":"za\u013c\u0161 ci\u0101ns",hue:"Nokr\u0101sa",light:"gai\u0161s",lightness:"Gai\u0161ums",magenta:"fuksiju","magenta pink":"fuksiju roz\u0101",orange:"oran\u017es","orange yellow":"oran\u017ei dzeltens",pale:"b\u0101ls",pink:"roz\u0101","pink red":"roz\u012bgi sarkans",purple:"violets","purple magenta":"violets fuksiju",red:"Sarkana","red orange":"sarkan\u012bgi oran\u017es",saturation:"Pies\u0101tin\u0101jums",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} caursp\u012bd\u012bgs`,"very dark":"\u013coti tum\u0161s","very light":"\u013coti gai\u0161s",vibrant:"ko\u0161s",white:"balts",yellow:"dzeltens","yellow green":"dzelteni za\u013c\u0161"},yE={alpha:"Alfa",black:"svart",blue:"Bl\xe5","blue purple":"bl\xe5lilla",brightness:"Lysstyrke",brown:"brun","brown yellow":"brungul",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"cyan","cyan blue":"cyanbl\xe5",dark:"m\xf8rk",gray:"gr\xe5",grayish:"gr\xe5aktig",green:"Gr\xf8nn","green cyan":"gr\xf8nncyan",hue:"Fargetone",light:"lys",lightness:"Lyshet",magenta:"magenta","magenta pink":"magentarosa",orange:"oransje","orange yellow":"oransjegul",pale:"blek",pink:"rosa","pink red":"rosar\xf8d",purple:"lilla","purple magenta":"lillamagenta",red:"R\xf8d","red orange":"r\xf8doransje",saturation:"Metning",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} gjennomsiktig`,"very dark":"sv\xe6rt m\xf8rk","very light":"sv\xe6rt lys",vibrant:"levende",white:"hvit",yellow:"gul","yellow green":"gulgr\xf8nn"},bE={alpha:"Alfa",black:"zwart",blue:"Blauw","blue purple":"paarsblauw",brightness:"Helderheid",brown:"bruin","brown yellow":"bruingeel",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"cyaan","cyan blue":"cyaanblauw",dark:"donker",gray:"grijs",grayish:"grijsachtig",green:"Groen","green cyan":"cyaangroen",hue:"Kleurtoon",light:"licht",lightness:"Lichtsterkte",magenta:"magenta","magenta pink":"magentaroze",orange:"oranje","orange yellow":"oranjegeel",pale:"bleek",pink:"roze","pink red":"rozerood",purple:"paars","purple magenta":"magentapaars",red:"Rood","red orange":"roodoranje",saturation:"Verzadiging",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} transparant`,"very dark":"heel donker","very light":"heel licht",vibrant:"levendig",white:"wit",yellow:"geel","yellow green":"geelgroen"},wE={alpha:"Alfa",black:"czarny",blue:"Niebieski","blue purple":"niebiesko-fioletowy",brightness:"Jasno\u015b\u0107",brown:"br\u0105zowy","brown yellow":"br\u0105zowo-\u017c\xf3\u0142ty",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"cyjanowy","cyan blue":"cyjanowo-niebieski",dark:"ciemny",gray:"szary",grayish:"szarawy",green:"Zielony","green cyan":"zielono-cyjanowy",hue:"Odcie\u0144",light:"jasny",lightness:"Jaskrawo\u015b\u0107",magenta:"purpurowy","magenta pink":"purpurowo-r\xf3\u017cowy",orange:"pomara\u0144czowy","orange yellow":"pomara\u0144czowo-\u017c\xf3\u0142ty",pale:"blady",pink:"r\xf3\u017cowy","pink red":"r\xf3\u017cowo-czerwony",purple:"fioletowy","purple magenta":"fioletowo-purpurowy",red:"Czerwony","red orange":"czerwono-pomara\u0144czowy",saturation:"Nasycenie",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} przezroczysto\u015bci`,"very dark":"bardzo ciemny","very light":"bardzo jasny",vibrant:"intensywny",white:"bia\u0142y",yellow:"\u017c\xf3\u0142ty","yellow green":"\u017c\xf3\u0142to-zielony"},xE={alpha:"Alfa",black:"preto",blue:"Azul","blue purple":"roxo azulado",brightness:"Brilho",brown:"marrom","brown yellow":"marrom amarelado",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"ciano","cyan blue":"azul-ciano",dark:"escuro",gray:"cinza",grayish:"acinzentado",green:"Verde","green cyan":"verde-ciano",hue:"Matiz",light:"claro",lightness:"Luminosidade",magenta:"magenta","magenta pink":"rosa-magenta",orange:"laranja","orange yellow":"amarelo alaranjado",pale:"p\xe1lido",pink:"rosa","pink red":"rosa avermelhado",purple:"roxo","purple magenta":"roxo-magenta",red:"Vermelho","red orange":"laranja avermelhado",saturation:"Satura\xe7\xe3o",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} transparente`,"very dark":"muito escuro","very light":"muito claro",vibrant:"vibrante",white:"branco",yellow:"amarelo","yellow green":"verde amarelado"},CE={alpha:"Alfa",black:"preto",blue:"Azul","blue purple":"azul-p\xfarpura",brightness:"Luminosidade",brown:"castanho","brown yellow":"amarelo-castanho",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"ciano","cyan blue":"azul-ciano",dark:"escuro",gray:"cinzento",grayish:"acinzentado",green:"Verde","green cyan":"verde-ciano",hue:"Tonalidade",light:"claro",lightness:"Claridade",magenta:"magenta","magenta pink":"rosa-magenta",orange:"laranja","orange yellow":"amarelo-laranja",pale:"p\xe1lido",pink:"cor-de-rosa","pink red":"vermelho-rosa",purple:"p\xfarpura","purple magenta":"p\xfarpura-magenta",red:"Vermelho","red orange":"laranja-vermelho",saturation:"Satura\xe7\xe3o",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} transparente`,"very dark":"muito escuro","very light":"muito claro",vibrant:"vibrante",white:"branco",yellow:"amarelo","yellow green":"verde-amarelo"},_E={alpha:"Alfa",black:"negru",blue:"Albastru","blue purple":"albastru-violet",brightness:"Luminozitate",brown:"maro","brown yellow":"galben maro",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"bleu","cyan blue":"albastru-bleu",dark:"\xeenchis",gray:"gri",grayish:"cenu\u0219iu",green:"Verde","green cyan":"verde bleu",hue:"Nuan\u021b\u0103",light:"deschis",lightness:"Luminozitate",magenta:"fucsia","magenta pink":"roz-fucsia",orange:"portocaliu","orange yellow":"galben-portocaliu",pale:"pal",pink:"roz","pink red":"roz-ro\u0219u",purple:"violet","purple magenta":"violet-fucsia",red:"Ro\u0219u","red orange":"portocaliu-ro\u0219u",saturation:"Satura\u021bie",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} transparent`,"very dark":"foarte \xeenchis","very light":"foarte deschis",vibrant:"plin de via\u021b\u0103",white:"alb",yellow:"galben","yellow green":"galben-verde"},SE={alpha:"\u0410\u043b\u044c\u0444\u0430",black:"\u0447\u0435\u0440\u043d\u044b\u0439",blue:"\u0421\u0438\u043d\u0438\u0439","blue purple":"\u0441\u0438\u043d\u0435-\u0444\u0438\u043e\u043b\u0435\u0442\u043e\u0432\u044b\u0439",brightness:"\u042f\u0440\u043a\u043e\u0441\u0442\u044c",brown:"\u043a\u043e\u0440\u0438\u0447\u043d\u0435\u0432\u044b\u0439","brown yellow":"\u043a\u043e\u0440\u0438\u0447\u043d\u0435\u0432\u043e-\u0436\u0435\u043b\u0442\u044b\u0439",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"\u0433\u043e\u043b\u0443\u0431\u043e\u0439","cyan blue":"\u0446\u0432\u0435\u0442 \u043c\u043e\u0440\u0441\u043a\u043e\u0439 \u0432\u043e\u043b\u043d\u044b",dark:"\u0442\u0435\u043c\u043d\u044b\u0439",gray:"\u0441\u0435\u0440\u044b\u0439",grayish:"\u0441\u0435\u0440\u043e\u0432\u0430\u0442\u044b\u0439",green:"\u0417\u0435\u043b\u0435\u043d\u044b\u0439","green cyan":"\u0441\u0438\u043d\u0435-\u0437\u0435\u043b\u0435\u043d\u044b\u0439",hue:"\u041e\u0442\u0442\u0435\u043d\u043e\u043a",light:"\u0441\u0432\u0435\u0442\u043b\u044b\u0439",lightness:"\u041e\u0441\u0432\u0435\u0449\u0435\u043d\u043d\u043e\u0441\u0442\u044c",magenta:"\u043f\u0443\u0440\u043f\u0443\u0440\u043d\u044b\u0439","magenta pink":"\u043f\u0443\u0440\u043f\u0443\u0440\u043d\u043e-\u0440\u043e\u0437\u043e\u0432\u044b\u0439",orange:"\u043e\u0440\u0430\u043d\u0436\u0435\u0432\u044b\u0439","orange yellow":"\u043e\u0440\u0430\u043d\u0436\u0435\u0432\u043e-\u0436\u0435\u043b\u0442\u044b\u0439",pale:"\u0431\u043b\u0435\u0434\u043d\u044b\u0439",pink:"\u0440\u043e\u0437\u043e\u0432\u044b\u0439","pink red":"\u0440\u043e\u0437\u043e\u0432\u043e-\u043a\u0440\u0430\u0441\u043d\u044b\u0439",purple:"\u0444\u0438\u043e\u043b\u0435\u0442\u043e\u0432\u044b\u0439","purple magenta":"\u0444\u0438\u043e\u043b\u0435\u0442\u043e\u0432\u043e-\u043f\u0443\u0440\u043f\u0443\u0440\u043d\u044b\u0439",red:"\u041a\u0440\u0430\u0441\u043d\u044b\u0439","red orange":"\u043a\u0440\u0430\u0441\u043d\u043e-\u043e\u0440\u0430\u043d\u0436\u0435\u0432\u044b\u0439",saturation:"\u041d\u0430\u0441\u044b\u0449\u0435\u043d\u043d\u043e\u0441\u0442\u044c",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u044b\u0439 \u043d\u0430 ${e.percentTransparent}`,"very dark":"\u043e\u0447\u0435\u043d\u044c \u0442\u0435\u043c\u043d\u044b\u0439","very light":"\u043e\u0447\u0435\u043d\u044c \u0441\u0432\u0435\u0442\u043b\u044b\u0439",vibrant:"\u044f\u0440\u043a\u0438\u0439",white:"\u0431\u0435\u043b\u044b\u0439",yellow:"\u0436\u0435\u043b\u0442\u044b\u0439","yellow green":"\u0436\u0435\u043b\u0442\u043e-\u0437\u0435\u043b\u0435\u043d\u044b\u0439"},AE={alpha:"Alfa",black:"\u010dierna",blue:"Modr\xe1","blue purple":"modrofialov\xe1",brightness:"Jas",brown:"hned\xe1","brown yellow":"hnedo\u017elt\xe1",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"az\xfarov\xe1","cyan blue":"az\xfarov\xe1 modr\xe1",dark:"tmav\xe1",gray:"siv\xe1",grayish:"sivast\xe1",green:"Zelen\xe1","green cyan":"zelen\xe1 az\xfarov\xe1",hue:"Odtie\u0148",light:"svetl\xe1",lightness:"Svetlos\u0165",magenta:"purpurov\xe1","magenta pink":"ru\u017eov\xe1 purpurov\xe1",orange:"oran\u017eov\xe1","orange yellow":"oran\u017eovo\u017elt\xe1",pale:"bled\xe1",pink:"ru\u017eov\xe1","pink red":"ru\u017eovo\u010derven\xe1",purple:"fialov\xe1","purple magenta":"fialov\xe1 purpurov\xe1",red:"\u010cerven\xe1","red orange":"\u010dervenooran\u017eov\xe1",saturation:"S\xfdtos\u0165",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} prieh\u013eadn\xe1`,"very dark":"ve\u013emi tmav\xe1","very light":"ve\u013emi svetl\xe1",vibrant:"energick\xe1",white:"biela",yellow:"\u017elt\xe1","yellow green":"\u017eltozelen\xe1"},kE={alpha:"Alfa",black:"\u010drna",blue:"Modra","blue purple":"modro vijoli\u010dna",brightness:"Svetlost",brown:"rjava","brown yellow":"rjavo rumena",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"cian","cyan blue":"cian modra",dark:"temna",gray:"siva",grayish:"sivkasta",green:"Zelena","green cyan":"zelena cian",hue:"Barva",light:"svetla",lightness:"Lahkost",magenta:"\u0161krlatna","magenta pink":"\u0161krlatno roza",orange:"oran\u017ena","orange yellow":"oran\u017eno rumena",pale:"bleda",pink:"roza","pink red":"roza rde\u010da",purple:"vijoli\u010dna","purple magenta":"vijoli\u010dno \u0161krlatna",red:"Rde\u010da","red orange":"rde\u010de oran\u017ena",saturation:"Nasi\u010denost",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} prozorna`,"very dark":"zelo temna","very light":"zelo svetla",vibrant:"\u017eivahna",white:"bela",yellow:"rumena","yellow green":"rumeno zelena"},EE={alpha:"Alfa",black:"crno",blue:"Plava","blue purple":"plavoljubi\u010dasta",brightness:"Osvetljenost",brown:"sme\u0111a","brown yellow":"sme\u0111e\u017euta",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"cijan","cyan blue":"cijan plava",dark:"tamno",gray:"siva",grayish:"sivkasta",green:"Zelena","green cyan":"zeleno cijan",hue:"Nijansa",light:"svetla",lightness:"Osvetljenje",magenta:"purpurnocrvena","magenta pink":"magenta ru\u017ei\u010dasta",orange:"narand\u017easta","orange yellow":"narand\u017easto\u017euta",pale:"bledo",pink:"ru\u017ei\u010dasta","pink red":"ru\u017ei\u010dastocrvena",purple:"ljubi\u010dasta","purple magenta":"ljubi\u010dasta magenta",red:"Crvena","red orange":"crvenonarand\u017easta",saturation:"Zasi\u0107enje",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} prozirna`,"very dark":"veoma tamno","very light":"vrlo svetlo",vibrant:"\u017eivopisna",white:"bela",yellow:"\u017euto","yellow green":"\u017eutozelena"},IE={alpha:"Alfa",black:"svart",blue:"Bl\xe5tt","blue purple":"bl\xe5lila",brightness:"Ljusstyrka",brown:"brun","brown yellow":"brungul",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"cyan","cyan blue":"cyanbl\xe5",dark:"m\xf6rk",gray:"gr\xe5",grayish:"gr\xe5aktig",green:"Gr\xf6nt","green cyan":"gr\xf6n cyan",hue:"Nyans",light:"ljus",lightness:"Ljushet",magenta:"magenta","magenta pink":"magentarosa",orange:"orange","orange yellow":"orangegul",pale:"blek",pink:"rosa","pink red":"rosar\xf6d",purple:"lila","purple magenta":"lila magenta",red:"R\xf6tt","red orange":"r\xf6dorange",saturation:"M\xe4ttnad",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} genomskinlig`,"very dark":"mycket m\xf6rk","very light":"mycket ljus",vibrant:"livfull",white:"vit",yellow:"gul","yellow green":"gulgr\xf6n"},jE={alpha:"Alfa",black:"siyah",blue:"Mavi","blue purple":"mavi mor",brightness:"Parlakl\u0131k",brown:"kahverengi","brown yellow":"kahverengi sar\u0131",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"camg\xf6be\u011fi","cyan blue":"camg\xf6be\u011fi mavi",dark:"koyu",gray:"gri",grayish:"grimsi",green:"Ye\u015fil","green cyan":"ye\u015fil camg\xf6be\u011fi",hue:"Ton",light:"a\xe7\u0131k",lightness:"Canl\u0131l\u0131k",magenta:"eflatun","magenta pink":"eflatun pembe",orange:"turuncu","orange yellow":"turuncu sar\u0131",pale:"solgun",pink:"pembe","pink red":"pembe k\u0131rm\u0131z\u0131",purple:"mor","purple magenta":"mor eflatun",red:"K\u0131rm\u0131z\u0131","red orange":"k\u0131rm\u0131z\u0131 portakal",saturation:"Doygunluk",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} saydam`,"very dark":"\xe7ok koyu","very light":"\xe7ok a\xe7\u0131k",vibrant:"canl\u0131",white:"beyaz",yellow:"sar\u0131","yellow green":"sar\u0131 ye\u015fil"},TE={alpha:"\u0410\u043b\u044c\u0444\u0430",black:"\u0447\u043e\u0440\u043d\u0438\u0439",blue:"\u0421\u0438\u043d\u0456\u0439","blue purple":"\u0441\u0438\u043d\u044c\u043e-\u0444\u0456\u043e\u043b\u0435\u0442\u043e\u0432\u0438\u0439",brightness:"\u042f\u0441\u043a\u0440\u0430\u0432\u0456\u0441\u0442\u044c",brown:"\u043a\u043e\u0440\u0438\u0447\u043d\u0435\u0432\u0438\u0439","brown yellow":"\u043a\u043e\u0440\u0438\u0447\u043d\u0435\u0432\u043e-\u0436\u043e\u0432\u0442\u0438\u0439",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"\u0431\u043b\u0430\u043a\u0438\u0442\u043d\u0438\u0439","cyan blue":"\u0441\u0438\u043d\u044c\u043e-\u0431\u043b\u0430\u043a\u0438\u0442\u043d\u0438\u0439",dark:"\u0442\u0435\u043c\u043d\u0438\u0439",gray:"\u0441\u0456\u0440\u0438\u0439",grayish:"\u0441\u0456\u0440\u0443\u0432\u0430\u0442\u0438\u0439",green:"\u0417\u0435\u043b\u0435\u043d\u0438\u0439","green cyan":"\u0437\u0435\u043b\u0435\u043d\u043e-\u0431\u043b\u0430\u043a\u0438\u0442\u043d\u0438\u0439",hue:"\u0422\u043e\u043d",light:"\u0441\u0432\u0456\u0442\u043b\u0438\u0439",lightness:"\u041e\u0441\u0432\u0456\u0442\u043b\u0435\u043d\u0456\u0441\u0442\u044c",magenta:"\u043f\u0443\u0440\u043f\u0443\u0440\u043e\u0432\u0438\u0439","magenta pink":"\u043f\u0443\u0440\u043f\u0443\u0440\u043e\u0432\u043e-\u0440\u043e\u0436\u0435\u0432\u0438\u0439",orange:"\u043f\u043e\u043c\u0430\u0440\u0430\u043d\u0447\u0435\u0432\u0438\u0439","orange yellow":"\u043f\u043e\u043c\u0430\u0440\u0430\u043d\u0447\u0435\u0432\u043e-\u0436\u043e\u0432\u0442\u0438\u0439",pale:"\u0431\u043b\u0456\u0434\u0438\u0439",pink:"\u0440\u043e\u0436\u0435\u0432\u0438\u0439","pink red":"\u0440\u043e\u0436\u0435\u0432\u043e-\u0447\u0435\u0440\u0432\u043e\u043d\u0438\u0439",purple:"\u0444\u0456\u043e\u043b\u0435\u0442\u043e\u0432\u0438\u0439","purple magenta":"\u0444\u0456\u043e\u043b\u0435\u0442\u043e\u0432\u043e-\u043f\u0443\u0440\u043f\u0443\u0440\u043e\u0432\u0438\u0439",red:"\u0427\u0435\u0440\u0432\u043e\u043d\u0438\u0439","red orange":"\u0447\u0435\u0440\u0432\u043e\u043d\u043e-\u043f\u043e\u043c\u0430\u0440\u0430\u043d\u0447\u0435\u0432\u0438\u0439",saturation:"\u041d\u0430\u0441\u0438\u0447\u0435\u043d\u0456\u0441\u0442\u044c",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, \u043f\u0440\u043e\u0437\u043e\u0440\u0438\u0439 \u043d\u0430 ${e.percentTransparent}`,"very dark":"\u0434\u0443\u0436\u0435 \u0442\u0435\u043c\u043d\u0438\u0439","very light":"\u0434\u0443\u0436\u0435 \u0441\u0432\u0456\u0442\u043b\u0438\u0439",vibrant:"\u044f\u0441\u043a\u0440\u0430\u0432\u0438\u0439",white:"\u0431\u0456\u043b\u0438\u0439",yellow:"\u0436\u043e\u0432\u0442\u0438\u0439","yellow green":"\u0436\u043e\u0432\u0442\u043e-\u0437\u0435\u043b\u0435\u043d\u0438\u0439"},FE={alpha:"Alpha",black:"\u9ed1\u8272",blue:"\u84dd\u8272","blue purple":"\u84dd\u7d2b\u8272",brightness:"\u4eae\u5ea6",brown:"\u68d5\u8272\u7684","brown yellow":"\u68d5\u9ec4\u8272",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"\u84dd\u7eff\u8272","cyan blue":"\u9752\u84dd\u8272",dark:"\u6df1\u8272",gray:"\u7070\u8272",grayish:"\u6d45\u7070\u8272\u7684",green:"\u7eff\u8272","green cyan":"\u7eff\u9752\u8272",hue:"\u8272\u76f8",light:"\u6d45\u8272",lightness:"\u660e\u4eae\u5ea6",magenta:"\u7d2b\u7ea2\u8272","magenta pink":"\u7d2b\u7c89\u8272",orange:"\u6a59\u8272","orange yellow":"\u6a59\u9ec4\u8272",pale:"\u82cd\u767d\u7684",pink:"\u7c89\u8272","pink red":"\u7c89\u7ea2\u8272",purple:"\u7d2b\u8272","purple magenta":"\u7d2b\u6d0b\u7ea2\u8272",red:"\u7ea2\u8272","red orange":"\u7ea2\u6a59\u8272",saturation:"\u9971\u548c\u5ea6",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} \u900f\u660e`,"very dark":"\u5f88\u6697","very light":"\u5f88\u6d45",vibrant:"\u751f\u673a\u52c3\u52c3",white:"\u767d\u8272",yellow:"\u9ec4\u8272","yellow green":"\u9ec4\u8272/\u7eff\u8272"},OE={alpha:"Alpha",black:"\u9ed1",blue:"\u85cd\u8272","blue purple":"\u85cd\u7d2b",brightness:"\u4eae\u5ea6",brown:"\u68d5","brown yellow":"\u68d5\u9ec3",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"\u9752","cyan blue":"\u9752\u85cd",dark:"\u6697",gray:"\u7070",grayish:"\u504f\u7070",green:"\u7da0\u8272","green cyan":"\u9752\u7da0",hue:"\u8272\u76f8",light:"\u6dfa",lightness:"\u660e\u4eae",magenta:"\u6d0b\u7d05","magenta pink":"\u6dfa\u6d0b\u7d05",orange:"\u6a59","orange yellow":"\u6a59\u9ec3",pale:"\u6de1",pink:"\u7c89\u7d05","pink red":"\u7c89\u7d05",purple:"\u7d2b","purple magenta":"\u7d2b\u6d0b\u7d05",red:"\u7d05\u8272","red orange":"\u6a59\u7d05",saturation:"\u98fd\u548c\u5ea6",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} \u900f\u660e`,"very dark":"\u5f88\u6697","very light":"\u5f88\u6dfa",vibrant:"\u9bae\u8c54",white:"\u767d",yellow:"\u9ec3","yellow green":"\u9ec3\u7da0"},ME={"ar-AE":Qk,"bg-BG":eE,"cs-CZ":tE,"da-DK":nE,"de-DE":rE,"el-GR":iE,"en-US":oE,"es-ES":aE,"et-EE":sE,"fi-FI":lE,"fr-FR":cE,"he-IL":uE,"hr-HR":dE,"hu-HU":hE,"it-IT":fE,"ja-JP":pE,"ko-KR":gE,"lt-LT":mE,"lv-LV":vE,"nb-NO":yE,"nl-NL":bE,"pl-PL":wE,"pt-BR":xE,"pt-PT":CE,"ro-RO":_E,"ru-RU":SE,"sk-SK":AE,"sl-SI":kE,"sr-SP":EE,"sv-SE":IE,"tr-TR":jE,"uk-UA":TE,"zh-CN":FE,"zh-TW":OE};const iI=Symbol.for("react-aria.i18n.locale"),oI=Symbol.for("react-aria.i18n.strings");let aI;class sI{getStringForLocale(e,t){let n=this.getStringsForLocale(t)[e];if(!n)throw new Error(`Could not find intl message ${e} in ${t} locale`);return n}getStringsForLocale(e){let t=this.strings[e];return t||(t=function(e,t,n="en-US"){if(t[e])return t[e];let r=function(e){return Intl.Locale?new Intl.Locale(e).language:e.split("-")[0]}(e);if(t[r])return t[r];for(let i in t)if(i.startsWith(r+"-"))return t[i];return t[n]}(e,this.strings,this.defaultLocale),this.strings[e]=t),t}static getGlobalDictionaryForPackage(e){if(typeof window>"u")return null;let t=window[iI];if(void 0===aI){let e=window[oI];if(!e)return null;aI={};for(let n in e)aI[n]=new sI({[t]:e[n]},t)}let n=null==aI?void 0:aI[e];if(!n)throw new Error(`Strings for package "${e}" were not included by LocalizedStringProvider. Please add it to the list passed to createLocalizedStringDictionary.`);return n}constructor(e,t="en-US"){this.strings=Object.fromEntries(Object.entries(e).filter(([,e])=>e)),this.defaultLocale=t}}const lI=new Map,cI=new Map;class uI{format(e,t){let n=this.strings.getStringForLocale(e,this.locale);return"function"==typeof n?n(t,this):n}plural(e,t,n="cardinal"){let r=t["="+e];if(r)return"function"==typeof r?r():r;let i=this.locale+":"+n,o=lI.get(i);return o||(o=new Intl.PluralRules(this.locale,{type:n}),lI.set(i,o)),r=t[o.select(e)]||t.other,"function"==typeof r?r():r}number(e){let t=cI.get(this.locale);return t||(t=new Intl.NumberFormat(this.locale),cI.set(this.locale,t)),t.format(e)}select(e,t){let n=e[t]||e.other;return"function"==typeof n?n():n}constructor(e,t){this.locale=e,this.strings=t}}let dI=new Map,hI=!1;try{hI="exceptZero"===new Intl.NumberFormat("de-DE",{signDisplay:"exceptZero"}).resolvedOptions().signDisplay}catch{}let fI=!1;try{fI="unit"===new Intl.NumberFormat("de-DE",{style:"unit",unit:"degree"}).resolvedOptions().style}catch{}const pI={degree:{narrow:{default:"\xb0","ja-JP":" \u5ea6","zh-TW":"\u5ea6","sl-SI":" \xb0"}}};class gI{format(e){let t="";if(t=hI||null==this.options.signDisplay?this.numberFormatter.format(e):function(e,t,n){if("auto"===t)return e.format(n);if("never"===t)return e.format(Math.abs(n));{let r=!1;if("always"===t?r=n>0||Object.is(n,0):"exceptZero"===t&&(Object.is(n,-0)||Object.is(n,0)?n=Math.abs(n):r=n>0),r){let t=e.format(-n),r=e.format(n),i=t.replace(r,"").replace(/\u200e|\u061C/,"");return t.replace(r,"!!!").replace(i,"+").replace("!!!",r)}return e.format(n)}}(this.numberFormatter,this.options.signDisplay,e),"unit"===this.options.style&&!fI){var n;let{unit:e,unitDisplay:r="short",locale:i}=this.resolvedOptions();if(!e)return t;let o=null===(n=pI[e])||void 0===n?void 0:n[r];t+=o[i]||o.default}return t}formatToParts(e){return this.numberFormatter.formatToParts(e)}formatRange(e,t){if("function"==typeof this.numberFormatter.formatRange)return this.numberFormatter.formatRange(e,t);if(t<e)throw new RangeError("End date must be >= start date");return`${this.format(e)} \u2013 ${this.format(t)}`}formatRangeToParts(e,t){if("function"==typeof this.numberFormatter.formatRangeToParts)return this.numberFormatter.formatRangeToParts(e,t);if(t<e)throw new RangeError("End date must be >= start date");let n=this.numberFormatter.formatToParts(e),r=this.numberFormatter.formatToParts(t);return[...n.map(e=>({...e,source:"startRange"})),{type:"literal",value:" \u2013 ",source:"shared"},...r.map(e=>({...e,source:"endRange"}))]}resolvedOptions(){let e=this.numberFormatter.resolvedOptions();return!hI&&null!=this.options.signDisplay&&(e={...e,signDisplay:this.options.signDisplay}),!fI&&"unit"===this.options.style&&(e={...e,style:"unit",unit:this.options.unit,unitDisplay:this.options.unitDisplay}),e}constructor(e,t={}){this.numberFormatter=function(e,t={}){let{numberingSystem:n}=t;if(n&&e.includes("-nu-")&&(e.includes("-u-")||(e+="-u-"),e+=`-nu-${n}`),"unit"===t.style&&!fI){var r;let{unit:e,unitDisplay:n="short"}=t;if(!e)throw new Error('unit option must be provided with style: "unit"');if(null===(r=pI[e])||void 0===r||!r[n])throw new Error(`Unsupported unit ${e} with unitDisplay = ${n}`);t={...t,style:"decimal"}}let i=e+(t?Object.entries(t).sort((e,t)=>e[0]<t[0]?-1:1).join():"");if(dI.has(i))return dI.get(i);let o=new Intl.NumberFormat(e,t);return dI.set(i,o),o}(e,t),this.options=t}}let mI=new sI(function(e){return e&&e.__esModule?e.default:e}(ME));const vI=[[0,"pink"],[15,"red"],[48,"orange"],[94,"yellow"],[135,"green"],[175,"cyan"],[264,"blue"],[284,"purple"],[320,"magenta"],[349,"pink"]];class yI{toHexInt(){return this.toFormat("rgb").toHexInt()}getChannelValue(e){if(e in this)return this[e];throw new Error("Unsupported color channel: "+e)}withChannelValue(e,t){if(e in this){let n=this.clone();return n[e]=t,n}throw new Error("Unsupported color channel: "+e)}getChannelName(e,t){return(sI.getGlobalDictionaryForPackage("@react-stately/color")||mI).getStringForLocale(e,t)}getColorSpaceAxes(e){let{xChannel:t,yChannel:n}=e,r=t||this.getColorChannels().find(e=>e!==n),i=n||this.getColorChannels().find(e=>e!==r),o=this.getColorChannels().find(e=>e!==r&&e!==i);return{xChannel:r,yChannel:i,zChannel:o}}getColorName(e){let t,[n,r,i]=AI(this),o=sI.getGlobalDictionaryForPackage("@react-stately/color")||mI;if(n>.999)return o.getStringForLocale("white",e);if(n<.001)return o.getStringForLocale("black",e);[t,n]=this.getOklchHue(n,r,i,e);let a="",s="";r<=.1&&r>=.001?s=n>=.7?"pale":"grayish":r>=.15&&(s="vibrant"),n<.3?a="very dark":n<.55?a="dark":n<.7||(a=n<.85?"light":"very light"),s&&(s=o.getStringForLocale(s,e)),a&&(a=o.getStringForLocale(a,e));let l=this.getChannelValue("alpha"),c=new uI(e,o);if(l<1){let n=new gI(e,{style:"percent"}).format(1-l);return c.format("transparentColorName",{lightness:a,chroma:s,hue:t,percentTransparent:n}).replace(/\s+/g," ").trim()}return c.format("colorName",{lightness:a,chroma:s,hue:t}).replace(/\s+/g," ").trim()}getOklchHue(e,t,n,r){let i=sI.getGlobalDictionaryForPackage("@react-stately/color")||mI;if(t<.001)return[i.getStringForLocale("gray",r),e];for(let o=0;o<vI.length;o++){let[t,a]=vI[o],[s,l]=vI[o+1]||[360,"pink"];if(n>=t&&n<s)return"orange"===a&&(e<.68?a="brown":e=e-.68+.55),n>t+(s-t)/2&&a!==l?a=`${a} ${l}`:"yellow"===a&&e<.85&&(a="yellow green"),[i.getStringForLocale(a,r).toLocaleLowerCase(r),e]}throw new Error("Unexpected hue")}getHueName(e){let[t,n,r]=AI(this),[i]=this.getOklchHue(t,n,r,e);return i}}class bI extends yI{static parse(e){let t=[];if(/^#[\da-f]+$/i.test(e)&&[4,5,7,9].includes(e.length)){const n=(e.length<6?e.replace(/[^#]/gi,"$&$&"):e).slice(1).split("");for(;n.length>0;)t.push(parseInt(n.splice(0,2).join(""),16));t[3]=void 0!==t[3]?t[3]/255:void 0}const n=e.match(/^rgba?\((.*)\)$/);var r;return null!=n&&n[1]&&(t=n[1].split(",").map(e=>Number(e.trim())),t=t.map((e,t)=>pw(e,0,t<3?255:1))),t.length<3?void 0:new bI(t[0],t[1],t[2],null!==(r=t[3])&&void 0!==r?r:1)}toString(e="css"){switch(e){case"hex":return"#"+(this.red.toString(16).padStart(2,"0")+this.green.toString(16).padStart(2,"0")+this.blue.toString(16).padStart(2,"0")).toUpperCase();case"hexa":return"#"+(this.red.toString(16).padStart(2,"0")+this.green.toString(16).padStart(2,"0")+this.blue.toString(16).padStart(2,"0")+Math.round(255*this.alpha).toString(16).padStart(2,"0")).toUpperCase();case"rgb":return`rgb(${this.red}, ${this.green}, ${this.blue})`;case"css":case"rgba":return`rgba(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`;default:return this.toFormat(e).toString(e)}}toFormat(e){switch(e){case"hex":case"hexa":case"rgb":case"rgba":return this;case"hsb":case"hsba":return this.toHSB();case"hsl":case"hsla":return this.toHSL();default:throw new Error("Unsupported color conversion: rgb -> "+e)}}toHexInt(){return this.red<<16|this.green<<8|this.blue}toHSB(){const e=this.red/255,t=this.green/255,n=this.blue/255,r=Math.min(e,t,n),i=Math.max(e,t,n),o=i-r,a=0===i?0:o/i;let s=0;if(0!==o){switch(i){case e:s=(t-n)/o+(t<n?6:0);break;case t:s=(n-e)/o+2;break;case n:s=(e-t)/o+4}s/=6}return new xI(mw(360*s,2),mw(100*a,2),mw(100*i,2),this.alpha)}toHSL(){const e=this.red/255,t=this.green/255,n=this.blue/255,r=Math.min(e,t,n),i=Math.max(e,t,n),o=(i+r)/2,a=i-r;let s,l;if(0===a)s=l=0;else{switch(l=a/(o<.5?i+r:2-i-r),i){case e:s=(t-n)/a+(t<n?6:0);break;case t:s=(n-e)/a+2;break;case n:s=(e-t)/a+4}s/=6}return new SI(mw(360*s,2),mw(100*l,2),mw(100*o,2),this.alpha)}clone(){return new bI(this.red,this.green,this.blue,this.alpha)}getChannelRange(e){switch(e){case"red":case"green":case"blue":return{minValue:0,maxValue:255,step:1,pageSize:17};case"alpha":return{minValue:0,maxValue:1,step:.01,pageSize:.1};default:throw new Error("Unknown color channel: "+e)}}getChannelFormatOptions(e){switch(e){case"red":case"green":case"blue":return{style:"decimal"};case"alpha":return{style:"percent"};default:throw new Error("Unknown color channel: "+e)}}formatChannelValue(e,t){let n=this.getChannelFormatOptions(e),r=this.getChannelValue(e);return new gI(t,n).format(r)}getColorSpace(){return"rgb"}getColorChannels(){return bI.colorChannels}constructor(e,t,n,r){super(),this.red=e,this.green=t,this.blue=n,this.alpha=r}}bI.colorChannels=["red","green","blue"];const wI=/hsb\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%)\)|hsba\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d(.\d+)?)\)/;class xI extends yI{static parse(e){let t;if(t=e.match(wI)){var n;const[e,r,i,o]=(null!==(n=t[1])&&void 0!==n?n:t[2]).split(",").map(e=>Number(e.trim().replace("%","")));return new xI(_I(e,360),pw(r,0,100),pw(i,0,100),pw(o??1,0,1))}}toString(e="css"){switch(e){case"css":return this.toHSL().toString("css");case"hex":return this.toRGB().toString("hex");case"hexa":return this.toRGB().toString("hexa");case"hsb":return`hsb(${this.hue}, ${mw(this.saturation,2)}%, ${mw(this.brightness,2)}%)`;case"hsba":return`hsba(${this.hue}, ${mw(this.saturation,2)}%, ${mw(this.brightness,2)}%, ${this.alpha})`;default:return this.toFormat(e).toString(e)}}toFormat(e){switch(e){case"hsb":case"hsba":return this;case"hsl":case"hsla":return this.toHSL();case"rgb":case"rgba":return this.toRGB();default:throw new Error("Unsupported color conversion: hsb -> "+e)}}toHSL(){let e=this.saturation/100,t=this.brightness/100,n=t*(1-e/2);return e=0===n||1===n?0:(t-n)/Math.min(n,1-n),new SI(mw(this.hue,2),mw(100*e,2),mw(100*n,2),this.alpha)}toRGB(){let e=this.hue,t=this.saturation/100,n=this.brightness/100,r=(r,i=(r+e/60)%6)=>n-t*n*Math.max(Math.min(i,4-i,1),0);return new bI(Math.round(255*r(5)),Math.round(255*r(3)),Math.round(255*r(1)),this.alpha)}clone(){return new xI(this.hue,this.saturation,this.brightness,this.alpha)}getChannelRange(e){switch(e){case"hue":return{minValue:0,maxValue:360,step:1,pageSize:15};case"saturation":case"brightness":return{minValue:0,maxValue:100,step:1,pageSize:10};case"alpha":return{minValue:0,maxValue:1,step:.01,pageSize:.1};default:throw new Error("Unknown color channel: "+e)}}getChannelFormatOptions(e){switch(e){case"hue":return{style:"unit",unit:"degree",unitDisplay:"narrow"};case"saturation":case"brightness":case"alpha":return{style:"percent"};default:throw new Error("Unknown color channel: "+e)}}formatChannelValue(e,t){let n=this.getChannelFormatOptions(e),r=this.getChannelValue(e);return("saturation"===e||"brightness"===e)&&(r/=100),new gI(t,n).format(r)}getColorSpace(){return"hsb"}getColorChannels(){return xI.colorChannels}constructor(e,t,n,r){super(),this.hue=e,this.saturation=t,this.brightness=n,this.alpha=r}}xI.colorChannels=["hue","saturation","brightness"];const CI=/hsl\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%)\)|hsla\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d(.\d+)?)\)/;function _I(e,t){return(e%t+t)%t}class SI extends yI{static parse(e){let t;if(t=e.match(CI)){var n;const[e,r,i,o]=(null!==(n=t[1])&&void 0!==n?n:t[2]).split(",").map(e=>Number(e.trim().replace("%","")));return new SI(_I(e,360),pw(r,0,100),pw(i,0,100),pw(o??1,0,1))}}toString(e="css"){switch(e){case"hex":return this.toRGB().toString("hex");case"hexa":return this.toRGB().toString("hexa");case"hsl":return`hsl(${this.hue}, ${mw(this.saturation,2)}%, ${mw(this.lightness,2)}%)`;case"css":case"hsla":return`hsla(${this.hue}, ${mw(this.saturation,2)}%, ${mw(this.lightness,2)}%, ${this.alpha})`;default:return this.toFormat(e).toString(e)}}toFormat(e){switch(e){case"hsl":case"hsla":return this;case"hsb":case"hsba":return this.toHSB();case"rgb":case"rgba":return this.toRGB();default:throw new Error("Unsupported color conversion: hsl -> "+e)}}toHSB(){let e=this.saturation/100,t=this.lightness/100,n=t+e*Math.min(t,1-t);return e=0===n?0:2*(1-t/n),new xI(mw(this.hue,2),mw(100*e,2),mw(100*n,2),this.alpha)}toRGB(){let e=this.hue,t=this.saturation/100,n=this.lightness/100,r=t*Math.min(n,1-n),i=(t,i=(t+e/30)%12)=>n-r*Math.max(Math.min(i-3,9-i,1),-1);return new bI(Math.round(255*i(0)),Math.round(255*i(8)),Math.round(255*i(4)),this.alpha)}clone(){return new SI(this.hue,this.saturation,this.lightness,this.alpha)}getChannelRange(e){switch(e){case"hue":return{minValue:0,maxValue:360,step:1,pageSize:15};case"saturation":case"lightness":return{minValue:0,maxValue:100,step:1,pageSize:10};case"alpha":return{minValue:0,maxValue:1,step:.01,pageSize:.1};default:throw new Error("Unknown color channel: "+e)}}getChannelFormatOptions(e){switch(e){case"hue":return{style:"unit",unit:"degree",unitDisplay:"narrow"};case"saturation":case"lightness":case"alpha":return{style:"percent"};default:throw new Error("Unknown color channel: "+e)}}formatChannelValue(e,t){let n=this.getChannelFormatOptions(e),r=this.getChannelValue(e);return("saturation"===e||"lightness"===e)&&(r/=100),new gI(t,n).format(r)}getColorSpace(){return"hsl"}getColorChannels(){return SI.colorChannels}constructor(e,t,n,r){super(),this.hue=e,this.saturation=t,this.lightness=n,this.alpha=r}}function AI(e){let t=e.toFormat("rgb"),n=t.getChannelValue("red")/255,r=t.getChannelValue("green")/255,i=t.getChannelValue("blue")/255;[n,r,i]=function(e,t,n){return[kI(e),kI(t),kI(n)]}(n,r,i);let[o,a,s]=function(e,t,n){return EI([.4123907992659595,.35758433938387796,.1804807884018343,.21263900587151036,.7151686787677559,.07219231536073371,.01933081871559185,.11919477979462599,.9505321522496606],e,t,n)}(n,r,i),[l,c,u]=function(e,t,n){let[r,i,o]=EI([.819022437996703,.3619062600528904,-.1288737815209879,.0329836539323885,.9292868615863434,.0361446663506424,.0481771893596242,.2642395317527308,.6335478284694309],e,t,n);return EI([.210454268309314,.7936177747023054,-.0040720430116193,1.9779985324311684,-2.42859224204858,.450593709617411,.0259040424655478,.7827717124575296,-.8086757549230774],Math.cbrt(r),Math.cbrt(i),Math.cbrt(o))}(o,a,s);return function(e,t,n){var r=180*Math.atan2(n,t)/Math.PI;return[e,Math.sqrt(t**2+n**2),r>=0?r:r+360]}(l,c,u)}function kI(e){let t=e<0?-1:1,n=Math.abs(e);return n<=.04045?e/12.92:t*Math.pow((n+.055)/1.055,2.4)}function EI(e,t,n,r){return[e[0]*t+e[1]*n+e[2]*r,e[3]*t+e[4]*n+e[5]*r,e[6]*t+e[7]*n+e[8]*r]}function II({onChange:e,value:t,colors:n}){const r=n.map(n=>{const r=t===n;return(0,i.jsx)(Hx,{onClick:()=>{null==e||e(n)},className:Pd("relative block flex-shrink-0 w-26 h-26 border rounded",r&&"shadow-md"),style:{backgroundColor:n},children:r&&(0,i.jsx)("span",{className:"absolute inset-0 m-auto rounded-full w-8 h-8 bg-white"})},n)});return(0,i.jsx)("div",{className:"flex flex-wrap gap-6",children:r})}SI.colorChannels=["hue","saturation","lightness"];const jI=[{color:"rgb(255, 255, 255)",name:kd("White")},{color:"rgb(239,245,245)",name:kd("Solitude")},{color:"rgb(245,213,174)",name:kd("Wheat")},{color:"rgb(253,227,167)",name:kd("Cape Honey")},{color:"rgb(242,222,186)",name:kd("Milk punch")},{color:"rgb(97,118,75)",name:kd("Dingy"),foreground:"rgb(255, 255, 255)"},{color:"rgb(4, 147, 114)",name:kd("Aquamarine"),foreground:"rgb(255, 255, 255)"},{color:"rgb(222,245,229)",name:kd("Cosmic Latte")},{color:"rgb(233,119,119)",name:kd("Geraldine"),foreground:"rgb(90,14,14)"},{color:"rgb(247,164,164)",name:kd("Sundown")},{color:"rgb(30,139,195)",name:kd("Pelorous"),foreground:"rgb(255, 255, 255)"},{color:"rgb(142,68,173)",name:kd("Deep Lilac"),foreground:"rgb(255, 255, 255)"},{color:"rgb(108,74,182)",name:kd("Blue marguerite"),foreground:"rgb(255, 255, 255)"},{color:"rgb(139,126,116)",name:kd("Americano"),foreground:"rgb(255, 255, 255)"},{color:"rgb(0,0,0)",name:kd("Black"),foreground:"rgb(255, 255, 255)"},{color:"rgb(64,66,88)",name:kd("Blue zodiac"),foreground:"rgb(255, 255, 255)"},{color:"rgb(101,100,124)",name:kd("Comet"),foreground:"rgb(255, 255, 255)"}].map(({color:e})=>e).slice(0,14);function TI({defaultValue:e,onChange:t,colorPresets:n,showInput:r}){const[a,s]=(0,o.useState)(e),l=n||jI,c=MS({size:"sm"});return(0,i.jsxs)("div",{children:[(0,i.jsx)(QE,{className:"!w-auto",color:a,onChange:e=>{null==t||t(e),s(e)}}),(0,i.jsxs)("div",{className:"px-12 py-20",children:[l&&(0,i.jsx)(II,{colors:l,onChange:e=>{if(e){const n=function(e){let t=bI.parse(e)||xI.parse(e)||SI.parse(e);if(t)return t;throw new Error("Invalid color value: "+e)}(e).toString("hex");null==t||t(n),s(n)}},value:a}),r&&(0,i.jsx)("div",{className:"pt-20",children:(0,i.jsx)(rI,{autoComplete:"off",role:"textbox",autoCorrect:"off",spellCheck:"false",required:!0,"aria-label":"Hex color",prefixed:!0,className:c.input,color:a,onChange:e=>{null==t||t(e),s(e)}})})]})]})}const FI=o.createContext(null);function OI(){return(0,o.useContext)(FI)}function MI(){const{lines:e,localeCode:t}=oS();return{trans:(0,o.useCallback)(n=>PI({...n,lines:e,localeCode:t}),[e,t])}}const PI=Qx(e=>{let{lines:t,message:n,values:r,localeCode:i}=e;return null==n?"":(n=(null==t?void 0:t[n])||(null==t?void 0:t[n.toLowerCase()])||n,r&&(n=aS(i,e),Object.entries(r).forEach(([e,t])=>{n=n.replace(`:${e}`,`${t}`)})),n)},{equals:iS,callTimeout:0});function RI({onDismiss:e}){const{trans:t}=MI();return(0,i.jsx)("button",{className:"sr-only","aria-label":t(kd("Dismiss")),tabIndex:-1,onClick:()=>{e&&e()}})}function LI(e){const{type:t="modal",dialogProps:n,...r}=(0,o.useContext)(FI),{children:a,className:s,size:l="md",background:c,radius:u="rounded",maxWidth:d="max-w-dialog",...h}=e;let f=null;("popover"===t||"tray"===t)&&(f=(0,i.jsx)(RI,{onDismiss:r.close}));const p="fullscreenTakeover"===l||"tray"===t,g=Pd("mx-auto pointer-events-auto outline-none flex flex-col overflow-hidden",c||"bg","tray"!==t&&function(e){switch(e){case"2xs":return"w-256";case"xs":return"w-320";case"sm":return"w-384";case"md":return"w-440";case"lg":return"w-620";case"xl":return"w-780";case"2xl":return"w-850";case"fullscreen":return"w-1280";case"fullscreenTakeover":return"w-full h-full";default:return e}}(l),"tray"===t&&"rounded-t border-b-bg","fullscreenTakeover"!==l&&"shadow-2xl border max-h-dialog",!p&&`${u} ${d}`,s);return(0,i.jsxs)("div",{...nw({role:"dialog",tabIndex:-1},n,h),style:{...e.style,"--be-dialog-padding":"24px"},"aria-modal":!0,className:g,children:[o.Children.toArray(a).map(e=>(0,o.isValidElement)(e)?(0,o.cloneElement)(e,{size:e.props.size??l}):e),f]})}const NI=Nd((0,i.jsx)("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"}),"KeyboardArrowDownOutlined"),DI=(0,o.forwardRef)(({children:e,autoFocus:t=!1,restoreFocus:n=!0,isDismissable:r=!0,isOpen:o=!1,placement:a="center",onClose:s},l)=>{const c=Z_(),u=uw(l);return(0,i.jsxs)("div",{className:"fixed inset-0 isolate z-modal",style:c,onKeyDown:e=>{"Escape"===e.key&&(e.stopPropagation(),e.preventDefault(),s())},children:[(0,i.jsx)(nS,{onClick:()=>{r&&s()}},"modal-underlay"),(0,i.jsx)(Pb.div,{ref:u,className:Pd("pointer-events-none absolute inset-0 z-20 flex h-full w-full","center"===a&&"items-center justify-center","top"===a&&"items-start justify-center pt-40"),role:"presentation",initial:{opacity:0,scale:"top"===a?1:.7},animate:{opacity:1,scale:1},exit:{opacity:0,scale:1},transition:{duration:.1},children:(0,i.jsx)(R_,{restoreFocus:n,autoFocus:t,contain:!0,children:e})})]})});function zI(e){let{children:t,type:n,disableInitialTransition:r,isDismissable:a=!0,moveFocusToDialog:s=!0,returnFocusToTrigger:l=!0,triggerOnHover:c=!1,triggerOnContextMenu:u=!1,usePortal:d=!0,mobileType:h,alwaysReturnCurrentValueOnClose:f}=e;const p=(0,o.useRef)(null),g=u&&!e.triggerRef?p:e.triggerRef,m=(0,o.useRef)(e.value),[v,y]=fw(e.isOpen,e.defaultIsOpen,e.onOpenChange),[b,w]=fw(e.value,e.defaultValue,e.onValueChange);mS()&&"popover"===n&&(n=h||"modal");const x=(0,o.useRef)(null),{x:C,y:_,reference:S,strategy:A,refs:k}=v_({...e,disablePositioning:"modal"===n}),E="popover"===n?{position:A,top:_??"",left:C??""}:{},I=(0,o.useId)(),j=`${I}-label`,T=`${I}-description`,F=`${I}-form`,O=function(e){const t=(0,o.useRef)(e);return(0,o.useEffect)(()=>{t.current=e}),(0,o.useMemo)(()=>(...e)=>{var n;return null==(n=t.current)?void 0:n.call(t,...e)},[])}(e.onClose),M=(0,o.useCallback)(e=>{typeof e>"u"&&f&&(e=b);const t=typeof e<"u"?e:m.current;null==O||O(t,{initialValue:m.current,valueChanged:t!==m.current}),y(!1)},[O,y,b,f]),P=(0,o.useCallback)(()=>{y(!0),m.current=e.value},[e.value,y]);$b(()=>{null!=g&&g.current&&k.reference.current!==g.current&&S(g.current)},[S,null==g?void 0:g.current,k]);const R=(0,o.useMemo)(()=>({"aria-labelledby":j,"aria-describedby":T}),[j,T]);let L;L="modal"===n?DI:"tray"===n?rS:Q_;const N=(0,o.useMemo)(()=>({dialogProps:R,type:n,labelId:j,descriptionId:T,isDismissable:a,close:M,value:b,initialValue:m.current,setValue:w,formId:F}),[M,T,R,F,j,n,a,b,w]);c=c&&"popover"===n;const D={onPointerEnter:Vx(e=>{P()}),onPointerLeave:Vx(e=>{x.current=setTimeout(()=>{M()},150)})},z={onPointerEnter:Vx(e=>{x.current&&clearTimeout(x.current)}),onPointerLeave:Vx(e=>{M()})},B={onContextMenu:Vx(e=>{e.preventDefault(),p.current=function({x:e,y:t},n){return{getBoundingClientRect:()=>({x:e,y:t,width:0,height:0,top:t,right:e,bottom:t,left:e}),contextElement:n}}({x:e.clientX,y:e.clientY},e.currentTarget),P()})},U={onClick:Vx(e=>{e.stopPropagation(),v?M():P()})},{dialogTrigger:V,dialog:H}=function(e,t){const n=Array.isArray(e)?e:o.Children.toArray(e);let r=2===n.length?n[1]:n[0];return r="function"==typeof r?r(t):r,2===n.length?{dialogTrigger:n[0],dialog:r}:{dialog:r}}(t,N),W=(0,i.jsx)(Ub,{initial:!r,children:v&&(0,i.jsx)(FI.Provider,{value:N,children:(0,i.jsx)(L,{...c?z:{},ref:k.setFloating,triggerRef:k.reference,style:E,restoreFocus:l,autoFocus:s,isOpen:v,onClose:M,isDismissable:a,isContextMenu:u,placement:e.placement,children:H})})});return(0,i.jsxs)(o.Fragment,{children:[V&&(0,o.cloneElement)(V,nw({...g||u?{}:{ref:S},...u?{}:U,...c?D:{},...u?B:{}},{...V.props})),d?Bp&&(0,de.createPortal)(W,Bp):W]})}function BI(e){const{label:t,className:n,value:r,onChange:a,size:s,width:l="w-max"}=e,c=Gp(e=>{var t,n;return null==(n=null==(t=e.config.ui)?void 0:t.colorPresets)?void 0:n.items})||[],u=MS({size:s}),[d,h]=(0,o.useState)(r),[f,p]=(0,o.useState)(!1);return(0,i.jsxs)("div",{className:Pd(n,l),children:[t&&(0,i.jsx)("span",{className:u.label,children:t}),(0,i.jsxs)(zI,{type:"popover",isOpen:f,onOpenChange:p,children:[(0,i.jsxs)(Hx,{className:Pd(u.input,"inline-flex items-center"),"aria-label":e["aria-label"],children:[(0,i.jsx)("span",{className:"block flex-shrink-0 mr-5 border rounded h-2/4 aspect-square",style:{backgroundColor:d}}),(0,i.jsx)(UI,{isActive:f,className:u.adornment})]}),(0,i.jsx)(LI,{size:"auto",children:(0,i.jsx)(TI,{onChange:e=>{h(e),null==a||a(e)},defaultValue:d,colorPresets:c})})]})]})}function UI({isActive:e,className:t}){return(0,i.jsx)(NI,{size:"sm",className:`transition-transform ml-auto flex-shrink-0 ${e?"rotate-180":"rotate-0"} ${t}`})}function VI(e){const{size:t="md",inline:n,label:r,showValueLabel:o=!!r,className:a,width:s="w-full",slider:l,children:c,trackColor:u="primary",fillColor:d="primary"}=e,{domProps:h,trackRef:f,getThumbPercent:p,getThumbValueLabel:g,labelId:m,groupId:v,thumbIds:y,isDisabled:b,numberFormatter:w,minValue:x,maxValue:C,step:_,values:S,getValueLabel:A}=l;let k="",E=Math.max([...w.format(x)].length,[...w.format(C)].length,[...w.format(_)].length);A?k=A(S[0]):1===S.length?k=g(0):2===S.length&&(k=`${g(0)} \u2013 ${g(1)}`,E=3+2*Math.max(E,[...w.format(x)].length,[...w.format(C)].length));const I=MS({size:t,disabled:b,labelDisplay:"flex"}),j=Pd("touch-none",a,s,{"flex items-center":n});return(0,i.jsxs)("div",{className:j,role:"group",id:v,children:[(r||o)&&(0,i.jsxs)("div",{className:Pd(I.label,"select-none"),children:[r&&(0,i.jsx)("label",{onClick:()=>{var e;null==(e=document.getElementById(y[0]))||e.focus()},id:m,htmlFor:v,children:r}),o&&(0,i.jsx)("output",{htmlFor:y[0],className:"ml-auto text-right","aria-live":"off",style:E?{width:`${E}ch`,minWidth:`${E}ch`}:void 0,children:k})]}),(0,i.jsxs)("div",{ref:f,className:Pd("relative",HI(e)),...h,role:"presentation",children:[(0,i.jsx)("div",{className:Pd("absolute inset-0 m-auto rounded",$I(u,b),WI(t))}),(0,i.jsx)("div",{className:Pd("absolute inset-0 my-auto rounded",GI(d,b),WI(t)),style:{width:`${Math.max(100*p(0),0)}%`}}),c]})]})}function HI({size:e,wrapperHeight:t}){if(t)return t;switch(e){case"xs":return"h-14";case"sm":return"h-20";default:return"h-30"}}function WI(e){switch(e){case"xs":return"h-2";case"sm":return"h-3";default:return"h-4"}}function $I(e,t){switch(t&&(e="disabled"),e){case"disabled":return"bg-slider-disabled/60";case"primary":return"bg-primary-light";case"neutral":return"bg-divider";default:return e}}function GI(e,t){switch(t&&(e="disabled"),e){case"disabled":return"bg-slider-disabled";case"primary":return"bg-primary";default:return e}}function qI(e={}){const{localeCode:t}=oS();return(0,o.useMemo)(()=>new gI(t,e),[t,e])}function YI({minValue:e=0,maxValue:t=100,isDisabled:n=!1,step:r=1,formatOptions:i,onChangeEnd:a,onPointerDown:s,label:l,getValueLabel:c,showThumbOnHoverOnly:u,thumbSize:d,onPointerMove:h,...f}){const[p,g]=(0,o.useState)(!1),m=qI(i),{addGlobalListener:v,removeGlobalListener:y}=cw(),b=(0,o.useRef)(null),[w,x]=fw(f.value?f.value:void 0,f.defaultValue??[e],f.onChange),C=(0,o.useRef)(null);C.current=w;const[_,S]=(0,o.useState)(new Array(w.length).fill(!1)),A=(0,o.useRef)(null);A.current=_;const k=t=>0===t?e:w[t-1],E=e=>e===w.length-1?t:w[e+1],I=(e,t)=>{!n&&R(e)&&C.current&&(t=function(e,t,n,r){t=Number(t),n=Number(n);let i=(e-(isNaN(t)?0:t))%r,o=gw(2*Math.abs(i)>=r?e+Math.sign(i)*(r-Math.abs(i)):e-i,r);return isNaN(t)?!isNaN(n)&&o>n&&(o=Math.floor(gw(n/r,r))*r):o<t?o=t:!isNaN(n)&&o>n&&(o=t+Math.floor(gw((n-t)/r,r))*r),o=gw(o,r),o}(t,k(e),E(e),r),C.current=XI(C.current,e,t),x(C.current))},j=(e,t)=>{var r;if(n||!R(e))return;const i=null==(r=A.current)?void 0:r[e];A.current=XI(A.current||[],e,t),S(A.current),a&&i&&!A.current.some(Boolean)&&a(C.current||[])},[T,F]=(0,o.useState)(void 0),O=n=>(n=>{const r=Math.min(1,(n-e)/(t-e));return isNaN(r)?0:r})(C.current[n]),M=n=>Ek((t=>Math.round((t-e)/r)*r+e)(n*(t-e)+e),e,t),P=(0,o.useRef)(new Array(w.length).fill(!0)),R=e=>P.current[e],L=(0,o.useRef)(null),N=(0,o.useRef)(void 0),D=(0,o.useRef)(null),{domProps:z}=vk({onPointerDown:e=>{if(("mouse"!==e.pointerType||!(0!==e.button||e.altKey||e.ctrlKey||e.metaKey))&&(null==s||s(),b.current&&!n&&w.every((e,t)=>!_[t]))){const t=b.current.offsetWidth,n=b.current.getBoundingClientRect().left,r=(e.clientX-n)/t,i=M(r);let o;const a=w.findIndex(e=>i-e<0);if(0===a)o=a;else if(-1===a)o=w.length-1;else{const e=w[a-1],t=w[a];o=Math.abs(e-i)<Math.abs(t-i)?a-1:a}o>=0&&R(o)?(e.preventDefault(),L.current=o,F(o),N.current=e.pointerId,j(L.current,!0),I(o,i),v(window,"pointerup",U,!1)):L.current=null}},onMoveStart(){D.current=null},onMove(e,t){var n;const r=(null==(n=b.current)?void 0:n.offsetWidth)||0;if(null==D.current&&(D.current=O(L.current||0)*r),D.current+=t,null!=L.current&&b.current){const e=Ek(D.current/r,0,1);((e,t)=>{I(e,M(t))})(L.current,e)}},onMoveEnd(){null!=L.current&&(j(L.current,!1),L.current=null)}}),B=nw(z,{onPointerEnter:()=>{g(!0)},onPointerLeave:()=>{g(!1)},onPointerMove:e=>{null==h||h(e)}}),U=e=>{e.pointerId===N.current&&(null!=L.current&&(j(L.current,!1),L.current=null),y(window,"pointerup",U,!1))},V=(0,o.useId)(),H=l?`${V}-label`:void 0,W=`${V}-group`,$=[...Array(w.length)].map((e,t)=>`${V}-thumb-${t}`);return{domProps:B,trackRef:b,isDisabled:n,step:r,values:w,minValue:e,maxValue:t,focusedThumb:T,labelId:H,groupId:W,thumbIds:$,numberFormatter:m,getThumbPercent:O,getThumbMinValue:k,getThumbMaxValue:E,getThumbValueLabel:e=>function(e){return m.format(e)}(w[e]),isThumbDragging:e=>{var t;return(null==(t=A.current)?void 0:t[e])||!1},setThumbValue:I,updateDraggedThumbs:j,setThumbEditable:(e,t)=>{P.current[e]=t},setFocusedThumb:F,getValueLabel:c,isPointerOver:p,showThumbOnHoverOnly:u,thumbSize:d}}function XI(e,t,n){return e[t]===n?e:[...e.slice(0,t),n,...e.slice(t+1)]}function KI({index:e,slider:t,isDisabled:n,ariaLabel:r,inputRef:a,onBlur:s,fillColor:l="primary"}){const c=uw(a),{addGlobalListener:u,removeGlobalListener:d}=cw(),{step:h,values:f,focusedThumb:p,labelId:g,thumbIds:m,isDisabled:v,getThumbPercent:y,getThumbMinValue:b,getThumbMaxValue:w,getThumbValueLabel:x,setThumbValue:C,updateDraggedThumbs:_,isThumbDragging:S,setThumbEditable:A,setFocusedThumb:k,isPointerOver:E,showThumbOnHoverOnly:I,thumbSize:j="w-18 h-18"}=t,T=S(e),F=f[e];A(e,!n);const O=n||v,M=(0,o.useCallback)(()=>{c.current&&c.current.focus({preventScroll:!0})},[c]),P=p===e;(0,o.useEffect)(()=>{P&&M()},[P,M]);const R=(0,o.useRef)(void 0),L=t=>{t.pointerId===R.current&&(M(),_(e,!1),d(window,"pointerup",L,!1))},N=Pd("outline-none rounded-full top-1/2 -translate-y-1/2 -translate-x-1/2 absolute inset-0 transition-button duration-200",j,!O&&"shadow-md",function({isDisabled:e,isDragging:t,fillColor:n}){return e?"bg-slider-disabled cursor-default":n&&"primary"!==n?n:Pd("hover:bg-primary-dark",t?"bg-primary-dark":"bg-primary")}({fillColor:l,isDisabled:O,isDragging:T}),!I||I&&T||E?"visible":"invisible");return(0,i.jsx)("div",{role:"presentation",className:N,style:{left:`${Math.max(100*y(e),0)}%`},onPointerDown:t=>{0!==t.button||t.altKey||t.ctrlKey||t.metaKey||(M(),R.current=t.pointerId,_(e,!0),u(window,"pointerup",L,!1))},children:(0,i.jsx)("input",{id:m[e],onKeyDown:Vx(()=>{_(e,!0)}),onKeyUp:Vx(()=>{_(e,!1)}),ref:c,tabIndex:O?void 0:0,min:b(e),max:w(e),step:h,value:F,disabled:O,"aria-label":r,"aria-labelledby":g,"aria-orientation":"horizontal","aria-valuetext":x(e),onFocus:()=>{k(e)},onBlur:t=>{k(void 0),_(e,!1),null==s||s(t)},onChange:t=>{C(e,parseFloat(t.target.value))},type:"range",className:"sr-only"})})}function ZI({inputRef:e,onBlur:t,...n}){const{onChange:r,onChangeEnd:o,value:a,defaultValue:s,...l}=n,c={...l,value:null!=a?[a]:void 0,defaultValue:null!=s?[s]:void 0,onChange:e=>{null==r||r(e[0])},onChangeEnd:e=>{null==o||o(e[0])}},u=YI(c);return(0,i.jsx)(VI,{...c,slider:u,children:(0,i.jsx)(KI,{fillColor:n.fillColor,index:0,slider:u,inputRef:e,onBlur:t})})}const JI=o.forwardRef((e,t)=>{let{value:n=0,minValue:r=0,maxValue:o=100,size:a="md",isIndeterminate:s=!1,className:l,position:c="relative",trackColor:u,fillColor:d="border-primary",...h}=e;n=Ek(n,r,o);const f=function(e){switch(e){case"xs":return"w-20 h-20";case"sm":return"w-24 h-24";case"md":return"w-32 h-32";case"lg":return"w-42 h-42";default:return e}}(a),p=(n-r)/(o-r),g=qI({style:"percent"});let m="";!s&&!m&&(m=g.format(p));const v={},y={};if(!s){const e=(n-r)/(o-r)*100;let t;e>0&&e<=50?(t=e/50*180-180,v.transform=`rotate(${t}deg)`,y.transform="rotate(-180deg)"):e>50&&(t=(e-50)/50*180-180,v.transform="rotate(0deg)",y.transform=`rotate(${t}deg)`)}return(0,i.jsxs)("div",{...h,"aria-valuenow":s?void 0:n,"aria-valuemin":r,"aria-valuemax":o,"aria-valuetext":s?void 0:m,role:"progressbar",ref:t,className:Pd("progress-circle",c,f,s&&"indeterminate",l),children:[(0,i.jsx)("div",{className:Pd(f,u,"rounded-full border-4")}),(0,i.jsxs)("div",{className:Pd("fills absolute left-0 top-0 h-full w-full",s&&"progress-circle-fills-animate"),children:[(0,i.jsx)(QI,{circleSize:f,subMaskStyle:v,isIndeterminate:s,className:"rotate-180",fillColor:d,subMaskClassName:Pd(s&&"progress-circle-fill-submask-1-animate")}),(0,i.jsx)(QI,{circleSize:f,subMaskStyle:y,isIndeterminate:s,fillColor:d,subMaskClassName:Pd(s&&"progress-circle-fill-submask-2-animate")})]})]})});function QI({subMaskStyle:e,subMaskClassName:t,className:n,circleSize:r,isIndeterminate:o,fillColor:a}){return(0,i.jsx)("div",{className:Pd("absolute h-full w-1/2 origin-[100%] overflow-hidden",n),children:(0,i.jsx)("div",{className:Pd("h-full w-full origin-[100%] rotate-180 overflow-hidden",!o&&"transition-transform duration-100",t),style:e,children:(0,i.jsx)("div",{className:Pd(r,a,"rounded-full border-4")})})})}function ej({isLoading:e,icon:t}){const n=(0,o.useRef)(null),{trans:r}=MI(),[a,s]=(0,o.useState)(!1),{state:{isOpen:l,inputValue:c}}=qx(),u=(0,o.useRef)(c);return(0,o.useEffect)(()=>{e&&!a?(null===n.current&&(n.current=setTimeout(()=>{s(!0)},500)),c!==u.current&&(clearTimeout(n.current),n.current=setTimeout(()=>{s(!0)},500))):e||(s(!1),clearTimeout(n.current),n.current=null),u.current=c},[e,a,c]),a&&(l||e)?(0,i.jsx)(JI,{"aria-label":r({message:"Loading"}),size:"sm",isIndeterminate:!0}):t||(0,i.jsx)(NI,{})}const tj=o.forwardRef(function(e,t){const n=mS(),{hideCaret:r,placeholder:o=(0,i.jsx)(cS,{message:"Select an option..."}),selectedValue:a,onItemSelected:s,onOpenChange:l,onInputValueChange:c,onSelectionChange:u,selectionMode:d,minWidth:h="min-w-128",children:f,searchPlaceholder:p,showEmptyMessage:g,showSearchField:m,defaultInputValue:v,inputValue:y,isLoading:b,isAsync:w,valueClassName:x,floatingWidth:C=(n?"auto":"matchTrigger"),..._}=e,S=y_({...e,clearInputOnItemSelection:!0,showEmptyMessage:g||m,floatingWidth:C,selectionMode:"single",role:"listbox",virtualFocus:m},t),{state:{selectedValues:A,isOpen:k,setIsOpen:E,activeIndex:I,setSelectedIndex:j,inputValue:T,setInputValue:F},collections:O,focusItem:M,listboxId:P,reference:R,refs:L,listContent:N,onInputChange:D}=S,{fieldProps:z,inputProps:B}=HS({..._,focusRef:L.reference}),U=O.collection.get(A[0]),V=U?(0,i.jsxs)("span",{className:"flex items-center gap-10",children:[U.element.props.startIcon,(0,i.jsx)("span",{className:Pd("overflow-hidden overflow-ellipsis whitespace-nowrap",x),children:U.element.props.children})]}):(0,i.jsx)("span",{className:"italic",children:o}),H=MS({...e,endAdornment:!0}),{handleTriggerKeyDown:W,handleListboxKeyboardNavigation:$,handleListboxSearchFieldKeydown:G}=fS(S),{findMatchingItem:q}=gS();return(0,i.jsx)(uS,{listbox:S,onKeyDownCapture:m?void 0:e=>{if(!k)return;const t=q(e,N,I);null!=t&&M("increment",t)},onKeyDown:$,onClose:m?()=>F(""):void 0,isLoading:b,searchField:m&&(0,i.jsx)(WS,{size:"xs"===e.size||"sm"===e.size?"xs":"sm",placeholder:p,startAdornment:(0,i.jsx)(vS,{}),className:"flex-shrink-0 px-8 pb-8 pt-4",autoFocus:!0,"aria-expanded":k?"true":"false","aria-haspopup":"listbox","aria-controls":k?P:void 0,"aria-autocomplete":"list",autoComplete:"off",autoCorrect:"off",spellCheck:"false",value:T,onChange:D,onKeyDown:e=>{G(e)}}),children:(0,i.jsx)(zS,{fieldClassNames:H,...z,endAdornment:!r&&(0,i.jsx)(ej,{isLoading:b}),children:(0,i.jsx)("button",{...B,type:"button","data-selected-value":null==U?void 0:U.value,"aria-expanded":k?"true":"false","aria-haspopup":"listbox","aria-controls":k?P:void 0,ref:R,onKeyDown:W,onKeyDownCapture:m?void 0:e=>{if(k)return;const t=q(e,N,I);null!=t&&j(t)},disabled:_.disabled,onClick:()=>{E(!k)},className:Pd(H.input,!z.unstyled&&h),children:V})})})});function nj(){const e=Gp(e=>e.filter.selected);if(!e)return null;const t=Yp().filter.getByName(e).options,n=(t,n)=>{var r;null==(r=Yp().filter)||r.applyValue(e,t,n),qp().setDirty(!0)},r=Yp().canvas.getMainImage().filters,o=Yp().filter.findFilterIndex(e,r),a=null==r?void 0:r[o];if(t){const e=Object.entries(t).map(([e,t])=>{let r;const o=a?a[e]:t.current;return"slider"===t.type?r=(0,i.jsx)(ZI,{label:(0,i.jsx)("span",{className:"capitalize",children:(0,i.jsx)(cS,{...$w[e]})}),minValue:t.min,maxValue:t.max,step:t.step,defaultValue:o,formatOptions:{style:"percent"},size:"sm",onChange:t=>{n(e,t)}}):"colorPicker"===t.type?r=(0,i.jsx)(BI,{label:(0,i.jsx)(cS,{...$w[e]}),size:"sm",width:"w-full",value:o,onChange:t=>{n(e,t)}}):"select"===t.type&&(r=(0,i.jsx)(tj,{selectionMode:"single",size:"sm",label:(0,i.jsx)(cS,{...$w[e]}),defaultValue:o,onSelectionChange:t=>{n(e,t)},children:t.available.map(e=>(0,i.jsx)(Zx,{value:e.key,children:(0,i.jsx)("span",{className:"capitalize",children:(0,i.jsx)(cS,{message:e.key})})},e.key))})),(0,i.jsx)("div",{className:"pb-10",children:r},e)});return(0,i.jsx)(Xk,{children:(0,i.jsx)("div",{className:"max-w-240 pt-10 mx-auto",children:e})})}return null}function rj(){const e=Gp(e=>e.frame.active),t="basic"===(null==e?void 0:e.mode),n=(0,o.useCallback)(e=>`${e}%`,[]);return(0,i.jsx)(Xk,{className:"pb-18 pt-6",children:(0,i.jsxs)("div",{className:"max-w-288 m-auto",children:[t&&(0,i.jsx)(BI,{className:"mb-20",width:"w-full",size:"sm",label:(0,i.jsx)(cS,{message:"Color"}),value:Yp().frame.builder.defaultColor,onChange:e=>{Yp().frame.active.changeColor(e)}}),(0,i.jsx)(ZI,{size:"sm",label:(0,i.jsx)(cS,{message:"Size"}),step:1,minValue:Yp().frame.active.getMinSize(),maxValue:Yp().frame.active.getMaxSize(),defaultValue:Yp().frame.active.currentSizeInPercent,getValueLabel:n,onChange:e=>{Yp().frame.resize(e)}})]})})}const ij=o.createContext(null);function oj(){const{tabsRef:e,selectedTab:t}=(0,o.useContext)(ij),[n,r]=(0,o.useState)({width:void 0,transform:void 0,className:void 0});return $b(()=>{if(null!=t&&e.current){const n=e.current[t];if(!n)return;r(e=>({width:`${n.offsetWidth}px`,transform:`translateX(${n.offsetLeft}px)`,className:void 0===e.width?"":"transition-all"}))}},[r,t,e]),(0,i.jsx)("div",{className:Pd("absolute bottom-0 left-0 h-2 bg-primary",n.className),role:"presentation",style:{width:n.width,transform:n.transform}})}function aj({children:e,center:t,expand:n,className:r}){const a=o.Children.toArray(e);return(0,i.jsx)(R_,{children:(0,i.jsxs)("div",{className:Pd("flex relative max-w-full overflow-auto border-b max-sm:hidden-scrollbar md:compact-scrollbar",r),role:"tablist","aria-orientation":"horizontal",children:[a.map((e,r)=>(0,o.isValidElement)(e)?(0,o.cloneElement)(e,{index:r,className:Pd(e.props.className,n&&"flex-auto",t&&0===r&&"ml-auto",t&&r===a.length-1&&"mr-auto")}):null),(0,i.jsx)(oj,{})]})})}function sj(e){const{size:t="md",children:n,className:r,isLazy:a,overflow:s="overflow-hidden"}=e,l=(0,o.useRef)([]),c=(0,o.useId)(),[u,d]=fw(e.selectedTab,e.defaultSelectedTab||0,e.onTabChange),h=(0,o.useMemo)(()=>({selectedTab:u,setSelectedTab:d,tabsRef:l,size:t,isLazy:a,id:c}),[u,c,a,d,t]);return(0,i.jsx)(ij.Provider,{value:h,children:(0,i.jsx)("div",{className:Pd(r,s,"max-w-full"),children:n})})}const lj=Nd((0,i.jsx)("path",{d:"M12 17c3.31 0 6-2.69 6-6V3h-2.5v8c0 1.93-1.57 3.5-3.5 3.5S8.5 12.93 8.5 11V3H6v8c0 3.31 2.69 6 6 6zm-7 2v2h14v-2H5z"}),"FormatUnderlinedOutlined"),cj=Nd((0,i.jsx)("path",{d:"M10 19h4v-3h-4v3zM5 4v3h5v3h4V7h5V4H5zM3 14h18v-2H3v2z"}),"FormatStrikethroughOutlined"),uj=Nd((0,i.jsx)("path",{d:"M10 4v3h2.21l-3.42 8H6v3h8v-3h-2.21l3.42-8H18V4h-8z"}),"FormatItalicOutlined"),dj=Nd((0,i.jsx)("path",{d:"M3 21h18v-2H3v2zm6-4h12v-2H9v2zm-6-4h18v-2H3v2zm6-4h12V7H9v2zM3 3v2h18V3H3z"}),"FormatAlignRightOutlined"),hj=Nd((0,i.jsx)("path",{d:"M15 15H3v2h12v-2zm0-8H3v2h12V7zM3 13h18v-2H3v2zm0 8h18v-2H3v2zM3 3v2h18V3H3z"}),"FormatAlignLeftOutlined"),fj=Nd((0,i.jsx)("path",{d:"M7 15v2h10v-2H7zm-4 6h18v-2H3v2zm0-8h18v-2H3v2zm4-6v2h10V7H7zM3 3v2h18V3H3z"}),"FormatAlignCenterOutlined");function pj(){return(0,i.jsxs)("div",{className:"flex gap-20 justify-center",children:[(0,i.jsx)(gj,{}),(0,i.jsx)(mj,{}),(0,i.jsx)(vj,{})]})}function gj(){const e=Gp(e=>e.objects.active.editableProps.fontSize)??40,{trans:t}=MI();return(0,i.jsx)(WS,{type:"number",size:"xs","aria-label":t({message:"Font Size"}),min:1,max:300,className:"w-64 flex-shrink-0",value:e,onChange:e=>{Yp().objects.setValues({fontSize:e.target.valueAsNumber}),qp().setDirty(!0)}})}function mj(){const e=Gp(e=>e.objects.active.editableProps.fontStyle),t=Gp(e=>e.objects.active.editableProps.underline),n=Gp(e=>e.objects.active.editableProps.linethrough),[r,a]=(0,o.useState)([e,t&&"underline",n&&"linethrough"]);return(0,i.jsxs)(eA,{size:"xs",variant:"outline",radius:"rounded",value:r,multiple:!0,onChange:e=>{a(e),Yp().objects.setValues({underline:e.includes("underline"),linethrough:e.includes("linethrough"),fontStyle:e.includes("italic")?"italic":""}),qp().setDirty(!0)},children:[(0,i.jsx)(YS,{value:"underline",children:(0,i.jsx)(lj,{})}),(0,i.jsx)(YS,{value:"linethrough",children:(0,i.jsx)(cj,{})}),(0,i.jsx)(YS,{value:"italic",children:(0,i.jsx)(uj,{})})]})}function vj(){const e=Gp(e=>e.objects.active.editableProps.textAlign);return(0,i.jsxs)(eA,{size:"xs",variant:"outline",radius:"rounded",value:e,onChange:e=>{Yp().objects.setValues({textAlign:e}),qp().setDirty(!0)},children:[(0,i.jsx)(YS,{value:"left",children:(0,i.jsx)(hj,{})}),(0,i.jsx)(YS,{value:"center",children:(0,i.jsx)(fj,{})}),(0,i.jsx)(YS,{value:"right",children:(0,i.jsx)(dj,{})})]})}function yj({children:e,className:t}){const{selectedTab:n,isLazy:r}=(0,o.useContext)(ij),a=o.Children.toArray(e).filter(e=>!!e);let s;if(r){const e=a[n];s=(0,o.isValidElement)(e)?(0,o.cloneElement)(a[n],{index:n}):null}else s=a.map((e,t)=>{if((0,o.isValidElement)(e)){const r=t===n;return(0,o.cloneElement)(e,{index:t,"aria-hidden":!r,className:r?e.props.className:Pd(e.props.className,"hidden")})}return null});return(0,i.jsx)("div",{className:t,children:s})}function bj({className:e,children:t,index:n,...r}){const{id:a}=(0,o.useContext)(ij),[s,l]=(0,o.useState)(0),c=(0,o.useRef)(null);return $b(()=>{if(null!=c&&c.current){const e=()=>{const e=q_(c.current,{tabbable:!0});l(e.nextNode()?void 0:0)};e();const t=new MutationObserver(e);return t.observe(c.current,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabIndex","disabled"]}),()=>{t.disconnect()}}},[c]),(0,i.jsx)("div",{tabIndex:s,ref:c,id:`${a}-${n}-tabpanel`,"aria-labelledby":`${a}-${n}-tab`,className:Pd(e,"focus-visible:outline-primary-light"),role:"tabpanel",...r,children:t})}const wj=[{type:"linear",coords:{x1:-80,y1:0,x2:80,y2:0},colorStops:[{color:"#ffe47b",offset:0},{color:"rgb(111,154,211)",offset:1}]},{type:"linear",coords:{x1:0,y1:-120,x2:0,y2:120},colorStops:[{color:"#ff4040",offset:0},{color:"#e6399b",offset:1}]},{type:"linear",coords:{x1:-90,y1:-90,x2:90,y2:90},colorStops:[{offset:0,color:"rgb(166,111,213)"},{offset:.5,color:"rgba(106, 72, 215, 0.5)"},{offset:1,color:"#200772"}]},{type:"radial",coords:{r1:100,r2:10,x1:0,y1:0,x2:0,y2:0},colorStops:[{offset:0,color:"#FF4F4F"},{offset:1,color:"rgb(255, 239, 64)"}]},{type:"radial",coords:{r1:100,r2:10,x1:0,y1:0,x2:20,y2:20},colorStops:[{offset:0,color:"#ffe47b"},{offset:.5,color:"rgb(111,154,211)"},{offset:1,color:"rgb(166,111,213)"}]},{type:"radial",coords:{r1:50,r2:80,x1:45,y1:45,x2:52,y2:50},colorStops:[{offset:0,color:"rgb(155, 237, 0)"},{offset:1,color:"rgba(0, 164, 128,0.4)"}]},{type:"linear",coords:{x1:-90,y1:-90,x2:90,y2:90},colorStops:[{offset:0,color:"#9ecb2d"},{offset:.5,color:"#72aa00"},{offset:1,color:"#bfd255"}]},{type:"radial",coords:{r1:100,r2:50,x1:30,y1:0,x2:0,y2:0},colorStops:[{offset:0,color:"#aebcbf"},{offset:1,color:"#0a0809"}]},{type:"linear",coords:{x1:-80,y1:0,x2:80,y2:0},colorStops:[{offset:0,color:"#ffffff"},{offset:1,color:"#f6f6f6"}]},{type:"linear",coords:{x1:0,y1:-120,x2:0,y2:120},colorStops:[{offset:0,color:"#fefcea"},{offset:1,color:"#f1da36"}]},{type:"linear",coords:{x1:-90,y1:-90,x2:90,y2:90},colorStops:[{offset:0,color:"rgb(166,111,213)"},{offset:.5,color:"rgba(106, 72, 215, 0.5)"},{offset:1,color:"#ff1a00"}]},{type:"linear",coords:{x1:0,y1:-120,x2:0,y2:120},colorStops:[{offset:0,color:"#b7deed"},{offset:1,color:"#21b4e2"}]},{type:"linear",coords:{x1:-80,y1:100,x2:80,y2:-100},colorStops:[{offset:0,color:"#ffe47b"},{offset:1,color:"rgb(111,154,211)"}]}],xj=Nd((0,i.jsx)("path",{d:"M19.51 3.08 3.08 19.51c.09.34.27.65.51.9.25.24.56.42.9.51L20.93 4.49c-.19-.69-.73-1.23-1.42-1.41zM11.88 3 3 11.88v2.83L14.71 3h-2.83zM5 3c-1.1 0-2 .9-2 2v2l4-4H5zm14 18c.55 0 1.05-.22 1.41-.59.37-.36.59-.86.59-1.41v-2l-4 4h2zm-9.71 0h2.83L21 12.12V9.29L9.29 21z"}),"TextureOutlined"),Cj=Nd((0,i.jsx)("path",{d:"M11 9h2v2h-2V9zm-2 2h2v2H9v-2zm4 0h2v2h-2v-2zm2-2h2v2h-2V9zM7 9h2v2H7V9zm12-6H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 18H7v-2h2v2zm4 0h-2v-2h2v2zm4 0h-2v-2h2v2zm2-7h-2v2h2v2h-2v-2h-2v2h-2v-2h-2v2H9v-2H7v2H5v-2h2v-2H5V5h14v6z"}),"GradientOutlined"),_j=Nd((0,i.jsx)("path",{d:"M18 20H4V6h9V4H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-9h-2v9zm-7.79-3.17-1.96-2.36L5.5 18h11l-3.54-4.71zM20 4V1h-2v3h-3c.01.01 0 2 0 2h3v2.99c.01.01 2 0 2 0V6h3V4h-3z"}),"AddPhotoAlternateOutlined");function Sj({property:e}){const{trans:t}=MI(),n=Gp(t=>t.objects.active.editableProps[e]);return(0,i.jsxs)("div",{className:"flex items-center justify-center gap-14",children:[(0,i.jsx)(BI,{className:"flex-shrink-0",size:"xs","aria-label":t({message:"Color"}),value:"string"==typeof n?n:Id.fill,onChange:t=>{Yp().objects.setValues({[e]:t}),qp().setDirty(!0)}}),(0,i.jsx)(Aj,{type:"gradient",property:e}),(0,i.jsx)(Aj,{type:"texture",property:e})]})}function Aj({type:e,property:t}){return(0,i.jsx)(o.Fragment,{children:(0,i.jsxs)(zI,{type:"popover",children:[(0,i.jsx)(Wx,{className:"flex-shrink-0",id:`${e}-panel-trigger`,variant:"outline",size:"xs",startIcon:(0,i.jsx)("texture"===e?xj:Cj,{}),endIcon:(0,i.jsx)(NI,{}),children:(0,i.jsx)("span",{className:"capitalize",children:(0,i.jsx)(cS,"gradient"===e?{message:"Gradient"}:{message:"Texture"})})}),(0,i.jsx)(LI,{size:"auto",children:(0,i.jsx)("div",{className:"grid gap-8 grid-cols-5-min-content p-10 bg-paper rounded shadow-md",children:(0,i.jsx)(kj,{property:t,type:e})})})]})})}function kj({type:e,property:t}){const{close:n}=OI(),r=Array.from(Array("gradient"===e?wj.length:28).keys()),a="w-56 h-56 bg border shadow-sm hover:scale-110",s=r.map(r=>{const o=Lw(`images/${e}s/${r}.png`);return(0,i.jsx)(Hx,{radius:"rounded",className:a,style:{backgroundImage:`url(${o})`},"aria-label":`Select ${e} #${r}`,onClick:async()=>{n();const i="gradient"===e?new vw.fabric.Gradient(wj[r]):await Ij(o);Yp().objects.setValues({[t]:i}),qp().setDirty(!0)}},r)});return"texture"===e&&s.unshift((0,i.jsx)(Ej,{property:t,className:a},"upload-btn")),(0,i.jsx)(o.Fragment,{children:s})}function Ej({className:e,property:t}){const{close:n}=OI();return(0,i.jsx)(Hx,{radius:"rounded",className:e,"aria-label":"Upload an image",onClick:async()=>{const e=await Yp().import.openUploadWindow();if(n(),e){const n=await Ij(await e.data);Yp().objects.setValues({[t]:n})}},children:(0,i.jsx)(_j,{className:"icon-md"})})}function Ij(e){return new Promise(t=>{vw.fabric.util.loadImage(e,e=>{const n=new vw.fabric.Pattern({source:e,repeat:"repeat"});t(n)})})}function jj(){const e=Gp(e=>e.objects.active.editableProps.opacity);return(0,i.jsx)(ZI,{className:"max-w-240 w-full mx-auto","aria-label":"Opacity",value:e,minValue:.1,step:.1,maxValue:1,onChange:e=>{Yp().objects.setValues({opacity:e}),qp().setDirty(!0)}})}function Tj(){const{trans:e}=MI(),t=Gp(e=>e.objects.active.editableProps.stroke),n=Gp(e=>e.objects.active.editableProps.strokeWidth);return(0,i.jsxs)("div",{className:"flex items-center gap-40",children:[(0,i.jsx)(BI,{className:"ml-auto flex-shrink-0",size:"xs",value:t,"aria-label":e({message:"Outline Color"}),onChange:e=>{Yp().objects.setValues({stroke:e}),qp().setDirty(!0)}}),(0,i.jsx)(ZI,{"aria-label":"Outline Width",className:"max-w-240 mr-auto flex-shrink-0",value:n,onChange:e=>{Yp().objects.setValues({strokeWidth:e}),qp().setDirty(!0)}})]})}const Fj=Nd((0,i.jsx)("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-4.86 8.86-3 3.87L9 13.14 6 17h12l-3.86-5.14z"}),"ImageOutlined");function Oj(){return(0,i.jsx)("div",{className:"flex justify-center",children:(0,i.jsx)(Wx,{type:"button",variant:"outline",size:"xs",startIcon:(0,i.jsx)(Fj,{}),radius:"rounded-full",onClick:async()=>{const e=await Yp().import.openUploadWindow();if(e){const t=Yp().objects.getActive();if(t&&"setSrc"in t){const n=await e.data;t.setSrc(n,()=>{Iw({src:n}),Yp().canvas.render()})}}},children:(0,i.jsx)(cS,{message:"Replace Image"})})})}const Mj={color:"rgba(0, 0, 0, 0.6)",blur:3,offsetX:-1,offsetY:0};function Pj(){const{trans:e}=MI(),t=Gp(e=>e.objects.active.editableProps.shadow)||Mj;return(0,i.jsxs)("div",{className:"flex items-center gap-40",children:[(0,i.jsx)(BI,{className:"ml-auto flex-shrink-0",value:t.color,size:"xs","aria-label":e({message:"Shadow Color"}),onChange:e=>{Yp().objects.setValues({shadow:Rj({color:e})}),qp().setDirty(!0)}}),(0,i.jsx)(ZI,{"aria-label":"Shadow Blur",className:"max-w-240 mr-auto flex-shrink-0",defaultValue:t.blur,onChange:e=>{Yp().objects.setValues({shadow:Rj({blur:e})}),qp().setDirty(!0)}})]})}function Rj(e){var t;const n=null==(t=Yp().objects.getActive())?void 0:t.shadow;return n?(Object.entries(e).forEach(([e,t])=>{n[e]=t}),n):new vw.fabric.Shadow({...Mj,...e})}function Lj({index:e,className:t,isDisabled:n,children:r,padding:a,elementType:s="button",to:l,relative:c,width:u="min-w-min"}){const{selectedTab:d,setSelectedTab:h,tabsRef:f,size:p="md",id:g}=(0,o.useContext)(ij),m=e===d,v=function(){var e;return null===(e=(0,o.useContext)(M_))||void 0===e?void 0:e.focusManager}(),y=a||("sm"===p?"px-12":"px-18"),b=Pd("tracking-wide overflow-hidden capitalize text-sm flex items-center justify-center outline-none transition-colors","focus-visible:ring focus-visible:ring-2 ring-inset rounded whitespace-nowrap cursor-pointer",u,function({isDisabled:e,isSelected:t}){return e?"text-disabled cursor-default":t?"text-primary":"text-muted hover:text-main"}({isDisabled:n,isSelected:m}),t,"md"===p&&`${y} h-48`,"sm"===p&&`${y} h-32`,n&&"pointer-events-none");return(0,i.jsx)(s,{disabled:n,id:`${g}-${e}-tab`,"aria-controls":`${g}-${e}-tabpanel`,type:"button",role:"tab","aria-selected":m,tabIndex:n?void 0:m?0:-1,onKeyDown:e=>{switch(e.key){case"ArrowLeft":null==v||v.focusPrevious();break;case"ArrowRight":null==v||v.focusNext();break;case"Home":null==v||v.focusFirst();break;case"End":null==v||v.focusLast()}},onClick:()=>{h(e)},to:l,relative:c,className:b,ref:t=>{f.current&&t&&(f.current[e]=t)},children:r})}function Nj(){const e=Gp(e=>e.objects.active);return(0,i.jsxs)(sj,{size:"sm",className:"pb-18 pt-6",children:[(0,i.jsxs)(aj,{center:!0,children:[e.isText&&(0,i.jsx)(Lj,{children:(0,i.jsx)(cS,{message:"Font"})}),!e.isImage&&(0,i.jsx)(Lj,{children:(0,i.jsx)(cS,{message:"Color"})}),!e.isImage&&(0,i.jsx)(Lj,{children:(0,i.jsx)(cS,{message:"Background"})}),e.isImage&&(0,i.jsx)(Lj,{children:(0,i.jsx)(cS,{message:"Image"})}),(0,i.jsx)(Lj,{children:(0,i.jsx)(cS,{message:"Opacity"})}),(0,i.jsx)(Lj,{children:(0,i.jsx)(cS,{message:"Outline"})}),(0,i.jsx)(Lj,{children:(0,i.jsx)(cS,{message:"Shadow"})})]}),(0,i.jsxs)(yj,{className:"pt-16 h-50",children:[e.isText&&(0,i.jsx)(bj,{children:(0,i.jsx)(pj,{})},"font"),!e.isImage&&(0,i.jsx)(bj,{children:(0,i.jsx)(Sj,{property:"fill"})}),!e.isImage&&(0,i.jsx)(bj,{children:(0,i.jsx)(Sj,{property:"backgroundColor"})}),e.isImage&&(0,i.jsx)(bj,{children:(0,i.jsx)(Oj,{})}),(0,i.jsx)(bj,{children:(0,i.jsx)(jj,{})}),(0,i.jsx)(bj,{children:(0,i.jsx)(Tj,{})}),(0,i.jsx)(bj,{children:(0,i.jsx)(Pj,{})})]})]})}function Dj(){const e=!mS()&&(0,i.jsx)(Wx,{size:"sm",color:"primary",variant:"outline",onClick:()=>{Yp().text.add(),qp().setDirty(!0)},children:(0,i.jsx)(cS,{message:"New Text"})});return(0,i.jsx)(Xk,{actionBtn:e,children:(0,i.jsx)(Nj,{})})}const zj=Nd((0,i.jsx)("path",{d:"m20 12-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"}),"ArrowDownwardOutlined"),Bj={};let Uj=!1,Vj=null,Hj=null;const Wj=e=>{var t;for(const n in Bj)n!==e&&(null==(t=Bj[n])||t.call(Bj,!0),delete Bj[n])},$j=(0,o.forwardRef)(({children:e,label:t,placement:n="top",offset:r=10,variant:a="neutral",delay:s=1500,isDisabled:l,usePortal:c=!0,...u},d)=>{const{x:h,y:f,reference:p,strategy:g,arrowRef:m,arrowStyle:v,refs:y}=v_({placement:n,offset:r,ref:d,showArrow:!0}),[b,w]=(0,o.useState)(!1),x=(0,o.useId)(),C=(0,o.useRef)(),_=()=>{clearTimeout(C.current),C.current=void 0,Wj(x),Bj[x]=S,Uj=!0,w(!0),Vj&&(clearTimeout(Vj),Vj=null),Hj&&(clearTimeout(Hj),Hj=null)},S=(0,o.useCallback)(e=>{e?(clearTimeout(C.current),C.current=void 0,w(!1)):C.current||(C.current=setTimeout(()=>{C.current=void 0,w(!1)},500)),Vj&&(clearTimeout(Vj),Vj=null),Uj&&(Hj&&clearTimeout(Hj),Hj=setTimeout(()=>{delete Bj[x],Hj=null,Uj=!1},500))},[x]),A=e=>{!e&&s>0&&!C.current?(Wj(x),Bj[x]=S,b||Vj||Uj?b||_():Vj=setTimeout(()=>{Vj=null,Uj=!0,_()},s)):_()};(0,o.useEffect)(()=>()=>{clearTimeout(C.current),Bj[x]&&delete Bj[x]},[x]),(0,o.useEffect)(()=>{const e=e=>{"Escape"===e.key&&S(!0)};if(b)return document.addEventListener("keydown",e,!0),()=>{document.removeEventListener("keydown",e,!0)}},[b,S]);const k=(0,i.jsx)(Ub,{children:b&&(0,i.jsxs)(Pb.div,{...J_,ref:y.setFloating,id:x,role:"tooltip",onPointerEnter:()=>{A(!0)},onPointerLeave:()=>{S()},className:Pd("z-tooltip my-4 max-w-240 break-words rounded px-8 py-4 text-xs text-white shadow","positive"===a&&"bg-positive","danger"===a&&"bg-danger","neutral"===a&&"bg-toast"),style:{position:g,top:f??"",left:h??""},children:[(0,i.jsx)("div",{ref:m,className:"absolute h-8 w-8 rotate-45 bg-inherit",style:v}),t]})});return(0,i.jsxs)(o.Fragment,{children:[(0,o.cloneElement)(e,nw({"aria-describedby":b?x:void 0,ref:p,onPointerEnter:e=>{"mouse"===e.pointerType&&A()},onFocus:e=>{e.target.matches(":focus-visible")&&A(!0)},onPointerLeave:e=>{"mouse"===e.pointerType&&S()},onPointerDown:()=>{S(!0)},onBlur:()=>{S()},"aria-label":"string"==typeof t?t:t.props.message},u)),c?Bp&&(0,de.createPortal)(k,Bp):k]})});function Gj(){const e=Gp(e=>e.activeToolOverlay),t=Gp(e=>e.objects.active.id),n=function(e,t){switch(e){case Lf.Filter:return(0,i.jsx)(nj,{});case Lf.Frame:return(0,i.jsx)(rj,{});case Lf.Text:return t&&(0,i.jsx)(Dj,{});case Lf.ActiveObject:return t&&(0,i.jsx)(Nj,{});default:return null}}(e,t),[r,a]=(0,o.useState)(!0);return(0,i.jsxs)("div",{className:"relative z-tool-overlay text-sm",children:[n&&(0,i.jsx)("div",{className:Pd("absolute right-16 text-muted z-50 transition-all",!r&&"rotate-180",r?"-top-144":"-top-40"),children:(0,i.jsx)($j,{label:(0,i.jsx)(cS,r?{message:"Hide options"}:{message:"Show options"}),children:(0,i.jsx)(YS,{variant:"outline",radius:"rounded-lg",size:"xs",onClick:()=>{a(!r)},children:(0,i.jsx)(zj,{})})})}),(0,i.jsx)(Ub,{children:n&&r&&(0,i.jsx)(Pb.div,{initial:{y:0,opacity:0},animate:{y:"-100%",opacity:1},exit:{y:0,opacity:0},transition:{type:"tween",duration:.15},className:"absolute inset-x-0 gap-16 px-5vw bg bg-opacity-95 border-t",children:n},"tool-controls-overlay")})]})}const qj=Nd((0,i.jsx)("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm3.59-13L12 10.59 8.41 7 7 8.41 10.59 12 7 15.59 8.41 17 12 13.41 15.59 17 17 15.59 13.41 12 17 8.41z"}),"CancelOutlined");function Yj({filter:e}){const t=Gp(t=>t.filter.applied.includes(e)),n=Yp().filter.hasOptions(e),r=Pd("block flex-shrink-0 rounded",{"text-primary border-primary":t}),a=Ww[e],s=(0,i.jsxs)(o.Fragment,{children:[(0,i.jsxs)("div",{className:"relative",children:[(0,i.jsx)(Xj,{filter:e}),t&&(0,i.jsx)(Kj,{filter:e,hasOptions:n})]}),(0,i.jsx)("div",{className:"mt-4 text-center text-xs capitalize",children:a?(0,i.jsx)(cS,{...a}):e})]});return t&&n?(0,i.jsx)("div",{className:r,children:s}):(0,i.jsx)(Hx,{className:r,onClick:()=>{t?Yp().filter.remove(e):Yp().filter.apply(e)},children:s})}function Xj({filter:e}){const t=Gp(t=>t.filter.selected===e),n=Pd("m-auto w-96 h-56 border rounded object-cover",{shadow:t});return(0,i.jsx)("img",{src:Lw(`images/filter/${e}.jpg`),className:n,alt:""})}function Kj({filter:e,hasOptions:t}){return(0,i.jsxs)("div",{className:"flex items-center justify-center bg-background/70 absolute inset-0 border-2 border-primary rounded",children:[t?(0,i.jsx)(YS,{color:"primary",size:"md",onClick:()=>{Yp().filter.remove(e)},children:(0,i.jsx)(qj,{})}):(0,i.jsx)(qj,{className:"svg-icon icon-md"}),t&&(0,i.jsx)(Zj,{filter:e,hasOptions:t})]})}function Zj({filter:e,hasOptions:t}){return(0,i.jsx)(YS,{color:"primary",size:"md",onClick:()=>{qp().activeToolOverlay===Lf.Filter&&qp().filter.selected===e?qp().setActiveTool(qp().activeTool,null):qp().filter.select(e,t)},children:(0,i.jsx)(Bd,{})})}const Jj=(0,o.forwardRef)(({children:e,className:t,gap:n="gap-10"},r)=>{const a=o.Children.map(e,(t,n)=>o.isValidElement(t)?o.cloneElement(t,{isFirst:0===n,isLast:o.Children.count(e)===n+1}):t);return(0,i.jsx)("div",{ref:r,className:Pd("tiny-scrollbar pb-4 overflow-x-auto relative flex items-center",n,t),children:a})});function Qj({isFirst:e,isLast:t,children:n,className:r}){const o=Pd(r,"flex-shrink-0",{"ml-auto":e,"mr-auto":t});return(0,i.jsx)("div",{className:o,children:n})}function eT(){const e=Gp(e=>{var t,n;return null==(n=null==(t=e.config.tools)?void 0:t.filter)?void 0:n.items})||[];(0,o.useEffect)(()=>{Yp().filter.syncState()},[]);const t=e.map(e=>(0,i.jsx)(Qj,{children:(0,i.jsx)(Yj,{filter:e})},e));return(0,i.jsx)(Jj,{children:t})}const tT=Nd((0,i.jsx)("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zM9 6c0-1.66 1.34-3 3-3s3 1.34 3 3v2H9V6zm9 14H6V10h12v10zm-6-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"}),"LockOutlined"),nT=Nd((0,i.jsx)("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6h2c0-1.66 1.34-3 3-3s3 1.34 3 3v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm0 12H6V10h12v10zm-6-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"}),"LockOpenOutlined"),rT=Nd((0,i.jsx)("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlankOutlined"),iT=Nd((0,i.jsx)("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),oT=Nd((0,i.jsx)("path",{d:"M19,3H5C3.9,3,3,3.9,3,5v14c0,1.1,0.9,2,2,2h14c1.1,0,2-0.9,2-2V5C21,3.9,20.1,3,19,3z M17,13H7v-2h10V13z"}),"CheckBox"),aT=(0,o.forwardRef)((e,t)=>{const{size:n="md",children:r,className:a,icon:s,checkedIcon:l,disabled:c,isIndeterminate:u,errorMessage:d,invalid:h,orientation:f="horizontal",onChange:p,autoFocus:g,required:m,value:v,name:y,inputTestId:b}=e,w=MS({...e,label:r}),x=s||rT,C=l||(u?oT:iT),_=uw(t);VS({autoFocus:g},_),(0,o.useEffect)(()=>{_.current&&(_.current.indeterminate=u||!1)});const[S,A]=fw(e.checked,e.defaultChecked||!1),k=(0,o.useCallback)(e=>{null==p||p(e),A(e.target.checked)},[p,A]),E=Pd("select-none",a,h&&"text-danger",!h&&c&&"text-disabled");let I,j=h?"text-danger":null;return u?(I=oT,j=j||"text-primary"):S?(I=C,j=j||"text-primary"):(I=x,j=j||"text-muted"),(0,i.jsxs)("div",{children:[(0,i.jsx)("label",{className:E,children:(0,i.jsxs)("div",{className:Pd("relative flex items-center","vertical"===f&&"flex-col flex-col-reverse"),children:[(0,i.jsx)("input",{className:"absolute left-0 top-0 h-24 w-24 appearance-none overflow-hidden rounded outline-none ring-inset transition-shadow focus-visible:ring",type:"checkbox","aria-checked":u?"mixed":S,"aria-invalid":h||void 0,onChange:k,ref:_,required:m,disabled:c,value:v,name:y,"data-testid":b}),(0,i.jsx)(I,{size:n,className:Pd("pointer-events-none",c?"text-disabled":j)}),r&&(0,i.jsx)("div",{className:Pd("first-letter:capitalize",w.size.font,"vertical"===f?"mb-6":"ml-6"),children:r})]})}),d&&(0,i.jsx)("div",{className:w.error,children:d})]})});function sT(){const{trans:e}=MI(),{minWidth:t=50,minHeight:n=50,maxHeight:r=2400,maxWidth:a=2400}=Gp(e=>{var t;return null==(t=e.config.tools)?void 0:t.resize})||{},s=Gp(e=>e.original),l=Gp(e=>e.resize.formValue);return(0,o.useEffect)(()=>{qp().resize.setFormValue({...s})},[s]),(0,o.useEffect)(()=>{qp().setDirty(!0)},[]),(0,i.jsxs)("form",{className:"flex items-center justify-center gap-16 w-full",onSubmit:e=>{e.preventDefault(),qp().applyChanges()},children:[(0,i.jsx)(WS,{type:"number",min:t,max:a,size:"sm",className:"w-full max-w-112",label:(0,i.jsx)(cS,{message:"Width"}),value:l.width,onChange:e=>{(e=>{const t={...l,width:e};l.maintainAspect&&(t.height=Qw(e,l.usePercentages)),qp().resize.setFormValue(t)})(e.target.valueAsNumber)}}),(0,i.jsx)("div",{className:"mt-24",children:(0,i.jsx)(aT,{size:"md",checked:l.maintainAspect,onChange:e=>{(e=>{const t={...l,maintainAspect:e};e&&(t.height=Qw(t.width,t.usePercentages)),qp().resize.setFormValue(t)})(!l.maintainAspect)},"aria-label":e({message:"Maintain aspect ratio"}),checkedIcon:tT,icon:nT})}),(0,i.jsx)(WS,{type:"number",min:n,max:r,size:"sm",className:"w-full max-w-112",label:(0,i.jsx)(cS,{message:"Height"}),value:l.height,onChange:e=>{(e=>{const t={...l,height:e};e&&l.maintainAspect&&(t.width=Jw(e,l.usePercentages)),qp().resize.setFormValue(t)})(e.target.valueAsNumber)}}),(0,i.jsx)("button",{type:"submit",className:"hidden",children:(0,i.jsx)(cS,{message:"Resize"})})]})}function lT(){const e=Gp(e=>{var t,n;return null==(n=null==(t=e.config.tools)?void 0:t.crop)?void 0:n.presets})||[],t=Gp(e=>e.crop.selectedAspectRatio),n=Gp(e=>{var t,n;return null==(n=null==(t=e.config.tools)?void 0:t.crop)?void 0:n.allowCustomRatio})??!0,r=e.filter(e=>e.ratio||!e.ratio&&n).map(e=>(0,i.jsx)(Qj,{children:(0,i.jsxs)(Hx,{onClick:()=>Yp().crop.resetCropzone(e.ratio),className:"flex flex-col items-center justify-between cursor-pointer h-56",children:[(0,i.jsx)(cT,{preset:e,selectedRatio:t}),(0,i.jsx)(uT,{preset:e,selectedRatio:t})]})},e.ratio||e.name));return(0,i.jsx)(Jj,{gap:"gap-18",children:r})}function cT({preset:e,selectedRatio:t}){let n=40,r=30;if(e.ratio){const t=nx(e.ratio);({width:n,height:r}=tx(t,n,r))}const o=Pd("border-2",{"border-dotted":null===e.ratio,"border-primary":t===e.ratio});return(0,i.jsx)("div",{style:{width:`${n}px`,height:`${r}px`},className:o})}function uT({preset:e,selectedRatio:t}){const n=Pd("mt-4 text-center text-xs",{"text-primary":t===e.ratio});return(0,i.jsx)("div",{className:n,children:e.name?(0,i.jsx)(cS,{message:e.name}):e.ratio})}const dT=Nd((0,i.jsx)("path",{d:"M15 21h2v-2h-2v2zm4-12h2V7h-2v2zM3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2zm16-2v2h2c0-1.1-.9-2-2-2zm-8 20h2V1h-2v22zm8-6h2v-2h-2v2zM15 5h2V3h-2v2zm4 8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2z"}),"FlipOutlined");function hT(){return(0,i.jsxs)("div",{children:[(0,i.jsx)(YS,{size:"sm",onClick:()=>{Yp().transform.flip("vertical"),qp().setDirty(!0)},children:(0,i.jsx)(dT,{})}),(0,i.jsx)(YS,{size:"sm",onClick:()=>{Yp().transform.flip("horizontal"),qp().setDirty(!0)},children:(0,i.jsx)(dT,{className:"rotate-90"})})]})}const fT=Nd((0,i.jsx)("path",{d:"M7.11 8.53 5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47zM6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47zm1.01 5.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32zM13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93z"}),"RotateLeftOutlined"),pT=Nd((0,i.jsx)("path",{d:"M15.55 5.55 11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45zM19.93 11c-.17-1.39-.72-2.73-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47h2.02zM13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03zm3.89-2.42 1.42 1.41c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.48z"}),"RotateRightOutlined");function gT(){return(0,i.jsxs)("div",{children:[(0,i.jsx)(YS,{size:"sm",onClick:()=>{Yp().transform.rotateLeft(),qp().setDirty(!0)},children:(0,i.jsx)(fT,{})}),(0,i.jsx)(YS,{size:"sm",onClick:()=>{Yp().transform.rotateRight(),qp().setDirty(!0)},children:(0,i.jsx)(pT,{})})]})}function mT(){return(0,i.jsxs)("div",{className:"flex items-center justify-center gap-16",children:[(0,i.jsx)(hT,{}),(0,i.jsx)(vT,{}),(0,i.jsx)(gT,{})]})}function vT(){const e=(0,o.useRef)(null),{domProps:t,groupId:n,thumbIds:r,trackRef:a,getThumbValueLabel:s}=YI({minValue:-45,maxValue:45,step:1,defaultValue:[qp().crop.straightenAngle],onChange:t=>{const n=t[0];Yp().transform.straighten(n),qp().crop.setTransformAngle(n),qp().setDirty(!0),e.current.style.transform=`translateX(${n}px)`}});return(0,i.jsx)("div",{id:n,role:"group",className:"flex-auto flex-shrink-0 max-w-320 touch-none isolate",children:(0,i.jsxs)("div",{...t,ref:a,className:"h-36 relative",children:[(0,i.jsxs)("output",{htmlFor:r[0],"aria-live":"off",className:"absolute left-1/2 top-1/2 w-40 text-center bg -translate-x-1/2 -translate-y-1/2 z-10",children:[s(0),"\xb0"]}),(0,i.jsx)(yT,{ref:e})]})})}const yT=o.forwardRef((e,t)=>{const n=[...Array(80).keys()],r=n.map(e=>(0,i.jsx)("circle",{cx:2+10*e,cy:"20",r:e%5?.75:2},e));return(0,i.jsx)("div",{className:"relative h-full cursor-pointer overflow-hidden",children:(0,i.jsx)("svg",{ref:t,style:{width:10*n.length},className:"absolute -left-80 h-full fill-current",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",children:r})})});function bT(){return(0,o.useEffect)(()=>(qp().setDirty(!0),Yp().frame.active.hide(),()=>{Yp().frame.active.show()}),[]),(0,i.jsxs)("div",{className:"pb-16",children:[(0,i.jsx)("div",{className:"mb-10",children:(0,i.jsx)(mT,{})}),(0,i.jsx)(lT,{})]})}const wT=Nd((0,i.jsx)("path",{d:"M 16 6 C 12.484375 6 9.273438 7.070313 6.90625 8.84375 C 4.539063 10.617188 3 13.15625 3 16 C 3 18.84375 4.539063 21.382813 6.90625 23.15625 C 9.273438 24.929688 12.484375 26 16 26 C 19.515625 26 22.726563 24.929688 25.09375 23.15625 C 27.460938 21.382813 29 18.84375 29 16 C 29 13.15625 27.460938 10.617188 25.09375 8.84375 C 22.726563 7.070313 19.515625 6 16 6 Z M 16 8 C 19.109375 8 21.898438 8.957031 23.875 10.4375 C 25.851563 11.917969 27 13.875 27 16 C 27 18.125 25.851563 20.082031 23.875 21.5625 C 21.898438 23.042969 19.109375 24 16 24 C 12.890625 24 10.101563 23.042969 8.125 21.5625 C 6.148438 20.082031 5 18.125 5 16 C 5 13.875 6.148438 11.917969 8.125 10.4375 C 10.101563 8.957031 12.890625 8 16 8 Z "})),xT=Nd((0,i.jsx)("path",{d:"M 16 4 C 9.382813 4 4 9.382813 4 16 C 4 22.617188 9.382813 28 16 28 C 22.617188 28 28 22.617188 28 16 C 28 9.382813 22.617188 4 16 4 Z M 16 6 C 21.535156 6 26 10.464844 26 16 C 26 21.535156 21.535156 26 16 26 C 10.464844 26 6 21.535156 6 16 C 6 10.464844 10.464844 6 16 6 Z "})),CT=Nd((0,i.jsx)("path",{d:"M 3 6 L 3 26 L 29 26 L 29 6 Z M 5 8 L 27 8 L 27 24 L 5 24 Z "})),_T=Nd((0,i.jsx)("path",{d:"M 16 4.90625 L 15.125 6.40625 L 4.71875 24.5 L 3.875 26 L 28.125 26 L 27.28125 24.5 L 16.875 6.40625 Z M 16 8.9375 L 24.65625 24 L 7.34375 24 Z "}));function ST(){const e=(Gp(e=>{var t,n;return null==(n=null==(t=e.config.tools)?void 0:t.shapes)?void 0:n.items})||[]).map(e=>(0,i.jsx)(Qj,{children:(0,i.jsx)(YS,{variant:"outline",radius:"rounded-2xl",size:"xl",onClick:()=>{Yp().shape.addBasicShape(e.name),qp().setDirty(!0)},children:(0,i.jsx)(AT,{shape:e})})},e.name));return(0,i.jsx)(Jj,{children:e})}function AT({shape:e}){var t;return"Path"===e.type?(0,i.jsx)("svg",{className:"m-auto w-36 h-36",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 -100 512 700",children:(0,i.jsx)("path",{className:"fill-transparent stroke-current",d:null==(t=e.options)?void 0:t.path,strokeWidth:25})}):o.cloneElement(kT[e.name],{className:"w-30 h-30"})}const kT={circle:(0,i.jsx)(xT,{viewBox:"0 0 32 32"}),square:(0,i.jsx)(CT,{viewBox:"0 0 32 32"}),triangle:(0,i.jsx)(_T,{viewBox:"0 0 32 32"}),ellipse:(0,i.jsx)(wT,{viewBox:"0 0 32 32"})};function ET(e,t,n){let r,i=n.initialDeps??[];return()=>{var o,a,s,l;let c;n.key&&null!=(o=n.debug)&&o.call(n)&&(c=Date.now());const u=e();if(u.length===i.length&&!u.some((e,t)=>i[t]!==e))return r;let d;if(i=u,n.key&&null!=(a=n.debug)&&a.call(n)&&(d=Date.now()),r=t(...u),n.key&&null!=(s=n.debug)&&s.call(n)){Math.round(100*(Date.now()-c)),Math.round(100*(Date.now()-d))}return null==(l=null==n?void 0:n.onChange)||l.call(n,r),r}}function IT(e,t){if(void 0===e)throw new Error("Unexpected undefined");return e}const jT=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}},TT=e=>e,FT=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let i=t;i<=n;i++)r.push(i);return r},OT=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const i=e=>{const{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(n.getBoundingClientRect()),!r.ResizeObserver)return()=>{};const o=new r.ResizeObserver(e=>{const t=e[0];if(null!=t&&t.borderBoxSize){const e=t.borderBoxSize[0];if(e)return void i({width:e.inlineSize,height:e.blockSize})}i(n.getBoundingClientRect())});return o.observe(n,{box:"border-box"}),()=>{o.unobserve(n)}},MT={passive:!0},PT=typeof window>"u"||"onscrollend"in window,RT=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let i=0;const o=PT?()=>{}:jT(r,()=>{t(i,!1)},e.options.isScrollingResetDelay),a=r=>()=>{i=n[e.options.horizontal?"scrollLeft":"scrollTop"],o(),t(i,r)},s=a(!0),l=a(!1);return l(),n.addEventListener("scroll",s,MT),n.addEventListener("scrollend",l,MT),()=>{n.removeEventListener("scroll",s),n.removeEventListener("scrollend",l)}},LT=(e,t,n)=>{if(null!=t&&t.borderBoxSize){const e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?"inlineSize":"blockSize"])}return Math.round(e.getBoundingClientRect()[n.options.horizontal?"width":"height"])},NT=(e,{adjustments:t=0,behavior:n},r)=>{var i,o;const a=e+t;null==(o=null==(i=r.scrollElement)?void 0:i.scrollTo)||o.call(i,{[r.options.horizontal?"left":"top"]:a,behavior:n})};class DT{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollDirection=null,this.scrollAdjustments=0,this.measureElementCache=new Map,this.observer=(()=>{let e=null;const t=()=>e||(this.targetWindow&&this.targetWindow.ResizeObserver?e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{this._measureElement(e.target,e)})}):null);return{disconnect:()=>{var e;return null==(e=t())?void 0:e.disconnect()},observe:e=>{var n;return null==(n=t())?void 0:n.observe(e,{box:"border-box"})},unobserve:e=>{var n;return null==(n=t())?void 0:n.unobserve(e)}}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach(([t,n])=>{typeof n>"u"&&delete e[t]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:TT,rangeExtractor:FT,onChange:()=>{},measureElement:LT,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,...e}},this.notify=(e,t)=>{var n,r;const{startIndex:i,endIndex:o}=this.range??{startIndex:void 0,endIndex:void 0},a=this.calculateRange();(e||i!==(null==a?void 0:a.startIndex)||o!==(null==a?void 0:a.endIndex))&&(null==(r=(n=this.options).onChange)||r.call(n,this,t))},this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.scrollElement=null},this._didMount=()=>(this.measureElementCache.forEach(this.observer.observe),()=>{this.observer.disconnect(),this.cleanup()}),this._willUpdate=()=>{var e;const t=this.options.getScrollElement();this.scrollElement!==t&&(this.cleanup(),this.scrollElement=t,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=(null==(e=this.scrollElement)?void 0:e.window)??null,this._scrollToOffset(this.scrollOffset,{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.notify(!1,!1)})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{this.scrollAdjustments=0,this.scrollDirection=t?this.scrollOffset<e?"forward":"backward":null,this.scrollOffset=e;const n=this.isScrolling;this.isScrolling=t,this.notify(n!==t,t)})))},this.getSize=()=>this.scrollRect[this.options.horizontal?"width":"height"],this.getMeasurementOptions=ET(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey],(e,t,n,r)=>(this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:t,scrollMargin:n,getItemKey:r}),{key:!1}),this.getFurthestMeasurement=(e,t)=>{const n=new Map,r=new Map;for(let i=t-1;i>=0;i--){const t=e[i];if(n.has(t.lane))continue;const o=r.get(t.lane);if(null==o||t.end>o.end?r.set(t.lane,t):t.end<o.end&&n.set(t.lane,!0),n.size===this.options.lanes)break}return r.size===this.options.lanes?Array.from(r.values()).sort((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end)[0]:void 0},this.getMeasurements=ET(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r},i)=>{const o=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const a=this.measurementsCache.slice(0,o);for(let s=o;s<e;s++){const e=r(s),o=1===this.options.lanes?a[s-1]:this.getFurthestMeasurement(a,s),l=o?o.end+this.options.gap:t+n,c=i.get(e),u="number"==typeof c?c:this.options.estimateSize(s),d=l+u,h=o?o.lane:s%this.options.lanes;a[s]={index:s,start:l,size:u,end:d,key:e,lane:h}}return this.measurementsCache=a,a},{key:!1,debug:()=>this.options.debug}),this.calculateRange=ET(()=>[this.getMeasurements(),this.getSize(),this.scrollOffset],(e,t,n)=>this.range=e.length>0&&t>0?function({measurements:e,outerSize:t,scrollOffset:n}){const r=e.length-1,i=zT(0,r,t=>e[t].start,n);let o=i;for(;o<r&&e[o].end<n+t;)o++;return{startIndex:i,endIndex:o}}({measurements:e,outerSize:t,scrollOffset:n}):null,{key:!1,debug:()=>this.options.debug}),this.getIndexes=ET(()=>[this.options.rangeExtractor,this.calculateRange(),this.options.overscan,this.options.count],(e,t,n,r)=>null===t?[]:e({startIndex:t.startIndex,endIndex:t.endIndex,overscan:n,count:r}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{const t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):-1},this._measureElement=(e,t)=>{const n=this.measurementsCache[this.indexFromElement(e)];if(!n||!e.isConnected)return void this.measureElementCache.forEach((t,n)=>{t===e&&(this.observer.unobserve(e),this.measureElementCache.delete(n))});const r=this.measureElementCache.get(n.key);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.measureElementCache.set(n.key,e));const i=this.options.measureElement(e,t,this);this.resizeItem(n,i)},this.resizeItem=(e,t)=>{const n=t-(this.itemSizeCache.get(e.key)??e.size);0!==n&&((void 0!==this.shouldAdjustScrollPositionOnItemSizeChange?this.shouldAdjustScrollPositionOnItemSizeChange(e,n,this):e.start<this.scrollOffset+this.scrollAdjustments)&&this._scrollToOffset(this.scrollOffset,{adjustments:this.scrollAdjustments+=n,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(e.index),this.itemSizeCache=new Map(this.itemSizeCache.set(e.key,t)),this.notify(!0,!1))},this.measureElement=e=>{e&&this._measureElement(e,void 0)},this.getVirtualItems=ET(()=>[this.getIndexes(),this.getMeasurements()],(e,t)=>{const n=[];for(let r=0,i=e.length;r<i;r++){const i=t[e[r]];n.push(i)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{const t=this.getMeasurements();return IT(t[zT(0,t.length-1,e=>IT(t[e]).start,e)])},this.getOffsetForAlignment=(e,t)=>{const n=this.getSize();"auto"===t&&(t=e<=this.scrollOffset?"start":e>=this.scrollOffset+n?"end":"start"),"start"===t||("end"===t?e-=n:"center"===t&&(e-=n/2));const r=this.options.horizontal?"scrollWidth":"scrollHeight",i=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[r]:this.scrollElement[r]:0)-this.getSize();return Math.max(Math.min(i,e),0)},this.getOffsetForIndex=(e,t="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));const n=IT(this.getMeasurements()[e]);if("auto"===t)if(n.end>=this.scrollOffset+this.getSize()-this.options.scrollPaddingEnd)t="end";else{if(!(n.start<=this.scrollOffset+this.options.scrollPaddingStart))return[this.scrollOffset,t];t="start"}const r="end"===t?n.end+this.options.scrollPaddingEnd:n.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(r,t),t]},this.isDynamicMode=()=>this.measureElementCache.size>0,this.cancelScrollToIndex=()=>{null!==this.scrollToIndexTimeoutId&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(e,{align:t="start",behavior:n}={})=>{this.cancelScrollToIndex(),"smooth"===n&&this.isDynamicMode(),this._scrollToOffset(this.getOffsetForAlignment(e,t),{adjustments:void 0,behavior:n})},this.scrollToIndex=(e,{align:t="auto",behavior:n}={})=>{e=Math.max(0,Math.min(e,this.options.count-1)),this.cancelScrollToIndex(),"smooth"===n&&this.isDynamicMode();const[r,i]=this.getOffsetForIndex(e,t);this._scrollToOffset(r,{adjustments:void 0,behavior:n}),"smooth"!==n&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.measureElementCache.has(this.options.getItemKey(e))){const[t]=this.getOffsetForIndex(e,i);((e,t)=>Math.abs(e-t)<1)(t,this.scrollOffset)||this.scrollToIndex(e,{align:i,behavior:n})}else this.scrollToIndex(e,{align:i,behavior:n})}))},this.scrollBy=(e,{behavior:t}={})=>{this.cancelScrollToIndex(),"smooth"===t&&this.isDynamicMode(),this._scrollToOffset(this.scrollOffset+e,{adjustments:void 0,behavior:t})},this.getTotalSize=()=>{var e;const t=this.getMeasurements();let n;return n=0===t.length?this.options.paddingStart:1===this.options.lanes?(null==(e=t[t.length-1])?void 0:e.end)??0:Math.max(...t.slice(-this.options.lanes).map(e=>e.end)),n-this.options.scrollMargin+this.options.paddingEnd},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{var e,t;this.itemSizeCache=new Map,null==(t=(e=this.options).onChange)||t.call(e,this,!1)},this.setOptions(e),this.scrollRect=this.options.initialRect,this.scrollOffset="function"==typeof this.options.initialOffset?this.options.initialOffset():this.options.initialOffset,this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}),this.notify(!1,!1)}}const zT=(e,t,n,r)=>{for(;e<=t;){const i=(e+t)/2|0,o=n(i);if(o<r)e=i+1;else{if(!(o>r))return i;t=i-1}}return e>0?e-1:0},BT=typeof document<"u"?o.useLayoutEffect:o.useEffect;function UT(){const e=Gp(e=>{var t;return null==(t=e.config.ui)?void 0:t.activeTheme});return Gp(t=>{var n;return((null==(n=t.config.ui)?void 0:n.themes)||[]).find(t=>t.name===e)})}function VT({category:e}){const t=UT(),n=e.name,r=e.list?e.list:Array.from(Array(e.items).keys()),a=(0,o.useRef)(null),s=function(e){return function(e){const t=o.useReducer(()=>({}),{})[1],n={...e,onChange:(n,r)=>{var i;r?(0,de.flushSync)(t):t(),null==(i=e.onChange)||i.call(e,n,r)}},[r]=o.useState(()=>new DT(n));return r.setOptions(n),o.useEffect(()=>r._didMount(),[]),BT(()=>r._willUpdate()),r}({observeElementRect:OT,observeElementOffset:RT,scrollToFn:NT,...e})}({horizontal:!0,count:r.length,getScrollElement:()=>a.current,estimateSize:(0,o.useCallback)(()=>52,[]),overscan:5});return(0,o.useEffect)(()=>{s.scrollToIndex(0)},[n]),(0,i.jsx)(o.Fragment,{children:(0,i.jsx)("div",{ref:a,className:"tiny-scrollbar overflow-x-auto overflow-y-hidden",style:{height:"52px"},children:(0,i.jsx)("div",{className:"h-full relative mx-auto",style:{width:`${s.getTotalSize()}px`},children:s.getVirtualItems().map(n=>{const o=`${r[n.index]}`;return(0,i.jsx)("div",{className:"absolute top-0 left-0 h-full",style:{width:`${n.size}px`,transform:`translateX(${n.start}px)`},children:(0,i.jsx)(Wx,{variant:"outline",radius:"rounded-xl",size:"md",equalWidth:!0,onClick:async()=>{await Yp().shape.addSticker(e.name,o),qp().setDirty(!0)},children:(0,i.jsx)("img",{className:Pd("m-auto m-auto w-28 h-28",e.invertPreview&&(null==t?void 0:t.isDark)&&"invert"),src:ox(e,o),alt:o})})},n.index)})})})})}function HT(){const e=Gp(e=>{var t,n;return null==(n=null==(t=e.config.tools)?void 0:t.stickers)?void 0:n.items})||[],[t,n]=(0,o.useState)(e[0]),r=e.map(e=>{const n=t===e,r=Ed[e.name];return(0,i.jsx)(Wx,{size:"xs",color:n?"primary":null,value:e,children:(0,i.jsx)("span",{className:"capitalize",children:r?(0,i.jsx)(cS,{...r}):e.name})},e.name)});return(0,i.jsxs)("div",{className:"h-92",children:[(0,i.jsx)("div",{className:"mb-10 w-full hide-scrollbar overflow-x-auto overflow-y-hidden flex",children:(0,i.jsx)(eA,{value:t,onChange:e=>n(e),variant:"outline",radius:"rounded-full",className:"mx-auto",children:r})}),t&&(0,i.jsx)(VT,{category:t})]})}function WT(){const e=Gp(e=>{var t,n;return null==(n=null==(t=e.config.tools)?void 0:t.frame)?void 0:n.items})||[],t=Gp(e=>e.frame.active);(0,o.useEffect)(()=>{qp().frame.active&&qp().frame.showOptionsPanel()},[]);const n=e.map(e=>{const n=Lw(`images/frames/${e.name}/thumbnail.png`),r=(null==t?void 0:t.name)===e.name;return(0,i.jsx)(Qj,{children:(0,i.jsxs)("button",{type:"button",className:"border-2 overflow-hidden relative rounded border cursor-pointer "+(r?"border-primary":""),onClick:()=>{qp().setDirty(!0),r?Yp().frame.remove():Yp().frame.add(e.name)},children:[r&&(0,i.jsx)($T,{}),(0,i.jsx)("img",{draggable:"false",className:"w-64 h-64",src:n,alt:e.name})]})},e.name)});return(0,i.jsx)(Jj,{children:n})}function $T(){return(0,i.jsx)("span",{className:"bg-background/70 absolute inset-0 text-primary",children:(0,i.jsx)(qj,{className:"svg-icon icon-md absolute inset-0 block m-auto"})})}function GT(){const e=Gp(e=>{var t,n;return null==(n=null==(t=e.config.tools)?void 0:t.text)?void 0:n.items});(0,o.useEffect)(()=>{e&&Bw(e,{prefixSrc:Lw,id:"pixie-fonts"}).catch(()=>{})},[e]),(0,o.useEffect)(()=>{Yp().text.selectOrAddText()&&qp().setDirty(!0)},[]);const t=(e||[]).map(e=>(0,i.jsx)(Qj,{children:(0,i.jsx)(qT,{fontConfig:e})},e.family));return(0,i.jsx)(Jj,{className:"pt-6",children:t})}function qT({fontConfig:e}){var t;const n=Gp(e=>e.objects.active.editableProps.fontFamily),r=Pd("block px-6 w-110 h-68 text-sm bg border rounded-2xl",{"border-primary":n===e.family,"text-primary":n===e.family});return(0,i.jsx)("button",{type:"button",className:r,style:{fontFamily:e.family.includes('"')?e.family:`"${e.family}"`,fontWeight:(null==(t=e.descriptors)?void 0:t.weight)||"normal"},onClick:async()=>{Yp().text.selectOrAddText(),qp().setDirty(!0),Yp().objects.setValues({fontFamily:e.family})},children:e.family})}const YT=Nd((0,i.jsx)("path",{d:"M290.7 57.4L57.4 290.7c-25 25-25 65.5 0 90.5l80 80c12 12 28.3 18.7 45.3 18.7H288h9.4H512c17.7 0 32-14.3 32-32s-14.3-32-32-32H387.9L518.6 285.3c25-25 25-65.5 0-90.5L381.3 57.4c-25-25-65.5-25-90.5 0zM297.4 416H288l-105.4 0-80-80L227.3 211.3 364.7 348.7 297.4 416z"}),"EraserFA","0 0 576 512");function XT(){return(0,o.useEffect)(()=>(Yp().draw.enable(),()=>{Yp().draw.disable()}),[]),(0,i.jsxs)(Jj,{gap:"gap-16",children:[(0,i.jsx)(Qj,{children:(0,i.jsx)(BI,{size:"sm",label:(0,i.jsx)(cS,{message:"Brush Color"}),value:Yp().draw.currentBrush.color,onChange:e=>{Yp().draw.setBrushColor(e)}})}),(0,i.jsx)(Qj,{children:(0,i.jsx)(ZT,{})}),(0,i.jsx)(Qj,{children:(0,i.jsx)(KT,{})})]})}function KT(){const e=Gp(e=>{var t,n;return null==(n=null==(t=e.config.tools)?void 0:t.draw)?void 0:n.brushSizes})||[],[t,n]=(0,o.useState)(Yp().draw.currentBrush.width);return(0,i.jsx)(tj,{selectionMode:"single",selectedValue:t,onSelectionChange:e=>{n(e),Yp().draw.setBrushSize(e)},size:"sm",label:(0,i.jsx)(cS,{message:"Brush Size"}),children:e.map(e=>(0,i.jsx)(Zx,{value:e,children:(0,i.jsxs)("div",{className:"flex items-center",children:[(0,i.jsx)("div",{className:"flex-shrink-0 mr-8 border-[3px] rounded-full",style:{width:`${e}px`,height:`${e}px`}}),e]})},e))})}function ZT(){const e=Gp(e=>{var t,n;return null==(n=null==(t=e.config.tools)?void 0:t.draw)?void 0:n.brushTypes})||[],t=UT(),[n,r]=(0,o.useState)(Yp().draw.currentBrush.type);return(0,i.jsx)(tj,{selectionMode:"single",selectedValue:n,onSelectionChange:e=>{r(e),Yp().draw.setBrushType(e)},size:"sm",label:(0,i.jsx)(cS,{message:"Brush Type"}),children:e.map(e=>(0,i.jsx)(Zx,{value:e,children:(0,i.jsxs)("div",{className:"flex items-center",children:["EraserBrush"===e?(0,i.jsx)(YT,{className:"mr-8"}):(0,i.jsx)("img",{className:"flex-shrink-0 mr-8 w-24 h-24",src:JT(e,null==t?void 0:t.isDark),alt:""}),(0,i.jsx)(cS,{message:e.replace(/([A-Z])/g," $1").trim()})]})},e))})}function JT(e,t=!1){return Lw(`images/brushes/${t?"white":"black"}/${e.replace("Brush","").toLowerCase()}.png`)}function QT(){const{trans:e}=MI(),t=Gp(e=>e.corners.radius);return(0,o.useEffect)(()=>(qp().setDirty(!0),Yp().corners.showPreview(),()=>Yp().corners.hidePreview()),[]),(0,i.jsx)("div",{className:"max-w-320 mx-auto",children:(0,i.jsx)(ZI,{minValue:1,maxValue:300,label:e({message:"Radius"}),getValueLabel:e=>`${e}px`,onChange:e=>{Yp().corners.updatePreview(e),qp().corners.setRadius(e)},value:t})})}const eF={initial:{y:"130%",opacity:0},animate:{y:0,opacity:1},exit:{y:"130%",opacity:0,left:0,position:"absolute",overflowY:"hidden"},transition:{type:"tween",duration:.15}};function tF({activeTool:e}){const t=function(e){switch(e){case Od.FILTER:return(0,i.jsx)(eT,{});case Od.RESIZE:return(0,i.jsx)(sT,{});case Od.CROP:return(0,i.jsx)(bT,{});case Od.DRAW:return(0,i.jsx)(XT,{});case Od.TEXT:return(0,i.jsx)(GT,{});case Od.SHAPES:return(0,i.jsx)(ST,{});case Od.STICKERS:return(0,i.jsx)(HT,{});case Od.FRAME:return(0,i.jsx)(WT,{});case Od.CORNERS:return(0,i.jsx)(QT,{});default:return null}}(e);return(0,i.jsx)(Pb.div,{className:"relative h-full w-full text-sm bg select-none overflow-hidden",...eF,children:t})}function nF({className:e}){const t=Gp(e=>e.activeTool);return(0,i.jsx)("nav",{className:Pd("z-navbar min-h-86 flex-shrink-0 px-16 relative overflow-hidden",e),children:(0,i.jsx)(Ub,{initial:!1,children:t?(0,i.jsx)(tF,{activeTool:t},"tool-controls"):(0,i.jsx)(rF,{},"nav-items")})})}function rF(){const e=Gp(e=>{var t,n;return null==(n=null==(t=e.config.ui)?void 0:t.nav)?void 0:n.items})||[];return(0,i.jsx)(Pb.div,{className:"w-full h-full bg-inherit",...eF,children:(0,i.jsx)(Jj,{children:e.map(e=>(0,i.jsx)(Qj,{children:(0,i.jsx)(iF,{item:e})},e.name))})})}function iF({item:e}){const t=rh[e.name];return(0,i.jsxs)(Hx,{variant:"outline",color:"paper",className:"flex-col flex-shrink-0 w-68 h-68",radius:"rounded-2xl",onClick:()=>{"string"==typeof e.action?eg(e.action):"function"==typeof e.action&&e.action(qp().editor)},children:[(0,i.jsx)("div",{className:"mb-1",children:(0,i.jsx)(XS,{className:"icon-md",icon:e.icon})}),(0,i.jsx)("div",{className:"mt-6 text-xs capitalize max-w-[90%] overflow-hidden overflow-ellipsis",children:t?(0,i.jsx)(cS,{...t}):e.name})]})}function oF(){const e=Gp(e=>e.history.items),t=Gp(e=>e.history.pointer);return(0,i.jsxs)(Pb.div,{...J_,className:"absolute bottom-20 right-20 w-224 max-w-[calc(100%-40px)] max-h-[calc(100%-40px)] bg-paper shadow-xl border focus:outline-none rounded overflow-hidden",children:[(0,i.jsxs)("div",{className:"px-10 py-2 mb-4 font-medium text-sm border-b flex items-center",children:[(0,i.jsx)(cS,{message:"History"}),(0,i.jsx)(YS,{size:"xs",className:"ml-auto flex-shrink-0",onClick:()=>{qp().togglePanel("history",!1)},children:(0,i.jsx)(cA,{})})]}),(0,i.jsx)("div",{className:"p-10",children:e.map(n=>{const r=n.id===e[t].id,a=th[n.name],s=a.icon&&o.createElement(a.icon,{className:"icon-sm"});return(0,i.jsx)(Wx,{onClick:()=>{r||Yp().history.load(n)},variant:"outline",color:r?"primary":null,size:"sm",className:Pd("w-full mb-8",r&&"pointer-events-none"),justify:"justify-start",startIcon:s,children:(0,i.jsx)(cS,{...a.name})},n.id)})})]})}function aF(e){const{children:t,className:n,color:r,onDismiss:a,leftAdornment:s,rightAdornment:l,hideDismissButton:c=!1,size:u,showDivider:d,justify:h="justify-between",titleFontWeight:f="font-semibold",titleTextSize:p=("xs"===u?"text-xs":"text-sm"),closeButtonSize:g=("xs"===u?"xs":"sm"),actions:m}=e,{labelId:v,isDismissable:y,close:b}=(0,o.useContext)(FI);return(0,i.jsxs)("div",{className:Pd(n,"flex flex-shrink-0 items-center gap-10",f,d&&"border-b",sF(e),r||"text-main",h),children:[s,(0,i.jsx)("h3",{id:v,className:Pd(p,"mr-auto leading-5 opacity-90"),children:t}),l,m,y&&!c&&(0,i.jsx)(YS,{"aria-label":"Dismiss",onClick:()=>{a?a():b()},size:g,className:Pd("-mr-8 text-muted",l&&"sr-only"),children:(0,i.jsx)(cA,{})})]})}function sF({size:e,padding:t}){if(t)return t;switch(e){case"2xs":case"xs":return"px-14 py-4";case"sm":return"px-18 py-4";default:return"px-24 py-6"}}const lF=(0,o.forwardRef)((e,t)=>{const{children:n,className:r,padding:o,size:a,...s}=e;return(0,i.jsx)("div",{...s,ref:t,className:Pd(r,cF(e),"overflow-y-auto overflow-x-hidden overscroll-contain text-sm flex-auto"),children:n})});function cF({size:e,padding:t}){if(t)return t;switch(e){case"xs":return"p-14";case"sm":return"p-18";default:return"px-24 py-20"}}function uF(){const e=Gp(e=>e.openPanels.newImage);return(0,i.jsx)(zI,{isOpen:e,disableInitialTransition:!0,type:"modal",isDismissable:!1,children:(0,i.jsx)(dF,{})})}function dF(){const[e,t]=(0,o.useState)("default");return(0,i.jsxs)(LI,{className:"text-center max-w-max text-main",size:"auto",children:[(0,i.jsx)(aF,{padding:"px-24 pt-24 pb-12",showDivider:!1,children:(0,i.jsx)(cS,{message:"Open a photo or design to get started"})}),(0,i.jsx)(lF,{children:(0,i.jsx)("default"===e?hF:pF,{setActivePanel:t})})]})}function hF({setActivePanel:e}){return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Wx,{className:"mr-20",size:"sm",variant:"raised",color:"primary",onClick:()=>{Yp().import.uploadAndReplaceMainImage()},children:(0,i.jsx)(cS,{message:"Open Photo"})}),(0,i.jsx)(Wx,{variant:"outline",size:"sm",color:"primary",onClick:()=>{e("newCanvas")},children:(0,i.jsx)(cS,{message:"Create New"})}),(0,i.jsx)(fF,{})]})}function fF(){const e=Gp(e=>{var t,n;return null==(n=null==(t=e.config.ui)?void 0:t.openImageDialog)?void 0:n.sampleImages});return null!=e&&e.length?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:"relative py-20 text-main",children:[(0,i.jsx)("hr",{className:"absolute h-1 border-none bg-divider w-full top inset-0 m-auto"}),(0,i.jsx)("span",{className:"text-sm bg px-6 relative",children:(0,i.jsx)(cS,{message:"or use sample"})})]}),(0,i.jsx)("ul",{className:"flex items-center gap-16",children:e.map(e=>(0,i.jsx)("li",{className:"shrink-0",children:(0,i.jsx)("button",{type:"button",onClick:async()=>{"function"==typeof e.action?e.action():e.url.endsWith(".json")?(await Zp(Lw(e.url)),qp().togglePanel("newImage",!1)):(await Yp().import.openBackgroundImage(Lw(e.url)),qp().togglePanel("newImage",!1))},children:(0,i.jsx)("img",{className:"w-80 h-80 rounded overflow-hidden transition-shadow hover:shadow-md",src:Lw(e.thumbnail),alt:""})})},e.url||e.thumbnail))})]}):null}function pF({setActivePanel:e}){const[t,n]=(0,o.useState)({width:800,height:600,bgColor:"transparent"});return(0,i.jsxs)("form",{onSubmit:e=>{e.preventDefault();const{width:n,height:r,bgColor:i}=t;n&&r&&(qp().setConfig({blankCanvasSize:{width:n,height:r}}),Yp().canvas.openNew(n,r,i),qp().togglePanel("newImage",!1),Yp().history.addInitial())},children:[(0,i.jsx)(WS,{type:"number",label:(0,i.jsx)(cS,{message:"Width"}),value:t.width,min:1,required:!0,className:"mb-16",onChange:e=>{n({...t,width:e.target.valueAsNumber})}}),(0,i.jsx)(WS,{type:"number",label:(0,i.jsx)(cS,{message:"Height"}),value:t.height,min:1,required:!0,className:"mb-16",onChange:e=>{n({...t,height:e.target.valueAsNumber})}}),(0,i.jsx)(BI,{onChange:e=>{n({...t,bgColor:e})},className:"mb-16",value:t.bgColor,label:(0,i.jsx)(cS,{message:"Background color"})}),(0,i.jsxs)("div",{className:"text-right",children:[(0,i.jsx)(Wx,{size:"sm",variant:"text",className:"mr-10",onClick:()=>{e("default")},children:(0,i.jsx)(cS,{message:"Cancel"})}),(0,i.jsx)(Wx,{size:"sm",type:"submit",variant:"raised",color:"primary",children:(0,i.jsx)(cS,{message:"Create"})})]})]})}const gF=(0,o.forwardRef)((e,t)=>{const n=MS(e),{label:r,children:a,size:s,className:l,orientation:c="horizontal",disabled:u,required:d,invalid:h,errorMessage:f,description:p}=e,g=(0,o.useId)(),m=e.name||g;return(0,i.jsxs)("fieldset",{"aria-describedby":p?`${g}-description`:void 0,ref:t,className:Pd("text-left",l),children:[r&&(0,i.jsx)("legend",{className:n.label,children:r}),(0,i.jsx)("div",{className:Pd("flex",r?"mt-6":"mt-0","vertical"===c?"flex-col gap-10":"flex-row gap-16"),children:o.Children.map(a,e=>{if((0,o.isValidElement)(e))return(0,o.cloneElement)(e,{name:m,size:s,invalid:e.props.invalid||h||void 0,disabled:e.props.disabled||u,required:e.props.required||d})})}),p&&!f&&(0,i.jsx)("div",{className:n.description,id:`${g}-description`,children:p}),f&&(0,i.jsx)("div",{className:n.error,children:f})]})}),mF=(0,o.forwardRef)((e,t)=>{const{children:n,autoFocus:r,size:o,invalid:a,isFirst:s,...l}=e,c=uw(t);VS({autoFocus:r},c);const u=function(e){switch(e){case"xs":return{circle:"h-12 w-12",label:"text-xs"};case"sm":return{circle:"h-16 w-16",label:"text-sm"};case"lg":return{circle:"h-24 w-24",label:"text-lg"};default:return{circle:"h-20 w-20",label:"text-base"}}}(o);return(0,i.jsxs)("label",{className:Pd("inline-flex gap-8 select-none items-center whitespace-nowrap align-middle",u.label,e.disabled&&"text-disabled pointer-events-none",e.invalid&&"text-danger"),children:[(0,i.jsx)("input",{type:"radio",className:Pd("focus-visible:ring outline-none","rounded-full transition-button border-2 appearance-none","border-text-muted disabled:border-disabled-fg checked:border-primary checked:hover:border-primary-dark","before:bg-primary disabled:before:bg-disabled-fg before:hover:bg-primary-dark","before:h-full before:w-full before:block before:rounded-full before:scale-10 before:opacity-0 before:transition before:duration-200","checked:before:scale-[.65] checked:before:opacity-100",u.circle),ref:c,...l}),n&&(0,i.jsx)("span",{children:n})]})});function vF(){const e=Gp(e=>e.openPanels.export);return(0,i.jsx)(zI,{isOpen:e,onOpenChange:e=>{e||qp().togglePanel("export",!1)},type:"modal",children:(0,i.jsx)(yF,{})})}function yF(){const[e,t]=(0,o.useState)(()=>{var e,t,n,r,i,o;return{filename:(null==(t=null==(e=qp().config.tools)?void 0:e.export)?void 0:t.defaultName)||"image",format:(null==(r=null==(n=qp().config.tools)?void 0:n.export)?void 0:r.defaultFormat)||"jpeg",quality:(null==(o=null==(i=qp().config.tools)?void 0:i.export)?void 0:o.defaultQuality)||.8}});return(0,i.jsx)(LI,{className:"text-center max-w-max text-main",size:"auto",children:(0,i.jsx)(lF,{children:(0,i.jsxs)("form",{onSubmit:t=>{t.preventDefault(),Yp().export.save(e.filename,e.format,e.quality),qp().togglePanel("export",!1)},children:[(0,i.jsx)(WS,{required:!0,size:"sm",label:(0,i.jsx)(cS,{message:"Save As"}),value:e.filename,onChange:n=>{t({...e,filename:n.target.value})}}),(0,i.jsxs)(gF,{size:"sm",className:"my-20","aria-label":"Image format",children:[(0,i.jsx)(mF,{value:"jpeg",checked:"jpeg"===e.format,onChange:n=>{t({...e,format:n.target.value})},children:"JPEG"}),(0,i.jsx)(mF,{value:"png",checked:"png"===e.format,onChange:n=>{t({...e,format:n.target.value})},children:"PNG"}),(0,i.jsx)(mF,{value:"json",checked:"json"===e.format,onChange:n=>{t({...e,format:n.target.value})},children:"JSON"})]}),(0,i.jsx)(ZI,{size:"sm",minValue:.1,step:.1,maxValue:1,value:e.quality,onChange:n=>{t({...e,quality:n})},formatOptions:{style:"percent"},label:(0,i.jsx)(cS,{message:"Quality"})}),(0,i.jsx)(Wx,{variant:"raised",color:"primary",type:"submit",className:"mt-20 w-full",size:"sm",children:(0,i.jsx)(cS,{message:"Save"})})]})})})}function bF(){const e=Gp(e=>e.objects.all),t=Gp(e=>e.objects.active.id);return(0,i.jsxs)(Pb.div,{...J_,className:"absolute bottom-20 right-20 w-224 max-w-[calc(100%-40px)] max-h-[calc(100%-40px)] bg-paper shadow-xl border focus:outline-none rounded overflow-hidden",children:[(0,i.jsxs)("div",{className:"px-10 py-2 mb-4 font-medium text-sm border-b flex items-center",children:[(0,i.jsx)(cS,{message:"Objects"}),(0,i.jsx)(YS,{size:"xs",className:"ml-auto flex-shrink-0",onClick:()=>{qp().togglePanel("objects",!1)},children:(0,i.jsx)(cA,{})})]}),(0,i.jsx)("div",{className:"p-8",children:e.map(e=>{const n=e.id===t,r=e.name;if(!r)return null;const a=Hf[r],s=a.icon&&o.createElement(a.icon,{className:"icon-sm"});return(0,i.jsx)(Wx,{onClick:()=>{n||!e.selectable||Yp().objects.select(e.id)},variant:"outline",color:n?"primary":null,size:"sm",className:Pd("w-full mb-8",(n||!e.selectable)&&"pointer-events-none"),justify:"justify-start",startIcon:s,children:(0,i.jsx)(cS,{...a.name})},e.id)})})]})}function wF(){const e=Gp(e=>e.openPanels.history),t=Gp(e=>e.openPanels.objects);return(0,i.jsxs)("div",{className:"z-modal",children:[(0,i.jsxs)(Ub,{children:[e&&(0,i.jsx)(oF,{},"historyPanel"),t&&(0,i.jsx)(bF,{},"objListPanel")]}),(0,i.jsx)(uF,{}),(0,i.jsx)(vF,{})]})}function xF(){return xF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xF.apply(this,arguments)}var CF,_F;function SF(e,t){if(!1===e||null===e||typeof e>"u")throw new Error(t)}function AF(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&"?"!==n&&(t+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(t+="#"===r.charAt(0)?r:"#"+r),t}function kF(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function EF(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)}),n.length>1?n.join("/"):"/"}function IF(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the `to."+n+'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.'}function jF(e,t){let n=function(e){return e.filter((e,t)=>0===t||e.route.path&&e.route.path.length>0)}(e);return t?n.map((t,n)=>n===e.length-1?t.pathname:t.pathnameBase):n.map(e=>e.pathnameBase)}function TF(e,t,n,r){let i;void 0===r&&(r=!1),"string"==typeof e?i=kF(e):(i=xF({},e),SF(!i.pathname||!i.pathname.includes("?"),IF("?","pathname","search",i)),SF(!i.pathname||!i.pathname.includes("#"),IF("#","pathname","hash",i)),SF(!i.search||!i.search.includes("#"),IF("#","search","hash",i)));let o,a=""===e||""===i.pathname,s=a?"/":i.pathname;if(null==s)o=n;else{let e=t.length-1;if(!r&&s.startsWith("..")){let t=s.split("/");for(;".."===t[0];)t.shift(),e-=1;i.pathname=t.join("/")}o=e>=0?t[e]:"/"}let l=function(e,t){void 0===t&&(t="/");let{pathname:n,search:r="",hash:i=""}="string"==typeof e?kF(e):e;return{pathname:n?n.startsWith("/")?n:EF(n,t):t,search:OF(r),hash:MF(i)}}(i,o),c=s&&"/"!==s&&s.endsWith("/"),u=(a||"."===s)&&n.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}!function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(CF||(CF={})),function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(_F||(_F={}));const FF=e=>e.join("/").replace(/\/\/+/g,"/"),OF=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",MF=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"",PF=["post","put","patch","delete"];new Set(PF);const RF=["get",...PF];function LF(){return LF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},LF.apply(this,arguments)}new Set(RF);const NF=o.createContext(null),DF=o.createContext(null),zF=o.createContext(null),BF=o.createContext({outlet:null,matches:[],isDataRoute:!1});function UF(){return null!=o.useContext(zF)}function VF(){return UF()||SF(!1),o.useContext(zF).location}function HF(e){o.useContext(DF).static||o.useLayoutEffect(e)}function WF(e,t){let{relative:n}=void 0===t?{}:t,{future:r}=o.useContext(DF),{matches:i}=o.useContext(BF),{pathname:a}=VF(),s=JSON.stringify(jF(i,r.v7_relativeSplatPath));return o.useMemo(()=>TF(e,JSON.parse(s),a,"path"===n),[e,s,a,n])}var $F=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}($F||{}),GF=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(GF||{});function qF(){return qF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qF.apply(this,arguments)}new Promise(()=>{});const YF=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"];try{window.__reactRouterVersion="6"}catch{}const XF=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",KF=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ZF=o.forwardRef(function(e,t){let n,{onClick:r,relative:i,reloadDocument:a,replace:s,state:l,target:c,to:u,preventScrollReset:d,unstable_viewTransition:h}=e,f=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&(i[n]=e[n]);return i}(e,YF),{basename:p}=o.useContext(DF),g=!1;if("string"==typeof u&&KF.test(u)&&(n=u,XF))try{let e=new URL(window.location.href),t=u.startsWith("//")?new URL(e.protocol+u):new URL(u),n=function(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&"/"!==r?null:e.slice(n)||"/"}(t.pathname,p);t.origin===e.origin&&null!=n?u=n+t.search+t.hash:g=!0}catch{}let m=function(e,t){let{relative:n}=void 0===t?{}:t;UF()||SF(!1);let{basename:r,navigator:i}=o.useContext(DF),{hash:a,pathname:s,search:l}=WF(e,{relative:n}),c=s;return"/"!==r&&(c="/"===s?r:FF([r,s])),i.createHref({pathname:c,search:l,hash:a})}(u,{relative:i}),v=function(e,t){let{target:n,replace:r,state:i,preventScrollReset:a,relative:s,unstable_viewTransition:l}=void 0===t?{}:t,c=function(){let{isDataRoute:e}=o.useContext(BF);return e?function(){let{router:e}=function(){let e=o.useContext(NF);return e||SF(!1),e}($F.UseNavigateStable),t=function(){let e=function(){let e=o.useContext(BF);return e||SF(!1),e}(),t=e.matches[e.matches.length-1];return t.route.id||SF(!1),t.route.id}(GF.UseNavigateStable),n=o.useRef(!1);return HF(()=>{n.current=!0}),o.useCallback(function(r,i){void 0===i&&(i={}),n.current&&("number"==typeof r?e.navigate(r):e.navigate(r,LF({fromRouteId:t},i)))},[e,t])}():function(){UF()||SF(!1);let e=o.useContext(NF),{basename:t,future:n,navigator:r}=o.useContext(DF),{matches:i}=o.useContext(BF),{pathname:a}=VF(),s=JSON.stringify(jF(i,n.v7_relativeSplatPath)),l=o.useRef(!1);return HF(()=>{l.current=!0}),o.useCallback(function(n,i){if(void 0===i&&(i={}),!l.current)return;if("number"==typeof n)return void r.go(n);let o=TF(n,JSON.parse(s),a,"path"===i.relative);null==e&&"/"!==t&&(o.pathname="/"===o.pathname?t:FF([t,o.pathname])),(i.replace?r.replace:r.push)(o,i.state,i)},[t,r,s,a,e])}()}(),u=VF(),d=WF(e,{relative:s});return o.useCallback(t=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(t,n)){t.preventDefault();let n=void 0!==r?r:AF(u)===AF(d);c(e,{replace:n,state:i,preventScrollReset:a,relative:s,unstable_viewTransition:l})}},[u,c,d,r,i,n,e,a,s,l])}(u,{replace:s,state:l,target:c,preventScrollReset:d,relative:i,unstable_viewTransition:h});return o.createElement("a",qF({},f,{href:n||m,onClick:g||a?r:function(e){r&&r(e),e.defaultPrevented||v(e)},ref:t,target:c}))});var JF,QF;!function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"}(JF||(JF={})),function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(QF||(QF={}));const eO=Nd((0,i.jsx)("path",{d:"M11 15h2v2h-2v-2zm0-8h2v6h-2V7zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"ErrorOutlineOutlined"),tO=Nd((0,i.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm4.59-12.42L10 14.17l-2.59-2.58L6 13l4 4 8-8z"}),"CheckCircleOutlined"),nO={opacity:0,y:50,scale:.3},rO={opacity:1,y:0,scale:1},iO={opacity:0,scale:.5};function oO(){const e=ig(e=>e.toasts);return(0,i.jsx)("div",{className:"pointer-events-none relative",children:(0,i.jsx)(Ub,{initial:!1,children:e.map(e=>(0,i.jsx)("div",{className:Pd("fixed z-toast mx-auto p-20","bottom-center"===e.position?"bottom-0 left-0 right-0":"bottom-0 right-0"),children:(0,i.jsxs)(Pb.div,{initial:e.disableEnterAnimation?void 0:nO,animate:e.disableEnterAnimation?void 0:rO,exit:e.disableExitAnimation?void 0:iO,className:Pd("pointer-events-auto mx-auto flex max-h-100 min-h-50 w-min min-w-288 max-w-500 items-center gap-10 rounded-lg border bg-paper bg-paper py-6 pl-16 pr-6 text-sm text-main shadow-lg"),onPointerEnter:()=>{var t;return null==(t=e.timer)?void 0:t.pause()},onPointerLeave:()=>{var t;return null==(t=e.timer)?void 0:t.resume()},role:"alert","aria-live":"danger"===e.type?"assertive":"polite",children:["danger"===e.type&&(0,i.jsx)(eO,{className:"flex-shrink-0 text-danger",size:"md"}),"loading"===e.type&&(0,i.jsx)(JI,{size:"sm",className:"flex-shrink-0",isIndeterminate:!0}),"positive"===e.type&&(0,i.jsx)(tO,{className:"flex-shrink-0 text-positive",size:"md"}),(0,i.jsx)("div",{className:"mr-auto w-max overflow-hidden overflow-ellipsis","data-testid":"toast-message",children:(0,i.jsx)(KS,{value:e.message})}),e.action&&(0,i.jsx)(Wx,{variant:"text",color:"primary",size:"sm",className:"flex-shrink-0",onFocus:()=>{var t;return null==(t=e.timer)?void 0:t.pause()},onBlur:()=>{var t;return null==(t=e.timer)?void 0:t.resume()},onClick:()=>og().remove(e.id),elementType:ZF,to:e.action.action,children:(0,i.jsx)(KS,{value:e.action.label})}),"loading"!==e.type&&(0,i.jsx)(YS,{onFocus:()=>{var t;return null==(t=e.timer)?void 0:t.pause()},onBlur:()=>{var t;return null==(t=e.timer)?void 0:t.resume()},type:"button",className:"flex-shrink-0",onClick:()=>{og().remove(e.id)},size:"sm",children:(0,i.jsx)(cA,{})})]})},e.id))})})}function aO(e){return ow()?e.metaKey:e.ctrlKey}function sO(e){switch(e.key){case"z":aO(e)&&(e.preventDefault(),e.stopPropagation(),e.shiftKey?Yp().history.redo():Yp().history.undo());break;case"ArrowUp":e.preventDefault(),e.stopPropagation(),Yp().objects.move("up");break;case"ArrowRight":e.preventDefault(),e.stopPropagation(),Yp().objects.move("right");break;case"ArrowDown":e.preventDefault(),e.stopPropagation(),Yp().objects.move("down");break;case"ArrowLeft":e.preventDefault(),e.stopPropagation(),Yp().objects.move("left");break;case"Delete":e.preventDefault(),e.stopPropagation(),Yp().objects.delete();break;case"v":aO(e)&&(e.preventDefault(),e.stopPropagation(),async function(){try{const e=await navigator.clipboard.read();for(const t of e)for(const e of t.types)if(e.startsWith("image/")){const n=await t.getType(e),r=new FileReader;return r.onload=e=>{var t;null!=(t=e.target)&&t.result&&Yp().import.addImageFromData(e.target.result)},void r.readAsDataURL(n)}}catch(e){}}())}}const lO=new Map,cO=new Map,uO={};async function*dO(e){const t=e.createReader();let n;do{n=await new Promise((e,n)=>{t.readEntries(e,n)});for(const e of n)if(e.isFile){if(".DS_Store"===e.name)continue;const t=await hO(e);yield new wx(t,e.fullPath)}else e.isDirectory&&(yield*dO(e))}while(n.length>0)}function hO(e){return new Promise((t,n)=>e.file(t,n))}function fO(e){return null!=uO.dragTargetId?lO.get(uO.dragTargetId):e.dataTransfer.types.includes("Files")?{type:"nativeFile",el:null,ref:null,getData:()=>async function(e){const t=[];for await(const n of e)t.push(n);return t}(async function*(e){const t=[];for(const n of e.items)if("file"===n.kind){const e=n.webkitGetAsEntry();e&&t.push(e)}for(const n of t)if(n.isFile){if(".DS_Store"===n.name)continue;const e=await hO(n);yield new wx(e,n.fullPath)}else n.isDirectory&&(yield*dO(n))}(e.dataTransfer))}:void 0}function pO(){const e=Gp(e=>{var t;return null==(t=e.config.ui)?void 0:t.visible})??!0,t=Gp(e=>{var t,n;return null==(n=null==(t=e.config.ui)?void 0:t.nav)?void 0:n.position})??"bottom",n=Gp(e=>{var t,n;return null==(n=null==(t=e.config.ui)?void 0:t.menubar)?void 0:n.position})??"top",r=Gp(e=>{var t;return null==(t=e.config.ui)?void 0:t.allowEditorClose})??!0,a=(0,o.useRef)(null),s=(0,o.useRef)(null),{isModal:l,isMobile:c}=uA(),u=(0,o.useCallback)(async e=>{var t,n;if(qp().activeTool||qp().dirty||"nativeFile"!==e.type)return;const r=await e.getData();Yp().import.fileIsValid(r[0])&&((null==(n=null==(t=qp().config.tools)?void 0:t.import)?void 0:n.openDroppedImageAsBackground)?await Yp().import.openBackgroundImage(r[0]):await Yp().import.openUploadedFile(r[0]))},[]),{droppableProps:d}=function({id:e,disabled:t,ref:n,...r}){const i=(0,o.useRef)({dragOverElements:new Set,dropActivateTimer:void 0}).current,a=(0,o.useRef)(r);a.current=r,(0,o.useLayoutEffect)(()=>(cO.set(e,{...cO.get(e),disabled:t,id:e,ref:n}),()=>{cO.delete(e)}),[e,a,t,n]);const s=e=>{var t;const r=a.current,i=r.allowDragEventsFromItself||n.current!==(null==(t=e.ref)?void 0:t.current);return!(!(null!=e&&e.type&&i&&r.types.includes(e.type))||r.acceptsDrop&&!r.acceptsDrop(e))},l=e=>{var t,n;const r=fO(e);r&&(null==(n=(t=a.current).onDragLeave)||n.call(t,r))};return{droppableProps:t?{}:{onDragOver:e=>{var t,n;e.preventDefault(),e.stopPropagation();const r=fO(e);r&&s(r)&&(null==(n=(t=a.current).onDragOver)||n.call(t,r,e))},onDragEnter:e=>{var t,n;if(e.stopPropagation(),i.dragOverElements.add(e.target),i.dragOverElements.size>1)return;const r=fO(e);r&&s(r)&&(null==(n=(t=a.current).onDragEnter)||n.call(t,r),clearTimeout(i.dropActivateTimer),"function"==typeof a.current.onDropActivate&&(i.dropActivateTimer=setTimeout(()=>{var e,t;r&&(null==(t=(e=a.current).onDropActivate)||t.call(e,r))},400)))},onDragLeave:e=>{e.stopPropagation(),i.dragOverElements.delete(e.target);for(const n of i.dragOverElements)e.currentTarget.contains(n)||i.dragOverElements.delete(n);if(i.dragOverElements.size>0)return;const t=fO(e);t&&s(t)&&(l(e),clearTimeout(i.dropActivateTimer))},onDrop:async e=>{var t,n,r,o;e.preventDefault(),e.stopPropagation(),i.dragOverElements.clear(),l(e),clearTimeout(i.dropActivateTimer);const c=fO(e);c&&(null==(n=(t=a.current).onDragLeave)||n.call(t,c),s(c)&&(null==(o=(r=a.current).onDrop)||o.call(r,c)))}}}}({id:"pixie-root",ref:s,types:["nativeFile"],onDrop:u});(0,o.useEffect)(()=>{var e,t;qp().fabric||(Gp.setState({canvasRef:a}),function(e){const t=function(e){var t;const n=new vw.fabric.Canvas(e,{width:1,height:1});n.preserveObjectStacking=!0,n.selection=!1,n.renderOnAddRemove=!1;const r=qp().config.textureSize;r&&(vw.fabric.textureSize=r);const i={...null==(t=qp().config.objectDefaults)?void 0:t.global,...bw};Object.keys(i).forEach(e=>{vw.fabric.Object.prototype[e]=i[e]}),n.on("object:added",e=>{var t,n;e.target&&(null==(n=null==(t=e.target)?void 0:t.data)||!n.id)&&(e.target.data||(e.target.data={}),e.target.data.id=ww(10))});const o=vw.fabric.Object.prototype.controls;return Object.keys(o).forEach(e=>{delete o[e]}),n}(e);qp().editor.fabric=t,Gp.setState({fabric:t}),qp().editor.tools={canvas:new kw,objects:new Ow,zoom:new _w,history:new Uw,filter:new qw,resize:new ex,crop:new rx,merge:new Vw,shape:new ix,frame:new cx,text:new ux,draw:new vx,transform:new Rx,import:new Ix,watermark:new Tx,export:new Mx,corners:new Px}}(a.current),null!=(e=qp().config.ui)&&e.defaultTool&&qp().setActiveTool(null==(t=qp().config.ui)?void 0:t.defaultTool,null),Yp().canvas.loadInitialContent().then(()=>{var e,t;null==(t=(e=qp().config).onLoad)||t.call(e,qp().editor)}));const n=Lx(s,()=>{qp().setStageSize(Nx(s.current))}),r=Lx(a,()=>{qp().setCanvasSize(Nx(a.current))});return()=>{n(),r()}},[s]);const h=Pd("pixie-root flex flex-col overflow-hidden bg-background text-main no-tap-highlight w-full h-full",{relative:!l,"fixed inset-0 w-full h-full z-20":l,"shadow-lg border rounded-md m-auto max-h-[calc(100vh-90px)] max-w-[calc(100vw-90px)]":l&&!c});return(0,i.jsxs)(Vb,{features:Wb,strict:!0,children:[l&&e&&!c&&r&&(0,i.jsx)(YS,{className:"z-20 fixed right-2 top-2 text-white",size:"lg",onClick:()=>{qp().editor.close()},children:(0,i.jsx)(cA,{})}),l&&e&&(0,i.jsx)(nS,{position:"fixed",disableInitialTransition:!0}),(0,i.jsxs)(Pb.div,{initial:!1,variants:{visible:{opacity:1,scale:1,display:"flex"},hidden:{opacity:0,transitionEnd:{display:"none"}}},animate:e?"visible":"hidden",className:h,children:["top"===n&&(0,i.jsx)(vA,{}),"top"===t&&(0,i.jsx)(nF,{className:"pt-14"}),(0,i.jsxs)("main",{className:"relative flex-auto my-20 overflow-hidden outline-none",tabIndex:-1,...nw(d,{onKeyDownCapture:sO}),ref:s,children:[(0,i.jsx)(bA,{}),(0,i.jsx)(Gk,{ref:a})]}),(0,i.jsx)(Gj,{}),"bottom"===t&&(0,i.jsx)(nF,{}),"bottom"===n&&(0,i.jsx)(vA,{}),(0,i.jsx)(wF,{}),(0,i.jsx)(oO,{})]})]})}!function(){fabric.Object.ENLIVEN_PROPS.push("eraser");var e=fabric.Object.prototype._drawClipPath,t=fabric.Object.prototype.needsItsOwnCache,n=fabric.Object.prototype.toObject,r=fabric.Object.prototype.getSvgCommons,i=fabric.Object.prototype._createBaseClipPathSVGMarkup,o=fabric.Object.prototype._createBaseSVGMarkup;fabric.Object.prototype.cacheProperties.push("eraser"),fabric.Object.prototype.stateProperties.push("eraser"),fabric.util.object.extend(fabric.Object.prototype,{erasable:!0,eraser:void 0,needsItsOwnCache:function(){return t.call(this)||!!this.eraser},_drawClipPath:function(t,n){if(e.call(this,t,n),this.eraser){var r=this._getNonTransformedDimensions();this.eraser.isType("eraser")&&this.eraser.set({width:r.x,height:r.y}),e.call(this,t,this.eraser)}},toObject:function(e){var t=n.call(this,["erasable"].concat(e));return this.eraser&&!this.eraser.excludeFromExport&&(t.eraser=this.eraser.toObject(e)),t},getSvgCommons:function(){return r.call(this)+(this.eraser?'mask="url(#'+this.eraser.clipPathId+')" ':"")},_createEraserSVGMarkup:function(e){return this.eraser?(this.eraser.clipPathId="MASK_"+fabric.Object.__uid++,['<mask id="',this.eraser.clipPathId,'" >',this.eraser.toSVG(e),"</mask>","\n"].join("")):""},_createBaseClipPathSVGMarkup:function(e,t){return[this._createEraserSVGMarkup(t&&t.reviver),i.call(this,e,t)].join("")},_createBaseSVGMarkup:function(e,t){return[this._createEraserSVGMarkup(t&&t.reviver),o.call(this,e,t)].join("")}});var a=fabric.Group.prototype._restoreObjectsState;fabric.util.object.extend(fabric.Group.prototype,{_addEraserPathToObjects:function(e){this._objects.forEach(function(t){fabric.EraserBrush.prototype._addPathToObjectEraser.call(fabric.EraserBrush.prototype,t,e)})},applyEraserToObjects:function(){var e=this,t=this.eraser;if(t){delete this.eraser;var n=e.calcTransformMatrix();t.clone(function(t){var r=e.clipPath;t.getObjects("path").forEach(function(t){var i=fabric.util.multiplyTransformMatrices(n,t.calcTransformMatrix());fabric.util.applyTransformToObject(t,i),r?r.clone(function(r){var i=fabric.EraserBrush.prototype.applyClipPathToPath.call(fabric.EraserBrush.prototype,t,r,n);e._addEraserPathToObjects(i)},["absolutePositioned","inverted"]):e._addEraserPathToObjects(t)})})}},_restoreObjectsState:function(){return!0===this.erasable&&this.applyEraserToObjects(),a.call(this)}}),fabric.Eraser=fabric.util.createClass(fabric.Group,{type:"eraser",originX:"center",originY:"center",drawObject:function(e){e.save(),e.fillStyle="black",e.fillRect(-this.width/2,-this.height/2,this.width,this.height),e.restore(),this.callSuper("drawObject",e)},_getBounds:function(){},_toSVG:function(e){var t=["<g ","COMMON_PARTS"," >\n"],n=["<rect ",'fill="white" ','x="',-this.width/2,'" y="',-this.height/2,'" width="',this.width,'" height="',this.height,'" />\n'].join("");t.push("\t\t",n);for(var r=0,i=this._objects.length;r<i;r++)t.push("\t\t",this._objects[r].toSVG(e));return t.push("</g>\n"),t}}),fabric.Eraser.fromObject=function(e,t){var n=e.objects;fabric.util.enlivenObjects(n,function(n){var r=fabric.util.object.clone(e,!0);delete r.objects,fabric.util.enlivenObjectEnlivables(e,r,function(){t&&t(new fabric.Eraser(n,r,!0))})})};var s=fabric.Canvas.prototype._renderOverlay;fabric.util.object.extend(fabric.Canvas.prototype,{isErasing:function(){return this.isDrawingMode&&this.freeDrawingBrush&&"eraser"===this.freeDrawingBrush.type&&this.freeDrawingBrush._isErasing},_renderOverlay:function(e){s.call(this,e),this.isErasing()&&!this.freeDrawingBrush.inverted&&this.freeDrawingBrush._render()}}),fabric.EraserBrush=fabric.util.createClass(fabric.PencilBrush,{type:"eraser",inverted:!1,_isErasing:!1,_isErasable:function(e){return!1!==e.erasable},_prepareCollectionTraversal:function(e,t,n){e.forEachObject(function(r){r.forEachObject&&"deep"===r.erasable?this._prepareCollectionTraversal(r,t,n):!this.inverted&&r.erasable&&r.visible?(r.visible=!1,e.dirty=!0,n.visibility.push(r),n.collection.push(e)):this.inverted&&r.visible&&(r.erasable&&r.eraser?(r.eraser.inverted=!0,r.dirty=!0,e.dirty=!0,n.eraser.push(r),n.collection.push(e)):(r.visible=!1,e.dirty=!0,n.visibility.push(r),n.collection.push(e)))},this)},preparePattern:function(){this._patternCanvas||(this._patternCanvas=fabric.util.createCanvasElement());var e=this._patternCanvas;e.width=this.canvas.width,e.height=this.canvas.height;var t=e.getContext("2d");if(this.canvas._isRetinaScaling()){var n=this.canvas.getRetinaScaling();this.canvas.__initRetinaScaling(n,e,t)}var r=this.canvas.backgroundImage,i=r&&this._isErasable(r),o=this.canvas.overlayImage,a=o&&this._isErasable(o);if(!this.inverted&&(r&&!i||this.canvas.backgroundColor))i&&(this.canvas.backgroundImage=void 0),this.canvas._renderBackground(t),i&&(this.canvas.backgroundImage=r);else if(this.inverted&&r&&i){var l=this.canvas.backgroundColor;this.canvas.backgroundColor=void 0,this.canvas._renderBackground(t),this.canvas.backgroundColor=l}t.save(),t.transform.apply(t,this.canvas.viewportTransform);var c={visibility:[],eraser:[],collection:[]};this._prepareCollectionTraversal(this.canvas,t,c),this.canvas._renderObjects(t,this.canvas._objects),c.visibility.forEach(function(e){e.visible=!0}),c.eraser.forEach(function(e){e.eraser.inverted=!1,e.dirty=!0}),c.collection.forEach(function(e){e.dirty=!0}),t.restore(),!this.inverted&&(o&&!a||this.canvas.overlayColor)?(a&&(this.canvas.overlayImage=void 0),s.call(this.canvas,t),a&&(this.canvas.overlayImage=o)):this.inverted&&o&&a&&(l=this.canvas.overlayColor,this.canvas.overlayColor=void 0,s.call(this.canvas,t),this.canvas.overlayColor=l)},_setBrushStyles:function(e){this.callSuper("_setBrushStyles",e),e.strokeStyle="black"},_saveAndTransform:function(e){this.callSuper("_saveAndTransform",e),this._setBrushStyles(e),e.globalCompositeOperation=e===this.canvas.getContext()?"destination-out":"source-over"},needsFullRender:function(){return!0},onMouseDown:function(e,t){this.canvas._isMainEvent(t.e)&&(this._prepareForDrawing(e),this._captureDrawingPath(e),this.preparePattern(),this._isErasing=!0,this.canvas.fire("erasing:start"),this._render())},_render:function(){var e;this.inverted||(e=this.canvas.getContext(),this.callSuper("_render",e)),e=this.canvas.contextTop,this.canvas.clearContext(e),this.callSuper("_render",e),e.save();var t=1/this.canvas.getRetinaScaling();e.scale(t,t),e.globalCompositeOperation="source-in",e.drawImage(this._patternCanvas,0,0),e.restore()},createPath:function(e){var t=this.callSuper("createPath",e);return t.globalCompositeOperation=this.inverted?"source-over":"destination-out",t.stroke=this.inverted?"white":"black",t},applyClipPathToPath:function(e,t,n){var r=fabric.util.invertTransform(e.calcTransformMatrix()),i=t.calcTransformMatrix(),o=t.absolutePositioned?r:fabric.util.multiplyTransformMatrices(r,n);return t.absolutePositioned=!1,fabric.util.applyTransformToObject(t,fabric.util.multiplyTransformMatrices(o,i)),e.clipPath=e.clipPath?fabric.util.mergeClipPaths(t,e.clipPath):t,e},clonePathWithClipPath:function(e,t,n){var r=t.calcTransformMatrix(),i=t.clipPath,o=this;e.clone(function(e){i.clone(function(t){n(o.applyClipPathToPath(e,t,r))},["absolutePositioned","inverted"])})},_addPathToObjectEraser:function(e,t){var n=this;if(e.forEachObject&&"deep"===e.erasable){var r=e._objects.filter(function(e){return e.erasable});r.length>0&&e.clipPath?this.clonePathWithClipPath(t,e,function(e){r.forEach(function(t){n._addPathToObjectEraser(t,e)})}):r.length>0&&r.forEach(function(e){n._addPathToObjectEraser(e,t)})}else{var i=e.eraser;i||(i=new fabric.Eraser,e.eraser=i),t.clone(function(t){var r=fabric.util.multiplyTransformMatrices(fabric.util.invertTransform(e.calcTransformMatrix()),t.calcTransformMatrix());fabric.util.applyTransformToObject(t,r),i.addWithUpdate(t),e.set("dirty",!0),e.fire("erasing:end",{path:t}),e.group&&Array.isArray(n.__subTargets)&&n.__subTargets.push(e)})}},applyEraserToCanvas:function(e){var t=this.canvas,n={};return["backgroundImage","overlayImage"].forEach(function(r){var i=t[r];i&&i.erasable&&(this._addPathToObjectEraser(i,e),n[r]=i)},this),n},_finalizeAndAddPath:function(){var e=this.canvas.contextTop,t=this.canvas;e.closePath(),this.decimate&&(this._points=this.decimatePoints(this._points,this.decimate)),t.clearContext(t.contextTop),this._isErasing=!1;var n=this._points&&this._points.length>1?this.convertPointsToSVGPath(this._points):null;if(!n||this._isEmptySVGPath(n))return t.fire("erasing:end"),void t.requestRenderAll();var r=this.createPath(n);r.setCoords(),t.fire("before:path:created",{path:r});var i=this.applyEraserToCanvas(r),o=this;this.__subTargets=[];var a=[];t.forEachObject(function(e){e.erasable&&e.intersectsWithObject(r,!0,!0)&&(o._addPathToObjectEraser(e,r),a.push(e))}),t.fire("erasing:end",{path:r,targets:a,subTargets:this.__subTargets,drawables:i}),delete this.__subTargets,t.requestRenderAll(),this._resetShadow(),t.fire("path:created",{path:r})}})}(),ps(!1);const gO=class e{constructor(e){if(is(this,"tools",{}),is(this,"fabric",null),e.sentryDsn&&function(e){const t={...e};du(t,"react"),xd(t)}({dsn:e.sentryDsn}),function(e,t){void 0===t&&(t={});var n=t.insertAt;if(!(typeof document>"u")){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}('/*! tailwindcss v3.3.2 | MIT License | https://tailwindcss.com*/.pi *,.pi :after,.pi :before{border-color:rgb(var(--be-foreground-base)/var(--be-divider-opacity));border-style:solid;border-width:0;box-sizing:border-box}.pi :after,.pi :before{--tw-content:""}.pi hr{border-top-width:1px;color:inherit;height:0}.pi abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.pi h1,.pi h2,.pi h3,.pi h4,.pi h5,.pi h6{font-size:inherit;font-weight:inherit}.pi a{color:inherit;text-decoration:inherit}.pi b,.pi strong{font-weight:bolder}.pi code,.pi kbd,.pi pre,.pi samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}.pi small{font-size:80%}.pi sub,.pi sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}.pi sub{bottom:-.25em}.pi sup{top:-.5em}.pi table{border-collapse:collapse;border-color:inherit;text-indent:0}.pi button,.pi input,.pi optgroup,.pi select,.pi textarea{color:inherit;font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;margin:0;padding:0}.pi button,.pi select{text-transform:none}.pi [type=button],.pi [type=reset],.pi [type=submit],.pi button{-webkit-appearance:button;background-color:transparent;background-image:none}.pi :-moz-focusring{outline:auto}.pi :-moz-ui-invalid{box-shadow:none}.pi progress{vertical-align:baseline}.pi ::-webkit-inner-spin-button,.pi ::-webkit-outer-spin-button{height:auto}.pi [type=search]{-webkit-appearance:textfield;outline-offset:-2px}.pi ::-webkit-search-decoration{-webkit-appearance:none}.pi ::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}.pi summary{display:list-item}.pi blockquote,.pi dd,.pi dl,.pi figure,.pi h1,.pi h2,.pi h3,.pi h4,.pi h5,.pi h6,.pi hr,.pi p,.pi pre{margin:0}.pi fieldset{margin:0;padding:0}.pi legend{padding:0}.pi menu,.pi ol,.pi ul{list-style:none;margin:0;padding:0}.pi textarea{resize:vertical}.pi input::-moz-placeholder,.pi textarea::-moz-placeholder{color:#9ca3af;opacity:1}.pi input::placeholder,.pi textarea::placeholder{color:#9ca3af;opacity:1}.pi [role=button],.pi button{cursor:pointer}.pi :disabled{cursor:default}.pi audio,.pi canvas,.pi embed,.pi iframe,.pi img,.pi object,.pi svg,.pi video{display:block;vertical-align:middle}.pi img,.pi video{height:auto;max-width:100%}.pi [hidden]{display:none}.pi *,.pi :after,.pi :before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(147,197,253,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.pi ::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(147,197,253,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.pi .\\!container{width:100%!important}.pi .container{width:100%}@media (min-width:640px){.pi .\\!container{max-width:640px!important}.pi .container{max-width:640px}}@media (min-width:768px){.pi .\\!container{max-width:768px!important}.pi .container{max-width:768px}}@media (min-width:1024px){.pi .\\!container{max-width:1024px!important}.pi .container{max-width:1024px}}@media (min-width:1280px){.pi .\\!container{max-width:1280px!important}.pi .container{max-width:1280px}}@media (min-width:1536px){.pi .\\!container{max-width:1536px!important}.pi .container{max-width:1536px}}.pi .sr-only{height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;clip:rect(0,0,0,0);border-width:0;white-space:nowrap}.pi .pointer-events-none{pointer-events:none}.pi .pointer-events-auto{pointer-events:auto}.pi .\\!visible{visibility:visible!important}.pi .visible{visibility:visible}.pi .invisible{visibility:hidden}.pi .collapse{visibility:collapse}.pi .static{position:static}.pi .fixed{position:fixed}.pi .absolute{position:absolute}.pi .relative{position:relative}.pi .inset-0{top:0;right:0;bottom:0;left:0}.pi .inset-x-0{left:0;right:0}.pi .-bottom-10{bottom:-10px}.pi .-bottom-20{bottom:-20px}.pi .-bottom-5{bottom:-5px}.pi .-left-5{left:-5px}.pi .-left-8{left:-8px}.pi .-left-80{left:-80px}.pi .-right-5{right:-5px}.pi .-top-144{top:-144px}.pi .-top-40{top:-40px}.pi .-top-5{top:-5px}.pi .bottom-0{bottom:0}.pi .bottom-20{bottom:20px}.pi .left-0{left:0}.pi .left-1\\/2{left:50%}.pi .left-20{left:20px}.pi .right-0{right:0}.pi .right-16{right:16px}.pi .right-2{right:2px}.pi .right-20{right:20px}.pi .right-4{right:4px}.pi .top-0{top:0}.pi .top-1\\/2{top:50%}.pi .top-2{top:2px}.pi .isolate{isolation:isolate}.pi .z-10{z-index:10}.pi .z-20{z-index:20}.pi .z-50{z-index:50}.pi .z-cropzone{z-index:10}.pi .z-loading-indicator{z-index:50}.pi .z-modal{z-index:110}.pi .z-navbar{z-index:40}.pi .z-obj-box{z-index:20}.pi .z-popover{z-index:130}.pi .z-toast{z-index:160}.pi .z-tool-overlay{z-index:30}.pi .z-tooltip{z-index:150}.pi .z-tray{z-index:120}.pi .m-auto{margin:auto}.pi .mx-20{margin-left:20px;margin-right:20px}.pi .mx-8{margin-left:8px;margin-right:8px}.pi .mx-auto{margin-left:auto;margin-right:auto}.pi .my-20{margin-bottom:20px;margin-top:20px}.pi .my-4{margin-bottom:4px;margin-top:4px}.pi .my-6{margin-bottom:6px;margin-top:6px}.pi .my-8{margin-bottom:8px;margin-top:8px}.pi .my-auto{margin-bottom:auto;margin-top:auto}.pi .-ml-1{margin-left:-1px}.pi .-ml-10{margin-left:-10px}.pi .-ml-12{margin-left:-12px}.pi .-ml-3{margin-left:-3px}.pi .-ml-4{margin-left:-4px}.pi .-ml-6{margin-left:-6px}.pi .-mr-4{margin-right:-4px}.pi .-mr-8{margin-right:-8px}.pi .mb-1{margin-bottom:1px}.pi .mb-10{margin-bottom:10px}.pi .mb-16{margin-bottom:16px}.pi .mb-2{margin-bottom:2px}.pi .mb-20{margin-bottom:20px}.pi .mb-24{margin-bottom:24px}.pi .mb-4{margin-bottom:4px}.pi .mb-6{margin-bottom:6px}.pi .mb-8{margin-bottom:8px}.pi .ml-10{margin-left:10px}.pi .ml-12{margin-left:12px}.pi .ml-4{margin-left:4px}.pi .ml-6{margin-left:6px}.pi .ml-8{margin-left:8px}.pi .ml-auto{margin-left:auto}.pi .mr-10{margin-right:10px}.pi .mr-16{margin-right:16px}.pi .mr-20{margin-right:20px}.pi .mr-4{margin-right:4px}.pi .mr-5{margin-right:5px}.pi .mr-6{margin-right:6px}.pi .mr-8{margin-right:8px}.pi .mr-auto{margin-right:auto}.pi .mt-0{margin-top:0}.pi .mt-10{margin-top:10px}.pi .mt-14{margin-top:14px}.pi .mt-20{margin-top:20px}.pi .mt-24{margin-top:24px}.pi .mt-4{margin-top:4px}.pi .mt-6{margin-top:6px}.pi .box-content{box-sizing:content-box}.pi .block{display:block}.pi .inline-block{display:inline-block}.pi .inline{display:inline}.pi .flex{display:flex}.pi .inline-flex{display:inline-flex}.pi .grid{display:grid}.pi .contents{display:contents}.pi .hidden{display:none}.pi .aspect-square{aspect-ratio:1/1}.pi .h-1{height:1px}.pi .h-12{height:12px}.pi .h-128{height:128px}.pi .h-14{height:14px}.pi .h-16{height:16px}.pi .h-18{height:18px}.pi .h-2{height:2px}.pi .h-2\\/4{height:50%}.pi .h-20{height:20px}.pi .h-22{height:22px}.pi .h-24{height:24px}.pi .h-26{height:26px}.pi .h-28{height:28px}.pi .h-3{height:3px}.pi .h-30{height:30px}.pi .h-32{height:32px}.pi .h-36{height:36px}.pi .h-38{height:2.375rem}.pi .h-4{height:4px}.pi .h-40{height:40px}.pi .h-42{height:42px}.pi .h-48{height:48px}.pi .h-50{height:50px}.pi .h-56{height:56px}.pi .h-6{height:6px}.pi .h-60{height:60px}.pi .h-64{height:64px}.pi .h-68{height:68px}.pi .h-8{height:8px}.pi .h-80{height:80px}.pi .h-84{height:84px}.pi .h-92{height:92px}.pi .h-\\[54px\\]{height:54px}.pi .h-font{height:1em}.pi .h-full{height:100%}.pi .h-px{height:1px}.pi .h-screen{height:100dvh}.pi .max-h-100{max-height:6.25rem}.pi .max-h-\\[calc\\(100\\%-40px\\)\\]{max-height:calc(100% - 40px)}.pi .max-h-\\[calc\\(100vh-90px\\)\\]{max-height:calc(100vh - 90px)}.pi .max-h-dialog{max-height:calc(var(--be-viewport-height, 100vh)*.9)}.pi .max-h-full{max-height:100%}.pi .max-h-inherit{max-height:inherit}.pi .max-h-tray{max-height:calc(var(--be-viewport-height, 100vh)*.9)}.pi .min-h-24{min-height:24px}.pi .min-h-30{min-height:30px}.pi .min-h-36{min-height:36px}.pi .min-h-42{min-height:42px}.pi .min-h-50{min-height:50px}.pi .min-h-60{min-height:60px}.pi .min-h-86{min-height:86px}.pi .\\!w-auto{width:auto!important}.pi .w-1\\/2{width:50%}.pi .w-110{width:110px}.pi .w-12{width:12px}.pi .w-1280{width:80rem}.pi .w-14{width:14px}.pi .w-144{width:144px}.pi .w-16{width:16px}.pi .w-18{width:18px}.pi .w-2{width:2px}.pi .w-20{width:20px}.pi .w-22{width:22px}.pi .w-224{width:224px}.pi .w-24{width:24px}.pi .w-256{width:256px}.pi .w-26{width:26px}.pi .w-28{width:28px}.pi .w-280{width:17.5rem}.pi .w-30{width:30px}.pi .w-32{width:32px}.pi .w-320{width:320px}.pi .w-36{width:36px}.pi .w-38{width:2.375rem}.pi .w-384{width:384px}.pi .w-40{width:40px}.pi .w-42{width:42px}.pi .w-440{width:27.5rem}.pi .w-46{width:2.875rem}.pi .w-50{width:50px}.pi .w-56{width:56px}.pi .w-60{width:60px}.pi .w-620{width:38.75rem}.pi .w-64{width:64px}.pi .w-68{width:68px}.pi .w-780{width:48.75rem}.pi .w-8{width:8px}.pi .w-80{width:80px}.pi .w-850{width:53.125rem}.pi .w-96{width:96px}.pi .w-\\[4ch\\]{width:4ch}.pi .w-auto{width:auto}.pi .w-font{width:1em}.pi .w-full{width:100%}.pi .w-max{width:-moz-max-content;width:max-content}.pi .w-min{width:-moz-min-content;width:min-content}.pi .w-px{width:1px}.pi .w-screen{width:100vw}.pi .min-w-0{min-width:0}.pi .min-w-128{min-width:128px}.pi .min-w-180{min-width:11.25rem}.pi .min-w-192{min-width:192px}.pi .min-w-288{min-width:288px}.pi .min-w-30{min-width:30px}.pi .min-w-4{min-width:4px}.pi .min-w-42{min-width:42px}.pi .min-w-92{min-width:92px}.pi .min-w-min{min-width:-moz-min-content;min-width:min-content}.pi .max-w-112{max-width:112px}.pi .max-w-240{max-width:240px}.pi .max-w-288{max-width:288px}.pi .max-w-320{max-width:320px}.pi .max-w-375{max-width:375px}.pi .max-w-500{max-width:31.25rem}.pi .max-w-\\[90\\%\\]{max-width:90%}.pi .max-w-\\[calc\\(100\\%-40px\\)\\]{max-width:calc(100% - 40px)}.pi .max-w-\\[calc\\(100vw-90px\\)\\]{max-width:calc(100vw - 90px)}.pi .max-w-dialog{max-width:calc(var(--be-viewport-width, 100vw)*.9)}.pi .max-w-full{max-width:100%}.pi .max-w-max{max-width:-moz-max-content;max-width:max-content}.pi .flex-\\[1_1_60px\\]{flex:1 1 60px}.pi .flex-auto{flex:1 1 auto}.pi .flex-shrink-0,.pi .shrink-0{flex-shrink:0}.pi .origin-\\[0_55\\%\\]{transform-origin:0 55%}.pi .origin-\\[100\\%\\]{transform-origin:100%}.pi .-translate-x-1\\/2{--tw-translate-x:-50%}.pi .-translate-x-1\\/2,.pi .-translate-y-1\\/2{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .-translate-y-1\\/2{--tw-translate-y:-50%}.pi .rotate-0{--tw-rotate:0deg}.pi .rotate-0,.pi .rotate-180{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .rotate-180{--tw-rotate:180deg}.pi .rotate-45{--tw-rotate:45deg}.pi .rotate-45,.pi .rotate-90{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .rotate-90{--tw-rotate:90deg}.pi .scale-y-\\[0\\.6\\]{--tw-scale-y:.6}.pi .scale-y-\\[0\\.6\\],.pi .transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .cursor-default{cursor:default}.pi .cursor-move{cursor:move}.pi .cursor-nesw-resize{cursor:nesw-resize}.pi .cursor-not-allowed{cursor:not-allowed}.pi .cursor-nwse-resize{cursor:nwse-resize}.pi .cursor-pointer{cursor:pointer}.pi .cursor-se-resize{cursor:se-resize}.pi .cursor-sw-resize{cursor:sw-resize}.pi .touch-none{touch-action:none}.pi .select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.pi .resize{resize:both}.pi .appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.pi .grid-cols-5-min-content{grid-template-columns:repeat(5,min-content)}.pi .flex-row{flex-direction:row}.pi .flex-col{flex-direction:column}.pi .flex-col-reverse{flex-direction:column-reverse}.pi .flex-wrap{flex-wrap:wrap}.pi .flex-nowrap{flex-wrap:nowrap}.pi .items-start{align-items:flex-start}.pi .items-end{align-items:flex-end}.pi .items-center{align-items:center}.pi .items-stretch{align-items:stretch}.pi .justify-start{justify-content:flex-start}.pi .justify-center{justify-content:center}.pi .justify-between{justify-content:space-between}.pi .gap-10{gap:10px}.pi .gap-14{gap:14px}.pi .gap-16{gap:16px}.pi .gap-18{gap:18px}.pi .gap-20{gap:20px}.pi .gap-36{gap:36px}.pi .gap-4{gap:4px}.pi .gap-40{gap:40px}.pi .gap-6{gap:6px}.pi .gap-8{gap:8px}.pi .space-y-10>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(10px*var(--tw-space-y-reverse));margin-top:calc(10px*(1 - var(--tw-space-y-reverse)))}.pi .overflow-auto{overflow:auto}.pi .overflow-hidden{overflow:hidden}.pi .overflow-x-auto{overflow-x:auto}.pi .overflow-y-auto{overflow-y:auto}.pi .overflow-x-hidden{overflow-x:hidden}.pi .overflow-y-hidden{overflow-y:hidden}.pi .overscroll-contain{overscroll-behavior:contain}.pi .truncate{overflow:hidden;white-space:nowrap}.pi .overflow-ellipsis,.pi .text-ellipsis,.pi .truncate{text-overflow:ellipsis}.pi .whitespace-normal{white-space:normal}.pi .whitespace-nowrap{white-space:nowrap}.pi .break-words{overflow-wrap:break-word}.pi .rounded{border-radius:4px}.pi .rounded-2xl{border-radius:16px}.pi .rounded-3xl{border-radius:24px}.pi .rounded-button{border-radius:var(--be-button-radius,.25rem)}.pi .rounded-full{border-radius:9999px}.pi .rounded-input{border-radius:var(--be-input-radius,.25rem)}.pi .rounded-lg{border-radius:8px}.pi .rounded-md{border-radius:6px}.pi .rounded-none{border-radius:0}.pi .rounded-panel{border-radius:var(--be-panel-radius,.25rem)}.pi .rounded-xl{border-radius:12px}.pi .rounded-l{border-bottom-left-radius:4px;border-top-left-radius:4px}.pi .rounded-l-full{border-bottom-left-radius:9999px;border-top-left-radius:9999px}.pi .rounded-l-input{border-bottom-left-radius:var(--be-input-radius,.25rem);border-top-left-radius:var(--be-input-radius,.25rem)}.pi .rounded-l-none{border-bottom-left-radius:0;border-top-left-radius:0}.pi .rounded-r-full{border-bottom-right-radius:9999px;border-top-right-radius:9999px}.pi .rounded-r-input{border-bottom-right-radius:var(--be-input-radius,.25rem);border-top-right-radius:var(--be-input-radius,.25rem)}.pi .rounded-r-none{border-bottom-right-radius:0;border-top-right-radius:0}.pi .rounded-t{border-top-left-radius:4px;border-top-right-radius:4px}.pi .rounded-bl-none{border-bottom-left-radius:0}.pi .rounded-br-none{border-bottom-right-radius:0}.pi .rounded-tl-none{border-top-left-radius:0}.pi .rounded-tr-none{border-top-right-radius:0}.pi .border{border-width:1px}.pi .border-2{border-width:2px}.pi .border-4{border-width:4px}.pi .border-\\[3px\\]{border-width:3px}.pi .border-y{border-top-width:1px}.pi .border-b,.pi .border-y{border-bottom-width:1px}.pi .border-b-4{border-bottom-width:4px}.pi .border-l{border-left-width:1px}.pi .border-l-4{border-left-width:4px}.pi .border-r{border-right-width:1px}.pi .border-r-4{border-right-width:4px}.pi .border-t{border-top-width:1px}.pi .border-t-4{border-top-width:4px}.pi .border-dotted{border-style:dotted}.pi .border-none{border-style:none}.pi .border-background{--tw-border-opacity:1;border-color:rgb(var(--be-background)/var(--tw-border-opacity))}.pi .border-bg-alt{--tw-border-opacity:1;border-color:rgb(var(--be-background-alt)/var(--tw-border-opacity))}.pi .border-chip{--tw-border-opacity:1;border-color:rgb(var(--be-background-chip)/var(--tw-border-opacity))}.pi .border-danger{--tw-border-opacity:1;border-color:rgb(239 68 68/var(--tw-border-opacity))}.pi .border-danger\\/50{border-color:#ef444480}.pi .border-divider{border-color:rgb(var(--be-foreground-base)/var(--be-divider-opacity))}.pi .border-paper{--tw-border-opacity:1;border-color:rgb(var(--be-paper)/var(--tw-border-opacity))}.pi .border-positive\\/50{border-color:#22c55e80}.pi .border-primary{--tw-border-opacity:1;border-color:rgb(var(--be-primary)/var(--tw-border-opacity))}.pi .border-primary\\/50{border-color:rgb(var(--be-primary)/.5)}.pi .border-text-muted{border-color:rgb(var(--be-foreground-base)/var(--be-text-muted-opacity))}.pi .border-transparent{border-color:transparent}.pi .border-white{--tw-border-opacity:1;border-color:rgb(255 255 255/var(--tw-border-opacity))}.pi .border-white\\/50{border-color:#ffffff80}.pi .border-b-bg{--tw-border-opacity:1;border-bottom-color:rgb(var(--be-background)/var(--tw-border-opacity))}.pi .border-b-transparent{border-bottom-color:transparent}.pi .border-r-transparent{border-right-color:transparent}.pi .bg{--tw-bg-opacity:1;background-color:rgb(var(--be-background)/var(--tw-bg-opacity))}.pi .bg-alt{--tw-bg-opacity:1;background-color:rgb(var(--be-background-alt)/var(--tw-bg-opacity))}.pi .bg-background{--tw-bg-opacity:1;background-color:rgb(var(--be-background)/var(--tw-bg-opacity))}.pi .bg-background\\/70{background-color:rgb(var(--be-background)/.7)}.pi .bg-background\\/80{background-color:rgb(var(--be-background)/.8)}.pi .bg-black\\/50{background-color:#00000080}.pi .bg-black\\/80{background-color:#000c}.pi .bg-chip{--tw-bg-opacity:1;background-color:rgb(var(--be-background-chip)/var(--tw-bg-opacity))}.pi .bg-controls{--tw-bg-opacity:1;background-color:rgb(50 50 50/var(--tw-bg-opacity))}.pi .bg-danger{--tw-bg-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity))}.pi .bg-danger-lighter{--tw-bg-opacity:1;background-color:rgb(254 202 202/var(--tw-bg-opacity))}.pi .bg-divider{background-color:rgb(var(--be-foreground-base)/var(--be-divider-opacity))}.pi .bg-fg-base\\/4{background-color:rgb(var(--be-foreground-base)/4%)}.pi .bg-focus{background-color:rgb(var(--be-foreground-base)/var(--be-focus-opacity))}.pi .bg-inherit{background-color:inherit}.pi .bg-paper{--tw-bg-opacity:1;background-color:rgb(var(--be-paper)/var(--tw-bg-opacity))}.pi .bg-positive{--tw-bg-opacity:1;background-color:rgb(34 197 94/var(--tw-bg-opacity))}.pi .bg-positive-lighter{--tw-bg-opacity:1;background-color:rgb(187 247 208/var(--tw-bg-opacity))}.pi .bg-primary{--tw-bg-opacity:1;background-color:rgb(var(--be-primary)/var(--tw-bg-opacity))}.pi .bg-primary-dark{--tw-bg-opacity:1;background-color:rgb(var(--be-primary-dark)/var(--tw-bg-opacity))}.pi .bg-primary-light{--tw-bg-opacity:1;background-color:rgb(var(--be-primary-light)/var(--tw-bg-opacity))}.pi .bg-primary\\/focus{background-color:rgb(var(--be-primary)/var(--be-focus-opacity))}.pi .bg-primary\\/selected{background-color:rgb(var(--be-primary)/var(--be-selected-opacity))}.pi .bg-slider-disabled{--tw-bg-opacity:1;background-color:rgb(189 189 189/var(--tw-bg-opacity))}.pi .bg-slider-disabled\\/60{background-color:#bdbdbd99}.pi .bg-toast{--tw-bg-opacity:1;background-color:rgb(50 50 50/var(--tw-bg-opacity))}.pi .bg-transparent{background-color:transparent}.pi .bg-warning{--tw-bg-opacity:1;background-color:rgb(243 164 50/var(--tw-bg-opacity))}.pi .bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.pi .bg-white\\/50{background-color:#ffffff80}.pi .bg-opacity-95{--tw-bg-opacity:.95}.pi .bg-no-repeat{background-repeat:no-repeat}.pi .fill-current{fill:currentColor}.pi .fill-transparent{fill:transparent}.pi .stroke-current{stroke:currentColor}.pi .object-contain{-o-object-fit:contain;object-fit:contain}.pi .object-cover{-o-object-fit:cover;object-fit:cover}.pi .p-0{padding:0}.pi .p-10{padding:10px}.pi .p-14{padding:14px}.pi .p-16{padding:16px}.pi .p-18{padding:18px}.pi .p-2{padding:2px}.pi .p-20{padding:20px}.pi .p-4{padding:4px}.pi .p-40{padding:40px}.pi .p-6{padding:6px}.pi .p-8{padding:8px}.pi .px-10{padding-left:10px;padding-right:10px}.pi .px-12{padding-left:12px;padding-right:12px}.pi .px-14{padding-left:14px;padding-right:14px}.pi .px-16{padding-left:16px;padding-right:16px}.pi .px-18{padding-left:18px;padding-right:18px}.pi .px-20{padding-left:20px;padding-right:20px}.pi .px-22{padding-left:22px;padding-right:22px}.pi .px-24{padding-left:24px;padding-right:24px}.pi .px-26{padding-left:26px;padding-right:26px}.pi .px-32{padding-left:32px;padding-right:32px}.pi .px-4{padding-left:4px;padding-right:4px}.pi .px-5vw{padding-left:5vw;padding-right:5vw}.pi .px-6{padding-left:6px;padding-right:6px}.pi .px-8{padding-left:8px;padding-right:8px}.pi .py-10{padding-bottom:10px;padding-top:10px}.pi .py-12{padding-bottom:12px;padding-top:12px}.pi .py-14{padding-bottom:14px;padding-top:14px}.pi .py-2{padding-bottom:2px;padding-top:2px}.pi .py-20{padding-bottom:20px;padding-top:20px}.pi .py-3{padding-bottom:3px;padding-top:3px}.pi .py-4{padding-bottom:4px;padding-top:4px}.pi .py-5{padding-bottom:5px;padding-top:5px}.pi .py-6{padding-bottom:6px;padding-top:6px}.pi .py-8{padding-bottom:8px;padding-top:8px}.pi .py-\\[9px\\]{padding-bottom:9px;padding-top:9px}.pi .pb-10{padding-bottom:10px}.pi .pb-12{padding-bottom:12px}.pi .pb-14{padding-bottom:14px}.pi .pb-16{padding-bottom:16px}.pi .pb-18{padding-bottom:18px}.pi .pb-20{padding-bottom:20px}.pi .pb-4{padding-bottom:4px}.pi .pb-8{padding-bottom:8px}.pi .pb-safe-area{padding-bottom:env(safe-area-inset-bottom)}.pi .pl-10{padding-left:10px}.pi .pl-12{padding-left:12px}.pi .pl-14{padding-left:14px}.pi .pl-16{padding-left:16px}.pi .pl-18{padding-left:18px}.pi .pl-28{padding-left:28px}.pi .pl-46{padding-left:2.875rem}.pi .pl-54{padding-left:3.375rem}.pi .pl-8{padding-left:8px}.pi .pr-10{padding-right:10px}.pi .pr-12{padding-right:12px}.pi .pr-18{padding-right:18px}.pi .pr-24{padding-right:24px}.pi .pr-28{padding-right:28px}.pi .pr-46{padding-right:2.875rem}.pi .pr-54{padding-right:3.375rem}.pi .pr-6{padding-right:6px}.pi .pr-8{padding-right:8px}.pi .pt-10{padding-top:10px}.pi .pt-12{padding-top:12px}.pi .pt-14{padding-top:14px}.pi .pt-16{padding-top:16px}.pi .pt-20{padding-top:20px}.pi .pt-24{padding-top:24px}.pi .pt-4{padding-top:4px}.pi .pt-40{padding-top:40px}.pi .pt-6{padding-top:6px}.pi .text-left{text-align:left}.pi .text-center{text-align:center}.pi .text-right{text-align:right}.pi .align-middle{vertical-align:middle}.pi .text-base{font-size:16px;line-height:24px}.pi .text-lg{font-size:18px;line-height:28px}.pi .text-sm{font-size:14px;line-height:20px}.pi .text-xl{font-size:20px;line-height:28px}.pi .text-xs{font-size:12px;line-height:16px}.pi .font-bold{font-weight:700}.pi .font-medium{font-weight:500}.pi .font-semibold{font-weight:600}.pi .uppercase{text-transform:uppercase}.pi .capitalize{text-transform:capitalize}.pi .italic{font-style:italic}.pi .tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.pi .leading-5{line-height:1.25rem}.pi .leading-none{line-height:1}.pi .tracking-wide{letter-spacing:.025em}.pi .\\!text{color:rgb(var(--be-foreground-base)/var(--be-text-main-opacity))!important}.pi .text{color:rgb(var(--be-foreground-base)/var(--be-text-main-opacity))}.pi .text-black{--tw-text-opacity:1;color:rgb(0 0 0/var(--tw-text-opacity))}.pi .text-black\\/30{color:#0000004d}.pi .text-danger{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity))}.pi .text-danger-darker{--tw-text-opacity:1;color:rgb(153 27 27/var(--tw-text-opacity))}.pi .text-disabled{color:rgb(var(--be-foreground-base)/var(--be-disabled-fg-opacity))}.pi .text-link{--tw-text-opacity:1;color:rgb(var(--be-link-color,var(--be-primary))/var(--tw-text-opacity))}.pi .text-main{color:rgb(var(--be-foreground-base)/var(--be-text-main-opacity))}.pi .text-muted{color:rgb(var(--be-foreground-base)/var(--be-text-muted-opacity))}.pi .text-on-primary{--tw-text-opacity:1;color:rgb(var(--be-on-primary)/var(--tw-text-opacity))}.pi .text-positive{--tw-text-opacity:1;color:rgb(34 197 94/var(--tw-text-opacity))}.pi .text-positive-darker{--tw-text-opacity:1;color:rgb(22 101 52/var(--tw-text-opacity))}.pi .text-primary{--tw-text-opacity:1;color:rgb(var(--be-primary)/var(--tw-text-opacity))}.pi .text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.pi .underline{text-decoration-line:underline}.pi .no-underline{text-decoration-line:none}.pi .caret-transparent{caret-color:transparent}.pi .opacity-0{opacity:0}.pi .opacity-100{opacity:1}.pi .opacity-70{opacity:.7}.pi .opacity-80{opacity:.8}.pi .opacity-90{opacity:.9}.pi .shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color)}.pi .shadow,.pi .shadow-2xl{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.pi .shadow-2xl{--tw-shadow:0 25px 50px -12px rgba(0,0,0,.25);--tw-shadow-colored:0 25px 50px -12px var(--tw-shadow-color)}.pi .shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color)}.pi .shadow-lg,.pi .shadow-md{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.pi .shadow-md{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color)}.pi .shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)}.pi .shadow-sm,.pi .shadow-xl{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.pi .shadow-xl{--tw-shadow:0 20px 25px -5px rgba(0,0,0,.1),0 8px 10px -6px rgba(0,0,0,.1);--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color),0 8px 10px -6px var(--tw-shadow-color)}.pi .outline-none{outline:2px solid transparent;outline-offset:2px}.pi .outline{outline-color:rgb(var(--be-primary-lighter)/1);outline-style:solid;outline-width:2px}.pi .ring{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.pi .ring-inset{--tw-ring-inset:inset}.pi .blur{--tw-blur:blur(8px)}.pi .blur,.pi .grayscale{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.pi .grayscale{--tw-grayscale:grayscale(100%)}.pi .invert{--tw-invert:invert(100%)}.pi .invert,.pi .sepia{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.pi .sepia{--tw-sepia:sepia(100%)}.pi .filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.pi .backdrop-blur-sm{--tw-backdrop-blur:blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.pi .transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .transition-button{transition-duration:.15s;transition-property:background-color,box-shadow,border-color,color;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .transition-shadow{transition-duration:.15s;transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .transition-transform{transition-duration:.15s;transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .transition-width{transition-duration:.15s;transition-property:width;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .duration-100{transition-duration:.1s}.pi .duration-200{transition-duration:.2s}.pi .will-change-transform{will-change:transform}.pi .icon-2xs{font-size:.75rem}.pi .icon-xs{font-size:1rem}.pi .icon-sm{font-size:1.25rem}.pi .icon-md{font-size:1.5rem}.pi .icon-lg{font-size:2.1875rem}.pi .icon-xl{font-size:2.6875rem}.pi .no-tap-highlight{-webkit-tap-highlight-color:transparent}@media only screen and (min-device-width:768px){.pi .tiny-scrollbar{scrollbar-color:rgba(0,0,0,.2) transparent;scrollbar-width:thin}.pi .tiny-scrollbar::-webkit-scrollbar{background-color:transparent;height:6px;width:6px}.pi .tiny-scrollbar::-webkit-scrollbar-thumb{background-color:rgb(var(--be-foreground-base)/.2);border-radius:10px}.pi .tiny-scrollbar::-webkit-scrollbar-track-piece:start{background:transparent}.pi .tiny-scrollbar::-webkit-scrollbar-track-piece:end{background:transparent}}.pi .hide-scrollbar{-ms-overflow-style:none;scrollbar-width:none}.pi .hide-scrollbar::-webkit-scrollbar{background:transparent;display:none;height:0;width:0}.pi .svg-icon{display:inline-block;flex-shrink:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;fill:currentColor;transition-duration:.15s;transition-property:transform,fill;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .cropzone:not(.moving) .cropzone-transition{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .first-letter\\:capitalize:first-letter{text-transform:capitalize}.pi .file\\:mr-10::file-selector-button{margin-right:10px}.pi .file\\:h-24::file-selector-button{height:24px}.pi .file\\:rounded::file-selector-button{border-radius:4px}.pi .file\\:border-none::file-selector-button{border-style:none}.pi .file\\:bg-primary::file-selector-button{--tw-bg-opacity:1;background-color:rgb(var(--be-primary)/var(--tw-bg-opacity))}.pi .file\\:px-10::file-selector-button{padding-left:10px;padding-right:10px}.pi .file\\:text-sm::file-selector-button{font-size:14px;line-height:20px}.pi .file\\:font-semibold::file-selector-button{font-weight:600}.pi .file\\:text-on-primary::file-selector-button{--tw-text-opacity:1;color:rgb(var(--be-on-primary)/var(--tw-text-opacity))}.pi .before\\:z-10:before{content:var(--tw-content);z-index:10}.pi .before\\:block:before{content:var(--tw-content);display:block}.pi .before\\:h-12:before{content:var(--tw-content);height:12px}.pi .before\\:h-14:before{content:var(--tw-content);height:14px}.pi .before\\:h-18:before{content:var(--tw-content);height:18px}.pi .before\\:h-22:before{content:var(--tw-content);height:22px}.pi .before\\:h-28:before{content:var(--tw-content);height:28px}.pi .before\\:h-full:before{content:var(--tw-content);height:100%}.pi .before\\:w-12:before{content:var(--tw-content);width:12px}.pi .before\\:w-14:before{content:var(--tw-content);width:14px}.pi .before\\:w-18:before{content:var(--tw-content);width:18px}.pi .before\\:w-22:before{content:var(--tw-content);width:22px}.pi .before\\:w-28:before{content:var(--tw-content);width:28px}.pi .before\\:w-full:before{content:var(--tw-content);width:100%}.pi .before\\:translate-x-2:before{--tw-translate-x:2px}.pi .before\\:scale-10:before,.pi .before\\:translate-x-2:before{content:var(--tw-content);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .before\\:scale-10:before{--tw-scale-x:.1;--tw-scale-y:.1}.pi .before\\:rounded-3xl:before{border-radius:24px;content:var(--tw-content)}.pi .before\\:rounded-full:before{border-radius:9999px;content:var(--tw-content)}.pi .before\\:border:before{border-width:1px;content:var(--tw-content)}.pi .before\\:bg-primary:before{content:var(--tw-content);--tw-bg-opacity:1;background-color:rgb(var(--be-primary)/var(--tw-bg-opacity))}.pi .before\\:bg-white:before{content:var(--tw-content);--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.pi .before\\:opacity-0:before{content:var(--tw-content);opacity:0}.pi .before\\:transition:before{content:var(--tw-content);transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .before\\:transition-transform:before{content:var(--tw-content);transition-duration:.15s;transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .before\\:duration-200:before{content:var(--tw-content);transition-duration:.2s}.pi .after\\:pointer-events-none:after{content:var(--tw-content);pointer-events:none}.pi .after\\:absolute:after{content:var(--tw-content);position:absolute}.pi .after\\:inset-0:after{content:var(--tw-content);top:0;right:0;bottom:0;left:0}.pi .checked\\:border-danger:checked{--tw-border-opacity:1;border-color:rgb(239 68 68/var(--tw-border-opacity))}.pi .checked\\:border-primary:checked{--tw-border-opacity:1;border-color:rgb(var(--be-primary)/var(--tw-border-opacity))}.pi .checked\\:bg-danger:checked{--tw-bg-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity))}.pi .checked\\:bg-primary:checked{--tw-bg-opacity:1;background-color:rgb(var(--be-primary)/var(--tw-bg-opacity))}.pi .checked\\:before\\:translate-x-14:checked:before{--tw-translate-x:14px}.pi .checked\\:before\\:translate-x-14:checked:before,.pi .checked\\:before\\:translate-x-20:checked:before{content:var(--tw-content);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .checked\\:before\\:translate-x-20:checked:before{--tw-translate-x:20px}.pi .checked\\:before\\:translate-x-24:checked:before{--tw-translate-x:24px}.pi .checked\\:before\\:translate-x-24:checked:before,.pi .checked\\:before\\:translate-x-30:checked:before{content:var(--tw-content);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .checked\\:before\\:translate-x-30:checked:before{--tw-translate-x:30px}.pi .checked\\:before\\:translate-x-36:checked:before{--tw-translate-x:36px}.pi .checked\\:before\\:scale-\\[\\.65\\]:checked:before,.pi .checked\\:before\\:translate-x-36:checked:before{content:var(--tw-content);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .checked\\:before\\:scale-\\[\\.65\\]:checked:before{--tw-scale-x:.65;--tw-scale-y:.65}.pi .checked\\:before\\:border-white:checked:before{content:var(--tw-content);--tw-border-opacity:1;border-color:rgb(255 255 255/var(--tw-border-opacity))}.pi .checked\\:before\\:opacity-100:checked:before{content:var(--tw-content);opacity:1}.pi .focus-within\\:border-primary\\/60:focus-within{border-color:rgb(var(--be-primary)/.6)}.pi .focus-within\\:ring:focus-within{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.pi .focus-within\\:ring-primary\\/focus:focus-within{--tw-ring-color:rgb(var(--be-primary)/var(--be-focus-opacity))}.pi .hover\\:scale-110:hover{--tw-scale-x:1.1;--tw-scale-y:1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .hover\\:border-chip\\/90:hover{border-color:rgb(var(--be-background-chip)/.9)}.pi .hover\\:border-danger:hover{--tw-border-opacity:1;border-color:rgb(239 68 68/var(--tw-border-opacity))}.pi .hover\\:border-danger\\/90:hover{border-color:#ef4444e6}.pi .hover\\:border-paper\\/90:hover{border-color:rgb(var(--be-paper)/.9)}.pi .hover\\:border-positive:hover{--tw-border-opacity:1;border-color:rgb(34 197 94/var(--tw-border-opacity))}.pi .hover\\:border-primary:hover{--tw-border-opacity:1;border-color:rgb(var(--be-primary)/var(--tw-border-opacity))}.pi .hover\\:border-primary-dark:hover{--tw-border-opacity:1;border-color:rgb(var(--be-primary-dark)/var(--tw-border-opacity))}.pi .hover\\:bg-chip\\/90:hover{background-color:rgb(var(--be-background-chip)/.9)}.pi .hover\\:bg-danger\\/4:hover{background-color:#ef44440a}.pi .hover\\:bg-danger\\/90:hover{background-color:#ef4444e6}.pi .hover\\:bg-fg-base\\/15:hover{background-color:rgb(var(--be-foreground-base)/15%)}.pi .hover\\:bg-hover:hover{background-color:rgb(var(--be-foreground-base)/var(--be-hover-opacity))}.pi .hover\\:bg-paper\\/90:hover{background-color:rgb(var(--be-paper)/.9)}.pi .hover\\:bg-positive\\/4:hover{background-color:#22c55e0a}.pi .hover\\:bg-primary-dark:hover{--tw-bg-opacity:1;background-color:rgb(var(--be-primary-dark)/var(--tw-bg-opacity))}.pi .hover\\:bg-primary\\/4:hover{background-color:rgb(var(--be-primary)/4%)}.pi .hover\\:bg-primary\\/focus:hover{background-color:rgb(var(--be-primary)/var(--be-focus-opacity))}.pi .hover\\:bg-primary\\/hover:hover{background-color:rgb(var(--be-primary)/var(--be-hover-opacity))}.pi .hover\\:bg-white:hover{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.pi .hover\\:bg-white\\/20:hover{background-color:#fff3}.pi .hover\\:bg-white\\/hover:hover{background-color:rgb(255 255 255/var(--be-hover-opacity))}.pi .hover\\:text-main:hover{color:rgb(var(--be-foreground-base)/var(--be-text-main-opacity))}.pi .hover\\:text-primary-dark:hover{--tw-text-opacity:1;color:rgb(var(--be-primary-dark)/var(--tw-text-opacity))}.pi .hover\\:underline:hover{text-decoration-line:underline}.pi .hover\\:shadow-md:hover{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.pi .before\\:hover\\:bg-primary-dark:hover:before{content:var(--tw-content);--tw-bg-opacity:1;background-color:rgb(var(--be-primary-dark)/var(--tw-bg-opacity))}.pi .hover\\:after\\:bg-black\\/5:hover:after{background-color:#0000000d;content:var(--tw-content)}.pi .checked\\:hover\\:border-primary-dark:hover:checked{--tw-border-opacity:1;border-color:rgb(var(--be-primary-dark)/var(--tw-border-opacity))}.pi .focus\\:border-danger\\/60:focus{border-color:#ef444499}.pi .focus\\:border-primary\\/60:focus{border-color:rgb(var(--be-primary)/.6)}.pi .focus\\:bg-primary:focus{--tw-bg-opacity:1;background-color:rgb(var(--be-primary)/var(--tw-bg-opacity))}.pi .focus\\:text-on-primary:focus{--tw-text-opacity:1;color:rgb(var(--be-on-primary)/var(--tw-text-opacity))}.pi .focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.pi .focus\\:ring:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.pi .focus\\:ring-danger\\/focus:focus{--tw-ring-color:rgb(239 68 68/var(--be-focus-opacity))}.pi .focus\\:ring-primary\\/focus:focus{--tw-ring-color:rgb(var(--be-primary)/var(--be-focus-opacity))}.pi .focus\\:after\\:bg-black\\/10:focus:after{background-color:#0000001a;content:var(--tw-content)}.pi .focus-visible\\:bg-primary\\/focus:focus-visible{background-color:rgb(var(--be-primary)/var(--be-focus-opacity))}.pi .focus-visible\\:outline:focus-visible{outline-color:rgb(var(--be-primary-lighter)/1);outline-style:solid;outline-width:2px}.pi .focus-visible\\:outline-primary-light:focus-visible{outline-color:rgb(var(--be-primary-light)/1)}.pi .focus-visible\\:ring:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.pi .focus-visible\\:ring-2:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.pi .focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px}.pi .disabled\\:pointer-events-none:disabled{pointer-events:none}.pi .disabled\\:cursor-default:disabled{cursor:default}.pi .disabled\\:border-disabled-bg:disabled{border-color:rgb(var(--be-foreground-base)/var(--be-disabled-bg-opacity))}.pi .disabled\\:border-disabled-fg:disabled{border-color:rgb(var(--be-foreground-base)/var(--be-disabled-fg-opacity))}.pi .disabled\\:border-transparent:disabled{border-color:transparent}.pi .disabled\\:border-white\\/70:disabled{border-color:#ffffffb3}.pi .disabled\\:border-r-transparent:disabled{border-right-color:transparent}.pi .disabled\\:bg-disabled:disabled{background-color:rgb(var(--be-foreground-base)/var(--be-disabled-bg-opacity))}.pi .disabled\\:bg-transparent:disabled{background-color:transparent}.pi .disabled\\:text-disabled:disabled{color:rgb(var(--be-foreground-base)/var(--be-disabled-fg-opacity))}.pi .disabled\\:text-white\\/70:disabled{color:#ffffffb3}.pi .disabled\\:shadow-none:disabled{--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.pi .disabled\\:before\\:bg-disabled-fg:disabled:before{background-color:rgb(var(--be-foreground-base)/var(--be-disabled-fg-opacity));content:var(--tw-content)}.pi :is(.dark .dark\\:bg-chip){--tw-bg-opacity:1;background-color:rgb(var(--be-background-chip)/var(--tw-bg-opacity))}.pi :is(.dark .dark\\:text-white\\/50){color:#ffffff80}.pi :is(.dark .dark\\:checked\\:border-primary-dark:checked){--tw-border-opacity:1;border-color:rgb(var(--be-primary-dark)/var(--tw-border-opacity))}.pi :is(.dark .dark\\:checked\\:bg-primary-dark:checked){--tw-bg-opacity:1;background-color:rgb(var(--be-primary-dark)/var(--tw-bg-opacity))}@media (min-width:640px){.pi .sm\\:text-sm{font-size:14px;line-height:20px}}@media (min-width:768px){.pi .md\\:text-lg{font-size:18px;line-height:28px}}.pi .\\[\\&\\>\\.tree-label\\]\\:focus-visible\\:ring:focus-visible>.tree-label{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.pi .\\[\\&\\>\\.tree-label\\]\\:focus-visible\\:ring-2:focus-visible>.tree-label{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.pi .\\[\\&\\>\\.tree-label\\]\\:focus-visible\\:ring-inset:focus-visible>.tree-label{--tw-ring-inset:inset}\n'),!e.selector)throw new Error('Pixie required "selector" option.');const t=document.querySelector(e.selector);t&&(t.classList.add("pi"),function(e){Bp=e,Up=e}(t),this.setConfig(e),Gp.setState({editor:this}),(0,a.H)(t).render((0,i.jsx)(o.StrictMode,{children:(0,i.jsx)(pO,{})})))}get state(){return qp()}get defaultConfig(){return e.defaultConfig}open(e={}){return new Promise(async t=>{var n;Object.keys(e).length?await this.resetEditor({...Ff(e,{ui:{visible:!0},image:e.image||qp().config.image,state:e.state||qp().config.state,blankCanvasSize:e.blankCanvasSize||qp().config.blankCanvasSize})}):null!=(n=qp().config.ui)&&n.visible||qp().setConfig({ui:{visible:!0}}),t()})}close(){var e,t,n;null!=(e=qp().config.ui)&&e.visible&&(this.setConfig({ui:{visible:!1}}),null==(n=(t=qp().config).onClose)||n.call(t))}setConfig(e){qp().setConfig(e)}uploadAndAddImage(){return Yp().import.uploadAndAddImage()}uploadAndReplaceMainImage(){return Yp().import.uploadAndReplaceMainImage()}uploadAndOpenStateFile(){return Yp().import.uploadAndOpenStateFile()}newCanvas(e,t,n){return Yp().canvas.openNew(e,t,n)}getState(e){return JSON.stringify(Qp(e))}setState(e){return Yp().import.loadState(e)}async setStateFromUrl(e){const t=await Zp(e);return Yp().import.loadState(t)}openTool(e){eg(e)}applyChanges(){qp().applyChanges()}cancelChanges(){qp().cancelChanges()}async resetEditor(e){await Kp(e),await Yp().canvas.loadInitialContent()}togglePanel(e,t){"objects"===e&&qp().togglePanel("history",!1),"history"===e&&qp().togglePanel("objects",!1),qp().togglePanel(e,t)}on(e,t){var n;null==(n=this.fabric)||n.on(e,t)}isDirty(){return qp().dirty}get(e){return this.tools[e]}notify(e){return ag(e)}static init(e){return new Promise(t=>{const n=e.onLoad;e.onLoad=e=>{null==n||n(e),t(e)},new this(e)})}};is(gO,"defaultConfig",oh),is(gO,"version","3.0.5");let mO=gO;function vO(e){if(!this.backgroundColor)return;const t=this._getNonTransformedDimensions(),n=-t.x/2,r=-t.y/2,i=t.x,o=t.y,a=this.backgroundColor;if("string"==typeof a||a instanceof CanvasGradient||a instanceof CanvasPattern)e.fillStyle=a,e.fillRect(n,r,i,o);else if("object"!=typeof a||!("type"in a)||"linear"!==a.type&&"radial"!==a.type){if("source"in a&&(a.source instanceof HTMLImageElement||a.source instanceof HTMLCanvasElement))if(a.repeat){const t=e.createPattern(a.source,a.repeat);t&&(e.fillStyle=t,e.fillRect(n,r,i,o))}else e.drawImage(a.source,n,r,i,o)}else{const t=function(e,t,n,r){var i,o;if("linear"===t.type){const i=e.createLinearGradient(n+t.coords.x1,r+t.coords.y1,n+t.coords.x2,r+t.coords.y2);return t.colorStops.forEach(e=>i.addColorStop(e.offset,e.color)),i}if("radial"===t.type){const a=e.createRadialGradient(n+t.coords.x1,r+t.coords.y1,null!==(i=t.coords.r1)&&void 0!==i?i:0,n+t.coords.x2,r+t.coords.y2,null!==(o=t.coords.r2)&&void 0!==o?o:0);return t.colorStops.forEach(e=>a.addColorStop(e.offset,e.color)),a}throw new Error("Unknown gradient type")}(e,a,n,r);e.fillStyle=t,e.fillRect(n,r,i,o)}this._removeShadow(e)}const yO="fm-pixie-editor",bO=new class{constructor(){this._container=document.createElement("div"),this._instance=null,this._container.classList.add(yO),this._container.style.width="100%",this._container.style.height="85vh",this._container.style.minHeight="400px"}get className(){return`.${yO}`}get canvas(){var e,t;return null===(t=null===(e=this._instance)||void 0===e?void 0:e.state.canvasRef)||void 0===t?void 0:t.current}get tools(){var e;return null===(e=this._instance)||void 0===e?void 0:e.tools}isLoaded(){return!!this._instance}async _setConfig(e){var t;this._instance?await this._instance.resetEditor(e):this._instance=await mO.init(Object.assign(Object.assign({},e),{selector:this.className})),(t=this._instance).fabric&&t.fabric.on("object:added",e=>{const t=e.target;t&&"text"===t.name&&(t._renderBackground=vO)})}async show(e,t,n=t.firstChild){t.insertBefore(this._container,n),await this._setConfig(e),this._instance.open()}close(){var e;null===(e=this._container.parentNode)||void 0===e||e.removeChild(this._container)}};function wO(e,t){return e?t?`${e.replace(/\/+$/,"")}/${t.replace(/^\/+/,"")}`:e:t}function xO(e,t){if(/^[a-zA-Z][a-zA-Z\d+\-.]*?:/.test(t))return t;const r=function(e){const t=n.p;if(e&&/^[a-zA-Z][a-zA-Z\d+\-.]*?:/.test(e))return e;let r=wO(t,e||"");return!r||r.startsWith("/")||/^[a-zA-Z][a-zA-Z\d+\-.]*?:/.test(r)||(r="/"+r),r}(e),i=wO(r,t);return!i||i.startsWith("/")||/^[a-zA-Z][a-zA-Z\d+\-.]*?:/.test(i)?i:"/"+i}var CO,_O;!function(e){e.TOP="top",e.BOTTOM="bottom",e.HIDDEN=""}(CO||(CO={})),function(e){e.TOP="top",e.BOTTOM="bottom",e.HIDDEN=""}(_O||(_O={}));const SO=(e,t="image/png")=>fetch(`data:${t};base64,${e}`).then(e=>e.blob());function AO(e){return new Promise((t,n)=>{const r=new FileReader;r.onload=()=>t(r.result),r.onerror=()=>{var e;return n(null!==(e=r.error)&&void 0!==e?e:new Error("Failed to convert blob to data URL"))},r.readAsDataURL(e)})}const kO=({visible:e,onClose:t,file:n,onSave:r,onSaveCopy:a})=>{var s;const{t:l}=En(),c=o.useRef(null),u=Ni(),d=ra(),{options:h,actions:f}=Ei(),{i18n:p}=En(),{config:g}=h,{setCurrentMenuFile:v}=f,{getFileData:y,resolveFileForEditByUrl:b}=d,[w,x]=o.useState(!1),[C,_]=o.useState(null),[S,A]=o.useState(""),[k,E]=o.useState(!1),[I,T]=o.useState(!1),[F,O]=o.useState(null),M=o.useRef(!1),P=o.useRef(),R=o.useRef(),L=o.useRef("saveCopy"),N=o.useRef(void 0);P.current=r,R.current=a,o.useEffect(()=>{n&&!M.current&&(async()=>{if(N.current!==n)if("object"!=typeof n){N.current=n,x(!0);try{if(n.startsWith("data:"))O({thumbnail:n,saveWithoutFolder:!0});else{const e=await b(n);N.current===n&&O(e)}}catch(It){N.current===n&&(N.current=null),null==t||t()}finally{x(!1)}}else O(n)})()},[n,t,b]);const D=o.useCallback(async e=>{try{if(e.thumbnail&&e.thumbnail.startsWith("data:"))return e.thumbnail;const t=await y(e.id,!0);if(!t)throw new Error(l("Error loading image"));return new Promise(e=>{const n=new FileReader;n.onload=()=>e(n.result),n.readAsDataURL(t)})}catch(e){throw e}},[y,l]);o.useEffect(()=>{if(!C&&e&&F){let e=!1;const r=async()=>{var r,i,o;x(!0);try{const t=await D(F);if(!t||"string"!=typeof t||""===t.trim())throw new Error("Invalid image data: empty or null");if(!t.startsWith("data:"))throw new Error("Invalid image data: not a valid data URL");const n=t.match(/^data:([^;]+);base64,(.+)$/);if(!n)throw new Error("Invalid image data: malformed data URL format");const[,r,i]=n;if(!r.startsWith("image/"))throw new Error(`Invalid image data: unsupported MIME type ${r}`);if(i.length<10)throw new Error("Invalid image data: base64 content too short");if(!/^[A-Za-z0-9+/]+=*$/.test(i))throw new Error("Invalid image data: corrupted base64 content");if(!e){_(t);const e=Go(F,"image/png");A(e.mimeType)}}catch(n){e||(u.error({id:"IMAGE_DOWNLOAD_FAILED",innerException:n,message:l("Error loading image"),placement:"bottomRight",data:{itemId:null!==(r=null==F?void 0:F.id)&&void 0!==r?r:void 0,itemName:null!==(i=null==F?void 0:F.name)&&void 0!==i?i:void 0,folderId:null!==(o=null==F?void 0:F.folderId)&&void 0!==o?o:null,thumbnail:null==F?void 0:F.thumbnail}}),null==t||t())}finally{x(!1)}};return r(),()=>{e=!0}}},[F,D,C,t,l,e]);const z=o.useCallback(async(e,t,n)=>{var r;let i=await function(e,t){if("json"===e)return new Blob([t],{type:"application/json"});if("svg"===e)return new Blob([t],{type:"image/svg+xml"});let n=`image/${e}`;if(t.startsWith("data:")){const e=on(t);e&&e.startsWith("image/")&&(n=e);const r=t.replace(/data:image\/[^;]+;base64,/,"");return SO(r,rn(n))}return SO(t,rn(n))}(n,e),o=rn(i.type||`image/${n}`);const a=null!==(r=null==g?void 0:g.compessorUrl)&&void 0!==r?r:null==g?void 0:g.compressorUrl;if(o.startsWith("image/"))try{const e=new File([i],t,{type:o}),n=await Zo(e,{maxSizeMB:null==g?void 0:g.compressMaxSize,maxWidthOrHeight:null==g?void 0:g.compressMaxWidthOrHeight,mimeType:o,fileName:t,libURL:a,enableCompression:Boolean(g)&&"image/gif"!==o});i=n,o=n.type}catch(e){}return{blob:i,mimeType:o,thumbnailDataUrl:await AO(i)}},[g]),B=o.useCallback(async(e,t,n,r)=>{var i,o,a,s,c,d;const h="save"===r?P.current:R.current;if(!F||!h)return;const f="object"==typeof F&&null!==F?F:null;let p=null;try{x(!0);const{blob:o,mimeType:a,thumbnailDataUrl:s}=await z(e,t,n),c=Object.assign(Object.assign({},F),{thumbnail:s,size:o.size,date:(new Date).toISOString().split("T")[0],type:a,folderId:F.folderId||"",name:F.name||t,extension:F.extension||(null===(i=(F.name||t).split(".").pop())||void 0===i?void 0:i.toLowerCase())||""});p=c;const u={blob:o,mimeType:a,thumbnail:s,mode:r},d=await h(c,u);if(d)return x(!1),d;throw new Error(l("saveCopy"===r?"Failed to save image copy":"Failed to save changes"))}catch(e){const n=null!=p?p:f;if(!(null==e?void 0:e.notificationShown)){const i=Gi(e),h=null!==(a=null!==(o=Wi(null==i?void 0:i.code,l))&&void 0!==o?o:null==i?void 0:i.message)&&void 0!==a?a:l("saveCopy"===r?"Failed to save image copy":"Error saving image");u.error({id:"saveCopy"===r?"IMAGE_SAVE_COPY_FAILED":"IMAGE_SAVE_FAILED",message:h,placement:"bottomRight",data:{itemId:null!==(s=null==n?void 0:n.id)&&void 0!==s?s:void 0,itemName:null!==(c=null==n?void 0:n.name)&&void 0!==c?c:t,folderId:null!==(d=null==n?void 0:n.folderId)&&void 0!==d?d:null,thumbnail:null==n?void 0:n.thumbnail},innerException:e})}x(!1)}},[F,u,z,l]),U=o.useCallback(async e=>{var t;if(!bO.isLoaded()||!F)return;L.current=e;const n=F.name||"edited-image",r=Go(F,S);try{await(null===(t=bO.tools)||void 0===t?void 0:t.export.save(n.replace(/\.[^/.]+$/,""),r.pixieFormat,qo.QUALITY))}catch(t){try{const t=bO.canvas,i=t?t.toDataURL(r.mimeType):null;i&&await B(i,n,r.extension,e)}catch(e){}}},[F,S,B]),V=o.useCallback(async()=>{var n;if(C&&e&&k&&!M.current)try{M.current=!0;const e=c.current;let r=0;for(;r<20&&(0===e.clientWidth||0===e.clientHeight);)await new Promise(e=>setTimeout(e,50)),r++;const o=(null==g?void 0:g.locale)?null==g?void 0:g.locale.replace("_","-"):"en",a=matchMedia(Gt).matches?Wt:Ht,s=(null==g?void 0:g.theme)===$t?a:null==g?void 0:g.theme,l=((null==g?void 0:g.locale)||p.language||"en").split("-")[0].split("_")[0],u=(p.getResourceBundle(l,"translation")||{}).pixie||{},d=e=>e.split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" "),h={};Object.entries(u).forEach(([e,t])=>{const n=d(e);h[n]=t,h[e]=t});const f={[o]:h},m=Go(F,S),v={selector:"#pixie-editor",baseUrl:xO((null==g?void 0:g.baseUrl)||"",(null==g?void 0:g.assetsUrl)||"assets/image-editor"),image:C,activeLanguage:o,languages:f,ui:{activeTheme:s,mode:"inline",forceOverlayModeOnMobile:!1,visible:!0,menubar:{replaceDefaultItems:!0,position:CO.TOP,items:[{type:"undoWidget",align:"left"},{type:"zoomWidget",align:"center",desktopOnly:!0},{type:"button",align:"right",desktopOnly:!0,icon:()=>(0,i.jsx)(ie.A,{style:{fontSize:20}}),action:e=>{e.togglePanel("history")}},{type:"button",icon:()=>(0,i.jsx)(ne.A,{style:{fontSize:20}}),align:"right",desktopOnly:!0,action:t}]},nav:{position:_O.TOP}},tools:{export:{defaultFormat:m.pixieFormat,defaultQuality:qo.QUALITY,defaultName:(null===(n=null==F?void 0:F.name)||void 0===n?void 0:n.replace(/\.[^/.]+$/,""))||"image"},text:{replaceDefaultItems:!0,defaultText:"Handwriting",items:[{family:"Inter",src:"fonts/inter-v20-cyrillic_latin-regular.woff2"},{family:"Commissioner",src:"fonts/commissioner-v24-cyrillic_latin-regular.woff2"},{family:"Montserrat Light",src:"fonts/Montserrat-Light.woff2"},{family:"Montserrat Regular",src:"fonts/Montserrat-Regular.woff2"},{family:"Montserrat Bold",src:"fonts/Montserrat-Bold.woff2"},{family:"Montserrat Black",src:"fonts/Montserrat-Black.woff2"},{family:"Roboto Light",src:"fonts/Roboto-Light.woff2"},{family:"Roboto Regular",src:"fonts/Roboto-Regular.woff2"},{family:"Roboto Bold",src:"fonts/Roboto-Bold.woff2"},{family:"Roboto Black",src:"fonts/Roboto-Black.woff2"},{family:"Lato Light",src:"fonts/Lato-Light.woff2"},{family:"Lato Regular",src:"fonts/Lato-Regular.woff2"},{family:"Lato Bold",src:"fonts/Lato-Bold.woff2"},{family:"Lato Black",src:"fonts/Lato-Black.woff2"},{family:"Rubik Light",src:"fonts/Rubik-Light.woff2"},{family:"Rubik Regular",src:"fonts/Rubik-Regular.woff2"},{family:"Rubik Bold",src:"fonts/Rubik-Bold.woff2"},{family:"Rubik Black",src:"fonts/Rubik-Black.woff2"},{family:"Bebas Neue Light",src:"fonts/BebasNeueLight.woff2"},{family:"Bebas Neue Regular",src:"fonts/BebasNeueRegular.woff2"},{family:"Bebas Neue Book",src:"fonts/BebasNeueBook.woff2"},{family:"Bebas Neue Bold",src:"fonts/BebasNeueBold.woff2"},{family:"Fira Sans",src:"fonts/fira-sans-v11-latin-ext_latin_cyrillic-regular.woff2"},{family:"Lobster",src:"fonts/Lobster.woff2"},{family:"Pacifico",src:"fonts/pacifico-v23-cyrillic_latin-regular.woff2"},{family:"Playfair Display",src:"fonts/playfair-display-v40-cyrillic_latin-regular.woff2"},{family:"Oswald",src:"fonts/oswald-v57-cyrillic_latin-regular.woff2"},{family:"Caveat",src:"fonts/caveat-v23-cyrillic_latin-regular.woff2"}]}},onSave:async function(e,t,n){try{return x(!0),await B(e,t,n,L.current)}catch(e){throw x(!1),e}}};try{T(!1),await bO.show(v,c.current);const e=bO.canvas;e&&e.focus(),T(!0),x(!1)}catch(It){}}catch(It){u.error({id:"EDITOR_INIT_FAILED",message:l("Error initializing editor"),placement:"bottomRight",innerException:It}),M.current=!1,null==t||t()}},[F,S,C,e,k,null==g?void 0:g.locale,null==g?void 0:g.theme,null==g?void 0:g.baseUrl,null==g?void 0:g.assetsUrl,t,B,u,p,l]);o.useEffect(()=>{e&&C&&k&&V()},[e,C,k,V]),o.useEffect(()=>{if(!e){try{bO.close()}catch(It){}x(!1),_(null),A(""),M.current=!1,E(!1),T(!1)}return()=>{try{bO.close()}catch(It){}}},[e]);const H=Boolean(null==F?void 0:F.id)&&!1!==(null===(s=null==g?void 0:g.features)||void 0===s?void 0:s.enableUpdateFile);return(0,i.jsx)(j.A,{title:(null==F?void 0:F.name)?l("Editing: {{name}}",{name:F.name}):l("Editing image"),open:e,closeIcon:null,onCancel:t,afterOpenChange:e=>E(e),forceRender:!0,width:"100vw",style:{top:0,height:"100vh",maxWidth:"none",padding:10},styles:{body:{height:"85vh",padding:0}},footer:[(0,i.jsx)(m.Ay,{onClick:t,disabled:!k||w,children:l("Cancel")},"cancel"),(0,i.jsx)(m.Ay,{type:"primary",onClick:()=>U("saveCopy"),loading:w,children:l("Save as copy and choose")},"save-copy"),...H?[(0,i.jsx)(m.Ay,{type:"primary",onClick:()=>U("save"),loading:w,children:l("Save and choose")},"save")]:[]],maskClosable:!1,destroyOnHidden:!1,afterClose:()=>{v&&v("")},children:(0,i.jsxs)("div",{ref:c,style:{position:"relative",width:"100%",height:"100%"},children:[e&&!I?(0,i.jsx)("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(255,255,255,0.45)",backdropFilter:"blur(1px)",pointerEvents:"all",zIndex:10},children:(0,i.jsx)("span",{style:{fontSize:14,color:"#555"},children:l("Loading editor...")})}):null,w&&I&&(0,i.jsx)(Xa,{style:{position:"absolute",top:0,background:"var(--colorBgLayout)",zIndex:100,opacity:.7}})]})})};const{Text:EO}=f.A,IO=({visible:e,files:t,totalFiles:n,completedFiles:r,onClose:o,onMinimize:a,onInsert:s,minimized:c=!1})=>{var u;const{token:d}=l.A.useToken(),{t:h}=En();if(!e)return null;const f=e=>{switch(e){case"success":return(0,i.jsx)("div",{className:"uploadProgress__status-icon",children:(0,i.jsx)(oe.A,{style:{color:d.colorSuccess}})});case"error":return(0,i.jsx)(ae.A,{style:{color:d.colorError}});default:return(0,i.jsx)(se.A,{style:{color:"#1890ff"}})}};if(c)return(0,i.jsx)("div",{className:"uploadProgress__minimized",children:(0,i.jsx)(m.Ay,{type:"primary",size:"small",onClick:a,className:"uploadProgress__minimized-button",children:h("Upload progress",{completed:r,total:n})})});const p=t.filter(e=>"uploading"===e.status).length,g=t.filter(e=>"success"===e.status).length,v=t.filter(e=>"error"===e.status).length,y=t.filter(e=>"error"===e.status),b=y.length>1&&y.every(e=>{var t;return e.error&&e.error===(null===(t=y[0])||void 0===t?void 0:t.error)}),w=b?null===(u=y[0])||void 0===u?void 0:u.error:null;return(0,i.jsx)("div",{className:"uploadProgress fm-upload-progress",children:(0,i.jsxs)("div",{className:"uploadProgress__card",children:[(0,i.jsxs)("div",{className:"uploadProgress__header",children:[(0,i.jsx)(EO,{strong:!0,className:"uploadProgress__header-title",children:p>0?h("Uploading files",{completed:r,total:n}):g>0?h("Uploaded files",{success:g,total:n}):h("Upload error files",{errorCount:v})}),(0,i.jsx)("div",{className:"uploadProgress__header-buttons",children:(0,i.jsx)(m.Ay,{type:"text",size:"small",icon:(0,i.jsx)(ne.A,{className:"uploadProgress__close-icon"}),onClick:o,className:"uploadProgress__header-button"})})]}),(0,i.jsxs)("div",{className:"uploadProgress__body "+(t.some(e=>"error"===e.status)?"uploadProgress__body--error":""),children:[(0,i.jsx)("div",{className:"uploadProgress__list-wrapper",children:(0,i.jsx)(M.A,{className:"uploadProgress__file-list",size:"small",dataSource:t,renderItem:e=>{const t="error"===e.status,n=t?(e=>{if(!e)return null;const t=e.toLowerCase();return t.includes("type")||t.includes("format")||t.includes("\u0444\u043e\u0440\u043c\u0430\u0442")||t.includes("\u0442\u0438\u043f")||t.includes("not allowed")||t.includes("\u0434\u043e\u0437\u0432\u043e\u043b\u0435\u043d")||t.includes("name")||t.includes("invalid")||t.includes("\u043d\u0430\u0437\u0432\u0430")||t.includes("\u043d\u0435\u043f\u0440\u0438\u043f\u0443\u0441\u0442\u0438\u043c")||t.includes("allowed characters")?null:t.includes("large")||t.includes("size")||t.includes("\u0440\u043e\u0437\u043c\u0456\u0440")||t.includes("\u0440\u0430\u0437\u043c\u0435\u0440")?h("upload_error_hint_size"):t.includes("exists")||t.includes("\u0432\u0436\u0435 \u0456\u0441\u043d\u0443\u0454")||t.includes("\u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442")?h("upload_error_hint_exists"):null})(e.error):null;return(0,i.jsx)(M.A.Item,{className:"uploadProgress__file-item "+(t?"uploadProgress__file-item--error":""),actions:(r=e,"success"===r.status?[(0,i.jsx)(m.Ay,{type:"primary",size:"small",onClick:()=>s(r),children:h("Insert")},"insert")]:[]),children:(0,i.jsx)(M.A.Item.Meta,{avatar:(0,i.jsx)(P.A,{size:"small",icon:f(e.status),className:"uploadProgress__file-avatar"}),title:(0,i.jsxs)("div",{className:"uploadProgress__file-info",children:[(0,i.jsx)(EO,{ellipsis:!0,className:"uploadProgress__file-name",children:e.name}),(0,i.jsx)(EO,{type:"secondary",className:"uploadProgress__file-size",children:void 0!==e.size?Bi(e.size):""})]}),description:"uploading"===e.status?(0,i.jsx)(T.A,{percent:e.progress,size:"small",status:"active",showInfo:!1,className:"uploadProgress__progress-bar"}):t?b?null:(0,i.jsxs)("div",{className:"uploadProgress__error-item",children:[(0,i.jsx)(EO,{type:"danger",className:"uploadProgress__error-message",children:e.error||h("Error")}),n&&(0,i.jsx)(EO,{type:"secondary",className:"uploadProgress__error-hint",children:n})]}):null})});var r}})}),w&&(0,i.jsxs)("div",{className:"uploadProgress__common-error",children:[(0,i.jsxs)("div",{className:"uploadProgress__common-error-row",children:[(0,i.jsx)(ae.A,{style:{color:d.colorError,marginRight:8,flexShrink:0}}),(0,i.jsx)(EO,{type:"danger",children:w})]}),(0,i.jsx)(EO,{type:"secondary",className:"uploadProgress__common-error-hint",children:h("Applies to all {{count}} files",{count:y.length})})]})]})]})})},{Header:jO}=R.A,{Title:TO}=f.A,FO=({activeLibraryItem:e,selectedFolder:t,isTrashFolder:n,onClearTrash:r,files:a,loading:s,onRefresh:l,refreshDisabled:c,showRefresh:u=!1})=>{const{t:d}=En(),h=e===Lt&&(null!=n?n:t===Vt),[f,p]=o.useState(!1),v={[Lt]:d("My files"),[Nt]:d("GIF"),[Dt]:d("Stock images"),[zt]:d("Icons"),[Bt]:d("AI image generation")};let y;return o.useEffect(()=>{const e=setTimeout(()=>{p(h&&a.length>0&&!s)},200);return()=>clearTimeout(e)},[h,a.length,s]),y=e===Lt?h?d("Trash"):t:v[e],(0,i.jsx)(jO,{className:"actions-header",children:(0,i.jsxs)("div",{className:"header-title-container",children:[(0,i.jsx)(TO,{level:5,className:"header-title",children:y}),f&&r&&(0,i.jsx)(m.Ay,{type:"default",onClick:r,className:"clear-trash-button","aria-label":d("Clear Trash"),children:d("Clear")}),e===Lt&&u&&l&&(0,i.jsx)(g.A,{title:d("Refresh"),children:(0,i.jsx)(m.Ay,{type:"text",className:"folder-refresh-button",icon:(0,i.jsx)(Vr,{size:16}),onClick:l,disabled:c})})]})})};var OO=function(e,t){return OO=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},OO(e,t)},MO=function(){return MO=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},MO.apply(this,arguments)},PO="Pixel",RO="Percent",LO={unit:RO,value:.8};function NO(e){return"number"==typeof e?{unit:RO,value:100*e}:"string"==typeof e?e.match(/^(\d*(\.\d+)?)px$/)?{unit:PO,value:parseFloat(e)}:e.match(/^(\d*(\.\d+)?)%$/)?{unit:RO,value:parseFloat(e)}:LO:LO}var DO=function(e){function t(t){var n=e.call(this,t)||this;return n.lastScrollTop=0,n.actionTriggered=!1,n.startY=0,n.currentY=0,n.dragging=!1,n.maxPullDownDistance=0,n.getScrollableTarget=function(){return n.props.scrollableTarget instanceof HTMLElement?n.props.scrollableTarget:"string"==typeof n.props.scrollableTarget?document.getElementById(n.props.scrollableTarget):(n.props.scrollableTarget,null)},n.onStart=function(e){n.lastScrollTop||(n.dragging=!0,e instanceof MouseEvent?n.startY=e.pageY:e instanceof TouchEvent&&(n.startY=e.touches[0].pageY),n.currentY=n.startY,n._infScroll&&(n._infScroll.style.willChange="transform",n._infScroll.style.transition="transform 0.2s cubic-bezier(0,0,0.31,1)"))},n.onMove=function(e){n.dragging&&(e instanceof MouseEvent?n.currentY=e.pageY:e instanceof TouchEvent&&(n.currentY=e.touches[0].pageY),n.currentY<n.startY||(n.currentY-n.startY>=Number(n.props.pullDownToRefreshThreshold)&&n.setState({pullToRefreshThresholdBreached:!0}),n.currentY-n.startY>1.5*n.maxPullDownDistance||n._infScroll&&(n._infScroll.style.overflow="visible",n._infScroll.style.transform="translate3d(0px, "+(n.currentY-n.startY)+"px, 0px)")))},n.onEnd=function(){n.startY=0,n.currentY=0,n.dragging=!1,n.state.pullToRefreshThresholdBreached&&(n.props.refreshFunction&&n.props.refreshFunction(),n.setState({pullToRefreshThresholdBreached:!1})),requestAnimationFrame(function(){n._infScroll&&(n._infScroll.style.overflow="auto",n._infScroll.style.transform="none",n._infScroll.style.willChange="unset")})},n.onScrollListener=function(e){"function"==typeof n.props.onScroll&&setTimeout(function(){return n.props.onScroll&&n.props.onScroll(e)},0);var t=n.props.height||n._scrollableNode?e.target:document.documentElement.scrollTop?document.documentElement:document.body;n.actionTriggered||((n.props.inverse?n.isElementAtTop(t,n.props.scrollThreshold):n.isElementAtBottom(t,n.props.scrollThreshold))&&n.props.hasMore&&(n.actionTriggered=!0,n.setState({showLoader:!0}),n.props.next&&n.props.next()),n.lastScrollTop=t.scrollTop)},n.state={showLoader:!1,pullToRefreshThresholdBreached:!1,prevDataLength:t.dataLength},n.throttledOnScrollListener=function(e,t,n,r){var i,o=!1,a=0;function s(){i&&clearTimeout(i)}function l(){var e=this,l=Date.now()-a,c=arguments;function u(){a=Date.now(),n.apply(e,c)}o||(r&&!i&&u(),s(),void 0===r&&l>150?u():!0!==t&&(i=setTimeout(r?function(){i=void 0}:u,void 0===r?150-l:150)))}return"boolean"!=typeof t&&(r=n,n=t,t=void 0),l.cancel=function(){s(),o=!0},l}(0,n.onScrollListener).bind(n),n.onStart=n.onStart.bind(n),n.onMove=n.onMove.bind(n),n.onEnd=n.onEnd.bind(n),n}return function(e,t){function n(){this.constructor=e}OO(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.componentDidMount=function(){if(void 0===this.props.dataLength)throw new Error('mandatory prop "dataLength" is missing. The prop is needed when loading more content. Check README.md for usage');if(this._scrollableNode=this.getScrollableTarget(),this.el=this.props.height?this._infScroll:this._scrollableNode||window,this.el&&this.el.addEventListener("scroll",this.throttledOnScrollListener),"number"==typeof this.props.initialScrollY&&this.el&&this.el instanceof HTMLElement&&this.el.scrollHeight>this.props.initialScrollY&&this.el.scrollTo(0,this.props.initialScrollY),this.props.pullDownToRefresh&&this.el&&(this.el.addEventListener("touchstart",this.onStart),this.el.addEventListener("touchmove",this.onMove),this.el.addEventListener("touchend",this.onEnd),this.el.addEventListener("mousedown",this.onStart),this.el.addEventListener("mousemove",this.onMove),this.el.addEventListener("mouseup",this.onEnd),this.maxPullDownDistance=this._pullDown&&this._pullDown.firstChild&&this._pullDown.firstChild.getBoundingClientRect().height||0,this.forceUpdate(),"function"!=typeof this.props.refreshFunction))throw new Error('Mandatory prop "refreshFunction" missing.\n Pull Down To Refresh functionality will not work\n as expected. Check README.md for usage\'')},t.prototype.componentWillUnmount=function(){this.el&&(this.el.removeEventListener("scroll",this.throttledOnScrollListener),this.props.pullDownToRefresh&&(this.el.removeEventListener("touchstart",this.onStart),this.el.removeEventListener("touchmove",this.onMove),this.el.removeEventListener("touchend",this.onEnd),this.el.removeEventListener("mousedown",this.onStart),this.el.removeEventListener("mousemove",this.onMove),this.el.removeEventListener("mouseup",this.onEnd)))},t.prototype.componentDidUpdate=function(e){this.props.dataLength!==e.dataLength&&(this.actionTriggered=!1,this.setState({showLoader:!1}))},t.getDerivedStateFromProps=function(e,t){return e.dataLength!==t.prevDataLength?MO(MO({},t),{prevDataLength:e.dataLength}):null},t.prototype.isElementAtTop=function(e,t){void 0===t&&(t=.8);var n=e===document.body||e===document.documentElement?window.screen.availHeight:e.clientHeight,r=NO(t);return r.unit===PO?e.scrollTop<=r.value+n-e.scrollHeight+1:e.scrollTop<=r.value/100+n-e.scrollHeight+1},t.prototype.isElementAtBottom=function(e,t){void 0===t&&(t=.8);var n=e===document.body||e===document.documentElement?window.screen.availHeight:e.clientHeight,r=NO(t);return r.unit===PO?e.scrollTop+n>=e.scrollHeight-r.value:e.scrollTop+n>=r.value/100*e.scrollHeight},t.prototype.render=function(){var e=this,t=MO({height:this.props.height||"auto",overflow:"auto",WebkitOverflowScrolling:"touch"},this.props.style),n=this.props.hasChildren||!!(this.props.children&&this.props.children instanceof Array&&this.props.children.length),r=this.props.pullDownToRefresh&&this.props.height?{overflow:"auto"}:{};return o.createElement("div",{style:r,className:"infinite-scroll-component__outerdiv"},o.createElement("div",{className:"infinite-scroll-component "+(this.props.className||""),ref:function(t){return e._infScroll=t},style:t},this.props.pullDownToRefresh&&o.createElement("div",{style:{position:"relative"},ref:function(t){return e._pullDown=t}},o.createElement("div",{style:{position:"absolute",left:0,right:0,top:-1*this.maxPullDownDistance}},this.state.pullToRefreshThresholdBreached?this.props.releaseToRefreshContent:this.props.pullDownToRefreshContent)),this.props.children,!this.state.showLoader&&!n&&this.props.hasMore&&this.props.loader,this.state.showLoader&&this.props.hasMore&&this.props.loader,!this.props.hasMore&&this.props.endMessage))},t}(o.Component);function zO(){return zO=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},zO.apply(this,arguments)}function BO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function UO(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?BO(Object(n),!0).forEach(function(t){VO(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BO(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function VO(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class HO extends o.Component{constructor(e){let t;super(e),this.reCalculateColumnCount=this.reCalculateColumnCount.bind(this),this.reCalculateColumnCountDebounce=this.reCalculateColumnCountDebounce.bind(this),t=this.props.breakpointCols&&this.props.breakpointCols.default?this.props.breakpointCols.default:parseInt(this.props.breakpointCols)||2,this.state={columnCount:t}}componentDidMount(){this.reCalculateColumnCount(),window&&window.addEventListener("resize",this.reCalculateColumnCountDebounce)}componentDidUpdate(){this.reCalculateColumnCount()}componentWillUnmount(){window&&window.removeEventListener("resize",this.reCalculateColumnCountDebounce)}reCalculateColumnCountDebounce(){window&&window.requestAnimationFrame?(window.cancelAnimationFrame&&window.cancelAnimationFrame(this._lastRecalculateAnimationFrame),this._lastRecalculateAnimationFrame=window.requestAnimationFrame(()=>{this.reCalculateColumnCount()})):this.reCalculateColumnCount()}reCalculateColumnCount(){const e=window&&window.innerWidth||1/0;let t=this.props.breakpointCols;"object"!=typeof t&&(t={default:parseInt(t)||2});let n=1/0,r=t.default||2;for(let i in t){const o=parseInt(i);o>0&&e<=o&&o<n&&(n=o,r=t[i])}r=Math.max(1,parseInt(r)||1),this.state.columnCount!==r&&this.setState({columnCount:r})}itemsInColumns(){const e=this.state.columnCount,t=new Array(e),n=o.Children.toArray(this.props.children);for(let r=0;r<n.length;r++){const i=r%e;t[i]||(t[i]=[]),t[i].push(n[r])}return t}renderColumns(){const{column:e,columnAttrs:t={},columnClassName:n}=this.props,r=this.itemsInColumns(),i=100/r.length+"%";let a=n;a&&"string"!=typeof a&&(this.logDeprecated('The property "columnClassName" requires a string'),void 0===a&&(a="my-masonry-grid_column"));const s=UO(UO(UO({},e),t),{},{style:UO(UO({},t.style),{},{width:i}),className:a});return r.map((e,t)=>o.createElement("div",zO({},s,{key:t}),e))}logDeprecated(e){}render(){const e=this.props,{children:t,breakpointCols:n,columnClassName:r,columnAttrs:i,column:a,className:s}=e,l=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,["children","breakpointCols","columnClassName","columnAttrs","column","className"]);let c=s;return"string"!=typeof s&&(this.logDeprecated('The property "className" requires a string'),void 0===s&&(c="my-masonry-grid")),o.createElement("div",zO({},l,{className:c}),this.renderColumns())}}HO.defaultProps={breakpointCols:void 0,className:void 0,columnClassName:void 0,children:void 0,columnAttrs:void 0,column:void 0};var WO={gifTab:"gifTab",scrollableDiv:"scrollableDiv",gifSearchInput:"gifSearchInput",search:"search",searchResults:"searchResults",myMasonryGrid:"myMasonryGrid",myMasonryGridColumn:"myMasonryGridColumn",listItem:"listItem",loaded:"loaded",loadedImage:"loadedImage",searchOutputWrapper:"searchOutputWrapper",divider:"divider",resultsContainer:"resultsContainer",playButton:"playButton",title:"title",subtitle:"subtitle"};const $O={default:4,1600:3,1100:2,700:1},GO=({setImageGifList:e,imageGifList:t=[],currentReqGif:n,setCurrentReqGif:r,inputRef:a,customRequest:l})=>{const{t:c}=En(),{GifPlayIcon:u}=ji(),{options:f}=Ei(),{config:p}=f,[g,m]=(0,o.useState)(null),[v,y]=(0,o.useState)(!1),[b,w]=(0,o.useState)(25),[x,C]=(0,o.useState)(null),[_]=d.A.useForm(),S=(0,o.useRef)(n);(0,o.useEffect)(()=>{_.setFieldsValue({keywords:n.keywords})},[]);const A=null==p?void 0:p.handleProxyUrl,k=async e=>A?Promise.resolve(A(e)):e,E=async e=>Promise.all(e.map(async e=>Object.assign(Object.assign({},e),{images:Object.assign(Object.assign({},e.images),{downsized:Object.assign(Object.assign({},e.images.downsized),{url:await k(e.images.downsized.url)})})}))),I=async function({query:e,page:t}){var n;const r=e.keywords.replace(/[^\w\s\u0430-\u044f\u0451\u0410-\u042f\u0401]|_/g,"").replace(/[\s_-]+/g," ");try{const e=`https://api.giphy.com/v1/gifs/search?api_key=${null!==(n=null==p?void 0:p.REACT_APP_GIPHY_KEY)&&void 0!==n?n:"Nh77eBlPeMn1ed9MBAvL542NUGeNO26F"}&q=${encodeURIComponent(r)}&limit=25&offset=${t}&lang=en`,i=await fetch(await k(e));return{data:await i.json()}}catch(e){}},j=async()=>{var t,n;const r=await I({query:S.current,page:0});(null===(n=null===(t=null==r?void 0:r.data)||void 0===t?void 0:t.data)||void 0===n?void 0:n.length)&&r.data.data.length>0&&e(await E(r.data.data))};return(0,o.useEffect)(()=>()=>{x&&clearTimeout(x)},[x]),(0,i.jsx)("div",{className:WO.gifTab,children:(0,i.jsx)("div",{className:WO.searchOutputWrapper,children:(0,i.jsxs)("div",{id:"scrollableDiv",className:WO.scrollableDiv,children:[(0,i.jsxs)(d.A,{form:_,onValuesChange:e=>{if(void 0!==e.keywords){const t=Object.assign(Object.assign({},S.current),{keywords:e.keywords});r(t),S.current=t,x&&clearTimeout(x);const n=setTimeout(j,800);C(n)}},className:t.length>0?WO.searchResults:WO.search,children:[(0,i.jsx)(d.A.Item,{name:"keywords",className:WO.gifSearchInput,children:(0,i.jsx)(h.A,{onKeyDown:e=>"Space"===e.code&&j(),onPressEnter:e=>j(),allowClear:!0,placeholder:c("Search GIFs"),ref:a,spellCheck:"false",prefix:(0,i.jsx)(Wr,{size:16,strokeWidth:null==p?void 0:p.iconStrokeWidth,onClick:j})})}),t.length>0&&!v&&(0,i.jsx)("div",{className:`ant-divider ${WO.divider}`,role:"separator"})]}),!t.length&&!v&&(0,i.jsx)(i.Fragment,{children:n.keywords?(0,i.jsx)(Ti,{}):(0,i.jsxs)("div",{className:WO.resultsContainer,children:[(0,i.jsx)("div",{className:WO.videoIcon,children:(0,i.jsx)(u,{className:WO.playButton})}),(0,i.jsx)("h1",{className:WO.title,children:c("Over 350,000 live images")}),(0,i.jsx)("p",{className:WO.subtitle,children:c("Enter a search query and we'll find the perfect image for you")})]})}),!t.length&&v&&(0,i.jsx)(Xa,{}),t.length>0&&(0,i.jsx)(DO,{dataLength:t&&t.length,next:async()=>{v||(y(!0),I({query:S.current,page:b}).then(async t=>{if(t&&t.data&&t.data.data){const n=await E(t.data.data);e(e=>[...e,...n])}y(!1),w(e=>e+25)}).catch(()=>{y(!1)}))},hasMore:!!t,endMessage:(0,i.jsxs)(O.A,{plain:!0,children:[c("That`s all we could find.")," \ud83e\udd10"]}),scrollableTarget:"scrollableDiv",style:{overflow:"visible"},loader:(0,i.jsx)(Xa,{}),children:(0,i.jsx)(HO,{breakpointCols:$O,className:WO.myMasonryGrid,columnClassName:WO.myMasonryGridColumn,children:t.map((e,t)=>(0,i.jsxs)("div",{className:WO.listItem,onClick:()=>(async(e,t)=>{var n;m(t),setTimeout(()=>{m(null)},2e3);let r=e.split("?")[0].split("#")[0].split("/"),i=r[r.length-1]||"uploaded-file";i.includes(".")&&(null===(n=i.split(".").pop())||void 0===n?void 0:n.length)&&i.split(".").pop().length<=5||(i+=".gif"),l(e,i)})(e.images.downsized.url,e.id,e.title),children:[(0,i.jsx)("img",{className:g===e.id?WO.loadedImage:"",width:"100%",src:e.images.downsized.url,alt:e.title,onLoad:e=>{const t=e.target.parentNode;t&&t instanceof HTMLElement&&t.classList.add(WO.loaded)}}),(0,i.jsx)("a",{rel:"noreferrer",href:"https://giphy.com/",target:"_blank",onClick:e=>e.stopPropagation()}),g===e.id&&(0,i.jsx)(s.A,{className:WO.antSpin})]},e.id+t))})})]})})})};var qO={stockTab:"stockTab",stockSearchInput:"stockSearchInput",searchOutputWrapper:"searchOutputWrapper",divider:"divider",search:"search",searchResults:"searchResults",scrollableDiv:"scrollableDiv",myMasonryGrid:"myMasonryGrid",myMasonryGridColumn:"myMasonryGridColumn",listItem:"listItem",loaded:"loaded",loadedImage:"loadedImage",creatorInfo:"creatorInfo",stockColorFilter:"stockColorFilter",allColors:"allColors",blackColor:"blackColor",bwColor:"bwColor",whiteColor:"whiteColor",orangeColor:"orangeColor",redColor:"redColor",purpleColor:"purpleColor",magentaColor:"magentaColor",greenColor:"greenColor",tealColor:"tealColor",blueColor:"blueColor",resultsContainer:"resultsContainer",playButton:"playButton",title:"title",subtitle:"subtitle"};const YO={default:4,1600:3,1100:2,700:1},XO=(e,t)=>{const n=new URL(e);return n.searchParams.set("w",t.toString()),n.toString()},KO=({imageStockList:e,setImageStockList:t,currentReq:n,setCurrentReq:r,inputRef:a,customRequest:l})=>{var c,u,f;const{t:p}=En(),{StockBigIcon:m,MixedViewIcon:v,LandscapeViewIcon:y,PortraitViewIcon:b,SquareViewIcon:w}=ji(),{options:x}=Ei(),{config:_}=x,[A,k]=(0,o.useState)(!1),[E,I]=(0,o.useState)(2),[j,T]=(0,o.useState)(null),[F,M]=(0,o.useState)(null),[P,R]=(0,o.useState)(!0),[N]=d.A.useForm(),D=null==_?void 0:_.handleProxyUrl,z=null!==(c=null==_?void 0:_.UNSPLASH_KEY)&&void 0!==c?c:"HX2_qqq3F3ljmtYtfmb9P6h0dn2u9mnnOl36IdV8el0",B=(null===(u=null==_?void 0:_.locale)||void 0===u?void 0:u.slice(0,2))||"ru",U=(0,o.useRef)(n),V=async e=>D?Promise.resolve(D(e)):e,H=async e=>Promise.all(e.map(async e=>Object.assign(Object.assign({},e),{urls:{raw:await V(XO(e.urls.raw,1200)),small:await V(XO(e.urls.raw,540))}})));(0,o.useEffect)(()=>{U.current=n},[n]),(0,o.useEffect)(()=>{0===e.length&&N.setFieldsValue({color:"",orientation:""})},[e,N]),(0,o.useEffect)(()=>{N.setFieldsValue({keywords:n.keywords,color:n.color,orientation:n.orientation})},[]);const W=async function({query:e,page:t}){const n=e.keywords.replace(/[^\w\s\u0430-\u044f\u0451\u0410-\u042f\u0401]|_/g,"").replace(/[\s_-]+/g," ");try{let r=`https://api.unsplash.com/search/photos?client_id=${z}&lang=${B}&per_page=18&query=${encodeURIComponent(n)}&page=${t}`;""!==e.color&&(r+=`&color=${e.color}`),""!==e.orientation&&(r+=`&orientation=${e.orientation}`);const i=await fetch(await V(r));return{data:await i.json()}}catch(e){}finally{k(!1)}},$=async()=>{var e,n,r;k(!0);const i=await W({query:U.current,page:1});(null===(e=null==i?void 0:i.data)||void 0===e?void 0:e.results)&&(t(await H(i.data.results)),R(18===i.data.results.length),(null===(r=null===(n=null==i?void 0:i.data)||void 0===n?void 0:n.results)||void 0===r?void 0:r.length)&&i.data.results.length>0&&I(2))};(0,o.useEffect)(()=>()=>{F&&clearTimeout(F)},[F]);return(0,i.jsx)("div",{className:qO.stockTab,children:(0,i.jsx)("div",{className:qO.searchOutputWrapper,children:(0,i.jsxs)("div",{className:qO.scrollableDiv,id:"scrollableDiv",children:[(0,i.jsxs)(d.A,{form:N,initialValues:Zt,onValuesChange:(t,n)=>{const i=Object.assign(Object.assign({},Zt),n);if(r(i),U.current=i,F&&clearTimeout(F),""!==n.keywords){const e=setTimeout($,800);M(e)}else e.length||(r(Object.assign({},Zt)),U.current=Zt,N.resetFields())},className:e.length>0?qO.searchResults:qO.search,children:[(0,i.jsxs)(S.A,{gutter:24,children:[(0,i.jsx)(C.A,{span:e.length>0?void 0:24,children:(0,i.jsx)(d.A.Item,{name:"keywords",className:qO.stockSearchInput,children:(0,i.jsx)(h.A,{allowClear:!0,placeholder:p("Search image"),ref:a,spellCheck:"false",prefix:(0,i.jsx)(Wr,{size:16,strokeWidth:null==_?void 0:_.iconStrokeWidth})})})}),!!e.length&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(C.A,{children:(0,i.jsx)(d.A.Item,{name:"orientation",children:(0,i.jsxs)(L.Ay.Group,{onChange:e=>r(t=>Object.assign(Object.assign({},t),{orientation:e.target.value})),children:[(0,i.jsx)(g.A,{title:p("All"),placement:"top",children:(0,i.jsx)(L.Ay.Button,{value:"",children:(0,i.jsx)(v,{})})}),(0,i.jsx)(g.A,{title:p("Landscape"),placement:"top",children:(0,i.jsx)(L.Ay.Button,{value:"landscape",children:(0,i.jsx)(y,{})})}),(0,i.jsx)(g.A,{title:p("Portrait"),placement:"top",children:(0,i.jsx)(L.Ay.Button,{value:"portrait",children:(0,i.jsx)(b,{})})}),(0,i.jsx)(g.A,{title:p("Squarish"),placement:"top",children:(0,i.jsx)(L.Ay.Button,{value:"squarish",children:(0,i.jsx)(w,{})})})]})})}),(0,i.jsx)(C.A,{children:(0,i.jsx)(d.A.Item,{name:"color",children:(0,i.jsxs)(L.Ay.Group,{className:qO.stockColorFilter,onChange:e=>r(t=>Object.assign(Object.assign({},t),{color:e.target.value})),children:[(0,i.jsx)(g.A,{title:p("All"),placement:"top",children:(0,i.jsx)(L.Ay.Button,{className:qO.allColors,value:"",children:"All"})}),(0,i.jsx)(g.A,{title:p("Black"),placement:"top",children:(0,i.jsx)(L.Ay.Button,{className:qO.blackColor,value:"black",children:"B"})}),(0,i.jsx)(g.A,{title:p("Black and White"),placement:"top",children:(0,i.jsx)(L.Ay.Button,{className:qO.bwColor,value:"black_and_white",children:"B&W"})}),(0,i.jsx)(g.A,{title:p("White"),placement:"top",children:(0,i.jsx)(L.Ay.Button,{className:qO.whiteColor,value:"white",children:"W"})}),(0,i.jsx)(g.A,{title:p("Orange"),placement:"top",children:(0,i.jsx)(L.Ay.Button,{className:qO.orangeColor,value:"orange",children:"O"})}),(0,i.jsx)(g.A,{title:p("Red"),placement:"top",children:(0,i.jsx)(L.Ay.Button,{className:qO.redColor,value:"red",children:"R"})}),(0,i.jsx)(g.A,{title:p("Purple"),placement:"top",children:(0,i.jsx)(L.Ay.Button,{className:qO.purpleColor,value:"purple",children:"P"})}),(0,i.jsx)(g.A,{title:p("Magenta"),placement:"top",children:(0,i.jsx)(L.Ay.Button,{className:qO.magentaColor,value:"magenta",children:"M"})}),(0,i.jsx)(g.A,{title:p("Green"),placement:"top",children:(0,i.jsx)(L.Ay.Button,{className:qO.greenColor,value:"green",children:"G"})}),(0,i.jsx)(g.A,{title:p("Teal"),placement:"top",children:(0,i.jsx)(L.Ay.Button,{className:qO.tealColor,value:"teal",children:"T"})}),(0,i.jsx)(g.A,{title:p("Blue"),placement:"top",children:(0,i.jsx)(L.Ay.Button,{className:qO.blueColor,value:"blue",children:"B"})})]})})})]})]}),e.length>0&&!A&&(0,i.jsx)("div",{className:`ant-divider ${qO.divider}`,role:"separator"})]}),!e.length&&!A&&(0,i.jsx)(i.Fragment,{children:n.keywords?(0,i.jsx)(Ti,{}):(0,i.jsxs)("div",{className:qO.resultsContainer,children:[(0,i.jsx)("div",{className:qO.videoIcon,children:(0,i.jsx)(m,{className:qO.playButton})}),(0,i.jsx)("h1",{className:qO.title,children:p("Millions of free stock images")}),(0,i.jsx)("p",{className:qO.subtitle,children:p("Enter a search query and we'll find the perfect image for you")})]})}),!e.length&&A&&(0,i.jsx)(Xa,{}),e.length>0&&(0,i.jsx)(DO,{dataLength:e&&e.length,next:async()=>{if(A||""===U.current.keywords)return k(!1),void(""===U.current.keywords&&R(!1));k(!0),W({query:U.current,page:E}).then(async e=>{if(e&&e.data&&e.data.results){const n=await H(e.data.results);t(e=>[...e,...n]),R(18===e.data.results.length)}I(e=>e+1)}).catch(e=>{}).finally(()=>{k(!1)})},hasMore:P&&""!==(null===(f=U.current)||void 0===f?void 0:f.keywords),endMessage:(0,i.jsxs)(O.A,{plain:!0,children:[p("That`s all we could find.")," \ud83e\udd10"]}),scrollableTarget:"scrollableDiv",style:{overflow:"visible"},loader:(0,i.jsx)(Xa,{}),children:(0,i.jsx)(HO,{breakpointCols:YO,className:qO.myMasonryGrid,columnClassName:qO.myMasonryGridColumn,children:e.map((e,t)=>(0,i.jsxs)("div",{className:qO.listItem,onClick:()=>(async(e,t,n)=>{var r;!async function(e){try{const t=`${e}${e.includes("?")?"&":"?"}client_id=${z}`,n=await V(t),r=await fetch(n);return{data:await r.json()}}catch(e){}}(t.download_location),T(n),setTimeout(()=>T(null),2e3);const i=e.raw,o=i.split("?")[0].split("#")[0].split("/");let a=o[o.length-1]||"uploaded-file";a.includes(".")&&(null===(r=a.split(".").pop())||void 0===r?void 0:r.length)&&a.split(".").pop().length<=5||(a+=".jpg"),l(i,a)})(e.urls,e.links,e.id,e.description),children:[(0,i.jsx)("img",{className:j===e.id?qO.loadedImage:"",width:"100%",src:e.urls.small,alt:e.description,onLoad:e=>{const t=e.target.parentNode;t&&t instanceof HTMLElement&&t.classList.add(qO.loaded)}}),(0,i.jsxs)("p",{className:qO.creatorInfo,onClick:e=>e.stopPropagation(),children:[p("Photo by")," ",(0,i.jsx)("a",{target:"_blank",href:`${e.user.links.html}?utm_source=${null==_?void 0:_.APP_NAME_UNSPLASH}&utm_medium=referral`,rel:"noreferrer",children:e.user.name})," ",p("on")," ",(0,i.jsx)("a",{target:"_blank",href:`https://unsplash.com/?utm_source=${null==_?void 0:_.APP_NAME_UNSPLASH}&utm_medium=referral`,rel:"noreferrer",children:"Unsplash"})]}),j===e.id&&(0,i.jsx)(s.A,{className:qO.antSpin})]},e.id+t))})})]})})})};const ZO=({images:e,transitionDuration:t=1e3,frameHeight:n})=>{const[r,a]=(0,o.useState)([]),[s,l]=(0,o.useState)(n);(0,o.useEffect)(()=>{const e=()=>{if("undefined"==typeof window)return void l(n);const e=window.innerHeight,t=Math.max(e-260,130);if("number"==typeof n){const e=Math.min(n,t);l(e)}else l(t)};if(e(),"undefined"!=typeof window)return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[n]);const c=()=>{a(e=>e.map((t,n)=>n===e.length-1?Object.assign(Object.assign({},t),{opacity:1}):t))};return(0,o.useEffect)(()=>{if(e.length>0){const t=e[e.length-1];a(e=>[...e,{src:t,opacity:0}]),setTimeout(c,1e3)}else a([])},[e]),(0,i.jsx)("div",{className:"slideshowContainer",style:{height:s,minHeight:130},children:r.map((e,n)=>(0,i.jsx)("img",{src:`data:image/jpeg;base64, ${e.src}`,alt:`Slide ${n+1}`,className:"slideshowImage",style:{opacity:e.opacity,transition:`opacity ${t}ms linear`,display:"block"}},n))})},JO=e=>{var{className:t,style:n,color:r,text:o,bordered:a}=e,s=Ca(e,["className","style","color","text","bordered"]);const l=o||"";return(0,i.jsx)(N.A,Object.assign({style:n,color:r,bordered:a,className:t},s,{children:l}))},QO=({text:e,counter:t,limits:n,wrapperStyles:r})=>{const{t:o}=En(),{options:a}=Ei(),s=a.config,{token:c}=l.A.useToken(),u=+n>0,d=!u||t<+n,h=(null==s?void 0:s.billingPageUrl)||"/billing",f=t+" "+o("of")+" "+(u?n:"\u221e")+" "+(e||o("tests",{count:n}))+" "+o("was used",{count:t});return(0,i.jsxs)("div",{className:"limits-couter-wrapper",style:r,children:[(0,i.jsx)(JO,{bordered:!1,text:f,className:"limit-counter",style:{color:d?c.colorText:"white"},color:d?c.colorFillSecondary:"rgb(255, 77, 79)"}),u&&(0,i.jsx)("div",{style:{fontSize:14,textDecoration:"underline",cursor:"pointer"},onClick:()=>window.location.assign(h),children:o("Need more?")})]})};var eM={imageAi:"imageAi",imageAiExample:"imageAiExample",imageItem:"imageItem",textAreaInputHybrid:"textAreaInputHybrid",loading:"loading",carousel:"carousel",arrow:"arrow",arrowNext:"arrowNext",arrowPrev:"arrowPrev",arrowBtn:"arrowBtn",arrowBtnNext:"arrowBtnNext",arrowBtnPrev:"arrowBtnPrev",row:"row",inputAffixWrapper:"inputAffixWrapper",textarea:"textarea",inputIcon:"inputIcon"};const tM=(0,o.memo)(({className:e,onClick:t})=>(0,i.jsx)("div",{className:`${eM.arrow} ${eM.arrowNext} ${e||""}`,onClick:t,children:(0,i.jsx)(m.Ay,{className:`${eM.arrowBtn} ${eM.arrowBtnNext}`,size:"large",icon:(0,i.jsx)(le.A,{})})}));tM.displayName="SampleNextArrow";const nM=(0,o.memo)(({className:e,onClick:t})=>(0,i.jsx)("div",{className:`${eM.arrow} ${eM.arrowPrev} ${e||""}`,onClick:t,children:(0,i.jsx)(m.Ay,{className:`${eM.arrowBtn} ${eM.arrowBtnPrev}`,size:"large",icon:(0,i.jsx)(ce.A,{})})}));nM.displayName="SamplePrevArrow";const rM=({customRequest:e,inputAiRef:t,isImageUploaded:n,setIsImageUploaded:r,aiImageRequest:a,setAiImageRequest:s,imageAiList:l,setImageAiList:c,isLoadingAi:u,setIsLoadingAi:f})=>{const{t:p}=En(),{AiIcon_2:g}=ji(),v=o.useRef(null),[y,b]=(0,o.useState)("auto"),{aiImageCounter:w,currentAiImgLimits:x,loadingDuringGeneration:_,requestStatus:A,handleGenerate:k,convertBase64ToFile:E,isShiftPressed:I,setIsShiftPressed:j,limitsInPlugin:T}=function({setFrameHeight:e,customRequest:t,aiTabRef:n,isImageUploaded:r,setIsImageUploaded:i,aiImageRequest:a,imageAiList:s,setImageAiList:l,isLoadingAi:c,setIsLoadingAi:u}){const{t:d}=En(),{options:h}=Ei(),f=h.config,p=Ni(),g=(()=>{const{options:e}=Ei(),t=e.config;return(0,o.useCallback)((e,n)=>{!1!==(null==t?void 0:t.pushToGTM)&&((e,t)=>{const n=()=>{try{const t=Object.assign(Object.assign({},e),{appLabel:"blocks_app"});window.dataLayer&&"function"==typeof window.dataLayer.push&&window.dataLayer.push(t)}catch(e){}};t?setTimeout(n,t):n()})(e,n)},[null==t?void 0:t.pushToGTM])})(),{messages:m}=h.config,[v,y]=(0,o.useState)([]),[b,w]=(0,o.useState)(0),[x,C]=(0,o.useState)(null),[_,S]=(0,o.useState)(!1),[A,k]=(0,o.useState)(d("Evaluating the task")),[E,I]=(0,o.useState)(!1),j=(0,o.useRef)(new Set),T=(0,o.useRef)(new Set),F=(0,o.useRef)(new Set);(0,o.useEffect)(()=>{y(m)},[m]),(0,o.useEffect)(()=>{s.length||x||(y([]),j.current.clear(),T.current.clear(),F.current.clear(),P.current=-1)},[s,x]);const O=(0,o.useMemo)(()=>f&&"function"==typeof(null==f?void 0:f.sendAIImageRequest)?null==f?void 0:f.sendAIImageRequest:()=>Promise.resolve({}),[f]),M=(0,o.useCallback)(e=>{const t=`${x}-${e.progress}-${JSON.stringify(e.images||e.data)}`;if(!F.current.has(t))if(F.current.add(t),"error"!==e.status&&"Canceled"!==e.status){if(e.images){if(k(String(e.status)),100===e.progress){u(!1),l(e.images);const t=x,n=Array.isArray(e.images)?e.images:[];n.length>0&&t&&!j.current.has(t)&&(j.current.add(t),p.success({id:"AI_IMAGE_GENERERATION_SUCCESS",message:d("Images generated successfully"),placement:"bottomRight",data:{request:a,taskId:t,images:n}})),C(null),I(!1)}}else if(e.data&&(l([String(e.data)]),100===e.progress)){u(!1);const t=x,n=e.data?[String(e.data)]:[];n.length>0&&t&&!j.current.has(t)&&(j.current.add(t),p.success({id:"AI_IMAGE_GENERERATION_SUCCESS",message:d("Images generated successfully"),placement:"bottomRight",data:{request:a,taskId:t,images:n}})),C(null),I(!1)}}else u(!1),I(!1),x&&!T.current.has(x)&&(T.current.add(x),p.error({id:"AI_RESPONSE_INVALID",message:d("Something went wrong, please try again"),placement:"bottomRight",description:String(x)||void 0,data:{requestId:x,request:a,response:e},innerException:e}))},[a,l,k,d,u,x,p,I]),P=(0,o.useRef)(-1);(0,o.useEffect)(()=>{if(v.length>0){const e=v.length-1;e>P.current&&(P.current=e,M(v[e]))}},[M,v]);const R=(0,o.useMemo)(()=>{if(f&&"function"==typeof(null==f?void 0:f.sseQuery)){const e=null==f?void 0:f.sseQuery;return t=>e(t)}return e=>{}},[f]),L=(0,o.useMemo)(()=>f&&"object"==typeof(null==f?void 0:f.handleLimitUsageEmitter)?null==f?void 0:f.handleLimitUsageEmitter:{fire:()=>{}},[f]),N=null==f?void 0:f.elementId,{projectId:D}=f,{limits:z}=(null==f?void 0:f.limits)?f:{limits:{ai_img_limit:0}},{ai_img_limit:B}=z,U=B>0&&b>=B,V=!(!(null==f?void 0:f.limits)||!f.counters)&&false,H=(0,o.useCallback)(()=>{L.fire({name:"AiImgCount",count:b+1})},[L,b]),W=(0,o.useMemo)(()=>!U&&!V,[U,V,b,B]),$=(0,o.useCallback)(async()=>{k(d("Evaluating the task")),""===a||c||(u(!0),I(!0),l([]),y([]),g({event:"submit_form",action:"ai_image_generation",entity_id:N,project_id:D}),O({body:{project_id:D,request:"create-image",connection:"midjourney",message:a}}).then(e=>{var t,n,r,i,o;const{data:s,error:l}=e||{};if(l)throw l;const c=s;if(401===(null==c?void 0:c.status)||401===(null===(t=null==c?void 0:c.data)||void 0===t?void 0:t.status))throw new Error("ERROR");const h=(null==c?void 0:c.task)||(null===(n=null==c?void 0:c.data)||void 0===n?void 0:n.task),f=null!==(i=null!==(r=null==h?void 0:h.id)&&void 0!==r?r:x)&&void 0!==i?i:void 0;200===(null==c?void 0:c.status)||200===(null===(o=null==c?void 0:c.data)||void 0===o?void 0:o.status)?((null==h?void 0:h.id)&&(k(h.message),C(h.id)),(null==c?void 0:c.message)&&p.success({id:"AI_IMAGE_GENERATION_STARTED",message:c.message,placement:"bottomRight",data:{request:a,taskId:f,response:null==c?void 0:c.data}}),R({task_id:null==h?void 0:h.id,entity_id:N})):(u(!1),I(!1),f&&!T.current.has(f)&&(T.current.add(f),p.error({id:"AI_IMAGE_GENERATION_FAILED",message:(null==c?void 0:c.message)||d("Something went wrong, please try again"),placement:"bottomRight",description:a,data:{request:a,taskId:f,response:c},innerException:c})))}).catch(e=>{u(!1),I(!1);const t=e;return((null==t?void 0:t.error)||(null==t?void 0:t.data))&&x&&!T.current.has(x)&&(T.current.add(x),null==p||p.error({id:"AI_IMAGE_GENERATION_FAILED",message:d("Something went wrong, please try again"),placement:"bottomRight",description:a,innerException:e,data:{request:a,taskId:x,response:null==t?void 0:t.data,error:Gi(null==t?void 0:t.error)}})),t}))},[a,c,u,I,l,g,N,D,O,p,R,d,x]),G=(0,o.useCallback)(()=>{W&&$()},[W,V,w,H,$,p,d]);(0,o.useEffect)(()=>{},[f,V]);const q=(0,o.useCallback)(e=>{if(r)return;const n=e.match(/^data:image\/([A-Za-z-+/]+);base64,(.+)$/);if(!n)return;const o=n[1],a=n[2],s=atob(a),l=new Array(s.length);for(let t=0;t<s.length;t++)l[t]=s.charCodeAt(t);const c=new Uint8Array(l),u=new Blob([c],{type:`image/${o}`}),d=new File([u],"image.jpeg",{type:u.type,lastModified:Date.now()});i(!0),(async()=>{try{"function"==typeof t&&await Promise.resolve(t({file:d}))}catch(e){}finally{i(!1)}})()},[r,i,t]);return(0,o.useEffect)(()=>{(c||s.length>0)&&setTimeout(()=>{var t,r;let i=350;if(n.current){const e=null===(t=n.current)||void 0===t?void 0:t.firstChild;e&&e instanceof HTMLElement&&(i=(null===(r=n.current.getBoundingClientRect())||void 0===r?void 0:r.height)-48-e.clientHeight)}e(i)},0)},[n,s.length,c,e]),{aiImageCounter:b,setAiImageCounter:w,currentAiImgLimits:B,isFieldsDisabled:U,canGenerateImage:W,aiImageRequest:a,imageAiList:s,setImageAiList:l,isLoadingAi:c,setIsLoadingAi:u,loadingDuringGeneration:E,setLoadingDuringGeneration:I,requestStatus:A,setRequestStatus:k,handleGenerate:G,handleLimitAiImgCount:H,convertBase64ToFile:q,isShiftPressed:_,setIsShiftPressed:S,currentReqId:x,setCurrentReqId:C,limitsInPlugin:V}}({setFrameHeight:b,customRequest:e,aiTabRef:v,isImageUploaded:n,setIsImageUploaded:r,aiImageRequest:a,imageAiList:l,setImageAiList:c,isLoadingAi:u,setIsLoadingAi:f});(0,o.useEffect)(()=>{},[n]);const[F,O]=(0,o.useState)(!1),M=(0,o.useCallback)(()=>O(!0),[]),P=(0,o.useCallback)(()=>O(!1),[]),R=(0,o.useCallback)(e=>s(e.target.value),[s]),L=(0,o.useCallback)(e=>{"Shift"===e.key?j(!0):"Enter"!==e.key||I||(e.preventDefault(),k())},[I,k,j]),N=(0,o.useCallback)(e=>{"Shift"===e.key&&j(!1)},[j]);return(0,i.jsxs)("div",{className:eM.imageAi,ref:v,children:[T&&(0,i.jsx)(QO,{text:"images",counter:w,limits:x,wrapperStyles:{marginTop:-25}}),(0,i.jsx)(S.A,{gutter:24,className:eM.row,children:(0,i.jsxs)(C.A,{span:24,children:[(0,i.jsx)(d.A.Item,{children:(0,i.jsxs)("span",{className:`ant-input-affix-wrapper ant-input-affix-wrapper-lg ${eM.inputAffixWrapper}${F?" ant-input-affix-wrapper-focused":""}`,children:[(0,i.jsx)(h.A.TextArea,{ref:t,onKeyDown:L,onKeyUp:N,onFocus:M,onBlur:P,autoSize:!0,allowClear:!0,className:`${eM.textAreaInputHybrid} ${eM.textarea}`,placeholder:p("Generate image"),value:a,onChange:R,spellCheck:"false"}),(0,i.jsx)("span",{className:`ant-input-suffix ${eM.inputSuffix}`,children:u||_?(0,i.jsx)(H.A,{className:`${eM.inputIcon} input-icon`,spin:!0}):(0,i.jsx)(g,{className:`${eM.inputIcon} input-icon`,onClick:k})})]})}),(0,i.jsxs)("div",{className:eM.imageAiExample,children:[(0,i.jsx)("span",{children:p("For example:")})," ",p("A beautiful image of a sunset over a calm ocean.")]})]})}),(u||l.length>0)&&(0,i.jsxs)(D.A,{dotPosition:"top",arrows:!0,nextArrow:(0,i.jsx)(tM,{}),prevArrow:(0,i.jsx)(nM,{}),className:eM.carousel,infinite:!1,children:[u&&!l.length&&(0,i.jsx)("div",{className:eM.loading,children:(0,i.jsxs)("div",{className:"spin",children:[(0,i.jsx)(H.A,{style:{fontSize:48},spin:!0}),(0,i.jsx)("p",{className:"status",children:A})]})}),l.length>0&&l.map((e,t)=>(0,i.jsxs)("div",{className:eM.imageItem,children:[(0,i.jsx)(ZO,{images:l,frameHeight:y}),(0,i.jsx)("div",{className:"buttons",children:l.length>0&&!u&&(0,i.jsx)(m.Ay,{onClick:()=>E(`data:image/jpeg;base64, ${e}`),loading:n,icon:(0,i.jsx)(ue.A,{}),children:p("Use this variant")})})]},t))]})]})};var iM={iconsTab:"iconsTab",hasSearch:"hasSearch",iconsSearchFormCenteredContainer:"iconsSearchFormCenteredContainer",iconsSearchFormCentered:"iconsSearchFormCentered",iconsSearchFormInput:"iconsSearchFormInput",iconsSearchFormInputInput:"iconsSearchFormInputInput",iconsSearchResults:"iconsSearchResults",iconsControlsControls:"iconsControlsControls",iconsControls:"iconsControls",iconsControlElement:"iconsControlElement",iconsControlsStrokeWidth:"iconsControlsStrokeWidth",iconsControlsHeader:"iconsControlsHeader",iconsSearchFormSelect:"iconsSearchFormSelect",iconsSearchFormStyleItem:"iconsSearchFormStyleItem",iconsSearchDivider:"iconsSearchDivider",iconsGrid:"iconsGrid",iconsBottomBar:"iconsBottomBar",iconsBottomBarContent:"iconsBottomBarContent",iconsGridEmptyState:"iconsGridEmptyState",resultsContainer:"resultsContainer",playButton:"playButton",title:"title",subtitle:"subtitle",iconsGridInfiniteScroll:"iconsGridInfiniteScroll",iconsGridGrid:"iconsGridGrid",iconsGridItem:"iconsGridItem",iconsGridItemThumbnail:"iconsGridItemThumbnail",iconsGridItemSvg:"iconsGridItemSvg",iconsGridItemImg:"iconsGridItemImg",iconsGridItemName:"iconsGridItemName",iconsGridLoading:"iconsGridLoading",iconsControlsBackButton:"iconsControlsBackButton",iconsGridCheckbox:"iconsGridCheckbox",iconsGridShowCheckboxes:"iconsGridShowCheckboxes",iconsHeaderContainer:"iconsHeaderContainer",iconsHeaderContainerLeft:"iconsHeaderContainerLeft",copyToFolderModalBody:"copyToFolderModalBody",copyToFolderModalLoadingOverlay:"copyToFolderModalLoadingOverlay"};const oM=[{label:"Line",value:"line"},{label:"Solid",value:"solid"},{label:"Flat",value:"flat"},{label:"Duo",value:"duo"},{label:"Handrawn",value:"handrawn"},{label:"Creative",value:"creative"},{label:"Gradient",value:"gradient"},{label:"Remix",value:"remix"},{label:"Neon",value:"neon"},{label:"Pop",value:"pop"},{label:"Light",value:"light"},{label:"Glyph",value:"glyph"},{label:"Minimal",value:"minimal"},{label:"Outlined",value:"outlined"},{label:"Geometric",value:"geometric"},{label:"Bold",value:"bold"},{label:"Stroke",value:"stroke"},{label:"Wireframe",value:"wireframe"},{label:"Filled",value:"filled"}],aM=({query:e,onQueryChange:t,onSubmit:n,styleFilter:r,onStyleChange:o,hasResults:a=!1,inputRef:s})=>{const{t:l}=En(),{options:c}=Ei(),{config:u}=c,f=e.length>0&&a;return(0,i.jsxs)("div",{className:iM.iconsSearchFormCenteredContainer,children:[(0,i.jsxs)(d.A,{layout:"inline",onFinish:n,className:f?iM.iconsSearchResults:iM.iconsSearchFormCentered,children:[(0,i.jsx)(d.A.Item,{className:iM.iconsSearchFormInput,children:(0,i.jsx)(h.A,{ref:s,className:iM.iconsSearchFormInputInput,allowClear:!0,prefix:(0,i.jsx)(Wr,{size:16,strokeWidth:null==u?void 0:u.iconStrokeWidth,onClick:n}),placeholder:l("Search icons"),value:e,onChange:e=>t(e.target.value),onKeyDown:e=>"Space"===e.code&&n(),onPressEnter:n,spellCheck:"false"})}),f&&(0,i.jsx)(d.A.Item,{className:iM.iconsSearchFormStyleItem,children:(0,i.jsx)(p.A,{allowClear:!0,placeholder:l("Style"),value:null!=r?r:void 0,onChange:e=>o(null!=e?e:null),className:iM.iconsSearchFormSelect,options:oM.map(e=>({label:l(e.label),value:e.value}))})})]}),f&&(0,i.jsx)("div",{className:`ant-divider ${iM.iconsSearchDivider}`,role:"separator"})]})},sM=e=>{const{t:t}=En(),{mode:n,colorHex:r,setColorHex:o,colorHex2:a,setColorHex2:s,colorHex3:l,setColorHex3:c,sizePx:u,setSizePx:d,strokeWidth:h,setStrokeWidth:f,showSecondColor:p,showThirdColor:g,onBack:y,styleFilter:b}=e;return(0,i.jsxs)("div",{className:iM.iconsControls,children:[(0,i.jsx)("div",{className:iM.iconsControlsControls,children:"family"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:iM.iconsControlsStrokeWidth,children:[(0,i.jsx)("span",{children:t("Size")}),(0,i.jsx)(z.A,{min:20,max:200,value:u,formatter:e=>`${e}px`,parser:e=>e?e.replace("px",""):"",onChange:e=>d("number"==typeof e?e:50)})]}),(0,i.jsxs)("div",{className:iM.iconsControlsStrokeWidth,children:[(0,i.jsx)("span",{children:t("Stroke width")}),(0,i.jsx)(z.A,{min:.3,max:3,step:.1,value:"number"==typeof h?h:1,formatter:e=>`${e}px`,parser:e=>e?e.replace("px",""):"",onChange:e=>f("number"==typeof e?e:1)})]}),"gradient"===b?(0,i.jsx)(v.A,{size:8,children:(0,i.jsx)(B.A,{defaultValue:[{color:r||"#108ee9",percent:0},{color:a||"#87d068",percent:100}],showText:!0,mode:"gradient",onChangeComplete:e=>{try{const t=e.toCssString().match(/(rgba?\([^)]+\)|#[0-9a-fA-F]{3,8})/g)||[];t[0]&&o(t[0]),t[1]&&s(t[1])}catch(e){}},size:"small"})}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:iM.iconsControlElement,children:[(0,i.jsx)("span",{children:t("Color1")}),(0,i.jsx)(B.A,{value:r,format:"hex",disabledAlpha:!0,onChange:(e,t)=>o(t),size:"middle"})]}),p&&(0,i.jsxs)("div",{className:iM.iconsControlElement,children:[(0,i.jsx)("span",{children:t("Color2")}),(0,i.jsx)(B.A,{value:a,format:"hex",disabledAlpha:!0,onChange:(e,t)=>s(t),size:"middle"})]}),g&&(0,i.jsxs)("div",{className:iM.iconsControlElement,children:[(0,i.jsx)("span",{children:t("Color3")}),(0,i.jsx)(B.A,{value:l,format:"hex",disabledAlpha:!0,onChange:(e,t)=>c(t),size:"middle"})]})]})]})}),(0,i.jsx)("div",{className:iM.iconsControlsHeader,children:(0,i.jsx)("div",{children:"family"===n?(0,i.jsx)(m.Ay,{className:iM.iconsControlsBackButton,type:"default",onClick:y,title:t("Back"),children:t("Back")}):null})})]})},lM=(0,i.jsx)(H.A,{style:{fontSize:20},spin:!0}),cM=({items:e,hasMore:t,loading:n,hasQuery:r,mode:o,selectedHash:a,onLoadMore:l,onItemClick:c,onInsert:u,scrollContainerRef:d,colorVars:h,svgTextMap:f,previewSize:p,selectedHashes:g,onToggleSelect:m})=>{const{t:v}=En(),{ThumbsUpIcon:y}=ji(),w=Boolean(g&&g.size>0),x=(0,i.jsx)("div",r?{className:iM.iconsGridEmptyState,children:(0,i.jsx)(Ti,{})}:{className:iM.iconsGridEmptyState,children:(0,i.jsxs)("div",{className:iM.resultsContainer,children:[(0,i.jsx)("span",{className:iM.videoIcon,children:(0,i.jsx)(y,{className:iM.playButton,style:{width:48,height:49,marginBottom:10}})}),(0,i.jsx)("h1",{className:iM.title,children:v("Millions of icons")}),(0,i.jsx)("p",{className:iM.subtitle,children:v("Enter a search query and we'll find the perfect icon for you")})]})});return(0,i.jsxs)("div",{id:"iconsScrollableDiv",ref:d,className:iM.iconsGrid,children:[0!==e.length||n?(0,i.jsx)(DO,{dataLength:e.length,next:l,hasMore:t,scrollableTarget:"iconsScrollableDiv",className:iM.iconsGridInfiniteScroll,loader:(0,i.jsx)(s.A,{indicator:lM}),children:(0,i.jsx)("div",{className:`${iM.iconsGridGrid} ${w?iM.iconsGridShowCheckboxes:""}`,style:{"--icons-grid-min-col":`${Math.max(100,(null!=p?p:50)+48)}px`},children:e.map(e=>{var t,n,r,s,l,u,d,v,y,w,x;return(0,i.jsxs)("div",{style:{border:g&&g.has(e.hash)||a===e.hash?"1px solid #1890ff":"1px solid #f0f0f0",boxShadow:g&&g.has(e.hash)||a===e.hash?"0 0 0 2px rgba(24,144,255,0.2)":"none"},className:iM.iconsGridItem,onClick:()=>{c(e),m&&"family"===o&&m(e.hash)},children:[(0,i.jsx)("div",{style:{height:null!=p?p:50},className:iM.iconsGridItemThumbnail,children:"family"===o&&f[e.hash]?(0,i.jsx)("div",{style:{color:null==h?void 0:h.colorHex,"--icon-grad-1":null!==(t=null==h?void 0:h.colorHex)&&void 0!==t?t:"#000","--icon-grad-2":null!==(n=null==h?void 0:h.colorHex2)&&void 0!==n?n:"#ff007a","--icon-color-1":null!==(r=null==h?void 0:h.colorHex)&&void 0!==r?r:"#000","--icon-color-2":null!==(s=null==h?void 0:h.colorHex2)&&void 0!==s?s:"#ff007a","--icon-color-3":null!==(l=null==h?void 0:h.colorHex3)&&void 0!==l?l:"#00C2FF","--icon-stroke-1":null!==(u=null==h?void 0:h.colorHex)&&void 0!==u?u:"#000","--icon-stroke-2":null!==(d=null==h?void 0:h.colorHex2)&&void 0!==d?d:"#ff007a","--icon-stroke-3":null!==(v=null==h?void 0:h.colorHex3)&&void 0!==v?v:"#00C2FF","--icon-fill-1":null!==(y=null==h?void 0:h.colorHex)&&void 0!==y?y:"#000","--icon-fill-2":null!==(w=null==h?void 0:h.colorHex2)&&void 0!==w?w:"#ff007a","--icon-fill-3":null!==(x=null==h?void 0:h.colorHex3)&&void 0!==x?x:"#00C2FF"},dangerouslySetInnerHTML:{__html:f[e.hash]},className:iM.iconsGridItemSvg}):(0,i.jsx)("img",{src:e.imagePreviewUrl,alt:e.name,style:{maxHeight:null!=p?p:96},className:iM.iconsGridItemImg})}),(0,i.jsx)("div",{className:iM.iconsGridItemName,title:e.name,children:e.name}),m?(0,i.jsx)("div",{onClick:e=>{e.stopPropagation()},className:iM.iconsGridCheckbox,children:(0,i.jsx)(b.A,{checked:Boolean(g&&g.has(e.hash)),onChange:()=>m(e.hash)})}):null]},e.hash)})})}):x,!n&&t&&e.length>0&&(0,i.jsx)("div",{style:{height:1},ref:e=>{if(!e||!d.current)return;const t=d.current;t.scrollHeight<=t.clientHeight&&l()}}),n&&0===e.length&&(0,i.jsx)("div",{className:iM.iconsGridLoading,children:(0,i.jsx)(s.A,{indicator:lM})})]})},uM="path|rect|circle|ellipse|polygon|line|polyline|g";function dM(e){const t=e.trim();if(!t||"none"===t||"transparent"===t)return null;if(/^url\(#/.test(t))return null;if(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(t)){const e=t.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})/);return e?"#"+(3===e[1].length?e[1].replace(/(.)/g,"$1$1"):e[1]).toLowerCase():null}if(/^rgb\(/.test(t)){const e=t.match(/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/);if(e)return"#"+[1,2,3].map(t=>parseInt(e[t],10).toString(16).padStart(2,"0")).join("")}if(/^rgba\(/.test(t)){const e=t.match(/^rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*[\d.]+\s*\)/);if(e)return"#"+[1,2,3].map(t=>parseInt(e[t],10).toString(16).padStart(2,"0")).join("")}const n={black:"#000000",white:"#ffffff",red:"#ff0000",green:"#008000",blue:"#0000ff"},r=t.toLowerCase();return n[r]?n[r]:("currentcolor"===r||"inherit"===r||/^[a-zA-Z]+$/.test(t),null)}function hM(e,t){const n=new RegExp(`${t}\\s*:\\s*([^;]+)`,"i"),r=e.match(n);return r?r[1].trim():null}function fM(e){let t=0;const n=new RegExp(`<(?:${uM})([^>]*)>`,"gi");let r;for(;null!==(r=n.exec(e));){const e=r[1],n=e.match(/fill\s*=\s*["']([^"']*)["']/i),i=e.match(/style\s*=\s*["']([^"']*)["']/i),o=n&&n[1]&&!/^none$/i.test(n[1])&&!/^url\(#/i.test(n[1]),a=i&&hM(i[1],"fill")&&!/^none$/i.test(hM(i[1],"fill"));(o||a)&&(t+=1)}return t}function pM(e){let t=0;const n=new RegExp(`<(?:${uM})([^>]*)>`,"gi");let r;for(;null!==(r=n.exec(e));){const e=r[1],n=e.match(/stroke\s*=\s*["']([^"']*)["']/i),i=e.match(/style\s*=\s*["']([^"']*)["']/i),o=n&&n[1]&&!/^none$/i.test(n[1])&&!/^url\(#/i.test(n[1]),a=i&&hM(i[1],"stroke")&&!/^none$/i.test(hM(i[1],"stroke"));(o||a)&&(t+=1)}return t}function gM(e){return/<linearGradient/i.test(e)||/<radialGradient/i.test(e)||/fill="url\(#|stroke="url\(#/i.test(e)}function mM(e){const t=e.trim().replace(/(?:px|em|ex|%)\s*$/i,""),n=parseFloat(t);return Number.isNaN(n)||n<=0||n>10?null:Math.round(10*n)/10}function vM(e){const t=[],n=e.indexOf("</defs>"),r=n>=0?e.slice(n):e,i=new RegExp(`<(?:${uM})[^>]*stroke-width\\s*=\\s*["']([^"']+)["']`,"gi");let o;for(;null!==(o=i.exec(r));){const e=mM(o[1]);null!=e&&t.push(e)}const a=new RegExp(`<(?:${uM})[^>]*style\\s*=\\s*["'][^"']*stroke-width\\s*:\\s*([^;"]+)[^"']*["']`,"gi");for(;null!==(o=a.exec(r));){const e=mM(o[1]);null!=e&&t.push(e)}if(0===t.length)return;t.sort((e,t)=>e-t);const s=Math.floor(t.length/2);return t.length%2==1?t[s]:(t[s-1]+t[s])/2}function yM(e){const t=function(e){const t=[],n=new Set;Array.from(e.matchAll(/<stop[^>]*?stop-color\s*=\s*["']([^"']+)["']/gi)).map(e=>e[1]).forEach(e=>{const r=dM(e);r&&!n.has(r)&&(n.add(r),t.push(e))});const r=new RegExp(`<(?:${uM})([^>]*)>`,"gi");let i;for(;null!==(i=r.exec(e));){const e=i[1],r=e.match(/fill\s*=\s*["']([^"']*)["']/i);if(r&&r[1]){const e=dM(r[1]);e&&!n.has(e)&&(n.add(e),t.push(r[1]))}const o=e.match(/stroke\s*=\s*["']([^"']*)["']/i);if(o&&o[1]){const e=dM(o[1]);e&&!n.has(e)&&(n.add(e),t.push(o[1]))}const a=e.match(/style\s*=\s*["']([^"']*)["']/i);if(a&&a[1]){const e=hM(a[1],"fill");if(e){const r=dM(e);r&&!n.has(r)&&(n.add(r),t.push(e))}const r=hM(a[1],"stroke");if(r){const e=dM(r);e&&!n.has(e)&&(n.add(e),t.push(r))}}}const o=e.match(/<svg([^>]*)>/i);if(o&&o[1]){const e=o[1];for(const[i,o]of[["fill",/fill\s*=\s*["']([^"']*)["']/i],["stroke",/stroke\s*=\s*["']([^"']*)["']/i]]){const r=e.match(o);if(r&&r[1]){const e=dM(r[1]);e&&!n.has(e)&&(n.add(e),t.push(r[1]))}}const r=e.match(/style\s*=\s*["']([^"']*)["']/i);if(r&&r[1])for(const i of["fill","stroke"]){const e=hM(r[1],i);if(e){const r=dM(e);r&&!n.has(r)&&(n.add(r),t.push(e))}}}return t}(e);return{colors:t,fillsCount:fM(e),strokesCount:pM(e),hasGradient:gM(e),strokeWidth:vM(e)}}const bM=new Map,wM="https://public-api.streamlinehq.com/v1";const xM=({apiKey:e,customRequest:t,query:n,setQuery:r,inputRef:a})=>{var l,c,u,p,g,y,b,w,x;const{t:C}=En(),[_,S]=o.useState(""),A=void 0!==n?n:_,k=void 0!==r?r:S,[E,I]=o.useState(""),[T,F]=o.useState("global"),[M,P]=o.useState(null),[R,L]=o.useState(null),[N,D]=o.useState(null),[z,B]=o.useState(null),[V,H]=o.useState([]),[W,$]=o.useState(0),[G,q]=o.useState(!1),[Y,X]=o.useState(!1),[K,Z]=o.useState(null),[J,Q]=o.useState({}),[ee,te]=o.useState({}),[ne,re]=o.useState({}),[ie,oe]=o.useState("#000000"),[ae,se]=o.useState("#ff007a"),[le,ce]=o.useState("#00C2FF"),[ue,de]=o.useState(1),[he,fe]=o.useState(50),[pe,ge]=o.useState(!0),[me,ve]=o.useState(!0),[ye,be]=o.useState(!1),we=Ei(),{options:xe}=we,Ce=o.useRef(null),_e=o.useRef(!1),Se=o.useRef(null),Ae=o.useRef(0),ke=o.useRef(!1),Ee=o.useRef(null),Ie=o.useRef(null===(l=null==xe?void 0:xe.config)||void 0===l?void 0:l.handleTranslate),je=o.useRef(null===(c=null==xe?void 0:xe.config)||void 0===c?void 0:c.locale);o.useEffect(()=>{var e,t;Ie.current=null===(e=null==xe?void 0:xe.config)||void 0===e?void 0:e.handleTranslate,je.current=null===(t=null==xe?void 0:xe.config)||void 0===t?void 0:t.locale},[null===(u=null==xe?void 0:xe.config)||void 0===u?void 0:u.handleTranslate,null===(p=null==xe?void 0:xe.config)||void 0===p?void 0:p.locale]);const Te=o.useRef(null),Fe=o.useRef(null),Oe=o.useRef(null),[Me,Pe]=o.useState(new Set),Re=null!==(y=null===(g=null==xe?void 0:xe.config)||void 0===g?void 0:g.STREAMLINE_API_KEY)&&void 0!==y?y:"3pAQQzwUNMmcgSr2.f4eb08cd5886d44b1fc6a701a3ba797c",Le=null===(b=null==xe?void 0:xe.config)||void 0===b?void 0:b.handleProxyUrl,Ne=async e=>Le?Promise.resolve(Le(e)):e,De=async e=>Promise.all(e.map(async e=>Object.assign(Object.assign({},e),{imagePreviewUrl:await Ne(e.imagePreviewUrl)}))),{performSearch:ze,fetchSvgDataUrl:Be,fetchPngDataUrl:Ue,normalizeSvgForCss:Ve}=function(e,t,n,r){const i=o.useMemo(()=>t&&"string"==typeof t?t.replace(/\/$/,""):"/streamline",[t]),a=async e=>n?Promise.resolve(n(e)):e,s=null==r?void 0:r.trim(),l=o.useCallback(async e=>n?a(function(e){const{mode:t,q:n,offset:r,limit:i,familySlug:o,style:a}=e,s=new URLSearchParams;"global"===t&&(s.set("productType","icons"),s.set("productTier","free")),s.set("query",n),s.set("offset",String(r)),s.set("limit",String(i)),a&&s.set("style",a);const l="global"===t?"search/global":`search/family/${encodeURIComponent(o||"")}`;return`${wM}/${l}?${s.toString()}`}(e)):function(e,t){const{mode:n,q:r,offset:i,limit:o,familySlug:a,style:s}=t,l="global"===n?"search/global":`search/family/${encodeURIComponent(a||"")}`,c=new URL(`${e}/${l}`,window.location.origin);return"global"===n&&(c.searchParams.set("productType","icons"),c.searchParams.set("productTier","free")),c.searchParams.set("query",r),c.searchParams.set("offset",String(i)),c.searchParams.set("limit",String(o)),s&&c.searchParams.set("style",s),c.toString().replace(window.location.origin,"")}(i,e),[i,n]),c=o.useCallback(async e=>{var t;const n=await l({mode:e.mode,q:e.query.trim(),offset:e.offset,limit:e.limit,familySlug:e.familySlug,style:null!==(t=e.style)&&void 0!==t?t:null}),r={Accept:"application/json"};s&&(r["x-api-key"]=s);const i=await fetch(n,{method:"GET",headers:r,signal:e.signal});if(!i.ok){const e=await i.text();throw new Error(`Request failed: ${i.status} ${e}`)}return await i.json()},[l,s]),u=o.useCallback((e,t)=>{let n=e;const r=/<linearGradient[\s\S]*?<\/linearGradient>/i.test(n)||/<radialGradient[\s\S]*?<\/radialGradient>/i.test(n);if(!/fill="url\(#/i.test(n)&&!/stroke="url\(#/i.test(n)){const e=function(e){var t,n,r,i,o,a,s,l;const c=new Map,u={v:1},d=e=>{const t=dM(e);t&&!c.has(t)&&(c.set(t,u.v),u.v=Math.min(u.v+1,3))},h=e.match(/<svg([^>]*)>/i);if(null==h?void 0:h[1]){const e=h[1],t=e.match(/fill\s*=\s*["']([^"']*)["']/i),n=e.match(/stroke\s*=\s*["']([^"']*)["']/i);!(null==t?void 0:t[1])||/^none$/i.test(t[1])||/^url\(#/i.test(t[1])||d(t[1]),!(null==n?void 0:n[1])||/^none$/i.test(n[1])||/^url\(#/i.test(n[1])||d(n[1])}const f=new RegExp(`<(?:${uM})([^>]*)>`,"gi");let p;for(;null!==(p=f.exec(e));){const e=p[1],c=e.match(/fill\s*=\s*["']([^"']*)["']/i),u=e.match(/style\s*=\s*["']([^"']*)["']/i),h=null===(t=null==u?void 0:u[1])||void 0===t?void 0:t.match(/fill\s*:\s*([^;]+)/i),f=null===(i=null!==(n=null==c?void 0:c[1])&&void 0!==n?n:null===(r=null==h?void 0:h[1])||void 0===r?void 0:r.trim())||void 0===i?void 0:i.trim();!f||/^none$/i.test(f)||/^url\(#/i.test(f)||d(f);const g=e.match(/stroke\s*=\s*["']([^"']*)["']/i),m=e.match(/style\s*=\s*["']([^"']*)["']/i),v=null===(o=null==m?void 0:m[1])||void 0===o?void 0:o.match(/stroke\s*:\s*([^;]+)/i),y=null===(l=null!==(a=null==g?void 0:g[1])&&void 0!==a?a:null===(s=null==v?void 0:v[1])||void 0===s?void 0:s.trim())||void 0===l?void 0:l.trim();!y||/^none$/i.test(y)||/^url\(#/i.test(y)||d(y)}return c}(n),t=t=>{const n=dM(t),r=n?e.get(n):void 0;return 1===r?"var(--icon-color-1)":2===r?"var(--icon-color-2)":3===r?"var(--icon-color-3)":"currentColor"};n=n.replace(/<svg([^>]*)>/i,(e,n)=>{let r=n;const i=n.match(/fill\s*=\s*["']([^"']*)["']/i);!(null==i?void 0:i[1])||/^none$/i.test(i[1])||/^url\(#/i.test(i[1])||(r=r.replace(/fill\s*=\s*["'][^"']*["']/i,`fill="${t(i[1])}"`));const o=n.match(/stroke\s*=\s*["']([^"']*)["']/i);return!(null==o?void 0:o[1])||/^none$/i.test(o[1])||/^url\(#/i.test(o[1])||(r=r.replace(/stroke\s*=\s*["'][^"']*["']/i,`stroke="${t(o[1])}"`)),`<svg${r}>`}),n=n.replace(/<(path|rect|circle|ellipse|polygon|line|polyline)([^>]*?)(\/>|>)/gi,(e,n,r,i)=>{var o,a,s,l,c,u,d,h;let f=r;const p=r.match(/fill\s*=\s*["']([^"']*)["']/i),g=r.match(/style\s*=\s*["']([^"']*)["']/i),m=null===(o=null==g?void 0:g[1])||void 0===o?void 0:o.match(/fill\s*:\s*([^;]+)/i),v=null===(l=null!==(a=null==p?void 0:p[1])&&void 0!==a?a:null===(s=null==m?void 0:m[1])||void 0===s?void 0:s.trim())||void 0===l?void 0:l.trim();if(v&&!/^none$/i.test(v)&&!/^url\(#/i.test(v)){const e=t(v);p?f=f.replace(/fill\s*=\s*["'][^"']*["']/i,`fill="${e}"`):(null==g?void 0:g[1])&&(f=f.replace(/style\s*=\s*["']([^"']*)["']/i,(t,n)=>`style="${n.replace(/fill\s*:\s*[^;]+/gi,`fill: ${e}`)}"`))}const y=r.match(/stroke\s*=\s*["']([^"']*)["']/i),b=r.match(/style\s*=\s*["']([^"']*)["']/i),w=null===(c=null==b?void 0:b[1])||void 0===c?void 0:c.match(/stroke\s*:\s*([^;]+)/i),x=null===(h=null!==(u=null==y?void 0:y[1])&&void 0!==u?u:null===(d=null==w?void 0:w[1])||void 0===d?void 0:d.trim())||void 0===h?void 0:h.trim();if(x&&!/^none$/i.test(x)&&!/^url\(#/i.test(x)){const e=t(x);y?f=f.replace(/stroke\s*=\s*["'][^"']*["']/i,`stroke="${e}"`):(null==b?void 0:b[1])&&(f=f.replace(/style\s*=\s*["']([^"']*)["']/i,(t,n)=>`style="${n.replace(/stroke\s*:\s*[^;]+/gi,`stroke: ${e}`)}"`))}return`<${n}${f}${i}`})}return r&&(n=n.replace(/<linearGradient([^>]*?)>([\s\S]*?)<\/linearGradient>/gi,(e,t,n)=>{let r=0;return`<linearGradient${t}>${n.replace(/<stop([^>]*?)>/gi,(e,t)=>{const n=0===r?"var(--icon-grad-1)":"var(--icon-grad-2)";return r+=1,/stop-color\s*=/.test(t)?"<stop"+t.replace(/stop-color="[^"]*"/i,'stop-color="'+n+'"')+">":"<stop"+t+' stop-color="'+n+'">'})}</linearGradient>`}),n=n.replace(/<radialGradient([^>]*?)>([\s\S]*?)<\/radialGradient>/gi,(e,t,n)=>{let r=0;return`<radialGradient${t}>${n.replace(/<stop([^>]*?)>/gi,(e,t)=>{const n=0===r?"var(--icon-grad-1)":"var(--icon-grad-2)";return r+=1,/stop-color\s*=/.test(t)?"<stop"+t.replace(/stop-color="[^"]*"/i,'stop-color="'+n+'"')+">":"<stop"+t+' stop-color="'+n+'">'})}</radialGradient>`})),"number"!=typeof(null==t?void 0:t.strokeWidth)||Number.isNaN(t.strokeWidth)||(/stroke-width\s*=\s*["'][^"']*["']/i.test(n)&&(n=n.replace(/stroke-width\s*=\s*["'][^"']*["']/gi,`stroke-width="${t.strokeWidth}"`)),/stroke-width\s*:/.test(n)&&(n=n.replace(/stroke-width\s*:\s*[^;]+/gi,`stroke-width: ${t.strokeWidth}`)),/stroke-width/i.test(n)||(n=n.replace(/<svg/,`<svg stroke-width="${t.strokeWidth}"`))),n=n.replace(/<svg([^>]*)>/i,(e,t)=>`<svg${t.replace(/\swidth="[^"]*"/i,"").replace(/\sheight="[^"]*"/i,"")} width="100%" height="100%">`),n},[]),d=o.useCallback(async(t,r)=>{const o=[t,e?"css=1":"css=0",(null==r?void 0:r.colors)?`c=${r.colors}`:"",(null==r?void 0:r.backgroundColor)?`bg=${r.backgroundColor}`:"",null!=(null==r?void 0:r.strokeWidth)?`sw=${r.strokeWidth}`:"",null!=(null==r?void 0:r.size)?`s=${r.size}`:"",null!=(null==r?void 0:r.responsive)?`r=${r.responsive}`:"",null!=(null==r?void 0:r.strokeToFill)?`sf=${r.strokeToFill}`:""].filter(Boolean).join("|"),l=bM.get(o);if(l)return l;const c=await(async(e,t)=>{var r,o;const s=new URLSearchParams;(null==t?void 0:t.colors)&&s.set("colors",t.colors),(null==t?void 0:t.backgroundColor)&&s.set("backgroundColor",t.backgroundColor),null!=(null==t?void 0:t.strokeWidth)&&s.set("strokeWidth",String(t.strokeWidth)),s.set("size",String(null!==(r=null==t?void 0:t.size)&&void 0!==r?r:96)),s.set("responsive",String(null===(o=null==t?void 0:t.responsive)||void 0===o||o)),null!=(null==t?void 0:t.strokeToFill)&&s.set("strokeToFill",String(t.strokeToFill));const l=`${wM}/icons/${encodeURIComponent(e)}/download/svg?${s.toString()}`;if(n)return a(l);const c=new URL(`${i}/icons/${encodeURIComponent(e)}/download/svg`,window.location.origin);return s.forEach((e,t)=>c.searchParams.set(t,e)),c.toString().replace(window.location.origin,"")})(t,r),d={Accept:"image/svg+xml"};s&&(d["x-api-key"]=s);const h=await fetch(c,{method:"GET",headers:d,signal:null==r?void 0:r.signal});if(!h.ok){const e=await h.text();throw new Error(`SVG request failed: ${h.status} ${e}`)}let f=await h.text();const p=f;e&&!(null==r?void 0:r.colors)&&(f=u(f,{strokeWidth:null==r?void 0:r.strokeWidth}));const g={text:f,url:`data:image/svg+xml;utf8,${encodeURIComponent(f)}`,original:p};return bM.set(o,g),g},[i,u,e,n,a,s]),h=o.useCallback(async(e,t)=>{const r=await(async(e,t)=>{var r;const o=new URLSearchParams;o.set("size",String(null!==(r=null==t?void 0:t.size)&&void 0!==r?r:96)),(null==t?void 0:t.colors)&&o.set("colors",t.colors),(null==t?void 0:t.backgroundColor)&&o.set("backgroundColor",t.backgroundColor),null!=(null==t?void 0:t.strokeWidth)&&o.set("strokeWidth",String(t.strokeWidth));const s=`${wM}/icons/${encodeURIComponent(e)}/download/png?${o.toString()}`;if(n)return a(s);const l=new URL(`${i}/icons/${encodeURIComponent(e)}/download/png`,window.location.origin);return o.forEach((e,t)=>l.searchParams.set(t,e)),l.toString().replace(window.location.origin,"")})(e,t),o={Accept:"image/png"};s&&(o["x-api-key"]=s);const l=await fetch(r,{method:"GET",headers:o,signal:null==t?void 0:t.signal});if(!l.ok){const e=await l.text();throw new Error(`PNG request failed: ${l.status} ${e}`)}const c=await l.blob();return await new Promise((e,t)=>{const n=new FileReader;n.onload=()=>e(n.result),n.onerror=()=>t(new Error("Failed to read PNG blob")),n.readAsDataURL(c)})},[i,n,a,s]);return{buildUrl:l,performSearch:c,fetchSvgDataUrl:d,fetchPngDataUrl:h,normalizeSvgForCss:u}}(me,null===(w=null==xe?void 0:xe.config)||void 0===w?void 0:w.STREAMLINE_BASE_URL,Le,Re),He=o.useMemo(()=>{if("family"!==T||0===V.length)return null;const e=new Set(V.map(e=>e.hash)),t=Object.keys(ne).some(t=>e.has(t))?ne:ee,n=V.map(e=>t[e.hash]).filter(e=>Boolean(e));return 0===n.length?null:function(e){const t=[],n=new Set;let r,i=0,o=0,a=!1;for(const s of e){i+=s.fillsCount,o+=s.strokesCount,s.hasGradient&&(a=!0);for(const e of s.colors){const r=dM(e);r&&!n.has(r)&&(n.add(r),t.push(e))}null==r&&null!=s.strokeWidth&&(r=s.strokeWidth)}return{colors:t,fillsCount:i,strokesCount:o,hasGradient:a,strokeWidth:r}}(n.map(e=>yM(e)))},[V,T,ne,ee]);o.useMemo(()=>"family"===T&&(!!(null==He?void 0:He.hasGradient)||!!(M||"").toLowerCase().includes("gradient")),[He,M,T]);const We=o.useMemo(()=>"family"===T&&V.some(e=>{const t=ee[e.hash];return t&&/var\(--icon-color-2\)/i.test(t)}),[V,T,ee]),$e=o.useMemo(()=>"family"===T&&V.some(e=>{const t=ee[e.hash];return t&&/var\(--icon-color-3\)/i.test(t)}),[V,T,ee]),Ge=o.useMemo(()=>!!me&&!!He&&(He.hasGradient||He.colors.length>=2&&We),[He,me,We]),qe=o.useMemo(()=>!!me&&!!He&&He.colors.length>=3&&$e,[He,me,$e]);o.useEffect(()=>(_e.current=!0,()=>{var e,t,n;_e.current=!1;try{null===(e=Te.current)||void 0===e||e.abort(),null===(t=Fe.current)||void 0===t||t.abort(),null===(n=Oe.current)||void 0===n||n.abort()}catch(e){}}),[]);const Ye=o.useRef(A),Xe=o.useCallback(async e=>{var t,n,r,i,o,a,s,l;const c=null!==(n=null===(t=e.override)||void 0===t?void 0:t.query)&&void 0!==n?n:E;if(!c||0===c.trim().length)return;if(Y)return;if(!_e.current)return;null===(r=Te.current)||void 0===r||r.abort();const u=new AbortController;Te.current=u,X(!0);const d=e.initial?0:W,h=e.initial?30:20,f=null!==(o=null===(i=e.override)||void 0===i?void 0:i.mode)&&void 0!==o?o:T,p=null!==(s=null===(a=e.override)||void 0===a?void 0:a.familySlug)&&void 0!==s?s:M,g=c.trim();try{const t=await ze({mode:f,familySlug:p||null,query:g,offset:d,limit:h,style:N,signal:u.signal});if(!_e.current)return;if(e.initial)H(await De(t.results));else{const e=await De(t.results);H(t=>[...t,...e])}q(Boolean(null===(l=t.pagination)||void 0===l?void 0:l.hasMore)),$(d+h)}catch(e){if("AbortError"===(null==e?void 0:e.name))return;U.Ay.error(C("Request error"))}finally{_e.current&&X(!1)}},[E,M,Le,V,Y,T,W,ze,N,C]);o.useEffect(()=>{Ee.current=Xe},[Xe]),o.useEffect(()=>{if("family"===T){const e=window.setTimeout(()=>{ke.current=!1},100);return()=>window.clearTimeout(e)}ke.current=!1},[T]);const Ke=o.useCallback(async e=>{var t;if(!e||0===e.trim().length)return;const n=++Ae.current;let r=e.trim();if(Ie.current)try{r=await Ie.current(e,{locale:je.current})}catch(t){r=e}n===Ae.current&&(F("global"),P(null),B(null),H([]),q(!1),$(0),Z(null),Pe(new Set),I(r),await(null===(t=Ee.current)||void 0===t?void 0:t.call(Ee,{initial:!0,override:{query:r}})))},[]),Ze=o.useCallback(async()=>{A&&0!==A.trim().length&&await Ke(A)},[A,Ke]),Je=o.useCallback(()=>{Ae.current+=1,F("global"),P(null),L(null),B(null),D(null),I(""),H([]),q(!1),$(0),Z(null),Pe(new Set),oe("#000000"),se("#ff007a"),ce("#00C2FF")},[]);o.useEffect(()=>{const e=Ye.current;e&&e.trim().length>=3&&Ke(e)},[]),o.useEffect(()=>{const e=A.trim();Se.current&&(window.clearTimeout(Se.current),Se.current=null),e.length<3?Je():Se.current=window.setTimeout(()=>{Ke(e)},700)},[A,N,Je,Ke]);const Qe=o.useCallback(()=>{ke.current||G&&!Y&&Xe({initial:!1})},[Xe,G,Y]),et=o.useCallback(e=>{if("global"===T){if(!e.familySlug||!E)return;return Se.current&&(window.clearTimeout(Se.current),Se.current=null),ke.current=!0,F("family"),P(e.familySlug),L(e.hash),B(e.categoryName||null),H([]),q(!1),$(0),Z(null),Pe(new Set),oe("#000000"),se("#ff007a"),ce("#00C2FF"),void Xe({initial:!0,override:{mode:"family",familySlug:e.familySlug,query:E}})}Z(e.hash)},[E,Xe,T]),tt=o.useCallback(()=>{const e=E.trim();F("global"),P(null),L(null),B(null),H([]),q(!1),$(0),Z(null),Pe(new Set),oe("#000000"),se("#ff007a"),ce("#00C2FF"),e&&Xe({initial:!0,override:{mode:"global",familySlug:null,query:e}})},[E,Xe]);o.useEffect(()=>{var e;if("family"!==T||0===V.length)return;const t=new Set(V.map(e=>e.hash));let n=V.map(e=>e.hash).filter(e=>!J[e]||!ee[e]);if(!R||t.has(R)||ne[R]||(n=[R,...n]),0===n.length)return;let r=!1;null===(e=Fe.current)||void 0===e||e.abort();const i=new AbortController;return Fe.current=i,Promise.all(n.map(e=>Be(e,{colors:me?void 0:ie,strokeWidth:ue,size:he,responsive:pe,signal:i.signal}).then(t=>({h:e,r:t})).catch(()=>null))).then(e=>{if(r||!_e.current)return;const t={},n={},i={};e.forEach(e=>{e&&e.h&&e.r&&(t[e.h]=e.r.url,n[e.h]=e.r.text,e.r.original&&(i[e.h]=e.r.original))}),Object.keys(t).length>0&&Q(e=>Object.assign(Object.assign({},e),t)),Object.keys(n).length>0&&te(e=>Object.assign(Object.assign({},e),n)),Object.keys(i).length>0&&re(e=>Object.assign(Object.assign({},e),i))}),()=>{r=!0,i.abort()}},[ie,R,Be,V,T,ne,pe,he,ue,ee,J,me]),o.useEffect(()=>{if("family"!==T)return;if(0===V.length)return;const e=V.map(e=>e.hash),t={},n={};let r=!1;e.forEach(e=>{const i=ne[e]||ee[e];if(!i)return;const o=Ve(i,{strokeWidth:"number"==typeof ue?ue:void 0});o&&o!==ee[e]&&(t[e]=o,n[e]=`data:image/svg+xml;utf8,${encodeURIComponent(o)}`,r=!0)}),r&&(Object.keys(t).length>0&&te(e=>Object.assign(Object.assign({},e),t)),Object.keys(n).length>0&&Q(e=>Object.assign(Object.assign({},e),n)))},[V,T,Ve,ne,ue,ee]);const nt=o.useRef(null);o.useEffect(()=>{var e;if("family"!==T||0===V.length)return;const t=R&&ne[R]?R:null===(e=V[0])||void 0===e?void 0:e.hash;if(!t||!ne[t])return;if(nt.current===M)return;const n=ne[t];if(!n)return;nt.current=M;const r=function(e){var t,n,r,i,o,a,s,l;const c=[],u=new Set,d=e=>{const t=dM(e);t&&!u.has(t)&&(u.add(t),c.push(e))},h=Array.from(e.matchAll(/<stop[^>]*?stop-color\s*=\s*["']([^"']+)["']/gi)).map(e=>e[1]);if(h.length>=2)return h.slice(0,3).forEach(e=>d(e)),c;const f=e.match(/<svg([^>]*)>/i);if(null==f?void 0:f[1]){const e=f[1],t=e.match(/fill\s*=\s*["']([^"']*)["']/i),n=e.match(/stroke\s*=\s*["']([^"']*)["']/i);!(null==t?void 0:t[1])||/^none$/i.test(t[1])||/^url\(#/i.test(t[1])||d(t[1]),!(null==n?void 0:n[1])||/^none$/i.test(n[1])||/^url\(#/i.test(n[1])||d(n[1])}const p=new RegExp(`<(?:${uM})([^>]*)>`,"gi");let g;for(;null!==(g=p.exec(e));){const e=g[1],c=e.match(/fill\s*=\s*["']([^"']*)["']/i),u=e.match(/style\s*=\s*["']([^"']*)["']/i),h=null===(t=null==u?void 0:u[1])||void 0===t?void 0:t.match(/fill\s*:\s*([^;]+)/i),f=null===(i=null!==(n=null==c?void 0:c[1])&&void 0!==n?n:null===(r=null==h?void 0:h[1])||void 0===r?void 0:r.trim())||void 0===i?void 0:i.trim();!f||/^none$/i.test(f)||/^url\(#/i.test(f)||d(f);const p=e.match(/stroke\s*=\s*["']([^"']*)["']/i),m=e.match(/style\s*=\s*["']([^"']*)["']/i),v=null===(o=null==m?void 0:m[1])||void 0===o?void 0:o.match(/stroke\s*:\s*([^;]+)/i),y=null===(l=null!==(a=null==p?void 0:p[1])&&void 0!==a?a:null===(s=null==v?void 0:v[1])||void 0===s?void 0:s.trim())||void 0===l?void 0:l.trim();!y||/^none$/i.test(y)||/^url\(#/i.test(y)||d(y)}return c.slice(0,3)}(n),i=e=>{const t=(e||"").trim().match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);return t?"#"+(3===t[1].length?t[1].replace(/(.)/g,"$1$1"):t[1]).toLowerCase():function(e){var t;const n=e.trim();if(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(n)){const e=n.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})/);if(e)return"#"+(3===e[1].length?e[1].replace(/(.)/g,"$1$1"):e[1]).toLowerCase()}const r=n.match(/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/);if(r)return"#"+[1,2,3].map(e=>parseInt(r[e],10).toString(16).padStart(2,"0")).join("");const i=n.match(/^rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*[\d.]+\s*\)/);return i?"#"+[1,2,3].map(e=>parseInt(i[e],10).toString(16).padStart(2,"0")).join(""):null!==(t={black:"#000000",white:"#ffffff",red:"#ff0000",green:"#008000",blue:"#0000ff"}[n.toLowerCase()])&&void 0!==t?t:dM(n)||"#000000"}(e)};r[0]&&oe(i(r[0])),r[1]&&se(i(r[1])),r[2]&&ce(i(r[2]))},[V,T,ne,M,R]),o.useEffect(()=>{"family"!==T&&(nt.current=null)},[T]);const rt=o.useRef(null);o.useEffect(()=>{if("family"!==T||!M||0===V.length)return;const e=V[0];if(!e||!ne[e.hash])return;if(rt.current===M)return;const t=ne[e.hash];if(!t)return;const n=yM(t);"number"==typeof n.strokeWidth&&n.strokeWidth>0&&(rt.current=M,de(n.strokeWidth))},[V,T,ne,M]),o.useEffect(()=>{"family"!==T&&(rt.current=null)},[T]);const it=o.useCallback(e=>function(e,t){const{colorHex:n,colorHex2:r,colorHex3:i}=t,o=[`--icon-grad-1: ${n}`,`--icon-grad-2: ${r}`,`--icon-stroke-1: ${n}`,`--icon-stroke-2: ${r}`,`--icon-stroke-3: ${i}`,`--icon-fill-1: ${n}`,`--icon-fill-2: ${r}`,`--icon-fill-3: ${i}`,`color: ${n}`].join(";");let a=e.replace(/<svg([^>]*)>/i,(e,t)=>{let n=t;return/style="/i.test(n)?n=n.replace(/style="([^"]*)"/i,(e,t)=>`style="${t};${o}"`):n+=` style="${o}"`,`<svg${n}>`});return a=a.replace(/var\(--icon-color-1\)/g,n).replace(/var\(--icon-color-2\)/g,r).replace(/var\(--icon-color-3\)/g,i).replace(/var\(--icon-fill-1\)/g,n).replace(/var\(--icon-fill-2\)/g,r).replace(/var\(--icon-fill-3\)/g,i).replace(/var\(--icon-stroke-1\)/g,n).replace(/var\(--icon-stroke-2\)/g,r).replace(/var\(--icon-stroke-3\)/g,i).replace(/var\(--icon-grad-1\)/g,n).replace(/var\(--icon-grad-2\)/g,r).replace(/currentColor/g,n),a}(e,{colorHex:ie,colorHex2:ae,colorHex3:le}),[ie,ae,le]),ot=o.useCallback(e=>{Pe(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),at=o.useCallback(()=>{Pe(new Set)},[]),st=o.useMemo(()=>{if(1===Me.size){const[e]=Array.from(Me);return V.find(t=>t.hash===e)||null}return 0===Me.size&&K&&V.find(e=>e.hash===K)||null},[V,K,Me]),lt=o.useCallback((e,t="image/png")=>{try{const n=e.split(",");if(n.length<2)return new Blob([],{type:t});const r=n[1]||"",i=atob(r),o=new Array(i.length);for(let e=0;e<i.length;e+=1)o[e]=i.charCodeAt(e);const a=new Uint8Array(o);return new Blob([a],{type:t})}catch(e){return new Blob([],{type:t})}},[]),ct=o.useCallback(async(e,t)=>{try{const n=async e=>{const t="family"===T?it(e):e,n=function(e,t){const n=e.match(/\swidth="([0-9.]+)(px)?"/i),r=e.match(/\sheight="([0-9.]+)(px)?"/i);if(n&&r){const e=parseFloat(n[1]),i=parseFloat(r[1]);if(Number.isFinite(e)&&Number.isFinite(i)&&e>0&&i>0){const n=e/i;return n>=1?{width:t,height:Math.max(1,Math.round(t/n))}:{width:Math.max(1,Math.round(t*n)),height:t}}}const i=e.match(/viewBox="([^"]+)"/i);if(i){const e=i[1].trim().split(/\s+/);if(4===e.length){const n=parseFloat(e[2]),r=parseFloat(e[3]);if(Number.isFinite(n)&&Number.isFinite(r)&&n>0&&r>0){const e=n/r;return e>=1?{width:t,height:Math.max(1,Math.round(t/e))}:{width:Math.max(1,Math.round(t*e)),height:t}}}}return{width:t,height:t}}(t,he);return async function(e,t,n){const r=new Blob([e],{type:"image/svg+xml;charset=utf-8"}),i=URL.createObjectURL(r);try{const e=new Image;return await new Promise((r,o)=>{e.onload=()=>{const i=document.createElement("canvas"),a=Math.max(1,Math.round(2*t)),s=Math.max(1,Math.round(2*n));i.width=a,i.height=s;const l=i.getContext("2d");l?(l.clearRect(0,0,a,s),l.drawImage(e,0,0,a,s),r(i.toDataURL("image/png"))):o(new Error("Canvas 2D context is not available"))},e.onerror=()=>o(new Error("Failed to load SVG image")),e.src=i})}finally{URL.revokeObjectURL(i)}}(t,n.width,n.height)},r=async e=>{const r=await Be(e,{colors:me?void 0:ie,strokeWidth:"number"==typeof ue?ue:void 0,size:he,responsive:pe,signal:t}),i=r.original||r.text;return n(i)};if("family"!==T)try{return await Ue(e.hash,{size:he,colors:me?void 0:ie,strokeWidth:"number"==typeof ue?ue:void 0,signal:t})}catch(t){return e.hash?await r(e.hash):null}const i=ee[e.hash]||ne[e.hash];return i?n(i):e.hash?await r(e.hash):null}catch(e){return null}},[it,ie,Be,Ue,T,ne,pe,he,ue,ee,me]),ut=o.useCallback(async e=>{var n;try{if(!_e.current)return;be(!0),null===(n=Oe.current)||void 0===n||n.abort();const r=new AbortController;Oe.current=r;const i=await ct(e,r.signal);if(!_e.current||!i)return;await Promise.resolve(t(i))}catch(e){U.Ay.error(C("Request error"))}finally{_e.current&&be(!1)}},[t,ct,C]);o.useCallback(()=>{var e;Z(null),at();const t=null===(e=null==xe?void 0:xe.config)||void 0===e?void 0:e.onClose;"function"==typeof t&&t()},[at,xe]);const{isCopyIconsModalVisible:dt,isCopyLoading:ht,copyForm:ft,openCopyModal:pt,closeCopyModal:gt,resetAfterClose:mt,handleCopyTreeSelect:vt,handleIconsCopyOk:yt,fetchChildFolders:bt,generateMenuItemsFromFolders:wt,handleCreateFolderAndCopy:xt}=(({items:e,selectedHashes:t,getPngDataUrlForItem:n,dataUrlToBlob:r,clearSelection:i})=>{const{t:a}=En(),{options:s,state:l}=Ei(),c=Ni(),[u,h]=o.useState(!1),[f]=d.A.useForm(),[p,g]=o.useState(!1),m=o.useRef(!1),{state:v,actions:{fetchFolders:y,fetchChildFolders:b,handleModalOk:w}}=so(),{EmptyFolderIcon:x}=ji(),{activeFormField:C,setActiveFormField:_,generateMenuItemsFromFolders:S}=Ja({folders:Array.isArray(v.folders)?v.folders:[],selectedFolder:l.selectedFolder,EmptyFolderIcon:x,handleCreateFolderModalOk:w,setIsLoading:g,t:a}),A=o.useCallback(async()=>{await y(),h(!0)},[y]),k=o.useCallback(async e=>{e.length>0&&(f.setFieldsValue({targetFolder:e[0]}),C!==e[0].toString()&&_(""))},[C,f,_]),E=o.useCallback(async o=>{var u,d;try{const{dataProviders:d}=s;if(!d||!d.uploadFile&&!d.uploadFiles)return void c.error({id:"FILES_UPLOAD_PROVIDER_NOT_CONFIGURED",message:a("API-endpoint for file upload is not configured"),placement:"bottomRight"});const h=o||(null==l?void 0:l.selectedFolder)||void 0,f=Array.from(t);if(0===f.length)return;const p=null!==(u=d.uploadFile)&&void 0!==u?u:async e=>{var t,n,r;if(!d.uploadFiles)throw new Error("Upload is not supported by data provider");const i=await d.uploadFiles({folderId:e.folderId,items:[{name:e.name,size:e.size,type:e.type,folderId:e.folderId,data:e.data,extension:e.extension}]}),o=null===(t=null==i?void 0:i.detailed)||void 0===t?void 0:t[0];if(!i||!i.success||!o||!1===o.success){const e=(null===(n=null==o?void 0:o.error)||void 0===n?void 0:n.message)||(null===(r=null==i?void 0:i.error)||void 0===r?void 0:r.message)||"Upload failed";throw new Error(e)}return o.data},{successCount:g,failCount:m}=await async function(e){var t;const{hashes:n,items:r,folderId:i,dataProviders:o,getPngDataUrlForItem:a,dataUrlToBlob:s}=e;let l=0,c=0;for(const u of n){const n=r.find(e=>e.hash===u);if(!n){c+=1;continue}const d=await a(n);if(!d){c+=1;continue}const h=`${(null===(t=n.name)||void 0===t?void 0:t.trim())||`icon-${u}`}.png`,f=s(d,"image/png");try{await o.uploadFile({name:h,size:f.size,type:"image/png",folderId:i,data:f,extension:"png"}),l+=1}catch(e){c+=1}}return{successCount:l,failCount:c}}({hashes:f,items:e,folderId:h,dataProviders:{uploadFile:p},getPngDataUrlForItem:n,dataUrlToBlob:r});g>0&&c.success({id:"FILES_COPY_SUCCESS",message:a("Files copied"),placement:"bottomRight",data:{successCount:g,totalCount:f.length,itemIds:f,folderId:null!=h?h:null}}),m>0&&c.error({id:"FILES_COPY_ERROR",message:a("\u041f\u0440\u0438 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0438"),placement:"bottomRight",data:{failCount:m,totalCount:f.length,itemIds:f,folderId:null!=h?h:null}}),i()}catch(e){c.error({id:"FILES_COPY_ERROR",message:a("\u041f\u0440\u0438 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0438"),placement:"bottomRight",innerException:e,data:{failCount:Array.from(t).length||0,totalCount:Array.from(t).length||0,itemIds:Array.from(t),folderId:null!==(d=null==l?void 0:l.selectedFolder)&&void 0!==d?d:null}})}},[i,r,n,e,c,s,t,null==l?void 0:l.selectedFolder,a]),I=o.useCallback(()=>{p||m.current||(h(!1),_(""),g(!1))},[p,_]),j=o.useCallback(()=>{_(""),g(!1)},[_]),T=o.useCallback(async e=>{if(!m.current){m.current=!0,g(!0);try{await E(null!=e?e:null),h(!1),_("")}finally{m.current=!1,g(!1)}}},[E,_]),F=o.useCallback(()=>{var e;const t=null!==(e=l.selectedFolder)&&void 0!==e?e:"folders";_(t),f.setFieldsValue({folderName:a("New folder"),targetFolder:t})},[f,l.selectedFolder,_,a]);return{isCopyIconsModalVisible:u,isCopyLoading:p,copyForm:f,openCopyModal:A,closeCopyModal:I,resetAfterClose:j,handleCopyTreeSelect:k,handleIconsCopyOk:T,handleCreateFolderAndCopy:F,fetchChildFolders:b,generateMenuItemsFromFolders:S}})({items:V,selectedHashes:Me,getPngDataUrlForItem:ct,dataUrlToBlob:lt,clearSelection:at});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:`${iM.iconsTab} ${E.trim()?iM.hasSearch:""}`,children:[E.trim()&&(V.length>0||Y)&&Me.size>0?(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)("div",{className:iM.iconsHeaderContainer,children:[(0,i.jsxs)("div",{className:iM.iconsHeaderContainerLeft,children:[(0,i.jsxs)(f.A.Text,{type:"secondary",children:[Me.size," ",C("selected")]}),(0,i.jsx)(m.Ay,{icon:(0,i.jsx)(Hr,{size:16}),onClick:at,children:C("Deselected")})]}),(0,i.jsx)(v.A,{children:(0,i.jsx)(m.Ay,{icon:(0,i.jsx)(jr,{size:16}),onClick:pt,children:C("Copy to folder")})})]})}):(0,i.jsx)(aM,{query:A,onQueryChange:k,onSubmit:Ze,styleFilter:N,onStyleChange:D,hasResults:V.length>0||Y,inputRef:a}),"family"===T?(0,i.jsx)(sM,{mode:T,familySlug:M,categoryName:z,colorHex:ie,setColorHex:oe,colorHex2:ae,setColorHex2:se,colorHex3:le,setColorHex3:ce,sizePx:he,setSizePx:fe,strokeWidth:ue,setStrokeWidth:de,responsiveSvg:pe,setResponsiveSvg:ge,useCssColor:me,setUseCssColor:ve,showSecondColor:Ge,showThirdColor:qe,styleFilter:N,onBack:tt}):null,(0,i.jsx)(cM,{items:V,hasMore:G,loading:Y,hasQuery:Boolean(E.trim()),mode:T,selectedHash:K,onLoadMore:Qe,onItemClick:et,onInsert:ut,scrollContainerRef:Ce,colorVars:{colorHex:ie,colorHex2:ae,colorHex3:le},svgTextMap:ee,previewSize:he,selectedHashes:Me,onToggleSelect:ot}),st?(0,i.jsxs)("div",{className:iM.iconsBottomBar,children:[(0,i.jsx)(O.A,{className:"zero-divider"}),(0,i.jsx)("div",{className:iM.iconsBottomBarContent,children:(0,i.jsx)(v.A,{children:(0,i.jsx)(m.Ay,{size:"large",type:"primary",style:{height:40},loading:ye,onClick:()=>ut(st),children:C("Choose")})})})]}):null]}),(0,i.jsx)(j.A,{title:(0,i.jsx)("div",{className:"modal-title",children:C("Copy to folder")}),open:dt,onCancel:()=>{ht||gt()},maskClosable:!ht,closable:!ht,keyboard:!ht,footer:(0,i.jsxs)("div",{className:Ka.formFooter,children:[(0,i.jsxs)(m.Ay,{className:Ka.folderButton,onClick:xt,loading:ht,children:[(0,i.jsx)(Pr,{size:18,strokeWidth:null===(x=xe.config)||void 0===x?void 0:x.iconStrokeWidth}),C("Create folder")]}),(0,i.jsx)(m.Ay,{type:"primary",className:Ka.folderButton,onClick:()=>{gt()},loading:ht,children:C("Done")})]}),afterClose:()=>mt(),children:(0,i.jsxs)("div",{className:iM.copyToFolderModalBody,children:[ht?(0,i.jsx)("div",{className:iM.copyToFolderModalLoadingOverlay,children:(0,i.jsx)(s.A,{size:"large"})}):null,(0,i.jsx)(d.A,{form:ft,layout:"vertical",initialValues:{targetFolder:"folders",folderName:C("New folder"),is_force_create:!1},children:(0,i.jsxs)("div",{className:Ka.foldersWrapper,children:[(0,i.jsx)(d.A.Item,{name:"targetFolder",rules:[{required:!0,message:C("Select the destination folder")}],className:Ka.formItem,children:(0,i.jsx)(Ya,{onSelect:vt,generateMenuItems:()=>wt({targetForm:ft,onTreeSelect:vt,onComplete:yt,actionButtonText:C("Copy here")}),fetchChildFolders:bt,disabledFolders:[],mode:"selection",className:"folderSelectionTree",defaultExpandAll:!0})}),(0,i.jsx)(d.A.Item,{name:"folderName",style:{display:"none"},rules:[{required:!0,validator:(e,t)=>"string"==typeof t&&0===t.trim().length?Promise.reject(new Error(C("Enter the name of the folder"))):Promise.resolve()}],children:(0,i.jsx)(h.A,{})}),(0,i.jsx)(d.A.Item,{name:"is_force_create",style:{display:"none"},children:(0,i.jsx)(h.A,{})})]})})]})})]})},{Sider:CM,Content:_M}=R.A,SM={keywords:""},AM=()=>{var e,t,n;const r=so(),a=(()=>{const{state:e}=Ei(),{files:t,loading:n,isUrlModalVisible:r}=e,i=ra(),a=(()=>{const{state:e}=Ei(),t=e.multiSelect,n=la(e=>e.selectedFiles),r=la(e=>e.toggleFileSelection),i=la(e=>e.setMultiSelect);return(0,o.useEffect)(()=>{i(!1!==t)},[t,i]),{state:{selectedFiles:n},actions:{toggleFileSelection:r}}})(),s=pa(i.fetchFiles);return{state:{files:t||[],selectedFiles:a.state.selectedFiles,loading:n||!1,isAddingFileByUrl:r||!1,isRenamingFile:s.state.isRenamingFile,fileToRename:s.state.fileToRename},actions:{fetchFiles:i.fetchFiles,handleDeleteFile:i.handleDeleteFile,handleDeleteFolder:i.handleDeleteFolder,handleAddFile:i.handleAddFile,handleAddFileByUrl:i.handleAddFileByUrl,handleDroppedFiles:i.handleDroppedFiles,uploadFileWithProvider:i.uploadFileWithProvider,toggleFileSelection:a.actions.toggleFileSelection,showRenameModal:s.actions.showRenameModal,handleRenameCancel:s.actions.handleRenameCancel,handleRenameOk:s.actions.handleRenameOk,showMoveModal:s.actions.showMoveModal,handleMoveCancel:s.actions.handleMoveCancel,handleMoveOk:s.actions.handleMoveOk,showCopyModal:s.actions.showCopyModal,handleCopyCancel:s.actions.handleCopyCancel,handleCopyOk:s.actions.handleCopyOk,showDeleteConfirm:s.actions.showDeleteConfirm,handleDeleteConfirmCancel:s.actions.handleDeleteConfirmCancel,handleDeleteConfirmOk:s.actions.handleDeleteConfirmOk}}})(),l=(()=>{var e,t;const{state:n,actions:r,options:i}=Ei(),{selectedFolder:a,pathHistory:s,folders:l}=n,{t:c}=En(),{setSelectedFolder:u,setPathHistory:d}=r,h=(0,o.useCallback)(()=>{var e;return`em_fm:lastFolder:${(null===(e=null==i?void 0:i.config)||void 0===e?void 0:e.projectId)||"default"}`},[null===(e=null==i?void 0:i.config)||void 0===e?void 0:e.projectId]),f=(0,o.useCallback)((e,t=new Set)=>{if(t.has(e))return[];const n=(Array.isArray(l)?l:[]).find(t=>t.id===e);if(!n)return[];const r=new Set(t);return r.add(e),n.parentId?n.parentId===n.id?[{id:n.id,name:n.name+" (\u043e\u0448\u0438\u0431\u043a\u0430)"}]:[...f(n.parentId,r),{id:n.id,name:n.name}]:[{id:n.id,name:n.name}]},[l]),p=(0,o.useCallback)(e=>{var t;if("undefined"==typeof window)return;const n=!0===(null===(t=null==i?void 0:i.config)||void 0===t?void 0:t.rememberLastFolder),r=h();try{if(!n)return void localStorage.removeItem(r);e?localStorage.setItem(r,e):localStorage.removeItem(r)}catch(e){}},[h,null===(t=null==i?void 0:i.config)||void 0===t?void 0:t.rememberLastFolder]),g=(0,o.useCallback)(e=>{if("folders"===e){const e=[{id:"folders",name:c("Folders")}];return null==d||d(e),void(i.onPathChange&&i.onPathChange([]))}if(!(Array.isArray(l)?l:[]).find(t=>t.id===e))return;const t=f(e),n=[{id:"folders",name:c("Folders")},...t];null==d||d(n),i.onPathChange&&i.onPathChange(n.map(e=>e.name))},[l,f,d,i,c]),m=(0,o.useCallback)(e=>{const t="folders"===e?null:e;t!==a&&(null==u||u(t),p(t),g(e))},[p,a,u,g]),v=(0,o.useCallback)(e=>{if(-1===e)null==u||u(null),null==d||d([{id:"folders",name:c("Folders")}]),i.onPathChange&&i.onPathChange([]);else{const t=s.slice(0,e+1),n=t[t.length-1],r="folders"===n.id?void 0:n.id;null==u||u(r||null),null==d||d(t),i.onPathChange&&i.onPathChange(t.map(e=>e.name))}},[i,s,d,u,c]),y=(0,o.useCallback)(e=>{if(!e.isFolder)return;null==u||u(e.id);const t={id:e.id,name:e.name};if(d){const e=[...s,t];d(e)}if(i.onPathChange){const t=[...s.map(e=>e.name),e.name];i.onPathChange(t)}},[i,s,d,u]);return{state:{selectedFolder:a,pathHistory:s},actions:{handleFolderSelect:m,handleBreadcrumbClick:v,handleItemClick:y},selectedFolder:a,pathHistory:s,handleFolderSelect:m,handleBreadcrumbClick:v,handleItemClick:y}})(),c=(()=>{const{state:e,actions:t}=Ei(),{pagination:n}=e,{setPagination:r}=t,i=(0,o.useCallback)((e,t)=>{const i=t||n.pageSize;null==r||r({current:e,pageSize:i,total:n.total})},[n.pageSize,n.total,r]);return{state:{pagination:n},actions:{handlePaginationChange:i}}})(),u=(()=>{const[e,t]=o.useState(()=>{const e=localStorage.getItem(ga);return e?Math.max(290,parseInt(e,10)):298}),[n,r]=o.useState(!1),[i,a]=o.useState(!1),[s,l]=o.useState(0),c=o.useCallback(()=>{t(298),localStorage.setItem(ga,298..toString())},[]),u=o.useCallback(n=>{n.preventDefault(),n.stopPropagation(),r(!0),document.body.classList.add("resizing");const i=n.clientX,o=e;let s=o;const c=e=>{e.preventDefault();const n=Math.max(Math.min(o+e.clientX-i,600),290);s=n,t(n),l(e.clientX),a(!0)},u=()=>{r(!1),document.body.classList.remove("resizing"),a(!1),localStorage.setItem(ga,s.toString()),document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",u)};document.addEventListener("mousemove",c),document.addEventListener("mouseup",u)},[e]);return o.useEffect(()=>()=>{document.body.classList.remove("resizing")},[]),{sidebarWidth:e,isResizing:n,showResizeGuide:i,resizeGuidePosition:s,handleResizeStart:u,handleDoubleClick:c}})(),d=(()=>{const[e,t]=(0,o.useState)([]),[n,r]=(0,o.useState)(!1),[i,a]=(0,o.useState)(!1),s=(0,o.useRef)(0),l=(0,o.useRef)(new Map),c=(0,o.useCallback)(()=>(s.current+=1,`upload_${s.current}_${Date.now()}`),[]),u=(0,o.useCallback)(e=>Bi(e.size),[]),d=(0,o.useCallback)((e,n)=>{const i=n.map(t=>({id:c(),folderId:e,name:t.name,size:u(t),status:"uploading",progress:0}));return t(i),r(!0),a(!1),i.map(e=>e.id)},[c,u]),h=(0,o.useCallback)((e,n)=>{const i={id:c(),folderId:e,name:n,size:void 0,status:"uploading",progress:0};return t(e=>[...e,i]),r(!0),a(!1),i.id},[c]),f=(0,o.useCallback)((e,n)=>{t(t=>t.map(t=>t.id===e?Object.assign(Object.assign({},t),{progress:Math.min(100,Math.max(0,n))}):t))},[]),p=(0,o.useCallback)((e,n)=>{n&&l.current.set(e,n),t(t=>t.map(t=>{if(t.id===e){const e=Object.assign(Object.assign({},t),{status:"success",progress:100});return(null==n?void 0:n.name)&&(e.name=n.name),(null==n?void 0:n.size)&&void 0===t.size&&(e.size=Bi(n.size)),e}return t}))},[]),g=(0,o.useCallback)((e,n)=>{t(t=>t.map(t=>t.id===e?Object.assign(Object.assign({},t),{status:"error",error:n}):t))},[]),m=(0,o.useCallback)(()=>{r(!1),a(!1),setTimeout(()=>{t([]),l.current.clear()},300)},[]),v=(0,o.useCallback)(()=>{a(e=>!e)},[]),y=(0,o.useCallback)(e=>l.current.get(e),[]),b=e.length,w=e.filter(e=>"success"===e.status||"error"===e.status).length;return{uploadFiles:e,isUploadVisible:n,isUploadMinimized:i,totalFiles:b,completedFiles:w,startUpload:d,startUploadByUrl:h,updateProgress:f,markAsSuccess:p,markAsError:g,getUploadedFile:y,closeUpload:m,minimizeUpload:v}})(),h=ra(),{deleteItems:f}=lo(),p=Ni(),{t:g}=En(),{options:v,state:y,actions:b}=Ei(),w=v,x=null==w?void 0:w.onChangeSelection,C=y,_=null==w?void 0:w.config,{dataProviders:S}=w,{form:A,urlForm:k,renameForm:E,moveForm:I,renameFolderForm:j,copyForm:T,isModalVisible:F,isUrlModalVisible:M,isMoveModalVisible:P,isRenameFolderModalVisible:L,isCopyModalVisible:N,isDeleteConfirmVisible:D,folderToRename:z,activeLibraryItem:B}=y,{setIsUrlModalVisible:U,setActiveLibraryItem:V}=b,{config:H}=v,{DropZoneFileIcon:W}=ji(),[$,G]=(0,o.useState)(!1),[q,Y]=(0,o.useState)(!1),[X,K]=(0,o.useState)(!1),Z=(0,o.useRef)(0),J=(0,o.useRef)(!1);J.current=q;const Q=o.useRef(null),ee=o.useRef([]),[te,ne]=(0,o.useState)(!1),[re,ie]=(0,o.useState)(!1),oe=la(e=>e.selectedFiles),ae=la(e=>e.clearSelection),se=la(e=>e.syncVisibleFiles),{folders:le,loading:ce}=r.state,{fetchFolders:ue,fetchChildFolders:he,handleCreateFolder:fe,handleModalOk:pe,handleModalCancel:ge,generateMenuItems:me}=r.actions,ve=(e=>{var t;const{state:n,actions:r,options:i}=Ei(),{t:a}=En(),s=Ni(),{folders:l,folderToRename:c,renameFolderForm:u,isRenameFolderModalVisible:d}=n,{setFolderToRename:h,setIsRenameFolderModalVisible:f}=r,{apiEndpoints:p,dataProviders:g,config:m}=i,v=(0,o.useCallback)(e=>{null==h||h(e),null==f||f(!0);const t=null==l?void 0:l.find(t=>t.id===e);t&&u&&u.setFieldsValue({newFolderName:t.name})},[h,f,l,u]),y=(0,o.useCallback)(()=>{null==f||f(!1),null==h||h(null),null==u||u.resetFields()},[f,h,u]),b=(0,o.useCallback)(async()=>{var t,n;if(c&&u)try{const i=await u.validateFields();if(!(null==i?void 0:i.newFolderName))return void s.warning({id:"FOLDER_OPERATION_VALIDATION_FAILED",message:a("Folder name cannot be empty"),placement:"bottomRight",data:{folderId:c,folderName:null==i?void 0:i.newFolderName,reason:"emptyName"}});if(!1===(null===(t=null==m?void 0:m.features)||void 0===t?void 0:t.enableRenameFolder))return void s.error({id:"FOLDER_RENAME_DISABLED_BY_CONFIG",message:a("Folder rename is disabled by config"),placement:"bottomRight",data:{itemId:null!=c?c:void 0,itemName:null==i?void 0:i.newFolderName}});if(!(null==g?void 0:g.renameFolder))throw new Error(a("renameFolder is not implemented in dataProviders"));const o=await g.renameFolder(c,i.newFolderName.trim());if(!(null==o?void 0:o.id))return void s.error({id:"FOLDER_RENAME_FAILED",message:a("Unexpected response when renaming folder"),placement:"bottomRight",data:{itemId:null!=c?c:void 0,itemName:i.newFolderName,error:{message:"invalidResponse"}}});s.success({id:"FOLDER_RENAME_SUCCESS",message:a("Folder renamed"),placement:"bottomRight",data:{itemId:o.id,itemName:o.name,folderId:null!==(n=o.parentId)&&void 0!==n?n:null}}),y(),await e(),c!==o.id&&r.setSelectedFolder&&r.setSelectedFolder(o.id)}catch(e){s.error({id:"FOLDER_RENAME_FAILED",message:a("Failed to rename folder"),placement:"bottomRight",innerException:e,data:{itemId:null!=c?c:void 0,itemName:null==u?void 0:u.getFieldValue("newFolderName"),error:{message:e instanceof Error?e.message:String(e)}}})}},[c,u,p,y,e,a,null===(t=null==m?void 0:m.features)||void 0===t?void 0:t.enableRenameFolder,s]);return{state:{isRenamingFolder:d||!1,folderToRename:c},actions:{showRenameFolderModal:v,handleRenameFolderCancel:y,handleRenameFolderOk:b}}})(ue),{files:ye,loading:be,isRenamingFile:we,fileToRename:xe}=a.state,{fetchFiles:Ce,handleDeleteFile:_e,handleDeleteFolder:Se,handleAddFile:Ae,handleAddFileByUrl:ke,showRenameModal:Ee,handleRenameCancel:Ie,handleRenameOk:je,handleDroppedFiles:Te,showMoveModal:Fe,handleMoveCancel:Oe,handleMoveOk:Me,handleCopyOk:Pe,handleCopyCancel:Re,showDeleteConfirm:Le,handleDeleteConfirmCancel:Ne,handleDeleteConfirmOk:De}=a.actions,{selectedFolder:ze,pathHistory:Be}=l.state,{handleFolderSelect:Ue,handleItemClick:Ve}=l.actions,{pagination:He}=c.state,We=Li(Ce),{searchTerm:$e,sortBy:Ge,sortOrder:qe}=We.state,{handleSearch:Ye,handleSort:Xe,handlePaginationChange:Ke}=We.actions,Ze=(0,o.useCallback)(async()=>{const e=(e=>Zi(e))(Be||[]);try{await eo({options:w,pathFolder:e,dataProviders:null==w?void 0:w.dataProviders})}catch(e){}await ue(),await Ce({folderId:ze||"",page:He.current,limit:He.pageSize,search:$e,sortBy:Ge,sortOrder:qe,itemType:"all"})},[Ce,ue,w,He,Be,$e,ze,Ge,qe]),Je=(({files:e,fetchFiles:t,selectedFolder:n})=>{const{t:r}=En(),i=Ni(),{options:a,actions:s,state:l}=o.useContext(ki),{setActiveLibraryItem:c}=s,{activeLibraryItem:u}=l,d=ra(),[h,f]=o.useState(!1),[p,g]=o.useState(null),m=o.useCallback(e=>{var t;if(e.type&&e.type.startsWith("image/"))return!0;if(e.extension){const t=e.extension.toLowerCase();return Yt.includes(t)}const n=null===(t=e.name.split(".").pop())||void 0===t?void 0:t.toLowerCase();return!!n&&Yt.includes(n)},[]),v=o.useCallback(async(e,t)=>{var n,i;const{dataProviders:o}=a;if(!1===(null===(i=null===(n=a.config)||void 0===n?void 0:n.features)||void 0===i?void 0:i.enableUpdateFile))throw new co(r("Updating files is disabled by configuration"),"UnsupportedOperation");if(!e.id||!e.thumbnail||!(null==o?void 0:o.updateFile))throw new co(r("Failed to save changes"),"UnsupportedOperation");const s=(null==t?void 0:t.mimeType)||an(e.thumbnail,e.type),l=sn(s),c=e.name.lastIndexOf("."),u=`${c>0?e.name.substring(0,c):e.name}.${l}`,d=(null==t?void 0:t.blob)||un(e.thumbnail,s);return o.updateFile(e.id,{name:u,type:s,data:d})},[a,r]),y=o.useCallback(async(e,t)=>{var n;if(!e.thumbnail)throw new co(r("Failed to save changes"),"ValidationError");const i=null!==(n=e.saveWithoutFolder)&&void 0!==n?n:!e.id,o=(null==t?void 0:t.mimeType)||an(e.thumbnail,e.type),a=(null==t?void 0:t.blob)||un(e.thumbnail,o),s=new File([a],e.name,{type:o,lastModified:Date.now()}),l=await d.uploadFileWithProvider(s,e.folderId||void 0,void 0,i);if(!l)throw new co(r("Failed to save image copy"),"FileWriteError");return l},[d,r]),b=o.useCallback(t=>{let n;if(t)n=t;else{const t=la.getState().selectedFiles;if(1!==t.size)return;const r=Array.from(t)[0];if(n=e.find(e=>e.id===r),!n||n.isFolder||!m(n))return}c&&c(Ut),g(n),f(!0)},[e,m,f,c]),w=o.useCallback(()=>{c&&u===Ut&&c(Lt),f(!1),g(null)},[u,c]),x=o.useCallback(async(e,o)=>{var s,l,c,u,d,h;try{const c=await v(e,o);return i.success({id:"IMAGE_UPDATE_SUCCESS",message:r("Success"),description:r("Image updated successfully"),placement:"bottomRight",data:{itemId:null!==(s=null==c?void 0:c.id)&&void 0!==s?s:void 0,itemName:null==c?void 0:c.name,folderId:null!==(l=null==c?void 0:c.folderId)&&void 0!==l?l:null,thumbnail:null==c?void 0:c.thumbnail}}),c&&a.onEditorOk&&a.onEditorOk(c),await t({folderId:n||""}),w(),null!=c?c:void 0}catch(t){const o=Gi(t),a=null!==(u=null!==(c=Wi(null==o?void 0:o.code,r))&&void 0!==c?c:null==o?void 0:o.message)&&void 0!==u?u:r("Failed to save changes");throw i.error({id:"IMAGE_SAVE_FAILED",message:a,innerException:t,placement:"bottomRight",data:{itemId:null!==(d=e.id)&&void 0!==d?d:void 0,itemName:e.name,folderId:null!==(h=e.folderId)&&void 0!==h?h:null,thumbnail:e.thumbnail}}),t.notificationShown=!0,t}},[v,a,t,n,i,w,r]),C=o.useCallback(async(e,o)=>{var s,l,c,u,d,h;try{const c=await y(e,o);return i.success({id:"IMAGE_SAVE_COPY_SUCCESS",message:r("Success"),description:r("Image copy saved successfully"),placement:"bottomRight",data:{itemId:null!==(s=null==c?void 0:c.id)&&void 0!==s?s:void 0,itemName:null==c?void 0:c.name,folderId:null!==(l=null==c?void 0:c.folderId)&&void 0!==l?l:null,thumbnail:null==c?void 0:c.thumbnail}}),c&&a.onEditorOk&&a.onEditorOk(c),await t({folderId:n||""}),w(),null!=c?c:void 0}catch(t){const o=Gi(t),a=null!==(u=null!==(c=Wi(null==o?void 0:o.code,r))&&void 0!==c?c:null==o?void 0:o.message)&&void 0!==u?u:r("Failed to save image copy");throw i.error({id:"IMAGE_SAVE_COPY_FAILED",message:a,innerException:t,placement:"bottomRight",data:{itemId:null!==(d=e.id)&&void 0!==d?d:void 0,itemName:e.name,folderId:null!==(h=e.folderId)&&void 0!==h?h:null,thumbnail:e.thumbnail}}),t.notificationShown=!0,t}},[y,a,t,n,i,w,r]);return{isPixieEditorVisible:h,editingFile:p,handleEdit:b,handlePixieEditorSave:x,handlePixieEditorSaveCopy:C,handlePixieEditorClose:w}})({files:ye||[],fetchFiles:Ce,selectedFolder:ze||null}),[Qe,et]=(0,o.useState)(!1),tt=(0,o.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),!e.dataTransfer||!e.dataTransfer.types||!e.dataTransfer.types.includes("Files"))return;e.dataTransfer.dropEffect="copy";const t=e.relatedTarget,n=e.currentTarget;t&&n.contains(t)||(Z.current+=1,Z.current>0&&G(!0))},[]),nt=(0,o.useCallback)(e=>{e.preventDefault(),e.stopPropagation();const t=e.relatedTarget,n=e.currentTarget;if(t&&!n.contains(t))Z.current=Math.max(0,Z.current-1),Z.current<=0&&G(!1);else if(t){const e=t.closest('[class*="dragOverlay"]');if(e&&n.contains(e))return}},[]),rt=(0,o.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),e.dataTransfer&&(e.dataTransfer.dropEffect="copy")},[]),it=(0,o.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),G(!1),Z.current=0;const t=(()=>{var t;const n=e.dataTransfer;if(!n)return[];if(null===(t=n.files)||void 0===t?void 0:t.length)return Array.from(n.files);const r=[];if(n.items)for(let e=0;e<n.items.length;e++){const t=n.items[e].getAsFile();t&&r.push(t)}return r})();t.length&&(et(!0),Te(t).catch(e=>{null==e||e.name}).finally(()=>{et(!1)}))},[Te]),ot=(0,o.useCallback)(()=>{G(!1),Z.current=0,document.body.removeAttribute("data-fm-dragging"),K(!1),Y(!1)},[]);o.useEffect(()=>{ee.current=ye||[]},[ye]);const at=null==C?void 0:C.activeLibraryItem;(0,o.useEffect)(()=>{const e=e=>{e?document.body.setAttribute("data-fm-dragging","true"):document.body.removeAttribute("data-fm-dragging")};let t=!1;const n=n=>{var r,i;!t&&(null===(i=null===(r=n.dataTransfer)||void 0===r?void 0:r.types)||void 0===i?void 0:i.includes("Files"))&&(t=!0,K(!0),e(!0),at===Lt&&Y(!0))},r=n=>{const r=n.relatedTarget;(!r||!document.documentElement.contains(r))&&t&&(t=!1,K(!1),Y(!1),e(!1))};return window.addEventListener("dragenter",n,!0),window.addEventListener("dragleave",r,!0),()=>{window.removeEventListener("dragenter",n,!0),window.removeEventListener("dragleave",r,!0),document.body.removeAttribute("data-fm-dragging")}},[at]),(0,o.useEffect)(()=>{const e=e=>{var t,n;if(document.body.removeAttribute("data-fm-dragging"),K(!1),!(null===(n=null===(t=e.dataTransfer)||void 0===t?void 0:t.types)||void 0===n?void 0:n.includes("Files")))return;e.preventDefault();const r=(e=>{var t;if(!e)return[];if(null===(t=e.files)||void 0===t?void 0:t.length)return Array.from(e.files);const n=[];if(e.items)for(let r=0;r<e.items.length;r++){const t=e.items[r].getAsFile();t&&n.push(t)}return n})(e.dataTransfer);if(!r.length)return;const i=e.target,o=i.closest(`.${va.filesContainer.replace(/\s+/g,".")}`)||i.closest("[data-files-container]"),a=i.closest(".em-filemanager")||i.closest(".file-manager__layout")||i.closest("[data-drop-overlay]")||i.closest("[data-drag-capture]");(J.current||$||o||a)&&(e.preventDefault(),e.stopPropagation(),Y(!1),G(!1),Z.current=0,et(!0),Te(r).catch(e=>{null==e||e.name}).finally(()=>et(!1)))},t=e=>{var t,n;(null===(n=null===(t=e.dataTransfer)||void 0===t?void 0:t.types)||void 0===n?void 0:n.includes("Files"))&&(e.preventDefault(),e.dataTransfer.dropEffect="copy",document.body.hasAttribute("data-fm-dragging")||(document.body.setAttribute("data-fm-dragging","true"),K(!0)),at!==Lt||J.current||Y(!0))},n=e=>{var t,n;(null===(n=null===(t=e.dataTransfer)||void 0===t?void 0:t.types)||void 0===n?void 0:n.includes("Files"))&&(e.preventDefault(),e.dataTransfer.dropEffect="copy",document.body.setAttribute("data-fm-dragging","true"),K(!0))},r={capture:!0,passive:!1};return window.addEventListener("drop",e,r),window.addEventListener("dragover",t,r),window.addEventListener("dragenter",n,r),()=>{window.removeEventListener("drop",e,r),window.removeEventListener("dragover",t,r),window.removeEventListener("dragenter",n,r)}},[$,Te,at]),(0,o.useEffect)(()=>{const e=e=>{$&&ot(),Y(!1),K(!1),document.body.removeAttribute("data-fm-dragging")};return window.addEventListener("dragend",e,!0),()=>window.removeEventListener("dragend",e,!0)},[$,ot]),(0,o.useEffect)(()=>{let e=null;const t=t=>{$&&(e=setTimeout(()=>{$&&ot()},200))};return document.addEventListener("mouseup",t,!0),()=>{document.removeEventListener("mouseup",t,!0),e&&clearTimeout(e)}},[$,ot]),(0,o.useEffect)(()=>{const e=e=>{"Escape"===e.key&&$&&ot()};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[$,ot]),(0,o.useEffect)(()=>{const e=e=>{$&&setTimeout(()=>{$&&ot()},100)};return document.addEventListener("click",e,!0),()=>{document.removeEventListener("click",e,!0)}},[$,ot]);const st=o.useCallback(async()=>{await De(),await ue(),ze===Vt&&he&&await he(Vt),requestAnimationFrame(()=>{requestAnimationFrame(()=>{var e,t;return null===(t=null===(e=Q.current)||void 0===e?void 0:e.refreshFileCounts)||void 0===t?void 0:t.call(e)})})},[ue,he,De,ze]),lt=o.useCallback(()=>{ie(!0)},[]),ct=o.useCallback(async()=>{var e,t;if(ze===Vt)try{if(null==S?void 0:S.cleanTrash){const t=await S.cleanTrash();await Ce({folderId:Vt}),await(null===(e=Q.current)||void 0===e?void 0:e.refreshFileCounts()),t.success?p.success({id:"TRASH_CLEARED_SUCCESS",message:g("Trash cleared successfully"),description:g("{{count}} items permanently deleted",{count:t.deletedCount||0}),placement:"bottomRight"}):p.error({id:"TRASH_CLEAR_FAILED",message:g("Failed to clear trash"),placement:"bottomRight"})}else{const e=ee.current||[];if(0===e.length)return void ie(!1);const n=e.map(e=>({id:e.id,isFolder:e.isFolder})),r=await f({items:n,selectedFolder:Vt,getItemNameById:t=>{var n;return(null===(n=e.find(e=>e.id===t))||void 0===n?void 0:n.name)||t||""},showNotifications:!1});await Ce({folderId:Vt}),await(null===(t=Q.current)||void 0===t?void 0:t.refreshFileCounts());const{successCount:i,failCount:o}=r;0===o?p.success({id:"TRASH_CLEARED_SUCCESS",message:g("Trash cleared successfully"),description:g("{{count}} items permanently deleted",{count:i}),placement:"bottomRight"}):i>0?p.warning({id:"TRASH_CLEARED_PARTIAL",message:g("Trash partially cleared"),description:g("{{succeeded}} items deleted, {{failed}} items failed",{succeeded:i,failed:o}),placement:"bottomRight"}):p.error({id:"TRASH_CLEAR_FAILED",message:g("Failed to clear trash"),placement:"bottomRight"})}ie(!1)}catch(e){p.error({id:"TRASH_CLEAR_ERROR",message:g("Error clearing trash"),placement:"bottomRight"}),ie(!1)}else ie(!1)},[ze,S,Ce,p,g,f]),ut=o.useCallback(()=>{ie(!1)},[]),dt=o.useCallback(async e=>{var t;await Me(e),await(null===(t=Q.current)||void 0===t?void 0:t.refreshFileCounts())},[Me]),ht=o.useCallback(async e=>{var t;await Pe(e),await(null===(t=Q.current)||void 0===t?void 0:t.refreshFileCounts())},[Pe]),ft=o.useCallback(async()=>{let e=[],t=new Map;const n=null==w?void 0:w.config;await Ae({onStartBatch:r=>{e=d.startUpload(ze||void 0,r),t=new Map,r.forEach((r,i)=>{const o=e[i];o&&(t.set(r.name,o),t.set(oo(r.name,n),o))})},onStart:r=>{if(0===e.length){e=d.startUpload(ze||void 0,[r]);const i=e[0];i&&(t.set(r.name,i),t.set(oo(r.name,n),i))}},onProgress:(e,n)=>{const r=t.get(e);r&&d.updateProgress(r,n)},onComplete:async e=>{var n;const r=t.get(e);if(r){await new Promise(e=>setTimeout(e,100));const t=null==ye?void 0:ye.find(t=>t.name===e&&!t.isFolder);d.markAsSuccess(r,t)}await(null===(n=Q.current)||void 0===n?void 0:n.refreshFileCounts())},onError:(n,r,i)=>{var o;const a=null!==(o=t.get(n))&&void 0!==o?o:null!=i&&i<e.length?e[i]:void 0;a&&d.markAsError(a,r)},onBatchComplete:async n=>{var r,i,o,a,s,l,c,u;for(let h=0;h<n.successes.length;h++){const u=n.successes[h],f=null===(r=n.uploadedFiles)||void 0===r?void 0:r.get(u),p=null!==(a=null!==(o=null!==(i=t.get(u))&&void 0!==i?i:(null==f?void 0:f.originalFileName)?t.get(f.originalFileName):void 0)&&void 0!==o?o:null!=(null==f?void 0:f.originalIndex)&&f.originalIndex<e.length?e[f.originalIndex]:void 0)&&void 0!==a?a:h<e.length?e[h]:void 0;if(p){let e;if(null==f?void 0:f.id){const t=f;e={id:t.id,name:null!==(s=t.name)&&void 0!==s?s:u,folderId:null!==(c=null!==(l=t.folderId)&&void 0!==l?l:ze)&&void 0!==c?c:null,isFolder:!1,size:t.size}}else await new Promise(e=>setTimeout(e,100)),e=null==ye?void 0:ye.find(e=>e.name===u&&!e.isFolder);d.updateProgress(p,100),d.markAsSuccess(p,e)}}n.errors.forEach(({fileName:e,error:n})=>{const r=t.get(e);r&&d.markAsError(r,n)}),await(null===(u=Q.current)||void 0===u?void 0:u.refreshFileCounts())}})},[Ae,d,ye,ze,null==w?void 0:w.config]),pt=o.useCallback(async(e,t,n,r)=>{var i,o;try{ne(!0);let a=n||"uploaded-file";if(!n&&e){const t=e.split("?")[0].split("#")[0].split("/");a=t[t.length-1]||"uploaded-file",a.includes(".")&&(null===(i=a.split(".").pop())||void 0===i?void 0:i.length)&&a.split(".").pop().length<=5||(a+=".jpg")}const s=d.startUploadByUrl(ze||void 0,a);try{const n=await ke(e,t,!0,null!=r?r:"uploadByUrl");if(d.updateProgress(s,100),n){await new Promise(e=>setTimeout(e,100));const e=(null==ye?void 0:ye.find(e=>e.id===n.id&&!e.isFolder))||n;d.markAsSuccess(s,e)}else d.markAsSuccess(s);await(null===(o=Q.current)||void 0===o?void 0:o.refreshFileCounts())}catch(e){const t=Gi(e),n=Ki(t,g);d.markAsError(s,n)}}finally{ne(!1)}},[ke,d,ze,ye,g]),gt=o.useCallback(async({file:e})=>{var t;const n=d.startUpload(ze||void 0,[e])[0];let r=0;const i=setInterval(()=>{r=Math.min(r+10+Math.floor(Date.now()%10),90),d.updateProgress(n,r)},200);try{const r=await h.uploadFileWithProvider(e,void 0,!0);if(clearInterval(i),d.updateProgress(n,100),r){await new Promise(e=>setTimeout(e,100));const e=(null==ye?void 0:ye.find(e=>e.id===r.id&&!e.isFolder))||r;d.markAsSuccess(n,e)}else d.markAsSuccess(n);const o=r&&r.folderId||ze||null;return Ue&&Ue(o&&"folders"!==o?o:"folders"),await(null===(t=Q.current)||void 0===t?void 0:t.refreshFileCounts()),r}catch(e){clearInterval(i);const t=e instanceof Error?e.message:String(e);throw d.markAsError(n,t),e}},[h,d,ze,ye,Ue]),mt=o.useCallback(async e=>{var t;if(Te){const n=d.startUpload(ze||void 0,e);e.forEach(async(e,t)=>{const r=n[t];if(!r)return;let i=0;const o=setInterval(()=>{i=Math.min(i+10+Math.floor(Date.now()%10),85),d.updateProgress(r,i)},200);setTimeout(()=>{clearInterval(o)},2e3)}),await Te(e),n.forEach(e=>{d.updateProgress(e,100),d.markAsSuccess(e)}),await(null===(t=Q.current)||void 0===t?void 0:t.refreshFileCounts())}},[Te,d,ze]),vt=o.useCallback(async e=>{var t;await Se(e),await ue(),await(null===(t=Q.current)||void 0===t?void 0:t.refreshFileCounts())},[Se,ue]),yt=(({files:e,clearSelection:t,showRenameModal:n,showMoveModal:r,showCopyModal:i,handleDeleteFile:a,handleDeleteFolder:s,showDeleteConfirm:l,onEdit:c})=>{const u=o.useCallback(()=>{t()},[t]),d=o.useCallback(e=>{const t=la.getState().selectedFiles;if(t&&1===t.size||e){const r=e||Array.from(t)[0];n(r)}},[n]),h=o.useCallback(t=>{const n=la.getState().selectedFiles;if(n&&n.size>0||(null==t?void 0:t.id)){if(l)return void l();(t?[t.id]:n).forEach(t=>{const n=e.find(e=>e.id===t);n&&(n.isFolder?s(t):a(t))})}},[e,a,s,l]);return{handleClearSelection:u,handleRename:d,handleDeleteSelected:h,handleCopy:o.useCallback(()=>{i()},[i]),handleMove:o.useCallback(()=>{r()},[r]),handleEdit:o.useCallback(()=>{c()},[c])}})({files:ye||[],clearSelection:ae,showRenameModal:Ee,showMoveModal:Fe,showCopyModal:a.actions.showCopyModal||(()=>{}),handleDeleteFile:_e,handleDeleteFolder:vt,showDeleteConfirm:Le,onEdit:Je.handleEdit}),bt=ce||be||Qe;(0,o.useEffect)(()=>{nn()},[]),(0,o.useLayoutEffect)(()=>{B!==Lt?ae():se(ye||[])},[B,ye,se,ae]),(0,o.useEffect)(()=>{if(!x||B!==Lt)return;if(!cn.current)return void(cn.current=!0);const e=(Array.isArray(ye)?ye:[]).filter(e=>oe.has(e.id));x(e)},[B,ye,oe,x]),o.useEffect(()=>{if(!Ue||0===le.length)return;const e=!1!==(null==_?void 0:_.rememberLastFolder),t=`em_fm:lastFolder:${(null==_?void 0:_.projectId)||"default"}`;if(e&&"undefined"!=typeof window)try{const e=localStorage.getItem(t),n=e&&le.some(t=>t.id===e);if(n)return void Ue(e)}catch(e){}ze||Ue("folders")},[ze,Ue,le,null==_?void 0:_.rememberLastFolder,null==_?void 0:_.projectId]);const{handleRenameFolderCancel:wt,handleRenameFolderOk:xt}=ve.actions;(0,o.useEffect)(()=>{const e=async e=>{if(B!==Lt)return;const t=document.activeElement;if(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||"true"===(null==t?void 0:t.getAttribute("contenteditable")))return;const n=e.clipboardData;if(!n)return;const r=Array.from(n.items),i=r.filter(e=>e.type.startsWith("image/"));if(i.length>0){const t=i.map(e=>e.getAsFile()).filter(e=>null!==e);return void(t.length>0&&(e.preventDefault(),await mt(t)))}const o=r.find(e=>"text/plain"===e.type);o&&o.getAsString(async t=>{const n=t.trim();if(n.startsWith("http://")||n.startsWith("https://"))e.preventDefault(),await pt(n);else if(n.includes("<meta")||n.includes("http")){const t=n.match(/https?:\/\/[^\s"']+/);t&&(e.preventDefault(),await pt(t[0]))}})};return document.addEventListener("paste",e),()=>{document.removeEventListener("paste",e)}},[B,pt,mt]);const Ct=(0,o.useRef)(He);(0,o.useEffect)(()=>{Ct.current=He},[He]);const _t=(0,o.useCallback)(e=>{Ke(e.current||Ct.current.current,e.pageSize||Ct.current.pageSize)},[Ke]),St=(0,o.useCallback)(e=>{null==Ve||Ve(e)},[Ve]),At=o.useCallback(e=>{const{sortBy:t,sortOrder:n}=(e=>{const[t,n]=e.split("-");return{sortBy:t,sortOrder:n}})(e);Xe(t,n)},[Xe]),[kt,Et]=(0,o.useState)(SM),[It,jt]=(0,o.useState)([]),Tt=(0,o.useRef)(null),[Ft,Ot]=(0,o.useState)(Zt),[Mt,Pt]=(0,o.useState)([]),Rt=(0,o.useRef)(null),[Ht,Wt]=(0,o.useState)(""),$t=(0,o.useRef)(null),[Gt,qt]=(0,o.useState)(""),[Kt,Jt]=(0,o.useState)([]),Qt=o.useRef(void 0),[en,tn]=(0,o.useState)(!1),[rn,on]=(0,o.useState)(!1),ln=o.useRef(null),cn=o.useRef(!1),dn=o.useRef(B),hn=o.useCallback(e=>{const t=e.indexOf(",");if(-1===t)return null;const n=e.substring(0,t),r=n.match(/^data:([^;]+)/),i=r&&r[1]||"image/svg+xml";let o,a="svg";if(i.includes("png")?a="png":(i.includes("jpeg")||i.includes("jpg"))&&(a="jpg"),/;base64/i.test(n)){const n=e.substring(t+1),r=atob(n),a=new Uint8Array(r.length);for(let e=0;e<r.length;e+=1)a[e]=r.charCodeAt(e);o=new Blob([a],{type:i})}else{const n=decodeURIComponent(e.substring(t+1));o=new Blob([n],{type:i})}return new File([o],`icon_${Date.now()}.${a}`,{type:i})},[]),fn=o.useCallback(async e=>{var t;const n=d.startUpload(ze||void 0,[e])[0];let r=0;const i=setInterval(()=>{r=Math.min(r+10+Math.floor(Date.now()%10),90),d.updateProgress(n,r)},200);try{const r=await h.uploadFileWithProvider(e,void 0,!0);if(clearInterval(i),d.updateProgress(n,100),r){await new Promise(e=>setTimeout(e,100));const e=(null==ye?void 0:ye.find(e=>e.id===r.id&&!e.isFolder))||r;d.markAsSuccess(n,e)}else d.markAsSuccess(n);await(null===(t=Q.current)||void 0===t?void 0:t.refreshFileCounts())}catch(e){clearInterval(i);const t=e instanceof Error?e.message:String(e);throw d.markAsError(n,t),e}},[d,ye,h,ze]),pn=(0,o.useCallback)(async e=>{if(Boolean(e&&e.startsWith("data:"))){const t=hn(e);if(!t)return;return void await fn(t)}e&&await pt(e,void 0,void 0,"iconStock")},[hn,pt,fn]),gn=(0,o.useCallback)(async()=>{const e=null==H?void 0:H.fileForEdit;if(Qt.current!==e&&B===Ut&&e&&!Je.editingFile){Qt.current=e;try{if("string"==typeof e){if(e.startsWith("data:"))return void(null==Je||Je.handleEdit({thumbnail:e,saveWithoutFolder:!0}));const t=await h.resolveFileForEditByUrl(e);Qt.current===e&&(null==Je||Je.handleEdit(t))}}catch(t){Qt.current===e&&(Qt.current=null),null==Je||Je.handlePixieEditorClose()}}},[null==H?void 0:H.fileForEdit,B,Je,h]);(0,o.useEffect)(()=>{gn()},[gn]),(0,o.useEffect)(()=>{var e,t,n,r;const i=dn.current;dn.current=B,B===Lt?(jt([]),Et(SM),Pt([]),Ot(Zt),Jt([]),qt(""),on(!1),tn(!1),i===Lt||i!==Dt&&i!==Nt&&i!==Bt||Ye("")):B===Bt?null===(e=ln.current)||void 0===e||e.focus():B===Nt?null===(t=Tt.current)||void 0===t||t.focus():B===Dt?null===(n=Rt.current)||void 0===n||n.focus():B===zt&&(null===(r=$t.current)||void 0===r||r.focus())},[B,Ye]);const mn=o.useCallback(async()=>{var e;await xt(),await(null===(e=Q.current)||void 0===e?void 0:e.refreshFileCounts())},[xt]),vn=oe.size,yn=o.useMemo(()=>{var e,t,n;if(1!==vn)return!1;const[r]=Array.from(oe),i=ye.find(e=>e.id===r);if(!i||i.isFolder)return!1;const o="string"==typeof i.name?i.name:"",a=o?null===(e=o.split(".").pop())||void 0===e?void 0:e.toLowerCase():void 0,s=null!==(n=null===(t=i.extension)||void 0===t?void 0:t.toLowerCase())&&void 0!==n?n:a;return"string"==typeof i.type&&i.type.startsWith("image/")||"string"==typeof s&&Xt.includes(s)},[vn,oe,ye]),bn=(0,o.useCallback)(e=>{var t;return e?(null===(t=e.files)||void 0===t?void 0:t.length)?Array.from(e.files):e.items?Array.from(e.items).map(e=>e.getAsFile()).filter(e=>Boolean(e)):[]:[]},[]);return(0,i.jsxs)(i.Fragment,{children:[X&&at===Lt&&(0,de.createPortal)((0,i.jsx)("div",{className:va.dragCaptureLayer,"data-drag-capture":"true",onDragOver:e=>{var t,n;e.preventDefault(),e.stopPropagation(),e.dataTransfer&&(e.dataTransfer.dropEffect="copy"),(null===(n=null===(t=e.dataTransfer)||void 0===t?void 0:t.types)||void 0===n?void 0:n.includes("Files"))&&!J.current&&Y(!0)},onDragEnter:e=>{var t,n;e.preventDefault(),e.stopPropagation(),(null===(n=null===(t=e.dataTransfer)||void 0===t?void 0:t.types)||void 0===n?void 0:n.includes("Files"))&&Y(!0)},onDragLeave:e=>{const t=e.relatedTarget;t&&document.documentElement.contains(t)||(Y(!1),K(!1),document.body.removeAttribute("data-fm-dragging"))},onDrop:e=>{e.preventDefault(),e.stopPropagation(),K(!1),Y(!1),document.body.removeAttribute("data-fm-dragging");const t=bn(e.dataTransfer);t.length&&(et(!0),Te(t).catch(e=>{null==e||e.name}).finally(()=>et(!1)))},"aria-hidden":"true"}),document.body),q&&(0,de.createPortal)((0,i.jsx)("div",{className:va.dragOverlayGlobal,"data-drop-overlay":"true",onDragOver:e=>{e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="copy")},onDragEnter:e=>e.preventDefault(),onDrop:e=>{e.preventDefault(),e.stopPropagation(),Y(!1),K(!1),document.body.removeAttribute("data-fm-dragging");const t=bn(e.dataTransfer);t.length&&(et(!0),Te(t).catch(e=>{null==e||e.name}).finally(()=>et(!1)))},"aria-hidden":"true",children:(0,i.jsxs)("div",{className:va.dragOverlayInner,children:[(0,i.jsx)("div",{className:va.uploadIcon,children:(0,i.jsx)(W,{})}),(0,i.jsx)("div",{className:va.textTitle,children:g("Drop files here to upload")}),(0,i.jsx)("div",{className:va.textDescription,children:g("Supported files:")+" .jpg, .jpeg, .svg, .png"})]})}),document.body),(0,i.jsx)(R.A,{className:"file-manager__layout",children:(0,i.jsxs)("div",{className:va.filesContainer,"data-files-container":"true",onDragOver:rt,onDragLeave:nt,onDragEnter:tt,onDrop:it,children:[$&&(0,i.jsx)("div",{className:va.dragOverlay,children:(0,i.jsxs)("div",{className:va.dragOverlayInner,children:[(0,i.jsx)("div",{className:va.uploadIcon,children:(0,i.jsx)(W,{})}),(0,i.jsx)("div",{className:va.textTitle,children:g("Drop files here to upload")}),(0,i.jsx)("div",{className:va.textDescription,children:g("Supported files:")+" .jpg, .jpeg, .svg, .png"})]})}),u.showResizeGuide&&(0,i.jsx)("div",{className:"resize-guide",style:{left:`${u.resizeGuidePosition}px`}}),(0,i.jsxs)(R.A,{className:"file-manager__content",children:[(0,i.jsxs)(CM,{width:320,theme:"light",className:"file-manager-sider",children:[(0,i.jsx)(ns,{ref:Q,selectedFolder:ze||"folders",generateMenuItems:me,onFolderSelect:e=>null==Ue?void 0:Ue(e),folders:le||[],fetchFolders:ue,fetchChildFolders:he,handleAddFile:ft,setIsUrlModalVisible:e=>null==U?void 0:U(e),handleDeleteFolder:vt,handleCreateFolder:fe,activeLibraryItem:B,setActiveLibraryItem:e=>null==V?void 0:V(e)}),(0,i.jsx)("div",{className:"sidebar-resizer "+(u.isResizing?"resizing":""),onMouseDown:u.handleResizeStart,onDoubleClick:u.handleDoubleClick,children:(0,i.jsx)("div",{className:"sidebar-resizer-indicator"})})]}),(0,i.jsxs)(R.A,{className:"file-manager__main-content",children:[Qe&&(0,i.jsx)(Xa,{style:{position:"absolute",width:"100%",height:"100%",top:0,left:0,zIndex:100,background:"var(--colorBgLayout)"}}),(0,i.jsxs)(_M,{className:"main-content",children:[(0,i.jsx)(FO,{activeLibraryItem:B,selectedFolder:(null===(e=null==le?void 0:le.find(e=>(null==e?void 0:e.id)===ze))||void 0===e?void 0:e.name)||g("Folders"),isTrashFolder:"Trash"===ze,onClearTrash:lt,files:ye||[],loading:bt,onRefresh:Ze,refreshDisabled:be||ce,showRefresh:!(!(null===(t=null==w?void 0:w.apiEndpoints)||void 0===t?void 0:t.clearCache)&&!(null===(n=null==w?void 0:w.dataProviders)||void 0===n?void 0:n.clearCache))}),(0,i.jsx)(O.A,{className:"zero-divider"}),B===Lt&&(0,i.jsx)(Wa,{searchTerm:$e,handleAddFile:ft,files:ye||[],handleSearch:Ye,sortBy:Ge,sortOrder:qe,handleSortOptionChange:At,pagination:He,setPagination:_t,loading:bt,handleItemClick:St,onClearSelection:yt.handleClearSelection,onRename:yt.handleRename,onCopy:yt.handleCopy,onMove:yt.handleMove,onDelete:yt.handleDeleteSelected,showRenameModal:Ee,showDeleteConfirm:Le,showCopyModal:a.actions.showCopyModal||(()=>{}),showMoveModal:Fe,onEdit:Je.handleEdit,getFileData:h.getFileData}),B===Nt&&(0,i.jsx)(GO,{imageGifList:It,setImageGifList:jt,currentReqGif:kt,setCurrentReqGif:Et,inputRef:Tt,customRequest:(e,t)=>pt(e,void 0,t,"gif")}),B===Dt&&(0,i.jsx)(KO,{imageStockList:Mt,setImageStockList:Pt,currentReq:Ft,setCurrentReq:Ot,inputRef:Rt,customRequest:(e,t)=>pt(e,void 0,t,"imageStock")}),B===zt&&(0,i.jsx)(xM,{apiKey:null==H?void 0:H.STREAMLINE_API_KEY,customRequest:pn,query:Ht,setQuery:Wt,inputRef:$t}),B===Bt&&!!(null==H?void 0:H.sseQuery)&&(0,i.jsx)(rM,{imageAiList:Kt,setImageAiList:Jt,aiImageRequest:Gt,setAiImageRequest:qt,inputAiRef:ln,customRequest:gt,isLoadingAi:en,setIsLoadingAi:tn,isImageUploaded:rn,setIsImageUploaded:on}),B===Ut&&(0,i.jsx)(i.Fragment,{}),(0,i.jsx)(i.Fragment,{children:yn&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(O.A,{className:"zero-divider"}),(0,i.jsx)("div",{style:{display:"flex",justifyContent:"right",padding:"17px 24px",alignItems:"center"},children:(0,i.jsx)(m.Ay,{size:"large",type:"primary",style:{height:40},onClick:()=>{if(v.onEditorOk){const e=Array.from(oe)[0],t=ye.find(t=>t.id===e);t&&v.onEditorOk(t)}},children:g("Choose")})})]})})]})]})]}),te&&!d.isUploadVisible&&(0,i.jsx)("div",{style:{position:"fixed",inset:0,zIndex:1500,backgroundColor:"rgba(255, 255, 255, 0.5)",pointerEvents:"all",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,i.jsx)(s.A,{size:"large"})}),(0,i.jsx)(es,{isModalVisible:F,handleModalOk:pe,handleModalCancel:ge,form:A,selectedFolder:ze||null,folders:le||[],isUrlModalVisible:M,setIsUrlModalVisible:e=>null==U?void 0:U(e),handleAddFileByUrl:pt,urlForm:k,isRenameModalVisible:we,handleRenameOk:()=>null==je?void 0:je(),handleRenameCancel:()=>null==Ie?void 0:Ie(),renameForm:E,fileToRename:xe,files:ye||[],isMoveModalVisible:P,handleMoveOk:dt,handleMoveCancel:Oe,moveForm:I,selectedFiles:oe||new Set,isRenameFolderModalVisible:L,handleRenameFolderOk:mn,handleRenameFolderCancel:wt,renameFolderForm:j,folderToRename:z,isCopyModalVisible:N,handleCopyOk:ht,handleCopyCancel:Re,copyForm:T,isDeleteConfirmVisible:D,handleDeleteConfirmOk:st,handleDeleteConfirmCancel:()=>null==Ne?void 0:Ne(),isClearTrashConfirmVisible:re,handleClearTrashConfirm:ct,handleClearTrashCancel:ut,fetchChildFolders:he}),(0,i.jsx)(kO,{visible:Je.isPixieEditorVisible,onClose:Je.handlePixieEditorClose,file:Je.editingFile,onSave:Je.handlePixieEditorSave,onSaveCopy:Je.handlePixieEditorSaveCopy}),(0,i.jsx)(IO,{files:d.uploadFiles,visible:d.isUploadVisible,minimized:d.isUploadMinimized,totalFiles:d.totalFiles,completedFiles:d.completedFiles,onClose:d.closeUpload,onMinimize:d.minimizeUpload,onInsert:e=>{var t;const n=d.getUploadedFile(e.id)||e;null===(t=v.onEditorOk)||void 0===t||t.call(v,n)}})]})})]})},kM=(0,o.memo)(({config:e={},onPathChange:t,onChangeSelection:n,onEditorOk:r,searchQuery:a="",sortBySize:s="name",apiEndpoints:l={},customIcons:d,dragDropIcon:h,dataProviders:f,handleNotify:p,handleError:g,handleSuccess:m})=>{const v=o.useMemo(()=>Object.assign({folderTreeLoading:"lazy",expandAllFoldersOnInit:!1,expandRootFolderOnInit:!1,iconStrokeWidth:1.4,availableImageExtensions:["jpg","jpeg","png","gif"],fileNameProcessing:Object.assign(Object.assign({},{transliterate:!0,replaceSpaces:!0,removeForbiddenChars:!0,toLowerCase:!0}),e.fileNameProcessing),folderNameProcessing:Object.assign(Object.assign({},{transliterate:!0,replaceSpaces:!0,removeForbiddenChars:!0,toLowerCase:!0}),e.folderNameProcessing)},e),[e]);o.useEffect(()=>{v.theme&&(e=>{if("system"===e){const t=matchMedia(Gt).matches?Wt:Ht;e=e===$t?t:e}document.documentElement.setAttribute("data-theme",e)})(v.theme),(e=>{(null==e?void 0:e.customTheme)&&((e={})=>{const t=document.querySelector("head");if(!t)return;const n=document.createElement("style");if(n.type="text/css",n.dataset.themeVariablesFm="true",n.setAttribute("data-file-manager","true"),Object.entries(e).length){let r="";Object.entries(e).forEach(([e,t])=>{"object"!=typeof t&&(r+=`\t--${e}: ${t};\n`)}),r=`.em-filemanager {\n${r}}`,n.appendChild(document.createTextNode(r));const i=t.querySelector('[data-theme-variables-fm="true"]');i?t.replaceChild(n,i):t.insertBefore(n,t.firstChild)}})(null==e?void 0:e.customTheme)})(v)},[v]),(0,o.useEffect)(()=>{v.locale&&v.locale!==yr.language&&yr.changeLanguage(v.locale),v.customLocale&&v.locale&&yr.addResourceBundle(v.locale,"translation",v.customLocale,!0,!0)},[v.locale,v.customLocale]);const y=(0,o.useRef)(null),b=o.useMemo(()=>({apiEndpoints:l,searchQuery:a,sortBySize:s,onPathChange:t,onChangeSelection:n,onEditorOk:r,config:v,customIcons:d,dragDropIcon:h,dataProviders:f,handleNotify:p,handleError:g,handleSuccess:m}),[l,a,s,t,n,r,v,d,h,f,p,g,m]);return(0,i.jsx)(u.A,{className:"em-filemanager",children:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(c.Ay,{getPopupContainer:()=>y.current||document.body,children:(0,i.jsx)(Ii,{options:b,children:(0,i.jsx)(AM,{})})}),(0,i.jsx)("div",{ref:y,className:"file-manager-modal-root"})]})})});kM.displayName="FileManagerApp";const EM=e=>{var t,n,r;return(0,i.jsx)(In,{i18n:yr,children:(0,i.jsx)(en,{externalTheme:null!==(n=null===(t=e.config)||void 0===t?void 0:t.theme)&&void 0!==n?n:"light",customThemeToken:null===(r=e.config)||void 0===r?void 0:r.customTheme,children:(0,i.jsx)(V.A,{children:(0,i.jsx)(kM,Object.assign({},e))})})})},IM=(new Map,new Map,e=>{var t,n;const{onClose:r,onSave:a,dataProviders:s,theme:l,locale:d}=e,h=o.useCallback(async(e,t,n,r)=>{if(!e&&!t||!(null==s?void 0:s.getFiles))return null;try{const i=await s.getFiles({folderId:r?void 0:n||void 0,noFolder:r,search:t||void 0,itemType:"file",page:1,limit:1}),[o]=i.files;return o?e&&o.id!==e?null:o:null}catch(e){return null}},[s]),f=o.useMemo(()=>{if(e.file)return e.file;const t=e.name||"edited-image",n=e.extension||(e.type?e.type.split("/")[1]:"png"),r=e.type||`image/${n}`;return{thumbnail:e.imageDataUrl||"",name:t,id:void 0,type:r,extension:n,saveWithoutFolder:!0}},[e.file,e.imageDataUrl,e.name,e.extension,e.type]),p=o.useCallback(async(e,t)=>{if((null==s?void 0:s.updateFile)&&e.thumbnail)try{const n=(null==t?void 0:t.mimeType)||an(e.thumbnail,e.type),r=sn(n),i=e.name.substring(0,e.name.lastIndexOf("."))+"."+r,o=(null==t?void 0:t.blob)||un(e.thumbnail,n);return await s.updateFile(e.id,{name:i,type:n,data:o})}catch(e){return null}return null},[s]),g=o.useCallback(async(e,t)=>{var n,r,i,o,a,l;if(!e.thumbnail)return null;try{const c=null!==(n=e.saveWithoutFolder)&&void 0!==n?n:!e.id,u=c?"":e.folderId||"",d=(null==t?void 0:t.mimeType)||an(e.thumbnail,e.type),f=(null==t?void 0:t.blob)||un(e.thumbnail,d),p=new File([f],e.name,{type:d,lastModified:Date.now()});if(null==s?void 0:s.uploadFiles){const t=await s.uploadFiles({items:[{name:p.name,size:p.size,type:p.type,folderId:u,noFolder:c,data:p,extension:sn(d)}],folderId:u}),n=null===(r=t.detailed)||void 0===r?void 0:r[0];if(t.success&&(null==n?void 0:n.success)&&n.data){const t=n.data;if(t.url||t.thumbnailUrl||t.thumbnail)return{id:t.id||e.id||"",name:t.name||e.name,folderId:null!==(i=t.folderId)&&void 0!==i?i:u,type:t.type||p.type,size:null!==(o=t.size)&&void 0!==o?o:p.size,extension:t.extension||sn(d),url:t.url,thumbnailUrl:t.thumbnailUrl,thumbnail:t.thumbnail,date:t.date,dimensions:t.dimensions,aspectRatio:t.aspectRatio,sourceUrl:t.sourceUrl,isFolder:!1,selected:!1};return await h(n.data.id,n.data.name||p.name,null!==(a=n.data.folderId)&&void 0!==a?a:u,c)||{id:n.data.id||e.id||"",name:n.data.name||e.name,folderId:null!==(l=n.data.folderId)&&void 0!==l?l:u,type:p.type,size:p.size,extension:sn(d),url:n.data.url,thumbnailUrl:n.data.thumbnailUrl,thumbnail:n.data.thumbnail,isFolder:!1,selected:!1}}}return(null==s?void 0:s.uploadFile)?await s.uploadFile({name:p.name,size:p.size,type:p.type,folderId:u,noFolder:c,data:p,extension:sn(d)}):null}catch(e){return null}},[s,h]),m=o.useCallback(async(e,t)=>{if((null==s?void 0:s.updateFile)&&e.id&&e.thumbnail)try{const n=await p(e,t);n&&(e=n)}catch(e){}return a&&await a(e,t),r&&r(),e},[s,a,r,p]),v=o.useCallback(async(e,t)=>{let n=e;if(e.thumbnail)try{const r=await g(e,t);r&&(n=r)}catch(e){}return a&&await a(n,t),r&&r(),n},[r,a,g]),y=(0,o.useRef)(null);return(0,o.useEffect)(()=>{d&&d!==yr.language&&yr.changeLanguage(d)},[d]),(0,i.jsx)(u.A,{className:"em-filemanager",children:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(c.Ay,{getPopupContainer:()=>y.current||document.body,children:(0,i.jsx)(In,{i18n:yr,children:(0,i.jsx)(en,{externalTheme:null!=l?l:"light",children:(0,i.jsx)(V.A,{children:(0,i.jsx)(Ii,{options:{dataProviders:s,handleNotify:e.handleNotify,handleError:e.handleError,handleSuccess:e.handleSuccess,config:{theme:null!=l?l:"light",locale:d,baseUrl:e.baseUrl,assetsUrl:e.assetsUrl,compressMaxSize:e.compressMaxSize,compressMaxWidthOrHeight:e.compressMaxWidthOrHeight,compessorUrl:null!==(t=e.compessorUrl)&&void 0!==t?t:e.compressorUrl,compressorUrl:null!==(n=e.compressorUrl)&&void 0!==n?n:e.compessorUrl,showNotifications:e.showNotifications,handleFileProxy:e.handleFileProxy}},children:(0,i.jsx)(kO,{visible:!0,onClose:r,file:f,onSave:m,onSaveCopy:v})})})})})}),(0,i.jsx)("div",{ref:y,className:"file-manager-modal-root"})]})})})}}]);
|
|
3
|
+
//# sourceMappingURL=3628.e132c341.js.map
|