diff --git a/docs/404.html b/docs/404.html index b9d12a8..8da2c5b 100644 --- a/docs/404.html +++ b/docs/404.html @@ -1 +1 @@ -404: This page could not be found.T2 Model Viewer & Skinner

404

This page could not be found.

\ No newline at end of file +404: This page could not be found.T2 Model Viewer & Skinner

404

This page could not be found.

\ No newline at end of file diff --git a/docs/404/index.html b/docs/404/index.html index b9d12a8..8da2c5b 100644 --- a/docs/404/index.html +++ b/docs/404/index.html @@ -1 +1 @@ -404: This page could not be found.T2 Model Viewer & Skinner

404

This page could not be found.

\ No newline at end of file +404: This page could not be found.T2 Model Viewer & Skinner

404

This page could not be found.

\ No newline at end of file diff --git a/docs/_next/static/VY3oqBwyqvlStXl38ih2v/_buildManifest.js b/docs/_next/static/-yFPMzbzcZfNmotCttmg4/_buildManifest.js similarity index 100% rename from docs/_next/static/VY3oqBwyqvlStXl38ih2v/_buildManifest.js rename to docs/_next/static/-yFPMzbzcZfNmotCttmg4/_buildManifest.js diff --git a/docs/_next/static/VY3oqBwyqvlStXl38ih2v/_clientMiddlewareManifest.json b/docs/_next/static/-yFPMzbzcZfNmotCttmg4/_clientMiddlewareManifest.json similarity index 100% rename from docs/_next/static/VY3oqBwyqvlStXl38ih2v/_clientMiddlewareManifest.json rename to docs/_next/static/-yFPMzbzcZfNmotCttmg4/_clientMiddlewareManifest.json diff --git a/docs/_next/static/VY3oqBwyqvlStXl38ih2v/_ssgManifest.js b/docs/_next/static/-yFPMzbzcZfNmotCttmg4/_ssgManifest.js similarity index 100% rename from docs/_next/static/VY3oqBwyqvlStXl38ih2v/_ssgManifest.js rename to docs/_next/static/-yFPMzbzcZfNmotCttmg4/_ssgManifest.js diff --git a/docs/_next/static/chunks/6cb39dc61a422734.js b/docs/_next/static/chunks/6cb39dc61a422734.js new file mode 100644 index 0000000..b5d976c --- /dev/null +++ b/docs/_next/static/chunks/6cb39dc61a422734.js @@ -0,0 +1 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,43794,(t,e,r)=>{!function(){"use strict";var r={}.hasOwnProperty;function i(){for(var t=[],e=0;e{t.v(t.b(["static/chunks/9338a92aac995757.js","static/chunks/a55df98dcb3b60ad.js","static/chunks/turbopack-95cb340f669027bc.js"]))},67585,(t,e,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"BailoutToCSR",{enumerable:!0,get:function(){return n}});let i=t.r(32061);function n(t){let{reason:e,children:r}=t;if("undefined"==typeof window)throw Object.defineProperty(new i.BailoutToCSRError(e),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return r}},9885,(t,e,r)=>{"use strict";function i(t){return t.split("/").map(t=>encodeURIComponent(t)).join("/")}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"encodeURIPath",{enumerable:!0,get:function(){return i}})},52157,(t,e,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"PreloadChunks",{enumerable:!0,get:function(){return o}});let i=t.r(43476),n=t.r(74080),s=t.r(63599),a=t.r(9885);function o(t){let{moduleIds:e}=t;if("undefined"!=typeof window)return null;let r=s.workAsyncStorage.getStore();if(void 0===r)return null;let o=[];if(r.reactLoadableManifest&&e){let t=r.reactLoadableManifest;for(let r of e){if(!t[r])continue;let e=t[r].files;o.push(...e)}}return 0===o.length?null:(0,i.jsx)(i.Fragment,{children:o.map(t=>{let e=r.assetPrefix+"/_next/"+(0,a.encodeURIPath)(t);return t.endsWith(".css")?(0,i.jsx)("link",{precedence:"dynamic",href:e,rel:"stylesheet",as:"style"},t):((0,n.preload)(e,{as:"script",fetchPriority:"low"}),null)})})}},69093,(t,e,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return h}});let i=t.r(43476),n=t.r(71645),s=t.r(67585),a=t.r(52157);function o(t){return{default:t&&"default"in t?t.default:t}}let l={loader:()=>Promise.resolve(o(()=>null)),loading:null,ssr:!0},h=function(t){let e={...l,...t},r=(0,n.lazy)(()=>e.loader().then(o)),h=e.loading;function c(t){let o=h?(0,i.jsx)(h,{isLoading:!0,pastDelay:!0,error:null}):null,l=!e.ssr||!!e.loading,c=l?n.Suspense:n.Fragment,u=e.ssr?(0,i.jsxs)(i.Fragment,{children:["undefined"==typeof window?(0,i.jsx)(a.PreloadChunks,{moduleIds:e.modules}):null,(0,i.jsx)(r,{...t})]}):(0,i.jsx)(s.BailoutToCSR,{reason:"next/dynamic",children:(0,i.jsx)(r,{...t})});return(0,i.jsx)(c,{...l?{fallback:o}:{},children:u})}return c.displayName="LoadableComponent",c}},70703,(t,e,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return n}});let i=t.r(55682)._(t.r(69093));function n(t,e){var r;let n={};"function"==typeof t&&(n.loader=t);let s={...n,...e};return(0,i.default)({...s,modules:null==(r=s.loadableGenerated)?void 0:r.modules})}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),e.exports=r.default)},52683,t=>{"use strict";let e,r,i,n,s;t.s(["default",()=>da],52683);var a,o,l,h,c,u,d,f,g,p,m,y,x,b,_,w,C,S,T,O,k,M,E,D,j,A,P,F,L,R,I,B,N,W,U,H,X,V,z,Y,G,q,K,Q,J=t.i(43476),Z=t.i(71645);function $(t,e,r){var i;return(e="symbol"==typeof(i=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(e,"string"))?i:i+"")in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function tt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,i)}return r}function te(t){for(var e=1;e=0)continue;r[i]=t[i]}return r}(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i=0||({}).propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function ti(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}class tn{constructor(){$(this,"browserShadowBlurConstant",1),$(this,"DPI",96),$(this,"devicePixelRatio","undefined"!=typeof window?window.devicePixelRatio:1),$(this,"perfLimitSizeTotal",2097152),$(this,"maxCacheSideLimit",4096),$(this,"minCacheSideLimit",256),$(this,"disableStyleCopyPaste",!1),$(this,"enableGLFiltering",!0),$(this,"textureSize",4096),$(this,"forceGLPutImageData",!1),$(this,"cachesBoundsOfCurve",!1),$(this,"fontPaths",{}),$(this,"NUM_FRACTION_DIGITS",4)}}let ts=new class extends tn{configure(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.assign(this,t)}addFonts(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.fontPaths=te(te({},this.fontPaths),t)}removeFonts(){(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach(t=>{delete this.fontPaths[t]})}clearFonts(){this.fontPaths={}}restoreDefaults(t){let e=new tn,r=(null==t?void 0:t.reduce((t,r)=>(t[r]=e[r],t),{}))||e;this.configure(r)}constructor(t){super(),this.configure(t)}},ta=function(t){for(var e=arguments.length,r=Array(e>1?e-1:0),i=1;ithis.testPrecision(e,t)),e.getExtension("WEBGL_lose_context").loseContext(),ta("log","WebGL: max texture size ".concat(this.maxTextureSize)))}isSupported(t){return!!this.maxTextureSize&&this.maxTextureSize>=t}}let tu={},td=()=>e||(e={document:document,window:window,isTouchSupported:"ontouchstart"in window||"ontouchstart"in document||window&&window.navigator&&window.navigator.maxTouchPoints>0,WebGLProbe:new tc,dispose(){},copyPasteData:tu}),tf=()=>td().document,tg=()=>td().window,tp=()=>{var t;return Math.max(null!=(t=ts.devicePixelRatio)?t:tg().devicePixelRatio,1)},tm=new class{getFontCache(t){let{fontFamily:e,fontStyle:r,fontWeight:i}=t;e=e.toLowerCase(),this.charWidthsCache[e]||(this.charWidthsCache[e]={});let n=this.charWidthsCache[e],s="".concat(r.toLowerCase(),"_").concat((i+"").toLowerCase());return n[s]||(n[s]={}),n[s]}clearFontCache(t){(t=(t||"").toLowerCase())?this.charWidthsCache[t]&&delete this.charWidthsCache[t]:this.charWidthsCache={}}limitDimsByArea(t){let{perfLimitSizeTotal:e}=ts,r=Math.sqrt(e*t);return[Math.floor(r),Math.floor(e/r)]}constructor(){$(this,"charWidthsCache",{}),$(this,"boundsOfCurveCache",{})}},tv="6.7.1";function ty(){}let tx=Math.PI/2,tb=2*Math.PI,t_=Math.PI/180,tw=Object.freeze([1,0,0,1,0,0]),tC="center",tS="left",tT="bottom",tO="right",tk="none",tM=/\r?\n/,tE="moving",tD="scaling",tj="rotating",tA="rotate",tP="skewing",tF="resizing",tL="modifyPoly",tR="changed",tI="scale",tB="scaleX",tN="scaleY",tW="skewX",tU="skewY",tH="fill",tX="stroke",tV="modified",tz="json",tY=new class{has(t){return this[tz].has(t)}getClass(t){let e=this[tz].get(t);if(!e)throw new to("No class registered for ".concat(t));return e}setClass(t,e){e?this[tz].set(e,t):(this[tz].set(t.type,t),this[tz].set(t.type.toLowerCase(),t))}getSVGClass(t){return this.svg.get(t)}setSVGClass(t,e){this.svg.set(null!=e?e:t.type.toLowerCase(),t)}constructor(){this[tz]=new Map,this.svg=new Map}},tG=new class extends Array{remove(t){let e=this.indexOf(t);e>-1&&this.splice(e,1)}cancelAll(){let t=this.splice(0);return t.forEach(t=>t.abort()),t}cancelByCanvas(t){if(!t)return[];let e=this.filter(e=>{var r;return e.target===t||"object"==typeof e.target&&(null==(r=e.target)?void 0:r.canvas)===t});return e.forEach(t=>t.abort()),e}cancelByTarget(t){if(!t)return[];let e=this.filter(e=>e.target===t);return e.forEach(t=>t.abort()),e}};class tq{on(t,e){return(this.__eventListeners||(this.__eventListeners={}),"object"==typeof t)?(Object.entries(t).forEach(t=>{let[e,r]=t;this.on(e,r)}),()=>this.off(t)):e?(this.__eventListeners[t]||(this.__eventListeners[t]=[]),this.__eventListeners[t].push(e),()=>this.off(t,e)):()=>!1}once(t,e){if("object"==typeof t){let e=[];return Object.entries(t).forEach(t=>{let[r,i]=t;e.push(this.once(r,i))}),()=>e.forEach(t=>t())}if(e){let r=this.on(t,function(){for(var t=arguments.length,i=Array(t),n=0;n!1}_removeEventListener(t,e){if(this.__eventListeners[t])if(e){let r=this.__eventListeners[t],i=r.indexOf(e);i>-1&&r.splice(i,1)}else this.__eventListeners[t]=[]}off(t,e){if(this.__eventListeners)if(void 0===t)for(let t in this.__eventListeners)this._removeEventListener(t);else"object"==typeof t?Object.entries(t).forEach(t=>{let[e,r]=t;this._removeEventListener(e,r)}):this._removeEventListener(t,e)}fire(t,e){var r;if(!this.__eventListeners)return;let i=null==(r=this.__eventListeners[t])?void 0:r.concat();if(i)for(let t=0;t{let r=t.indexOf(e);return -1!==r&&t.splice(r,1),t},tQ=t=>{if(0===t)return 1;switch(Math.abs(t)/tx){case 1:case 3:return 0;case 2:return -1}return Math.cos(t)},tJ=t=>{if(0===t)return 0;let e=Math.sign(t);switch(t/tx){case 1:return e;case 2:return 0;case 3:return-e}return Math.sin(t)};class tZ{add(t){return new tZ(this.x+t.x,this.y+t.y)}addEquals(t){return this.x+=t.x,this.y+=t.y,this}scalarAdd(t){return new tZ(this.x+t,this.y+t)}scalarAddEquals(t){return this.x+=t,this.y+=t,this}subtract(t){return new tZ(this.x-t.x,this.y-t.y)}subtractEquals(t){return this.x-=t.x,this.y-=t.y,this}scalarSubtract(t){return new tZ(this.x-t,this.y-t)}scalarSubtractEquals(t){return this.x-=t,this.y-=t,this}multiply(t){return new tZ(this.x*t.x,this.y*t.y)}scalarMultiply(t){return new tZ(this.x*t,this.y*t)}scalarMultiplyEquals(t){return this.x*=t,this.y*=t,this}divide(t){return new tZ(this.x/t.x,this.y/t.y)}scalarDivide(t){return new tZ(this.x/t,this.y/t)}scalarDivideEquals(t){return this.x/=t,this.y/=t,this}eq(t){return this.x===t.x&&this.y===t.y}lt(t){return this.xt.x&&this.y>t.y}gte(t){return this.x>=t.x&&this.y>=t.y}lerp(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5;return e=Math.max(Math.min(1,e),0),new tZ(this.x+(t.x-this.x)*e,this.y+(t.y-this.y)*e)}distanceFrom(t){let e=this.x-t.x,r=this.y-t.y;return Math.sqrt(e*e+r*r)}midPointFrom(t){return this.lerp(t)}min(t){return new tZ(Math.min(this.x,t.x),Math.min(this.y,t.y))}max(t){return new tZ(Math.max(this.x,t.x),Math.max(this.y,t.y))}toString(){return"".concat(this.x,",").concat(this.y)}setXY(t,e){return this.x=t,this.y=e,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setFromPoint(t){return this.x=t.x,this.y=t.y,this}swap(t){let e=this.x,r=this.y;this.x=t.x,this.y=t.y,t.x=e,t.y=r}clone(){return new tZ(this.x,this.y)}rotate(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t$,r=tJ(t),i=tQ(t),n=this.subtract(e);return new tZ(n.x*i-n.y*r,n.x*r+n.y*i).add(e)}transform(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return new tZ(t[0]*this.x+t[2]*this.y+(e?0:t[4]),t[1]*this.x+t[3]*this.y+(e?0:t[5]))}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;"object"==typeof t?(this.x=t.x,this.y=t.y):(this.x=t,this.y=e)}}let t$=new tZ(0,0),t0=t=>!!t&&Array.isArray(t._objects);function t1(t){class e extends t{_onObjectAdded(t){}_onObjectRemoved(t){}_onStackOrderChanged(t){}add(){for(var t=arguments.length,e=Array(t),r=0;rthis._onObjectAdded(t)),i}insertAt(t){for(var e=arguments.length,r=Array(e>1?e-1:0),i=1;ithis._onObjectAdded(t)),this._objects.length}remove(){let t=this._objects,e=[];for(var r=arguments.length,i=Array(r),n=0;n{let i=t.indexOf(r);-1!==i&&(t.splice(i,1),e.push(r),this._onObjectRemoved(r))}),e}forEachObject(t){this.getObjects().forEach((e,r,i)=>t(e,r,i))}getObjects(){for(var t=arguments.length,e=Array(t),r=0;rt.isType(...e))}item(t){return this._objects[t]}isEmpty(){return 0===this._objects.length}size(){return this._objects.length}contains(t,r){return!!this._objects.includes(t)||!!r&&this._objects.some(r=>r instanceof e&&r.contains(t,!0))}complexity(){return this._objects.reduce((t,e)=>t+=e.complexity?e.complexity():0,0)}sendObjectToBack(t){return!(!t||t===this._objects[0])&&(tK(this._objects,t),this._objects.unshift(t),this._onStackOrderChanged(t),!0)}bringObjectToFront(t){return!(!t||t===this._objects[this._objects.length-1])&&(tK(this._objects,t),this._objects.push(t),this._onStackOrderChanged(t),!0)}sendObjectBackwards(t,e){if(!t)return!1;let r=this._objects.indexOf(t);if(0!==r){let i=this.findNewLowerIndex(t,r,e);return tK(this._objects,t),this._objects.splice(i,0,t),this._onStackOrderChanged(t),!0}return!1}bringObjectForward(t,e){if(!t)return!1;let r=this._objects.indexOf(t);if(r!==this._objects.length-1){let i=this.findNewUpperIndex(t,r,e);return tK(this._objects,t),this._objects.splice(i,0,t),this._onStackOrderChanged(t),!0}return!1}moveObjectTo(t,e){return t!==this._objects[e]&&(tK(this._objects,t),this._objects.splice(e,0,t),this._onStackOrderChanged(t),!0)}findNewLowerIndex(t,e,r){let i;if(r){i=e;for(let r=e-1;r>=0;--r)if(t.isOverlapping(this._objects[r])){i=r;break}}else i=e-1;return i}findNewUpperIndex(t,e,r){let i;if(r){i=e;for(let r=e+1;r1&&void 0!==arguments[1]?arguments[1]:{},a=[],o=new tZ(e,r),l=o.add(new tZ(i,n));for(let t=this._objects.length-1;t>=0;t--){let e=this._objects[t];e.selectable&&e.visible&&(s&&e.intersectsWithRect(o,l)||e.isContainedWithinRect(o,l)||s&&e.containsPoint(o)||s&&e.containsPoint(l))&&a.push(e)}return a}constructor(){super(...arguments),$(this,"_objects",[])}}return e}class t2 extends tq{_setOptions(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};for(let e in t)this.set(e,t[e])}_setObject(t){for(let e in t)this._set(e,t[e])}set(t,e){return"object"==typeof t?this._setObject(t):this._set(t,e),this}_set(t,e){this[t]=e}toggle(t){let e=this.get(t);return"boolean"==typeof e&&this.set(t,!e),this}get(t){return this[t]}}function t5(t){return tg().requestAnimationFrame(t)}function t4(t){return tg().cancelAnimationFrame(t)}let t3=0,t9=()=>t3++,t6=()=>{let t=tf().createElement("canvas");if(!t||void 0===t.getContext)throw new to("Failed to create `canvas` element");return t},t8=()=>tf().createElement("img"),t7=t=>{let e=t6();return e.width=t.width,e.height=t.height,e},et=(t,e,r)=>t.toDataURL("image/".concat(e),r),ee=(t,e,r)=>new Promise((i,n)=>{t.toBlob(i,"image/".concat(e),r)}),er=t=>t*t_,ei=t=>t/t_,en=t=>t.every((t,e)=>t===tw[e]),es=(t,e,r)=>new tZ(t).transform(e,r),ea=t=>{let e=1/(t[0]*t[3]-t[1]*t[2]),r=[e*t[3],-e*t[1],-e*t[2],e*t[0],0,0],{x:i,y:n}=new tZ(t[4],t[5]).transform(r,!0);return r[4]=-i,r[5]=-n,r},eo=(t,e,r)=>[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],r?0:t[0]*e[4]+t[2]*e[5]+t[4],r?0:t[1]*e[4]+t[3]*e[5]+t[5]],el=(t,e)=>t.reduceRight((t,r)=>r&&t?eo(r,t,e):r||t,void 0)||tw.concat(),eh=t=>{let[e,r]=t;return Math.atan2(r,e)},ec=t=>{let e=eh(t),r=Math.pow(t[0],2)+Math.pow(t[1],2),i=Math.sqrt(r),n=(t[0]*t[3]-t[2]*t[1])/i,s=Math.atan2(t[0]*t[2]+t[1]*t[3],r);return{angle:ei(e),scaleX:i,scaleY:n,skewX:ei(s),skewY:0,translateX:t[4]||0,translateY:t[5]||0}},eu=function(t){return[1,0,0,1,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0]};function ed(){let{angle:t=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{x:e=0,y:r=0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=er(t),n=tQ(i),s=tJ(i);return[n,s,-s,n,e?e-(n*e-s*r):0,r?r-(s*e+n*r):0]}let ef=function(t){return[t,0,0,arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,0,0]},eg=t=>Math.tan(er(t)),ep=t=>[1,0,eg(t),1,0,0],em=t=>[1,eg(t),0,1,0,0],ev=t=>{let{scaleX:e=1,scaleY:r=1,flipX:i=!1,flipY:n=!1,skewX:s=0,skewY:a=0}=t,o=ef(i?-e:e,n?-r:r);return s&&(o=eo(o,ep(s),!0)),a&&(o=eo(o,em(a),!0)),o},ey=t=>{let{translateX:e=0,translateY:r=0,angle:i=0}=t,n=eu(e,r);i&&(n=eo(n,ed({angle:i})));let s=ev(t);return en(s)||(n=eo(n,s)),n},ex=function(t){let{signal:e,crossOrigin:r=null}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(i,n){let s;if(e&&e.aborted)return n(new tl("loadImage"));let a=t8();e&&(s=function(t){a.src="",n(t)},e.addEventListener("abort",s,{once:!0}));let o=function(){a.onload=a.onerror=null,s&&(null==e||e.removeEventListener("abort",s)),i(a)};t?(a.onload=o,a.onerror=function(){s&&(null==e||e.removeEventListener("abort",s)),n(new to("Error loading ".concat(a.src)))},r&&(a.crossOrigin=r),a.src=t):o()})},eb=function(t){let{signal:e,reviver:r=ty}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((i,n)=>{let s=[];e&&e.addEventListener("abort",n,{once:!0}),Promise.all(t.map(t=>tY.getClass(t.type).fromObject(t,{signal:e}).then(e=>(r(t,e),s.push(e),e)))).then(i).catch(t=>{s.forEach(t=>{t.dispose&&t.dispose()}),n(t)}).finally(()=>{e&&e.removeEventListener("abort",n)})})},e_=function(t){let{signal:e}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((r,i)=>{let n=[];e&&e.addEventListener("abort",i,{once:!0});let s=Object.values(t).map(t=>t&&t.type&&tY.has(t.type)?eb([t],{signal:e}).then(t=>{let[e]=t;return n.push(e),e}):t),a=Object.keys(t);Promise.all(s).then(t=>t.reduce((t,e,r)=>(t[a[r]]=e,t),{})).then(r).catch(t=>{n.forEach(t=>{t.dispose&&t.dispose()}),i(t)}).finally(()=>{e&&e.removeEventListener("abort",i)})})},ew=function(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]).reduce((e,r)=>(r in t&&(e[r]=t[r]),e),{})},eC=(t,e)=>Object.keys(t).reduce((r,i)=>(e(t[i],i,t)&&(r[i]=t[i]),r),{}),eS=(t,e)=>parseFloat(Number(t).toFixed(e)),eT=t=>"matrix("+t.map(t=>eS(t,ts.NUM_FRACTION_DIGITS)).join(" ")+")",eO=t=>!!t&&void 0!==t.toLive,ek=t=>!!t&&"function"==typeof t.toObject,eM=t=>!!t&&void 0!==t.offsetX&&"source"in t,eE=t=>!!t&&"multiSelectionStacking"in t;function eD(t){let e=t&&ej(t),r=0,i=0;if(!t||!e)return{left:r,top:i};let n=t,s=e.documentElement,a=e.body||{scrollLeft:0,scrollTop:0};for(;n&&(n.parentNode||n.host)&&((n=n.parentNode||n.host)===e?(r=a.scrollLeft||s.scrollLeft||0,i=a.scrollTop||s.scrollTop||0):(r+=n.scrollLeft||0,i+=n.scrollTop||0),1!==n.nodeType||"fixed"!==n.style.position););return{left:r,top:i}}let ej=t=>t.ownerDocument||null,eA=t=>{var e;return(null==(e=t.ownerDocument)?void 0:e.defaultView)||null},eP=function(t,e,r){let{width:i,height:n}=r,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;t.width=i,t.height=n,s>1&&(t.setAttribute("width",(i*s).toString()),t.setAttribute("height",(n*s).toString()),e.scale(s,s))},eF=(t,e)=>{let{width:r,height:i}=e;r&&(t.style.width="number"==typeof r?"".concat(r,"px"):r),i&&(t.style.height="number"==typeof i?"".concat(i,"px"):i)};function eL(t){return void 0!==t.onselectstart&&(t.onselectstart=()=>!1),t.style.userSelect=tk,t}class eR{createLowerCanvas(t){let e=t&&void 0!==t.getContext?t:t&&tf().getElementById(t)||t6();if(e.hasAttribute("data-fabric"))throw new to("Trying to initialize a canvas that has already been initialized. Did you forget to dispose the canvas?");return this._originalCanvasStyle=e.style.cssText,e.setAttribute("data-fabric","main"),e.classList.add("lower-canvas"),e}cleanupDOM(t){let{width:e,height:r}=t,{el:i}=this.lower;i.classList.remove("lower-canvas"),i.removeAttribute("data-fabric"),i.setAttribute("width","".concat(e)),i.setAttribute("height","".concat(r)),i.style.cssText=this._originalCanvasStyle||"",this._originalCanvasStyle=void 0}setDimensions(t,e){let{el:r,ctx:i}=this.lower;eP(r,i,t,e)}setCSSDimensions(t){eF(this.lower.el,t)}calcOffset(){return function(t){var e;let r=t&&ej(t),i={left:0,top:0};if(!r)return i;let n=(null==(e=eA(t))?void 0:e.getComputedStyle(t,null))||{};i.left+=parseInt(n.borderLeftWidth,10)||0,i.top+=parseInt(n.borderTopWidth,10)||0,i.left+=parseInt(n.paddingLeft,10)||0,i.top+=parseInt(n.paddingTop,10)||0;let s={left:0,top:0},a=r.documentElement;void 0!==t.getBoundingClientRect&&(s=t.getBoundingClientRect());let o=eD(t);return{left:s.left+o.left-(a.clientLeft||0)+i.left,top:s.top+o.top-(a.clientTop||0)+i.top}}(this.lower.el)}dispose(){td().dispose(this.lower.el),delete this.lower}constructor(t){$(this,"_originalCanvasStyle",void 0),$(this,"lower",void 0);let e=this.createLowerCanvas(t);this.lower={el:e,ctx:e.getContext("2d")}}}let eI={backgroundVpt:!0,backgroundColor:"",overlayVpt:!0,overlayColor:"",includeDefaultValues:!0,svgViewportTransformation:!0,renderOnAddRemove:!0,skipOffscreen:!0,enableRetinaScaling:!0,imageSmoothingEnabled:!0,controlsAboveOverlay:!1,allowTouchScrolling:!1,viewportTransform:[...tw]};class eB extends t1(t2){get lowerCanvasEl(){var t;return null==(t=this.elements.lower)?void 0:t.el}get contextContainer(){var t;return null==(t=this.elements.lower)?void 0:t.ctx}static getDefaults(){return eB.ownDefaults}initElements(t){this.elements=new eR(t)}add(){let t=super.add(...arguments);return arguments.length>0&&this.renderOnAddRemove&&this.requestRenderAll(),t}insertAt(t){for(var e=arguments.length,r=Array(e>1?e-1:0),i=1;i0&&this.renderOnAddRemove&&this.requestRenderAll(),n}remove(){let t=super.remove(...arguments);return t.length>0&&this.renderOnAddRemove&&this.requestRenderAll(),t}_onObjectAdded(t){t.canvas&&t.canvas!==this&&(ta("warn","Canvas is trying to add an object that belongs to a different canvas.\nResulting to default behavior: removing object from previous canvas and adding to new canvas"),t.canvas.remove(t)),t._set("canvas",this),t.setCoords(),this.fire("object:added",{target:t}),t.fire("added",{target:this})}_onObjectRemoved(t){t._set("canvas",void 0),this.fire("object:removed",{target:t}),t.fire("removed",{target:this})}_onStackOrderChanged(){this.renderOnAddRemove&&this.requestRenderAll()}getRetinaScaling(){return this.enableRetinaScaling?tp():1}calcOffset(){return this._offset=this.elements.calcOffset()}getWidth(){return this.width}getHeight(){return this.height}setWidth(t,e){return this.setDimensions({width:t},e)}setHeight(t,e){return this.setDimensions({height:t},e)}_setDimensionsImpl(t){let{cssOnly:e=!1,backstoreOnly:r=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e){let e=te({width:this.width,height:this.height},t);this.elements.setDimensions(e,this.getRetinaScaling()),this.hasLostContext=!0,this.width=e.width,this.height=e.height}r||this.elements.setCSSDimensions(t),this.calcOffset()}setDimensions(t,e){this._setDimensionsImpl(t,e),e&&e.cssOnly||this.requestRenderAll()}getZoom(){return this.viewportTransform[0]}setViewportTransform(t){this.viewportTransform=t,this.calcViewportBoundaries(),this.renderOnAddRemove&&this.requestRenderAll()}zoomToPoint(t,e){let r=[...this.viewportTransform],i=es(t,ea(r));r[0]=e,r[3]=e;let n=es(i,r);r[4]+=t.x-n.x,r[5]+=t.y-n.y,this.setViewportTransform(r)}setZoom(t){this.zoomToPoint(new tZ(0,0),t)}absolutePan(t){let e=[...this.viewportTransform];return e[4]=-t.x,e[5]=-t.y,this.setViewportTransform(e)}relativePan(t){return this.absolutePan(new tZ(-t.x-this.viewportTransform[4],-t.y-this.viewportTransform[5]))}getElement(){return this.elements.lower.el}clearContext(t){t.clearRect(0,0,this.width,this.height)}getContext(){return this.elements.lower.ctx}clear(){this.remove(...this.getObjects()),this.backgroundImage=void 0,this.overlayImage=void 0,this.backgroundColor="",this.overlayColor="",this.clearContext(this.getContext()),this.fire("canvas:cleared"),this.renderOnAddRemove&&this.requestRenderAll()}renderAll(){this.cancelRequestedRender(),this.destroyed||this.renderCanvas(this.getContext(),this._objects)}renderAndReset(){this.nextRenderHandle=0,this.renderAll()}requestRenderAll(){this.nextRenderHandle||this.disposed||this.destroyed||(this.nextRenderHandle=t5(()=>this.renderAndReset()))}calcViewportBoundaries(){let t=this.width,e=this.height,r=ea(this.viewportTransform),i=es({x:0,y:0},r),n=es({x:t,y:e},r),s=i.min(n),a=i.max(n);return this.vptCoords={tl:s,tr:new tZ(a.x,s.y),bl:new tZ(s.x,a.y),br:a}}cancelRequestedRender(){this.nextRenderHandle&&(t4(this.nextRenderHandle),this.nextRenderHandle=0)}drawControls(t){}renderCanvas(t,e){if(this.destroyed)return;let r=this.viewportTransform,i=this.clipPath;this.calcViewportBoundaries(),this.clearContext(t),t.imageSmoothingEnabled=this.imageSmoothingEnabled,t.patternQuality="best",this.fire("before:render",{ctx:t}),this._renderBackground(t),t.save(),t.transform(r[0],r[1],r[2],r[3],r[4],r[5]),this._renderObjects(t,e),t.restore(),this.controlsAboveOverlay||this.skipControlsDrawing||this.drawControls(t),i&&(i._set("canvas",this),i.shouldCache(),i._transformDone=!0,i.renderCache({forClipping:!0}),this.drawClipPathOnCanvas(t,i)),this._renderOverlay(t),this.controlsAboveOverlay&&!this.skipControlsDrawing&&this.drawControls(t),this.fire("after:render",{ctx:t}),this.__cleanupTask&&(this.__cleanupTask(),this.__cleanupTask=void 0)}drawClipPathOnCanvas(t,e){let r=this.viewportTransform;t.save(),t.transform(...r),t.globalCompositeOperation="destination-in",e.transform(t),t.scale(1/e.zoomX,1/e.zoomY),t.drawImage(e._cacheCanvas,-e.cacheTranslationX,-e.cacheTranslationY),t.restore()}_renderObjects(t,e){for(let r=0,i=e.length;r!t.excludeFromExport).map(r=>this._toObject(r,t,e))},this.__serializeBgOverlay(t,e)),i?{clipPath:i}:null)}_toObject(t,e,r){let i;this.includeDefaultValues||(i=t.includeDefaultValues,t.includeDefaultValues=!1);let n=t[e](r);return this.includeDefaultValues||(t.includeDefaultValues=!!i),n}__serializeBgOverlay(t,e){let r={},i=this.backgroundImage,n=this.overlayImage,s=this.backgroundColor,a=this.overlayColor;return eO(s)?s.excludeFromExport||(r.background=s.toObject(e)):s&&(r.background=s),eO(a)?a.excludeFromExport||(r.overlay=a.toObject(e)):a&&(r.overlay=a),i&&!i.excludeFromExport&&(r.backgroundImage=this._toObject(i,t,e)),n&&!n.excludeFromExport&&(r.overlayImage=this._toObject(n,t,e)),r}toSVG(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;t.reviver=e;let r=[];return this._setSVGPreamble(r,t),this._setSVGHeader(r,t),this.clipPath&&r.push('\n')),this._setSVGBgOverlayColor(r,"background"),this._setSVGBgOverlayImage(r,"backgroundImage",e),this._setSVGObjects(r,e),this.clipPath&&r.push("\n"),this._setSVGBgOverlayColor(r,"overlay"),this._setSVGBgOverlayImage(r,"overlayImage",e),r.push(""),r.join("")}_setSVGPreamble(t,e){e.suppressPreamble||t.push('\n','\n')}_setSVGHeader(t,e){let r,i=e.width||"".concat(this.width),n=e.height||"".concat(this.height),s=ts.NUM_FRACTION_DIGITS,a=e.viewBox;if(a)r='viewBox="'.concat(a.x," ").concat(a.y," ").concat(a.width," ").concat(a.height,'" ');else if(this.svgViewportTransformation){let t=this.viewportTransform;r='viewBox="'.concat(eS(-t[4]/t[0],s)," ").concat(eS(-t[5]/t[3],s)," ").concat(eS(this.width/t[0],s)," ").concat(eS(this.height/t[3],s),'" ')}else r='viewBox="0 0 '.concat(this.width," ").concat(this.height,'" ');t.push("\n',"Created with Fabric.js ",tv,"\n","\n",this.createSVGFontFacesMarkup(),this.createSVGRefElementsMarkup(),this.createSVGClipPathMarkup(e),"\n")}createSVGClipPathMarkup(t){let e=this.clipPath;return e?(e.clipPathId="CLIPPATH_".concat(t9()),'\n').concat(e.toClipPathSVG(t.reviver),"\n")):""}createSVGRefElementsMarkup(){return["background","overlay"].map(t=>{let e=this["".concat(t,"Color")];if(eO(e)){let r=this["".concat(t,"Vpt")],i=this.viewportTransform,n={isType:()=>!1,width:this.width/(r?i[0]:1),height:this.height/(r?i[3]:1)};return e.toSVG(n,{additionalTransform:r?eT(i):""})}}).join("")}createSVGFontFacesMarkup(){let t=[],e={},r=ts.fontPaths;this._objects.forEach(function e(r){t.push(r),t0(r)&&r._objects.forEach(e)}),t.forEach(t=>{if(!t||"function"!=typeof t._renderText)return;let{styles:i,fontFamily:n}=t;!e[n]&&r[n]&&(e[n]=!0,i&&Object.values(i).forEach(t=>{Object.values(t).forEach(t=>{let{fontFamily:i=""}=t;!e[i]&&r[i]&&(e[i]=!0)})}))});let i=Object.keys(e).map(t=>" @font-face {\n font-family: '".concat(t,"';\n src: url('").concat(r[t],"');\n }\n")).join("");return i?' \n"):""}_setSVGObjects(t,e){this.forEachObject(r=>{r.excludeFromExport||this._setSVGObject(t,r,e)})}_setSVGObject(t,e,r){t.push(e.toSVG(r))}_setSVGBgOverlayImage(t,e,r){let i=this[e];i&&!i.excludeFromExport&&i.toSVG&&t.push(i.toSVG(r))}_setSVGBgOverlayColor(t,e){let r=this["".concat(e,"Color")];if(r)if(eO(r)){let i=r.repeat||"",n=this.width,s=this.height,a=this["".concat(e,"Vpt")]?eT(ea(this.viewportTransform)):"";t.push('\n'))}else t.push('\n")}loadFromJSON(t,e){let{signal:r}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t)return Promise.reject(new to("`json` is undefined"));let i="string"==typeof t?JSON.parse(t):t,{objects:n=[],backgroundImage:s,background:a,overlayImage:o,overlay:l,clipPath:h}=i,c=this.renderOnAddRemove;return this.renderOnAddRemove=!1,Promise.all([eb(n,{reviver:e,signal:r}),e_({backgroundImage:s,backgroundColor:a,overlayImage:o,overlayColor:l,clipPath:h},{signal:r})]).then(t=>{let[e,r]=t;return this.clear(),this.add(...e),this.set(i),this.set(r),this.renderOnAddRemove=c,this})}clone(t){let e=this.toObject(t);return this.cloneWithoutData().loadFromJSON(e)}cloneWithoutData(){let t=t7(this);return new this.constructor(t)}toDataURL(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{format:e="png",quality:r=1,multiplier:i=1,enableRetinaScaling:n=!1}=t,s=i*(n?this.getRetinaScaling():1);return et(this.toCanvasElement(s,t),e,r)}toBlob(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{format:e="png",quality:r=1,multiplier:i=1,enableRetinaScaling:n=!1}=t,s=i*(n?this.getRetinaScaling():1);return ee(this.toCanvasElement(s,t),e,r)}toCanvasElement(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,{width:e,height:r,left:i,top:n,filter:s}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=(e||this.width)*t,o=(r||this.height)*t,l=this.getZoom(),h=this.width,c=this.height,u=this.skipControlsDrawing,d=l*t,f=this.viewportTransform,g=[d,0,0,d,(f[4]-(i||0))*t,(f[5]-(n||0))*t],p=this.enableRetinaScaling,m=t7({width:a,height:o}),y=s?this._objects.filter(t=>s(t)):this._objects;return this.enableRetinaScaling=!1,this.viewportTransform=g,this.width=a,this.height=o,this.skipControlsDrawing=!0,this.calcViewportBoundaries(),this.renderCanvas(m.getContext("2d"),y),this.viewportTransform=f,this.width=h,this.height=c,this.calcViewportBoundaries(),this.enableRetinaScaling=p,this.skipControlsDrawing=u,m}dispose(){return this.disposed||this.elements.cleanupDOM({width:this.width,height:this.height}),tG.cancelByCanvas(this),this.disposed=!0,new Promise((t,e)=>{let r=()=>{this.destroy(),t(!0)};r.kill=e,this.__cleanupTask&&this.__cleanupTask.kill("aborted"),this.destroyed?t(!1):this.nextRenderHandle?this.__cleanupTask=r:r()})}destroy(){this.destroyed=!0,this.cancelRequestedRender(),this.forEachObject(t=>t.dispose()),this._objects=[],this.backgroundImage&&this.backgroundImage.dispose(),this.backgroundImage=void 0,this.overlayImage&&this.overlayImage.dispose(),this.overlayImage=void 0,this.elements.dispose()}toString(){return"#")}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),Object.assign(this,this.constructor.getDefaults()),this.set(e),this.initElements(t),this._setDimensionsImpl({width:this.width||this.elements.lower.el.width||0,height:this.height||this.elements.lower.el.height||0}),this.skipControlsDrawing=!1,this.viewportTransform=[...this.viewportTransform],this.calcViewportBoundaries()}}$(eB,"ownDefaults",eI);let eN=["touchstart","touchmove","touchend"],eW=t=>{let e=eD(t.target),r=function(t){let e=t.changedTouches;return e&&e[0]?e[0]:t}(t);return new tZ(r.clientX+e.left,r.clientY+e.top)},eU=t=>eN.includes(t.type)||"touch"===t.pointerType,eH=t=>{t.preventDefault(),t.stopPropagation()},eX=t=>{let e=0,r=0,i=0,n=0;for(let s=0,a=t.length;si||!s)&&(i=a),(an||!s)&&(n=o),(oeY(t,eo(e,t.calcOwnMatrix())),eY=(t,e)=>{let r=ec(e),{translateX:i,translateY:n,scaleX:s,scaleY:a}=r,o=tr(r,eV),l=new tZ(i,n);t.flipX=!1,t.flipY=!1,Object.assign(t,o),t.set({scaleX:s,scaleY:a}),t.setPositionByOrigin(l,tC,tC)},eG=t=>{t.scaleX=1,t.scaleY=1,t.skewX=0,t.skewY=0,t.flipX=!1,t.flipY=!1,t.rotate(0)},eq=t=>({scaleX:t.scaleX,scaleY:t.scaleY,skewX:t.skewX,skewY:t.skewY,angle:t.angle,left:t.left,flipX:t.flipX,flipY:t.flipY,top:t.top}),eK=(t,e,r)=>{let i=t/2,n=e/2,s=eX([new tZ(-i,-n),new tZ(i,-n),new tZ(-i,n),new tZ(i,n)].map(t=>t.transform(r)));return new tZ(s.width,s.height)},eQ=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:tw;return eo(ea(arguments.length>1&&void 0!==arguments[1]?arguments[1]:tw),t)},eJ=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tw,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:tw;return t.transform(eQ(e,r))},eZ=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tw,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:tw;return t.transform(eQ(e,r),!0)},e$=(t,e,r)=>{let i=eQ(e,r);return eY(t,eo(i,t.calcOwnMatrix())),i},e0=(t,e)=>{var r;let{transform:{target:i}}=e;null==(r=i.canvas)||r.fire("object:".concat(t),te(te({},e),{},{target:i})),i.fire(t,e)},e1={left:-.5,top:-.5,center:0,bottom:.5,right:.5},e2=t=>"string"==typeof t?e1[t]:t-.5,e5="not-allowed";function e4(t){return e2(t.originX)===e2(tC)&&e2(t.originY)===e2(tC)}let e3=(t,e)=>t[e],e9=(t,e,r,i)=>({e:t,transform:e,pointer:new tZ(r,i)});function e6(t,e){return Math.round((t.getTotalAngle()+ei(Math.atan2(e.y,e.x))+360)%360/45)}function e8(t,e,r,i,n){var s;let{target:a,corner:o}=t,l=a.controls[o],h=(null==(s=a.canvas)?void 0:s.getZoom())||1,c=a.padding/h,u=function(t,e,r,i){let n=t.getRelativeCenterPoint(),s=void 0!==r&&void 0!==i?t.translateToGivenOrigin(n,tC,tC,r,i):new tZ(t.left,t.top);return(t.angle?e.rotate(-er(t.angle),n):e).subtract(s)}(a,new tZ(i,n),e,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-=l.offsetX,u.y-=l.offsetY,u}let e7=(t,e,r,i)=>{let{target:n,offsetX:s,offsetY:a}=e,o=r-s,l=i-a,h=!e3(n,"lockMovementX")&&n.left!==o,c=!e3(n,"lockMovementY")&&n.top!==l;return h&&n.set(tS,o),c&&n.set("top",l),(h||c)&&e0(tE,e9(t,e,r,i)),h||c},rt={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aqua:"#0FF",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000",blanchedalmond:"#FFEBCD",blue:"#00F",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#0FF",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:"#F0F",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:"#789",lightslategrey:"#789",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",lime:"#0F0",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#F0F",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:"#639",red:"#F00",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:"#FFF",whitesmoke:"#F5F5F5",yellow:"#FF0",yellowgreen:"#9ACD32"},re=(t,e,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t),rr=(t,e,r,i)=>{let n,s;t/=255;let a=Math.max(t,e/=255,r/=255),o=Math.min(t,e,r),l=(a+o)/2;if(a===o)n=s=0;else{let i=a-o;switch(s=l>.5?i/(2-a-o):i/(a+o),a){case t:n=(e-r)/i+6*(e0&&void 0!==arguments[0]?arguments[0]:"1";return parseFloat(t)/(t.endsWith("%")?100:1)},rn=t=>Math.min(Math.round(t),255).toString(16).toUpperCase().padStart(2,"0"),rs=t=>{let[e,r,i,n=1]=t,s=Math.round(.3*e+.59*r+.11*i);return[s,s,s,n]};class ra{_tryParsingColor(t){return(t=t.toLowerCase())in rt&&(t=rt[t]),"transparent"===t?[255,255,255,0]:ra.sourceFromHex(t)||ra.sourceFromRgb(t)||ra.sourceFromHsl(t)||(this.isUnrecognised=!0,[0,0,0,1])}getSource(){return this._source}setSource(t){this._source=t}toRgb(){let[t,e,r]=this.getSource();return"rgb(".concat(t,",").concat(e,",").concat(r,")")}toRgba(){return"rgba(".concat(this.getSource().join(","),")")}toHsl(){let[t,e,r]=rr(...this.getSource());return"hsl(".concat(t,",").concat(e,"%,").concat(r,"%)")}toHsla(){let[t,e,r,i]=rr(...this.getSource());return"hsla(".concat(t,",").concat(e,"%,").concat(r,"%,").concat(i,")")}toHex(){return this.toHexa().slice(0,6)}toHexa(){let[t,e,r,i]=this.getSource();return"".concat(rn(t)).concat(rn(e)).concat(rn(r)).concat(rn(Math.round(255*i)))}getAlpha(){return this.getSource()[3]}setAlpha(t){return this._source[3]=t,this}toGrayscale(){return this.setSource(rs(this.getSource())),this}toBlackWhite(t){let[e,,,r]=rs(this.getSource()),i=e<(t||127)?0:255;return this.setSource([i,i,i,r]),this}overlayWith(t){t instanceof ra||(t=new ra(t));let e=this.getSource(),r=t.getSource(),[i,n,s]=e.map((t,e)=>Math.round(.5*t+.5*r[e]));return this.setSource([i,n,s,e[3]]),this}static fromRgb(t){return ra.fromRgba(t)}static fromRgba(t){return new ra(ra.sourceFromRgb(t))}static sourceFromRgb(t){let e=t.match(/^rgba?\(\s*(\d{0,3}(?:\.\d+)?%?)\s*[\s|,]\s*(\d{0,3}(?:\.\d+)?%?)\s*[\s|,]\s*(\d{0,3}(?:\.\d+)?%?)\s*(?:\s*[,/]\s*(\d{0,3}(?:\.\d+)?%?)\s*)?\)$/i);if(e){let[t,r,i]=e.slice(1,4).map(t=>{let e=parseFloat(t);return t.endsWith("%")?Math.round(2.55*e):e});return[t,r,i,ri(e[4])]}}static fromHsl(t){return ra.fromHsla(t)}static fromHsla(t){return new ra(ra.sourceFromHsl(t))}static sourceFromHsl(t){let e,r,i,n=t.match(/^hsla?\(\s*([+-]?\d{0,3}(?:\.\d+)?(?:deg|turn|rad)?)\s*[\s|,]\s*(\d{0,3}(?:\.\d+)?%?)\s*[\s|,]\s*(\d{0,3}(?:\.\d+)?%?)\s*(?:\s*[,/]\s*(\d*(?:\.\d+)?%?)\s*)?\)$/i);if(!n)return;let s=(ra.parseAngletoDegrees(n[1])%360+360)%360/360,a=parseFloat(n[2])/100,o=parseFloat(n[3])/100;if(0===a)e=r=i=o;else{let t=o<=.5?o*(a+1):o+a-o*a,n=2*o-t;e=re(n,t,s+1/3),r=re(n,t,s),i=re(n,t,s-1/3)}return[Math.round(255*e),Math.round(255*r),Math.round(255*i),ri(n[4])]}static fromHex(t){return new ra(ra.sourceFromHex(t))}static sourceFromHex(t){if(t.match(/^#?(([0-9a-f]){3,4}|([0-9a-f]{2}){3,4})$/i)){let e=t.slice(t.indexOf("#")+1),[r,i,n,s=255]=(e.length<=4?e.split("").map(t=>t+t):e.match(/.{2}/g)).map(t=>parseInt(t,16));return[r,i,n,s/255]}}static parseAngletoDegrees(t){let e=t.toLowerCase(),r=parseFloat(e);return e.includes("rad")?ei(r):e.includes("turn")?360*r:r}constructor(t){if($(this,"isUnrecognised",!1),t)if(t instanceof ra)this.setSource([...t._source]);else if(Array.isArray(t)){let[e,r,i,n=1]=t;this.setSource([e,r,i,n])}else this.setSource(this._tryParsingColor(t));else this.setSource([0,0,0,1])}}let ro=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16,r=/\D{0,2}$/.exec(t),i=parseFloat(t),n=ts.DPI;switch(null==r?void 0:r[0]){case"mm":return i*n/25.4;case"cm":return i*n/2.54;case"in":return i*n;case"pt":return i*n/72;case"pc":return i*n/72*12;case"em":return i*e;default:return i}},rl=t=>{let[e,r]=t.trim().split(" "),[i,n]=e&&e!==tk?[e.slice(1,4),e.slice(5,8)]:e===tk?[e,e]:["Mid","Mid"];return{meetOrSlice:r||"meet",alignX:i,alignY:n}},rh=function(t,e){let r,i,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(e)if(e.toLive)r="url(#SVGID_".concat(e.id,")");else{let t=new ra(e),n=t.getAlpha();r=t.toRgb(),1!==n&&(i=n.toString())}else r="none";return n?"".concat(t,": ").concat(r,"; ").concat(i?"".concat(t,"-opacity: ").concat(i,"; "):""):"".concat(t,'="').concat(r,'" ').concat(i?"".concat(t,'-opacity="').concat(i,'" '):"")};class rc{getSvgStyles(t){let e=this.fillRule?this.fillRule:"nonzero",r=this.strokeWidth?this.strokeWidth:"0",i=this.strokeDashArray?this.strokeDashArray.join(" "):tk,n=this.strokeDashOffset?this.strokeDashOffset:"0",s=this.strokeLineCap?this.strokeLineCap:"butt",a=this.strokeLineJoin?this.strokeLineJoin:"miter",o=this.strokeMiterLimit?this.strokeMiterLimit:"4",l=void 0!==this.opacity?this.opacity:"1",h=this.visible?"":" visibility: hidden;",c=t?"":this.getSvgFilter(),u=rh(tH,this.fill);return rh(tX,this.stroke)+"stroke-width: "+r+"; stroke-dasharray: "+i+"; stroke-linecap: "+s+"; stroke-dashoffset: "+n+"; stroke-linejoin: "+a+"; stroke-miterlimit: "+o+"; "+u+"fill-rule: "+e+"; opacity: "+l+";"+c+h}getSvgFilter(){return this.shadow?"filter: url(#SVGID_".concat(this.shadow.id,");"):""}getSvgCommons(){return[this.id?'id="'.concat(this.id,'" '):"",this.clipPath?'clip-path="url(#'.concat(this.clipPath.clipPathId,')" '):""].join("")}getSvgTransform(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=t?this.calcTransformMatrix():this.calcOwnMatrix(),i='transform="'.concat(eT(r));return"".concat(i).concat(e,'" ')}_toSVG(t){return[""]}toSVG(t){return this._createBaseSVGMarkup(this._toSVG(t),{reviver:t})}toClipPathSVG(t){return" "+this._createBaseClipPathSVGMarkup(this._toSVG(t),{reviver:t})}_createBaseClipPathSVGMarkup(t){let{reviver:e,additionalTransform:r=""}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=[this.getSvgTransform(!0,r),this.getSvgCommons()].join(""),n=t.indexOf("COMMON_PARTS");return t[n]=i,e?e(t.join("")):t.join("")}_createBaseSVGMarkup(t){let e,{noStyle:r,reviver:i,withShadow:n,additionalTransform:s}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=r?"":'style="'.concat(this.getSvgStyles(),'" '),o=n?'style="'.concat(this.getSvgFilter(),'" '):"",l=this.clipPath,h=this.strokeUniform?'vector-effect="non-scaling-stroke" ':"",c=l&&l.absolutePositioned,u=this.stroke,d=this.fill,f=this.shadow,g=[],p=t.indexOf("COMMON_PARTS");l&&(l.clipPathId="CLIPPATH_".concat(t9()),e='\n').concat(l.toClipPathSVG(i),"\n")),c&&g.push("\n"),g.push("\n");let m=""+a+h+(r?"":this.addPaintOrder())+" "+(s?'transform="'.concat(s,'" '):"");return t[p]=m,eO(d)&&g.push(d.toSVG(this)),eO(u)&&g.push(u.toSVG(this)),f&&g.push(f.toSVG(this)),l&&g.push(e),g.push(t.join("")),g.push("\n"),c&&g.push("\n"),i?i(g.join("")):g.join("")}addPaintOrder(){return this.paintFirst!==tH?' paint-order="'.concat(this.paintFirst,'" '):""}}function ru(t){return RegExp("^("+t.join("|")+")\\b","i")}let rd="textDecorationThickness",rf=["fontSize","fontWeight","fontFamily","fontStyle"],rg=["underline","overline","linethrough"],rp=[...rf,"lineHeight","text","charSpacing","textAlign","styles","path","pathStartOffset","pathSide","pathAlign"],rm=[...rp,...rg,"textBackgroundColor","direction",rd],rv=[...rf,...rg,tX,"strokeWidth",tH,"deltaY","textBackgroundColor",rd],ry="justify",rx="justify-left",rb="justify-right",r_="justify-center",rw=String.raw(a||(a=ti(["[-+]?(?:d*.d+|d+.?)(?:[eE][-+]?d+)?"],["[-+]?(?:\\d*\\.\\d+|\\d+\\.?)(?:[eE][-+]?\\d+)?"]))),rC=String.raw(o||(o=ti(["(?:s*,?s+|s*,s*)"],["(?:\\s*,?\\s+|\\s*,\\s*)"]))),rS=RegExp("(normal|italic)?\\s*(normal|small-caps)?\\s*(normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900)?\\s*("+rw+"(?:px|cm|mm|em|pt|pc|in)*)(?:\\/(normal|"+rw+"))?\\s+(.*)"),rT={cx:tS,x:tS,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","text-decoration-thickness":rd},rO="font-size",rk="clip-path",rM=(ru(["path","circle","polygon","polyline","ellipse","rect","line","image","text"]),ru(["symbol","image","marker","pattern","view","svg"]),ru(["symbol","g","a","svg","clipPath","defs"])),rE=(new RegExp(String.raw(l||(l=ti(["^s*(",")","(",")","(",")","(",")s*$"],["^\\s*(",")","(",")","(",")","(",")\\s*$"])),rw,rC,rw,rC,rw,rC,rw)),new tZ(1,0)),rD=new tZ,rj=(t,e)=>t.rotate(e),rA=(t,e)=>new tZ(e).subtract(t),rP=t=>t.distanceFrom(rD),rF=(t,e)=>Math.atan2(rB(t,e),rN(t,e)),rL=t=>rF(rE,t),rR=t=>t.eq(rD)?t:t.scalarDivide(rP(t)),rI=function(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return rR(new tZ(-t.y,t.x).scalarMultiply(e?1:-1))},rB=(t,e)=>t.x*e.y-t.y*e.x,rN=(t,e)=>t.x*e.x+t.y*e.y,rW=(t,e,r)=>{if(t.eq(e)||t.eq(r))return!0;let i=rB(e,r),n=rB(e,t),s=rB(r,t);return i>=0?n>=0&&s<=0:!(n<=0&&s>=0)},rU="(-?\\d+(?:\\.\\d*)?(?:px)?(?:\\s?|$))?",rH=RegExp("(?:\\s|^)"+rU+rU+"("+rw+"?(?:px)?)?(?:\\s?|$)(?:$|\\s)");class rX{static parseShadow(t){let e=t.trim(),[,r=0,i=0,n=0]=(rH.exec(e)||[]).map(t=>parseFloat(t)||0);return{color:(e.replace(rH,"")||"rgb(0,0,0)").trim(),offsetX:r,offsetY:i,blur:n}}toString(){return[this.offsetX,this.offsetY,this.blur,this.color].join("px ")}toSVG(t){let e=rj(new tZ(this.offsetX,this.offsetY),er(-t.angle)),r=new ra(this.color),i=40,n=40;return t.width&&t.height&&(i=100*eS((Math.abs(e.x)+this.blur)/t.width,ts.NUM_FRACTION_DIGITS)+20,n=100*eS((Math.abs(e.y)+this.blur)/t.height,ts.NUM_FRACTION_DIGITS)+20),t.flipX&&(e.x*=-1),t.flipY&&(e.y*=-1),'\n \n \n \n \n \n \n \n \n\n')}toObject(){let t={color:this.color,blur:this.blur,offsetX:this.offsetX,offsetY:this.offsetY,affectStroke:this.affectStroke,nonScaling:this.nonScaling,type:this.constructor.type},e=rX.ownDefaults;return this.includeDefaultValues?t:eC(t,(t,r)=>t!==e[r])}static async fromObject(t){return new this(t)}constructor(t){let e="string"==typeof t?rX.parseShadow(t):t;Object.assign(this,rX.ownDefaults,e),this.id=t9()}}$(rX,"ownDefaults",{color:"rgb(0,0,0)",blur:0,offsetX:0,offsetY:0,affectStroke:!1,includeDefaultValues:!0,nonScaling:!1}),$(rX,"type","shadow"),tY.setClass(rX,"shadow");let rV=(t,e,r)=>Math.max(t,Math.min(e,r)),rz=["top",tS,tB,tN,"flipX","flipY","originX","originY","angle","opacity","globalCompositeOperation","shadow","visible",tW,tU],rY=[tH,tX,"strokeWidth","strokeDashArray","width","height","paintFirst","strokeUniform","strokeLineCap","strokeDashOffset","strokeLineJoin","strokeMiterLimit","backgroundColor","clipPath"],rG=(t,e,r,i)=>(tt*Math.pow(2,10*(i-=1))*Math.sin((i*n-e)*tb/r),rK=(t,e,r,i)=>-r*Math.cos(t/i*tx)+r+e,rQ=(t,e,r,i)=>(t/=i)<1/2.75?7.5625*t*t*r+e:t<2/2.75?r*(7.5625*(t-=1.5/2.75)*t+.75)+e:t<2.5/2.75?r*(7.5625*(t-=2.25/2.75)*t+.9375)+e:r*(7.5625*(t-=2.625/2.75)*t+.984375)+e,rJ=(t,e,r,i)=>r-rQ(i-t,0,r,i)+e;var rZ=Object.freeze({__proto__:null,defaultEasing:rK,easeInBack:function(t,e,r,i){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1.70158;return r*(t/=i)*t*((n+1)*t-n)+e},easeInBounce:rJ,easeInCirc:(t,e,r,i)=>-r*(Math.sqrt(1-(t/=i)*t)-1)+e,easeInCubic:(t,e,r,i)=>r*(t/i)**3+e,easeInElastic:(t,e,r,i)=>{let n=0;if(0===t)return e;if(1==(t/=i))return e+r;n||(n=.3*i);let{a:s,s:a,p:o}=rG(r,r,n,1.70158);return-rq(s,a,o,t,i)+e},easeInExpo:(t,e,r,i)=>0===t?e:r*2**(10*(t/i-1))+e,easeInOutBack:function(t,e,r,i){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1.70158;return(t/=i/2)<1?r/2*(t*t*((1+(n*=1.525))*t-n))+e:r/2*((t-=2)*t*((1+(n*=1.525))*t+n)+2)+e},easeInOutBounce:(t,e,r,i)=>t(t/=i/2)<1?-r/2*(Math.sqrt(1-t**2)-1)+e:r/2*(Math.sqrt(1-(t-=2)*t)+1)+e,easeInOutCubic:(t,e,r,i)=>(t/=i/2)<1?r/2*t**3+e:r/2*((t-2)**3+2)+e,easeInOutElastic:(t,e,r,i)=>{let n=0;if(0===t)return e;if(2==(t/=i/2))return e+r;n||(n=.3*1.5*i);let{a:s,s:a,p:o,c:l}=rG(r,r,n,1.70158);return t<1?-.5*rq(s,a,o,t,i)+e:s*Math.pow(2,-10*(t-=1))*Math.sin((t*i-a)*tb/o)*.5+l+e},easeInOutExpo:(t,e,r,i)=>0===t?e:t===i?e+r:(t/=i/2)<1?r/2*2**(10*(t-1))+e:-(r/2*(2**(-10*--t)+2))+e,easeInOutQuad:(t,e,r,i)=>(t/=i/2)<1?r/2*t**2+e:-r/2*(--t*(t-2)-1)+e,easeInOutQuart:(t,e,r,i)=>(t/=i/2)<1?r/2*t**4+e:-r/2*((t-=2)*t**3-2)+e,easeInOutQuint:(t,e,r,i)=>(t/=i/2)<1?r/2*t**5+e:r/2*((t-2)**5+2)+e,easeInOutSine:(t,e,r,i)=>-r/2*(Math.cos(Math.PI*t/i)-1)+e,easeInQuad:(t,e,r,i)=>r*(t/=i)*t+e,easeInQuart:(t,e,r,i)=>r*(t/=i)*t**3+e,easeInQuint:(t,e,r,i)=>r*(t/i)**5+e,easeInSine:(t,e,r,i)=>-r*Math.cos(t/i*tx)+r+e,easeOutBack:function(t,e,r,i){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1.70158;return r*((t=t/i-1)*t*((n+1)*t+n)+1)+e},easeOutBounce:rQ,easeOutCirc:(t,e,r,i)=>r*Math.sqrt(1-(t=t/i-1)*t)+e,easeOutCubic:(t,e,r,i)=>r*((t/i-1)**3+1)+e,easeOutElastic:(t,e,r,i)=>{let n=0;if(0===t)return e;if(1==(t/=i))return e+r;n||(n=.3*i);let{a:s,s:a,p:o,c:l}=rG(r,r,n,1.70158);return s*2**(-10*t)*Math.sin((t*i-a)*tb/o)+l+e},easeOutExpo:(t,e,r,i)=>t===i?e+r:-(r*(2**(-10*t/i)+1))+e,easeOutQuad:(t,e,r,i)=>-r*(t/=i)*(t-2)+e,easeOutQuart:(t,e,r,i)=>-r*((t=t/i-1)*t**3-1)+e,easeOutQuint:(t,e,r,i)=>r*((t/i-1)**5+1)+e,easeOutSine:(t,e,r,i)=>r*Math.sin(t/i*tx)+e});let r$=()=>!1;class r0{get state(){return this._state}isDone(){return"aborted"===this._state||"completed"===this._state}start(){let t=t=>{"pending"===this._state&&(this.startTime=t||+new Date,this._state="running",this._onStart(),this.tick(this.startTime))};this.register(),this.delay>0?setTimeout(()=>t5(t),this.delay):t5(t)}tick(t){let e=(t||+new Date)-this.startTime,r=Math.min(e,this.duration);this.durationProgress=r/this.duration;let{value:i,valueProgress:n}=this.calculate(r);this.value=Object.freeze(i),this.valueProgress=n,"aborted"!==this._state&&(this._abort(this.value,this.valueProgress,this.durationProgress)?(this._state="aborted",this.unregister()):e>=this.duration?(this.durationProgress=this.valueProgress=1,this._onChange(this.endValue,this.valueProgress,this.durationProgress),this._state="completed",this._onComplete(this.endValue,this.valueProgress,this.durationProgress),this.unregister()):(this._onChange(this.value,this.valueProgress,this.durationProgress),t5(this.tick)))}register(){tG.push(this)}unregister(){tG.remove(this)}abort(){this._state="aborted",this.unregister()}constructor(t){let{startValue:e,byValue:r,duration:i=500,delay:n=0,easing:s=rK,onStart:a=ty,onChange:o=ty,onComplete:l=ty,abort:h=r$,target:c}=t;$(this,"_state","pending"),$(this,"durationProgress",0),$(this,"valueProgress",0),this.tick=this.tick.bind(this),this.duration=i,this.delay=n,this.easing=s,this._onStart=a,this._onChange=o,this._onComplete=l,this._abort=h,this.target=c,this.startValue=e,this.byValue=r,this.value=this.startValue,this.endValue=Object.freeze(this.calculate(this.duration).value)}}let r1=["startValue","endValue"];class r2 extends r0{calculate(t){let e=this.easing(t,this.startValue,this.byValue,this.duration);return{value:e,valueProgress:Math.abs((e-this.startValue)/this.byValue)}}constructor(t){let{startValue:e=0,endValue:r=100}=t;super(te(te({},tr(t,r1)),{},{startValue:e,byValue:r-e}))}}let r5=["startValue","endValue"];class r4 extends r0{calculate(t){let e=this.startValue.map((e,r)=>this.easing(t,e,this.byValue[r],this.duration,r));return{value:e,valueProgress:Math.abs((e[0]-this.startValue[0])/this.byValue[0])}}constructor(t){let{startValue:e=[0],endValue:r=[100]}=t;super(te(te({},tr(t,r5)),{},{startValue:e,byValue:r.map((t,r)=>t-e[r])}))}}let r3=["startValue","endValue","easing","onChange","onComplete","abort"],r9=(t,e,r,i)=>e+r*(1-Math.cos(t/i*tx)),r6=t=>t&&((e,r,i)=>t(new ra(e).toRgba(),r,i));class r8 extends r0{calculate(t){let[e,r,i,n]=this.startValue.map((e,r)=>this.easing(t,e,this.byValue[r],this.duration,r)),s=[...[e,r,i].map(Math.round),rV(0,n,1)];return{value:s,valueProgress:s.map((t,e)=>0!==this.byValue[e]?Math.abs((t-this.startValue[e])/this.byValue[e]):0).find(t=>0!==t)||0}}constructor(t){let{startValue:e,endValue:r,easing:i=r9,onChange:n,onComplete:s,abort:a}=t,o=tr(t,r3),l=new ra(e).getSource();super(te(te({},o),{},{startValue:l,byValue:new ra(r).getSource().map((t,e)=>t-l[e]),easing:i,onChange:r6(n),onComplete:r6(s),abort:r6(a)}))}}function r7(t){let e=Array.isArray(t.startValue)||Array.isArray(t.endValue)?new r4(t):new r2(t);return e.start(),e}function it(t){let e=new r8(t);return e.start(),e}class ie{includes(t){return this.points.some(e=>e.eq(t))}append(){for(var t=arguments.length,e=Array(t),r=0;r!this.includes(t))),this}static isPointContained(t,e,r){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(e.eq(r))return t.eq(e);if(e.x===r.x)return t.x===e.x&&(i||t.y>=Math.min(e.y,r.y)&&t.y<=Math.max(e.y,r.y));if(e.y===r.y)return t.y===e.y&&(i||t.x>=Math.min(e.x,r.x)&&t.x<=Math.max(e.x,r.x));{let n=rA(e,r),s=rA(e,t).divide(n);return i?Math.abs(s.x)===Math.abs(s.y):s.x===s.y&&s.x>=0&&s.x<=1}}static isPointInPolygon(t,e){let r=new tZ(t).setX(Math.min(t.x-1,...e.map(t=>t.x))),i=0;for(let n=0;n4&&void 0!==arguments[4])||arguments[4],s=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],a=e.x-t.x,o=e.y-t.y,l=i.x-r.x,h=i.y-r.y,c=t.x-r.x,u=t.y-r.y,d=l*u-h*c,f=a*u-o*c,g=h*a-l*o;if(0!==g){let e=d/g,r=f/g;return(n||0<=e&&e<=1)&&(s||0<=r&&r<=1)?new ie("Intersection").append(new tZ(t.x+e*a,t.y+e*o)):new ie}if(0===d||0===f){let a=n||s||ie.isPointContained(t,r,i)||ie.isPointContained(e,r,i)||ie.isPointContained(r,t,e)||ie.isPointContained(i,t,e);return new ie(a?"Coincident":void 0)}return new ie("Parallel")}static intersectSegmentLine(t,e,r,i){return ie.intersectLineLine(t,e,r,i,!1,!0)}static intersectSegmentSegment(t,e,r,i){return ie.intersectLineLine(t,e,r,i,!1,!1)}static intersectLinePolygon(t,e,r){let i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],n=new ie,s=r.length;for(let a,o,l,h=0;h0&&(n.status="Intersection"),n}static intersectSegmentPolygon(t,e,r){return ie.intersectLinePolygon(t,e,r,!1)}static intersectPolygonPolygon(t,e){let r=new ie,i=t.length,n=[];for(let s=0;s0&&n.length===t.length?new ie("Coincident"):(r.points.length>0&&(r.status="Intersection"),r)}static intersectPolygonRectangle(t,e,r){let i=e.min(r),n=e.max(r),s=new tZ(n.x,i.y),a=new tZ(i.x,n.y);return ie.intersectPolygonPolygon(t,[i,s,n,a])}constructor(t){this.status=t,this.points=[]}}class ir extends t2{getX(){return this.getXY().x}setX(t){this.setXY(this.getXY().setX(t))}getY(){return this.getXY().y}setY(t){this.setXY(this.getXY().setY(t))}getRelativeX(){return this.left}setRelativeX(t){this.left=t}getRelativeY(){return this.top}setRelativeY(t){this.top=t}getXY(){let t=this.getRelativeXY();return this.group?es(t,this.group.calcTransformMatrix()):t}setXY(t,e,r){this.group&&(t=es(t,ea(this.group.calcTransformMatrix()))),this.setRelativeXY(t,e,r)}getRelativeXY(){return new tZ(this.left,this.top)}setRelativeXY(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.originX,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.originY;this.setPositionByOrigin(t,e,r)}isStrokeAccountedForInDimensions(){return!1}getCoords(){let{tl:t,tr:e,br:r,bl:i}=this.aCoords||(this.aCoords=this.calcACoords()),n=[t,e,r,i];if(this.group){let t=this.group.calcTransformMatrix();return n.map(e=>es(e,t))}return n}intersectsWithRect(t,e){return"Intersection"===ie.intersectPolygonRectangle(this.getCoords(),t,e).status}intersectsWithObject(t){let e=ie.intersectPolygonPolygon(this.getCoords(),t.getCoords());return"Intersection"===e.status||"Coincident"===e.status||t.isContainedWithinObject(this)||this.isContainedWithinObject(t)}isContainedWithinObject(t){return this.getCoords().every(e=>t.containsPoint(e))}isContainedWithinRect(t,e){let{left:r,top:i,width:n,height:s}=this.getBoundingRect();return r>=t.x&&r+n<=e.x&&i>=t.y&&i+s<=e.y}isOverlapping(t){return this.intersectsWithObject(t)||this.isContainedWithinObject(t)||t.isContainedWithinObject(this)}containsPoint(t){return ie.isPointInPolygon(t,this.getCoords())}isOnScreen(){if(!this.canvas)return!1;let{tl:t,br:e}=this.canvas.vptCoords;return!!this.getCoords().some(r=>r.x<=e.x&&r.x>=t.x&&r.y<=e.y&&r.y>=t.y)||!!this.intersectsWithRect(t,e)||this.containsPoint(t.midPointFrom(e))}isPartiallyOnScreen(){if(!this.canvas)return!1;let{tl:t,br:e}=this.canvas.vptCoords;return!!this.intersectsWithRect(t,e)||this.getCoords().every(r=>(r.x>=e.x||r.x<=t.x)&&(r.y>=e.y||r.y<=t.y))&&this.containsPoint(t.midPointFrom(e))}getBoundingRect(){return eX(this.getCoords())}getScaledWidth(){return this._getTransformedDimensions().x}getScaledHeight(){return this._getTransformedDimensions().y}scale(t){this._set(tB,t),this._set(tN,t),this.setCoords()}scaleToWidth(t){let e=this.getBoundingRect().width/this.getScaledWidth();return this.scale(t/this.width/e)}scaleToHeight(t){let e=this.getBoundingRect().height/this.getScaledHeight();return this.scale(t/this.height/e)}getCanvasRetinaScaling(){var t;return(null==(t=this.canvas)?void 0:t.getRetinaScaling())||1}getTotalAngle(){return this.group?ei(eh(this.calcTransformMatrix())):this.angle}getViewportTransform(){var t;return(null==(t=this.canvas)?void 0:t.viewportTransform)||tw.concat()}calcACoords(){let t=ed({angle:this.angle}),{x:e,y:r}=this.getRelativeCenterPoint(),i=eo(eu(e,r),t),n=this._getTransformedDimensions(),s=n.x/2,a=n.y/2;return{tl:es({x:-s,y:-a},i),tr:es({x:s,y:-a},i),bl:es({x:-s,y:a},i),br:es({x:s,y:a},i)}}setCoords(){this.aCoords=this.calcACoords()}transformMatrixKey(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=[];return!t&&this.group&&(e=this.group.transformMatrixKey(t)),e.push(this.top,this.left,this.width,this.height,this.scaleX,this.scaleY,this.angle,this.strokeWidth,this.skewX,this.skewY,+this.flipX,+this.flipY,e2(this.originX),e2(this.originY)),e}calcTransformMatrix(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.calcOwnMatrix();if(t||!this.group)return e;let r=this.transformMatrixKey(t),i=this.matrixCache;return i&&i.key.every((t,e)=>t===r[e])?i.value:(this.group&&(e=eo(this.group.calcTransformMatrix(!1),e)),this.matrixCache={key:r,value:e},e)}calcOwnMatrix(){let t=this.transformMatrixKey(!0),e=this.ownMatrixCache;if(e&&e.key===t)return e.value;let r=this.getRelativeCenterPoint(),i=ey({angle:this.angle,translateX:r.x,translateY:r.y,scaleX:this.scaleX,scaleY:this.scaleY,skewX:this.skewX,skewY:this.skewY,flipX:this.flipX,flipY:this.flipY});return this.ownMatrixCache={key:t,value:i},i}_getNonTransformedDimensions(){return new tZ(this.width,this.height).scalarAdd(this.strokeWidth)}_calculateCurrentDimensions(t){return this._getTransformedDimensions(t).transform(this.getViewportTransform(),!0).scalarAdd(2*this.padding)}_getTransformedDimensions(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=te({scaleX:this.scaleX,scaleY:this.scaleY,skewX:this.skewX,skewY:this.skewY,width:this.width,height:this.height,strokeWidth:this.strokeWidth},t),r=e.strokeWidth,i=r,n=0;this.strokeUniform&&(i=0,n=r);let s=e.width+i,a=e.height+i;return(0===e.skewX&&0===e.skewY?new tZ(s*e.scaleX,a*e.scaleY):eK(s,a,ev(e))).scalarAdd(n)}translateToGivenOrigin(t,e,r,i,n){let s=t.x,a=t.y,o=e2(i)-e2(e),l=e2(n)-e2(r);if(o||l){let t=this._getTransformedDimensions();s+=o*t.x,a+=l*t.y}return new tZ(s,a)}translateToCenterPoint(t,e,r){if(e===tC&&r===tC)return t;let i=this.translateToGivenOrigin(t,e,r,tC,tC);return this.angle?i.rotate(er(this.angle),t):i}translateToOriginPoint(t,e,r){let i=this.translateToGivenOrigin(t,tC,tC,e,r);return this.angle?i.rotate(er(this.angle),t):i}getCenterPoint(){let t=this.getRelativeCenterPoint();return this.group?es(t,this.group.calcTransformMatrix()):t}getRelativeCenterPoint(){return this.translateToCenterPoint(new tZ(this.left,this.top),this.originX,this.originY)}getPointByOrigin(t,e){return this.translateToOriginPoint(this.getRelativeCenterPoint(),t,e)}setPositionByOrigin(t,e,r){let i=this.translateToCenterPoint(t,e,r),n=this.translateToOriginPoint(i,this.originX,this.originY);this.set({left:n.x,top:n.y})}_getLeftTopCoords(){return this.translateToOriginPoint(this.getRelativeCenterPoint(),tS,"top")}}let ii=["type"],is=["extraParam"],ia=class t extends ir{static getDefaults(){return t.ownDefaults}get type(){let t=this.constructor.type;return"FabricObject"===t?"object":t.toLowerCase()}set type(t){ta("warn","Setting type has no effect",t)}_createCacheCanvas(){this._cacheCanvas=t6(),this._cacheContext=this._cacheCanvas.getContext("2d"),this._updateCacheCanvas(),this.dirty=!0}_limitCacheSize(t){let e=t.width,r=t.height,i=ts.maxCacheSideLimit,n=ts.minCacheSideLimit;if(e<=i&&r<=i&&e*r<=ts.perfLimitSizeTotal)return eo&&(t.zoomX/=e/o,t.width=o,t.capped=!0),r>l&&(t.zoomY/=r/l,t.height=l,t.capped=!0),t}_getCacheCanvasDimensions(){let t=this.getTotalObjectScaling(),e=this._getTransformedDimensions({skewX:0,skewY:0}),r=e.x*t.x/this.scaleX,i=e.y*t.y/this.scaleY;return{width:Math.ceil(r+2),height:Math.ceil(i+2),zoomX:t.x,zoomY:t.y,x:r,y:i}}_updateCacheCanvas(){let t=this._cacheCanvas,e=this._cacheContext,{width:r,height:i,zoomX:n,zoomY:s,x:a,y:o}=this._limitCacheSize(this._getCacheCanvasDimensions()),l=r!==t.width||i!==t.height,h=this.zoomX!==n||this.zoomY!==s;if(!t||!e)return!1;if(l||h){r!==t.width||i!==t.height?(t.width=r,t.height=i):(e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,t.width,t.height));let l=a/2,h=o/2;return this.cacheTranslationX=Math.round(t.width/2-l)+l,this.cacheTranslationY=Math.round(t.height/2-h)+h,e.translate(this.cacheTranslationX,this.cacheTranslationY),e.scale(n,s),this.zoomX=n,this.zoomY=s,!0}return!1}setOptions(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._setOptions(t)}transform(t){let e=this.group&&!this.group._transformDone||this.group&&this.canvas&&t===this.canvas.contextTop,r=this.calcTransformMatrix(!e);t.transform(r[0],r[1],r[2],r[3],r[4],r[5])}getObjectScaling(){if(!this.group)return new tZ(Math.abs(this.scaleX),Math.abs(this.scaleY));let t=ec(this.calcTransformMatrix());return new tZ(Math.abs(t.scaleX),Math.abs(t.scaleY))}getTotalObjectScaling(){let t=this.getObjectScaling();if(this.canvas){let e=this.canvas.getZoom(),r=this.getCanvasRetinaScaling();return t.scalarMultiply(e*r)}return t}getObjectOpacity(){let t=this.opacity;return this.group&&(t*=this.group.getObjectOpacity()),t}_constrainScale(t){return Math.abs(t){t.transform(i)}),e.parentClipPaths.push(t),t.absolutePositioned){let t=ea(this.calcTransformMatrix());i.transform(t[0],t[1],t[2],t[3],t[4],t[5])}return t.transform(i),t.drawObject(i,!0,e),r}_drawClipPath(t,e,r){if(!e)return;e._transformDone=!0;let i=this.createClipPathLayer(e,r);this.drawClipPathOnCache(t,e,i)}drawCacheOnCanvas(t){t.scale(1/this.zoomX,1/this.zoomY),t.drawImage(this._cacheCanvas,-this.cacheTranslationX,-this.cacheTranslationY)}isCacheDirty(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isNotVisible())return!1;let e=this._cacheCanvas,r=this._cacheContext;return!(!e||!r||t||!this._updateCacheCanvas())||!!(this.dirty||this.clipPath&&this.clipPath.absolutePositioned)&&(e&&r&&!t&&(r.save(),r.setTransform(1,0,0,1,0,0),r.clearRect(0,0,e.width,e.height),r.restore()),!0)}_renderBackground(t){if(!this.backgroundColor)return;let e=this._getNonTransformedDimensions();t.fillStyle=this.backgroundColor,t.fillRect(-e.x/2,-e.y/2,e.x,e.y),this._removeShadow(t)}_setOpacity(t){this.group&&!this.group._transformDone?t.globalAlpha=this.getObjectOpacity():t.globalAlpha*=this.opacity}_setStrokeStyles(t,e){let r=e.stroke;r&&(t.lineWidth=e.strokeWidth,t.lineCap=e.strokeLineCap,t.lineDashOffset=e.strokeDashOffset,t.lineJoin=e.strokeLineJoin,t.miterLimit=e.strokeMiterLimit,eO(r)?"percentage"===r.gradientUnits||r.gradientTransform||r.patternTransform?this._applyPatternForTransformedGradient(t,r):(t.strokeStyle=r.toLive(t),this._applyPatternGradientTransform(t,r)):t.strokeStyle=e.stroke)}_setFillStyles(t,e){let{fill:r}=e;r&&(eO(r)?(t.fillStyle=r.toLive(t),this._applyPatternGradientTransform(t,r)):t.fillStyle=r)}_setClippingProperties(t){t.globalAlpha=1,t.strokeStyle="transparent",t.fillStyle="#000000"}_setLineDash(t,e){e&&0!==e.length&&t.setLineDash(e)}_setShadow(t){if(!this.shadow)return;let e=this.shadow,r=this.canvas,i=this.getCanvasRetinaScaling(),[n,,,s]=(null==r?void 0:r.viewportTransform)||tw,a=n*i,o=s*i,l=e.nonScaling?new tZ(1,1):this.getObjectScaling();t.shadowColor=e.color,t.shadowBlur=e.blur*ts.browserShadowBlurConstant*(a+o)*(l.x+l.y)/4,t.shadowOffsetX=e.offsetX*a*l.x,t.shadowOffsetY=e.offsetY*o*l.y}_removeShadow(t){this.shadow&&(t.shadowColor="",t.shadowBlur=t.shadowOffsetX=t.shadowOffsetY=0)}_applyPatternGradientTransform(t,e){if(!eO(e))return{offsetX:0,offsetY:0};let r=e.gradientTransform||e.patternTransform,i=-this.width/2+e.offsetX||0,n=-this.height/2+e.offsetY||0;return"percentage"===e.gradientUnits?t.transform(this.width,0,0,this.height,i,n):t.transform(1,0,0,1,i,n),r&&t.transform(r[0],r[1],r[2],r[3],r[4],r[5]),{offsetX:i,offsetY:n}}_renderPaintInOrder(t){this.paintFirst===tX?(this._renderStroke(t),this._renderFill(t)):(this._renderFill(t),this._renderStroke(t))}_render(t){}_renderFill(t){this.fill&&(t.save(),this._setFillStyles(t,this),"evenodd"===this.fillRule?t.fill("evenodd"):t.fill(),t.restore())}_renderStroke(t){if(this.stroke&&0!==this.strokeWidth){if(this.shadow&&!this.shadow.affectStroke&&this._removeShadow(t),t.save(),this.strokeUniform){let e=this.getObjectScaling();t.scale(1/e.x,1/e.y)}this._setLineDash(t,this.strokeDashArray),this._setStrokeStyles(t,this),t.stroke(),t.restore()}}_applyPatternForTransformedGradient(t,e){var r;let i=this._limitCacheSize(this._getCacheCanvasDimensions()),n=this.getCanvasRetinaScaling(),s=i.x/this.scaleX/n,a=i.y/this.scaleY/n,o=t7({width:Math.ceil(s),height:Math.ceil(a)}),l=o.getContext("2d");l&&(l.beginPath(),l.moveTo(0,0),l.lineTo(s,0),l.lineTo(s,a),l.lineTo(0,a),l.closePath(),l.translate(s/2,a/2),l.scale(i.zoomX/this.scaleX/n,i.zoomY/this.scaleY/n),this._applyPatternGradientTransform(l,e),l.fillStyle=e.toLive(t),l.fill(),t.translate(-this.width/2-this.strokeWidth/2,-this.height/2-this.strokeWidth/2),t.scale(n*this.scaleX/i.zoomX,n*this.scaleY/i.zoomY),t.strokeStyle=null!=(r=l.createPattern(o,"no-repeat"))?r:"")}_findCenterFromElement(){return new tZ(this.left+this.width/2,this.top+this.height/2)}clone(t){let e=this.toObject(t);return this.constructor.fromObject(e)}cloneAsImage(t){let e=this.toCanvasElement(t);return new(tY.getClass("image"))(e)}toCanvasElement(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=eq(this),r=this.group,i=this.shadow,n=Math.abs,s=t.enableRetinaScaling?tp():1,a=(t.multiplier||1)*s,o=t.canvasProvider||(t=>new eB(t,{enableRetinaScaling:!1,renderOnAddRemove:!1,skipOffscreen:!1}));delete this.group,t.withoutTransform&&eG(this),t.withoutShadow&&(this.shadow=null),t.viewportTransform&&e$(this,this.getViewportTransform()),this.setCoords();let l=t6(),h=this.getBoundingRect(),c=this.shadow,u=new tZ;if(c){let t=c.blur,e=c.nonScaling?new tZ(1,1):this.getObjectScaling();u.x=2*Math.round(n(c.offsetX)+t)*n(e.x),u.y=2*Math.round(n(c.offsetY)+t)*n(e.y)}let d=h.width+u.x,f=h.height+u.y;l.width=Math.ceil(d),l.height=Math.ceil(f);let g=o(l);"jpeg"===t.format&&(g.backgroundColor="#fff"),this.setPositionByOrigin(new tZ(g.width/2,g.height/2),tC,tC);let p=this.canvas;g._objects=[this],this.set("canvas",g),this.setCoords();let m=g.toCanvasElement(a||1,t);return this.set("canvas",p),this.shadow=i,r&&(this.group=r),this.set(e),this.setCoords(),g._objects=[],g.destroy(),m}toDataURL(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return et(this.toCanvasElement(t),t.format||"png",t.quality||1)}toBlob(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ee(this.toCanvasElement(t),t.format||"png",t.quality||1)}isType(){for(var t=arguments.length,e=Array(t),r=0;r{let[i,n]=r;return t[i]=this._animate(i,n,e),t},{})}_animate(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=t.split("."),n=this.constructor.colorProperties.includes(i[i.length-1]),{abort:s,startValue:a,onChange:o,onComplete:l}=r,h=te(te({},r),{},{target:this,startValue:null!=a?a:i.reduce((t,e)=>t[e],this),endValue:e,abort:null==s?void 0:s.bind(this),onChange:(t,e,r)=>{i.reduce((e,r,n)=>(n===i.length-1&&(e[r]=t),e[r]),this),o&&o(t,e,r)},onComplete:(t,e,r)=>{this.setCoords(),l&&l(t,e,r)}});return n?it(h):r7(h)}isDescendantOf(t){let{parent:e,group:r}=this;return e===t||r===t||!!e&&e.isDescendantOf(t)||!!r&&r!==e&&r.isDescendantOf(t)}getAncestors(){let t=[],e=this;do(e=e.parent)&&t.push(e);while(e)return t}findCommonAncestors(t){if(this===t)return{fork:[],otherFork:[],common:[this,...this.getAncestors()]};let e=this.getAncestors(),r=t.getAncestors();if(0===e.length&&r.length>0&&this===r[r.length-1])return{fork:[],otherFork:[t,...r.slice(0,r.length-1)],common:[this]};for(let i,n=0;n-1&&s>a}toObject(){let e,r=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).concat(t.customProperties,this.constructor.customProperties||[]),i=ts.NUM_FRACTION_DIGITS,{clipPath:n,fill:s,stroke:a,shadow:o,strokeDashArray:l,left:h,top:c,originX:u,originY:d,width:f,height:g,strokeWidth:p,strokeLineCap:m,strokeDashOffset:y,strokeLineJoin:x,strokeUniform:b,strokeMiterLimit:_,scaleX:w,scaleY:C,angle:S,flipX:T,flipY:O,opacity:k,visible:M,backgroundColor:E,fillRule:D,paintFirst:j,globalCompositeOperation:A,skewX:P,skewY:F}=this;n&&!n.excludeFromExport&&(e=n.toObject(r.concat("inverted","absolutePositioned")));let L=t=>eS(t,i),R=te(te({},ew(this,r)),{},{type:this.constructor.type,version:tv,originX:u,originY:d,left:L(h),top:L(c),width:L(f),height:L(g),fill:ek(s)?s.toObject():s,stroke:ek(a)?a.toObject():a,strokeWidth:L(p),strokeDashArray:l?l.concat():l,strokeLineCap:m,strokeDashOffset:y,strokeLineJoin:x,strokeUniform:b,strokeMiterLimit:L(_),scaleX:L(w),scaleY:L(C),angle:L(S),flipX:T,flipY:O,opacity:L(k),shadow:o?o.toObject():o,visible:M,backgroundColor:E,fillRule:D,paintFirst:j,globalCompositeOperation:A,skewX:L(P),skewY:L(F)},e?{clipPath:e}:null);return this.includeDefaultValues?R:this._removeDefaultValues(R)}toDatalessObject(t){return this.toObject(t)}_removeDefaultValues(t){let e=this.constructor.getDefaults(),r=Object.keys(e).length>0?e:Object.getPrototypeOf(this);return eC(t,(t,e)=>{if(e===tS||"top"===e||"type"===e)return!0;let i=r[e];return t!==i&&!(Array.isArray(t)&&Array.isArray(i)&&0===t.length&&0===i.length)})}toString(){return"#<".concat(this.constructor.type,">")}static _fromObject(t){let e=tr(t,ii),r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{extraParam:i}=r;return e_(e,tr(r,is)).then(t=>i?(delete t[i],new this(e[i],t)):new this(t))}static fromObject(t,e){return this._fromObject(t,e)}constructor(e){super(),$(this,"_cacheContext",null),Object.assign(this,t.ownDefaults),this.setOptions(e)}};$(ia,"stateProperties",rz),$(ia,"cacheProperties",rY),$(ia,"ownDefaults",{top:0,left:0,width:0,height:0,angle:0,flipX:!1,flipY:!1,scaleX:1,scaleY:1,minScaleLimit:0,skewX:0,skewY:0,originX:tS,originY:"top",strokeWidth:1,strokeUniform:!1,padding:0,opacity:1,paintFirst:tH,fill:"rgb(0,0,0)",fillRule:"nonzero",stroke:null,strokeDashArray:null,strokeDashOffset:0,strokeLineCap:"butt",strokeLineJoin:"miter",strokeMiterLimit:4,globalCompositeOperation:"source-over",backgroundColor:"",shadow:null,visible:!0,includeDefaultValues:!0,excludeFromExport:!1,objectCaching:!0,clipPath:void 0,inverted:!1,absolutePositioned:!1,centeredRotation:!0,centeredScaling:!1,dirty:!0}),$(ia,"type","FabricObject"),$(ia,"colorProperties",[tH,tX,"backgroundColor"]),$(ia,"customProperties",[]),tY.setClass(ia),tY.setClass(ia,"object");let io=(t,e,r)=>(i,n,s,a)=>{let o=e(i,n,s,a);return o&&e0(t,te(te({},e9(i,n,s,a)),r)),o};function il(t){return(e,r,i,n)=>{let{target:s,originX:a,originY:o}=r,l=s.getRelativeCenterPoint(),h=s.translateToOriginPoint(l,a,o),c=t(e,r,i,n);return s.setPositionByOrigin(h,r.originX,r.originY),c}}let ih=io(tF,il((t,e,r,i)=>{let n=e8(e,e.originX,e.originY,r,i);if(e2(e.originX)===e2(tC)||e2(e.originX)===e2(tO)&&n.x<0||e2(e.originX)===e2(tS)&&n.x>0){let{target:t}=e,r=t.strokeWidth/(t.strokeUniform?t.scaleX:1),i=e4(e)?2:1,s=t.width,a=Math.abs(n.x*i/t.scaleX)-r;return t.set("width",Math.max(a,1)),s!==t.width}return!1}));function ic(t,e,r,i,n){i=i||{};let s=this.sizeX||i.cornerSize||n.cornerSize,a=this.sizeY||i.cornerSize||n.cornerSize,o=void 0!==i.transparentCorners?i.transparentCorners:n.transparentCorners,l=o?tX:tH,h=!o&&(i.cornerStrokeColor||n.cornerStrokeColor),c,u=e,d=r;t.save(),t.fillStyle=i.cornerColor||n.cornerColor||"",t.strokeStyle=i.cornerStrokeColor||n.cornerStrokeColor||"",s>a?(c=s,t.scale(1,a/s),d=r*s/a):a>s?(c=a,t.scale(s/a,1),u=e*a/s):c=s,t.beginPath(),t.arc(u,d,c/2,0,tb,!1),t[l](),h&&t.stroke(),t.restore()}function iu(t,e,r,i,n){i=i||{};let s=this.sizeX||i.cornerSize||n.cornerSize,a=this.sizeY||i.cornerSize||n.cornerSize,o=void 0!==i.transparentCorners?i.transparentCorners:n.transparentCorners,l=o?tX:tH,h=!o&&(i.cornerStrokeColor||n.cornerStrokeColor),c=s/2,u=a/2;t.save(),t.fillStyle=i.cornerColor||n.cornerColor||"",t.strokeStyle=i.cornerStrokeColor||n.cornerStrokeColor||"",t.translate(e,r);let d=n.getTotalAngle();t.rotate(er(d)),t["".concat(l,"Rect")](-c,-u,s,a),h&&t.strokeRect(-c,-u,s,a),t.restore()}class id{shouldActivate(t,e,r,i){var n;let{tl:s,tr:a,br:o,bl:l}=i;return(null==(n=e.canvas)?void 0:n.getActiveObject())===e&&e.isControlVisible(t)&&ie.isPointInPolygon(r,[s,a,o,l])}getActionHandler(t,e,r){return this.actionHandler}getMouseDownHandler(t,e,r){return this.mouseDownHandler}getMouseUpHandler(t,e,r){return this.mouseUpHandler}cursorStyleHandler(t,e,r){return e.cursorStyle}getActionName(t,e,r){return e.actionName}getVisibility(t,e){var r,i;return null!=(r=null==(i=t._controlsVisibility)?void 0:i[e])?r:this.visible}setVisibility(t,e,r){this.visible=t}positionHandler(t,e,r,i){return new tZ(this.x*t.x+this.offsetX,this.y*t.y+this.offsetY).transform(e)}calcCornerCoords(t,e,r,i,n,s){let a=el([eu(r,i),ed({angle:t}),ef((n?this.touchSizeX:this.sizeX)||e,(n?this.touchSizeY:this.sizeY)||e)]);return{tl:new tZ(-.5,-.5).transform(a),tr:new tZ(.5,-.5).transform(a),br:new tZ(.5,.5).transform(a),bl:new tZ(-.5,.5).transform(a)}}render(t,e,r,i,n){"circle"===((i=i||{}).cornerStyle||n.cornerStyle)?ic.call(this,t,e,r,i,n):iu.call(this,t,e,r,i,n)}constructor(t){$(this,"visible",!0),$(this,"actionName",tI),$(this,"angle",0),$(this,"x",0),$(this,"y",0),$(this,"offsetX",0),$(this,"offsetY",0),$(this,"sizeX",0),$(this,"sizeY",0),$(this,"touchSizeX",0),$(this,"touchSizeY",0),$(this,"cursorStyle","crosshair"),$(this,"withConnection",!1),Object.assign(this,t)}}let ig=(t,e,r)=>r.lockRotation?e5:e.cursorStyle,ip=io(tj,il((t,e,r,i)=>{let{target:n,ex:s,ey:a,theta:o,originX:l,originY:h}=e,c=n.translateToOriginPoint(n.getRelativeCenterPoint(),l,h);if(e3(n,"lockRotation"))return!1;let u=Math.atan2(a-c.y,s-c.x),d=ei(Math.atan2(i-c.y,r-c.x)-u+o);if(n.snapAngle&&n.snapAngle>0){let t=n.snapAngle,e=n.snapThreshold||t,r=Math.ceil(d/t)*t,i=Math.floor(d/t)*t;Math.abs(d-i){let i=im(t,r);if(iv(r,0!==e.x&&0===e.y?"x":0===e.x&&0!==e.y?"y":"",i))return e5;let n=e6(r,e);return"".concat(iy[n],"-resize")};function ib(t,e,r,i){let n,s,a,o,l,h,c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},u=e.target,d=c.by,f=im(t,u);if(iv(u,d,f))return!1;if(e.gestureScale)s=e.scaleX*e.gestureScale,a=e.scaleY*e.gestureScale;else{if(n=e8(e,e.originX,e.originY,r,i),l="y"!==d?Math.sign(n.x||e.signX||1):1,h="x"!==d?Math.sign(n.y||e.signY||1):1,e.signX||(e.signX=l),e.signY||(e.signY=h),e3(u,"lockScalingFlip")&&(e.signX!==l||e.signY!==h))return!1;if(o=u._getTransformedDimensions(),f&&!d){let t=Math.abs(n.x)+Math.abs(n.y),{original:r}=e,i=t/(Math.abs(o.x*r.scaleX/u.scaleX)+Math.abs(o.y*r.scaleY/u.scaleY));s=r.scaleX*i,a=r.scaleY*i}else s=Math.abs(n.x*u.scaleX/o.x),a=Math.abs(n.y*u.scaleY/o.y);e4(e)&&(s*=2,a*=2),e.signX!==l&&"y"!==d&&(e.originX=.5-e2(e.originX),s*=-1,e.signX=l),e.signY!==h&&"x"!==d&&(e.originY=.5-e2(e.originY),a*=-1,e.signY=h)}let g=u.scaleX,p=u.scaleY;return d?("x"===d&&u.set(tB,s),"y"===d&&u.set(tN,a)):(e3(u,"lockScalingX")||u.set(tB,s),e3(u,"lockScalingY")||u.set(tN,a)),g!==u.scaleX||p!==u.scaleY}let i_=io(tD,il((t,e,r,i)=>ib(t,e,r,i))),iw=io(tD,il((t,e,r,i)=>ib(t,e,r,i,{by:"x"}))),iC=io(tD,il((t,e,r,i)=>ib(t,e,r,i,{by:"y"}))),iS=["target","ex","ey","skewingSide"],iT={x:{counterAxis:"y",scale:tB,skew:tW,lockSkewing:"lockSkewingX",origin:"originX",flip:"flipX"},y:{counterAxis:"x",scale:tN,skew:tU,lockSkewing:"lockSkewingY",origin:"originY",flip:"flipY"}},iO=["ns","nesw","ew","nwse"],ik=(t,e,r)=>{if(0!==e.x&&e3(r,"lockSkewingY")||0!==e.y&&e3(r,"lockSkewingX"))return e5;let i=e6(r,e)%4;return"".concat(iO[i],"-resize")};function iM(t,e,r,i,n){let{target:s}=r,{counterAxis:a,origin:o,lockSkewing:l,skew:h,flip:c}=iT[t];if(e3(s,l))return!1;let{origin:u,flip:d}=iT[a],f=-Math.sign(e2(r[u])*(s[d]?-1:1))*(s[c]?-1:1),g=-(.5*((0===s[h]&&e8(r,tC,tC,i,n)[t]>0||s[h]>0?1:-1)*f))+.5;return io(tP,il((e,r,i,n)=>(function(t,e,r){let{target:i,ex:n,ey:s,skewingSide:a}=e,o=tr(e,iS),{skew:l}=iT[t],h=r.subtract(new tZ(n,s)).divide(new tZ(i.scaleX,i.scaleY))[t],c=i[l],u=Math.tan(er(o[l])),d=ei(Math.atan(2*h*a/Math.max("y"===t?i._getTransformedDimensions({scaleX:1,scaleY:1,skewX:0}).x:i._getTransformedDimensions({scaleX:1,scaleY:1}).y,1)+u));i.set(l,d);let f=c!==i[l];if(f&&"y"===t){let{skewX:t,scaleX:e}=i,r=i._getTransformedDimensions({skewY:c}),n=i._getTransformedDimensions(),s=0!==t?r.x/n.x:1;1!==s&&i.set(tB,s*e)}return f})(t,r,new tZ(i,n))))(e,te(te({},r),{},{[o]:g,skewingSide:f}),i,n)}let iE=(t,e,r,i)=>iM("x",t,e,r,i),iD=(t,e,r,i)=>iM("y",t,e,r,i);function ij(t,e){return t[e.canvas.altActionKey]}let iA=(t,e,r)=>{let i=ij(t,r);return 0===e.x?i?tW:tN:0===e.y?i?tU:tB:""},iP=(t,e,r)=>ij(t,r)?ik(0,e,r):ix(t,e,r),iF=(t,e,r,i)=>ij(t,e.target)?iD(t,e,r,i):iw(t,e,r,i),iL=(t,e,r,i)=>ij(t,e.target)?iE(t,e,r,i):iC(t,e,r,i),iR=()=>({ml:new id({x:-.5,y:0,cursorStyleHandler:iP,actionHandler:iF,getActionName:iA}),mr:new id({x:.5,y:0,cursorStyleHandler:iP,actionHandler:iF,getActionName:iA}),mb:new id({x:0,y:.5,cursorStyleHandler:iP,actionHandler:iL,getActionName:iA}),mt:new id({x:0,y:-.5,cursorStyleHandler:iP,actionHandler:iL,getActionName:iA}),tl:new id({x:-.5,y:-.5,cursorStyleHandler:ix,actionHandler:i_}),tr:new id({x:.5,y:-.5,cursorStyleHandler:ix,actionHandler:i_}),bl:new id({x:-.5,y:.5,cursorStyleHandler:ix,actionHandler:i_}),br:new id({x:.5,y:.5,cursorStyleHandler:ix,actionHandler:i_}),mtr:new id({x:0,y:-.5,actionHandler:ip,cursorStyleHandler:ig,offsetY:-40,withConnection:!0,actionName:tA})}),iI=()=>({mr:new id({x:.5,y:0,actionHandler:ih,cursorStyleHandler:iP,actionName:tF}),ml:new id({x:-.5,y:0,actionHandler:ih,cursorStyleHandler:iP,actionName:tF})}),iB=()=>te(te({},iR()),iI());class iN extends ia{static getDefaults(){return te(te({},super.getDefaults()),iN.ownDefaults)}static createControls(){return{controls:iR()}}_updateCacheCanvas(){let t=this.canvas;if(this.noScaleCache&&t&&t._currentTransform){let e=t._currentTransform,r=e.target,i=e.action;if(this===r&&i&&i.startsWith(tI))return!1}return super._updateCacheCanvas()}getActiveControl(){let t=this.__corner;return t?{key:t,control:this.controls[t],coord:this.oCoords[t]}:void 0}findControl(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.hasControls||!this.canvas)return;this.__corner=void 0;let r=Object.entries(this.oCoords);for(let i=r.length-1;i>=0;i--){let[n,s]=r[i],a=this.controls[n];if(a.shouldActivate(n,this,t,e?s.touchCorner:s.corner))return this.__corner=n,{key:n,control:a,coord:this.oCoords[n]}}}calcOCoords(){let t=this.getViewportTransform(),e=this.getCenterPoint(),r=eo(eu(e.x,e.y),ed({angle:this.getTotalAngle()-(this.group&&this.flipX?180:0)})),i=eo(t,r),n=eo(i,[1/t[0],0,0,1/t[3],0,0]),s=this.group?ec(this.calcTransformMatrix()):void 0;s&&(s.scaleX=Math.abs(s.scaleX),s.scaleY=Math.abs(s.scaleY));let a=this._calculateCurrentDimensions(s),o={};return this.forEachControl((t,e)=>{let r=t.positionHandler(a,n,this,t);o[e]=Object.assign(r,this._calcCornerCoords(t,r))}),o}_calcCornerCoords(t,e){let r=this.getTotalAngle();return{corner:t.calcCornerCoords(r,this.cornerSize,e.x,e.y,!1,this),touchCorner:t.calcCornerCoords(r,this.touchCornerSize,e.x,e.y,!0,this)}}setCoords(){super.setCoords(),this.canvas&&(this.oCoords=this.calcOCoords())}forEachControl(t){for(let e in this.controls)t(this.controls[e],e,this)}drawSelectionBackground(t){if(!this.selectionBackgroundColor||this.canvas&&this.canvas._activeObject!==this)return;t.save();let e=this.getRelativeCenterPoint(),r=this._calculateCurrentDimensions(),i=this.getViewportTransform();t.translate(e.x,e.y),t.scale(1/i[0],1/i[3]),t.rotate(er(this.angle)),t.fillStyle=this.selectionBackgroundColor,t.fillRect(-r.x/2,-r.y/2,r.x,r.y),t.restore()}strokeBorders(t,e){t.strokeRect(-e.x/2,-e.y/2,e.x,e.y)}_drawBorders(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=te({hasControls:this.hasControls,borderColor:this.borderColor,borderDashArray:this.borderDashArray},r);t.save(),t.strokeStyle=i.borderColor,this._setLineDash(t,i.borderDashArray),this.strokeBorders(t,e),i.hasControls&&this.drawControlsConnectingLines(t,e),t.restore()}_renderControls(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{hasBorders:r,hasControls:i}=this,n=te({hasBorders:r,hasControls:i},e),s=this.getViewportTransform(),a=n.hasBorders,o=n.hasControls,l=ec(eo(s,this.calcTransformMatrix()));t.save(),t.translate(l.translateX,l.translateY),t.lineWidth=this.borderScaleFactor,this.group===this.parent&&(t.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1),this.flipX&&(l.angle-=180),t.rotate(er(this.group?l.angle:this.angle)),a&&this.drawBorders(t,l,e),o&&this.drawControls(t,e),t.restore()}drawBorders(t,e,r){let i;if(r&&r.forActiveSelection||this.group){let t=eK(this.width,this.height,ev(e)),r=this.isStrokeAccountedForInDimensions()?t$:(this.strokeUniform?(new tZ).scalarAdd(this.canvas?this.canvas.getZoom():1):new tZ(e.scaleX,e.scaleY)).scalarMultiply(this.strokeWidth);i=t.add(r).scalarAdd(this.borderScaleFactor).scalarAdd(2*this.padding)}else i=this._calculateCurrentDimensions().scalarAdd(this.borderScaleFactor);this._drawBorders(t,i,r)}drawControlsConnectingLines(t,e){let r=!1;t.beginPath(),this.forEachControl((i,n)=>{i.withConnection&&i.getVisibility(this,n)&&(r=!0,t.moveTo(i.x*e.x,i.y*e.y),t.lineTo(i.x*e.x+i.offsetX,i.y*e.y+i.offsetY))}),r&&t.stroke()}drawControls(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.save();let r=this.getCanvasRetinaScaling(),{cornerStrokeColor:i,cornerDashArray:n,cornerColor:s}=this,a=te({cornerStrokeColor:i,cornerDashArray:n,cornerColor:s},e);t.setTransform(r,0,0,r,0,0),t.strokeStyle=t.fillStyle=a.cornerColor,this.transparentCorners||(t.strokeStyle=a.cornerStrokeColor),this._setLineDash(t,a.cornerDashArray),this.forEachControl((e,r)=>{if(e.getVisibility(this,r)){let i=this.oCoords[r];e.render(t,i.x,i.y,a,this)}}),t.restore()}isControlVisible(t){return this.controls[t]&&this.controls[t].getVisibility(this,t)}setControlVisible(t,e){this._controlsVisibility||(this._controlsVisibility={}),this._controlsVisibility[t]=e}setControlsVisibility(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.entries(t).forEach(t=>{let[e,r]=t;return this.setControlVisible(e,r)})}clearContextTop(t){if(!this.canvas)return;let e=this.canvas.contextTop;if(!e)return;let r=this.canvas.viewportTransform;e.save(),e.transform(r[0],r[1],r[2],r[3],r[4],r[5]),this.transform(e);let i=this.width+4,n=this.height+4;return e.clearRect(-i/2,-n/2,i,n),t||e.restore(),e}onDeselect(t){return!1}onSelect(t){return!1}shouldStartDragging(t){return!1}onDragStart(t){return!1}canDrop(t){return!1}renderDragSourceEffect(t){}renderDropTargetEffect(t){}constructor(t){super(),Object.assign(this,this.constructor.createControls(),iN.ownDefaults),this.setOptions(t)}}function iW(t,e){return e.forEach(e=>{Object.getOwnPropertyNames(e.prototype).forEach(r=>{"constructor"!==r&&Object.defineProperty(t.prototype,r,Object.getOwnPropertyDescriptor(e.prototype,r)||Object.create(null))})}),t}$(iN,"ownDefaults",{noScaleCache:!0,lockMovementX:!1,lockMovementY:!1,lockRotation:!1,lockScalingX:!1,lockScalingY:!1,lockSkewingX:!1,lockSkewingY:!1,lockScalingFlip:!1,cornerSize:13,touchCornerSize:24,transparentCorners:!0,cornerColor:"rgb(178,204,255)",cornerStrokeColor:"",cornerStyle:"rect",cornerDashArray:null,hasControls:!0,borderColor:"rgb(178,204,255)",borderDashArray:null,borderOpacityWhenMoving:.4,borderScaleFactor:1,hasBorders:!0,selectionBackgroundColor:"",selectable:!0,evented:!0,perPixelTargetFind:!1,activeOn:"down",hoverCursor:null,moveCursor:null});class iU extends iN{}iW(iU,[rc]),tY.setClass(iU),tY.setClass(iU,"object");let iH=(t,e,r,i)=>{let n=2*(i=Math.round(i))+1,{data:s}=t.getImageData(e-i,r-i,n,n);for(let t=3;t0)return!1;return!0};class iX{createSideVector(t,e){let r=rA(t,e);return this.options.strokeUniform?r.multiply(this.scale):r}projectOrthogonally(t,e,r){return this.applySkew(t.add(this.calcOrthogonalProjection(t,e,r)))}isSkewed(){return 0!==this.options.skewX||0!==this.options.skewY}applySkew(t){let e=new tZ(t);return e.y+=e.x*Math.tan(er(this.options.skewY)),e.x+=e.y*Math.tan(er(this.options.skewX)),e}scaleUnitVector(t,e){return t.multiply(this.strokeUniformScalar).scalarMultiply(e)}constructor(t){this.options=t,this.strokeProjectionMagnitude=this.options.strokeWidth/2,this.scale=new tZ(this.options.scaleX,this.options.scaleY),this.strokeUniformScalar=this.options.strokeUniform?new tZ(1/this.options.scaleX,1/this.options.scaleY):new tZ(1,1)}}let iV=new tZ;class iz extends iX{static getOrthogonalRotationFactor(t,e){return Math.abs(e?rF(t,e):rL(t))2&&void 0!==arguments[2]?arguments[2]:this.strokeProjectionMagnitude,i=rI(this.createSideVector(t,e)),n=iz.getOrthogonalRotationFactor(i,this.bisector);return this.scaleUnitVector(i,r*n)}projectBevel(){let t=[];return(this.alpha%tb==0?[this.B]:[this.B,this.C]).forEach(e=>{t.push(this.projectOrthogonally(this.A,e)),t.push(this.projectOrthogonally(this.A,e,-this.strokeProjectionMagnitude))}),t}projectMiter(){let t=[],e=1/Math.sin(Math.abs(this.alpha)/2),r=this.scaleUnitVector(this.bisector,-this.strokeProjectionMagnitude*e),i=this.options.strokeUniform?rP(this.scaleUnitVector(this.bisector,this.options.strokeMiterLimit)):this.options.strokeMiterLimit;return rP(r)/this.strokeProjectionMagnitude<=i&&t.push(this.applySkew(this.A.add(r))),t.push(...this.projectBevel()),t}projectRoundNoSkew(t,e){let r=[],i=new tZ(iz.getOrthogonalRotationFactor(this.bisector),iz.getOrthogonalRotationFactor(new tZ(this.bisector.y,this.bisector.x)));return[new tZ(1,0).scalarMultiply(this.strokeProjectionMagnitude).multiply(this.strokeUniformScalar).multiply(i),new tZ(0,1).scalarMultiply(this.strokeProjectionMagnitude).multiply(this.strokeUniformScalar).multiply(i)].forEach(i=>{rW(i,t,e)&&r.push(this.A.add(i))}),r}projectRoundWithSkew(t,e){let r=[],{skewX:i,skewY:n,scaleX:s,scaleY:a,strokeUniform:o}=this.options,l=new tZ(Math.tan(er(i)),Math.tan(er(n))),h=this.strokeProjectionMagnitude,c=o?h/a/Math.sqrt(1/a**2+1/s**2*l.y**2):h/Math.sqrt(1+l.y**2),u=new tZ(Math.sqrt(Math.max(h**2-c**2,0)),c),d=o?h/Math.sqrt(1+l.x**2*(1/a)**2/(1/s+1/s*l.x*l.y)**2):h/Math.sqrt(1+l.x**2/(1+l.x*l.y)**2),f=new tZ(d,Math.sqrt(Math.max(h**2-d**2,0)));return[f,f.scalarMultiply(-1),u,u.scalarMultiply(-1)].map(t=>this.applySkew(o?t.multiply(this.strokeUniformScalar):t)).forEach(i=>{rW(i,t,e)&&r.push(this.applySkew(this.A).add(i))}),r}projectRound(){let t=[];t.push(...this.projectBevel());let e=this.alpha%tb==0,r=this.applySkew(this.A),i=t[2*!e].subtract(r),n=t[+!!e].subtract(r),s=rB(i,e?this.applySkew(this.AB.scalarMultiply(-1)):this.applySkew(this.bisector.multiply(this.strokeUniformScalar).scalarMultiply(-1)))>0,a=s?i:n,o=s?n:i;return this.isSkewed()?t.push(...this.projectRoundWithSkew(a,o)):t.push(...this.projectRoundNoSkew(a,o)),t}projectPoints(){switch(this.options.strokeLineJoin){case"miter":return this.projectMiter();case"round":return this.projectRound();default:return this.projectBevel()}}project(){return this.projectPoints().map(t=>({originPoint:this.A,projectedPoint:t,angle:this.alpha,bisector:this.bisector}))}constructor(t,e,r,i){super(i),$(this,"AB",void 0),$(this,"AC",void 0),$(this,"alpha",void 0),$(this,"bisector",void 0),this.A=new tZ(t),this.B=new tZ(e),this.C=new tZ(r),this.AB=this.createSideVector(this.A,this.B),this.AC=this.createSideVector(this.A,this.C),this.alpha=rF(this.AB,this.AC),this.bisector=rR(rj(this.AB.eq(iV)?this.AC:this.AB,this.alpha/2))}}class iY extends iX{calcOrthogonalProjection(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.strokeProjectionMagnitude,i=this.createSideVector(t,e);return this.scaleUnitVector(rI(i),r)}projectButt(){return[this.projectOrthogonally(this.A,this.T,this.strokeProjectionMagnitude),this.projectOrthogonally(this.A,this.T,-this.strokeProjectionMagnitude)]}projectRound(){let t=[];if(!this.isSkewed()&&this.A.eq(this.T)){let e=new tZ(1,1).scalarMultiply(this.strokeProjectionMagnitude).multiply(this.strokeUniformScalar);t.push(this.applySkew(this.A.add(e)),this.applySkew(this.A.subtract(e)))}else t.push(...new iz(this.A,this.T,this.T,this.options).projectRound());return t}projectSquare(){let t=[];if(this.A.eq(this.T)){let e=new tZ(1,1).scalarMultiply(this.strokeProjectionMagnitude).multiply(this.strokeUniformScalar);t.push(this.A.add(e),this.A.subtract(e))}else{let e=this.calcOrthogonalProjection(this.A,this.T,this.strokeProjectionMagnitude),r=this.scaleUnitVector(rR(this.createSideVector(this.A,this.T)),-this.strokeProjectionMagnitude),i=this.A.add(r);t.push(i.add(e),i.subtract(e))}return t.map(t=>this.applySkew(t))}projectPoints(){switch(this.options.strokeLineCap){case"round":return this.projectRound();case"square":return this.projectSquare();default:return this.projectButt()}}project(){return this.projectPoints().map(t=>({originPoint:this.A,projectedPoint:t}))}constructor(t,e,r){super(r),this.A=new tZ(t),this.T=new tZ(e)}}let iG=function(t,e){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=[];if(0===t.length)return i;let n=t.reduce((t,e)=>(t[t.length-1].eq(e)||t.push(new tZ(e)),t),[new tZ(t[0])]);if(1===n.length)r=!0;else if(!r){let t=n[0],e=((t,e)=>{for(let r=t.length-1;r>=0;r--)if(e(t[r],r,t))return r;return -1})(n,e=>!e.eq(t));n.splice(e+1)}return n.forEach((t,n,s)=>{let a,o;0===n?(o=s[1],a=r?t:s[s.length-1]):n===s.length-1?(a=s[n-1],o=r?t:s[0]):(a=s[n-1],o=s[n+1]),r&&1===s.length?i.push(...new iY(t,t,e).project()):r&&(0===n||n===s.length-1)?i.push(...new iY(t,0===n?o:a,e).project()):i.push(...new iz(t,a,o,e).project())}),i},iq=t=>{let e={};return Object.keys(t).forEach(r=>{e[r]={},Object.keys(t[r]).forEach(i=>{e[r][i]=te({},t[r][i])})}),e},iK=t=>t.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">"),iQ=t=>(r||r||(r="Intl"in tg()&&"Segmenter"in Intl&&new Intl.Segmenter(void 0,{granularity:"grapheme"})),r)?Array.from(r.segment(t)).map(t=>{let{segment:e}=t;return e}):iJ(t),iJ=t=>{let e=[];for(let r,i=0;i{let r=t.charCodeAt(e);if(isNaN(r))return"";if(r<55296||r>57343)return t.charAt(e);if(55296<=r&&r<=56319){if(t.length<=e+1)throw"High surrogate without following low surrogate";let r=t.charCodeAt(e+1);if(56320>r||r>57343)throw"High surrogate without following low surrogate";return t.charAt(e)+t.charAt(e+1)}if(0===e)throw"Low surrogate without preceding high surrogate";let i=t.charCodeAt(e-1);if(55296>i||i>56319)throw"Low surrogate without preceding high surrogate";return!1};var i$=Object.freeze({__proto__:null,capitalize:function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return"".concat(t.charAt(0).toUpperCase()).concat(e?t.slice(1):t.slice(1).toLowerCase())},escapeXml:iK,graphemeSplit:iQ});let i0=function(t,e){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return t.fill!==e.fill||t.stroke!==e.stroke||t.strokeWidth!==e.strokeWidth||t.fontSize!==e.fontSize||t.fontFamily!==e.fontFamily||t.fontWeight!==e.fontWeight||t.fontStyle!==e.fontStyle||t.textDecorationThickness!==e.textDecorationThickness||t.textBackgroundColor!==e.textBackgroundColor||t.deltaY!==e.deltaY||r&&(t.overline!==e.overline||t.underline!==e.underline||t.linethrough!==e.linethrough)},i1=(t,e)=>{let r=e.split("\n"),i=[],n=-1,s={};t=iq(t);for(let e=0;e0&&(i0(s,a,!0)?i.push({start:n,end:n+1,style:a}):i[i.length-1].end++),s=a||{}}else n+=a.length,s={}}return i},i2=(t,e)=>{if(!Array.isArray(t))return iq(t);let r=e.split(tM),i={},n=-1,s=0;for(let e=0;e{var e;return null!=(e=rT[t])?e:t},i9=RegExp("(".concat(rw,")"),"gi"),i6="(".concat(rw,")"),i8=String.raw(h||(h=ti(["(skewX)(",")"],["(skewX)\\(","\\)"])),i6),i7=String.raw(c||(c=ti(["(skewY)(",")"],["(skewY)\\(","\\)"])),i6),nt=String.raw(u||(u=ti(["(rotate)(","(?: "," ",")?)"],["(rotate)\\(","(?: "," ",")?\\)"])),i6,i6,i6),ne=String.raw(d||(d=ti(["(scale)(","(?: ",")?)"],["(scale)\\(","(?: ",")?\\)"])),i6,i6),nr=String.raw(f||(f=ti(["(translate)(","(?: ",")?)"],["(translate)\\(","(?: ",")?\\)"])),i6,i6),ni=String.raw(g||(g=ti(["(matrix)("," "," "," "," "," ",")"],["(matrix)\\("," "," "," "," "," ","\\)"])),i6,i6,i6,i6,i6,i6),nn="(?:".concat(ni,"|").concat(nr,"|").concat(nt,"|").concat(ne,"|").concat(i8,"|").concat(i7,")"),ns=new RegExp(String.raw(p||(p=ti(["^s*(?:","?)s*$"],["^\\s*(?:","?)\\s*$"])),"(?:".concat(nn,"*)"))),na=new RegExp(nn),no=RegExp(nn,"g");function nl(t){let e=[];if(!(t=t.replace(i9," $1 ").replace(/,/gi," ").replace(/\s+/gi," ").replace(/\s*([()])\s*/gi,"$1"))||t&&!ns.test(t))return[...tw];for(let r of t.matchAll(no)){let t=na.exec(r[0]);if(!t)continue;let i=tw,[,n,...s]=t.filter(t=>!!t),[a,o,l,h,c,u]=s.map(t=>parseFloat(t));switch(n){case"translate":i=eu(a,o);break;case tA:i=ed({angle:a},{x:o,y:l});break;case tI:i=ef(a,o);break;case tW:i=ep(a);break;case tU:i=em(a);break;case"matrix":i=[a,o,l,h,c,u]}e.push(i)}return el(e)}let nh={stroke:"strokeOpacity",fill:"fillOpacity"};function nc(t,e,r){if(!t)return{};let i,n={},s=16;t.parentNode&&rM.test(t.parentNode.nodeName)&&(n=nc(t.parentElement,e,r)).fontSize&&(i=s=ro(n.fontSize));let a=te(te(te({},e.reduce((e,r)=>{let i=t.getAttribute(r);return i&&(e[r]=i),e},{})),function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={};for(let i in e)(function(t,e){let r=!0,i=i4(t,e.pop());return i&&e.length&&(r=function(t,e){let r,i=!0;for(;t.parentElement&&1===t.parentElement.nodeType&&e.length;)i&&(r=e.pop()),i=i4(t=t.parentElement,r);return 0===e.length}(t,e)),i&&r&&0===e.length})(t,i.split(" "))&&(r=te(te({},r),e[i]));return r}(t,r)),function(t){let e={},r=t.getAttribute("style");return r&&("string"==typeof r?r.replace(/;\s*$/,"").split(";").forEach(t=>{if(!t)return;let[r,i]=t.split(":");e[r.trim().toLowerCase()]=i.trim()}):Object.entries(r).forEach(t=>{let[r,i]=t;void 0!==i&&(e[r.toLowerCase()]=i)})),e}(t));a[rk]&&t.setAttribute(rk,a[rk]),a[rO]&&(i=ro(a[rO],s),a[rO]="".concat(i));let o={};for(let t in a){let e=i3(t),r=function(t,e,r,i){let n=Array.isArray(e),s,a=e;if(t!==tH&&t!==tX||e!==tk){if("strokeUniform"===t)return"non-scaling-stroke"===e;if("strokeDashArray"===t)a=e===tk?null:e.replace(/,/g," ").split(/\s+/).map(parseFloat);else if("transformMatrix"===t)a=r&&r.transformMatrix?eo(r.transformMatrix,nl(e)):nl(e);else if("visible"===t)a=e!==tk&&"hidden"!==e,r&&!1===r.visible&&(a=!1);else if("opacity"===t)a=parseFloat(e),r&&void 0!==r.opacity&&(a*=r.opacity);else if("textAnchor"===t)a="start"===e?tS:"end"===e?tO:tC;else if("charSpacing"===t||t===rd)s=ro(e,i)/i*1e3;else if("paintFirst"===t){let t=e.indexOf(tH),r=e.indexOf(tX);a=tH,(t>-1&&r>-1&&r-1)&&(a=tX)}else{if("href"===t||"xlink:href"===t||"font"===t||"id"===t)return e;if("imageSmoothing"===t)return"optimizeQuality"===e;s=n?e.map(ro):ro(e,i)}}else a="";return!n&&isNaN(s)?a:s}(e,a[t],n,i);o[e]=r}o&&o.font&&function(t,e){let r=t.match(rS);if(!r)return;let i=r[1],n=r[3],s=r[4],a=r[5],o=r[6];i&&(e.fontStyle=i),n&&(e.fontWeight=isNaN(parseFloat(n))?n:parseFloat(n)),s&&(e.fontSize=ro(s)),o&&(e.fontFamily=o),a&&(e.lineHeight="normal"===a?1:a)}(o.font,o);let l=te(te({},n),o);return rM.test(t.nodeName)?l:function(t){let e=iU.getDefaults();return Object.entries(nh).forEach(r=>{let[i,n]=r;if(void 0===t[n]||""===t[i])return;if(void 0===t[i]){if(!e[i])return;t[i]=e[i]}if(0===t[i].indexOf("url("))return;let s=new ra(t[i]);t[i]=s.setAlpha(eS(s.getAlpha()*t[n],2)).toRgba()}),t}(l)}let nu=["left","top","width","height","visible"],nd=["rx","ry"];class nf extends iU{static getDefaults(){return te(te({},super.getDefaults()),nf.ownDefaults)}_initRxRy(){let{rx:t,ry:e}=this;t&&!e?this.ry=t:e&&!t&&(this.rx=e)}_render(t){let{width:e,height:r}=this,i=-e/2,n=-r/2,s=this.rx?Math.min(this.rx,e/2):0,a=this.ry?Math.min(this.ry,r/2):0,o=0!==s||0!==a;t.beginPath(),t.moveTo(i+s,n),t.lineTo(i+e-s,n),o&&t.bezierCurveTo(i+e-.4477152502*s,n,i+e,n+.4477152502*a,i+e,n+a),t.lineTo(i+e,n+r-a),o&&t.bezierCurveTo(i+e,n+r-.4477152502*a,i+e-.4477152502*s,n+r,i+e-s,n+r),t.lineTo(i+s,n+r),o&&t.bezierCurveTo(i+.4477152502*s,n+r,i,n+r-.4477152502*a,i,n+r-a),t.lineTo(i,n+a),o&&t.bezierCurveTo(i,n+.4477152502*a,i+.4477152502*s,n,i+s,n),t.closePath(),this._renderPaintInOrder(t)}toObject(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return super.toObject([...nd,...t])}_toSVG(){let{width:t,height:e,rx:r,ry:i}=this;return["\n')]}static async fromElement(t,e,r){let i=nc(t,this.ATTRIBUTE_NAMES,r),{left:n=0,top:s=0,width:a=0,height:o=0,visible:l=!0}=i,h=tr(i,nu);return new this(te(te(te({},e),h),{},{left:n,top:s,width:a,height:o,visible:!!(l&&a&&o)}))}constructor(t){super(),Object.assign(this,nf.ownDefaults),this.setOptions(t),this._initRxRy()}}$(nf,"type","Rect"),$(nf,"cacheProperties",[...rY,...nd]),$(nf,"ownDefaults",{rx:0,ry:0}),$(nf,"ATTRIBUTE_NAMES",[...i5,"x","y","rx","ry","width","height"]),tY.setClass(nf),tY.setSVGClass(nf);let ng="initialization",np="added",nm="removed",nv="imperative",ny=(t,e)=>{let{strokeUniform:r,strokeWidth:i,width:n,height:s,group:a}=e,o=a&&a!==t?eQ(a.calcTransformMatrix(),t.calcTransformMatrix()):null,l=o?e.getRelativeCenterPoint().transform(o):e.getRelativeCenterPoint(),h=!e.isStrokeAccountedForInDimensions(),c=r&&h?eZ(new tZ(i,i),void 0,t.calcTransformMatrix()):t$,u=!r&&h?i:0,d=eK(n+u,s+u,el([o,e.calcOwnMatrix()],!0)).add(c).scalarDivide(2);return[l.subtract(d),l.add(d)]};class nx{calcLayoutResult(t,e){if(this.shouldPerformLayout(t))return this.calcBoundingBox(e,t)}shouldPerformLayout(t){let{type:e,prevStrategy:r,strategy:i}=t;return e===ng||e===nv||!!r&&i!==r}shouldLayoutClipPath(t){let{type:e,target:{clipPath:r}}=t;return e!==ng&&r&&!r.absolutePositioned}getInitialSize(t,e){return e.size}calcBoundingBox(t,e){let{type:r,target:i}=e;if(r===nv&&e.overrides)return e.overrides;if(0===t.length)return;let{left:n,top:s,width:a,height:o}=eX(t.map(t=>ny(i,t)).reduce((t,e)=>t.concat(e),[])),l=new tZ(a,o),h=new tZ(n,s).add(l.scalarDivide(2));if(r===ng){let t=this.getInitialSize(e,{size:l,center:h});return{center:h,relativeCorrection:new tZ(0,0),size:t}}return{center:h.transform(i.calcOwnMatrix()),size:l}}}$(nx,"type","strategy");class nb extends nx{shouldPerformLayout(t){return!0}}$(nb,"type","fit-content"),tY.setClass(nb);let n_=["strategy"],nw=["target","strategy","bubbles","prevStrategy"],nC="layoutManager";class nS{performLayout(t){let e=te(te({bubbles:!0,strategy:this.strategy},t),{},{prevStrategy:this._prevLayoutStrategy,stopPropagation(){this.bubbles=!1}});this.onBeforeLayout(e);let r=this.getLayoutResult(e);r&&this.commitLayout(e,r),this.onAfterLayout(e,r),this._prevLayoutStrategy=e.strategy}attachHandlers(t,e){let{target:r}=e;return[tV,tE,tF,tj,tD,tP,tR,tL,"modifyPath"].map(e=>t.on(e,t=>this.performLayout(e===tV?{type:"object_modified",trigger:e,e:t,target:r}:{type:"object_modifying",trigger:e,e:t,target:r})))}subscribe(t,e){this.unsubscribe(t,e);let r=this.attachHandlers(t,e);this._subscriptions.set(t,r)}unsubscribe(t,e){(this._subscriptions.get(t)||[]).forEach(t=>t()),this._subscriptions.delete(t)}unsubscribeTargets(t){t.targets.forEach(e=>this.unsubscribe(e,t))}subscribeTargets(t){t.targets.forEach(e=>this.subscribe(e,t))}onBeforeLayout(t){let{target:e,type:r}=t,{canvas:i}=e;if(r===ng||r===np?this.subscribeTargets(t):r===nm&&this.unsubscribeTargets(t),e.fire("layout:before",{context:t}),i&&i.fire("object:layout:before",{target:e,context:t}),r===nv&&t.deep){let r=tr(t,n_);e.forEachObject(t=>t.layoutManager&&t.layoutManager.performLayout(te(te({},r),{},{bubbles:!1,target:t})))}}getLayoutResult(t){let{target:e,strategy:r,type:i}=t,n=r.calcLayoutResult(t,e.getObjects());if(!n)return;let s=i===ng?new tZ:e.getRelativeCenterPoint(),{center:a,correction:o=new tZ,relativeCorrection:l=new tZ}=n,h=s.subtract(a).add(o).transform(i===ng?tw:ea(e.calcOwnMatrix()),!0).add(l);return{result:n,prevCenter:s,nextCenter:a,offset:h}}commitLayout(t,e){var r,i;let{target:n}=t,{result:{size:s},nextCenter:a}=e;(n.set({width:s.x,height:s.y}),this.layoutObjects(t,e),t.type===ng)?n.set({left:null!=(r=t.x)?r:a.x+s.x*e2(n.originX),top:null!=(i=t.y)?i:a.y+s.y*e2(n.originY)}):(n.setPositionByOrigin(a,tC,tC),n.setCoords(),n.set("dirty",!0))}layoutObjects(t,e){let{target:r}=t;r.forEachObject(i=>{i.group===r&&this.layoutObject(t,e,i)}),t.strategy.shouldLayoutClipPath(t)&&this.layoutObject(t,e,r.clipPath)}layoutObject(t,e,r){let{offset:i}=e;r.set({left:r.left+i.x,top:r.top+i.y})}onAfterLayout(t,e){let{target:r,strategy:i,bubbles:n,prevStrategy:s}=t,a=tr(t,nw),{canvas:o}=r;r.fire("layout:after",{context:t,result:e}),o&&o.fire("object:layout:after",{context:t,result:e,target:r});let l=r.parent;n&&null!=l&&l.layoutManager&&((a.path||(a.path=[])).push(r),l.layoutManager.performLayout(te(te({},a),{},{target:l}))),r.set("dirty",!0)}dispose(){let{_subscriptions:t}=this;t.forEach(t=>t.forEach(t=>t())),t.clear()}toObject(){return{type:nC,strategy:this.strategy.constructor.type}}toJSON(){return this.toObject()}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new nb;$(this,"strategy",void 0),this.strategy=t,this._subscriptions=new Map}}tY.setClass(nS,nC);let nT=["type","objects","layoutManager"];class nO extends nS{performLayout(){}}class nk extends t1(iU){static getDefaults(){return te(te({},super.getDefaults()),nk.ownDefaults)}groupInit(t,e){var r;this._objects=[...t],this.__objectSelectionTracker=this.__objectSelectionMonitor.bind(this,!0),this.__objectSelectionDisposer=this.__objectSelectionMonitor.bind(this,!1),this.forEachObject(t=>{this.enterGroup(t,!1)}),this.layoutManager=null!=(r=e.layoutManager)?r:new nS,this.layoutManager.performLayout({type:ng,target:this,targets:[...t],x:e.left,y:e.top})}canEnterGroup(t){return t===this||this.isDescendantOf(t)?(ta("error","Group: circular object trees are not supported, this call has no effect"),!1):-1===this._objects.indexOf(t)||(ta("error","Group: duplicate objects are not supported inside group, this call has no effect"),!1)}_filterObjectsBeforeEnteringGroup(t){return t.filter((t,e,r)=>this.canEnterGroup(t)&&r.indexOf(t)===e)}add(){for(var t=arguments.length,e=Array(t),r=0;r1?e-1:0),i=1;i{r._set(t,e)}),this}_shouldSetNestedCoords(){return this.subTargetCheck}removeAll(){return this._activeObjects=[],this.remove(...this._objects)}__objectSelectionMonitor(t,e){let{target:r}=e,i=this._activeObjects;if(t)i.push(r),this._set("dirty",!0);else if(i.length>0){let t=i.indexOf(r);t>-1&&(i.splice(t,1),this._set("dirty",!0))}}_watchObject(t,e){t&&this._watchObject(!1,e),t?(e.on("selected",this.__objectSelectionTracker),e.on("deselected",this.__objectSelectionDisposer)):(e.off("selected",this.__objectSelectionTracker),e.off("deselected",this.__objectSelectionDisposer))}enterGroup(t,e){t.group&&t.group.remove(t),t._set("parent",this),this._enterGroup(t,e)}_enterGroup(t,e){e&&eY(t,eo(ea(this.calcTransformMatrix()),t.calcTransformMatrix())),this._shouldSetNestedCoords()&&t.setCoords(),t._set("group",this),t._set("canvas",this.canvas),this._watchObject(!0,t);let r=this.canvas&&this.canvas.getActiveObject&&this.canvas.getActiveObject();r&&(r===t||t.isDescendantOf(r))&&this._activeObjects.push(t)}exitGroup(t,e){this._exitGroup(t,e),t._set("parent",void 0),t._set("canvas",void 0)}_exitGroup(t,e){t._set("group",void 0),e||(eY(t,eo(this.calcTransformMatrix(),t.calcTransformMatrix())),t.setCoords()),this._watchObject(!1,t);let r=this._activeObjects.length>0?this._activeObjects.indexOf(t):-1;r>-1&&this._activeObjects.splice(r,1)}shouldCache(){let t=iU.prototype.shouldCache.call(this);if(t){for(let t=0;tt.setCoords())}triggerLayout(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.layoutManager.performLayout(te({target:this,type:nv},t))}render(t){this._transformDone=!0,super.render(t),this._transformDone=!1}__serializeObjects(t,e){let r=this.includeDefaultValues;return this._objects.filter(function(t){return!t.excludeFromExport}).map(function(i){let n=i.includeDefaultValues;i.includeDefaultValues=r;let s=i[t||"toObject"](e);return i.includeDefaultValues=n,s})}toObject(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=this.layoutManager.toObject();return te(te(te({},super.toObject(["subTargetCheck","interactive",...t])),"fit-content"!==e.strategy||this.includeDefaultValues?{layoutManager:e}:{}),{},{objects:this.__serializeObjects("toObject",t)})}toString(){return"#")}dispose(){this.layoutManager.unsubscribeTargets({targets:this.getObjects(),target:this}),this._activeObjects=[],this.forEachObject(t=>{this._watchObject(!1,t),t.dispose()}),super.dispose()}_createSVGBgRect(t){if(!this.backgroundColor)return"";let e=nf.prototype._toSVG.call(this),r=e.indexOf("COMMON_PARTS");e[r]='for="group" ';let i=e.join("");return t?t(i):i}_toSVG(t){let e=["\n"],r=this._createSVGBgRect(t);r&&e.push(" ",r);for(let r=0;r\n"),e}getSvgStyles(){let t=void 0!==this.opacity&&1!==this.opacity?"opacity: ".concat(this.opacity,";"):"",e=this.visible?"":" visibility: hidden;";return[t,this.getSvgFilter(),e].join("")}toClipPathSVG(t){let e=[],r=this._createSVGBgRect(t);r&&e.push(" ",r);for(let r=0;r{let[e,r]=t,i=new this(e,te(te(te({},s),r),{},{layoutManager:new nO}));return n?i.layoutManager=new(tY.getClass(n.type))(new(tY.getClass(n.strategy))):i.layoutManager=new nS,i.layoutManager.subscribeTargets({type:ng,target:i,targets:i.getObjects()}),i.setCoords(),i})}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),$(this,"_activeObjects",[]),$(this,"__objectSelectionTracker",void 0),$(this,"__objectSelectionDisposer",void 0),Object.assign(this,nk.ownDefaults),this.setOptions(e),this.groupInit(t,e)}}$(nk,"type","Group"),$(nk,"ownDefaults",{strokeWidth:0,subTargetCheck:!1,interactive:!1}),tY.setClass(nk);let nM=(t,e)=>Math.min(e.width/t.width,e.height/t.height),nE=(t,e)=>Math.max(e.width/t.width,e.height/t.height),nD="\\s*,?\\s*",nj="".concat(nD,"(").concat(rw,")"),nA="".concat(nj).concat(nj).concat(nj).concat(nD,"([01])").concat(nD,"([01])").concat(nj).concat(nj),nP={m:"l",M:"L"},nF=(t,e,r,i,n,s,a,o,l,h,c)=>{let u=tQ(t),d=tJ(t),f=tQ(e),g=tJ(e),p=r*n*f-i*s*g+a,m=i*n*f+r*s*g+o;return["C",h+l*(-r*n*d-i*s*u),c+l*(-i*n*d+r*s*u),p+l*(r*n*g+i*s*f),m+l*(i*n*g-r*s*f),p,m]},nL=(t,e,r,i)=>{let n=Math.atan2(e,t),s=Math.atan2(i,r);return s>=n?s-n:2*Math.PI-(n-s)};function nR(t,e,r,i,n,s,a,o){let l;if(ts.cachesBoundsOfCurve&&(l=[...arguments].join(),tm.boundsOfCurveCache[l]))return tm.boundsOfCurveCache[l];let h=Math.sqrt,c=Math.abs,u=[],d=[[0,0],[0,0]],f=6*t-12*r+6*n,g=-3*t+9*r-9*n+3*a,p=3*r-3*t;for(let t=0;t<2;++t){if(t>0&&(f=6*e-12*i+6*s,g=-3*e+9*i-9*s+3*o,p=3*i-3*e),1e-12>c(g)){if(1e-12>c(f))continue;let t=-p/f;0{let[i,n,s,a,o,l,h,c]=r,u=((t,e,r,i,n,s,a)=>{if(0===r||0===i)return[];let o=0,l=0,h=0,c=Math.PI,u=a*t_,d=tJ(u),f=tQ(u),g=.5*(-f*t-d*e),p=.5*(-f*e+d*t),m=r**2,y=i**2,x=p**2,b=g**2,_=m*y-m*x-y*b,w=Math.abs(r),C=Math.abs(i);if(_<0){let t=Math.sqrt(1-_/(m*y));w*=t,C*=t}else h=(n===s?-1:1)*Math.sqrt(_/(m*x+y*b));let S=h*w*p/C,T=-h*C*g/w,O=f*S-d*T+.5*t,k=d*S+f*T+.5*e,M=nL(1,0,(g-S)/w,(p-T)/C),E=nL((g-S)/w,(p-T)/C,(-g-S)/w,(-p-T)/C);0===s&&E>0?E-=2*c:1===s&&E<0&&(E+=2*c);let D=Math.ceil(Math.abs(E/c*2)),j=[],A=E/D,P=8/3*Math.sin(A/4)*Math.sin(A/4)/Math.sin(A/2),F=M+A;for(let t=0;t{let e=0,r=0,i=0,n=0,s=[],a,o=0,l=0;for(let h of t){let t,c=[...h];switch(c[0]){case"l":c[1]+=e,c[2]+=r;case"L":t=["L",e=c[1],r=c[2]];break;case"h":c[1]+=e;case"H":t=["L",e=c[1],r];break;case"v":c[1]+=r;case"V":t=["L",e,r=c[1]];break;case"m":c[1]+=e,c[2]+=r;case"M":e=c[1],r=c[2],i=c[1],n=c[2],t=["M",e,r];break;case"c":c[1]+=e,c[2]+=r,c[3]+=e,c[4]+=r,c[5]+=e,c[6]+=r;case"C":o=c[3],l=c[4],e=c[5],r=c[6],t=["C",c[1],c[2],o,l,e,r];break;case"s":c[1]+=e,c[2]+=r,c[3]+=e,c[4]+=r;case"S":"C"===a?(o=2*e-o,l=2*r-l):(o=e,l=r),e=c[3],r=c[4],o=(t=["C",o,l,c[1],c[2],e,r])[3],l=t[4];break;case"q":c[1]+=e,c[2]+=r,c[3]+=e,c[4]+=r;case"Q":o=c[1],l=c[2],t=["Q",o,l,e=c[3],r=c[4]];break;case"t":c[1]+=e,c[2]+=r;case"T":"Q"===a?(o=2*e-o,l=2*r-l):(o=e,l=r),t=["Q",o,l,e=c[1],r=c[2]];break;case"a":c[6]+=e,c[7]+=r;case"A":nI(e,r,c).forEach(t=>s.push(t)),e=c[6],r=c[7];break;case"z":case"Z":e=i,r=n,t=["Z"]}t?(s.push(t),a=t[0]):a=""}return s},nN=(t,e,r,i)=>Math.sqrt((r-t)**2+(i-e)**2),nW=(t,e,r,i,n,s,a,o)=>l=>{let h=l**3,c=(t=>3*t**2*(1-t))(l),u=(t=>3*t*(1-t)**2)(l),d=(1-l)**3;return new tZ(a*h+n*c+r*u+t*d,o*h+s*c+i*u+e*d)},nU=t=>2*t*(1-t),nH=(t,e,r,i,n,s,a,o)=>l=>{let h=l**2,c=nU(l),u=(1-l)**2;return Math.atan2(3*(u*(i-e)+c*(s-i)+h*(o-s)),3*(u*(r-t)+c*(n-r)+h*(a-n)))},nX=(t,e,r,i,n,s)=>a=>{let o=a**2,l=nU(a),h=(1-a)**2;return new tZ(n*o+r*l+t*h,s*o+i*l+e*h)},nV=(t,e,r,i,n,s)=>a=>{let o=1-a;return Math.atan2(2*(o*(i-e)+a*(s-i)),2*(o*(r-t)+a*(n-r)))},nz=(t,e,r)=>{let i=new tZ(e,r),n=0;for(let e=1;e<=100;e+=1){let r=t(e/100);n+=nN(i.x,i.y,r.x,r.y),i=r}return n},nY=t=>{let e,r,i=0,n=0,s=0,a=0,o=0,l=[];for(let h of t){let t={x:n,y:s,command:h[0],length:0};switch(h[0]){case"M":(r=t).x=a=n=h[1],r.y=o=s=h[2];break;case"L":(r=t).length=nN(n,s,h[1],h[2]),n=h[1],s=h[2];break;case"C":e=nW(n,s,h[1],h[2],h[3],h[4],h[5],h[6]),(r=t).iterator=e,r.angleFinder=nH(n,s,h[1],h[2],h[3],h[4],h[5],h[6]),r.length=nz(e,n,s),n=h[5],s=h[6];break;case"Q":e=nX(n,s,h[1],h[2],h[3],h[4]),(r=t).iterator=e,r.angleFinder=nV(n,s,h[1],h[2],h[3],h[4]),r.length=nz(e,n,s),n=h[3],s=h[4];break;case"Z":(r=t).destX=a,r.destY=o,r.length=nN(n,s,a,o),n=a,s=o}i+=r.length,l.push(r)}return l.push({length:i,x:n,y:s}),l},nG=function(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:nY(t),i=0;for(;e-r[i].length>0&&i{let r,i=0,n=0,s={x:t.x,y:t.y},a=te({},s),o=.01,l=0,h=t.iterator,c=t.angleFinder;for(;n1e-4;)a=h(i),l=i,(r=nN(s.x,s.y,a.x,a.y))+n>e?(i-=o,o/=2):(s=a,i+=o,n+=r);return te(te({},a),{},{angle:c(l)})})(n,e)}},nq=RegExp("[mzlhvcsqta][^mzlhvcsqta]*","gi"),nK=RegExp(nA,"g"),nQ=RegExp(rw,"gi"),nJ={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7},nZ=t=>{var e;let r=[];for(let i of null!=(e=t.match(nq))?e:[]){let t=i[0];if("z"===t||"Z"===t){r.push([t]);continue}let e=nJ[t.toLowerCase()],n=[];if("a"===t||"A"===t){nK.lastIndex=0;for(let t=null;t=nK.exec(i);)n.push(...t.slice(1))}else n=i.match(nQ)||[];for(let i=0;i0&&a?a:t;for(let t=0;t1&&void 0!==arguments[1]?arguments[1]:0,i=new tZ(t[0]),n=new tZ(t[1]),s=1,a=0,o=[],l=t.length,h=l>2;for(h&&(s=t[2].xt[e-2].x?1:i.x===t[e-2].x?0:-1,a=i.y>t[e-2].y?1:i.y===t[e-2].y?0:-1),o.push(["L",i.x+s*r,i.y+a*r]),o},n0=(t,e)=>t.map(t=>t.map((t,r)=>0===r||void 0===e?t:eS(t,e)).join(" ")).join(" ");function n1(t,e){let r=t.style;r&&e&&("string"==typeof e?r.cssText+=";"+e:Object.entries(e).forEach(t=>{let[e,i]=t;return r.setProperty(e,i)}))}Object.freeze({__proto__:null,addTransformToObject:ez,animate:r7,animateColor:it,applyTransformToObject:eY,calcAngleBetweenVectors:rF,calcDimensionsMatrix:ev,calcPlaneChangeMatrix:eQ,calcVectorRotation:rL,cancelAnimFrame:t4,capValue:rV,composeMatrix:ey,copyCanvasElement:t=>{var e;let r=t7(t);return null==(e=r.getContext("2d"))||e.drawImage(t,0,0),r},cos:tQ,createCanvasElement:t6,createImage:t8,createRotateMatrix:ed,createScaleMatrix:ef,createSkewXMatrix:ep,createSkewYMatrix:em,createTranslateMatrix:eu,createVector:rA,crossProduct:rB,degreesToRadians:er,dotProduct:rN,ease:rZ,enlivenObjectEnlivables:e_,enlivenObjects:eb,findScaleToCover:nE,findScaleToFit:nM,getBoundsOfCurve:nR,getOrthonormalVector:rI,getPathSegmentsInfo:nY,getPointOnPath:nG,getPointer:eW,getRandomInt:(t,e)=>Math.floor(Math.random()*(e-t+1))+t,getRegularPolygonPath:(t,e)=>{let r=2*Math.PI/t,i=-tx;t%2==0&&(i+=r/2);let n=Array(t+1);for(let s=0;s{let e=["instantiated_by_use","style","id","class"];switch(t){case"linearGradient":return e.concat(["x1","y1","x2","y2","gradientUnits","gradientTransform"]);case"radialGradient":return e.concat(["gradientUnits","gradientTransform","cx","cy","r","fx","fy","fr"]);case"stop":return e.concat(["offset","stop-color","stop-opacity"])}return e},getUnitVector:rR,groupSVGElements:(t,e)=>t&&1===t.length?t[0]:new nk(t,e),hasStyleChanged:i0,invertTransform:ea,isBetweenVectors:rW,isIdentityMatrix:en,isTouchEvent:eU,isTransparent:iH,joinPath:n0,loadImage:ex,magnitude:rP,makeBoundingBoxFromPoints:eX,makePathSimpler:nB,matrixToSVG:eT,mergeClipPaths:(t,e)=>{var r;let i=t,n=e;i.inverted&&!n.inverted&&(i=e,n=t),e$(n,null==(r=n.group)?void 0:r.calcTransformMatrix(),i.calcTransformMatrix());let s=i.inverted&&n.inverted;return s&&(i.inverted=n.inverted=!1),new nk([i],{clipPath:n,inverted:s})},multiplyTransformMatrices:eo,multiplyTransformMatrixArray:el,parsePath:nZ,parsePreserveAspectRatioAttribute:rl,parseUnit:ro,pick:ew,projectStrokeOnPoints:iG,qrDecompose:ec,radiansToDegrees:ei,removeFromArray:tK,removeTransformFromObject:(t,e)=>{let r=eo(ea(e),t.calcOwnMatrix());eY(t,r)},removeTransformMatrixForSvgParsing:(t,e)=>{let r=t._findCenterFromElement();t.transformMatrix&&((t=>{if(t.transformMatrix){let{scaleX:e,scaleY:r,angle:i,skewX:n}=ec(t.transformMatrix);t.flipX=!1,t.flipY=!1,t.set(tB,e),t.set(tN,r),t.angle=i,t.skewX=n,t.skewY=0}})(t),r=r.transform(t.transformMatrix)),delete t.transformMatrix,e&&(t.scaleX*=e.scaleX,t.scaleY*=e.scaleY,t.cropX=e.cropX,t.cropY=e.cropY,r.x+=e.offsetLeft,r.y+=e.offsetTop,t.width=e.width,t.height=e.height),t.setPositionByOrigin(r,tC,tC)},request:function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.onComplete||ty,i=new(tg()).XMLHttpRequest,n=e.signal,s=function(){i.abort()},a=function(){n&&n.removeEventListener("abort",s),i.onerror=i.ontimeout=ty};if(n&&n.aborted)throw new tl("request");return n&&n.addEventListener("abort",s,{once:!0}),i.onreadystatechange=function(){4===i.readyState&&(a(),r(i),i.onreadystatechange=ty)},i.onerror=i.ontimeout=a,i.open("get",t,!0),i.send(),i},requestAnimFrame:t5,resetObjectTransform:eG,rotatePoint:(t,e,r)=>t.rotate(r,e),rotateVector:rj,saveObjectTransform:eq,sendObjectToPlane:e$,sendPointToPlane:eJ,sendVectorToPlane:eZ,setStyle:n1,sin:tJ,sizeAfterTransform:eK,string:i$,stylesFromArray:i2,stylesToArray:i1,toBlob:ee,toDataURL:et,toFixed:eS,transformPath:(t,e,r)=>(r&&(e=eo(e,[1,0,0,1,-r.x,-r.y])),t.map(t=>{let r=[...t];for(let i=1;i1&&void 0!==arguments[1]?arguments[1]:{};super(t),$(this,"upper",void 0),$(this,"container",void 0);let{el:i}=this.lower,n=this.createUpperCanvas();this.upper={el:n,ctx:n.getContext("2d")},this.applyCanvasStyle(i,{allowTouchScrolling:e}),this.applyCanvasStyle(n,{allowTouchScrolling:e,styles:{position:"absolute",left:"0",top:"0"}});let s=this.createContainerElement();s.classList.add(r),i.parentNode&&i.parentNode.replaceChild(s,i),s.append(i,n),this.container=s}}class n5 extends eB{static getDefaults(){return te(te({},super.getDefaults()),n5.ownDefaults)}get upperCanvasEl(){var t;return null==(t=this.elements.upper)?void 0:t.el}get contextTop(){var t;return null==(t=this.elements.upper)?void 0:t.ctx}get wrapperEl(){return this.elements.container}initElements(t){this.elements=new n2(t,{allowTouchScrolling:this.allowTouchScrolling,containerClass:this.containerClass}),this._createCacheCanvas()}_onObjectAdded(t){this._objectsToRender=void 0,super._onObjectAdded(t)}_onObjectRemoved(t){this._objectsToRender=void 0,t===this._activeObject&&(this.fire("before:selection:cleared",{deselected:[t]}),this._discardActiveObject(),this.fire("selection:cleared",{deselected:[t]}),t.fire("deselected",{target:t})),t===this._hoveredTarget&&(this._hoveredTarget=void 0,this._hoveredTargets=[]),super._onObjectRemoved(t)}_onStackOrderChanged(){this._objectsToRender=void 0,super._onStackOrderChanged()}_chooseObjectsToRender(){let t=this._activeObject;return!this.preserveObjectStacking&&t?this._objects.filter(e=>!e.group&&e!==t).concat(t):this._objects}renderAll(){this.cancelRequestedRender(),this.destroyed||(!this.contextTopDirty||this._groupSelector||this.isDrawingMode||(this.clearContext(this.contextTop),this.contextTopDirty=!1),this.hasLostContext&&(this.renderTopLayer(this.contextTop),this.hasLostContext=!1),this._objectsToRender||(this._objectsToRender=this._chooseObjectsToRender()),this.renderCanvas(this.getContext(),this._objectsToRender))}renderTopLayer(t){t.save(),this.isDrawingMode&&this._isCurrentlyDrawing&&(this.freeDrawingBrush&&this.freeDrawingBrush._render(),this.contextTopDirty=!0),this.selection&&this._groupSelector&&(this._drawSelection(t),this.contextTopDirty=!0),t.restore()}renderTop(){let t=this.contextTop;this.clearContext(t),this.renderTopLayer(t),this.fire("after:render",{ctx:t})}setTargetFindTolerance(t){t=Math.round(t),this.targetFindTolerance=t;let e=this.getRetinaScaling(),r=Math.ceil((2*t+1)*e);this.pixelFindCanvasEl.width=this.pixelFindCanvasEl.height=r,this.pixelFindContext.scale(e,e)}isTargetTransparent(t,e,r){let i=this.targetFindTolerance,n=this.pixelFindContext;this.clearContext(n),n.save(),n.translate(-e+i,-r+i),n.transform(...this.viewportTransform);let s=t.selectionBackgroundColor;t.selectionBackgroundColor="",t.render(n),t.selectionBackgroundColor=s,n.restore();let a=Math.round(i*this.getRetinaScaling());return iH(n,a,a,a)}_isSelectionKeyPressed(t){let e=this.selectionKey;return!!e&&(Array.isArray(e)?!!e.find(e=>!!e&&!0===t[e]):t[e])}_shouldClearSelection(t,e){let r=this.getActiveObjects(),i=this._activeObject;return!!(!e||e&&i&&r.length>1&&-1===r.indexOf(e)&&i!==e&&!this._isSelectionKeyPressed(t)||e&&!e.evented||e&&!e.selectable&&i&&i!==e)}_shouldCenterTransform(t,e,r){let i;if(t)return e===tI||e===tB||e===tN||e===tF?i=this.centeredScaling||t.centeredScaling:e===tA&&(i=this.centeredRotation||t.centeredRotation),i?!r:r}_getOriginFromCorner(t,e){let r={x:t.originX,y:t.originY};return e&&(["ml","tl","bl"].includes(e)?r.x=tO:["mr","tr","br"].includes(e)&&(r.x=tS),["tl","mt","tr"].includes(e)?r.y=tT:["bl","mb","br"].includes(e)&&(r.y="top")),r}_setupCurrentTransform(t,e,r){var i;let n=e.group?eJ(this.getScenePoint(t),void 0,e.group.calcTransformMatrix()):this.getScenePoint(t),{key:s="",control:a}=e.getActiveControl()||{},o=r&&a?null==(i=a.getActionHandler(t,e,a))?void 0:i.bind(a):e7,l=((t,e,r,i)=>{if(!e||!t)return"drag";let n=i.controls[e];return n.getActionName(r,n,i)})(r,s,t,e),h=t[this.centeredKey],c=this._shouldCenterTransform(e,l,h)?{x:tC,y:tC}:this._getOriginFromCorner(e,s),u={target:e,action:l,actionHandler:o,actionPerformed:!1,corner:s,scaleX:e.scaleX,scaleY:e.scaleY,skewX:e.skewX,skewY:e.skewY,offsetX:n.x-e.left,offsetY:n.y-e.top,originX:c.x,originY:c.y,ex:n.x,ey:n.y,lastX:n.x,lastY:n.y,theta:er(e.angle),width:e.width,height:e.height,shiftKey:t.shiftKey,altKey:h,original:te(te({},eq(e)),{},{originX:c.x,originY:c.y})};this._currentTransform=u,this.fire("before:transform",{e:t,transform:u})}setCursor(t){this.upperCanvasEl.style.cursor=t}_drawSelection(t){let{x:e,y:r,deltaX:i,deltaY:n}=this._groupSelector,s=new tZ(e,r).transform(this.viewportTransform),a=new tZ(e+i,r+n).transform(this.viewportTransform),o=this.selectionLineWidth/2,l=Math.min(s.x,a.x),h=Math.min(s.y,a.y),c=Math.max(s.x,a.x),u=Math.max(s.y,a.y);this.selectionColor&&(t.fillStyle=this.selectionColor,t.fillRect(l,h,c-l,u-h)),this.selectionLineWidth&&this.selectionBorderColor&&(t.lineWidth=this.selectionLineWidth,t.strokeStyle=this.selectionBorderColor,l+=o,h+=o,c-=o,u-=o,iU.prototype._setLineDash.call(this,t,this.selectionDashArray),t.strokeRect(l,h,c-l,u-h))}findTarget(t){if(this.skipTargetFind)return;let e=this.getViewportPoint(t),r=this._activeObject,i=this.getActiveObjects();if(this.targets=[],r&&i.length>=1){if(r.findControl(e,eU(t))||i.length>1&&this.searchPossibleTargets([r],e))return r;if(r===this.searchPossibleTargets([r],e)){if(this.preserveObjectStacking){let i=this.targets;this.targets=[];let n=this.searchPossibleTargets(this._objects,e);return t[this.altSelectionKey]&&n&&n!==r?(this.targets=i,r):n}return r}}return this.searchPossibleTargets(this._objects,e)}_pointIsInObjectSelectionArea(t,e){let r=t.getCoords(),i=this.getZoom(),n=t.padding/i;if(n){let[t,e,i,s]=r,a=Math.atan2(e.y-t.y,e.x-t.x),o=tQ(a)*n,l=tJ(a)*n,h=o+l,c=o-l;r=[new tZ(t.x-c,t.y-h),new tZ(e.x+h,e.y-c),new tZ(i.x+c,i.y+h),new tZ(s.x-h,s.y+c)]}return ie.isPointInPolygon(e,r)}_checkTarget(t,e){return!(!(t&&t.visible&&t.evented&&this._pointIsInObjectSelectionArea(t,eJ(e,void 0,this.viewportTransform)))||(this.perPixelTargetFind||t.perPixelTargetFind)&&!t.isEditing&&this.isTargetTransparent(t,e.x,e.y))||!1}_searchPossibleTargets(t,e){let r=t.length;for(;r--;){let i=t[r];if(this._checkTarget(i,e)){if(t0(i)&&i.subTargetCheck){let t=this._searchPossibleTargets(i._objects,e);t&&this.targets.push(t)}return i}}}searchPossibleTargets(t,e){let r=this._searchPossibleTargets(t,e);if(r&&t0(r)&&r.interactive&&this.targets[0]){let t=this.targets;for(let e=t.length-1;e>0;e--){let r=t[e];if(!t0(r)||!r.interactive)return r}return t[0]}return r}getViewportPoint(t){return this._pointer?this._pointer:this.getPointer(t,!0)}getScenePoint(t){return this._absolutePointer?this._absolutePointer:this.getPointer(t)}getPointer(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.upperCanvasEl,i=r.getBoundingClientRect(),n=eW(t),s=i.width||0,a=i.height||0;s&&a||("top"in i&&tT in i&&(a=Math.abs(i.top-i.bottom)),tO in i&&tS in i&&(s=Math.abs(i.right-i.left))),this.calcOffset(),n.x=n.x-this._offset.left,n.y=n.y-this._offset.top,e||(n=eJ(n,void 0,this.viewportTransform));let o=this.getRetinaScaling();1!==o&&(n.x/=o,n.y/=o);let l=0===s||0===a?new tZ(1,1):new tZ(r.width/s,r.height/a);return n.multiply(l)}_setDimensionsImpl(t,e){this._resetTransformEventData(),super._setDimensionsImpl(t,e),this._isCurrentlyDrawing&&this.freeDrawingBrush&&this.freeDrawingBrush._setBrushStyles(this.contextTop)}_createCacheCanvas(){this.pixelFindCanvasEl=t6(),this.pixelFindContext=this.pixelFindCanvasEl.getContext("2d",{willReadFrequently:!0}),this.setTargetFindTolerance(this.targetFindTolerance)}getTopContext(){return this.elements.upper.ctx}getSelectionContext(){return this.elements.upper.ctx}getSelectionElement(){return this.elements.upper.el}getActiveObject(){return this._activeObject}getActiveObjects(){let t=this._activeObject;return eE(t)?t.getObjects():t?[t]:[]}_fireSelectionEvents(t,e){let r=!1,i=!1,n=this.getActiveObjects(),s=[],a=[];t.forEach(t=>{n.includes(t)||(r=!0,t.fire("deselected",{e:e,target:t}),a.push(t))}),n.forEach(i=>{t.includes(i)||(r=!0,i.fire("selected",{e:e,target:i}),s.push(i))}),t.length>0&&n.length>0?(i=!0,r&&this.fire("selection:updated",{e:e,selected:s,deselected:a})):n.length>0?(i=!0,this.fire("selection:created",{e:e,selected:s})):t.length>0&&(i=!0,this.fire("selection:cleared",{e:e,deselected:a})),i&&(this._objectsToRender=void 0)}setActiveObject(t,e){let r=this.getActiveObjects(),i=this._setActiveObject(t,e);return this._fireSelectionEvents(r,e),i}_setActiveObject(t,e){let r=this._activeObject;return r!==t&&!(!this._discardActiveObject(e,t)&&this._activeObject)&&!t.onSelect({e:e})&&(this._activeObject=t,eE(t)&&r!==t&&t.set("canvas",this),t.setCoords(),!0)}_discardActiveObject(t,e){let r=this._activeObject;return!!r&&!r.onDeselect({e:t,object:e})&&(this._currentTransform&&this._currentTransform.target===r&&this.endCurrentTransform(t),eE(r)&&r===this._hoveredTarget&&(this._hoveredTarget=void 0),this._activeObject=void 0,!0)}discardActiveObject(t){let e=this.getActiveObjects(),r=this.getActiveObject();e.length&&this.fire("before:selection:cleared",{e:t,deselected:[r]});let i=this._discardActiveObject(t);return this._fireSelectionEvents(e,t),i}endCurrentTransform(t){let e=this._currentTransform;this._finalizeCurrentTransform(t),e&&e.target&&(e.target.isMoving=!1),this._currentTransform=null}_finalizeCurrentTransform(t){let e=this._currentTransform,r=e.target,i={e:t,target:r,transform:e,action:e.action};r._scaling&&(r._scaling=!1),r.setCoords(),e.actionPerformed&&(this.fire("object:modified",i),r.fire(tV,i))}setViewportTransform(t){super.setViewportTransform(t);let e=this._activeObject;e&&e.setCoords()}destroy(){let t=this._activeObject;eE(t)&&(t.removeAll(),t.dispose()),delete this._activeObject,super.destroy(),this.pixelFindContext=null,this.pixelFindCanvasEl=void 0}clear(){this.discardActiveObject(),this._activeObject=void 0,this.clearContext(this.contextTop),super.clear()}drawControls(t){let e=this._activeObject;e&&e._renderControls(t)}_toObject(t,e,r){let i=this._realizeGroupTransformOnObject(t),n=super._toObject(t,e,r);return t.set(i),n}_realizeGroupTransformOnObject(t){let{group:e}=t;if(e&&eE(e)&&this._activeObject===e){let r=ew(t,["angle","flipX","flipY",tS,tB,tN,tW,tU,"top"]);return ez(t,e.calcOwnMatrix()),r}return{}}_setSVGObject(t,e,r){let i=this._realizeGroupTransformOnObject(e);super._setSVGObject(t,e,r),e.set(i)}constructor(){super(...arguments),$(this,"targets",[]),$(this,"_hoveredTargets",[]),$(this,"_objectsToRender",void 0),$(this,"_currentTransform",null),$(this,"_groupSelector",null),$(this,"contextTopDirty",!1)}}$(n5,"ownDefaults",{uniformScaling:!0,uniScaleKey:"shiftKey",centeredScaling:!1,centeredRotation:!1,centeredKey:"altKey",altActionKey:"shiftKey",selection:!0,selectionKey:"shiftKey",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",perPixelTargetFind:!1,targetFindTolerance:0,skipTargetFind:!1,stopContextMenu:!1,fireRightClick:!1,fireMiddleClick:!1,enablePointerEvents:!1,containerClass:"canvas-container",preserveObjectStacking:!1});class n4{exitTextEditing(){this.target=void 0,this.targets.forEach(t=>{t.isEditing&&t.exitEditing()})}add(t){this.targets.push(t)}remove(t){this.unregister(t),tK(this.targets,t)}register(t){this.target=t}unregister(t){t===this.target&&(this.target=void 0)}onMouseMove(t){var e;(null==(e=this.target)?void 0:e.isEditing)&&this.target.updateSelectionOnMouseMove(t)}clear(){this.targets=[],this.target=void 0}dispose(){this.clear(),this.__disposer(),delete this.__disposer}constructor(t){$(this,"targets",[]),$(this,"__disposer",void 0);let e=()=>{let{hiddenTextarea:e}=t.getActiveObject()||{};e&&e.focus()},r=t.upperCanvasEl;r.addEventListener("click",e),this.__disposer=()=>r.removeEventListener("click",e)}}let n3=["target","oldTarget","fireCanvas","e"],n9={passive:!1},n6=(t,e)=>{let r=t.getViewportPoint(e),i=t.getScenePoint(e);return{viewportPoint:r,scenePoint:i,pointer:r,absolutePointer:i}},n8=function(t){for(var e=arguments.length,r=Array(e>1?e-1:0),i=1;i1?e-1:0),i=1;i{this.fire("mouse:out",te(te({},r),{},{target:t})),t&&t.fire("mouseout",te({},r))}),this._hoveredTargets=[]}_onMouseEnter(t){this._currentTransform||this.findTarget(t)||(this.fire("mouse:over",te({e:t},n6(this,t))),this._hoveredTarget=void 0,this._hoveredTargets=[])}_onDragStart(t){this._isClick=!1;let e=this.getActiveObject();if(e&&e.onDragStart(t)){this._dragSource=e;let r={e:t,target:e};return this.fire("dragstart",r),e.fire("dragstart",r),void n8(this.upperCanvasEl,"drag",this._onDragProgress)}eH(t)}_renderDragEffects(t,e,r){let i=!1,n=this._dropTarget;n&&n!==e&&n!==r&&(n.clearContextTop(),i=!0),null==e||e.clearContextTop(),r!==e&&(null==r||r.clearContextTop());let s=this.contextTop;s.save(),s.transform(...this.viewportTransform),e&&(s.save(),e.transform(s),e.renderDragSourceEffect(t),s.restore(),i=!0),r&&(s.save(),r.transform(s),r.renderDropTargetEffect(t),s.restore(),i=!0),s.restore(),i&&(this.contextTopDirty=!0)}_onDragEnd(t){let e=!!t.dataTransfer&&t.dataTransfer.dropEffect!==tk,r=e?this._activeObject:void 0,i={e:t,target:this._dragSource,subTargets:this.targets,dragSource:this._dragSource,didDrop:e,dropTarget:r};n7(this.upperCanvasEl,"drag",this._onDragProgress),this.fire("dragend",i),this._dragSource&&this._dragSource.fire("dragend",i),delete this._dragSource,this._onMouseUp(t)}_onDragProgress(t){let e={e:t,target:this._dragSource,dragSource:this._dragSource,dropTarget:this._draggedoverTarget};this.fire("drag",e),this._dragSource&&this._dragSource.fire("drag",e)}findDragTargets(t){return this.targets=[],{target:this._searchPossibleTargets(this._objects,this.getViewportPoint(t)),targets:[...this.targets]}}_onDragOver(t){let e,r="dragover",{target:i,targets:n}=this.findDragTargets(t),s=this._dragSource,a={e:t,target:i,subTargets:n,dragSource:s,canDrop:!1,dropTarget:void 0};this.fire(r,a),this._fireEnterLeaveEvents(i,a),i&&(i.canDrop(t)&&(e=i),i.fire(r,a));for(let i=0;i3||e<2||(this._cacheTransformEventData(t),2==e&&"dblclick"===t.type&&this._handleEvent(t,"dblclick"),3==e&&this._handleEvent(t,"tripleclick"),this._resetTransformEventData())}getPointerId(t){let e=t.changedTouches;return e?e[0]&&e[0].identifier:this.enablePointerEvents?t.pointerId:-1}_isMainEvent(t){return!0===t.isPrimary||!1!==t.isPrimary&&("touchend"===t.type&&0===t.touches.length||!t.changedTouches||t.changedTouches[0].identifier===this.mainTouchId)}_onTouchStart(t){let e=!this.allowTouchScrolling,r=this._activeObject;void 0===this.mainTouchId&&(this.mainTouchId=this.getPointerId(t)),this.__onMouseDown(t),(this.isDrawingMode||r&&this._target===r)&&(e=!0),e&&t.preventDefault(),this._resetTransformEventData();let i=this.upperCanvasEl,n=this._getEventPrefix(),s=ej(i);n8(s,"touchend",this._onTouchEnd,n9),e&&n8(s,"touchmove",this._onMouseMove,n9),n7(i,"".concat(n,"down"),this._onMouseDown)}_onMouseDown(t){this.__onMouseDown(t),this._resetTransformEventData();let e=this.upperCanvasEl,r=this._getEventPrefix();n7(e,"".concat(r,"move"),this._onMouseMove,n9);let i=ej(e);n8(i,"".concat(r,"up"),this._onMouseUp),n8(i,"".concat(r,"move"),this._onMouseMove,n9)}_onTouchEnd(t){if(t.touches.length>0)return;this.__onMouseUp(t),this._resetTransformEventData(),delete this.mainTouchId;let e=this._getEventPrefix(),r=ej(this.upperCanvasEl);n7(r,"touchend",this._onTouchEnd,n9),n7(r,"touchmove",this._onMouseMove,n9),this._willAddMouseDown&&clearTimeout(this._willAddMouseDown),this._willAddMouseDown=setTimeout(()=>{n8(this.upperCanvasEl,"".concat(e,"down"),this._onMouseDown),this._willAddMouseDown=0},400)}_onMouseUp(t){this.__onMouseUp(t),this._resetTransformEventData();let e=this.upperCanvasEl,r=this._getEventPrefix();if(this._isMainEvent(t)){let t=ej(this.upperCanvasEl);n7(t,"".concat(r,"up"),this._onMouseUp),n7(t,"".concat(r,"move"),this._onMouseMove,n9),n8(e,"".concat(r,"move"),this._onMouseMove,n9)}}_onMouseMove(t){let e=this.getActiveObject();this.allowTouchScrolling||e&&e.shouldStartDragging(t)||!t.preventDefault||t.preventDefault(),this.__onMouseMove(t)}_onResize(){this.calcOffset(),this._resetTransformEventData()}_shouldRender(t){let e=this.getActiveObject();return!!e!=!!t||e&&t&&e!==t}__onMouseUp(t){var e;this._cacheTransformEventData(t),this._handleEvent(t,"up:before");let r=this._currentTransform,i=this._isClick,n=this._target,{button:s}=t;if(s)return(this.fireMiddleClick&&1===s||this.fireRightClick&&2===s)&&this._handleEvent(t,"up"),void this._resetTransformEventData();if(this.isDrawingMode&&this._isCurrentlyDrawing)return void this._onMouseUpInDrawingMode(t);if(!this._isMainEvent(t))return;let a,o,l=!1;if(r&&(this._finalizeCurrentTransform(t),l=r.actionPerformed),!i){let e=n===this._activeObject;this.handleSelection(t),l||(l=this._shouldRender(n)||!e&&n===this._activeObject)}if(n){let{key:e,control:i}=n.findControl(this.getViewportPoint(t),eU(t))||{};if(o=e,n.selectable&&n!==this._activeObject&&"up"===n.activeOn)this.setActiveObject(n,t),l=!0;else if(i){let e=i.getMouseUpHandler(t,n,i);e&&(a=this.getScenePoint(t),e.call(i,t,r,a.x,a.y))}n.isMoving=!1}if(r&&(r.target!==n||r.corner!==o)){let e=r.target&&r.target.controls[r.corner],i=e&&e.getMouseUpHandler(t,r.target,e);a=a||this.getScenePoint(t),i&&i.call(e,t,r,a.x,a.y)}this._setCursorFromEvent(t,n),this._handleEvent(t,"up"),this._groupSelector=null,this._currentTransform=null,n&&(n.__corner=void 0),l?this.requestRenderAll():i||null!=(e=this._activeObject)&&e.isEditing||this.renderTop()}_basicEventHandler(t,e){let{target:r,subTargets:i=[]}=e;this.fire(t,e),r&&r.fire(t,e);for(let n=0;n{r=t.hoverCursor||r}),this.setCursor(r)}handleMultiSelection(t,e){let r=this._activeObject,i=eE(r);if(r&&this._isSelectionKeyPressed(t)&&this.selection&&e&&e.selectable&&(r!==e||i)&&(i||!e.isDescendantOf(r)&&!r.isDescendantOf(e))&&!e.onSelect({e:t})&&!r.getActiveControl()){if(i){let i=r.getObjects();if(e===r){let r=this.getViewportPoint(t);if(!(e=this.searchPossibleTargets(i,r)||this.searchPossibleTargets(this._objects,r))||!e.selectable)return!1}e.group===r?(r.remove(e),this._hoveredTarget=e,this._hoveredTargets=[...this.targets],1===r.size()&&this._setActiveObject(r.item(0),t)):(r.multiSelectAdd(e),this._hoveredTarget=r,this._hoveredTargets=[...this.targets]),this._fireSelectionEvents(i,t)}else{r.isEditing&&r.exitEditing();let i=new(tY.getClass("ActiveSelection"))([],{canvas:this});i.multiSelectAdd(r,e),this._hoveredTarget=i,this._setActiveObject(i,t),this._fireSelectionEvents([r],t)}return!0}return!1}handleSelection(t){if(!this.selection||!this._groupSelector)return!1;let{x:e,y:r,deltaX:i,deltaY:n}=this._groupSelector,s=new tZ(e,r),a=s.add(new tZ(i,n)),o=s.min(a),l=s.max(a).subtract(o),h=this.collectObjects({left:o.x,top:o.y,width:l.x,height:l.y},{includeIntersecting:!this.selectionFullyContained}),c=s.eq(a)?h[0]?[h[0]]:[]:h.length>1?h.filter(e=>!e.onSelect({e:t})).reverse():h;if(1===c.length)this.setActiveObject(c[0],t);else if(c.length>1){let e=tY.getClass("ActiveSelection");this.setActiveObject(new e(c,{canvas:this}),t)}return this._groupSelector=null,!0}clear(){this.textEditingManager.clear(),super.clear()}destroy(){this.removeListeners(),this.textEditingManager.dispose(),super.destroy()}constructor(t){super(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),$(this,"_isClick",void 0),$(this,"textEditingManager",new n4(this)),["_onMouseDown","_onTouchStart","_onMouseMove","_onMouseUp","_onTouchEnd","_onResize","_onMouseWheel","_onMouseOut","_onMouseEnter","_onContextMenu","_onClick","_onDragStart","_onDragEnd","_onDragProgress","_onDragOver","_onDragEnter","_onDragLeave","_onDrop"].forEach(t=>{this[t]=this[t].bind(this)}),this.addOrRemove(n8,"add")}}let sr={x1:0,y1:0,x2:0,y2:0},si=te(te({},sr),{},{r1:0,r2:0}),sn=(t,e)=>isNaN(t)&&"number"==typeof e?e:t,ss=/^(\d+\.\d+)%|(\d+)%$/;function sa(t){return t&&ss.test(t)}function so(t,e){return rV(0,sn("number"==typeof t?t:"string"==typeof t?parseFloat(t)/(sa(t)?100:1):NaN,e),1)}let sl=/\s*;\s*/,sh=/\s*:\s*/;function sc(t){return"linearGradient"===t.nodeName||"LINEARGRADIENT"===t.nodeName?"linear":"radial"}function su(t){return"userSpaceOnUse"===t.getAttribute("gradientUnits")?"pixels":"percentage"}function sd(t,e){return t.getAttribute(e)}class sf{addColorStop(t){for(let e in t){let r=new ra(t[e]);this.colorStops.push({offset:parseFloat(e),color:r.toRgb(),opacity:r.getAlpha()})}return this}toObject(t){return te(te({},ew(this,t)),{},{type:this.type,coords:te({},this.coords),colorStops:this.colorStops.map(t=>te({},t)),offsetX:this.offsetX,offsetY:this.offsetY,gradientUnits:this.gradientUnits,gradientTransform:this.gradientTransform?[...this.gradientTransform]:void 0})}toSVG(t){let{additionalTransform:e}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=[],i=this.gradientTransform?this.gradientTransform.concat():tw.concat(),n="pixels"===this.gradientUnits?"userSpaceOnUse":"objectBoundingBox",s=this.colorStops.map(t=>te({},t)).sort((t,e)=>t.offset-e.offset),a=-this.offsetX,o=-this.offsetY;"objectBoundingBox"===n?(a/=t.width,o/=t.height):(a+=t.width/2,o+=t.height/2),t&&"function"==typeof t._renderPathCommands&&"percentage"!==this.gradientUnits&&(a-=t.pathOffset.x,o-=t.pathOffset.y),i[4]-=a,i[5]-=o;let l=['id="SVGID_'.concat(this.id,'"'),'gradientUnits="'.concat(n,'"'),'gradientTransform="'.concat(e?e+" ":"").concat(eT(i),'"'),""].join(" ");if("linear"===this.type){let{x1:t,y1:e,x2:i,y2:n}=this.coords;r.push("\n')}else if("radial"===this.type){let{x1:t,y1:e,x2:i,y2:n,r1:a,r2:o}=this.coords,h=a>o;r.push("\n'),h&&(s.reverse(),s.forEach(t=>{t.offset=1-t.offset}));let c=Math.min(a,o);if(c>0){let t=c/Math.max(a,o);s.forEach(e=>{e.offset+=t*(1-e.offset)})}}return s.forEach(t=>{let{color:e,offset:i,opacity:n}=t;r.push("\n')}),r.push("linear"===this.type?"":"","\n"),r.join("")}toLive(t){let{x1:e,y1:r,x2:i,y2:n,r1:s,r2:a}=this.coords,o="linear"===this.type?t.createLinearGradient(e,r,i,n):t.createRadialGradient(e,r,s,i,n,a);return this.colorStops.forEach(t=>{let{color:e,opacity:r,offset:i}=t;o.addColorStop(i,void 0!==r?new ra(e).setAlpha(r).toRgba():e)}),o}static async fromObject(t){let{colorStops:e,gradientTransform:r}=t;return new this(te(te({},t),{},{colorStops:e?e.map(t=>te({},t)):void 0,gradientTransform:r?[...r]:void 0}))}static fromElement(t,e,r){var i;let n=su(t),s=e._findCenterFromElement();return new this(te({id:t.getAttribute("id")||void 0,type:sc(t),coords:(i={width:r.viewBoxWidth||r.width,height:r.viewBoxHeight||r.height},function(t,e){let r,{width:i,height:n,gradientUnits:s}=e;return Object.keys(t).reduce((e,a)=>{let o=t[a];return"Infinity"===o?r=1:"-Infinity"===o?r=0:(r="string"==typeof o?parseFloat(o):o,"string"==typeof o&&sa(o)&&(r*=.01,"pixels"===s&&("x1"!==a&&"x2"!==a&&"r2"!==a||(r*=i),"y1"!==a&&"y2"!==a||(r*=n)))),e[a]=r,e},{})}("linear"===sc(t)?{x1:sd(t,"x1")||0,y1:sd(t,"y1")||0,x2:sd(t,"x2")||"100%",y2:sd(t,"y2")||0}:{x1:sd(t,"fx")||sd(t,"cx")||"50%",y1:sd(t,"fy")||sd(t,"cy")||"50%",r1:0,x2:sd(t,"cx")||"50%",y2:sd(t,"cy")||"50%",r2:sd(t,"r")||"50%"},te(te({},i),{},{gradientUnits:su(t)}))),colorStops:function(t,e){let r=[],i=t.getElementsByTagName("stop"),n=so(e,1);for(let t=i.length;t--;)r.push(function(t,e){let r,i,n=t.getAttribute("style");if(n){let t=n.split(sl);""===t[t.length-1]&&t.pop();for(let e=t.length;e--;){let[n,s]=t[e].split(sh).map(t=>t.trim());"stop-color"===n?r=s:"stop-opacity"===n&&(i=s)}}let s=new ra(r||t.getAttribute("stop-color")||"rgb(0,0,0)");return{offset:so(t.getAttribute("offset"),0),color:s.toRgb(),opacity:sn(parseFloat(i||t.getAttribute("stop-opacity")||""),1)*s.getAlpha()*e}}(i[t],n));return r}(t,r.opacity),gradientUnits:n,gradientTransform:nl(t.getAttribute("gradientTransform")||"")},"pixels"===n?{offsetX:e.width/2-s.x,offsetY:e.height/2-s.y}:{offsetX:0,offsetY:0}))}constructor(t){let{type:e="linear",gradientUnits:r="pixels",coords:i={},colorStops:n=[],offsetX:s=0,offsetY:a=0,gradientTransform:o,id:l}=t||{};Object.assign(this,{type:e,gradientUnits:r,coords:te(te({},"radial"===e?si:sr),i),colorStops:n,offsetX:s,offsetY:a,gradientTransform:o,id:l?"".concat(l,"_").concat(t9()):t9()})}}$(sf,"type","Gradient"),tY.setClass(sf,"gradient"),tY.setClass(sf,"linear"),tY.setClass(sf,"radial");let sg=["type","source","patternTransform"];class sp{get type(){return"pattern"}set type(t){ta("warn","Setting type has no effect",t)}isImageSource(){return!!this.source&&"string"==typeof this.source.src}isCanvasSource(){return!!this.source&&!!this.source.toDataURL}sourceToString(){return this.isImageSource()?this.source.src:this.isCanvasSource()?this.source.toDataURL():""}toLive(t){return this.source&&(!this.isImageSource()||this.source.complete&&0!==this.source.naturalWidth&&0!==this.source.naturalHeight)?t.createPattern(this.source,this.repeat):null}toObject(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],{repeat:e,crossOrigin:r}=this;return te(te({},ew(this,t)),{},{type:"pattern",source:this.sourceToString(),repeat:e,crossOrigin:r,offsetX:eS(this.offsetX,ts.NUM_FRACTION_DIGITS),offsetY:eS(this.offsetY,ts.NUM_FRACTION_DIGITS),patternTransform:this.patternTransform?[...this.patternTransform]:null})}toSVG(t){let{width:e,height:r}=t,{source:i,repeat:n,id:s}=this,a=sn(this.offsetX/e,0),o=sn(this.offsetY/r,0),l="repeat-y"===n||"no-repeat"===n?1+Math.abs(a||0):sn(i.width/e,0),h="repeat-x"===n||"no-repeat"===n?1+Math.abs(o||0):sn(i.height/r,0);return[''),''),"\n"].join("\n")}static async fromObject(t,e){let{type:r,source:i,patternTransform:n}=t,s=tr(t,sg),a=await ex(i,te(te({},e),{},{crossOrigin:s.crossOrigin}));return new this(te(te({},s),{},{patternTransform:n&&n.slice(0),source:a}))}constructor(t){$(this,"repeat","repeat"),$(this,"offsetX",0),$(this,"offsetY",0),$(this,"crossOrigin",""),this.id=t9(),Object.assign(this,t)}}$(sp,"type","Pattern"),tY.setClass(sp),tY.setClass(sp,"pattern");class sm{_setBrushStyles(t){t.strokeStyle=this.color,t.lineWidth=this.width,t.lineCap=this.strokeLineCap,t.miterLimit=this.strokeMiterLimit,t.lineJoin=this.strokeLineJoin,t.setLineDash(this.strokeDashArray||[])}_saveAndTransform(t){let e=this.canvas.viewportTransform;t.save(),t.transform(e[0],e[1],e[2],e[3],e[4],e[5])}needsFullRender(){return 1>new ra(this.color).getAlpha()||!!this.shadow}_setShadow(){if(!this.shadow||!this.canvas)return;let t=this.canvas,e=this.shadow,r=t.contextTop,i=t.getZoom()*t.getRetinaScaling();r.shadowColor=e.color,r.shadowBlur=e.blur*i,r.shadowOffsetX=e.offsetX*i,r.shadowOffsetY=e.offsetY*i}_resetShadow(){let t=this.canvas.contextTop;t.shadowColor="",t.shadowBlur=t.shadowOffsetX=t.shadowOffsetY=0}_isOutSideCanvas(t){return t.x<0||t.x>this.canvas.getWidth()||t.y<0||t.y>this.canvas.getHeight()}constructor(t){$(this,"color","rgb(0, 0, 0)"),$(this,"width",1),$(this,"shadow",null),$(this,"strokeLineCap","round"),$(this,"strokeLineJoin","round"),$(this,"strokeMiterLimit",10),$(this,"strokeDashArray",null),$(this,"limitedToCanvasSize",!1),this.canvas=t}}let sv=["path","left","top"],sy=["d"];class sx extends iU{_setPath(t,e){this.path=nB(Array.isArray(t)?t:nZ(t)),this.setBoundingBox(e)}_findCenterFromElement(){let t=this._calcBoundsFromPath();return new tZ(t.left+t.width/2,t.top+t.height/2)}_renderPathCommands(t){let e=-this.pathOffset.x,r=-this.pathOffset.y;for(let i of(t.beginPath(),this.path))switch(i[0]){case"L":t.lineTo(i[1]+e,i[2]+r);break;case"M":t.moveTo(i[1]+e,i[2]+r);break;case"C":t.bezierCurveTo(i[1]+e,i[2]+r,i[3]+e,i[4]+r,i[5]+e,i[6]+r);break;case"Q":t.quadraticCurveTo(i[1]+e,i[2]+r,i[3]+e,i[4]+r);break;case"Z":t.closePath()}}_render(t){this._renderPathCommands(t),this._renderPaintInOrder(t)}toString(){return"#")}toObject(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return te(te({},super.toObject(t)),{},{path:this.path.map(t=>t.slice())})}toDatalessObject(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=this.toObject(t);return this.sourcePath&&(delete e.path,e.sourcePath=this.sourcePath),e}_toSVG(){let t=n0(this.path,ts.NUM_FRACTION_DIGITS);return["\n')]}_getOffsetTransform(){let t=ts.NUM_FRACTION_DIGITS;return" translate(".concat(eS(-this.pathOffset.x,t),", ").concat(eS(-this.pathOffset.y,t),")")}toClipPathSVG(t){let e=this._getOffsetTransform();return" "+this._createBaseClipPathSVGMarkup(this._toSVG(),{reviver:t,additionalTransform:e})}toSVG(t){let e=this._getOffsetTransform();return this._createBaseSVGMarkup(this._toSVG(),{reviver:t,additionalTransform:e})}complexity(){return this.path.length}setDimensions(){this.setBoundingBox()}setBoundingBox(t){let{width:e,height:r,pathOffset:i}=this._calcDimensions();this.set({width:e,height:r,pathOffset:i}),t&&this.setPositionByOrigin(i,tC,tC)}_calcBoundsFromPath(){let t=[],e=0,r=0,i=0,n=0;for(let s of this.path)switch(s[0]){case"L":i=s[1],n=s[2],t.push({x:e,y:r},{x:i,y:n});break;case"M":i=s[1],n=s[2],e=i,r=n;break;case"C":t.push(...nR(i,n,s[1],s[2],s[3],s[4],s[5],s[6])),i=s[5],n=s[6];break;case"Q":t.push(...nR(i,n,s[1],s[2],s[1],s[2],s[3],s[4])),i=s[3],n=s[4];break;case"Z":i=e,n=r}return eX(t)}_calcDimensions(){let t=this._calcBoundsFromPath();return te(te({},t),{},{pathOffset:new tZ(t.left+t.width/2,t.top+t.height/2)})}static fromObject(t){return this._fromObject(t,{extraParam:"path"})}static async fromElement(t,e,r){let i=nc(t,this.ATTRIBUTE_NAMES,r),{d:n}=i;return new this(n,te(te(te({},tr(i,sy)),e),{},{left:void 0,top:void 0}))}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{path:r,left:i,top:n}=e,s=tr(e,sv);super(),Object.assign(this,sx.ownDefaults),this.setOptions(s),this._setPath(t||[],!0),"number"==typeof i&&this.set(tS,i),"number"==typeof n&&this.set("top",n)}}$(sx,"type","Path"),$(sx,"cacheProperties",[...rY,"path","fillRule"]),$(sx,"ATTRIBUTE_NAMES",[...i5,"d"]),tY.setClass(sx),tY.setSVGClass(sx);class sb extends sm{needsFullRender(){return super.needsFullRender()||this._hasStraightLine}static drawSegment(t,e,r){let i=e.midPointFrom(r);return t.quadraticCurveTo(e.x,e.y,i.x,i.y),i}onMouseDown(t,e){let{e:r}=e;this.canvas._isMainEvent(r)&&(this.drawStraightLine=!!this.straightLineKey&&r[this.straightLineKey],this._prepareForDrawing(t),this._addPoint(t),this._render())}onMouseMove(t,e){let{e:r}=e;if(this.canvas._isMainEvent(r)&&(this.drawStraightLine=!!this.straightLineKey&&r[this.straightLineKey],(!0!==this.limitedToCanvasSize||!this._isOutSideCanvas(t))&&this._addPoint(t)&&this._points.length>1))if(this.needsFullRender())this.canvas.clearContext(this.canvas.contextTop),this._render();else{let t=this._points,e=t.length,r=this.canvas.contextTop;this._saveAndTransform(r),this.oldEnd&&(r.beginPath(),r.moveTo(this.oldEnd.x,this.oldEnd.y)),this.oldEnd=sb.drawSegment(r,t[e-2],t[e-1]),r.stroke(),r.restore()}}onMouseUp(t){let{e:e}=t;return!this.canvas._isMainEvent(e)||(this.drawStraightLine=!1,this.oldEnd=void 0,this._finalizeAndAddPath(),!1)}_prepareForDrawing(t){this._reset(),this._addPoint(t),this.canvas.contextTop.moveTo(t.x,t.y)}_addPoint(t){return!(this._points.length>1&&t.eq(this._points[this._points.length-1]))&&(this.drawStraightLine&&this._points.length>1&&(this._hasStraightLine=!0,this._points.pop()),this._points.push(t),!0)}_reset(){this._points=[],this._setBrushStyles(this.canvas.contextTop),this._setShadow(),this._hasStraightLine=!1}_render(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.canvas.contextTop,e=this._points[0],r=this._points[1];if(this._saveAndTransform(t),t.beginPath(),2===this._points.length&&e.x===r.x&&e.y===r.y){let t=this.width/1e3;e.x-=t,r.x+=t}t.moveTo(e.x,e.y);for(let i=1;i=i&&s.push(r=t[e]);return s.push(t[n]),s}_finalizeAndAddPath(){this.canvas.contextTop.closePath(),this.decimate&&(this._points=this.decimatePoints(this._points,this.decimate));let t=this.convertPointsToSVGPath(this._points);if("M 0 0 Q 0 0 0 0 L 0 0"===n0(t))return void this.canvas.requestRenderAll();let e=this.createPath(t);this.canvas.clearContext(this.canvas.contextTop),this.canvas.fire("before:path:created",{path:e}),this.canvas.add(e),this.canvas.requestRenderAll(),e.setCoords(),this._resetShadow(),this.canvas.fire("path:created",{path:e})}constructor(t){super(t),$(this,"decimate",.4),$(this,"drawStraightLine",!1),$(this,"straightLineKey","shiftKey"),this._points=[],this._hasStraightLine=!1}}let s_=["left","top","radius"],sw=["radius","startAngle","endAngle","counterClockwise"];class sC extends iU{static getDefaults(){return te(te({},super.getDefaults()),sC.ownDefaults)}_set(t,e){return super._set(t,e),"radius"===t&&this.setRadius(e),this}_render(t){t.beginPath(),t.arc(0,0,this.radius,er(this.startAngle),er(this.endAngle),this.counterClockwise),this._renderPaintInOrder(t)}getRadiusX(){return this.get("radius")*this.get(tB)}getRadiusY(){return this.get("radius")*this.get(tN)}setRadius(t){this.radius=t,this.set({width:2*t,height:2*t})}toObject(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return super.toObject([...sw,...t])}_toSVG(){let t=(this.endAngle-this.startAngle)%360;if(0===t)return["\n'];{let{radius:e}=this,r=er(this.startAngle),i=er(this.endAngle),n=tQ(r)*e,s=tJ(r)*e,a=tQ(i)*e,o=tJ(i)*e,l=+!this.counterClockwise;return['180)," ").concat(l," ").concat(a," ").concat(o,'" '),"COMMON_PARTS"," />\n"]}}static async fromElement(t,e,r){let i=nc(t,this.ATTRIBUTE_NAMES,r),{left:n=0,top:s=0,radius:a=0}=i;return new this(te(te({},tr(i,s_)),{},{radius:a,left:n-a,top:s-a}))}static fromObject(t){return super._fromObject(t)}constructor(t){super(),Object.assign(this,sC.ownDefaults),this.setOptions(t)}}$(sC,"type","Circle"),$(sC,"cacheProperties",[...rY,...sw]),$(sC,"ownDefaults",{radius:0,startAngle:0,endAngle:360,counterClockwise:!1}),$(sC,"ATTRIBUTE_NAMES",["cx","cy","r",...i5]),tY.setClass(sC),tY.setSVGClass(sC);let sS=["x1","y1","x2","y2"],sT=["x1","y1","x2","y2"],sO=["x1","x2","y1","y2"];class sk extends iU{_setWidthHeight(){let{x1:t,y1:e,x2:r,y2:i}=this;this.width=Math.abs(r-t),this.height=Math.abs(i-e);let{left:n,top:s,width:a,height:o}=eX([{x:t,y:e},{x:r,y:i}]),l=new tZ(n+a/2,s+o/2);this.setPositionByOrigin(l,tC,tC)}_set(t,e){return super._set(t,e),sO.includes(t)&&this._setWidthHeight(),this}_render(t){var e;t.beginPath();let r=this.calcLinePoints();t.moveTo(r.x1,r.y1),t.lineTo(r.x2,r.y2),t.lineWidth=this.strokeWidth;let i=t.strokeStyle;eO(this.stroke)?t.strokeStyle=this.stroke.toLive(t):t.strokeStyle=null!=(e=this.stroke)?e:t.fillStyle,this.stroke&&this._renderStroke(t),t.strokeStyle=i}_findCenterFromElement(){return new tZ((this.x1+this.x2)/2,(this.y1+this.y2)/2)}toObject(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return te(te({},super.toObject(t)),this.calcLinePoints())}_getNonTransformedDimensions(){let t=super._getNonTransformedDimensions();return"butt"===this.strokeLineCap&&(0===this.width&&(t.y-=this.strokeWidth),0===this.height&&(t.x-=this.strokeWidth)),t}calcLinePoints(){let{x1:t,x2:e,y1:r,y2:i,width:n,height:s}=this,a=t<=e?-1:1,o=r<=i?-1:1;return{x1:a*n/2,x2:-(a*n)/2,y1:o*s/2,y2:-(o*s)/2}}_toSVG(){let{x1:t,x2:e,y1:r,y2:i}=this.calcLinePoints();return["\n')]}static async fromElement(t,e,r){let i=nc(t,this.ATTRIBUTE_NAMES,r),{x1:n=0,y1:s=0,x2:a=0,y2:o=0}=i;return new this([n,s,a,o],tr(i,sS))}static fromObject(t){let{x1:e,y1:r,x2:i,y2:n}=t,s=tr(t,sT);return this._fromObject(te(te({},s),{},{points:[e,r,i,n]}),{extraParam:"points"})}constructor(){let[t,e,r,i]=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,0,0],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),Object.assign(this,sk.ownDefaults),this.setOptions(n),this.x1=t,this.x2=r,this.y1=e,this.y2=i,this._setWidthHeight();let{left:s,top:a}=n;"number"==typeof s&&this.set(tS,s),"number"==typeof a&&this.set("top",a)}}$(sk,"type","Line"),$(sk,"cacheProperties",[...rY,...sO]),$(sk,"ATTRIBUTE_NAMES",i5.concat(sO)),tY.setClass(sk),tY.setSVGClass(sk);class sM extends iU{static getDefaults(){return te(te({},super.getDefaults()),sM.ownDefaults)}_render(t){let e=this.width/2,r=this.height/2;t.beginPath(),t.moveTo(-e,r),t.lineTo(0,-r),t.lineTo(e,r),t.closePath(),this._renderPaintInOrder(t)}_toSVG(){let t=this.width/2,e=this.height/2;return["']}constructor(t){super(),Object.assign(this,sM.ownDefaults),this.setOptions(t)}}$(sM,"type","Triangle"),$(sM,"ownDefaults",{width:100,height:100}),tY.setClass(sM),tY.setSVGClass(sM);let sE=["rx","ry"];class sD extends iU{static getDefaults(){return te(te({},super.getDefaults()),sD.ownDefaults)}_set(t,e){switch(super._set(t,e),t){case"rx":this.rx=e,this.set("width",2*e);break;case"ry":this.ry=e,this.set("height",2*e)}return this}getRx(){return this.get("rx")*this.get(tB)}getRy(){return this.get("ry")*this.get(tN)}toObject(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return super.toObject([...sE,...t])}_toSVG(){return["\n')]}_render(t){t.beginPath(),t.save(),t.transform(1,0,0,this.ry/this.rx,0,0),t.arc(0,0,this.rx,0,tb,!1),t.restore(),this._renderPaintInOrder(t)}static async fromElement(t,e,r){let i=nc(t,this.ATTRIBUTE_NAMES,r);return i.left=(i.left||0)-i.rx,i.top=(i.top||0)-i.ry,new this(i)}constructor(t){super(),Object.assign(this,sD.ownDefaults),this.setOptions(t)}}$(sD,"type","Ellipse"),$(sD,"cacheProperties",[...rY,...sE]),$(sD,"ownDefaults",{rx:0,ry:0}),$(sD,"ATTRIBUTE_NAMES",[...i5,"cx","cy","rx","ry"]),tY.setClass(sD),tY.setSVGClass(sD);let sj=["left","top"],sA={exactBoundingBox:!1};class sP extends iU{static getDefaults(){return te(te({},super.getDefaults()),sP.ownDefaults)}isOpen(){return!0}_projectStrokeOnPoints(t){return iG(this.points,t,this.isOpen())}_calcDimensions(t){t=te({scaleX:this.scaleX,scaleY:this.scaleY,skewX:this.skewX,skewY:this.skewY,strokeLineCap:this.strokeLineCap,strokeLineJoin:this.strokeLineJoin,strokeMiterLimit:this.strokeMiterLimit,strokeUniform:this.strokeUniform,strokeWidth:this.strokeWidth},t||{});let e=this.exactBoundingBox?this._projectStrokeOnPoints(t).map(t=>t.projectedPoint):this.points;if(0===e.length)return{left:0,top:0,width:0,height:0,pathOffset:new tZ,strokeOffset:new tZ,strokeDiff:new tZ};let r=eX(e),i=ev(te(te({},t),{},{scaleX:1,scaleY:1})),n=eX(this.points.map(t=>es(t,i,!0))),s=new tZ(this.scaleX,this.scaleY),a=r.left+r.width/2,o=r.top+r.height/2;return this.exactBoundingBox&&(a-=o*Math.tan(er(this.skewX)),o-=a*Math.tan(er(this.skewY))),te(te({},r),{},{pathOffset:new tZ(a,o),strokeOffset:new tZ(n.left,n.top).subtract(new tZ(r.left,r.top)).multiply(s),strokeDiff:new tZ(r.width,r.height).subtract(new tZ(n.width,n.height)).multiply(s)})}_findCenterFromElement(){let t=eX(this.points);return new tZ(t.left+t.width/2,t.top+t.height/2)}setDimensions(){this.setBoundingBox()}setBoundingBox(t){let{left:e,top:r,width:i,height:n,pathOffset:s,strokeOffset:a,strokeDiff:o}=this._calcDimensions();this.set({width:i,height:n,pathOffset:s,strokeOffset:a,strokeDiff:o}),t&&this.setPositionByOrigin(new tZ(e+i/2,r+n/2),tC,tC)}isStrokeAccountedForInDimensions(){return this.exactBoundingBox}_getNonTransformedDimensions(){return this.exactBoundingBox?new tZ(this.width,this.height):super._getNonTransformedDimensions()}_getTransformedDimensions(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.exactBoundingBox){var e,r,i,n;let s;if(Object.keys(t).some(t=>this.strokeUniform||this.constructor.layoutProperties.includes(t))){let{width:i,height:n}=this._calcDimensions(t);s=new tZ(null!=(e=t.width)?e:i,null!=(r=t.height)?r:n)}else s=new tZ(null!=(i=t.width)?i:this.width,null!=(n=t.height)?n:this.height);return s.multiply(new tZ(t.scaleX||this.scaleX,t.scaleY||this.scaleY))}return super._getTransformedDimensions(t)}_set(t,e){let r=this.initialized&&this[t]!==e,i=super._set(t,e);return this.exactBoundingBox&&r&&((t===tB||t===tN)&&this.strokeUniform&&this.constructor.layoutProperties.includes("strokeUniform")||this.constructor.layoutProperties.includes(t))&&this.setDimensions(),i}toObject(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return te(te({},super.toObject(t)),{},{points:this.points.map(t=>{let{x:e,y:r}=t;return{x:e,y:r}})})}_toSVG(){let t=[],e=this.pathOffset.x,r=this.pathOffset.y,i=ts.NUM_FRACTION_DIGITS;for(let n=0,s=this.points.length;n\n')]}_render(t){let e=this.points.length,r=this.pathOffset.x,i=this.pathOffset.y;if(e&&!isNaN(this.points[e-1].y)){t.beginPath(),t.moveTo(this.points[0].x-r,this.points[0].y-i);for(let n=0;n0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),$(this,"strokeDiff",void 0),Object.assign(this,sP.ownDefaults),this.setOptions(e),this.points=t;let{left:r,top:i}=e;this.initialized=!0,this.setBoundingBox(!0),"number"==typeof r&&this.set(tS,r),"number"==typeof i&&this.set("top",i)}}$(sP,"ownDefaults",sA),$(sP,"type","Polyline"),$(sP,"layoutProperties",[tW,tU,"strokeLineCap","strokeLineJoin","strokeMiterLimit","strokeWidth","strokeUniform","points"]),$(sP,"cacheProperties",[...rY,"points"]),$(sP,"ATTRIBUTE_NAMES",[...i5]),tY.setClass(sP),tY.setSVGClass(sP);class sF extends sP{isOpen(){return!1}}$(sF,"ownDefaults",sA),$(sF,"type","Polygon"),tY.setClass(sF),tY.setSVGClass(sF);class sL extends iU{isEmptyStyles(t){if(!this.styles||void 0!==t&&!this.styles[t])return!0;let e=void 0===t?this.styles:{line:this.styles[t]};for(let t in e)for(let r in e[t])for(let i in e[t][r])return!1;return!0}styleHas(t,e){if(!this.styles||void 0!==e&&!this.styles[e])return!1;let r=void 0===e?this.styles:{0:this.styles[e]};for(let e in r)for(let i in r[e])if(void 0!==r[e][i][t])return!0;return!1}cleanStyle(t){if(!this.styles)return!1;let e=this.styles,r,i,n=0,s=!0,a=0;for(let a in e){for(let o in r=0,e[a]){let l=e[a][o]||{};n++,void 0!==l[t]?(i?l[t]!==i&&(s=!1):i=l[t],l[t]===this[t]&&delete l[t]):s=!1,0!==Object.keys(l).length?r++:delete e[a][o]}0===r&&delete e[a]}for(let t=0;tvoid 0!==t);this._setStyleDeclaration(r,i,n)}getSelectionStyles(t,e,r){let i=[];for(let n=t;n<(e||t);n++)i.push(this.getStyleAtPosition(n,r));return i}getStyleAtPosition(t,e){let{lineIndex:r,charIndex:i}=this.get2DCursorLocation(t);return e?this.getCompleteStyleDeclaration(r,i):this._getStyleDeclaration(r,i)}setSelectionStyles(t,e,r){for(let i=e;i<(r||e);i++)this._extendStyles(i,t);this._forceClearCache=!0}_getStyleDeclaration(t,e){var r;let i=this.styles&&this.styles[t];return i&&null!=(r=i[e])?r:{}}getCompleteStyleDeclaration(t,e){return te(te({},ew(this,this.constructor._styleProperties)),this._getStyleDeclaration(t,e))}_setStyleDeclaration(t,e,r){this.styles[t][e]=r}_deleteStyleDeclaration(t,e){delete this.styles[t][e]}_getLineStyle(t){return!!this.styles[t]}_setLineStyle(t){this.styles[t]={}}_deleteLineStyle(t){delete this.styles[t]}}$(sL,"_styleProperties",rv);let sR=/ +/g,sI=/"/g;function sB(t,e,r,i,n){return" ".concat(function(t,e){let{left:r,top:i,width:n,height:s}=e,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ts.NUM_FRACTION_DIGITS,o=rh(tH,t,!1),[l,h,c,u]=[r,i,n,s].map(t=>eS(t,a));return"')}(t,{left:e,top:r,width:i,height:n}),"\n")}let sN=["textAnchor","textDecoration","dx","dy","top","left","fontSize","strokeWidth"];class sW extends sL{static getDefaults(){return te(te({},super.getDefaults()),sW.ownDefaults)}setPathInfo(){let t=this.path;t&&(t.segmentsInfo=nY(t.path))}_splitText(){let t=this._splitTextIntoLines(this.text);return this.textLines=t.lines,this._textLines=t.graphemeLines,this._unwrappedTextLines=t._unwrappedLines,this._text=t.graphemeText,t}initDimensions(){this._splitText(),this._clearCache(),this.dirty=!0,this.path?(this.width=this.path.width,this.height=this.path.height):(this.width=this.calcTextWidth()||this.cursorWidth||this.MIN_TEXT_WIDTH,this.height=this.calcTextHeight()),this.textAlign.includes(ry)&&this.enlargeSpaces()}enlargeSpaces(){let t,e,r,i,n,s,a;for(let o=0,l=this._textLines.length;o')}_getCacheCanvasDimensions(){let t=super._getCacheCanvasDimensions(),e=this.fontSize;return t.width+=e*t.zoomX,t.height+=e*t.zoomY,t}_render(t){let e=this.path;e&&!e.isNotVisible()&&e._render(t),this._setTextStyles(t),this._renderTextLinesBackground(t),this._renderTextDecoration(t,"underline"),this._renderText(t),this._renderTextDecoration(t,"overline"),this._renderTextDecoration(t,"linethrough")}_renderText(t){this.paintFirst===tX?(this._renderTextStroke(t),this._renderTextFill(t)):(this._renderTextFill(t),this._renderTextStroke(t))}_setTextStyles(t,e,r){if(t.textBaseline="alphabetic",this.path)switch(this.pathAlign){case tC:t.textBaseline="middle";break;case"ascender":t.textBaseline="top";break;case"descender":t.textBaseline=tT}t.font=this._getFontDeclaration(e,r)}calcTextWidth(){let t=this.getLineWidth(0);for(let e=1,r=this._textLines.length;et&&(t=r)}return t}_renderTextLine(t,e,r,i,n,s){this._renderChars(t,e,r,i,n,s)}_renderTextLinesBackground(t){if(!this.textBackgroundColor&&!this.styleHas("textBackgroundColor"))return;let e=t.fillStyle,r=this._getLeftOffset(),i=this._getTopOffset();for(let e=0,n=this._textLines.length;e=0:ie?t%=e:t<0&&(t+=e),this._setGraphemeOnPath(t,r),t+=r.kernedWidth}return{width:i,numOfSpaces:0}}_setGraphemeOnPath(t,e){let r=t+e.kernedWidth/2,i=this.path,n=nG(i.path,r,i.segmentsInfo);e.renderLeft=n.x-i.pathOffset.x,e.renderTop=n.y-i.pathOffset.y,e.angle=n.angle+(this.pathSide===tO?Math.PI:0)}_getGraphemeBox(t,e,r,i,n){let s=this.getCompleteStyleDeclaration(e,r),a=i?this.getCompleteStyleDeclaration(e,r-1):{},o=this._measureChar(t,s,i,a),l,h=o.kernedWidth,c=o.width;0!==this.charSpacing&&(c+=l=this._getWidthOfCharSpacing(),h+=l);let u={width:c,left:0,height:s.fontSize,kernedWidth:h,deltaY:s.deltaY};if(r>0&&!n){let t=this.__charBounds[e][r-1];u.left=t.left+t.width+o.kernedWidth-o.width}return u}getHeightOfLine(t){if(this.__lineHeights[t])return this.__lineHeights[t];let e=this.getHeightOfChar(t,0);for(let r=1,i=this._textLines[t].length;r0){let e=this.fontSize*y/1e3,r=i+d+f;"rtl"===this.direction&&(r=this.width-r-g),p&&m&&y&&(t.fillStyle=m,t.fillRect(r,w+o*C+S-a*e,g,e)),f=s.left,g=s.width,p=x,y=_,m=b,C=h,S=c}else g+=s.kernedWidth}let T=i+d+f;"rtl"===this.direction&&(T=this.width-T-g),t.fillStyle=b;let O=this.fontSize*_/1e3;x&&b&&_&&t.fillRect(T,w+o*C+S-a*O,g-s,O),r+=h}this._removeShadow(t)}_getFontDeclaration(){let{fontFamily:t=this.fontFamily,fontStyle:e=this.fontStyle,fontWeight:r=this.fontWeight,fontSize:i=this.fontSize}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,s=t.includes("'")||t.includes('"')||t.includes(",")||sW.genericFonts.includes(t.toLowerCase())?t:'"'.concat(t,'"');return[e,r,"".concat(n?this.CACHE_FONT_SIZE:i,"px"),s].join(" ")}render(t){this.visible&&(this.canvas&&this.canvas.skipOffscreen&&!this.group&&!this.isOnScreen()||(this._forceClearCache&&this.initDimensions(),super.render(t)))}graphemeSplit(t){return iQ(t)}_splitTextIntoLines(t){let e=t.split(this._reNewline),r=Array(e.length),i=["\n"],n=[];for(let t=0;t0&&void 0!==arguments[0]?arguments[0]:[];return te(te({},super.toObject([...rm,...t])),{},{styles:i1(this.styles,this.text)},this.path?{path:this.path.toObject()}:{})}set(t,e){let{textLayoutProperties:r}=this.constructor;super.set(t,e);let i=!1,n=!1;if("object"==typeof t)for(let e in t)"path"===e&&this.setPathInfo(),i=i||r.includes(e),n=n||"path"===e;else i=r.includes(t),n="path"===t;return n&&this.setPathInfo(),i&&this.initialized&&(this.initDimensions(),this.setCoords()),this}complexity(){return 1}static async fromElement(t,e,r){let i=nc(t,sW.ATTRIBUTE_NAMES,r),n=te(te({},e),i),{textAnchor:s=tS,textDecoration:a="",dx:o=0,dy:l=0,top:h=0,left:c=0,fontSize:u=16,strokeWidth:d=1}=n,f=tr(n,sN),g=new this((t.textContent||"").replace(/^\s+|\s+$|\n+/g,"").replace(/\s+/g," "),te({left:c+o,top:h+l,underline:a.includes("underline"),overline:a.includes("overline"),linethrough:a.includes("line-through"),strokeWidth:0,fontSize:u},f)),p=g.getScaledHeight()/g.height,m=((g.height+g.strokeWidth)*g.lineHeight-g.height)*p,y=g.getScaledHeight()+m,x=0;return s===tC&&(x=g.getScaledWidth()/2),s===tO&&(x=g.getScaledWidth()),g.set({left:g.left-x,top:g.top-(y-g.fontSize*(.07+g._fontSizeFraction))/g.lineHeight,strokeWidth:d}),g}static fromObject(t){return this._fromObject(te(te({},t),{},{styles:i2(t.styles||{},t.text)}),{extraParam:"text"})}constructor(t,e){super(),$(this,"__charBounds",[]),Object.assign(this,sW.ownDefaults),this.setOptions(e),this.styles||(this.styles={}),this.text=t,this.initialized=!0,this.path&&this.setPathInfo(),this.initDimensions(),this.setCoords()}}$(sW,"textLayoutProperties",rp),$(sW,"cacheProperties",[...rY,...rm]),$(sW,"ownDefaults",{_reNewline:tM,_reSpacesAndTabs:/[ \t\r]/g,_reSpaceAndTab:/[ \t\r]/,_reWords:/\S+/g,fontSize:40,fontWeight:"normal",fontFamily:"Times New Roman",underline:!1,overline:!1,linethrough:!1,textAlign:tS,fontStyle:"normal",lineHeight:1.16,textBackgroundColor:"",stroke:null,shadow:null,path:void 0,pathStartOffset:0,pathSide:tS,pathAlign:"baseline",charSpacing:0,deltaY:0,direction:"ltr",CACHE_FONT_SIZE:400,MIN_TEXT_WIDTH:2,superscript:{size:.6,baseline:-.35},subscript:{size:.6,baseline:.11},_fontSizeFraction:.222,offsets:{underline:.1,linethrough:-.28167,overline:-.81333},_fontSizeMult:1.13,[rd]:66.667}),$(sW,"type","Text"),$(sW,"genericFonts",["serif","sans-serif","monospace","cursive","fantasy","system-ui","ui-serif","ui-sans-serif","ui-monospace","ui-rounded","math","emoji","fangsong"]),$(sW,"ATTRIBUTE_NAMES",i5.concat("x","y","dx","dy","font-family","font-style","font-weight","font-size","letter-spacing","text-decoration","text-anchor")),iW(sW,[class extends rc{_toSVG(){let t=this._getSVGLeftTopOffsets(),e=this._getSVGTextAndBg(t.textTop,t.textLeft);return this._wrapSVGTextAndBg(e)}toSVG(t){let e=this._createBaseSVGMarkup(this._toSVG(),{reviver:t,noStyle:!0,withShadow:!0}),r=this.path;return r?e+r._createBaseSVGMarkup(r._toSVG(),{reviver:t,withShadow:!0,additionalTransform:eT(this.calcOwnMatrix())}):e}_getSVGLeftTopOffsets(){return{textLeft:-this.width/2,textTop:-this.height/2,lineTop:this.getHeightOfLine(0)}}_wrapSVGTextAndBg(t){let{textBgRects:e,textSpans:r}=t,i=this.getSvgTextDecoration(this);return[e.join(""),' ",r.join(""),"\n"]}_getSVGTextAndBg(t,e){let r=[],i=[],n,s=t;this.backgroundColor&&i.push(...sB(this.backgroundColor,-this.width/2,-this.height/2,this.width,this.height));for(let t=0,a=this._textLines.length;t").concat(iK(t),"")}_setSVGTextLineText(t,e,r,i){let n=this.getHeightOfLine(e),s=this.textAlign.includes(ry),a=this._textLines[e],o,l,h,c,u,d="",f=0;i+=n*(1-this._fontSizeFraction)/this.lineHeight;for(let n=0,g=a.length-1;n<=g;n++)u=n===g||this.charSpacing||this.path,d+=a[n],h=this.__charBounds[e][n],0===f?(r+=h.kernedWidth-h.width,f+=h.width):f+=h.kernedWidth,s&&!u&&this._reSpaceAndTab.test(a[n])&&(u=!0),u||(u=i0(o=o||this.getCompleteStyleDeclaration(e,n),l=this.getCompleteStyleDeclaration(e,n+1),!0)),u&&(c=this._getStyleDeclaration(e,n),t.push(this._createTextCharSpan(d,c,r,i,h)),d="",o=l,"rtl"===this.direction?r-=f:r+=f,f=0)}_setSVGTextLineBg(t,e,r,i){let n=this._textLines[e],s=this.getHeightOfLine(e)/this.lineHeight,a,o=0,l=0,h=this.getValueOfPropertyAt(e,0,"textBackgroundColor");for(let c=0;ct[e.replace("-","")]).join(" ")}}]),tY.setClass(sW),tY.setSVGClass(sW);class sU{isPointerOverSelection(t){let e=this.target,r=e.getSelectionStartFromPointer(t);return e.isEditing&&r>=e.selectionStart&&r<=e.selectionEnd&&e.selectionStart{b.remove()},ej(t.target||this.target.hiddenTextarea).body.appendChild(b),null==(r=t.dataTransfer)||r.setDragImage(b,p.x,p.y)}onDragStart(t){this.__dragStartFired=!0;let e=this.target,r=this.isActive();if(r&&t.dataTransfer){let r=this.__dragStartSelection={selectionStart:e.selectionStart,selectionEnd:e.selectionEnd},i=e._text.slice(r.selectionStart,r.selectionEnd).join(""),n=te({text:e.text,value:i},r);t.dataTransfer.setData("text/plain",i),t.dataTransfer.setData("application/fabric",JSON.stringify({value:i,styles:e.getSelectionStyles(r.selectionStart,r.selectionEnd,!0)})),t.dataTransfer.effectAllowed="copyMove",this.setDragImage(t,n)}return e.abortCursorAnimation(),r}canDrop(t){if(this.target.editable&&!this.target.getActiveControl()&&!t.defaultPrevented){if(this.isActive()&&this.__dragStartSelection){let e=this.target.getSelectionStartFromPointer(t),r=this.__dragStartSelection;return er.selectionEnd}return!0}return!1}targetCanDrop(t){return this.target.canDrop(t)}dragEnterHandler(t){let{e:e}=t,r=this.targetCanDrop(e);!this.__isDraggingOver&&r&&(this.__isDraggingOver=!0)}dragOverHandler(t){let{e:e}=t,r=this.targetCanDrop(e);!this.__isDraggingOver&&r?this.__isDraggingOver=!0:this.__isDraggingOver&&!r&&(this.__isDraggingOver=!1),this.__isDraggingOver&&(e.preventDefault(),t.canDrop=!0,t.dropTarget=this.target)}dragLeaveHandler(){(this.__isDraggingOver||this.isActive())&&(this.__isDraggingOver=!1)}dropHandler(t){var e;let{e:r}=t,i=r.defaultPrevented;this.__isDraggingOver=!1,r.preventDefault();let n=null==(e=r.dataTransfer)?void 0:e.getData("text/plain");if(n&&!i){let e=this.target,i=e.canvas,s=e.getSelectionStartFromPointer(r),{styles:a}=r.dataTransfer.types.includes("application/fabric")?JSON.parse(r.dataTransfer.getData("application/fabric")):{},o=n[Math.max(0,n.length-1)];if(this.__dragStartSelection){let t=this.__dragStartSelection.selectionStart,r=this.__dragStartSelection.selectionEnd;s>t&&s<=r?s=t:s>r&&(s-=r-t),e.removeChars(t,r),delete this.__dragStartSelection}e._reNewline.test(o)&&(e._reNewline.test(e._text[s])||s===e._text.length)&&(n=n.trimEnd()),t.didDrop=!0,t.dropTarget=e,e.insertChars(n,a,s),i.setActiveObject(e),e.enterEditing(r),e.selectionStart=Math.min(s+0,e._text.length),e.selectionEnd=Math.min(e.selectionStart+n.length,e._text.length),e.hiddenTextarea.value=e.text,e._updateTextarea(),e.hiddenTextarea.focus(),e.fire(tR,{index:s+0,action:"drop"}),i.fire("text:changed",{target:e}),i.contextTopDirty=!0,i.requestRenderAll()}}dragEndHandler(t){let{e:e}=t;if(this.isActive()&&this.__dragStartFired&&this.__dragStartSelection){var r;let t=this.target,i=this.target.canvas,{selectionStart:n,selectionEnd:s}=this.__dragStartSelection,a=(null==(r=e.dataTransfer)?void 0:r.dropEffect)||tk;a===tk?(t.selectionStart=n,t.selectionEnd=s,t._updateTextarea(),t.hiddenTextarea.focus()):(t.clearContextTop(),"move"===a&&(t.removeChars(n,s),t.selectionStart=t.selectionEnd=n,t.hiddenTextarea&&(t.hiddenTextarea.value=t.text),t._updateTextarea(),t.fire(tR,{index:n,action:"dragend"}),i.fire("text:changed",{target:t}),i.requestRenderAll()),t.exitEditing())}this.__dragImageDisposer&&this.__dragImageDisposer(),delete this.__dragImageDisposer,delete this.__dragStartSelection,this.__isDraggingOver=!1}dispose(){this._dispose&&this._dispose()}constructor(t){$(this,"target",void 0),$(this,"__mouseDownInPlace",!1),$(this,"__dragStartFired",!1),$(this,"__isDraggingOver",!1),$(this,"__dragStartSelection",void 0),$(this,"__dragImageDisposer",void 0),$(this,"_dispose",void 0),this.target=t;let e=[this.target.on("dragenter",this.dragEnterHandler.bind(this)),this.target.on("dragover",this.dragOverHandler.bind(this)),this.target.on("dragleave",this.dragLeaveHandler.bind(this)),this.target.on("dragend",this.dragEndHandler.bind(this)),this.target.on("drop",this.dropHandler.bind(this))];this._dispose=()=>{e.forEach(t=>t()),this._dispose=void 0}}}let sH=/[ \n\.,;!\?\-]/;class sX extends sW{initBehavior(){this._tick=this._tick.bind(this),this._onTickComplete=this._onTickComplete.bind(this),this.updateSelectionOnMouseMove=this.updateSelectionOnMouseMove.bind(this)}onDeselect(t){return this.isEditing&&this.exitEditing(),this.selected=!1,super.onDeselect(t)}_animateCursor(t){let{toValue:e,duration:r,delay:i,onComplete:n}=t;return r7({startValue:this._currentCursorOpacity,endValue:e,duration:r,delay:i,onComplete:n,abort:()=>!this.canvas||this.selectionStart!==this.selectionEnd,onChange:t=>{this._currentCursorOpacity=t,this.renderCursorOrSelection()}})}_tick(t){this._currentTickState=this._animateCursor({toValue:0,duration:this.cursorDuration/2,delay:Math.max(t||0,100),onComplete:this._onTickComplete})}_onTickComplete(){var t;null==(t=this._currentTickCompleteState)||t.abort(),this._currentTickCompleteState=this._animateCursor({toValue:1,duration:this.cursorDuration,onComplete:this._tick})}initDelayedCursor(t){this.abortCursorAnimation(),this._tick(t?0:this.cursorDelay)}abortCursorAnimation(){let t=!1;[this._currentTickState,this._currentTickCompleteState].forEach(e=>{e&&!e.isDone()&&(t=!0,e.abort())}),this._currentCursorOpacity=1,t&&this.clearContextTop()}restartCursorIfNeeded(){[this._currentTickState,this._currentTickCompleteState].some(t=>!t||t.isDone())&&this.initDelayedCursor()}selectAll(){return this.selectionStart=0,this.selectionEnd=this._text.length,this._fireSelectionChanged(),this._updateTextarea(),this}cmdAll(){this.selectAll(),this.renderCursorOrSelection()}getSelectedText(){return this._text.slice(this.selectionStart,this.selectionEnd).join("")}findWordBoundaryLeft(t){let e=0,r=t-1;if(this._reSpace.test(this._text[r]))for(;this._reSpace.test(this._text[r]);)e++,r--;for(;/\S/.test(this._text[r])&&r>-1;)e++,r--;return t-e}findWordBoundaryRight(t){let e=0,r=t;if(this._reSpace.test(this._text[r]))for(;this._reSpace.test(this._text[r]);)e++,r++;for(;/\S/.test(this._text[r])&&r-1;)e++,r--;return t-e}findLineBoundaryRight(t){let e=0,r=t;for(;!/\n/.test(this._text[r])&&r0&&this._reSpace.test(r[t])&&(-1===e||!tM.test(r[t-1]))?t-1:t,n=r[i];for(;i>0&&ithis.__selectionStartOnMouseDown?(this.selectionStart=this.__selectionStartOnMouseDown,this.selectionEnd=r):(this.selectionStart=r,this.selectionEnd=this.__selectionStartOnMouseDown),this.selectionStart===i&&this.selectionEnd===n||(this._fireSelectionChanged(),this._updateTextarea(),this.renderCursorOrSelection()))}_setEditingProps(){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(t,e,r){let i=r.slice(0,t),n=this.graphemeSplit(i).length;if(t===e)return{selectionStart:n,selectionEnd:n};let s=r.slice(t,e);return{selectionStart:n,selectionEnd:n+this.graphemeSplit(s).length}}fromGraphemeToStringSelection(t,e,r){let i=r.slice(0,t).join("").length;return t===e?{selectionStart:i,selectionEnd:i}:{selectionStart:i,selectionEnd:i+r.slice(t,e).join("").length}}_updateTextarea(){if(this.cursorOffsetCache={},this.hiddenTextarea){if(!this.inCompositionMode){let t=this.fromGraphemeToStringSelection(this.selectionStart,this.selectionEnd,this._text);this.hiddenTextarea.selectionStart=t.selectionStart,this.hiddenTextarea.selectionEnd=t.selectionEnd}this.updateTextareaPosition()}}updateFromTextArea(){if(!this.hiddenTextarea)return;this.cursorOffsetCache={};let t=this.hiddenTextarea;this.text=t.value,this.set("dirty",!0),this.initDimensions(),this.setCoords();let e=this.fromStringToGraphemeSelection(t.selectionStart,t.selectionEnd,t.value);this.selectionEnd=this.selectionStart=e.selectionEnd,this.inCompositionMode||(this.selectionStart=e.selectionStart),this.updateTextareaPosition()}updateTextareaPosition(){if(this.selectionStart===this.selectionEnd){let t=this._calcTextareaPosition();this.hiddenTextarea.style.left=t.left,this.hiddenTextarea.style.top=t.top}}_calcTextareaPosition(){if(!this.canvas)return{left:"1px",top:"1px"};let t=this.inCompositionMode?this.compositionStart:this.selectionStart,e=this._getCursorBoundaries(t),r=this.get2DCursorLocation(t),i=r.lineIndex,n=r.charIndex,s=this.getValueOfPropertyAt(i,n,"fontSize")*this.lineHeight,a=e.leftOffset,o=this.getCanvasRetinaScaling(),l=this.canvas.upperCanvasEl,h=l.width/o,c=l.height/o,u=h-s,d=c-s,f=new tZ(e.left+a,e.top+e.topOffset+s).transform(this.calcTransformMatrix()).transform(this.canvas.viewportTransform).multiply(new tZ(l.clientWidth/h,l.clientHeight/c));return f.x<0&&(f.x=0),f.x>u&&(f.x=u),f.y<0&&(f.y=0),f.y>d&&(f.y=d),f.x+=this.canvas._offset.left,f.y+=this.canvas._offset.top,{left:"".concat(f.x,"px"),top:"".concat(f.y,"px"),fontSize:"".concat(s,"px"),charHeight:s}}_saveEditingProps(){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(){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.defaultCursor,this.canvas.moveCursor=this._savedProps.moveCursor||this.canvas.moveCursor),delete this._savedProps)}_exitEditing(){let t=this.hiddenTextarea;this.selected=!1,this.isEditing=!1,t&&(t.blur&&t.blur(),t.parentNode&&t.parentNode.removeChild(t)),this.hiddenTextarea=null,this.abortCursorAnimation(),this.selectionStart!==this.selectionEnd&&this.clearContextTop()}exitEditingImpl(){this._exitEditing(),this.selectionEnd=this.selectionStart,this._restoreEditingProps(),this._forceClearCache&&(this.initDimensions(),this.setCoords())}exitEditing(){let t=this._textBeforeEdit!==this.text;return this.exitEditingImpl(),this.fire("editing:exited"),t&&this.fire(tV),this.canvas&&(this.canvas.fire("text:editing:exited",{target:this}),t&&this.canvas.fire("object:modified",{target:this})),this}_removeExtraneousStyles(){for(let t in this.styles)this._textLines[t]||delete this.styles[t]}removeStyleFromTo(t,e){let{lineIndex:r,charIndex:i}=this.get2DCursorLocation(t,!0),{lineIndex:n,charIndex:s}=this.get2DCursorLocation(e,!0);if(r!==n){if(this.styles[r])for(let t=i;t=s&&(t[r-e]=t[i],delete t[i])}}}shiftLineStyles(t,e){let r=Object.assign({},this.styles);for(let i in this.styles){let n=parseInt(i,10);n>t&&(this.styles[n+e]=r[n],r[n-e]||delete this.styles[n])}}insertNewlineStyleObject(t,e,r,i){let n={},s=this._unwrappedTextLines[t].length,a=s===e,o=!1;r||(r=1),this.shiftLineStyles(t,r);let l=this.styles[t]?this.styles[t][0===e?e:e-1]:void 0;for(let r in this.styles[t]){let i=parseInt(r,10);i>=e&&(o=!0,n[i-e]=this.styles[t][r],a&&0===e||delete this.styles[t][r])}let h=!1;for(o&&!a&&(this.styles[t+r]=n,h=!0),(h||s>e)&&r--;r>0;)i&&i[r-1]?this.styles[t+r]={0:te({},i[r-1])}:l?this.styles[t+r]={0:te({},l)}:delete this.styles[t+r],r--;this._forceClearCache=!0}insertCharStyleObject(t,e,r,i){this.styles||(this.styles={});let n=this.styles[t],s=n?te({},n):{};for(let t in r||(r=1),s){let i=parseInt(t,10);i>=e&&(n[i+r]=s[i],s[i-r]||delete n[i])}if(this._forceClearCache=!0,i){for(;r--;)Object.keys(i[r]).length&&(this.styles[t]||(this.styles[t]={}),this.styles[t][e+r]=te({},i[r]));return}if(!n)return;let a=n[e?e-1:1];for(;a&&r--;)this.styles[t][e+r]=te({},a)}insertNewStyleBlock(t,e,r){let i=this.get2DCursorLocation(e,!0),n=[0],s,a=0;for(let e=0;e0&&(this.insertCharStyleObject(i.lineIndex,i.charIndex,n[0],r),r=r&&r.slice(n[0]+1)),a&&this.insertNewlineStyleObject(i.lineIndex,i.charIndex+n[0],a),s=1;s0?this.insertCharStyleObject(i.lineIndex+s,0,n[s],r):r&&this.styles[i.lineIndex+s]&&r[0]&&(this.styles[i.lineIndex+s][0]=r[0]),r=r&&r.slice(n[s]+1);n[s]>0&&this.insertCharStyleObject(i.lineIndex+s,0,n[s],r)}removeChars(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t+1;this.removeStyleFromTo(t,e),this._text.splice(t,e-t),this.text=this._text.join(""),this.set("dirty",!0),this.initDimensions(),this.setCoords(),this._removeExtraneousStyles()}insertChars(t,e,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:r;i>r&&this.removeStyleFromTo(r,i);let n=this.graphemeSplit(t);this.insertNewStyleBlock(n,r,e),this._text=[...this._text.slice(0,r),...n,...this._text.slice(i)],this.text=this._text.join(""),this.set("dirty",!0),this.initDimensions(),this.setCoords(),this._removeExtraneousStyles()}setSelectionStartEndWithShift(t,e,r){r<=t?(e===t?this._selectionDirection=tS:this._selectionDirection===tO&&(this._selectionDirection=tS,this.selectionEnd=t),this.selectionStart=r):r>t&&r{let[r,i]=t;return e.setAttribute(r,i)});let{top:r,left:i,fontSize:n}=this._calcTextareaPosition();e.style.cssText="position: absolute; top: ".concat(r,"; left: ").concat(i,"; z-index: -999; opacity: 0; width: 1px; height: 1px; font-size: 1px; padding-top: ").concat(n,";"),(this.hiddenTextareaContainer||t.body).appendChild(e),Object.entries({blur:"blur",keydown:"onKeyDown",keyup:"onKeyUp",input:"onInput",copy:"copy",cut:"copy",paste:"paste",compositionstart:"onCompositionStart",compositionupdate:"onCompositionUpdate",compositionend:"onCompositionEnd"}).map(t=>{let[r,i]=t;return e.addEventListener(r,this[i].bind(this))}),this.hiddenTextarea=e}blur(){this.abortCursorAnimation()}onKeyDown(t){if(!this.isEditing)return;let e="rtl"===this.direction?this.keysMapRtl:this.keysMap;if(t.keyCode in e)this[e[t.keyCode]](t);else{if(!(t.keyCode in this.ctrlKeysMapDown)||!t.ctrlKey&&!t.metaKey)return;this[this.ctrlKeysMapDown[t.keyCode]](t)}t.stopImmediatePropagation(),t.preventDefault(),t.keyCode>=33&&t.keyCode<=40?(this.inCompositionMode=!1,this.clearContextTop(),this.renderCursorOrSelection()):this.canvas&&this.canvas.requestRenderAll()}onKeyUp(t){!this.isEditing||this._copyDone||this.inCompositionMode?this._copyDone=!1:t.keyCode in this.ctrlKeysMapUp&&(t.ctrlKey||t.metaKey)&&(this[this.ctrlKeysMapUp[t.keyCode]](t),t.stopImmediatePropagation(),t.preventDefault(),this.canvas&&this.canvas.requestRenderAll())}onInput(t){let e=this.fromPaste,{value:r,selectionStart:i,selectionEnd:n}=this.hiddenTextarea;if(this.fromPaste=!1,t&&t.stopPropagation(),!this.isEditing)return;let s=()=>{this.updateFromTextArea(),this.fire(tR),this.canvas&&(this.canvas.fire("text:changed",{target:this}),this.canvas.requestRenderAll())};if(""===this.hiddenTextarea.value)return this.styles={},void s();let a=this._splitTextIntoLines(r).graphemeText,o=this._text.length,l=a.length,h=this.selectionStart,c=this.selectionEnd,u=h!==c,d,f,g,p,m=l-o,y=this.fromStringToGraphemeSelection(i,n,r),x=h>y.selectionStart;u?(f=this._text.slice(h,c),m+=c-h):ld[0])),u?(g=h,p=c):x?(g=c-f.length,p=c):(g=c,p=c+f.length),this.removeStyleFromTo(g,p)),b.length){let{copyPasteData:t}=td();e&&b.join("")===t.copiedText&&!ts.disableStyleCopyPaste&&(d=t.copiedTextStyle),this.insertNewStyleBlock(b,h,d)}s()}onCompositionStart(){this.inCompositionMode=!0}onCompositionEnd(){this.inCompositionMode=!1}onCompositionUpdate(t){let{target:e}=t,{selectionStart:r,selectionEnd:i}=e;this.compositionStart=r,this.compositionEnd=i,this.updateTextareaPosition()}copy(){if(this.selectionStart===this.selectionEnd)return;let{copyPasteData:t}=td();t.copiedText=this.getSelectedText(),ts.disableStyleCopyPaste?t.copiedTextStyle=void 0:t.copiedTextStyle=this.getSelectionStyles(this.selectionStart,this.selectionEnd,!0),this._copyDone=!0}paste(){this.fromPaste=!0}_getWidthBeforeCursor(t,e){let r,i=this._getLineLeftOffset(t);return e>0&&(i+=(r=this.__charBounds[t][e-1]).left+r.width),i}getDownCursorOffset(t,e){let r=this._getSelectionForOffset(t,e),i=this.get2DCursorLocation(r),n=i.lineIndex;if(n===this._textLines.length-1||t.metaKey||34===t.keyCode)return this._text.length-r;let s=i.charIndex,a=this._getWidthBeforeCursor(n,s),o=this._getIndexOnLine(n+1,a);return this._textLines[n].slice(s).length+o+1+this.missingNewlineOffset(n)}_getSelectionForOffset(t,e){return t.shiftKey&&this.selectionStart!==this.selectionEnd&&e?this.selectionEnd:this.selectionStart}getUpCursorOffset(t,e){let r=this._getSelectionForOffset(t,e),i=this.get2DCursorLocation(r),n=i.lineIndex;if(0===n||t.metaKey||33===t.keyCode)return-r;let s=i.charIndex,a=this._getWidthBeforeCursor(n,s),o=this._getIndexOnLine(n-1,a),l=this._textLines[n].slice(0,s),h=this.missingNewlineOffset(n-1);return-this._textLines[n-1].length+o-l.length+(1-h)}_getIndexOnLine(t,e){let r=this._textLines[t],i,n,s=this._getLineLeftOffset(t),a=0;for(let o=0,l=r.length;oe){n=!0;let t=Math.abs(s-i-e);a=Math.abs(s-e)=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorUpOrDown("Down",t)}moveCursorUp(t){0===this.selectionStart&&0===this.selectionEnd||this._moveCursorUpOrDown("Up",t)}_moveCursorUpOrDown(t,e){let r=this["get".concat(t,"CursorOffset")](e,this._selectionDirection===tO);if(e.shiftKey?this.moveCursorWithShift(r):this.moveCursorWithoutShift(r),0!==r){let t=this.text.length;this.selectionStart=rV(0,this.selectionStart,t),this.selectionEnd=rV(0,this.selectionEnd,t),this.abortCursorAnimation(),this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea()}}moveCursorWithShift(t){let e=this._selectionDirection===tS?this.selectionStart+t:this.selectionEnd+t;return this.setSelectionStartEndWithShift(this.selectionStart,this.selectionEnd,e),0!==t}moveCursorWithoutShift(t){return t<0?(this.selectionStart+=t,this.selectionEnd=this.selectionStart):(this.selectionEnd+=t,this.selectionStart=this.selectionEnd),0!==t}moveCursorLeft(t){0===this.selectionStart&&0===this.selectionEnd||this._moveCursorLeftOrRight("Left",t)}_move(t,e,r){let i;if(t.altKey)i=this["findWordBoundary".concat(r)](this[e]);else{if(!t.metaKey&&35!==t.keyCode&&36!==t.keyCode)return this[e]+="Left"===r?-1:1,!0;i=this["findLineBoundary".concat(r)](this[e])}return void 0!==i&&this[e]!==i&&(this[e]=i,!0)}_moveLeft(t,e){return this._move(t,e,"Left")}_moveRight(t,e){return this._move(t,e,"Right")}moveCursorLeftWithoutShift(t){let e=!0;return this._selectionDirection=tS,this.selectionEnd===this.selectionStart&&0!==this.selectionStart&&(e=this._moveLeft(t,"selectionStart")),this.selectionEnd=this.selectionStart,e}moveCursorLeftWithShift(t){return this._selectionDirection===tO&&this.selectionStart!==this.selectionEnd?this._moveLeft(t,"selectionEnd"):0!==this.selectionStart?(this._selectionDirection=tS,this._moveLeft(t,"selectionStart")):void 0}moveCursorRight(t){this.selectionStart>=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorLeftOrRight("Right",t)}_moveCursorLeftOrRight(t,e){let r="moveCursor".concat(t).concat(e.shiftKey?"WithShift":"WithoutShift");this._currentCursorOpacity=1,this[r](e)&&(this.abortCursorAnimation(),this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea())}moveCursorRightWithShift(t){return this._selectionDirection===tS&&this.selectionStart!==this.selectionEnd?this._moveRight(t,"selectionStart"):this.selectionEnd!==this._text.length?(this._selectionDirection=tO,this._moveRight(t,"selectionEnd")):void 0}moveCursorRightWithoutShift(t){let e=!0;return this._selectionDirection=tO,this.selectionStart===this.selectionEnd?(e=this._moveRight(t,"selectionStart"),this.selectionEnd=this.selectionStart):this.selectionStart=this.selectionEnd,e}}class sz extends sV{initBehavior(){this.on("mousedown",this._mouseDownHandler),this.on("mouseup",this.mouseUpHandler),this.on("mousedblclick",this.doubleClickHandler),this.on("mousetripleclick",this.tripleClickHandler),this.draggableTextDelegate=new sU(this),super.initBehavior()}shouldStartDragging(){return this.draggableTextDelegate.isActive()}onDragStart(t){return this.draggableTextDelegate.onDragStart(t)}canDrop(t){return this.draggableTextDelegate.canDrop(t)}doubleClickHandler(t){this.isEditing&&(this.selectWord(this.getSelectionStartFromPointer(t.e)),this.renderCursorOrSelection())}tripleClickHandler(t){this.isEditing&&(this.selectLine(this.getSelectionStartFromPointer(t.e)),this.renderCursorOrSelection())}_mouseDownHandler(t){let{e:e,alreadySelected:r}=t;this.canvas&&this.editable&&!e.button&&!this.getActiveControl()&&(this.draggableTextDelegate.start(e)||(this.canvas.textEditingManager.register(this),r&&(this.inCompositionMode=!1,this.setCursorByClick(e)),this.isEditing&&(this.__selectionStartOnMouseDown=this.selectionStart,this.selectionStart===this.selectionEnd&&this.abortCursorAnimation(),this.renderCursorOrSelection()),this.selected||(this.selected=r||this.isEditing)))}mouseUpHandler(t){let{e:e,transform:r}=t,i=this.draggableTextDelegate.end(e);if(this.canvas){this.canvas.textEditingManager.unregister(this);let t=this.canvas._activeObject;if(t&&t!==this)return}!this.editable||this.group&&!this.group.interactive||r&&r.actionPerformed||e.button||i||this.selected&&!this.getActiveControl()&&(this.enterEditing(e),this.selectionStart===this.selectionEnd?this.initDelayedCursor(!0):this.renderCursorOrSelection())}setCursorByClick(t){let e=this.getSelectionStartFromPointer(t),r=this.selectionStart,i=this.selectionEnd;t.shiftKey?this.setSelectionStartEndWithShift(r,i,e):(this.selectionStart=e,this.selectionEnd=e),this.isEditing&&(this._fireSelectionChanged(),this._updateTextarea())}getSelectionStartFromPointer(t){let e=this.canvas.getScenePoint(t).transform(ea(this.calcTransformMatrix())).add(new tZ(-this._getLeftOffset(),-this._getTopOffset())),r=0,i=0,n=0;for(let t=0;t0&&(i+=this._textLines[t-1].length+this.missingNewlineOffset(t-1));let s=Math.abs(this._getLineLeftOffset(n)),a=this._textLines[n].length,o=this.__charBounds[n];for(let t=0;t{let r=e.getRetinaScaling();t.setTransform(r,0,0,r,0,0);let i=e.viewportTransform;t.transform(i[0],i[1],i[2],i[3],i[4],i[5])},sZ=te({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,keysMap:{9:sQ,27:sQ,33:sY,34:sG,35:sK,36:sq,37:sq,38:sY,39:sK,40:sG},keysMapRtl:{9:sQ,27:sQ,33:sY,34:sG,35:sq,36:sK,37:sK,38:sY,39:sq,40:sG},ctrlKeysMapDown:{65:"cmdAll"},ctrlKeysMapUp:{67:"copy",88:"cut"}},{_selectionDirection:null,_reSpace:/\s|\r?\n/,inCompositionMode:!1});class s$ extends sz{static getDefaults(){return te(te({},super.getDefaults()),s$.ownDefaults)}get type(){let t=super.type;return"itext"===t?"i-text":t}_set(t,e){return this.isEditing&&this._savedProps&&t in this._savedProps?(this._savedProps[t]=e,this):("canvas"===t&&(this.canvas instanceof se&&this.canvas.textEditingManager.remove(this),e instanceof se&&e.textEditingManager.add(this)),super._set(t,e))}setSelectionStart(t){t=Math.max(t,0),this._updateAndFire("selectionStart",t)}setSelectionEnd(t){t=Math.min(t,this.text.length),this._updateAndFire("selectionEnd",t)}_updateAndFire(t,e){this[t]!==e&&(this._fireSelectionChanged(),this[t]=e),this._updateTextarea()}_fireSelectionChanged(){this.fire("selection:changed"),this.canvas&&this.canvas.fire("text:selection:changed",{target:this})}initDimensions(){this.isEditing&&this.initDelayedCursor(),super.initDimensions()}getSelectionStyles(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.selectionStart||0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selectionEnd,r=arguments.length>2?arguments[2]:void 0;return super.getSelectionStyles(t,e,r)}setSelectionStyles(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selectionStart||0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.selectionEnd;return super.setSelectionStyles(t,e,r)}get2DCursorLocation(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.selectionStart,e=arguments.length>1?arguments[1]:void 0;return super.get2DCursorLocation(t,e)}render(t){super.render(t),this.cursorOffsetCache={},this.renderCursorOrSelection()}toCanvasElement(t){let e=this.isEditing;this.isEditing=!1;let r=super.toCanvasElement(t);return this.isEditing=e,r}renderCursorOrSelection(){if(!this.isEditing||!this.canvas)return;let t=this.clearContextTop(!0);if(!t)return;let e=this._getCursorBoundaries(),r=this.findAncestorsWithClipPath(),i=r.length>0,n,s=t;if(i){sJ(s=(n=t7(t.canvas)).getContext("2d"),this.canvas);let e=this.calcTransformMatrix();s.transform(e[0],e[1],e[2],e[3],e[4],e[5])}if(this.selectionStart!==this.selectionEnd||this.inCompositionMode?this.renderSelection(s,e):this.renderCursor(s,e),i)for(let e of r){let r=e.clipPath,i=t7(t.canvas),n=i.getContext("2d");if(sJ(n,this.canvas),!r.absolutePositioned){let t=e.calcTransformMatrix();n.transform(t[0],t[1],t[2],t[3],t[4],t[5])}r.transform(n),r.drawObject(n,!0,{}),this.drawClipPathOnCache(s,r,i)}i&&(t.setTransform(1,0,0,1,0,0),t.drawImage(n,0,0)),this.canvas.contextTopDirty=!0,t.restore()}findAncestorsWithClipPath(){let t=[],e=this;for(;e;)e.clipPath&&t.push(e),e=e.parent;return t}_getCursorBoundaries(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.selectionStart,e=arguments.length>1?arguments[1]:void 0,r=this._getLeftOffset(),i=this._getTopOffset(),n=this._getCursorBoundariesOffsets(t,e);return{left:r,top:i,leftOffset:n.left,topOffset:n.top}}_getCursorBoundariesOffsets(t,e){return e?this.__getCursorBoundariesOffsets(t):this.cursorOffsetCache&&"top"in this.cursorOffsetCache?this.cursorOffsetCache:this.cursorOffsetCache=this.__getCursorBoundariesOffsets(t)}__getCursorBoundariesOffsets(t){let e=0,r=0,{charIndex:i,lineIndex:n}=this.get2DCursorLocation(t);for(let t=0;t0?r:0)};return"rtl"===this.direction&&(this.textAlign===tO||this.textAlign===ry||this.textAlign===rb?o.left*=-1:this.textAlign===tS||this.textAlign===rx?o.left=s-(r>0?r:0):this.textAlign!==tC&&this.textAlign!==r_||(o.left=s-(r>0?r:0))),o}renderCursorAt(t){this._renderCursor(this.canvas.contextTop,this._getCursorBoundaries(t,!0),t)}renderCursor(t,e){this._renderCursor(t,e,this.selectionStart)}getCursorRenderingData(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.selectionStart,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._getCursorBoundaries(t),r=this.get2DCursorLocation(t),i=r.lineIndex,n=r.charIndex>0?r.charIndex-1:0,s=this.getValueOfPropertyAt(i,n,"fontSize"),a=this.getObjectScaling().x*this.canvas.getZoom(),o=this.cursorWidth/a,l=this.getValueOfPropertyAt(i,n,"deltaY"),h=e.topOffset+(1-this._fontSizeFraction)*this.getHeightOfLine(i)/this.lineHeight-s*(1-this._fontSizeFraction);return{color:this.cursorColor||this.getValueOfPropertyAt(i,n,"fill"),opacity:this._currentCursorOpacity,left:e.left+e.leftOffset-o/2,top:h+e.top+l,width:o,height:s}}_renderCursor(t,e,r){let{color:i,opacity:n,left:s,top:a,width:o,height:l}=this.getCursorRenderingData(r,e);t.fillStyle=i,t.globalAlpha=n,t.fillRect(s,a,o,l)}renderSelection(t,e){let r={selectionStart:this.inCompositionMode?this.hiddenTextarea.selectionStart:this.selectionStart,selectionEnd:this.inCompositionMode?this.hiddenTextarea.selectionEnd:this.selectionEnd};this._renderSelection(t,r,e)}renderDragSourceEffect(){let t=this.draggableTextDelegate.getDragStartSelection();this._renderSelection(this.canvas.contextTop,t,this._getCursorBoundaries(t.selectionStart,!0))}renderDropTargetEffect(t){let e=this.getSelectionStartFromPointer(t);this.renderCursorAt(e)}_renderSelection(t,e,r){let i=e.selectionStart,n=e.selectionEnd,s=this.textAlign.includes(ry),a=this.get2DCursorLocation(i),o=this.get2DCursorLocation(n),l=a.lineIndex,h=o.lineIndex,c=a.charIndex<0?0:a.charIndex,u=o.charIndex<0?0:o.charIndex;for(let e=l;e<=h;e++){let i=this._getLineLeftOffset(e)||0,n=this.getHeightOfLine(e),a=0,o=0,d=0;if(e===l&&(o=this.__charBounds[l][c].left),e>=l&&e1)&&(n/=this.lineHeight);let f=r.left+i+o,g=n,p=0,m=d-o;this.inCompositionMode?(t.fillStyle=this.compositionColor||"black",g=1,p=n):t.fillStyle=this.selectionColor,"rtl"===this.direction&&(this.textAlign===tO||this.textAlign===ry||this.textAlign===rb?f=this.width-f-m:this.textAlign===tS||this.textAlign===rx?f=r.left+i-d:this.textAlign!==tC&&this.textAlign!==r_||(f=r.left+i-d)),t.fillRect(f,r.top+r.topOffset+p,m,g),r.topOffset+=a}}getCurrentCharFontSize(){let t=this._getCurrentCharIndex();return this.getValueOfPropertyAt(t.l,t.c,"fontSize")}getCurrentCharColor(){let t=this._getCurrentCharIndex();return this.getValueOfPropertyAt(t.l,t.c,tH)}_getCurrentCharIndex(){let t=this.get2DCursorLocation(this.selectionStart,!0),e=t.charIndex>0?t.charIndex-1:0;return{l:t.lineIndex,c:e}}dispose(){this.exitEditingImpl(),this.draggableTextDelegate.dispose(),super.dispose()}constructor(t,e){super(t,te(te({},s$.ownDefaults),e)),this.initBehavior()}}$(s$,"ownDefaults",sZ),$(s$,"type","IText"),tY.setClass(s$),tY.setClass(s$,"i-text");class s0 extends s${static getDefaults(){return te(te({},super.getDefaults()),s0.ownDefaults)}static createControls(){return{controls:iB()}}initDimensions(){this.initialized&&(this.isEditing&&this.initDelayedCursor(),this._clearCache(),this.dynamicMinWidth=0,this._styleMap=this._generateStyleMap(this._splitText()),this.dynamicMinWidth>this.width&&this._set("width",this.dynamicMinWidth),this.textAlign.includes(ry)&&this.enlargeSpaces(),this.height=this.calcTextHeight())}_generateStyleMap(t){let e=0,r=0,i=0,n={};for(let s=0;s0?(r=0,i++,e++):!this.splitByGrapheme&&this._reSpaceAndTab.test(t.graphemeText[i])&&s>0&&(r++,i++),n[s]={line:e,offset:r},i+=t.graphemeLines[s].length,r+=t.graphemeLines[s].length;return n}styleHas(t,e){if(this._styleMap&&!this.isWrapping){let t=this._styleMap[e];t&&(e=t.line)}return super.styleHas(t,e)}isEmptyStyles(t){if(!this.styles)return!0;let e,r=0,i=!1,n=this._styleMap[t],s=this._styleMap[t+1];n&&(t=n.line,r=n.offset),s&&(i=s.line===t,e=s.offset);let a=void 0===t?this.styles:{line:this.styles[t]};for(let t in a)for(let n in a[t]){let s=parseInt(n,10);if(s>=r&&(!i||s{let s=0,a=e?this.graphemeSplit(t):this.wordSplit(t);return 0===a.length?[{word:[],width:0}]:a.map(t=>{let a=e?[t]:this.graphemeSplit(t),o=this._measureWord(a,n,s);return i=Math.max(o,i),s+=a.length+r.length,{word:a,width:o}})}),largestWordWidth:i}}_measureWord(t,e){let r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=0;for(let s=0,a=t.length;s3&&void 0!==arguments[3]?arguments[3]:0,o=this._getWidthOfCharSpacing(),l=this.splitByGrapheme,h=[],c=l?"":" ",u=0,d=[],f=0,g=0,p=!0,m=Math.max(e-=a,n,this.dynamicMinWidth),y=s[t];for(f=0,i=0;im&&!p?(h.push(d),d=[],u=r,p=!0):u+=o,p||l||d.push(c),d=d.concat(e),g=l?0:this._measureWord([c],t,f),f++,p=!1}return i&&h.push(d),n+a>this.dynamicMinWidth&&(this.dynamicMinWidth=n-o+a),h}isEndOfWrapping(t){return!this._styleMap[t+1]||this._styleMap[t+1].line!==this._styleMap[t].line}missingNewlineOffset(t,e){return this.splitByGrapheme&&!e?+!!this.isEndOfWrapping(t):1}_splitTextIntoLines(t){let e=super._splitTextIntoLines(t),r=this._wrapText(e.lines,this.width),i=Array(r.length);for(let t=0;t0&&void 0!==arguments[0]?arguments[0]:[];return super.toObject(["minWidth","splitByGrapheme",...t])}constructor(t,e){super(t,te(te({},s0.ownDefaults),e))}}$(s0,"type","Textbox"),$(s0,"textLayoutProperties",[...s$.textLayoutProperties,"width"]),$(s0,"ownDefaults",{minWidth:20,dynamicMinWidth:2,lockScalingFlip:!0,noScaleCache:!1,_wordJoiners:/[ \t\r]/,splitByGrapheme:!1}),tY.setClass(s0);class s1 extends nx{shouldPerformLayout(t){return!!t.target.clipPath&&super.shouldPerformLayout(t)}shouldLayoutClipPath(){return!1}calcLayoutResult(t,e){let{target:r}=t,{clipPath:i,group:n}=r;if(!i||!this.shouldPerformLayout(t))return;let{width:s,height:a}=eX(ny(r,i)),o=new tZ(s,a);if(i.absolutePositioned)return{center:eJ(i.getRelativeCenterPoint(),void 0,n?n.calcTransformMatrix():void 0),size:o};{let n=i.getRelativeCenterPoint().transform(r.calcOwnMatrix(),!0);if(this.shouldPerformLayout(t)){let{center:r=new tZ,correction:i=new tZ}=this.calcBoundingBox(e,t)||{};return{center:r.add(n),correction:i.subtract(n),size:o}}return{center:r.getRelativeCenterPoint().add(n),size:o}}}}$(s1,"type","clip-path"),tY.setClass(s1);class s2 extends nx{getInitialSize(t,e){let{target:r}=t,{size:i}=e;return new tZ(r.width||i.x,r.height||i.y)}}$(s2,"type","fixed"),tY.setClass(s2);class s5 extends nS{subscribeTargets(t){let e=t.target;t.targets.reduce((t,e)=>(e.parent&&t.add(e.parent),t),new Set).forEach(t=>{t.layoutManager.subscribeTargets({target:t,targets:[e]})})}unsubscribeTargets(t){let e=t.target,r=e.getObjects();t.targets.reduce((t,e)=>(e.parent&&t.add(e.parent),t),new Set).forEach(t=>{r.some(e=>e.parent===t)||t.layoutManager.unsubscribeTargets({target:t,targets:[e]})})}}class s4 extends nk{static getDefaults(){return te(te({},super.getDefaults()),s4.ownDefaults)}_shouldSetNestedCoords(){return!0}__objectSelectionMonitor(){}multiSelectAdd(){for(var t=arguments.length,e=Array(t),r=0;r{let e=this._objects.findIndex(e=>e.isInFrontOf(t)),r=-1===e?this.size():e;this.insertAt(r,t)})}canEnterGroup(t){return this.getObjects().some(e=>e.isDescendantOf(t)||t.isDescendantOf(e))?(ta("error","ActiveSelection: circular object trees are not supported, this call has no effect"),!1):super.canEnterGroup(t)}enterGroup(t,e){t.parent&&t.parent===t.group?t.parent._exitGroup(t):t.group&&t.parent!==t.group&&t.group.remove(t),this._enterGroup(t,e)}exitGroup(t,e){this._exitGroup(t,e),t.parent&&t.parent._enterGroup(t,!0)}_onAfterObjectsChange(t,e){super._onAfterObjectsChange(t,e);let r=new Set;e.forEach(t=>{let{parent:e}=t;e&&r.add(e)}),t===nm?r.forEach(t=>{t._onAfterObjectsChange(np,e)}):r.forEach(t=>{t._set("dirty",!0)})}onDeselect(){return this.removeAll(),!1}toString(){return"#")}shouldCache(){return!1}isOnACache(){return!1}_renderControls(t,e,r){t.save(),t.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1;let i=te(te({hasControls:!1},r),{},{forActiveSelection:!0});for(let e=0;e0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),Object.assign(this,s4.ownDefaults),this.setOptions(e);let{left:r,top:i,layoutManager:n}=e;this.groupInit(t,{left:r,top:i,layoutManager:null!=n?n:new s5})}}$(s4,"type","ActiveSelection"),$(s4,"ownDefaults",{multiSelectionStacking:"canvas-stacking"}),tY.setClass(s4),tY.setClass(s4,"activeSelection");class s3{applyFilters(t,e,r,i,n){let s=n.getContext("2d");if(!s)return;s.drawImage(e,0,0,r,i);let a={sourceWidth:r,sourceHeight:i,imageData:s.getImageData(0,0,r,i),originalEl:e,originalImageData:s.getImageData(0,0,r,i),canvasEl:n,ctx:s,filterBackend:this};t.forEach(t=>{t.applyTo(a)});let{imageData:o}=a;return o.width===r&&o.height===i||(n.width=o.width,n.height=o.height),s.putImageData(o,0,0),a}constructor(){$(this,"resources",{})}}class s9{setupGLContext(t,e){this.dispose(),this.createWebGLCanvas(t,e)}createWebGLCanvas(t,e){let r=t7({width:t,height:e}),i=r.getContext("webgl",{alpha:!0,premultipliedAlpha:!1,depth:!1,stencil:!1,antialias:!1});i&&(i.clearColor(0,0,0,0),this.canvas=r,this.gl=i)}applyFilters(t,e,r,i,n,s){let a,o=this.gl,l=n.getContext("2d");if(!o||!l)return;s&&(a=this.getCachedTexture(s,e));let h={originalWidth:e.width||e.naturalWidth||0,originalHeight:e.height||e.naturalHeight||0,sourceWidth:r,sourceHeight:i,destinationWidth:r,destinationHeight:i,context:o,sourceTexture:this.createTexture(o,r,i,a?void 0:e),targetTexture:this.createTexture(o,r,i),originalTexture:a||this.createTexture(o,r,i,a?void 0:e),passes:t.length,webgl:!0,aPosition:this.aPosition,programCache:this.programCache,pass:0,filterBackend:this,targetCanvas:n},c=o.createFramebuffer();return o.bindFramebuffer(o.FRAMEBUFFER,c),t.forEach(t=>{t&&t.applyTo(h)}),function(t){let e=t.targetCanvas,r=e.width,i=e.height,n=t.destinationWidth,s=t.destinationHeight;r===n&&i===s||(e.width=n,e.height=s)}(h),this.copyGLTo2D(o,h),o.bindTexture(o.TEXTURE_2D,null),o.deleteTexture(h.sourceTexture),o.deleteTexture(h.targetTexture),o.deleteFramebuffer(c),l.setTransform(1,0,0,1,0,0),h}dispose(){this.canvas&&(this.canvas=null,this.gl=null),this.clearWebGLCaches()}clearWebGLCaches(){this.programCache={},this.textureCache={}}createTexture(t,e,r,i,n){let{NEAREST:s,TEXTURE_2D:a,RGBA:o,UNSIGNED_BYTE:l,CLAMP_TO_EDGE:h,TEXTURE_MAG_FILTER:c,TEXTURE_MIN_FILTER:u,TEXTURE_WRAP_S:d,TEXTURE_WRAP_T:f}=t,g=t.createTexture();return t.bindTexture(a,g),t.texParameteri(a,c,n||s),t.texParameteri(a,u,n||s),t.texParameteri(a,d,h),t.texParameteri(a,f,h),i?t.texImage2D(a,0,o,o,l,i):t.texImage2D(a,0,o,e,r,0,o,l,null),g}getCachedTexture(t,e,r){let{textureCache:i}=this;if(i[t])return i[t];{let n=this.createTexture(this.gl,e.width,e.height,e,r);return n&&(i[t]=n),n}}evictCachesForKey(t){this.textureCache[t]&&(this.gl.deleteTexture(this.textureCache[t]),delete this.textureCache[t])}copyGLTo2D(t,e){let r=t.canvas,i=e.targetCanvas,n=i.getContext("2d");if(!n)return;n.translate(0,i.height),n.scale(1,-1);let s=r.height-i.height;n.drawImage(r,0,s,i.width,i.height,0,0,i.width,i.height)}copyGLTo2DPutImageData(t,e){let r=e.targetCanvas.getContext("2d"),i=e.destinationWidth,n=e.destinationHeight,s=i*n*4;if(!r)return;let a=new Uint8Array(this.imageBuffer,0,s),o=new Uint8ClampedArray(this.imageBuffer,0,s);t.readPixels(0,0,i,n,t.RGBA,t.UNSIGNED_BYTE,a);let l=new ImageData(o,i,n);r.putImageData(l,0,0)}captureGPUInfo(){if(this.gpuInfo)return this.gpuInfo;let t=this.gl,e={renderer:"",vendor:""};if(!t)return e;let r=t.getExtension("WEBGL_debug_renderer_info");if(r){let i=t.getParameter(r.UNMASKED_RENDERER_WEBGL),n=t.getParameter(r.UNMASKED_VENDOR_WEBGL);i&&(e.renderer=i.toLowerCase()),n&&(e.vendor=n.toLowerCase())}return this.gpuInfo=e,e}constructor(){let{tileSize:t=ts.textureSize}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};$(this,"aPosition",new Float32Array([0,0,0,1,1,0,1,1])),$(this,"resources",{}),this.tileSize=t,this.setupGLContext(t,t),this.captureGPUInfo()}}function s6(){return n||arguments.length>0&&void 0!==arguments[0]&&!arguments[0]||(n=function(){let{WebGLProbe:t}=td();return t.queryWebGL(t6()),ts.enableGLFiltering&&t.isSupported(ts.textureSize)?new s9({tileSize:ts.textureSize}):new s3}()),n}let s8=["filters","resizeFilter","src","crossOrigin","type"],s7=["cropX","cropY"];class at extends iU{static getDefaults(){return te(te({},super.getDefaults()),at.ownDefaults)}getElement(){return this._element}setElement(t){var e;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.removeTexture(this.cacheKey),this.removeTexture("".concat(this.cacheKey,"_filtered")),this._element=t,this._originalElement=t,this._setWidthHeight(r),null==(e=t.classList)||e.add(at.CSS_CANVAS),0!==this.filters.length&&this.applyFilters(),this.resizeFilter&&this.applyResizeFilters()}removeTexture(t){let e=s6(!1);e instanceof s9&&e.evictCachesForKey(t)}dispose(){super.dispose(),this.removeTexture(this.cacheKey),this.removeTexture("".concat(this.cacheKey,"_filtered")),this._cacheContext=null,["_originalElement","_element","_filteredEl","_cacheCanvas"].forEach(t=>{let e=this[t];e&&td().dispose(e),this[t]=void 0})}getCrossOrigin(){return this._originalElement&&(this._originalElement.crossOrigin||null)}getOriginalSize(){let t=this.getElement();return t?{width:t.naturalWidth||t.width,height:t.naturalHeight||t.height}:{width:0,height:0}}_stroke(t){if(!this.stroke||0===this.strokeWidth)return;let e=this.width/2,r=this.height/2;t.beginPath(),t.moveTo(-e,-r),t.lineTo(e,-r),t.lineTo(e,r),t.lineTo(-e,r),t.lineTo(-e,-r),t.closePath()}toObject(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=[];return this.filters.forEach(t=>{t&&e.push(t.toObject())}),te(te({},super.toObject([...s7,...t])),{},{src:this.getSrc(),crossOrigin:this.getCrossOrigin(),filters:e},this.resizeFilter?{resizeFilter:this.resizeFilter.toObject()}:{})}hasCrop(){return!!this.cropX||!!this.cropY||this.width\n',' \n',"\n"),a=' clip-path="url(#imageCrop_'+t+')" '}if(this.imageSmoothing||(o=' image-rendering="optimizeSpeed"'),t.push(" \n")),this.stroke||this.strokeDashArray){let t=this.fill;this.fill=null,s=[' \n')],this.fill=t}return this.paintFirst!==tH?n.concat(s,t):n.concat(t,s)}getSrc(t){let e=t?this._element:this._originalElement;return e?e.toDataURL?e.toDataURL():this.srcFromAttribute?e.getAttribute("src")||"":e.src:this.src||""}getSvgSrc(t){return this.getSrc(t)}setSrc(t){let{crossOrigin:e,signal:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ex(t,{crossOrigin:e,signal:r}).then(t=>{void 0!==e&&this.set({crossOrigin:e}),this.setElement(t)})}toString(){return'#')}applyResizeFilters(){let t=this.resizeFilter,e=this.minimumScaleTrigger,r=this.getTotalObjectScaling(),i=r.x,n=r.y,s=this._filteredEl||this._originalElement;if(this.group&&this.set("dirty",!0),!t||i>e&&n>e)return this._element=s,this._filterScalingX=1,this._filterScalingY=1,this._lastScaleX=i,void(this._lastScaleY=n);let a=t7(s),{width:o,height:l}=s;this._element=a,this._lastScaleX=t.scaleX=i,this._lastScaleY=t.scaleY=n,s6().applyFilters([t],s,o,l,this._element),this._filterScalingX=a.width/this._originalElement.width,this._filterScalingY=a.height/this._originalElement.height}applyFilters(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.filters||[];if(t=t.filter(t=>t&&!t.isNeutralState()),this.set("dirty",!0),this.removeTexture("".concat(this.cacheKey,"_filtered")),0===t.length)return this._element=this._originalElement,this._filteredEl=void 0,this._filterScalingX=1,void(this._filterScalingY=1);let e=this._originalElement,r=e.naturalWidth||e.width,i=e.naturalHeight||e.height;if(this._element===this._originalElement){let t=t7({width:r,height:i});this._element=t,this._filteredEl=t}else this._filteredEl&&(this._element=this._filteredEl,this._filteredEl.getContext("2d").clearRect(0,0,r,i),this._lastScaleX=1,this._lastScaleY=1);s6().applyFilters(t,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)}_render(t){t.imageSmoothingEnabled=this.imageSmoothing,!0!==this.isMoving&&this.resizeFilter&&this._needsResize()&&this.applyResizeFilters(),this._stroke(t),this._renderPaintInOrder(t)}drawCacheOnCanvas(t){t.imageSmoothingEnabled=this.imageSmoothing,super.drawCacheOnCanvas(t)}shouldCache(){return this.needsItsOwnCache()}_renderFill(t){let e=this._element;if(!e)return;let r=this._filterScalingX,i=this._filterScalingY,n=this.width,s=this.height,a=Math.max(this.cropX,0),o=Math.max(this.cropY,0),l=e.naturalWidth||e.width,h=e.naturalHeight||e.height,c=a*r,u=o*i,d=Math.min(n*r,l-c),f=Math.min(s*i,h-u),g=Math.min(n,l/r-a),p=Math.min(s,h/i-o);e&&t.drawImage(e,c,u,d,f,-n/2,-s/2,g,p)}_needsResize(){let t=this.getTotalObjectScaling();return t.x!==this._lastScaleX||t.y!==this._lastScaleY}_resetWidthHeight(){this.set(this.getOriginalSize())}_setWidthHeight(){let{width:t,height:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=this.getOriginalSize();this.width=t||r.width,this.height=e||r.height}parsePreserveAspectRatioAttribute(){let t=rl(this.preserveAspectRatio||""),e=this.width,r=this.height,i={width:e,height:r},n,s=this._element.width,a=this._element.height,o=1,l=1,h=0,c=0,u=0,d=0;return t&&(t.alignX!==tk||t.alignY!==tk)?("meet"===t.meetOrSlice&&(n=(e-s*(o=l=nM(this._element,i)))/2,"Min"===t.alignX&&(h=-n),"Max"===t.alignX&&(h=n),n=(r-a*l)/2,"Min"===t.alignY&&(c=-n),"Max"===t.alignY&&(c=n)),"slice"===t.meetOrSlice&&(n=s-e/(o=l=nE(this._element,i)),"Mid"===t.alignX&&(u=n/2),"Max"===t.alignX&&(u=n),n=a-r/l,"Mid"===t.alignY&&(d=n/2),"Max"===t.alignY&&(d=n),s=e/o,a=r/l)):(o=e/s,l=r/a),{width:s,height:a,scaleX:o,scaleY:l,offsetLeft:h,offsetTop:c,cropX:u,cropY:d}}static fromObject(t,e){let{filters:r,resizeFilter:i,src:n,crossOrigin:s,type:a}=t,o=tr(t,s8);return Promise.all([ex(n,te(te({},e),{},{crossOrigin:s})),r&&eb(r,e),i&&eb([i],e),e_(o,e)]).then(t=>{let[e,r=[],[i]=[],s={}]=t;return new this(e,te(te({},o),{},{src:n,filters:r,resizeFilter:i},s))})}static fromURL(t){let{crossOrigin:e=null,signal:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;return ex(t,{crossOrigin:e,signal:r}).then(t=>new this(t,i))}static async fromElement(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0,i=nc(t,this.ATTRIBUTE_NAMES,r);return this.fromURL(i["xlink:href"]||i.href,e,i).catch(t=>(ta("log","Unable to parse Image",t),null))}constructor(t,e){super(),$(this,"_lastScaleX",1),$(this,"_lastScaleY",1),$(this,"_filterScalingX",1),$(this,"_filterScalingY",1),this.filters=[],Object.assign(this,at.ownDefaults),this.setOptions(e),this.cacheKey="texture".concat(t9()),this.setElement("string"==typeof t?(this.canvas&&ej(this.canvas.getElement())||tf()).getElementById(t):t,e)}}$(at,"type","Image"),$(at,"cacheProperties",[...rY,...s7]),$(at,"ownDefaults",{strokeWidth:0,srcFromAttribute:!1,minimumScaleTrigger:.5,cropX:0,cropY:0,imageSmoothing:!0}),$(at,"CSS_CANVAS","canvas-img"),$(at,"ATTRIBUTE_NAMES",[...i5,"x","y","width","height","preserveAspectRatio","xlink:href","href","crossOrigin","image-rendering"]),tY.setClass(at),tY.setSVGClass(at),ru(["pattern","defs","symbol","metadata","clipPath","mask","desc"]);let ae=t=>function(e,r,i){let{points:n,pathOffset:s}=i;return new tZ(n[t]).subtract(s).transform(eo(i.getViewportTransform(),i.calcTransformMatrix()))},ar=(t,e,r,i)=>{let{target:n,pointIndex:s}=e,a=eJ(new tZ(r,i),void 0,n.calcOwnMatrix());return n.points[s]=a.add(n.pathOffset),n.setDimensions(),n.set("dirty",!0),!0},ai=(t,e)=>function(r,i,n,s){let a=i.target,o=new tZ(a.points[(t>0?t:a.points.length)-1]),l=o.subtract(a.pathOffset).transform(a.calcOwnMatrix()),h=e(r,te(te({},i),{},{pointIndex:t}),n,s),c=o.subtract(a.pathOffset).transform(a.calcOwnMatrix()).subtract(l);return a.left-=c.x,a.top-=c.y,h},an=t=>io(tL,ai(t,ar)),as=(t,e,r)=>{let{path:i,pathOffset:n}=t,s=i[e];return new tZ(s[r]-n.x,s[r+1]-n.y).transform(eo(t.getViewportTransform(),t.calcTransformMatrix()))};function aa(t,e,r){let{commandIndex:i,pointIndex:n}=this;return as(r,i,n)}function ao(t,e,r,i){let{target:n}=e,{commandIndex:s,pointIndex:a}=this,o=((t,e,r,i,n)=>{let{path:s,pathOffset:a}=t,o=s[(i>0?i:s.length)-1],l=new tZ(o[n],o[n+1]),h=l.subtract(a).transform(t.calcOwnMatrix()),c=eJ(new tZ(e,r),void 0,t.calcOwnMatrix());s[i][n]=c.x+a.x,s[i][n+1]=c.y+a.y,t.setDimensions();let u=l.subtract(t.pathOffset).transform(t.calcOwnMatrix()).subtract(h);return t.left-=u.x,t.top-=u.y,t.set("dirty",!0),!0})(n,r,i,s,a);return e0(this.actionName,te(te({},e9(t,e,r,i)),{},{commandIndex:s,pointIndex:a})),o}class al extends id{render(t,e,r,i,n){let s=te(te({},i),{},{cornerColor:this.controlFill,cornerStrokeColor:this.controlStroke,transparentCorners:!this.controlFill});super.render(t,e,r,s,n)}constructor(t){super(t)}}class ah extends al{render(t,e,r,i,n){let{path:s}=n,{commandIndex:a,pointIndex:o,connectToCommandIndex:l,connectToPointIndex:h}=this;t.save(),t.strokeStyle=this.controlStroke,this.connectionDashArray&&t.setLineDash(this.connectionDashArray);let[c]=s[a],u=as(n,l,h);if("Q"===c){let i=as(n,a,o+2);t.moveTo(i.x,i.y),t.lineTo(e,r)}else t.moveTo(e,r);t.lineTo(u.x,u.y),t.stroke(),t.restore(),super.render(t,e,r,i,n)}constructor(t){super(t)}}let ac=(t,e,r,i,n,s)=>new(r?ah:al)(te(te({commandIndex:t,pointIndex:e,actionName:"modifyPath",positionHandler:aa,actionHandler:ao,connectToCommandIndex:n,connectToPointIndex:s},i),r?i.controlPointStyle:i.pointStyle));Object.freeze({__proto__:null,changeWidth:ih,createObjectDefaultControls:iR,createPathControls:function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={},i="M";return t.path.forEach((t,n)=>{let s=t[0];switch("Z"!==s&&(r["c_".concat(n,"_").concat(s)]=ac(n,t.length-2,!1,e)),s){case"C":let a;r["c_".concat(n,"_C_CP_1")]=ac(n,1,!0,e,n-1,"C"===(a=i)?5:"Q"===a?3:1),r["c_".concat(n,"_C_CP_2")]=ac(n,3,!0,e,n,5);break;case"Q":r["c_".concat(n,"_Q_CP_1")]=ac(n,1,!0,e,n,3)}i=s}),r},createPolyActionHandler:an,createPolyControls:function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={};for(let i=0;i<("number"==typeof t?t:t.points.length);i++)r["p".concat(i)]=new id(te({actionName:tL,positionHandler:ae(i),actionHandler:an(i)},e));return r},createPolyPositionHandler:ae,createResizeControls:iI,createTextboxDefaultControls:iB,dragHandler:e7,factoryPolyActionHandler:ai,getLocalPoint:e8,polyActionHandler:ar,renderCircleControl:ic,renderSquareControl:iu,rotationStyleHandler:ig,rotationWithSnapping:ip,scaleCursorStyleHandler:ix,scaleOrSkewActionName:iA,scaleSkewCursorStyleHandler:iP,scalingEqually:i_,scalingX:iw,scalingXOrSkewingY:iF,scalingY:iC,scalingYOrSkewingX:iL,skewCursorStyleHandler:ik,skewHandlerX:iE,skewHandlerY:iD,wrapWithFireEvent:io,wrapWithFixedAnchor:il});let au="precision highp float",ad="\n ".concat(au,";\n varying vec2 vTexCoord;\n uniform sampler2D uTexture;\n void main() {\n gl_FragColor = texture2D(uTexture, vTexCoord);\n }"),af=["type"],ag=["type"],ap=RegExp(au,"g");class am{get type(){return this.constructor.type}getFragmentSource(){return ad}getVertexSource(){return"\n attribute vec2 aPosition;\n varying vec2 vTexCoord;\n void main() {\n vTexCoord = aPosition;\n gl_Position = vec4(aPosition * 2.0 - 1.0, 0.0, 1.0);\n }"}createProgram(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getFragmentSource(),r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.getVertexSource(),{WebGLProbe:{GLPrecision:i="highp"}}=td();"highp"!==i&&(e=e.replace(ap,au.replace("highp",i)));let n=t.createShader(t.VERTEX_SHADER),s=t.createShader(t.FRAGMENT_SHADER),a=t.createProgram();if(!n||!s||!a)throw new to("Vertex, fragment shader or program creation error");if(t.shaderSource(n,r),t.compileShader(n),!t.getShaderParameter(n,t.COMPILE_STATUS))throw new to("Vertex shader compile error for ".concat(this.type,": ").concat(t.getShaderInfoLog(n)));if(t.shaderSource(s,e),t.compileShader(s),!t.getShaderParameter(s,t.COMPILE_STATUS))throw new to("Fragment shader compile error for ".concat(this.type,": ").concat(t.getShaderInfoLog(s)));if(t.attachShader(a,n),t.attachShader(a,s),t.linkProgram(a),!t.getProgramParameter(a,t.LINK_STATUS))throw new to('Shader link error for "'.concat(this.type,'" ').concat(t.getProgramInfoLog(a)));let o=this.getUniformLocations(t,a)||{};return o.uStepW=t.getUniformLocation(a,"uStepW"),o.uStepH=t.getUniformLocation(a,"uStepH"),{program:a,attributeLocations:this.getAttributeLocations(t,a),uniformLocations:o}}getAttributeLocations(t,e){return{aPosition:t.getAttribLocation(e,"aPosition")}}getUniformLocations(t,e){let r=this.constructor.uniformLocations,i={};for(let n=0;n1){let r=t.destinationWidth,i=t.destinationHeight;t.sourceWidth===r&&t.sourceHeight===i||(e.deleteTexture(t.targetTexture),t.targetTexture=t.filterBackend.createTexture(e,r,i)),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t.targetTexture,0)}else e.bindFramebuffer(e.FRAMEBUFFER,null),e.finish()}_swapTextures(t){t.passes--,t.pass++;let e=t.targetTexture;t.targetTexture=t.sourceTexture,t.sourceTexture=e}isNeutralState(t){return!1}applyTo(t){void 0!==t.webgl?(this._setupFrameBuffer(t),this.applyToWebGL(t),this._swapTextures(t)):this.applyTo2d(t)}applyTo2d(t){}getCacheKey(){return this.type}retrieveShader(t){let e=this.getCacheKey();return t.programCache[e]||(t.programCache[e]=this.createProgram(t.context)),t.programCache[e]}applyToWebGL(t){let e=t.context,r=this.retrieveShader(t);0===t.pass&&t.originalTexture?e.bindTexture(e.TEXTURE_2D,t.originalTexture):e.bindTexture(e.TEXTURE_2D,t.sourceTexture),e.useProgram(r.program),this.sendAttributeData(e,r.attributeLocations,t.aPosition),e.uniform1f(r.uniformLocations.uStepW,1/t.sourceWidth),e.uniform1f(r.uniformLocations.uStepH,1/t.sourceHeight),this.sendUniformData(e,r.uniformLocations),e.viewport(0,0,t.destinationWidth,t.destinationHeight),e.drawArrays(e.TRIANGLE_STRIP,0,4)}bindAdditionalTexture(t,e,r){t.activeTexture(r),t.bindTexture(t.TEXTURE_2D,e),t.activeTexture(t.TEXTURE0)}unbindAdditionalTexture(t,e){t.activeTexture(e),t.bindTexture(t.TEXTURE_2D,null),t.activeTexture(t.TEXTURE0)}sendUniformData(t,e){}createHelpLayer(t){if(!t.helpLayer){let{sourceWidth:e,sourceHeight:r}=t;t.helpLayer=t7({width:e,height:r})}}toObject(){let t=Object.keys(this.constructor.defaults||{});return te({type:this.type},t.reduce((t,e)=>(t[e]=this[e],t),{}))}toJSON(){return this.toObject()}static async fromObject(t,e){return new this(tr(t,ag))}constructor(){let t=tr(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},af);Object.assign(this,this.constructor.defaults,t)}}$(am,"type","BaseFilter"),$(am,"uniformLocations",[]);let av={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",difference:"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:"\n if (uColor.r < 0.5) {\n gl_FragColor.r *= 2.0 * uColor.r;\n } else {\n gl_FragColor.r = 1.0 - 2.0 * (1.0 - gl_FragColor.r) * (1.0 - uColor.r);\n }\n if (uColor.g < 0.5) {\n gl_FragColor.g *= 2.0 * uColor.g;\n } else {\n gl_FragColor.g = 1.0 - 2.0 * (1.0 - gl_FragColor.g) * (1.0 - uColor.g);\n }\n if (uColor.b < 0.5) {\n gl_FragColor.b *= 2.0 * uColor.b;\n } else {\n gl_FragColor.b = 1.0 - 2.0 * (1.0 - gl_FragColor.b) * (1.0 - uColor.b);\n }\n ",tint:"\n gl_FragColor.rgb *= (1.0 - uColor.a);\n gl_FragColor.rgb += uColor.rgb;\n "};class ay extends am{getCacheKey(){return"".concat(this.type,"_").concat(this.mode)}getFragmentSource(){return"\n precision highp float;\n uniform sampler2D uTexture;\n uniform vec4 uColor;\n varying vec2 vTexCoord;\n void main() {\n vec4 color = texture2D(uTexture, vTexCoord);\n gl_FragColor = color;\n if (color.a > 0.0) {\n ".concat(av[this.mode],"\n }\n }\n ")}applyTo2d(t){let{imageData:{data:e}}=t,r=new ra(this.color).getSource(),i=this.alpha,n=r[0]*i,s=r[1]*i,a=r[2]*i,o=1-i;for(let t=0;tnew this(te(te({},n),{},{image:t})))}}$(a_,"type","BlendImage"),$(a_,"defaults",{mode:"multiply",alpha:1}),$(a_,"uniformLocations",["uTransformMatrix","uImage"]),tY.setClass(a_);class aw extends am{getFragmentSource(){return"\n precision highp float;\n uniform sampler2D uTexture;\n uniform vec2 uDelta;\n varying vec2 vTexCoord;\n const float nSamples = 15.0;\n vec3 v3offset = vec3(12.9898, 78.233, 151.7182);\n float random(vec3 scale) {\n /* use the fragment position for a different seed per-pixel */\n return fract(sin(dot(gl_FragCoord.xyz, scale)) * 43758.5453);\n }\n void main() {\n vec4 color = vec4(0.0);\n float totalC = 0.0;\n float totalA = 0.0;\n float offset = random(v3offset);\n for (float t = -nSamples; t <= nSamples; t++) {\n float percent = (t + offset - 0.5) / nSamples;\n vec4 sample = texture2D(uTexture, vTexCoord + uDelta * percent);\n float weight = 1.0 - abs(percent);\n float alpha = weight * sample.a;\n color.rgb += sample.rgb * alpha;\n color.a += alpha;\n totalA += weight;\n totalC += alpha;\n }\n gl_FragColor.rgb = color.rgb / totalC;\n gl_FragColor.a = color.a / totalA;\n }\n "}applyTo(t){void 0!==t.webgl?(this.aspectRatio=t.sourceWidth/t.sourceHeight,t.passes++,this._setupFrameBuffer(t),this.horizontal=!0,this.applyToWebGL(t),this._swapTextures(t),this._setupFrameBuffer(t),this.horizontal=!1,this.applyToWebGL(t),this._swapTextures(t)):this.applyTo2d(t)}applyTo2d(t){let{imageData:{data:e,width:r,height:i}}=t;this.aspectRatio=r/i,this.horizontal=!0;let n=this.getBlurValue()*r,s=new Uint8ClampedArray(e),a=4*r;for(let t=0;tu&&(g=u);let p=e[g+3]*f;r+=e[g]*p,i+=e[g+1]*p,o+=e[g+2]*p,l+=p,h+=f}s[t]=r/l,s[t+1]=i/l,s[t+2]=o/l,s[t+3]=l/h}this.horizontal=!1,n=this.getBlurValue()*i;for(let t=0;tu&&(p=u);let m=s[p+3]*g;r+=s[p]*m,i+=s[p+1]*m,o+=s[p+2]*m,l+=m,h+=g}e[t]=r/l,e[t+1]=i/l,e[t+2]=o/l,e[t+3]=l/h}}sendUniformData(t,e){let r=this.chooseRightDelta();t.uniform2fv(e.uDelta,r)}isNeutralState(){return 0===this.blur}getBlurValue(){let t=1,{horizontal:e,aspectRatio:r}=this;return e?r>1&&(t=1/r):r<1&&(t=r),t*this.blur*.12}chooseRightDelta(){let t=this.getBlurValue();return this.horizontal?[t,0]:[0,t]}}$(aw,"type","Blur"),$(aw,"defaults",{blur:0}),$(aw,"uniformLocations",["uDelta"]),tY.setClass(aw);class aC extends am{getFragmentSource(){return"\n precision highp float;\n uniform sampler2D uTexture;\n uniform float uBrightness;\n varying vec2 vTexCoord;\n void main() {\n vec4 color = texture2D(uTexture, vTexCoord);\n color.rgb += uBrightness;\n gl_FragColor = color;\n }\n"}applyTo2d(t){let{imageData:{data:e}}=t,r=Math.round(255*this.brightness);for(let t=0;t{e.applyTo(t)})}toObject(){return{type:this.type,subFilters:this.subFilters.map(t=>t.toObject())}}isNeutralState(){return!this.subFilters.some(t=>!t.isNeutralState())}static fromObject(t,e){return Promise.all((t.subFilters||[]).map(t=>tY.getClass(t.type).fromObject(t,e))).then(t=>new this({subFilters:t}))}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(t),this.subFilters=t.subFilters||[]}}$(aF,"type","Composed"),tY.setClass(aF);class aL extends am{getFragmentSource(){return"\n precision highp float;\n uniform sampler2D uTexture;\n uniform float uContrast;\n varying vec2 vTexCoord;\n void main() {\n vec4 color = texture2D(uTexture, vTexCoord);\n float contrastF = 1.015 * (uContrast + 1.0) / (1.0 * (1.015 - uContrast));\n color.rgb = contrastF * (color.rgb - 0.5) + 0.5;\n gl_FragColor = color;\n }"}isNeutralState(){return 0===this.contrast}applyTo2d(t){let{imageData:{data:e}}=t,r=Math.floor(255*this.contrast),i=259*(r+255)/(255*(259-r));for(let t=0;t=_||a<0||a>=b||(l=4*(o*b+a),h=m[f*y+d],e+=p[l]*h,r+=p[l+1]*h,i+=p[l+2]*h,S||(n+=p[l+3]*h));C[s]=e,C[s+1]=r,C[s+2]=i,C[s+3]=S?p[s+3]:n}t.imageData=w}sendUniformData(t,e){t.uniform1fv(e.uMatrix,this.matrix)}toObject(){return te(te({},super.toObject()),{},{opaque:this.opaque,matrix:[...this.matrix]})}}$(aI,"type","Convolute"),$(aI,"defaults",{opaque:!1,matrix:[0,0,0,0,1,0,0,0,0]}),$(aI,"uniformLocations",["uMatrix","uOpaque","uHalfSize","uSize"]),tY.setClass(aI);let aB="Gamma";class aN extends am{getFragmentSource(){return"\n precision highp float;\n uniform sampler2D uTexture;\n uniform vec3 uGamma;\n varying vec2 vTexCoord;\n void main() {\n vec4 color = texture2D(uTexture, vTexCoord);\n vec3 correction = (1.0 / uGamma);\n color.r = pow(color.r, correction.r);\n color.g = pow(color.g, correction.g);\n color.b = pow(color.b, correction.b);\n gl_FragColor = color;\n gl_FragColor.rgb *= color.a;\n }\n"}applyTo2d(t){let{imageData:{data:e}}=t,r=this.gamma,i=1/r[0],n=1/r[1],s=1/r[2];this.rgbValues||(this.rgbValues={r:new Uint8Array(256),g:new Uint8Array(256),b:new Uint8Array(256)});let a=this.rgbValues;for(let t=0;t<256;t++)a.r[t]=255*Math.pow(t/255,i),a.g[t]=255*Math.pow(t/255,n),a.b[t]=255*Math.pow(t/255,s);for(let t=0;t0&&void 0!==arguments[0]?arguments[0]:{};super(t),this.gamma=t.gamma||this.constructor.defaults.gamma.concat()}}$(aN,"type",aB),$(aN,"defaults",{gamma:[1,1,1]}),$(aN,"uniformLocations",["uGamma"]),tY.setClass(aN);let aW={average:"\n precision highp float;\n uniform sampler2D uTexture;\n varying vec2 vTexCoord;\n void main() {\n vec4 color = texture2D(uTexture, vTexCoord);\n float average = (color.r + color.b + color.g) / 3.0;\n gl_FragColor = vec4(average, average, average, color.a);\n }\n ",lightness:"\n precision highp float;\n uniform sampler2D uTexture;\n uniform int uMode;\n varying vec2 vTexCoord;\n void main() {\n vec4 col = texture2D(uTexture, vTexCoord);\n float average = (max(max(col.r, col.g),col.b) + min(min(col.r, col.g),col.b)) / 2.0;\n gl_FragColor = vec4(average, average, average, col.a);\n }\n ",luminosity:"\n precision highp float;\n uniform sampler2D uTexture;\n uniform int uMode;\n varying vec2 vTexCoord;\n void main() {\n vec4 col = texture2D(uTexture, vTexCoord);\n float average = 0.21 * col.r + 0.72 * col.g + 0.07 * col.b;\n gl_FragColor = vec4(average, average, average, col.a);\n }\n "};class aU extends am{applyTo2d(t){let{imageData:{data:e}}=t;for(let t,r=0;rn[0]&&i>n[1]&&a>n[2]&&r"\n color += texture2D(uTexture, vTexCoord + ".concat(t,") * uTaps[").concat(e,"] + texture2D(uTexture, vTexCoord - ").concat(t,") * uTaps[").concat(e,"];\n sum += 2.0 * uTaps[").concat(e,"];\n ")).join("\n"),"\n gl_FragColor = color / sum;\n }\n ")}applyToForWebgl(t){t.passes++,this.width=t.sourceWidth,this.horizontal=!0,this.dW=Math.round(this.width*this.scaleX),this.dH=t.sourceHeight,this.tempScale=this.dW/this.width,this.taps=this.getTaps(),t.destinationWidth=this.dW,super.applyTo(t),t.sourceWidth=t.destinationWidth,this.height=t.sourceHeight,this.horizontal=!1,this.dH=Math.round(this.height*this.scaleY),this.tempScale=this.dH/this.height,this.taps=this.getTaps(),t.destinationHeight=this.dH,super.applyTo(t),t.sourceHeight=t.destinationHeight}applyTo(t){void 0!==t.webgl?this.applyToForWebgl(t):this.applyTo2d(t)}isNeutralState(){return 1===this.scaleX&&1===this.scaleY}lanczosCreate(t){return e=>{if(e>=t||e<=-t)return 0;if(e<11920929e-14&&e>-11920929e-14)return 1;let r=(e*=Math.PI)/t;return Math.sin(e)/e*Math.sin(r)/r}}applyTo2d(t){let e,r=t.imageData,i=this.scaleX,n=this.scaleY;this.rcpScaleX=1/i,this.rcpScaleY=1/n;let s=r.width,a=r.height,o=Math.round(s*i),l=Math.round(a*n);e="sliceHack"===this.resizeType?this.sliceByTwo(t,s,a,o,l):"hermite"===this.resizeType?this.hermiteFastResize(t,s,a,o,l):"bilinear"===this.resizeType?this.bilinearFiltering(t,s,a,o,l):"lanczos"===this.resizeType?this.lanczosResize(t,s,a,o,l):new ImageData(o,l),t.imageData=e}sliceByTwo(t,e,r,i,n){let s=t.imageData,a=!1,o=!1,l=.5*e,h=.5*r,c=t.filterBackend.resources,u=0,d=0,f=e,g=0;c.sliceByTwo||(c.sliceByTwo=t6());let p=c.sliceByTwo;(p.width<1.5*e||p.height=e)){p[E=Math.floor(1e3*Math.abs(_-m.x))]||(p[E]={});for(let t=y.y-g;t<=y.y+g;t++)t<0||t>=r||(D=Math.floor(1e3*Math.abs(t-m.y)),p[E][D]||(p[E][D]=l(Math.sqrt(Math.pow(E*u,2)+Math.pow(D*d,2))/1e3)),(w=p[E][D])>0&&(C=4*(t*e+_),S+=w,T+=w*s[C],O+=w*s[C+1],k+=w*s[C+2],M+=w*s[C+3]))}o[C=4*(b*i+x)]=T/S,o[C+1]=O/S,o[C+2]=k/S,o[C+3]=M/S}return++x1&&s<-1||(c=2*s*s*s-3*s*s+1)>0&&(y+=c*h[(r=4*(t+i*e))+3],f+=c,h[r+3]<255&&(c=c*h[r+3]/250),g+=c*h[r],p+=c*h[r+1],m+=c*h[r+2],d+=c)}}u[n]=g/d,u[n+1]=p/d,u[n+2]=m/d,u[n+3]=y/f}return c}}$(aq,"type","Resize"),$(aq,"defaults",{resizeType:"hermite",scaleX:1,scaleY:1,lanczosLobes:3}),$(aq,"uniformLocations",["uDelta","uTaps"]),tY.setClass(aq);class aK extends am{getFragmentSource(){return"\n precision highp float;\n uniform sampler2D uTexture;\n uniform float uSaturation;\n varying vec2 vTexCoord;\n void main() {\n vec4 color = texture2D(uTexture, vTexCoord);\n float rgMax = max(color.r, color.g);\n float rgbMax = max(rgMax, color.b);\n color.r += rgbMax != color.r ? (rgbMax - color.r) * uSaturation : 0.00;\n color.g += rgbMax != color.g ? (rgbMax - color.g) * uSaturation : 0.00;\n color.b += rgbMax != color.b ? (rgbMax - color.b) * uSaturation : 0.00;\n gl_FragColor = color;\n }\n"}applyTo2d(t){let{imageData:{data:e}}=t,r=-this.saturation;for(let t=0;t({x:t,y:t}),a6={left:"right",right:"left",bottom:"top",top:"bottom"},a8={start:"end",end:"start"};function a7(t,e){return"function"==typeof t?t(e):t}function ot(t){return t.split("-")[0]}function oe(t){return t.split("-")[1]}function or(t){return"y"===t?"height":"width"}let oi=new Set(["top","bottom"]);function on(t){return oi.has(ot(t))?"y":"x"}function os(t){return"x"===on(t)?"y":"x"}function oa(t){return t.replace(/start|end/g,t=>a8[t])}let oo=["left","right"],ol=["right","left"],oh=["top","bottom"],oc=["bottom","top"];function ou(t){return t.replace(/left|right|bottom|top/g,t=>a6[t])}function od(t){let{x:e,y:r,width:i,height:n}=t;return{width:i,height:n,top:r,left:e,right:e+i,bottom:r+n,x:e,y:r}}function of(t,e,r){let i,{reference:n,floating:s}=t,a=on(e),o=os(e),l=or(o),h=ot(e),c="y"===a,u=n.x+n.width/2-s.width/2,d=n.y+n.height/2-s.height/2,f=n[l]/2-s[l]/2;switch(h){case"top":i={x:u,y:n.y-s.height};break;case"bottom":i={x:u,y:n.y+n.height};break;case"right":i={x:n.x+n.width,y:d};break;case"left":i={x:n.x-s.width,y:d};break;default:i={x:n.x,y:n.y}}switch(oe(e)){case"start":i[o]-=f*(r&&c?-1:1);break;case"end":i[o]+=f*(r&&c?-1:1)}return i}let og=async(t,e,r)=>{let{placement:i="bottom",strategy:n="absolute",middleware:s=[],platform:a}=r,o=s.filter(Boolean),l=await (null==a.isRTL?void 0:a.isRTL(e)),h=await a.getElementRects({reference:t,floating:e,strategy:n}),{x:c,y:u}=of(h,i,l),d=i,f={},g=0;for(let r=0;r{try{return t.matches(e)}catch(t){return!1}})}let oj=["transform","translate","scale","rotate","perspective"],oA=["transform","translate","scale","rotate","perspective","filter"],oP=["paint","layout","strict","content"];function oF(t){let e=oL(),r=oC(t)?oB(t):t;return oj.some(t=>!!r[t]&&"none"!==r[t])||!!r.containerType&&"normal"!==r.containerType||!e&&!!r.backdropFilter&&"none"!==r.backdropFilter||!e&&!!r.filter&&"none"!==r.filter||oA.some(t=>(r.willChange||"").includes(t))||oP.some(t=>(r.contain||"").includes(t))}function oL(){return"undefined"!=typeof CSS&&!!CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")}let oR=new Set(["html","body","#document"]);function oI(t){return oR.has(ox(t))}function oB(t){return ob(t).getComputedStyle(t)}function oN(t){return oC(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function oW(t){if("html"===ox(t))return t;let e=t.assignedSlot||t.parentNode||oT(t)&&t.host||o_(t);return oT(e)?e.host:e}function oU(t,e,r){var i;void 0===e&&(e=[]),void 0===r&&(r=!0);let n=function t(e){let r=oW(e);return oI(r)?e.ownerDocument?e.ownerDocument.body:e.body:oS(r)&&ok(r)?r:t(r)}(t),s=n===(null==(i=t.ownerDocument)?void 0:i.body),a=ob(n);if(s){let t=oH(a);return e.concat(a,a.visualViewport||[],ok(n)?n:[],t&&r?oU(t):[])}return e.concat(n,oU(n,[],r))}function oH(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function oX(t){let e=oB(t),r=parseFloat(e.width)||0,i=parseFloat(e.height)||0,n=oS(t),s=n?t.offsetWidth:r,a=n?t.offsetHeight:i,o=a4(r)!==s||a4(i)!==a;return o&&(r=s,i=a),{width:r,height:i,$:o}}function oV(t){return oC(t)?t:t.contextElement}function oz(t){let e=oV(t);if(!oS(e))return a9(1);let r=e.getBoundingClientRect(),{width:i,height:n,$:s}=oX(e),a=(s?a4(r.width):r.width)/i,o=(s?a4(r.height):r.height)/n;return a&&Number.isFinite(a)||(a=1),o&&Number.isFinite(o)||(o=1),{x:a,y:o}}let oY=a9(0);function oG(t){let e=ob(t);return oL()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:oY}function oq(t,e,r,i){var n;void 0===e&&(e=!1),void 0===r&&(r=!1);let s=t.getBoundingClientRect(),a=oV(t),o=a9(1);e&&(i?oC(i)&&(o=oz(i)):o=oz(t));let l=(void 0===(n=r)&&(n=!1),i&&(!n||i===ob(a))&&n)?oG(a):a9(0),h=(s.left+l.x)/o.x,c=(s.top+l.y)/o.y,u=s.width/o.x,d=s.height/o.y;if(a){let t=ob(a),e=i&&oC(i)?ob(i):i,r=t,n=oH(r);for(;n&&i&&e!==r;){let t=oz(n),e=n.getBoundingClientRect(),i=oB(n),s=e.left+(n.clientLeft+parseFloat(i.paddingLeft))*t.x,a=e.top+(n.clientTop+parseFloat(i.paddingTop))*t.y;h*=t.x,c*=t.y,u*=t.x,d*=t.y,h+=s,c+=a,n=oH(r=ob(n))}}return od({width:u,height:d,x:h,y:c})}function oK(t,e){let r=oN(t).scrollLeft;return e?e.left+r:oq(o_(t)).left+r}function oQ(t,e){let r=t.getBoundingClientRect();return{x:r.left+e.scrollLeft-oK(t,r),y:r.top+e.scrollTop}}let oJ=new Set(["absolute","fixed"]);function oZ(t,e,r){let i;if("viewport"===e)i=function(t,e){let r=ob(t),i=o_(t),n=r.visualViewport,s=i.clientWidth,a=i.clientHeight,o=0,l=0;if(n){s=n.width,a=n.height;let t=oL();(!t||t&&"fixed"===e)&&(o=n.offsetLeft,l=n.offsetTop)}let h=oK(i);if(h<=0){let t=i.ownerDocument,e=t.body,r=getComputedStyle(e),n="CSS1Compat"===t.compatMode&&parseFloat(r.marginLeft)+parseFloat(r.marginRight)||0,a=Math.abs(i.clientWidth-e.clientWidth-n);a<=25&&(s-=a)}else h<=25&&(s+=h);return{width:s,height:a,x:o,y:l}}(t,r);else if("document"===e)i=function(t){let e=o_(t),r=oN(t),i=t.ownerDocument.body,n=a5(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),s=a5(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight),a=-r.scrollLeft+oK(t),o=-r.scrollTop;return"rtl"===oB(i).direction&&(a+=a5(e.clientWidth,i.clientWidth)-n),{width:n,height:s,x:a,y:o}}(o_(t));else if(oC(e))i=function(t,e){let r=oq(t,!0,"fixed"===e),i=r.top+t.clientTop,n=r.left+t.clientLeft,s=oS(t)?oz(t):a9(1),a=t.clientWidth*s.x,o=t.clientHeight*s.y;return{width:a,height:o,x:n*s.x,y:i*s.y}}(e,r);else{let r=oG(t);i={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return od(i)}function o$(t){return"static"===oB(t).position}function o0(t,e){if(!oS(t)||"fixed"===oB(t).position)return null;if(e)return e(t);let r=t.offsetParent;return o_(t)===r&&(r=r.ownerDocument.body),r}function o1(t,e){var r;let i=ob(t);if(oD(t))return i;if(!oS(t)){let e=oW(t);for(;e&&!oI(e);){if(oC(e)&&!o$(e))return e;e=oW(e)}return i}let n=o0(t,e);for(;n&&(r=n,oM.has(ox(r)))&&o$(n);)n=o0(n,e);return n&&oI(n)&&o$(n)&&!oF(n)?i:n||function(t){let e=oW(t);for(;oS(e)&&!oI(e);){if(oF(e))return e;if(oD(e))break;e=oW(e)}return null}(t)||i}let o2=async function(t){let e=this.getOffsetParent||o1,r=this.getDimensions,i=await r(t.floating);return{reference:function(t,e,r){let i=oS(e),n=o_(e),s="fixed"===r,a=oq(t,!0,s,e),o={scrollLeft:0,scrollTop:0},l=a9(0);if(i||!i&&!s)if(("body"!==ox(e)||ok(n))&&(o=oN(e)),i){let t=oq(e,!0,s,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop}else n&&(l.x=oK(n));s&&!i&&n&&(l.x=oK(n));let h=!n||i||s?a9(0):oQ(n,o);return{x:a.left+o.scrollLeft-l.x-h.x,y:a.top+o.scrollTop-l.y-h.y,width:a.width,height:a.height}}(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}},o5={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:r,offsetParent:i,strategy:n}=t,s="fixed"===n,a=o_(i),o=!!e&&oD(e.floating);if(i===a||o&&s)return r;let l={scrollLeft:0,scrollTop:0},h=a9(1),c=a9(0),u=oS(i);if((u||!u&&!s)&&(("body"!==ox(i)||ok(a))&&(l=oN(i)),oS(i))){let t=oq(i);h=oz(i),c.x=t.x+i.clientLeft,c.y=t.y+i.clientTop}let d=!a||u||s?a9(0):oQ(a,l);return{width:r.width*h.x,height:r.height*h.y,x:r.x*h.x-l.scrollLeft*h.x+c.x+d.x,y:r.y*h.y-l.scrollTop*h.y+c.y+d.y}},getDocumentElement:o_,getClippingRect:function(t){let{element:e,boundary:r,rootBoundary:i,strategy:n}=t,s=[..."clippingAncestors"===r?oD(e)?[]:function(t,e){let r=e.get(t);if(r)return r;let i=oU(t,[],!1).filter(t=>oC(t)&&"body"!==ox(t)),n=null,s="fixed"===oB(t).position,a=s?oW(t):t;for(;oC(a)&&!oI(a);){let e=oB(a),r=oF(a);r||"fixed"!==e.position||(n=null),(s?!r&&!n:!r&&"static"===e.position&&!!n&&oJ.has(n.position)||ok(a)&&!r&&function t(e,r){let i=oW(e);return!(i===r||!oC(i)||oI(i))&&("fixed"===oB(i).position||t(i,r))}(t,a))?i=i.filter(t=>t!==a):n=e,a=oW(a)}return e.set(t,i),i}(e,this._c):[].concat(r),i],a=s[0],o=s.reduce((t,r)=>{let i=oZ(e,r,n);return t.top=a5(i.top,t.top),t.right=a2(i.right,t.right),t.bottom=a2(i.bottom,t.bottom),t.left=a5(i.left,t.left),t},oZ(e,a,n));return{width:o.right-o.left,height:o.bottom-o.top,x:o.left,y:o.top}},getOffsetParent:o1,getElementRects:o2,getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){let{width:e,height:r}=oX(t);return{width:e,height:r}},getScale:oz,isElement:oC,isRTL:function(t){return"rtl"===oB(t).direction}};function o4(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function o3(t,e,r,i){let n;void 0===i&&(i={});let{ancestorScroll:s=!0,ancestorResize:a=!0,elementResize:o="function"==typeof ResizeObserver,layoutShift:l="function"==typeof IntersectionObserver,animationFrame:h=!1}=i,c=oV(t),u=s||a?[...c?oU(c):[],...oU(e)]:[];u.forEach(t=>{s&&t.addEventListener("scroll",r,{passive:!0}),a&&t.addEventListener("resize",r)});let d=c&&l?function(t,e){let r,i=null,n=o_(t);function s(){var t;clearTimeout(r),null==(t=i)||t.disconnect(),i=null}return!function a(o,l){void 0===o&&(o=!1),void 0===l&&(l=1),s();let h=t.getBoundingClientRect(),{left:c,top:u,width:d,height:f}=h;if(o||e(),!d||!f)return;let g=a3(u),p=a3(n.clientWidth-(c+d)),m={rootMargin:-g+"px "+-p+"px "+-a3(n.clientHeight-(u+f))+"px "+-a3(c)+"px",threshold:a5(0,a2(1,l))||1},y=!0;function x(e){let i=e[0].intersectionRatio;if(i!==l){if(!y)return a();i?a(!1,i):r=setTimeout(()=>{a(!1,1e-7)},1e3)}1!==i||o4(h,t.getBoundingClientRect())||a(),y=!1}try{i=new IntersectionObserver(x,{...m,root:n.ownerDocument})}catch(t){i=new IntersectionObserver(x,m)}i.observe(t)}(!0),s}(c,r):null,f=-1,g=null;o&&(g=new ResizeObserver(t=>{let[i]=t;i&&i.target===c&&g&&(g.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var t;null==(t=g)||t.observe(e)})),r()}),c&&!h&&g.observe(c),g.observe(e));let p=h?oq(t):null;return h&&function e(){let i=oq(t);p&&!o4(p,i)&&r(),p=i,n=requestAnimationFrame(e)}(),r(),()=>{var t;u.forEach(t=>{s&&t.removeEventListener("scroll",r),a&&t.removeEventListener("resize",r)}),null==d||d(),null==(t=g)||t.disconnect(),g=null,h&&cancelAnimationFrame(n)}}var o9=t.i(74080),o6="undefined"!=typeof document?Z.useLayoutEffect:function(){};function o8(t,e){let r,i,n;if(t===e)return!0;if(typeof t!=typeof e)return!1;if("function"==typeof t&&t.toString()===e.toString())return!0;if(t&&e&&"object"==typeof t){if(Array.isArray(t)){if((r=t.length)!==e.length)return!1;for(i=r;0!=i--;)if(!o8(t[i],e[i]))return!1;return!0}if((r=(n=Object.keys(t)).length)!==Object.keys(e).length)return!1;for(i=r;0!=i--;)if(!({}).hasOwnProperty.call(e,n[i]))return!1;for(i=r;0!=i--;){let r=n[i];if(("_owner"!==r||!t.$$typeof)&&!o8(t[r],e[r]))return!1}return!0}return t!=t&&e!=e}function o7(t){return"undefined"==typeof window?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function lt(t,e){let r=o7(t);return Math.round(e*r)/r}function le(t){let e=Z.useRef(t);return o6(()=>{e.current=t}),e}let lr=(t,e)=>({...function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var r,i;let{x:n,y:s,placement:a,middlewareData:o}=e,l=await ov(e,t);return a===(null==(r=o.offset)?void 0:r.placement)&&null!=(i=o.arrow)&&i.alignmentOffset?{}:{x:n+l.x,y:s+l.y,data:{...l,placement:a}}}}}(t),options:[t,e]}),li=(t,e)=>({...function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var r,i,n,s,a;let{placement:o,middlewareData:l,rects:h,initialPlacement:c,platform:u,elements:d}=e,{mainAxis:f=!0,crossAxis:g=!0,fallbackPlacements:p,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:x=!0,...b}=a7(t,e);if(null!=(r=l.arrow)&&r.alignmentOffset)return{};let _=ot(o),w=on(c),C=ot(c)===c,S=await (null==u.isRTL?void 0:u.isRTL(d.floating)),T=p||(C||!x?[ou(c)]:function(t){let e=ou(t);return[oa(t),e,oa(e)]}(c)),O="none"!==y;!p&&O&&T.push(...function(t,e,r,i){let n=oe(t),s=function(t,e,r){switch(t){case"top":case"bottom":if(r)return e?ol:oo;return e?oo:ol;case"left":case"right":return e?oh:oc;default:return[]}}(ot(t),"start"===r,i);return n&&(s=s.map(t=>t+"-"+n),e&&(s=s.concat(s.map(oa)))),s}(c,x,y,S));let k=[c,...T],M=await op(e,b),E=[],D=(null==(i=l.flip)?void 0:i.overflows)||[];if(f&&E.push(M[_]),g){let t=function(t,e,r){void 0===r&&(r=!1);let i=oe(t),n=os(t),s=or(n),a="x"===n?i===(r?"end":"start")?"right":"left":"start"===i?"bottom":"top";return e.reference[s]>e.floating[s]&&(a=ou(a)),[a,ou(a)]}(o,h,S);E.push(M[t[0]],M[t[1]])}if(D=[...D,{placement:o,overflows:E}],!E.every(t=>t<=0)){let t=((null==(n=l.flip)?void 0:n.index)||0)+1,e=k[t];if(e&&("alignment"!==g||w===on(e)||D.every(t=>on(t.placement)!==w||t.overflows[0]>0)))return{data:{index:t,overflows:D},reset:{placement:e}};let r=null==(s=D.filter(t=>t.overflows[0]<=0).sort((t,e)=>t.overflows[1]-e.overflows[1])[0])?void 0:s.placement;if(!r)switch(m){case"bestFit":{let t=null==(a=D.filter(t=>{if(O){let e=on(t.placement);return e===w||"y"===e}return!0}).map(t=>[t.placement,t.overflows.filter(t=>t>0).reduce((t,e)=>t+e,0)]).sort((t,e)=>t[1]-e[1])[0])?void 0:a[0];t&&(r=t);break}case"initialPlacement":r=c}if(o!==r)return{reset:{placement:r}}}return{}}}}(t),options:[t,e]});t.i(47167);var ln='input:not([inert]),select:not([inert]),textarea:not([inert]),a[href]:not([inert]),button:not([inert]),[tabindex]:not(slot):not([inert]),audio[controls]:not([inert]),video[controls]:not([inert]),[contenteditable]:not([contenteditable="false"]):not([inert]),details>summary:first-of-type:not([inert]),details:not([inert])',ls="undefined"==typeof Element,la=ls?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,lo=!ls&&Element.prototype.getRootNode?function(t){var e;return null==t||null==(e=t.getRootNode)?void 0:e.call(t)}:function(t){return null==t?void 0:t.ownerDocument},ll=function t(e,r){void 0===r&&(r=!0);var i,n=null==e||null==(i=e.getAttribute)?void 0:i.call(e,"inert");return""===n||"true"===n||r&&e&&t(e.parentNode)},lh=function(t){var e,r=null==t||null==(e=t.getAttribute)?void 0:e.call(t,"contenteditable");return""===r||"true"===r},lc=function(t,e,r){if(ll(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(ln));return e&&la.call(t,ln)&&i.unshift(t),i=i.filter(r)},lu=function t(e,r,i){for(var n=[],s=Array.from(e);s.length;){var a=s.shift();if(!ll(a,!1))if("SLOT"===a.tagName){var o=a.assignedElements(),l=t(o.length?o:a.children,!0,i);i.flatten?n.push.apply(n,l):n.push({scopeParent:a,candidates:l})}else{la.call(a,ln)&&i.filter(a)&&(r||!e.includes(a))&&n.push(a);var h=a.shadowRoot||"function"==typeof i.getShadowRoot&&i.getShadowRoot(a),c=!ll(h,!1)&&(!i.shadowRootFilter||i.shadowRootFilter(a));if(h&&c){var u=t(!0===h?a.children:h.children,!0,i);i.flatten?n.push.apply(n,u):n.push({scopeParent:a,candidates:u})}else s.unshift.apply(s,a.children)}}return n},ld=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},lf=function(t){if(!t)throw Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||lh(t))&&!ld(t)?0:t.tabIndex},lg=function(t,e){var r=lf(t);return r<0&&e&&!ld(t)?0:r},lp=function(t,e){return t.tabIndex===e.tabIndex?t.documentOrder-e.documentOrder:t.tabIndex-e.tabIndex},lm=function(t){return"INPUT"===t.tagName},lv=function(t,e){for(var r=0;rsummary:first-of-type")?t.parentElement:t;if(la.call(n,"details:not([open]) *"))return!0;if(r&&"full"!==r&&"legacy-full"!==r){if("non-zero-area"===r)return l_(t)}else{if("function"==typeof i){for(var s=t;t;){var a=t.parentElement,o=lo(t);if(a&&!a.shadowRoot&&!0===i(a))return l_(t);t=t.assignedSlot?t.assignedSlot:a||o===t.ownerDocument?a:o.host}t=s}if(lb(t))return!t.getClientRects().length;if("legacy-full"!==r)return!0}return!1},lC=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var e=t.parentElement;e;){if("FIELDSET"===e.tagName&&e.disabled){for(var r=0;rlf(e))&&!!lS(t,e)},lO=function(t){var e=parseInt(t.getAttribute("tabindex"),10);return!!isNaN(e)||!!(e>=0)},lk=function t(e){var r=[],i=[];return e.forEach(function(e,n){var s=!!e.scopeParent,a=s?e.scopeParent:e,o=lg(a,s),l=s?t(e.candidates):a;0===o?s?r.push.apply(r,l):r.push(a):i.push({documentOrder:n,tabIndex:o,item:e,isScope:s,content:l})}),i.sort(lp).reduce(function(t,e){return e.isScope?t.push.apply(t,e.content):t.push(e.content),t},[]).concat(r)},lM=function(t,e){return lk((e=e||{}).getShadowRoot?lu([t],e.includeContainer,{filter:lT.bind(null,e),flatten:!1,getShadowRoot:e.getShadowRoot,shadowRootFilter:lO}):lc(t,e.includeContainer,lT.bind(null,e)))},lE=function(t,e){return(e=e||{}).getShadowRoot?lu([t],e.includeContainer,{filter:lS.bind(null,e),flatten:!0,getShadowRoot:e.getShadowRoot}):lc(t,e.includeContainer,lS.bind(null,e))},lD=function(t,e){if(e=e||{},!t)throw Error("No node provided");return!1!==la.call(t,ln)&&lT(e,t)};function lj(){let t=navigator.userAgentData;return t&&Array.isArray(t.brands)?t.brands.map(t=>{let{brand:e,version:r}=t;return e+"/"+r}).join(" "):navigator.userAgent}function lA(){let t=/android/i;return t.test(function(){let t=navigator.userAgentData;return null!=t&&t.platform?t.platform:navigator.platform}())||t.test(lj())}let lP="data-floating-ui-focusable";function lF(t){let e=t.activeElement;for(;(null==(r=e)||null==(r=r.shadowRoot)?void 0:r.activeElement)!=null;){var r;e=e.shadowRoot.activeElement}return e}function lL(t,e){if(!t||!e)return!1;let r=null==e.getRootNode?void 0:e.getRootNode();if(t.contains(e))return!0;if(r&&oT(r)){let r=e;for(;r;){if(t===r)return!0;r=r.parentNode||r.host}}return!1}function lR(t){return"composedPath"in t?t.composedPath()[0]:t.target}function lI(t,e){return null!=e&&("composedPath"in t?t.composedPath().includes(e):null!=t.target&&e.contains(t.target))}function lB(t){return(null==t?void 0:t.ownerDocument)||document}function lN(t){return oS(t)&&t.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}function lW(t){return!!t&&"combobox"===t.getAttribute("role")&&lN(t)}function lU(t){return t?t.hasAttribute(lP)?t:t.querySelector("["+lP+"]")||t:null}function lH(t,e,r){return void 0===r&&(r=!0),t.filter(t=>{var i;return t.parentId===e&&(!r||(null==(i=t.context)?void 0:i.open))}).flatMap(e=>[e,...lH(t,e.id,r)])}function lX(t,e){var r;let i=[],n=null==(r=t.find(t=>t.id===e))?void 0:r.parentId;for(;n;){let e=t.find(t=>t.id===n);n=null==e?void 0:e.parentId,e&&(i=i.concat(e))}return i}function lV(t){t.preventDefault(),t.stopPropagation()}function lz(t,e){let r=["mouse","pen"];return e||r.push("",void 0),r.includes(t)}var lY="undefined"!=typeof document?Z.useLayoutEffect:function(){};function lG(t){let e=Z.useRef(t);return lY(()=>{e.current=t}),e}let lq={...Z}.useInsertionEffect||(t=>t());function lK(t){let e=Z.useRef(()=>{});return lq(()=>{e.current=t}),Z.useCallback(function(){for(var t=arguments.length,r=Array(t),i=0;i({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function lJ(t,e){let r=lM(t,lQ()),i=r.length;if(0===i)return;let n=lF(lB(t)),s=r.indexOf(n);return r[-1===s?1===e?0:i-1:s+e]}function lZ(t,e){let r=e||t.currentTarget,i=t.relatedTarget;return!i||!lL(r,i)}let l$="active",l0="selected",l1={...Z},l2=!1,l5=0,l4=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+l5++,l3=l1.useId||function(){let[t,e]=Z.useState(()=>l2?l4():void 0);return lY(()=>{null==t&&e(l4())},[]),Z.useEffect(()=>{l2=!0},[]),t},l9=Z.createContext(null),l6=Z.createContext(null),l8=()=>{var t;return(null==(t=Z.useContext(l9))?void 0:t.id)||null},l7=()=>Z.useContext(l6);function ht(t){return"data-floating-ui-"+t}let he=0;function hr(t,e){void 0===e&&(e={});let{preventScroll:r=!1,cancelPrevious:i=!0,sync:n=!1}=e;i&&cancelAnimationFrame(he);let s=()=>null==t?void 0:t.focus({preventScroll:r});n?s():he=requestAnimationFrame(s)}let hi={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function hn(t){return"inert"===t?hi.inert:"aria-hidden"===t?hi["aria-hidden"]:hi.none}let hs=new WeakSet,ha={},ho=0,hl=t=>t&&(t.host||hl(t.parentNode));function hh(t,e,r){var i;void 0===e&&(e=!1),void 0===r&&(r=!1);let n=((null==(i=t[0])?void 0:i.ownerDocument)||document).body;return function(t,e,r,i){let n="data-floating-ui-inert",s=i?"inert":r?"aria-hidden":null,a=t.map(t=>{if(e.contains(t))return t;let r=hl(t);return e.contains(r)?r:null}).filter(t=>null!=t),o=new Set,l=new Set(a),h=[];ha[n]||(ha[n]=new WeakMap);let c=ha[n];return a.forEach(function t(e){!(!e||o.has(e))&&(o.add(e),e.parentNode&&t(e.parentNode))}),function t(e){!e||l.has(e)||[].forEach.call(e.children,e=>{if("script"!==ox(e))if(o.has(e))t(e);else{let t=s?e.getAttribute(s):null,r=null!==t&&"false"!==t,i=hn(s),a=(i.get(e)||0)+1,o=(c.get(e)||0)+1;i.set(e,a),c.set(e,o),h.push(e),1===a&&r&&hs.add(e),1===o&&e.setAttribute(n,""),!r&&s&&e.setAttribute(s,"inert"===s?"":"true")}})}(e),o.clear(),ho++,()=>{h.forEach(t=>{let e=hn(s),r=(e.get(t)||0)-1,i=(c.get(t)||0)-1;e.set(t,r),c.set(t,i),r||(!hs.has(t)&&s&&t.removeAttribute(s),hs.delete(t)),i||t.removeAttribute(n)}),--ho||(hi.inert=new WeakMap,hi["aria-hidden"]=new WeakMap,hi.none=new WeakMap,hs=new WeakSet,ha={})}}(t.concat(Array.from(n.querySelectorAll('[aria-live],[role="status"],output'))),n,e,r)}let hc={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},hu=Z.forwardRef(function(t,e){let[r,i]=Z.useState();lY(()=>{/apple/i.test(navigator.vendor)&&i("button")},[]);let n={ref:e,tabIndex:0,role:r,"aria-hidden":!r||void 0,[ht("focus-guard")]:"",style:hc};return(0,J.jsx)("span",{...t,...n})}),hd=Z.createContext(null);function hf(t){return Z.useMemo(()=>e=>{t.forEach(t=>{t&&(t.current=e)})},t)}let hg=[];function hp(){hg=hg.filter(t=>t.isConnected)}function hm(){return hp(),hg[hg.length-1]}function hv(t,e){var r;if(!e.current.includes("floating")&&!(null!=(r=t.getAttribute("role"))&&r.includes("dialog")))return;let i=lQ(),n=lE(t,i).filter(t=>{let e=t.getAttribute("data-tabindex")||"";return lD(t,i)||t.hasAttribute("data-tabindex")&&!e.startsWith("-")}),s=t.getAttribute("tabindex");e.current.includes("floating")||0===n.length?"0"!==s&&t.setAttribute("tabindex","0"):("-1"!==s||t.hasAttribute("data-tabindex")&&"-1"!==t.getAttribute("data-tabindex"))&&(t.setAttribute("tabindex","-1"),t.setAttribute("data-tabindex","-1"))}let hy=Z.forwardRef(function(t,e){return(0,J.jsx)("button",{...t,type:"button",ref:e,tabIndex:-1,style:hc})});function hx(t){let{context:e,children:r,disabled:i=!1,order:n=["content"],guards:s=!0,initialFocus:a=0,returnFocus:o=!0,restoreFocus:l=!1,modal:h=!0,visuallyHiddenDismiss:c=!1,closeOnFocusOut:u=!0,outsideElementsInert:d=!1,getInsideElements:f=()=>[]}=t,{open:g,onOpenChange:p,events:m,dataRef:y,elements:{domReference:x,floating:b}}=e,_=lK(()=>{var t;return null==(t=y.current.floatingContext)?void 0:t.nodeId}),w=lK(f),C="number"==typeof a&&a<0,S=lW(x)&&C,T="undefined"!=typeof HTMLElement&&"inert"in HTMLElement.prototype,O=!T||s,k=!O||T&&d,M=lG(n),E=lG(a),D=lG(o),j=l7(),A=Z.useContext(hd),P=Z.useRef(null),F=Z.useRef(null),L=Z.useRef(!1),R=Z.useRef(!1),I=Z.useRef(-1),B=Z.useRef(-1),N=null!=A,W=lU(b),U=lK(function(t){return void 0===t&&(t=W),t?lM(t,lQ()):[]}),H=lK(t=>{let e=U(t);return M.current.map(t=>x&&"reference"===t?x:W&&"floating"===t?W:e).filter(Boolean).flat()});Z.useEffect(()=>{if(i||!h)return;function t(t){if("Tab"===t.key){lL(W,lF(lB(W)))&&0===U().length&&!S&&lV(t);let e=H(),r=lR(t);"reference"===M.current[0]&&r===x&&(lV(t),t.shiftKey?hr(e[e.length-1]):hr(e[1])),"floating"===M.current[1]&&r===W&&t.shiftKey&&(lV(t),hr(e[0]))}}let e=lB(W);return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}},[i,x,W,h,M,S,U,H]),Z.useEffect(()=>{if(!i&&b)return b.addEventListener("focusin",t),()=>{b.removeEventListener("focusin",t)};function t(t){let e=lR(t),r=U().indexOf(e);-1!==r&&(I.current=r)}},[i,b,U]),Z.useEffect(()=>{if(i||!u)return;function t(){R.current=!0,setTimeout(()=>{R.current=!1})}function e(t){let e=t.relatedTarget,r=t.currentTarget,i=lR(t);queueMicrotask(()=>{let n=_(),s=!(lL(x,e)||lL(b,e)||lL(e,b)||lL(null==A?void 0:A.portalNode,e)||null!=e&&e.hasAttribute(ht("focus-guard"))||j&&(lH(j.nodesRef.current,n).find(t=>{var r,i;return lL(null==(r=t.context)?void 0:r.elements.floating,e)||lL(null==(i=t.context)?void 0:i.elements.domReference,e)})||lX(j.nodesRef.current,n).find(t=>{var r,i,n;return[null==(r=t.context)?void 0:r.elements.floating,lU(null==(i=t.context)?void 0:i.elements.floating)].includes(e)||(null==(n=t.context)?void 0:n.elements.domReference)===e})));if(r===x&&W&&hv(W,M),l&&r!==x&&!(null!=i&&i.isConnected)&&lF(lB(W))===lB(W).body){oS(W)&&W.focus();let t=I.current,e=U(),r=e[t]||e[e.length-1]||W;oS(r)&&r.focus()}if(y.current.insideReactTree){y.current.insideReactTree=!1;return}(S||!h)&&e&&s&&!R.current&&e!==hm()&&(L.current=!0,p(!1,t,"focus-out"))})}let r=!!(!j&&A);function n(){-1!==B.current&&(clearTimeout(B.current),B.current=-1),y.current.insideReactTree=!0,B.current=window.setTimeout(()=>{y.current.insideReactTree=!1})}if(b&&oS(x))return x.addEventListener("focusout",e),x.addEventListener("pointerdown",t),b.addEventListener("focusout",e),r&&b.addEventListener("focusout",n,!0),()=>{x.removeEventListener("focusout",e),x.removeEventListener("pointerdown",t),b.removeEventListener("focusout",e),r&&b.removeEventListener("focusout",n,!0)}},[i,x,b,W,h,j,A,p,u,l,U,S,_,M,y]);let X=Z.useRef(null),V=Z.useRef(null),z=hf([X,null==A?void 0:A.beforeInsideRef]),Y=hf([V,null==A?void 0:A.afterInsideRef]);function G(t){return!i&&c&&h?(0,J.jsx)(hy,{ref:"start"===t?P:F,onClick:t=>p(!1,t.nativeEvent),children:"string"==typeof c?c:"Dismiss"}):null}Z.useEffect(()=>{var t,e;if(i||!b)return;let r=Array.from((null==A||null==(t=A.portalNode)?void 0:t.querySelectorAll("["+ht("portal")+"]"))||[]),n=[b,null==(e=(j?lX(j.nodesRef.current,_()):[]).find(t=>{var e;return lW((null==(e=t.context)?void 0:e.elements.domReference)||null)}))||null==(e=e.context)?void 0:e.elements.domReference,...r,...w(),P.current,F.current,X.current,V.current,null==A?void 0:A.beforeOutsideRef.current,null==A?void 0:A.afterOutsideRef.current,M.current.includes("reference")||S?x:null].filter(t=>null!=t),s=h||S?hh(n,!k,k):hh(n);return()=>{s()}},[i,x,b,h,M,A,S,O,k,j,_,w]),lY(()=>{if(i||!oS(W))return;let t=lF(lB(W));queueMicrotask(()=>{let e=H(W),r=E.current,i=("number"==typeof r?e[r]:r.current)||W,n=lL(W,t);C||n||!g||hr(i,{preventScroll:i===W})})},[i,g,W,C,H,E]),lY(()=>{var t;if(i||!W)return;let e=lB(W);function r(t){let{reason:e,event:r,nested:i}=t;if(["hover","safe-polygon"].includes(e)&&"mouseleave"===r.type&&(L.current=!0),"outside-press"===e)if(i)L.current=!1;else if(0===r.mozInputSource&&r.isTrusted||(lA()&&r.pointerType?"click"===r.type&&1===r.buttons:0===r.detail&&!r.pointerType)||!lj().includes("jsdom/")&&(!lA()&&0===r.width&&0===r.height||lA()&&1===r.width&&1===r.height&&0===r.pressure&&0===r.detail&&"mouse"===r.pointerType||r.width<1&&r.height<1&&0===r.pressure&&0===r.detail&&"touch"===r.pointerType))L.current=!1;else{let t=!1;document.createElement("div").focus({get preventScroll(){return t=!0,!1}}),t?L.current=!1:L.current=!0}}t=lF(e),hp(),t&&"body"!==ox(t)&&(hg.push(t),hg.length>20&&(hg=hg.slice(-20))),m.on("openchange",r);let n=e.createElement("span");return n.setAttribute("tabindex","-1"),n.setAttribute("aria-hidden","true"),Object.assign(n.style,hc),N&&x&&x.insertAdjacentElement("afterend",n),()=>{m.off("openchange",r);let t=lF(e),i=lL(b,t)||j&&lH(j.nodesRef.current,_(),!1).some(e=>{var r;return lL(null==(r=e.context)?void 0:r.elements.floating,t)}),s=function(){if("boolean"==typeof D.current){let t=x||hm();return t&&t.isConnected?t:n}return D.current.current||n}();queueMicrotask(()=>{let r=function(t){let e=lQ();return lD(t,e)?t:lM(t,e)[0]||t}(s);D.current&&!L.current&&oS(r)&&(r===t||t===e.body||i)&&r.focus({preventScroll:!0}),n.remove()})}},[i,b,W,D,y,m,j,N,x,_]),Z.useEffect(()=>(queueMicrotask(()=>{L.current=!1}),()=>{queueMicrotask(hp)}),[i]),lY(()=>{if(!i&&A)return A.setFocusManagerState({modal:h,closeOnFocusOut:u,open:g,onOpenChange:p,domReference:x}),()=>{A.setFocusManagerState(null)}},[i,A,h,g,p,u,x]),lY(()=>{!i&&W&&hv(W,M)},[i,W,M]);let q=!i&&O&&(!h||!S)&&(N||h);return(0,J.jsxs)(J.Fragment,{children:[q&&(0,J.jsx)(hu,{"data-type":"inside",ref:z,onFocus:t=>{var e;if(h){let t=H();hr("reference"===n[0]?t[0]:t[t.length-1])}else if(null!=A&&A.preserveTabOrder&&A.portalNode)if(L.current=!1,lZ(t,A.portalNode)){let t=lJ(lB(x).body,1)||x;null==t||t.focus()}else null==(e=A.beforeOutsideRef.current)||e.focus()}}),!S&&G("start"),r,G("end"),q&&(0,J.jsx)(hu,{"data-type":"inside",ref:Y,onFocus:t=>{var e;if(h)hr(H()[0]);else if(null!=A&&A.preserveTabOrder&&A.portalNode)if(u&&(L.current=!0),lZ(t,A.portalNode)){let t=lJ(lB(x).body,-1)||x;null==t||t.focus()}else null==(e=A.afterOutsideRef.current)||e.focus()}})]})}function hb(t){return oS(t.target)&&"BUTTON"===t.target.tagName}function h_(t,e){void 0===e&&(e={});let{open:r,onOpenChange:i,dataRef:n,elements:{domReference:s}}=t,{enabled:a=!0,event:o="click",toggle:l=!0,ignoreMouse:h=!1,keyboardHandlers:c=!0,stickIfOpen:u=!0}=e,d=Z.useRef(),f=Z.useRef(!1),g=Z.useMemo(()=>({onPointerDown(t){d.current=t.pointerType},onMouseDown(t){let e=d.current;0===t.button&&"click"!==o&&(lz(e,!0)&&h||(r&&l&&(!n.current.openEvent||!u||"mousedown"===n.current.openEvent.type)?i(!1,t.nativeEvent,"click"):(t.preventDefault(),i(!0,t.nativeEvent,"click"))))},onClick(t){let e=d.current;if("mousedown"===o&&d.current){d.current=void 0;return}lz(e,!0)&&h||(r&&l&&(!n.current.openEvent||!u||"click"===n.current.openEvent.type)?i(!1,t.nativeEvent,"click"):i(!0,t.nativeEvent,"click"))},onKeyDown(t){d.current=void 0,!(t.defaultPrevented||!c||hb(t))&&(" "!==t.key||lN(s)||(t.preventDefault(),f.current=!0),oS(t.target)&&"A"===t.target.tagName||"Enter"!==t.key||(r&&l?i(!1,t.nativeEvent,"click"):i(!0,t.nativeEvent,"click")))},onKeyUp(t){!(t.defaultPrevented||!c||hb(t)||lN(s))&&" "===t.key&&f.current&&(f.current=!1,r&&l?i(!1,t.nativeEvent,"click"):i(!0,t.nativeEvent,"click"))}}),[n,s,o,h,c,i,r,u,l]);return Z.useMemo(()=>a?{reference:g}:{},[a,g])}let hw={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},hC={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},hS=t=>{var e,r;return{escapeKey:"boolean"==typeof t?t:null!=(e=null==t?void 0:t.escapeKey)&&e,outsidePress:"boolean"==typeof t?t:null==(r=null==t?void 0:t.outsidePress)||r}};function hT(t,e){void 0===e&&(e={});let{open:r,onOpenChange:i,elements:n,dataRef:s}=t,{enabled:a=!0,escapeKey:o=!0,outsidePress:l=!0,outsidePressEvent:h="pointerdown",referencePress:c=!1,referencePressEvent:u="pointerdown",ancestorScroll:d=!1,bubbles:f,capture:g}=e,p=l7(),m=lK("function"==typeof l?l:()=>!1),y="function"==typeof l?m:l,x=Z.useRef(!1),{escapeKey:b,outsidePress:_}=hS(f),{escapeKey:w,outsidePress:C}=hS(g),S=Z.useRef(!1),T=lK(t=>{var e;if(!r||!a||!o||"Escape"!==t.key||S.current)return;let n=null==(e=s.current.floatingContext)?void 0:e.nodeId,l=p?lH(p.nodesRef.current,n):[];if(!b&&(t.stopPropagation(),l.length>0)){let t=!0;if(l.forEach(e=>{var r;if(null!=(r=e.context)&&r.open&&!e.context.dataRef.current.__escapeKeyBubbles){t=!1;return}}),!t)return}i(!1,"nativeEvent"in t?t.nativeEvent:t,"escape-key")}),O=lK(t=>{var e;let r=()=>{var e;T(t),null==(e=lR(t))||e.removeEventListener("keydown",r)};null==(e=lR(t))||e.addEventListener("keydown",r)}),k=lK(t=>{var e;let r=s.current.insideReactTree;s.current.insideReactTree=!1;let a=x.current;if(x.current=!1,"click"===h&&a||r||"function"==typeof y&&!y(t))return;let o=lR(t),l="["+ht("inert")+"]",c=lB(n.floating).querySelectorAll(l),u=oC(o)?o:null;for(;u&&!oI(u);){let t=oW(u);if(oI(t)||!oC(t))break;u=t}if(c.length&&oC(o)&&!o.matches("html,body")&&!lL(o,n.floating)&&Array.from(c).every(t=>!lL(u,t)))return;if(oS(o)&&D){let e=oI(o),r=oB(o),i=/auto|scroll/,n=e||i.test(r.overflowX),s=e||i.test(r.overflowY),a=n&&o.clientWidth>0&&o.scrollWidth>o.clientWidth,l=s&&o.clientHeight>0&&o.scrollHeight>o.clientHeight,h="rtl"===r.direction,c=l&&(h?t.offsetX<=o.offsetWidth-o.clientWidth:t.offsetX>o.clientWidth),u=a&&t.offsetY>o.clientHeight;if(c||u)return}let d=null==(e=s.current.floatingContext)?void 0:e.nodeId,f=p&&lH(p.nodesRef.current,d).some(e=>{var r;return lI(t,null==(r=e.context)?void 0:r.elements.floating)});if(lI(t,n.floating)||lI(t,n.domReference)||f)return;let g=p?lH(p.nodesRef.current,d):[];if(g.length>0){let t=!0;if(g.forEach(e=>{var r;if(null!=(r=e.context)&&r.open&&!e.context.dataRef.current.__outsidePressBubbles){t=!1;return}}),!t)return}i(!1,t,"outside-press")}),M=lK(t=>{var e;let r=()=>{var e;k(t),null==(e=lR(t))||e.removeEventListener(h,r)};null==(e=lR(t))||e.addEventListener(h,r)});Z.useEffect(()=>{if(!r||!a)return;s.current.__escapeKeyBubbles=b,s.current.__outsidePressBubbles=_;let t=-1;function e(t){i(!1,t,"ancestor-scroll")}function l(){window.clearTimeout(t),S.current=!0}function c(){t=window.setTimeout(()=>{S.current=!1},5*!!oL())}let u=lB(n.floating);o&&(u.addEventListener("keydown",w?O:T,w),u.addEventListener("compositionstart",l),u.addEventListener("compositionend",c)),y&&u.addEventListener(h,C?M:k,C);let f=[];return d&&(oC(n.domReference)&&(f=oU(n.domReference)),oC(n.floating)&&(f=f.concat(oU(n.floating))),!oC(n.reference)&&n.reference&&n.reference.contextElement&&(f=f.concat(oU(n.reference.contextElement)))),(f=f.filter(t=>{var e;return t!==(null==(e=u.defaultView)?void 0:e.visualViewport)})).forEach(t=>{t.addEventListener("scroll",e,{passive:!0})}),()=>{o&&(u.removeEventListener("keydown",w?O:T,w),u.removeEventListener("compositionstart",l),u.removeEventListener("compositionend",c)),y&&u.removeEventListener(h,C?M:k,C),f.forEach(t=>{t.removeEventListener("scroll",e)}),window.clearTimeout(t)}},[s,n,o,y,h,r,i,d,a,b,_,T,w,O,k,C,M]),Z.useEffect(()=>{s.current.insideReactTree=!1},[s,y,h]);let E=Z.useMemo(()=>({onKeyDown:T,...c&&{[hw[u]]:t=>{i(!1,t.nativeEvent,"reference-press")},..."click"!==u&&{onClick(t){i(!1,t.nativeEvent,"reference-press")}}}}),[T,i,c,u]),D=Z.useMemo(()=>({onKeyDown:T,onMouseDown(){x.current=!0},onMouseUp(){x.current=!0},[hC[h]]:()=>{s.current.insideReactTree=!0}}),[T,h,s]);return Z.useMemo(()=>a?{reference:E,floating:D}:{},[a,E,D])}function hO(t){void 0===t&&(t={});let{nodeId:e}=t,r=function(t){let{open:e=!1,onOpenChange:r,elements:i}=t,n=l3(),s=Z.useRef({}),[a]=Z.useState(()=>(function(){let t=new Map;return{emit(e,r){var i;null==(i=t.get(e))||i.forEach(t=>t(r))},on(e,r){t.has(e)||t.set(e,new Set),t.get(e).add(r)},off(e,r){var i;null==(i=t.get(e))||i.delete(r)}}})()),o=null!=l8(),[l,h]=Z.useState(i.reference),c=lK((t,e,i)=>{s.current.openEvent=t?e:void 0,a.emit("openchange",{open:t,event:e,reason:i,nested:o}),null==r||r(t,e,i)}),u=Z.useMemo(()=>({setPositionReference:h}),[]),d=Z.useMemo(()=>({reference:l||i.reference||null,floating:i.floating||null,domReference:i.reference}),[l,i.reference,i.floating]);return Z.useMemo(()=>({dataRef:s,open:e,onOpenChange:c,elements:d,events:a,floatingId:n,refs:u}),[e,c,d,a,n,u])}({...t,elements:{reference:null,floating:null,...t.elements}}),i=t.rootContext||r,n=i.elements,[s,a]=Z.useState(null),[o,l]=Z.useState(null),h=(null==n?void 0:n.domReference)||s,c=Z.useRef(null),u=l7();lY(()=>{h&&(c.current=h)},[h]);let d=function(t){void 0===t&&(t={});let{placement:e="bottom",strategy:r="absolute",middleware:i=[],platform:n,elements:{reference:s,floating:a}={},transform:o=!0,whileElementsMounted:l,open:h}=t,[c,u]=Z.useState({x:0,y:0,strategy:r,placement:e,middlewareData:{},isPositioned:!1}),[d,f]=Z.useState(i);o8(d,i)||f(i);let[g,p]=Z.useState(null),[m,y]=Z.useState(null),x=Z.useCallback(t=>{t!==C.current&&(C.current=t,p(t))},[]),b=Z.useCallback(t=>{t!==S.current&&(S.current=t,y(t))},[]),_=s||g,w=a||m,C=Z.useRef(null),S=Z.useRef(null),T=Z.useRef(c),O=null!=l,k=le(l),M=le(n),E=le(h),D=Z.useCallback(()=>{if(!C.current||!S.current)return;let t={placement:e,strategy:r,middleware:d};M.current&&(t.platform=M.current),((t,e,r)=>{let i=new Map,n={platform:o5,...r},s={...n.platform,_c:i};return og(t,e,{...n,platform:s})})(C.current,S.current,t).then(t=>{let e={...t,isPositioned:!1!==E.current};j.current&&!o8(T.current,e)&&(T.current=e,o9.flushSync(()=>{u(e)}))})},[d,e,r,M,E]);o6(()=>{!1===h&&T.current.isPositioned&&(T.current.isPositioned=!1,u(t=>({...t,isPositioned:!1})))},[h]);let j=Z.useRef(!1);o6(()=>(j.current=!0,()=>{j.current=!1}),[]),o6(()=>{if(_&&(C.current=_),w&&(S.current=w),_&&w){if(k.current)return k.current(_,w,D);D()}},[_,w,D,k,O]);let A=Z.useMemo(()=>({reference:C,floating:S,setReference:x,setFloating:b}),[x,b]),P=Z.useMemo(()=>({reference:_,floating:w}),[_,w]),F=Z.useMemo(()=>{let t={position:r,left:0,top:0};if(!P.floating)return t;let e=lt(P.floating,c.x),i=lt(P.floating,c.y);return o?{...t,transform:"translate("+e+"px, "+i+"px)",...o7(P.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:e,top:i}},[r,o,P.floating,c.x,c.y]);return Z.useMemo(()=>({...c,update:D,refs:A,elements:P,floatingStyles:F}),[c,D,A,P,F])}({...t,elements:{...n,...o&&{reference:o}}}),f=Z.useCallback(t=>{let e=oC(t)?{getBoundingClientRect:()=>t.getBoundingClientRect(),getClientRects:()=>t.getClientRects(),contextElement:t}:t;l(e),d.refs.setReference(e)},[d.refs]),g=Z.useCallback(t=>{(oC(t)||null===t)&&(c.current=t,a(t)),(oC(d.refs.reference.current)||null===d.refs.reference.current||null!==t&&!oC(t))&&d.refs.setReference(t)},[d.refs]),p=Z.useMemo(()=>({...d.refs,setReference:g,setPositionReference:f,domReference:c}),[d.refs,g,f]),m=Z.useMemo(()=>({...d.elements,domReference:h}),[d.elements,h]),y=Z.useMemo(()=>({...d,...i,refs:p,elements:m,nodeId:e}),[d,p,m,e,i]);return lY(()=>{i.dataRef.current.floatingContext=y;let t=null==u?void 0:u.nodesRef.current.find(t=>t.id===e);t&&(t.context=y)}),Z.useMemo(()=>({...d,context:y,refs:p,elements:m}),[d,p,m,y])}function hk(t,e,r){let i=new Map,n="item"===r,s=t;if(n&&t){let{[l$]:e,[l0]:r,...i}=t;s=i}return{..."floating"===r&&{tabIndex:-1,"data-floating-ui-focusable":""},...s,...e.map(e=>{let i=e?e[r]:null;return"function"==typeof i?t?i(t):null:i}).concat(t).reduce((t,e)=>(e&&Object.entries(e).forEach(e=>{let[r,s]=e;if(!(n&&[l$,l0].includes(r)))if(0===r.indexOf("on")){if(i.has(r)||i.set(r,[]),"function"==typeof s){var a;null==(a=i.get(r))||a.push(s),t[r]=function(){for(var t,e=arguments.length,n=Array(e),s=0;st(...n)).find(t=>void 0!==t)}}}else t[r]=s}),t),{})}}function hM(t){void 0===t&&(t=[]);let e=t.map(t=>null==t?void 0:t.reference),r=t.map(t=>null==t?void 0:t.floating),i=t.map(t=>null==t?void 0:t.item),n=Z.useCallback(e=>hk(e,t,"reference"),e),s=Z.useCallback(e=>hk(e,t,"floating"),r),a=Z.useCallback(e=>hk(e,t,"item"),i);return Z.useMemo(()=>({getReferenceProps:n,getFloatingProps:s,getItemProps:a}),[n,s,a])}let hE=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function hD(t,e){var r,i;void 0===e&&(e={});let{open:n,elements:s,floatingId:a}=t,{enabled:o=!0,role:l="dialog"}=e,h=l3(),c=(null==(r=s.domReference)?void 0:r.id)||h,u=Z.useMemo(()=>{var t;return(null==(t=lU(s.floating))?void 0:t.id)||a},[s.floating,a]),d=null!=(i=hE.get(l))?i:l,f=null!=l8(),g=Z.useMemo(()=>"tooltip"===d||"label"===l?{["aria-"+("label"===l?"labelledby":"describedby")]:n?u:void 0}:{"aria-expanded":n?"true":"false","aria-haspopup":"alertdialog"===d?"dialog":d,"aria-controls":n?u:void 0,..."listbox"===d&&{role:"combobox"},..."menu"===d&&{id:c},..."menu"===d&&f&&{role:"menuitem"},..."select"===l&&{"aria-autocomplete":"none"},..."combobox"===l&&{"aria-autocomplete":"list"}},[d,u,f,n,c,l]),p=Z.useMemo(()=>{let t={id:u,...d&&{role:d}};return"tooltip"===d||"label"===l?t:{...t,..."menu"===d&&{"aria-labelledby":c}}},[d,u,c,l]),m=Z.useCallback(t=>{let{active:e,selected:r}=t,i={role:"option",...e&&{id:u+"-fui-option"}};switch(l){case"select":case"combobox":return{...i,"aria-selected":r}}return{}},[u,l]);return Z.useMemo(()=>o?{reference:g,floating:p,item:m}:{},[o,g,p,m])}var hj=t.i(40141);function hA(t){return(0,hj.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M6.9998 6V3C6.9998 2.44772 7.44752 2 7.9998 2H19.9998C20.5521 2 20.9998 2.44772 20.9998 3V17C20.9998 17.5523 20.5521 18 19.9998 18H16.9998V20.9991C16.9998 21.5519 16.5499 22 15.993 22H4.00666C3.45059 22 3 21.5554 3 20.9991L3.0026 7.00087C3.0027 6.44811 3.45264 6 4.00942 6H6.9998ZM8.9998 6H16.9998V16H18.9998V4H8.9998V6Z"},child:[]}]})(t)}function hP(t){return(0,hj.GenIcon)({tag:"svg",attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M5 2a1 1 0 011 1v1h1a1 1 0 010 2H6v1a1 1 0 01-2 0V6H3a1 1 0 010-2h1V3a1 1 0 011-1zm0 10a1 1 0 011 1v1h1a1 1 0 110 2H6v1a1 1 0 11-2 0v-1H3a1 1 0 110-2h1v-1a1 1 0 011-1zM12 2a1 1 0 01.967.744L14.146 7.2 17.5 9.134a1 1 0 010 1.732l-3.354 1.935-1.18 4.455a1 1 0 01-1.933 0L9.854 12.8 6.5 10.866a1 1 0 010-1.732l3.354-1.935 1.18-4.455A1 1 0 0112 2z",clipRule:"evenodd"},child:[]}]})(t)}var hF=t.i(11152);function hL(t){return(0,hj.GenIcon)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M123.193 29.635L121 406.18l84.31-82.836 65.87 159.02 67.5-27.96-65.87-159.02L391 294.342z"},child:[]}]})(t)}function hR(t){return(0,hj.GenIcon)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M149.9 302.2c-39.1 0-70.7 31-70.7 69.3 0 30.3-27.3 46.2-47.2 46.2C53.7 446 90.7 464 126.3 464c52.1 0 94.3-41.4 94.3-92.4 0-38.4-31.6-69.4-70.7-69.4zM473.1 85.7l-31.6-31c-9.2-9-24-9-33.2 0L197 261.8l64.8 63.5 211.2-207c9.3-9 9.3-23.6.1-32.6z"},child:[]}]})(t)}function hI(t){return(0,hj.GenIcon)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M96 448h106.7V64H96v384zM309.3 64v384H416V64H309.3z"},child:[]}]})(t)}function hB(t){return(0,hj.GenIcon)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M96 52v408l320-204L96 52z"},child:[]}]})(t)}function hN(t){return(0,hj.GenIcon)({tag:"svg",attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M11.904 16c1.777-3.219 2.076-8.13-4.904-7.966v3.966l-6-6 6-6v3.881c8.359-0.218 9.29 7.378 4.904 12.119z"},child:[]}]})(t)}function hW(t){return(0,hj.GenIcon)({tag:"svg",attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9 3.881v-3.881l6 6-6 6v-3.966c-6.98-0.164-6.681 4.747-4.904 7.966-4.386-4.741-3.455-12.337 4.904-12.119z"},child:[]}]})(t)}function hU(t){return(0,hj.GenIcon)({tag:"svg",attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 0c-4.418 0-8 3.582-8 8s3.582 8 8 8 8-3.582 8-8-3.582-8-8-8zM2 8c0-3.314 2.686-6 6-6v12c-3.314 0-6-2.686-6-6z"},child:[]}]})(t)}function hH(t){return(0,hj.GenIcon)({tag:"svg",attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 4c-2.209 0-4 1.791-4 4s1.791 4 4 4 4-1.791 4-4-1.791-4-4-4zM8 10.5v-5c1.379 0 2.5 1.122 2.5 2.5s-1.121 2.5-2.5 2.5zM8 13c0.552 0 1 0.448 1 1v1c0 0.552-0.448 1-1 1s-1-0.448-1-1v-1c0-0.552 0.448-1 1-1zM8 3c-0.552 0-1-0.448-1-1v-1c0-0.552 0.448-1 1-1s1 0.448 1 1v1c0 0.552-0.448 1-1 1zM15 7c0.552 0 1 0.448 1 1s-0.448 1-1 1h-1c-0.552 0-1-0.448-1-1s0.448-1 1-1h1zM3 8c0 0.552-0.448 1-1 1h-1c-0.552 0-1-0.448-1-1s0.448-1 1-1h1c0.552 0 1 0.448 1 1zM12.95 11.536l0.707 0.707c0.39 0.39 0.39 1.024 0 1.414s-1.024 0.39-1.414 0l-0.707-0.707c-0.39-0.39-0.39-1.024 0-1.414s1.024-0.39 1.414 0zM3.050 4.464l-0.707-0.707c-0.391-0.391-0.391-1.024 0-1.414s1.024-0.391 1.414 0l0.707 0.707c0.391 0.391 0.391 1.024 0 1.414s-1.024 0.391-1.414 0zM12.95 4.464c-0.39 0.391-1.024 0.391-1.414 0s-0.39-1.024 0-1.414l0.707-0.707c0.39-0.391 1.024-0.391 1.414 0s0.39 1.024 0 1.414l-0.707 0.707zM3.050 11.536c0.39-0.39 1.024-0.39 1.414 0s0.391 1.024 0 1.414l-0.707 0.707c-0.391 0.39-1.024 0.39-1.414 0s-0.391-1.024 0-1.414l0.707-0.707z"},child:[]}]})(t)}function hX(t){return(0,hj.GenIcon)({tag:"svg",attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M15.5 6h-5.5v-5.5c0-0.276-0.224-0.5-0.5-0.5h-3c-0.276 0-0.5 0.224-0.5 0.5v5.5h-5.5c-0.276 0-0.5 0.224-0.5 0.5v3c0 0.276 0.224 0.5 0.5 0.5h5.5v5.5c0 0.276 0.224 0.5 0.5 0.5h3c0.276 0 0.5-0.224 0.5-0.5v-5.5h5.5c0.276 0 0.5-0.224 0.5-0.5v-3c0-0.276-0.224-0.5-0.5-0.5z"},child:[]}]})(t)}let hV=Z.default.createContext(null);function hz(){let t=(0,Z.useContext)(hV);if(!t)throw Error("No WarriorContext.Provider");return t}hV.displayName="WarriorContext";let hY="undefined"!=typeof window&&window.document&&window.document.createElement?Z.useLayoutEffect:Z.useEffect,hG=(t,e)=>{let r=Z.useRef(!0);hY(()=>t(r.current),e),hY(()=>(r.current=!1,()=>{r.current=!0}),[])},hq=function(t){let e=Z.useRef();return e.current=t,Z.useCallback(function(){for(var t,r=arguments.length,i=Array(r),n=0;n{hQ.push(t)},h0.resetWarned=function(){hK={}},h0.noteOnce=function(t,e){h$(hZ,t,e)};let h1=function(t,e){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=new Set;return function t(e,n){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=i.has(e);if(h0(!a,"Warning: There may be circular references"),a)return!1;if(e===n)return!0;if(r&&s>1)return!1;i.add(e);let o=s+1;if(Array.isArray(e)){if(!Array.isArray(n)||e.length!==n.length)return!1;for(let r=0;rt(e[r],n[r],o))}return!1}(t,e)};var h2=t.i(43794);function h5(t,e,r,i){let n=(e-r)/(i-r),s={};switch(t){case"rtl":s.right="".concat(100*n,"%"),s.transform="translateX(50%)";break;case"btt":s.bottom="".concat(100*n,"%"),s.transform="translateY(50%)";break;case"ttb":s.top="".concat(100*n,"%"),s.transform="translateY(-50%)";break;default:s.left="".concat(100*n,"%"),s.transform="translateX(-50%)"}return s}function h4(t,e){return Array.isArray(t)?t[e]:t}let h3={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(t){let{keyCode:e}=t;if(t.altKey&&!t.ctrlKey||t.metaKey||e>=h3.F1&&e<=h3.F12)return!1;switch(e){case h3.ALT:case h3.CAPS_LOCK:case h3.CONTEXT_MENU:case h3.CTRL:case h3.DOWN:case h3.END:case h3.ESC:case h3.HOME:case h3.INSERT:case h3.LEFT:case h3.MAC_FF_META:case h3.META:case h3.NUMLOCK:case h3.NUM_CENTER:case h3.PAGE_DOWN:case h3.PAGE_UP:case h3.PAUSE:case h3.PRINT_SCREEN:case h3.RIGHT:case h3.SHIFT:case h3.UP:case h3.WIN_KEY:case h3.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(t){if(t>=h3.ZERO&&t<=h3.NINE||t>=h3.NUM_ZERO&&t<=h3.NUM_MULTIPLY||t>=h3.A&&t<=h3.Z||-1!==window.navigator.userAgent.indexOf("WebKit")&&0===t)return!0;switch(t){case h3.SPACE:case h3.QUESTION_MARK:case h3.NUM_PLUS:case h3.NUM_MINUS:case h3.NUM_PERIOD:case h3.NUM_DIVISION:case h3.SEMICOLON:case h3.DASH:case h3.EQUALS:case h3.COMMA:case h3.PERIOD:case h3.SLASH:case h3.APOSTROPHE:case h3.SINGLE_QUOTE:case h3.OPEN_SQUARE_BRACKET:case h3.BACKSLASH:case h3.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},h9=Z.createContext({min:0,max:0,direction:"ltr",step:1,includedStart:0,includedEnd:0,tabIndex:0,keyboard:!0,styles:{},classNames:{}}),h6=Z.createContext({});function h8(){return(h8=Object.assign.bind()).apply(this,arguments)}let h7=Z.forwardRef((t,e)=>{let{prefixCls:r,value:i,valueIndex:n,onStartMove:s,onDelete:a,style:o,render:l,dragging:h,draggingDelete:c,onOffsetChange:u,onChangeComplete:d,onFocus:f,onMouseEnter:g,...p}=t,{min:m,max:y,direction:x,disabled:b,keyboard:_,range:w,tabIndex:C,ariaLabelForHandle:S,ariaLabelledByForHandle:T,ariaRequired:O,ariaValueTextFormatterForHandle:k,styles:M,classNames:E}=Z.useContext(h9),D="".concat(r,"-handle"),j=t=>{b||s(t,n)},A=h5(x,i,m,y),P={};if(null!==n){var F;P={tabIndex:b?null:h4(C,n),role:"slider","aria-valuemin":m,"aria-valuemax":y,"aria-valuenow":i,"aria-disabled":b,"aria-label":h4(S,n),"aria-labelledby":h4(T,n),"aria-required":h4(O,n),"aria-valuetext":null==(F=h4(k,n))?void 0:F(i),"aria-orientation":"ltr"===x||"rtl"===x?"horizontal":"vertical",onMouseDown:j,onTouchStart:j,onFocus:t=>{null==f||f(t,n)},onMouseEnter:t=>{g(t,n)},onKeyDown:t=>{if(!b&&_){let e=null;switch(t.which||t.keyCode){case h3.LEFT:e="ltr"===x||"btt"===x?-1:1;break;case h3.RIGHT:e="ltr"===x||"btt"===x?1:-1;break;case h3.UP:e="ttb"!==x?1:-1;break;case h3.DOWN:e="ttb"!==x?-1:1;break;case h3.HOME:e="min";break;case h3.END:e="max";break;case h3.PAGE_UP:e=2;break;case h3.PAGE_DOWN:e=-2;break;case h3.BACKSPACE:case h3.DELETE:null==a||a(n)}null!==e&&(t.preventDefault(),u(e,n))}},onKeyUp:t=>{switch(t.which||t.keyCode){case h3.LEFT:case h3.RIGHT:case h3.UP:case h3.DOWN:case h3.HOME:case h3.END:case h3.PAGE_UP:case h3.PAGE_DOWN:null==d||d()}}}}let L=Z.createElement("div",h8({ref:e,className:(0,h2.default)(D,{["".concat(D,"-").concat(n+1)]:null!==n&&w,["".concat(D,"-dragging")]:h,["".concat(D,"-dragging-delete")]:c},E.handle),style:{...A,...o,...M.handle}},P,p));return l&&(L=l(L,{index:n,prefixCls:r,value:i,dragging:h,draggingDelete:c})),L});function ct(){return(ct=Object.assign.bind()).apply(this,arguments)}let ce=Z.forwardRef((t,e)=>{let{prefixCls:r,style:i,onStartMove:n,onOffsetChange:s,values:a,handleRender:o,activeHandleRender:l,draggingIndex:h,draggingDelete:c,onFocus:u,...d}=t,f=Z.useRef({}),[g,p]=Z.useState(!1),[m,y]=Z.useState(-1),x=t=>{y(t),p(!0)};Z.useImperativeHandle(e,()=>({focus:t=>{var e;null==(e=f.current[t])||e.focus()},hideHelp:()=>{(0,o9.flushSync)(()=>{p(!1)})}}));let b={prefixCls:r,onStartMove:n,onOffsetChange:s,render:o,onFocus:(t,e)=>{x(e),null==u||u(t)},onMouseEnter:(t,e)=>{x(e)},...d};return Z.createElement(Z.Fragment,null,a.map((t,e)=>{let r=h===e;return Z.createElement(h7,ct({ref:t=>{t?f.current[e]=t:delete f.current[e]},dragging:r,draggingDelete:r&&c,style:h4(i,e),key:e,value:t,valueIndex:e},b))}),l&&g&&Z.createElement(h7,ct({key:"a11y"},b,{value:a[m],valueIndex:null,dragging:-1!==h,draggingDelete:c,render:l,style:{pointerEvents:"none"},tabIndex:null,"aria-hidden":!0})))}),cr=t=>{let{prefixCls:e,style:r,children:i,value:n,onClick:s}=t,{min:a,max:o,direction:l,includedStart:h,includedEnd:c,included:u}=Z.useContext(h9),d="".concat(e,"-text"),f=h5(l,n,a,o);return Z.createElement("span",{className:(0,h2.default)(d,{["".concat(d,"-active")]:u&&h<=n&&n<=c}),style:{...f,...r},onMouseDown:t=>{t.stopPropagation()},onClick:()=>{s(n)}},i)},ci=t=>{let{prefixCls:e,marks:r,onClick:i}=t,n="".concat(e,"-mark");return r.length?Z.createElement("div",{className:n},r.map(t=>{let{value:e,style:r,label:s}=t;return Z.createElement(cr,{key:e,prefixCls:n,style:r,value:e,onClick:i},s)})):null},cn=t=>{let{prefixCls:e,value:r,style:i,activeStyle:n}=t,{min:s,max:a,direction:o,included:l,includedStart:h,includedEnd:c}=Z.useContext(h9),u="".concat(e,"-dot"),d=l&&h<=r&&r<=c,f={...h5(o,r,s,a),..."function"==typeof i?i(r):i};return d&&(f={...f,..."function"==typeof n?n(r):n}),Z.createElement("span",{className:(0,h2.default)(u,{["".concat(u,"-active")]:d}),style:f})},cs=t=>{let{prefixCls:e,marks:r,dots:i,style:n,activeStyle:s}=t,{min:a,max:o,step:l}=Z.useContext(h9),h=Z.useMemo(()=>{let t=new Set;if(r.forEach(e=>{t.add(e.value)}),i&&null!==l){let e=a;for(;e<=o;)t.add(e),e+=l}return Array.from(t)},[a,o,l,i,r]);return Z.createElement("div",{className:"".concat(e,"-step")},h.map(t=>Z.createElement(cn,{prefixCls:e,key:t,value:t,style:n,activeStyle:s})))},ca=t=>{let{prefixCls:e,style:r,start:i,end:n,index:s,onStartMove:a,replaceCls:o}=t,{direction:l,min:h,max:c,disabled:u,range:d,classNames:f}=Z.useContext(h9),g="".concat(e,"-track"),p=(i-h)/(c-h),m=(n-h)/(c-h),y=t=>{!u&&a&&a(t,-1)},x={};switch(l){case"rtl":x.right="".concat(100*p,"%"),x.width="".concat(100*m-100*p,"%");break;case"btt":x.bottom="".concat(100*p,"%"),x.height="".concat(100*m-100*p,"%");break;case"ttb":x.top="".concat(100*p,"%"),x.height="".concat(100*m-100*p,"%");break;default:x.left="".concat(100*p,"%"),x.width="".concat(100*m-100*p,"%")}let b=o||(0,h2.default)(g,{["".concat(g,"-").concat(s+1)]:null!==s&&d,["".concat(e,"-track-draggable")]:a},f.track);return Z.createElement("div",{className:b,style:{...x,...r},onMouseDown:y,onTouchStart:y})},co=t=>{let{prefixCls:e,style:r,values:i,startPoint:n,onStartMove:s}=t,{included:a,range:o,min:l,styles:h,classNames:c}=Z.useContext(h9),u=Z.useMemo(()=>{if(!o){if(0===i.length)return[];let t=null!=n?n:l,e=i[0];return[{start:Math.min(t,e),end:Math.max(t,e)}]}let t=[];for(let e=0;e{let{start:n,end:a}=t;return Z.createElement(ca,{index:i,prefixCls:e,style:{...h4(r,i),...h.track},start:n,end:a,key:i,onStartMove:s})}))};function cl(t){let e="targetTouches"in t?t.targetTouches[0]:t;return{pageX:e.pageX,pageY:e.pageY}}let ch=function(t,e,r,i,n,s,a,o,l,h,c){let[u,d]=Z.useState(null),[f,g]=Z.useState(-1),[p,m]=Z.useState(!1),[y,x]=Z.useState(r),[b,_]=Z.useState(r),w=Z.useRef(null),C=Z.useRef(null),S=Z.useRef(null),{onDragStart:T,onDragChange:O}=Z.useContext(h6);hG(()=>{-1===f&&x(r)},[r,f]),Z.useEffect(()=>()=>{document.removeEventListener("mousemove",w.current),document.removeEventListener("mouseup",C.current),S.current&&(S.current.removeEventListener("touchmove",w.current),S.current.removeEventListener("touchend",C.current))},[]);let k=(t,e,r)=>{void 0!==e&&d(e),x(t);let i=t;r&&(i=t.filter((t,e)=>e!==f)),a(i),O&&O({rawValues:t,deleteIndex:r?f:-1,draggingIndex:f,draggingValue:e})},M=hq((t,e,r)=>{if(-1===t){let t=b[0],r=b[b.length-1],a=e*(n-i);a=Math.min(a=Math.max(a,i-t),n-r),a=s(t+a)-t,k(b.map(t=>t+a))}else{let s=[...y];s[t]=b[t];let a=l(s,(n-i)*e,t,"dist");k(a.values,a.value,r)}});return[f,u,p,Z.useMemo(()=>{let t=[...r].sort((t,e)=>t-e),e=[...y].sort((t,e)=>t-e),i={};e.forEach(t=>{i[t]=(i[t]||0)+1}),t.forEach(t=>{i[t]=(i[t]||0)-1});let n=+!!h;return Object.values(i).reduce((t,e)=>t+Math.abs(e),0)<=n?y:r},[r,y,h]),(i,n,s)=>{i.stopPropagation();let a=s||r,l=a[n];g(n),d(l),_(a),x(a),m(!1);let{pageX:u,pageY:f}=cl(i),p=!1;T&&T({rawValues:a,draggingIndex:n,draggingValue:l});let b=r=>{let i,s;r.preventDefault();let{pageX:a,pageY:o}=cl(r),l=a-u,d=o-f,{width:g,height:x}=t.current.getBoundingClientRect();switch(e){case"btt":i=-d/x,s=l;break;case"ttb":i=d/x,s=l;break;case"rtl":i=-l/g,s=d;break;default:i=l/g,s=d}m(p=!!h&&Math.abs(s)>130&&c{t.preventDefault(),document.removeEventListener("mouseup",O),document.removeEventListener("mousemove",b),S.current&&(S.current.removeEventListener("touchmove",w.current),S.current.removeEventListener("touchend",C.current)),w.current=null,C.current=null,S.current=null,o(p),g(-1),m(!1)};document.addEventListener("mouseup",O),document.addEventListener("mousemove",b),i.currentTarget.addEventListener("touchend",O),i.currentTarget.addEventListener("touchmove",b),w.current=b,C.current=O,S.current=i.currentTarget}]},cc=Z.forwardRef((t,e)=>{let{prefixCls:r="rc-slider",className:i,style:n,classNames:s,styles:a,id:o,disabled:l=!1,keyboard:h=!0,autoFocus:c,onFocus:u,onBlur:d,min:f=0,max:g=100,step:p=1,value:m,defaultValue:y,range:x,count:b,onChange:_,onBeforeChange:w,onAfterChange:C,onChangeComplete:S,allowCross:T=!0,pushable:O=!1,reverse:k,vertical:M,included:E=!0,startPoint:D,trackStyle:j,handleStyle:A,railStyle:P,dotStyle:F,activeDotStyle:L,marks:R,dots:I,handleRender:B,activeHandleRender:N,track:W,tabIndex:U=0,ariaLabelForHandle:H,ariaLabelledByForHandle:X,ariaRequired:V,ariaValueTextFormatterForHandle:z}=t,Y=Z.useRef(null),G=Z.useRef(null),q=Z.useMemo(()=>M?k?"ttb":"btt":k?"rtl":"ltr",[k,M]),[K,Q,J,$,tt]=function(t){return(0,Z.useMemo)(()=>{if(!0===t||!t)return[!!t,!1,!1,0];let{editable:e,draggableTrack:r,minCount:i,maxCount:n}=t;return[!0,e,!e&&r,i||0,n]},[t])}(x),te=Z.useMemo(()=>isFinite(f)?f:0,[f]),tr=Z.useMemo(()=>isFinite(g)?g:100,[g]),ti=Z.useMemo(()=>null!==p&&p<=0?1:p,[p]),tn=Z.useMemo(()=>"boolean"==typeof O?!!O&&ti:O>=0&&O,[O,ti]),ts=Z.useMemo(()=>Object.keys(R||{}).map(t=>{let e=R[t],r={value:Number(t)};return e&&"object"==typeof e&&!Z.isValidElement(e)&&("label"in e||"style"in e)?(r.style=e.style,r.label=e.label):r.label=e,r}).filter(t=>{let{label:e}=t;return e||"number"==typeof e}).sort((t,e)=>t.value-e.value),[R]),[ta,to]=function(t,e,r,i,n,s){let a=Z.useCallback(r=>Math.max(t,Math.min(e,r)),[t,e]),o=Z.useCallback(i=>{if(null!==r){let n=t+Math.round((a(i)-t)/r)*r,s=t=>(String(t).split(".")[1]||"").length,o=Math.max(s(r),s(e),s(t)),l=Number(n.toFixed(o));return t<=l&&l<=e?l:null}return null},[r,t,e,a]),l=Z.useCallback(n=>{let s=a(n),l=i.map(t=>t.value);null!==r&&l.push(o(n)),l.push(t,e);let h=l[0],c=e-t;return l.forEach(t=>{let e=Math.abs(s-t);e<=c&&(h=t,c=e)}),h},[t,e,i,r,a,o]),h=function(n,s,a){let l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"unit";if("number"==typeof s){let c,u=n[a],d=u+s,f=[];i.forEach(t=>{f.push(t.value)}),f.push(t,e),f.push(o(u));let g=s>0?1:-1;"unit"===l?f.push(o(u+g*r)):f.push(o(d)),f=f.filter(t=>null!==t).filter(t=>s<0?t<=u:t>=u),"unit"===l&&(f=f.filter(t=>t!==u));let p="unit"===l?u:d,m=Math.abs((c=f[0])-p);if(f.forEach(t=>{let e=Math.abs(t-p);e1){let t=[...n];return t[a]=c,h(t,s-g,a,l)}return c}return"min"===s?t:"max"===s?e:void 0},c=function(t,e,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"unit",n=t[r],s=h(t,e,r,i);return{value:s,changed:s!==n}},u=t=>null===s&&0===t||"number"==typeof s&&t3&&void 0!==arguments[3]?arguments[3]:"unit",a=t.map(l),o=a[r],d=h(a,e,r,i);if(a[r]=d,!1===n){let t=s||0;r>0&&a[r-1]!==o&&(a[r]=Math.max(a[r],a[r-1]+t)),r0;t-=1){let e=!0;for(;u(a[t]-a[t-1])&&e;)({value:a[t-1],changed:e}=c(a,-1,t-1))}for(let t=a.length-1;t>0;t-=1){let e=!0;for(;u(a[t]-a[t-1])&&e;)({value:a[t-1],changed:e}=c(a,-1,t-1))}for(let t=0;t{t||i(e)},[e]),[n,i]}(y,m),tc=Z.useMemo(()=>{let t=null==tl?[]:Array.isArray(tl)?tl:[tl],[e=te]=t,r=null===tl?[]:[e];if(K){if(r=[...t],b||void 0===tl){let t=b>=0?b+1:2;for(r=r.slice(0,t);r.lengtht-e)}return r.forEach((t,e)=>{r[e]=ta(t)}),r},[tl,K,te,b,ta]),tu=t=>K?t:t[0],td=hq(t=>{let e=[...t].sort((t,e)=>t-e);_&&!h1(e,tc,!0)&&_(tu(e)),th(e)}),tf=hq(t=>{t&&Y.current.hideHelp();let e=tu(tc);null==C||C(e),h0(!C,"[rc-slider] `onAfterChange` is deprecated. Please use `onChangeComplete` instead."),null==S||S(e)}),[tg,tp,tm,tv,ty]=ch(G,q,tc,te,tr,ta,td,tf,to,Q,$),tx=(t,e)=>{if(!l){let n=[...tc],s=0,a=0,o=tr-te;tc.forEach((e,r)=>{let i=Math.abs(t-e);i<=o&&(o=i,s=r),e{if(null!==tb){let t=tc.indexOf(tb);t>=0&&Y.current.focus(t)}t_(null)},[tb]);let tw=Z.useMemo(()=>(!J||null!==ti)&&J,[J,ti]),tC=hq((t,e)=>{ty(t,e),null==w||w(tu(tc))}),tS=-1!==tg;Z.useEffect(()=>{if(!tS){let t=tc.lastIndexOf(tp);Y.current.focus(t)}},[tS]);let tT=Z.useMemo(()=>[...tv].sort((t,e)=>t-e),[tv]),[tO,tk]=Z.useMemo(()=>K?[tT[0],tT[tT.length-1]]:[te,tT[0]],[tT,K,te]);Z.useImperativeHandle(e,()=>({focus:()=>{Y.current.focus(0)},blur:()=>{var t;let{activeElement:e}=document;(null==(t=G.current)?void 0:t.contains(e))&&(null==e||e.blur())}})),Z.useEffect(()=>{c&&Y.current.focus(0)},[]);let tM=Z.useMemo(()=>({min:te,max:tr,direction:q,disabled:l,keyboard:h,step:ti,included:E,includedStart:tO,includedEnd:tk,range:K,tabIndex:U,ariaLabelForHandle:H,ariaLabelledByForHandle:X,ariaRequired:V,ariaValueTextFormatterForHandle:z,styles:a||{},classNames:s||{}}),[te,tr,q,l,h,ti,E,tO,tk,K,U,H,X,V,z,a,s]);return Z.createElement(h9.Provider,{value:tM},Z.createElement("div",{ref:G,className:(0,h2.default)(r,i,{["".concat(r,"-disabled")]:l,["".concat(r,"-vertical")]:M,["".concat(r,"-horizontal")]:!M,["".concat(r,"-with-marks")]:ts.length}),style:n,onMouseDown:t=>{let e;t.preventDefault();let{width:r,height:i,left:n,top:s,bottom:a,right:o}=G.current.getBoundingClientRect(),{clientX:l,clientY:h}=t;switch(q){case"btt":e=(a-h)/i;break;case"ttb":e=(h-s)/i;break;case"rtl":e=(o-l)/r;break;default:e=(l-n)/r}tx(ta(te+e*(tr-te)),t)},id:o},Z.createElement("div",{className:(0,h2.default)("".concat(r,"-rail"),null==s?void 0:s.rail),style:{...P,...null==a?void 0:a.rail}}),!1!==W&&Z.createElement(co,{prefixCls:r,style:j,values:tc,startPoint:D,onStartMove:tw?tC:void 0}),Z.createElement(cs,{prefixCls:r,marks:ts,dots:I,style:F,activeStyle:L}),Z.createElement(ce,{ref:Y,prefixCls:r,style:A,values:tv,draggingIndex:tg,draggingDelete:tm,onStartMove:tC,onOffsetChange:(t,e)=>{if(!l){let r=to(tc,t,e);null==w||w(tu(tc)),td(r.values),t_(r.value)}},onFocus:u,onBlur:d,handleRender:B,activeHandleRender:N,onChangeComplete:tf,onDelete:Q?t=>{if(l||!Q||tc.length<=$)return;let e=[...tc];e.splice(t,1),null==w||w(tu(e)),td(e);let r=Math.max(0,t-1);Y.current.hideHelp(),Y.current.focus(r)}:void 0}),Z.createElement(ci,{prefixCls:r,marks:ts,onClick:tx})))}),cu={track:{height:8,background:"#03fccf"},handle:{width:20,height:20,marginTop:-6,borderColor:"#03fccf",background:"rgb(5, 69, 76)",opacity:1},rail:{height:8,border:"1px solid #555",background:"rgba(255, 255, 255, 0.3)"}};function cd(t){return(0,J.jsx)(cc,{...t,styles:{...cu,...t.styles}})}let cf=t.i(29947).default,{materials:cg}=cf;function cp(){var t;let e=(0,Z.useRef)(null),r=(0,Z.useRef)(null),[i,n]=(0,Z.useState)("vl2"),{activeCanvas:s,backgroundColor:a,setBackgroundColor:o,selectedObjects:l,lockedObjects:h,lockSelection:c,unlockSelection:u,bringForward:d,sendBackward:f,duplicate:g,deleteSelection:p,undo:m,redo:y,canUndo:x,canRedo:b,copyToMetallic:_,brushColor:w,setBrushColor:C,brushSize:S,setBrushSize:T,hueRotate:O,setHueRotate:k,saturation:M,setSaturation:E,brightness:D,setBrightness:j,contrast:A,setContrast:P,opacity:F,setOpacity:L,layerMode:R,setLayerMode:I,activeCanvasType:B,addImages:N,exportSkin:W,selectedExportMaterials:U,setSelectedExportMaterials:H}=a1(),{actualModel:X}=hz(),V=cg[X],{canvas:z,isDrawingMode:Y,setDrawingMode:G}=a$(s),[q,K]=(0,Z.useState)(!1),Q=q?"⌘":"Ctrl ",[$,tt]=(0,Z.useState)(!1),{refs:te,floatingStyles:tr,context:ti}=hO({open:$,onOpenChange:tt,placement:"bottom-end",middleware:[li(),lr(10)],whileElementsMounted:o3}),tn=h_(ti),ts=hT(ti),ta=hD(ti);(0,Z.useEffect)(()=>{$&&G(!0)},[$,G]);let{getReferenceProps:to,getFloatingProps:tl}=hM([tn,ts,ta]),[th,tc]=(0,Z.useState)(!1),{refs:tu,floatingStyles:td,context:tf}=hO({open:th,onOpenChange:tc,placement:"bottom-end",middleware:[li(),lr(10)],whileElementsMounted:o3}),tg=h_(tf),{getReferenceProps:tp,getFloatingProps:tm}=hM([tg,hT(tf),hD(tf)]),[tv,ty]=(0,Z.useState)(!1),{refs:tx,floatingStyles:tb,context:t_}=hO({open:tv,onOpenChange:ty,placement:"bottom-end",middleware:[li(),lr(10)],whileElementsMounted:o3}),tw=h_(t_),{getReferenceProps:tC,getFloatingProps:tS}=hM([tw,hT(t_),hD(t_)]),tT=!!l.length&&l.every(t=>h.has(t)),tO=l.length>0,tk=l.filter(t=>t instanceof at).length>0,tM=t=>{o(t.target.value)};return(0,Z.useEffect)(()=>{try{let t=localStorage.getItem("exportFileType");switch(t){case"vl2":case"png":n(t)}}catch(t){}},[]),(0,Z.useEffect)(()=>{navigator.platform&&navigator.platform.startsWith("Mac")?K(!0):navigator.userAgent.match(/\(Macintosh;/)&&K(!0)},[]),(0,J.jsxs)("div",{className:"CanvasTools",children:[(0,J.jsxs)("div",{className:"CanvasBackgroundColor",children:[(0,J.jsx)("input",{className:"ColorSwatch",type:"radio",name:"backgroundColor",id:"canvasBackgroundColorBlack",value:"black",checked:"black"===a,onChange:tM}),(0,J.jsx)("label",{htmlFor:"canvasBackgroundColorBlack",children:(0,J.jsx)("span",{className:"HiddenLabel",children:"Black"})}),(0,J.jsx)("input",{className:"ColorSwatch",type:"radio",name:"backgroundColor",id:"canvasBackgroundColorMagenta",value:"magenta",checked:"magenta"===a,onChange:tM}),(0,J.jsx)("label",{htmlFor:"canvasBackgroundColorMagenta",children:(0,J.jsx)("span",{className:"HiddenLabel",children:"Magenta"})}),(0,J.jsx)("input",{className:"ColorSwatch",type:"radio",name:"backgroundColor",id:"canvasBackgroundColorWhite",value:"white",checked:"white"===a,onChange:tM}),(0,J.jsx)("label",{htmlFor:"canvasBackgroundColorWhite",children:(0,J.jsx)("span",{className:"HiddenLabel",children:"White"})})]}),(0,J.jsxs)("div",{className:"Buttons",children:["metallic"===B?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)("div",{className:"ButtonGroup",children:[(0,J.jsx)("button",{className:"ButtonGroup",type:"button","data-active":Y?void 0:"","aria-label":"Select Mode",title:"Select Mode (S)",onClick:()=>{G(!1)},children:(0,J.jsx)(hL,{})}),(0,J.jsx)("button",{className:"ButtonGroup",type:"button","data-active":Y?"":void 0,"aria-label":"Paint Mode",title:"Paint Mode (P)",ref:te.setReference,...to(),children:(0,J.jsx)(hR,{})})]}),$?(0,J.jsx)(hx,{context:ti,modal:!1,children:(0,J.jsx)("div",{className:"BrushToolsPopup",ref:te.setFloating,style:tr,...tl(),children:(0,J.jsxs)("div",{className:"Fields",children:[(0,J.jsxs)("div",{className:"Field",children:[(0,J.jsx)("label",{children:"Metallic Amount"}),(0,J.jsx)("div",{className:"SliderContainer",children:(0,J.jsx)(cd,{min:0,max:255,value:w,onChange:t=>{Array.isArray(t)&&(t=t[0]),C(t)},styles:{track:{display:"none"},handle:{width:20,height:20,marginTop:-6,borderColor:"rgb(20, 105, 241)",background:"rgb(".concat(w,", ").concat(w,", ").concat(w,")"),opacity:1},rail:{height:8,border:"1px solid #555",background:"linear-gradient(to right, black 0%, white 100%)"}}})})]}),(0,J.jsxs)("div",{className:"Field",children:[(0,J.jsx)("label",{children:"Brush Size"}),(0,J.jsx)("div",{className:"SliderContainer",children:(0,J.jsx)(cd,{min:1,max:50,value:S,onChange:t=>{Array.isArray(t)&&(t=t[0]),T(t)}})})]})]})})}):null]}):null,(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)("input",{ref:r,onChange:async t=>{N([await new Promise((e,r)=>{var i;let n=null==(i=t.target.files)?void 0:i[0];if(n){let t=new FileReader;t.addEventListener("load",t=>{var r;e(null==(r=t.target)?void 0:r.result)}),t.readAsDataURL(n)}else r(Error("No input file provided."))})])},type:"file",accept:".png, image/png",hidden:!0}),(0,J.jsx)("button",{type:"button","aria-label":"Add Image",title:"Add Image",onClick:()=>{r.current&&r.current.click()},children:(0,J.jsx)(hX,{style:{fontSize:14}})}),(0,J.jsx)("button",{type:"button","data-active":th?"":void 0,"aria-label":"Filters",title:"Filters",disabled:tO&&!tk,ref:tu.setReference,...tp(),children:(0,J.jsx)(hU,{})}),th?(0,J.jsx)(hx,{context:tf,modal:!1,children:(0,J.jsx)("div",{className:"BrushToolsPopup",ref:tu.setFloating,style:td,...tm(),children:(0,J.jsxs)("div",{className:"Fields",children:[(0,J.jsxs)("div",{className:"Field ApplyTo",children:[(0,J.jsx)("label",{children:"Layer:"}),(0,J.jsx)("ul",{children:l.length?(0,J.jsxs)("li",{children:[(0,J.jsx)("input",{type:"radio",name:"FilterLayer",value:"SelectedLayer",id:"FilterLayer-SelectedLayer",checked:"SelectedLayer"===R,onChange:()=>{I("SelectedLayer")}}),(0,J.jsxs)("label",{htmlFor:"FilterLayer-SelectedLayer",children:["selected (",l.length.toLocaleString(),")"]})]}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)("li",{children:[(0,J.jsx)("input",{type:"radio",name:"FilterLayer",value:"BaseLayer",id:"FilterLayer-BaseLayer",checked:"BaseLayer"===R,onChange:()=>{I("BaseLayer")}})," ",(0,J.jsx)("label",{htmlFor:"FilterLayer-BaseLayer",children:"base"})]}),(0,J.jsxs)("li",{children:[(0,J.jsx)("input",{type:"radio",name:"FilterLayer",value:"AllLayers",id:"FilterLayer-AllLayers",checked:"AllLayers"===R,onChange:()=>{I("AllLayers")}}),(0,J.jsxs)("label",{htmlFor:"FilterLayer-AllLayers",children:["all (",null!=(t=null==z?void 0:z._objects.filter(t=>t instanceof at).length.toLocaleString())?t:0,")"]})]})]})})]}),"color"===B?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)("div",{className:"Field",children:[(0,J.jsxs)("label",{children:["Hue:"," ",(0,J.jsx)("strong",{children:null==O?"MULTIPLE VALUES":(0,J.jsxs)(J.Fragment,{children:[Math.round(180*O),"°"]})})]}),(0,J.jsx)("div",{className:"SliderContainer",children:(0,J.jsx)(cd,{min:-180,max:180,startPoint:0,value:Math.round((null!=O?O:0)*180),onChange:t=>{Array.isArray(t)&&(t=t[0]),k(t/180)}})})]}),(0,J.jsxs)("div",{className:"Field",children:[(0,J.jsxs)("label",{children:["Saturation:"," ",(0,J.jsx)("strong",{children:null==M?"MULTIPLE VALUES":"".concat(Math.round(100*M+100),"%")})]}),(0,J.jsx)("div",{className:"SliderContainer",children:(0,J.jsx)(cd,{min:-100,max:100,startPoint:0,value:Math.round((null!=M?M:0)*100),onChange:t=>{Array.isArray(t)&&(t=t[0]),E(t/100)}})})]})]}):null,(0,J.jsxs)("div",{className:"Field",children:[(0,J.jsxs)("label",{children:["Brightness:"," ",(0,J.jsx)("strong",{children:null==D?"MULTIPLE VALUES":"".concat(Math.round(100*D+100),"%")})]}),(0,J.jsx)("div",{className:"SliderContainer",children:(0,J.jsx)(cd,{min:-100,max:100,startPoint:0,value:Math.round((null!=D?D:0)*100),onChange:t=>{Array.isArray(t)&&(t=t[0]),j(t/100)}})})]}),(0,J.jsxs)("div",{className:"Field",children:[(0,J.jsxs)("label",{children:["Contrast:"," ",(0,J.jsx)("strong",{children:null==A?"MULTIPLE VALUES":"".concat(Math.round(100*A+100),"%")})]}),(0,J.jsx)("div",{className:"SliderContainer",children:(0,J.jsx)(cd,{min:-100,max:100,startPoint:0,value:Math.round((null!=A?A:0)*100),onChange:t=>{Array.isArray(t)&&(t=t[0]),P(t/100)}})})]}),(0,J.jsxs)("div",{className:"Field",children:[(0,J.jsxs)("label",{children:["Opacity:"," ",(0,J.jsx)("strong",{children:null==F?"MULTIPLE VALUES":"".concat(Math.round((null!=F?F:1)*100),"%")})]}),(0,J.jsx)("div",{className:"SliderContainer",children:(0,J.jsx)(cd,{min:0,max:100,startPoint:0,value:Math.round((null!=F?F:1)*100),onChange:t=>{Array.isArray(t)&&(t=t[0]),L(t/100)}})})]})]})})}):null,(0,J.jsx)("button",{type:"button","aria-label":tT?"Unlock":"Lock",title:tT?"Unlock (L)":"Lock (L)",onClick:tT?u:c,"data-locked":tT?"":void 0,disabled:!tO,children:tT?(0,J.jsx)(hF.FaUnlock,{style:{fontSize:14}}):(0,J.jsx)(hF.FaLock,{style:{fontSize:14}})}),(0,J.jsxs)("div",{className:"ButtonGroup",children:[(0,J.jsx)("button",{type:"button","aria-label":"Bring Forward",title:"Bring Forward (F)",onClick:d,disabled:!tO,children:(0,J.jsx)(hF.FaArrowUp,{})}),(0,J.jsx)("button",{type:"button","aria-label":"Send Backward",title:"Send Backward (B)",onClick:f,disabled:!tO,children:(0,J.jsx)(hF.FaArrowDown,{})})]}),(0,J.jsx)("button",{type:"button","aria-label":"Duplicate",title:"Duplicate (D)",onClick:g,disabled:!tO,children:(0,J.jsx)(hA,{})}),(0,J.jsx)("button",{type:"button","aria-label":"Delete",title:"Delete (Backspace)",onClick:p,disabled:tT||!tO,children:(0,J.jsx)(hF.FaTrashAlt,{})}),(0,J.jsxs)("div",{className:"ButtonGroup",children:[(0,J.jsx)("button",{type:"button","aria-label":"Undo",title:"Undo (".concat(Q,"Z)"),onClick:m,disabled:!x,children:(0,J.jsx)(hN,{})}),(0,J.jsx)("button",{type:"button","aria-label":"Redo",title:"Redo (".concat(q?"".concat("⇧").concat(Q,"Z)"):"".concat(Q," Y"),")"),onClick:y,disabled:!b,children:(0,J.jsx)(hW,{})})]}),"color"===B?(0,J.jsxs)("button",{type:"button",className:"MetallicButton","aria-label":"Copy to Metallic",title:"Copy to Metallic",onClick:_,children:[(0,J.jsx)(hP,{})," ",(0,J.jsx)("span",{className:"ButtonLabel",children:"Metal"})]}):null]})]}),(0,J.jsxs)("div",{className:"Export",children:[(0,J.jsx)("input",{ref:e,type:"text",name:"CustomSkinName",placeholder:"Skin Name",size:12}),(0,J.jsxs)("button",{className:"ExportOptionsButton",type:"button","data-active":tv?"":void 0,"aria-label":"Export Options",title:"Export Options",ref:tx.setReference,...tC(),children:[".",i,(0,J.jsx)(hF.FaAngleDown,{})]}),tv?(0,J.jsx)(hx,{context:t_,modal:!1,children:(0,J.jsx)("div",{className:"ExportOptionsPopup",ref:tx.setFloating,style:tb,...tS(),children:(0,J.jsxs)("div",{className:"Fields",children:[(0,J.jsxs)("div",{className:"Field",children:[(0,J.jsx)("label",{children:"Export Materials"}),(0,J.jsx)("ul",{className:"ExportOptionsList",children:V.map((t,e)=>t&&!1!==t.selectable&&!t.hidden?(0,J.jsxs)("li",{children:[(0,J.jsx)("input",{id:"MaterialSelect-".concat(t.name),type:"checkbox",checked:!1!==U[e],onChange:t=>{H(r=>{let i=r.slice();return i[e]=t.target.checked,i})}}),(0,J.jsx)("label",{htmlFor:"MaterialSelect-".concat(t.name),children:t.label})]},t.name):null)})]}),(0,J.jsxs)("div",{className:"Field",children:[(0,J.jsx)("label",{htmlFor:"ExportFormat",children:"Export Format"}),(0,J.jsxs)("select",{id:"ExportFormat",value:i,onChange:t=>{n(t.target.value);try{localStorage.setItem("exportFileType",t.target.value)}catch(t){}},children:[(0,J.jsx)("option",{value:"png",children:".png"}),(0,J.jsx)("option",{value:"vl2",children:".vl2"})]})]})]})})}):null,(0,J.jsx)("button",{type:"button",onClick:()=>{W({name:e.current?e.current.value:"",format:i})},children:"Export"})]})]})}function cm(){return(0,J.jsxs)("footer",{className:"AppFooter",children:[(0,J.jsx)("a",{href:"https://github.com/exogen/t2-model-skinner",className:"IconLink",children:(0,J.jsx)(hF.FaGithub,{size:32})}),(0,J.jsxs)("div",{className:"Sponsor",children:[(0,J.jsx)("a",{href:"https://github.com/sponsors/exogen",target:"_blank",rel:"noreferrer",children:"Support this project"})," ",(0,J.jsx)("span",{className:"Separator",children:"or"})," ",(0,J.jsx)("a",{href:"https://www.buymeacoffee.com/mosswood",target:"_blank",rel:"noreferrer",children:(0,J.jsx)("img",{src:"https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png",alt:"Buy Me A Coffee",width:145,height:40})})]})]})}async function cv(t){return await at.fromURL(t,{crossOrigin:"anonymous"})}var cy=t.i(55519);function cx(){let e=(0,Z.useRef)(null),r=(0,Z.useRef)(null),i=(0,Z.useMemo)(()=>({async combineColorAndAlphaImageUrls(){for(var t=arguments.length,e=Array(t),i=0;i{let i=new Worker(t.r(79702)),n=cy.wrap(i);return e.current=i,r.current=n,()=>{n[cy.releaseProxy](),r.current=null,i.terminate()}},[]),i}function cb(){return{canvasPadding:64,basePath:"/t2-model-skinner"}}var c_=t.i(54826);let{materials:cw}=cf,cC=[512,512];function cS(e){var r,i;let{children:n}=e,{actualModel:s,selectedModelType:a}=hz(),[o,l]=(0,Z.useState)(0),[h,c]=(0,Z.useState)(0),[u,d]=(0,Z.useState)(1),f=cw[s],g=null!=(r=f[o])?r:null,p=null!=(i=g.frameCount)?i:1,m=p>1,[y,x]=(0,Z.useState)([]),b=(0,Z.useMemo)(()=>{var t;let[e,r]=null!=(t=g.size)?t:cC;return[e*u,r*u]},[g.size,u]),_=0!==g.metallicFactor||1!==g.roughnessFactor,[w,C]=(0,Z.useState)("color");_||"metallic"!==w||C("color"),h>=p&&c(0),(0,Z.useEffect)(()=>{try{let t=localStorage.getItem("sizeMultiplier");switch(t){case"1":case"2":case"4":d(+t)}}catch(t){}},[]),(0,Z.useEffect)(()=>{x(f.map(t=>!!(t&&!1!==t.selectable&&!t.hidden)))},[f]),(0,Z.useEffect)(()=>{c(0)},[g]);let[S,T]=(0,Z.useState)("magenta"),[O,k]=(0,Z.useState)(()=>new Set),[M,E]=(0,Z.useState)(200),[D,j]=(0,Z.useState)(10),[A,P]=(0,Z.useState)(()=>new Map),[F,L]=(0,Z.useState)(()=>[]),R=g?"".concat(g.name,":").concat(w,":").concat(h,":").concat(u):null,I=g?"".concat(g.name,":metallic:").concat(h,":").concat(u):null,{canvases:B}=a$(),{canvas:N,notifyChange:W,undo:U,redo:H,canUndo:X,canRedo:V}=a$(R),{canvas:z,setDrawingMode:Y}=a$(I),{combineColorAndAlphaImageUrls:G}=cx(),{canvasPadding:q}=cb(),[K,Q]=(0,Z.useState)(()=>[]),[$,tt]=(0,Z.useState)("BaseLayer");F.length?"SelectedLayer"!==$&&tt("SelectedLayer"):"SelectedLayer"===$&&tt("BaseLayer");let te=(0,Z.useCallback)((t,e)=>{var r,i,n;let s=[],a=new Map(A),o=F;for(let l of("AllLayers"===$?o=null!=(r=null==N?void 0:N._objects)?r:[]:"BaseLayer"===$&&(o=null!=(i=null==N?void 0:N._objects.slice(0,1))?i:[]),o))if(l instanceof at){let r={...null!=(n=A.get(l))?n:{},[t]:e};a.set(l,r),s.push([l,r])}P(a),Q(s)},[N,$,A,F]),tr=t=>{var e,r;let i=+("Opacity"===t),n=F;if("AllLayers"===$?n=null!=(e=null==N?void 0:N._objects)?e:[]:"BaseLayer"===$&&(n=null!=(r=null==N?void 0:N._objects.slice(0,1))?r:[]),!(n=n.filter(t=>t instanceof at)).length)return[i,e=>te(t,e)];{let e=e=>{var r,s;return null!=(s=(null!=(r=A.get(n[e]))?r:{})[t])?s:i},r=e(0);return n.slice(1).every((t,i)=>e(i+1)===r)?[r,e=>te(t,e)]:[null,e=>te(t,e)]}},[ti,tn]=tr("HueRotation"),[ts,ta]=tr("Saturation"),[to,tl]=tr("Brightness"),[th,tc]=tr("Contrast"),[tu,td]=tr("Opacity");(0,Z.useEffect)(()=>{if(K.length){for(let[t,e]of K)if(t instanceof at){if(t.filters=[],"metallic"===w){let e=new aJ.Grayscale;t.filters.push(e)}for(let r in e){let i=e[r];if(null!=i)switch(r){case"HueRotation":t.filters.push(new aJ.HueRotation({rotation:i}));break;case"Saturation":t.filters.push(new aJ.Saturation({saturation:i}));break;case"Brightness":t.filters.push(new aJ.Brightness({brightness:i}));break;case"Contrast":t.filters.push(new aJ.Contrast({contrast:i}));break;case"Opacity":t.opacity=i}}t.applyFilters()}Q([]),W&&W()}},[K,w,W]);let tf=(0,Z.useCallback)(()=>{F.length&&k(t=>{let e=new Set(t);for(let t of F)e.add(t),t.lockMovementX=!0,t.lockMovementY=!0,t.lockScalingX=!0,t.lockScalingY=!0,t.lockRotation=!0;return e})},[F]),tg=(0,Z.useCallback)(()=>{F.length&&k(t=>{let e=new Set(t);for(let t of F)e.delete(t),t.lockMovementX=!1,t.lockMovementY=!1,t.lockScalingX=!1,t.lockScalingY=!1,t.lockRotation=!1;return e})},[F]),tp=(0,Z.useCallback)(async()=>{let t=N.getActiveObject();t&&(N.bringObjectForward(t,!0),W())},[N,W]),tm=(0,Z.useCallback)(async()=>{let t=N.getActiveObject();if(t){if(N._objects[0]===t||N._objects[1]===t)return;N.sendObjectBackwards(t,!0),W()}},[N,W]),tv=(0,Z.useCallback)(async t=>{let e;for(let r of t){let t=await cv(r);if(!t.width||!t.height)throw Error("Zero-height image");let i=t.width/b[0],n=t.height/b[1];if(i>1||n>1){let e;t.scaleX=e=i>n?1/i:1/n,t.scaleY=e}if("metallic"===w){t.filters||(t.filters=[]);let e=new aJ.Grayscale;t.filters.push(e),t.applyFilters()}z&&Y(!1),N.centerObject(t),N.add(t),e=t}e&&(N.setActiveObject(e),N.requestRenderAll())},[b,w,z,N,Y]),ty=(0,Z.useCallback)(async()=>{let t=N.getActiveObject();if(t){var e,r;let i=await t.clone();i.set({top:(null!=(e=i.top)?e:0)+20,left:(null!=(r=i.left)?r:0)+20,evented:!0}),"activeSelection"===i.type&&(i.canvas=N,i.forEachObject(t=>{N.add(t)}),i.setCoords()),N.discardActiveObject(),N.add(i),N.setActiveObject(i)}},[N]),tx=(0,Z.useCallback)(async()=>{let t=N.getActiveObjects();N.discardActiveObject(),N.remove(...t),N.requestRenderAll()},[N]),tb=(0,Z.useCallback)(async()=>{if("color"===w&&z){let t=N.toDataURL({format:"png",multiplier:1,top:q,left:q,width:b[0],height:b[1]}),e=await cv(t);e.filters||(e.filters=[]);let r=new aJ.Grayscale;e.filters.push(r),e.applyFilters(),z.centerObject(e),z.add(e),z.setActiveObject(e),Y(!1),C("metallic")}},[z,N,w,q,Y,b]),t_=(0,Z.useCallback)(async e=>{let{format:r,name:i=""}=e,{savePngFile:n,saveZipFile:o,createZipFile:l}=await t.A(91135);i=i.trim()||"MyCustomSkin";let h=await Promise.all(f.filter((t,e)=>!1!==y[e]).map(t=>{var e;let r=null!=(e=t.frameCount)?e:1;return Array(r).fill(null).map(async(e,n)=>{var o,l,h,c;let d,f,g=null==(o=B["".concat(t.name,":color:").concat(n,":").concat(u)])?void 0:o.canvas,p=null==(l=B["".concat(t.name,":metallic:").concat(n,":").concat(u)])?void 0:l.canvas,m=null!=(h=t.size)?h:cC,y=[m[0]*u,m[1]*u],x=g.toDataURL({format:"png",multiplier:1,top:q,left:q,width:y[0],height:y[1]});if(p){let t=p.toDataURL({format:"png",multiplier:1,top:q,left:q,width:y[0],height:y[1]});d=await G({colorImageUrl:x,metallicImageUrl:t})}else d=x;switch(a){case"player":f="".concat(i,".").concat(s,".png");break;case"weapon":case"vehicle":if(t){let e=null!=(c=t.file)?c:t.name;if(r>1){let t=e.match(/^(.+)(\d\d)$/);if(t){let e=t[1];f="".concat(e).concat(n.toString().padStart(2,"0"),".png")}else throw Error("Unexpected animation filename")}else f="".concat(e,".png")}else f="weapon"===a?"weapon_".concat(s,".png"):"".concat(s,".png");break;default:throw Error("Unknown model type")}return{imageUrl:d,filename:f}})}).flat());switch(r){case"png":h.forEach(t=>{let{imageUrl:e,filename:r}=t;n(e,r)});break;case"vl2":{let t=l(await Promise.all(h.map(async t=>({data:await (0,c_.imageUrlToArrayBuffer)(t.imageUrl),name:t.filename})))),e=s.replace(/(?:^([a-z])|_([a-z]))/g,(t,e,r)=>(e||r).toUpperCase()),r="",n=u>1?"-@".concat(u,"x"):"";switch(a){case"player":r="zPlayerSkin-".concat(i).concat(n,".vl2");break;case"weapon":r="zWeapon".concat(e,"-").concat(i).concat(n,".vl2");break;case"vehicle":r="z".concat(e,"-").concat(i).concat(n,".vl2")}await o(t,r)}}},[f,y,B,u,q,a,G,s]),tw=(0,Z.useMemo)(()=>({activeCanvas:R,activeCanvasType:w,setActiveCanvasType:C,backgroundColor:S,setBackgroundColor:T,lockedObjects:O,setLockedObjects:k,brushColor:M,setBrushColor:E,brushSize:D,setBrushSize:j,hueRotate:ti,setHueRotate:tn,saturation:ts,setSaturation:ta,brightness:to,setBrightness:tl,contrast:th,setContrast:tc,opacity:tu,setOpacity:td,layerMode:$,setLayerMode:tt,selectedObjects:F,lockSelection:tf,unlockSelection:tg,bringForward:tp,sendBackward:tm,addImages:tv,duplicate:ty,deleteSelection:tx,undo:U,redo:H,canUndo:X,canRedo:V,copyToMetallic:tb,exportSkin:t_,selectedMaterialIndex:o,setSelectedMaterialIndex:l,textureSize:b,hasMetallic:_,selectedFrameIndex:h,setSelectedFrameIndex:c,hasAnimation:m,frameCount:p,sizeMultiplier:u,setSizeMultiplier:d,selectedExportMaterials:y,setSelectedExportMaterials:x}),[R,w,S,O,M,D,ti,tn,ts,ta,to,tl,th,tc,tu,td,$,F,tf,tg,tp,tm,tv,ty,tx,U,H,X,V,tb,t_,o,b,_,h,m,p,u,y]);return(0,Z.useEffect)(()=>{if(N){let t=()=>{L(N.getActiveObjects())};return N.on("selection:cleared",t),N.on("selection:updated",t),N.on("selection:created",t),t(),()=>{N.off("selection:cleared",t),N.off("selection:updated",t),N.off("selection:created",t)}}},[N]),(0,Z.useEffect)(()=>{z&&(z.freeDrawingBrush||(z.freeDrawingBrush=new sb(z)),z.freeDrawingBrush.width=D)},[z,D]),(0,Z.useEffect)(()=>{z&&(z.freeDrawingBrush||(z.freeDrawingBrush=new sb(z)),z.freeDrawingBrush.color="rgb(".concat(M,", ").concat(M,", ").concat(M,")"))},[z,M]),(0,J.jsx)(a0.Provider,{value:tw,children:n})}function cT(){let{backgroundColor:t,textureSize:e}=a1(),{canvasPadding:r}=cb();return e?(0,J.jsx)("div",{className:"CanvasBackdrop",style:{backgroundColor:t,top:r,width:e[0],height:e[1]}}):null}function cO(t){let{children:e}=t,[r,i]=(0,Z.useState)({}),n=(0,Z.useCallback)((t,e)=>{i(r=>({...r,[t]:e}))},[]),s=(0,Z.useCallback)(t=>{i(e=>{let{[t]:r,...i}=e;return i})},[]),a=(0,Z.useMemo)(()=>({canvases:r,registerCanvas:n,unregisterCanvas:s}),[r,n,s]);return(0,J.jsx)(aZ.Provider,{value:a,children:e})}function ck(t){let{children:e}=t,r=(0,Z.useRef)(null),{activeCanvas:i,activeCanvasType:n,bringForward:s,sendBackward:a,duplicate:o,deleteSelection:l,addImages:h,undo:c,redo:u}=a1(),{canvas:d,notifyChange:f,setDrawingMode:g}=a$(i),p=async function(){let{top:t=0,left:e=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};for(let n of d.getActiveObjects()){var r,i;n.top=(null!=(r=n.top)?r:0)+t,n.left=(null!=(i=n.left)?i:0)+e}f()};return(0,J.jsx)("div",{className:"CanvasInteractions",tabIndex:0,ref:r,onDragOver:t=>{t.preventDefault()},onDrop:async t=>{t.preventDefault(),r.current&&r.current.focus();let{items:e}=t.dataTransfer,i=Array.from(e).filter(t=>"file"===t.kind&&t.type.match(/^image\//)),n=await Promise.all(i.map(async t=>{let e=t.getAsFile();if(!e)throw Error("Not a file.");let r=new FileReader;return await new Promise((t,i)=>{r.onload=async e=>{e.target&&"string"==typeof e.target.result?t(e.target.result):i(Error("Failed to load image data."))},r.readAsDataURL(e)})}).filter(Boolean));await h(n)},onKeyDown:async t=>{let e=t.target;if("INPUT"!==e.nodeName&&"TEXTAREA"!==e.nodeName){if(t.ctrlKey||t.metaKey)switch(t.key){case"z":if(t.altKey)return;if(t.shiftKey){t.preventDefault(),u();return}t.preventDefault(),c();return;case"y":if(t.altKey||t.shiftKey)return;t.preventDefault(),u();return}if(!t.altKey&&!t.ctrlKey&&!t.metaKey&&!t.shiftKey)switch(t.key){case"Backspace":case"Delete":t.preventDefault(),await l();break;case"ArrowLeft":t.preventDefault(),await p({left:-1});break;case"ArrowRight":t.preventDefault(),await p({left:1});break;case"ArrowUp":t.preventDefault(),await p({top:-1});break;case"ArrowDown":t.preventDefault(),await p({top:1});break;case"d":t.preventDefault(),await o();break;case"f":t.preventDefault(),await s();break;case"b":t.preventDefault(),await a();break;case"p":"metallic"===n&&(t.preventDefault(),g(!0));break;case"s":"metallic"===n&&(t.preventDefault(),g(!1))}}},children:e})}function cM(){let{activeCanvasType:t,setActiveCanvasType:e,hasMetallic:r,hasAnimation:i,frameCount:n,selectedFrameIndex:s,setSelectedFrameIndex:a,sizeMultiplier:o,setSizeMultiplier:l}=a1();return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)("div",{className:"CanvasToggle",children:[(0,J.jsx)("button",{type:"button","data-selected":"color"===t?"":void 0,onClick:()=>{e("color")},children:"Color"}),r?(0,J.jsx)("button",{type:"button","data-selected":"metallic"===t?"":void 0,onClick:()=>{e("metallic")},children:"Metallic"}):null]}),(0,J.jsxs)("div",{className:"CanvasToggle",style:{display:"none"},children:[(0,J.jsx)("button",{type:"button","data-selected":1===o?"":void 0,onClick:()=>{l(1)},children:"1×"}),(0,J.jsx)("button",{type:"button","data-selected":2===o?"":void 0,onClick:()=>{l(2)},children:"2×"}),(0,J.jsx)("button",{type:"button","data-selected":4===o?"":void 0,onClick:()=>{l(4)},children:"4×"})]}),i?(0,J.jsxs)("div",{className:"FrameSelector",children:[(0,J.jsx)("button",{type:"button",onClick:()=>{a(t=>(n+t-1)%n)},children:(0,J.jsx)(hF.FaChevronLeft,{})}),(0,J.jsxs)("span",{className:"FrameInfo",children:[s+1," / ",n]}),(0,J.jsx)("button",{type:"button",onClick:()=>{a(t=>(t+1)%n)},children:(0,J.jsx)(hF.FaChevronRight,{})})]}):null]})}function cE(t){return(0,hj.GenIcon)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M1 2a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1zM1 7a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1zM1 12a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1z"},child:[]}]})(t)}var cD=t.i(71315);let cj=cf.materials,cA=/^(\.|__MACOSX)/;async function cP(t){let e=await cD.default.loadAsync(t);return(await Promise.all(Object.entries(e.files).map(async t=>{let[e,r]=t;if(!cA.test(e)&&/\.png$/i.exec(e)){let t=await r.async("base64");return{path:e,imageUrl:"data:image/png;base64,".concat(t)}}}))).filter(t=>!!t)}async function cF(t){return new Promise((e,r)=>{let i=new FileReader;i.addEventListener("load",t=>{var i;"string"==typeof(null==(i=t.target)?void 0:i.result)?e(t.target.result):r()}),i.addEventListener("error",t=>{r()}),i.readAsDataURL(t)})}async function cL(t){return(await Promise.all(Array.from(t).map(async t=>{var e;if(cA.test(t.name))return null;switch((e=t).name.match(/\.png$/i)?"png":e.name.match(/\.zip$/i)?"zip":e.name.match(/\.vl2$/i)?"vl2":void 0){case"zip":case"vl2":{let e=t.name.match(/^(.+)\.(zip|vl2)$/i),r=e?e[1]:t.name;return(await cP(t)).map(e=>({...e,path:"".concat(t.name,"/").concat(e.path),name:r}))}case"png":return{path:t.name,imageUrl:await cF(t),name:null};default:return null}}))).flat().filter(t=>!!t)}async function cR(t){var e=await cL(t);let r=new Map;return e.forEach(t=>{let e=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;s||(s=function(){let t=new Map;for(let e in cj)cj[e].forEach((r,i)=>{let n;if(r.fileSuffix?n=r.fileSuffix:!1!==r.selectable&&!0!==r.hidden&&(r.file||r.name)&&(n=r.file||r.name),n){var s;let a=null!=(s=t.get(n))?s:[];a.push({modelName:e,material:r,index:i}),t.set(n,a)}});return t}());let r=t.split("/").slice(-1)[0],i=r.match(/^(.+)\.(PNG|png)$/);if(i){let n=i[1],a=n.split(".");if(a.length>1){let e=".".concat(a[a.length-1]),o=s.get(e);if(o)return{path:t,basename:r,nameWithoutExtension:n,extension:i[2],skinName:a.slice(0,a.length-1).join("."),models:o}}else{let o=function(t){let e=/^(.+[^\d])(\d{2,})$/.exec(t);if(e){var r;let t=e[1],i=e[2],n=parseInt(i,10),a="".concat(t).concat("0".padStart(i.length,"0"));return(null!=(r=s.get(a))?r:[]).filter(t=>"number"==typeof t.material.frameCount).map(t=>({...t,frameIndex:n}))}return[]}(a[0]);if(o.length)return{path:t,basename:r,nameWithoutExtension:n,extension:i[2],skinName:e,models:o};{let o=s.get(a[0]);if(o)return{path:t,basename:r,nameWithoutExtension:n,extension:i[2],skinName:e,models:o}}}}return null}(t.path,t.name);e&&e.models.forEach(i=>{var n,s,a,o,l;let h=null!=(n=r.get(i.modelName))?n:new Map,c=null!=(s=h.get(e.skinName))?s:{name:e.skinName,isComplete:null,materials:new Map},u=null!=(a=i.material.file)?a:i.material.name,d=null!=(o=c.materials.get(u))?o:[];d[null!=(l=i.frameIndex)?l:0]=t.imageUrl,c.materials.set(u,d),h.set(e.skinName,c),r.set(i.modelName,h)})}),r.forEach((t,e)=>{let r=cj[e].filter(t=>!1!==t.selectable&&!0!==t.hidden&&!0!==t.optional);t.forEach(t=>{t.isComplete=r.every(e=>{var r;return t.materials.has(null!=(r=e.file)?r:e.name)})})}),r}var cI=t.i(15768);let{defaultSkins:cB,modelDefaults:cN}=cf,cW={},cU=new Map;function cH(){var t,e,r,i,n,s;let{selectedModel:a,setSelectedModel:o,selectedModelType:l,setSelectedModelType:h,selectedSkin:c,setSelectedSkin:u,setSelectedSkinType:d,actualModel:f,setSelectedAnimation:g,setAnimationPaused:p,importedSkins:m,addImportedSkins:y}=hz(),{setSelectedMaterialIndex:x}=a1(),[b,_]=(0,Z.useState)(cW),[w,C]=(0,Z.useState)(cW),[S,T]=(0,Z.useState)(null),O=(0,Z.useRef)(null),[k,M]=(0,cI.default)(),E=Array.from((null!=(s=m.get(f))?s:cU).values()).filter(t=>t.isComplete);M&&(b!==k.customSkins||w!==k.newSkins)&&(_(k.customSkins),C(k.newSkins));let D=null!=c?c:"";return c&&S&&(D="".concat(S,"/").concat(c)),(0,J.jsxs)("div",{className:"Toolbar",children:[(0,J.jsxs)("div",{className:"Field",children:[(0,J.jsx)("label",{htmlFor:"ModelSelect",children:"Model"}),(0,J.jsxs)("select",{id:"ModelSelect",value:a,onChange:t=>{var e,r,i,n;let s=t.target.selectedOptions[0].parentNode,a=t.target.value,l="hfemale"===a?"hmale":a,{modelType:f}=s.dataset;if(!f)throw Error("No data-model-type found");let m=c&&((null==(e=cB[l])?void 0:e.includes(c))||(null==(r=b[l])?void 0:r.includes(c)))||!1,y=!1;c&&"new"===S&&m&&(y=null==(i=w[l])?void 0:i.includes(c)),g(null),p(!1),h(f),o(a),x(0),m||(u(null!=(n=cN[l])?n:null),d("default")),y||T(null)},children:[(0,J.jsxs)("optgroup",{label:"Players","data-model-type":"player",children:[(0,J.jsx)("option",{value:"lmale",children:"Human Male • Light"}),(0,J.jsx)("option",{value:"mmale",children:"Human Male • Medium"}),(0,J.jsx)("option",{value:"hmale",children:"Human Male • Heavy"}),(0,J.jsx)("option",{value:"lfemale",children:"Human Female • Light"}),(0,J.jsx)("option",{value:"mfemale",children:"Human Female • Medium"}),(0,J.jsx)("option",{value:"hfemale",children:"Human Female • Heavy"}),(0,J.jsx)("option",{value:"lbioderm",children:"Bioderm • Light"}),(0,J.jsx)("option",{value:"mbioderm",children:"Bioderm • Medium"}),(0,J.jsx)("option",{value:"hbioderm",children:"Bioderm • Heavy"})]}),(0,J.jsxs)("optgroup",{label:"Weapons","data-model-type":"weapon",children:[(0,J.jsx)("option",{value:"disc",children:"Disc Launcher"}),(0,J.jsx)("option",{value:"chaingun",children:"Chaingun"}),(0,J.jsx)("option",{value:"grenade_launcher",children:"Grenade Launcher"}),(0,J.jsx)("option",{value:"sniper",children:"Laser Rifle"}),(0,J.jsx)("option",{value:"plasmathrower",children:"Plasma Cannon"}),(0,J.jsx)("option",{value:"energy",children:"Blaster"}),(0,J.jsx)("option",{value:"shocklance",children:"Shocklance"}),(0,J.jsx)("option",{value:"elf",children:"ELF Projector"}),(0,J.jsx)("option",{value:"missile",children:"Missile Launcher"}),(0,J.jsx)("option",{value:"mortar",children:"Mortar"}),(0,J.jsx)("option",{value:"repair",children:"Repair Pack"}),(0,J.jsx)("option",{value:"targeting",children:"Targeting Laser"}),(0,J.jsx)("option",{value:"mine",children:"Mine"})]}),(0,J.jsxs)("optgroup",{label:"Vehicles","data-model-type":"vehicle",children:[(0,J.jsx)("option",{value:"vehicle_grav_scout",children:"Wildcat Grav Cycle"}),(0,J.jsx)("option",{value:"vehicle_grav_tank",children:"Beowulf Assault Tank"}),(0,J.jsx)("option",{value:"vehicle_land_mpbbase",children:"Jericho Mobile Point Base"}),(0,J.jsx)("option",{value:"vehicle_air_scout",children:"Shrike Scout Fighter"}),(0,J.jsx)("option",{value:"vehicle_air_bomber",children:"Thundersword Bomber"}),(0,J.jsx)("option",{value:"vehicle_air_hapc",children:"HAVOC Gunship Transport"})]})]})]}),(0,J.jsxs)("div",{className:"Field",children:[(0,J.jsx)("label",{htmlFor:"SkinSelect",children:"Skin"}),(0,J.jsxs)("div",{className:"Buttons",children:[(0,J.jsxs)("select",{id:"SkinSelect",value:D,onChange:t=>{var e,r;let i=t.target.selectedOptions[0].parentNode,n=t.target.value&&null!=(e=i.dataset.skinType)?e:null,s=t.target.value.split("/");u(null!=(r=s.slice(-1)[0])?r:null),d(n),s.length>1?T(s[0]):T(null)},children:[(0,J.jsx)("option",{value:"",children:"Select a skin…"}),"player"===l?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)("optgroup",{label:"Default Skins","data-skin-type":"default",children:null==(t=cB[f])?void 0:t.map(t=>(0,J.jsx)("option",{value:t,children:t},t))}),E.length?(0,J.jsx)("optgroup",{label:"Imported Skins","data-skin-type":"import",children:E.map(t=>{var e,r;return(0,J.jsx)("option",{value:"import/".concat(null!=(e=t.name)?e:"__untitled__"),children:t.name||"Untitled Imported Skin"},"import/".concat(null!=(r=t.name)?r:"__untitled__"))})}):null,(null==(e=w[f])?void 0:e.length)?(0,J.jsx)("optgroup",{label:"New Skins ✨","data-skin-type":"custom",children:null==(r=w[f])?void 0:r.map(t=>(0,J.jsxs)("option",{value:"new/".concat(t),children:[t," ✨"]},"new/".concat(t)))}):null,(0,J.jsx)("optgroup",{label:"Custom Skins","data-skin-type":"custom",children:b===cW?(0,J.jsx)("option",{value:"",children:"Loading…"},"loading"):null==(i=b[f])?void 0:i.map(t=>(0,J.jsx)("option",{value:t,children:t},t))})]}):null,"weapon"===l||"vehicle"===l?(0,J.jsxs)(J.Fragment,{children:[cN[f]?(0,J.jsx)("optgroup",{label:"Default Skins","data-skin-type":"default",children:(0,J.jsx)("option",{value:cN[f],children:"Default"})}):null,E.length?(0,J.jsx)("optgroup",{label:"Imported Skins","data-skin-type":"import",children:E.map(t=>{var e,r;return(0,J.jsx)("option",{value:"import/".concat(null!=(e=t.name)?e:"__untitled__"),children:t.name||"Untitled Imported Skin"},"import/".concat(null!=(r=t.name)?r:"__untitled__"))})}):null,(null==(n=b[f])?void 0:n.length)?(0,J.jsx)("optgroup",{label:"Custom Skins","data-skin-type":"custom",children:b[f].map(t=>(0,J.jsx)("option",{value:t,children:t},t))}):null]}):null]}),(0,J.jsx)("button",{type:"button","aria-label":"Load Skin",title:"Load a Skin",onClick:()=>{O.current&&O.current.click()},children:(0,J.jsx)(hF.FaFolderOpen,{style:{fontSize:18}})}),(0,J.jsx)("input",{ref:O,onChange:async t=>{var e,r,i;let n=await cR(null!=(e=t.target.files)?e:[]);y(n);let s=n.get(f);if(s){let t=Array.from(s.values()).filter(t=>t.isComplete);if(t.length){let e=t[0];d("import"),T("import"),u(null!=(r=e.name)?r:"__untitled__"),x(0),g(null);return}}for(let[t,e]of Array.from(n.entries()))for(let r of Array.from(e.values()))if(r.isComplete){o(t),h(function(t){switch(t){case"lmale":case"mmale":case"hmale":case"lfemale":case"mfemale":case"hfemale":case"lbioderm":case"mbioderm":case"hbioderm":return"player";case"disc":case"chaingun":case"grenade_launcher":case"sniper":case"plasmathrower":case"energy":case"shocklance":case"elf":case"missile":case"mortar":case"repair":case"targeting":return"weapon";case"vehicle_grav_scout":case"vehicle_grav_tank":case"vehicle_land_mpbbase":case"vehicle_air_scout":case"vehicle_air_bomber":case"vehicle_air_hapc":return"vehicle";default:throw Error("Unknown model")}}(t)),d("import"),T("import"),u(null!=(i=r.name)?i:"__untitled__"),x(0),g(null);break}},type:"file",accept:".png, image/png, .vl2, .zip, application/zip, application/zip-compressed",multiple:!0,hidden:!0})]})]}),(0,J.jsx)("div",{className:"Field GalleryField",children:(0,J.jsxs)("a",{href:"gallery/",target:"_blank",className:"GalleryLink",title:"Open skin gallery",children:[(0,J.jsx)("span",{className:"FieldLabel",children:"Gallery"}),(0,J.jsx)(cE,{})]})})]})}var cX=t.i(18566);let{materials:cV,modelDefaults:cz,defaultSkins:cY}=cf,cG="https://exogen.github.io/t2-skins/skins",cq=new Map;function cK(t,e){if(e<2)return[t];let r=t.match(/^(.+)(\d\d)$/);if(r){let t=r[1];return Array(e).fill(null).map((e,r)=>"".concat(t).concat(r.toString().padStart(2,"0")))}throw Error("Did not match expected frame format")}function cQ(t){let{basePath:e,actualModel:r,selectedModelType:i,selectedSkin:n,selectedSkinType:s}=t,a=cV[r];if(n&&"import"===s){let t=cq.get(r);if(t){let e="__untitled__"===n?null:n,r=t.get(e);if(r&&r.isComplete)return Object.fromEntries(r.materials)}throw Error("No skin found")}switch(i){case"player":switch(s){case"default":return{base:["".concat(e,"/textures/").concat(n,".").concat(r,".png")]};case"custom":return{base:["".concat(cG,"/").concat(n,".").concat(r,".png")]}}break;case"weapon":case"vehicle":return a.reduce((t,r)=>{if(r){var i,a,o,l,h;let c=null!=(i=r.frameCount)?i:1;switch(s){case"default":!1!==r.hasDefault&&(t[null!=(a=r.file)?a:r.name]=cK(null!=(o=r.file)?o:r.name,c).map(t=>"".concat(e,"/textures/").concat(t,".png")));break;case"custom":t[null!=(l=r.file)?l:r.name]=cK(null!=(h=r.file)?h:r.name,c).map(t=>"".concat(cG,"/").concat(n,"/").concat(t,".png"))}}return t},{})}return{}}function cJ(t){var e,r;let{children:i}=t,n=(0,cX.useRouter)(),s=(0,cX.usePathname)(),a=(0,cX.useSearchParams)(),[o,l]=(0,Z.useState)(!1),[h,c]=(0,Z.useState)("lmale"),[u,d]=(0,Z.useState)("player"),[f,g]=(0,Z.useState)("Blood Eagle"),[p,m]=(0,Z.useState)("default"),[y,x]=(0,Z.useState)(null),[b,_]=(0,Z.useState)(!1),[w,C]=(0,Z.useState)(!1),{basePath:S}=cb(),T="hfemale"===h?"hmale":h,O="".concat(S,"/").concat(T).concat(y?".anim":"",".glb"),[k,M]=(0,Z.useState)(cq),E=(0,Z.useCallback)(t=>{let e=new Map(cq.entries());t.forEach((t,r)=>{var i;let n=null!=(i=e.get(r))?i:new Map;t.forEach((t,e)=>{n.set(e,t)}),e.set(r,n)}),M(cq=e)},[]),[D,j]=(0,Z.useState)(()=>cQ({basePath:S,actualModel:T,selectedModelType:u,selectedSkin:f,selectedSkinType:p})),A=(0,Z.useMemo)(()=>cQ({basePath:S,actualModel:T,selectedModelType:u,selectedSkin:cz[T],selectedSkinType:"default"}),[T,S,u]),P=(0,Z.useMemo)(()=>({selectedModel:h,setSelectedModel:c,selectedModelType:u,setSelectedModelType:d,actualModel:T,selectedModelUrl:O,animationPaused:b,setAnimationPaused:_,selectedSkin:f,setSelectedSkin:g,selectedSkinType:p,setSelectedSkinType:m,selectedAnimation:y,setSelectedAnimation:x,skinImageUrls:D,setSkinImageUrls:j,defaultSkinImageUrls:A,slowModeEnabled:w,setSlowModeEnabled:C,importedSkins:k,addImportedSkins:E}),[h,c,u,d,T,O,b,_,f,g,p,m,y,x,D,j,A,w,k,E]);if(!o){let t=a.get("m"),i=a.get("s");if("string"==typeof t){let n=function(t){switch(t){case"lmale":case"mmale":case"hmale":case"lfemale":case"mfemale":case"hfemale":case"lbioderm":case"mbioderm":case"hbioderm":return"player";case"disc":case"chaingun":case"grenade_launcher":case"sniper":case"plasmathrower":case"energy":case"shocklance":case"elf":case"missile":case"mortar":case"repair":case"targeting":case"mine":return"weapon";case"vehicle_grav_scout":case"vehicle_grav_tank":case"vehicle_land_mpbbase":case"vehicle_air_scout":case"vehicle_air_bomber":case"vehicle_air_hapc":return"vehicle";default:return null}}(t);if(n&&(c(t),d(n),"string"==typeof i)){let n=i===cz[e="hfemale"===t?"hmale":t]||(null==(r=cY[e])?void 0:r.includes(i))?"default":"custom";g(i),m(n)}}l(!0)}return(0,Z.useEffect)(()=>{if(!f)return;let t=a.get("m"),e=a.get("s");if(t!==h||e!==f){let t=new URLSearchParams(a);t.set("m",h),t.set("s",f);let e="".concat(s,"?").concat(t);n.replace(e,{scroll:!1})}},[s,n,a,h,f]),(0,Z.useEffect)(()=>{if(f)try{let t=cQ({basePath:S,actualModel:T,selectedModelType:u,selectedSkin:f,selectedSkinType:p});j(t)}catch(t){m("default"),g(cz[T])}},[T,S,u,f,p]),(0,J.jsx)(hV.Provider,{value:P,children:i})}var cZ=t.i(70703);let c$=Z.default.createContext(null);function c0(){let t=(0,Z.useContext)(c$);if(!t)throw Error("No EnvironmentContext.Provider");return t}c$.displayName="EnvironmentContext";let c1=Z.default.createContext(null);function c2(){let t=(0,Z.useContext)(c1);if(!t)throw Error("No SkinContext.Provider");return t}c1.displayName="SkinContext";var c5=t.i(63871);function c4(t){let{material:e,materialDef:r,textureType:i,imageUrl:n,frameRef:s,onReady:a}=t,{modelViewer:o}=(0,c5.default)(),{basePath:l}=cb(),{slowModeEnabled:h}=hz();(0,Z.useEffect)(()=>{let t,c=!1;return(async()=>{if(!r||r.hidden)if("metallicRoughnessTexture"===i){a&&a();return}else e.setAlphaMode("BLEND"),e.pbrMetallicRoughness.setBaseColorFactor([0,0,0,0]),a&&a();else{let{alphaMode:u,alphaCutoff:d,baseColorFactor:f,emissiveFactor:g,emissiveTexture:p=!1,metallicFactor:m=1,roughnessFactor:y=1,frameCount:x=1,frameTimings:b}=r,_=null!=n?n:Array(x).fill("".concat(l,"/white.png"));if(_.some(t=>!t))return;switch(i){case"baseColorTexture":f&&e.pbrMetallicRoughness.setBaseColorFactor(f),u&&e.setAlphaMode(u),d&&e.setAlphaCutoff(d),g&&e.setEmissiveFactor(g);break;case"metallicRoughnessTexture":e.pbrMetallicRoughness.setMetallicFactor(m),e.pbrMetallicRoughness.setRoughnessFactor(y),0===m&&1===y&&(_=Array(x).fill("".concat(l,"/green.png")))}let w=await Promise.all(_.map(t=>o.createTexture(t)));if(!c){let r="baseColorTexture"===i,n=s.current,o=()=>{let s=w[n.frameIndex];if(e.pbrMetallicRoughness[i].setTexture(s),r&&p&&e.emissiveTexture.setTexture(s),r&&(n.frameProgress+=h?.05:1),x>1){var a;let e=null!=(a=null==b?void 0:b[n.frameIndex])?a:1;r&&n.frameProgress>=e&&(n.frameIndex=(n.frameIndex+1)%x,n.frameProgress=0),t=requestAnimationFrame(o)}};o(0),a&&a()}}})(),()=>{c=!0,null!=t&&cancelAnimationFrame(t)}},[l,o,e,r,i,n,s,h,a])}function c3(t){var e,r;let{material:i,materialDef:n,onReady:s}=t,{getSkinImages:a}=c2(),{colorImageUrl:o,metallicImageUrl:l}=null!=(r=a(null!=(e=null==n?void 0:n.file)?e:i.name))?r:{},h=(0,Z.useRef)({frameIndex:0,frameProgress:0});return c4({material:i,materialDef:n,textureType:"baseColorTexture",imageUrl:o,frameRef:h}),c4({material:i,materialDef:n,textureType:"metallicRoughnessTexture",imageUrl:l,frameRef:h}),null}let{materials:c9}=cf;function c6(){let{actualModel:t}=hz(),{model:e}=(0,c5.default)(),r=c9[t];return(0,J.jsx)(J.Fragment,{children:e.materials.map((t,e)=>{let i=r[e];return(0,J.jsx)(c3,{material:t,materialDef:i},t.name)})})}let c8=(0,cZ.default)(()=>t.A(22143),{loadableGenerated:{modules:[66641]},ssr:!1}),{cameraOverrides:c7}=cf;function ut(){var t,e,r,i;let{selectedModel:n,selectedModelUrl:s,selectedModelType:a,selectedAnimation:o,animationPaused:l,slowModeEnabled:h}=hz(),{environmentImageUrl:c,showEnvironment:u,exposure:d}=c0();return(0,J.jsx)(c8,{modelUrl:s,environmentImageUrl:c,showEnvironment:u,animationName:o,animationPaused:l,timeScale:h?.05:.5,cameraOrbit:null!=(i=null==(t=c7[n])?void 0:t.orbit)?i:"weapon"===a?"315deg 70deg 105%":void 0,cameraTarget:null==(e=c7[n])?void 0:e.target,fieldOfView:null==(r=c7[n])?void 0:r.fov,exposure:d,children:(0,J.jsx)(c6,{})})}function ue(){let{selectedEnvironment:t,setSelectedEnvironment:e}=c0();return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)("label",{htmlFor:"EnvMapSelect",children:"Environment"}),(0,J.jsxs)("select",{id:"EnvMapSelect",value:null!=t?t:"",onChange:t=>{e(t.target.value||null)},children:[(0,J.jsx)("option",{value:"",children:"Default"}),(0,J.jsx)("option",{value:"clarens_night_02_1k.hdr",children:"Clarens Night"}),(0,J.jsx)("option",{value:"dry_cracked_lake_1k.hdr",children:"Dry Cracked Lake"}),(0,J.jsx)("option",{value:"fouriesburg_mountain_midday_1k.hdr",children:"Fouriesburg Mountain"}),(0,J.jsx)("option",{value:"goegap_1k.hdr",children:"Goegap"}),(0,J.jsx)("option",{value:"hilly_terrain_01_1k.hdr",children:"Hilly Terrain"}),(0,J.jsx)("option",{value:"kloofendal_48d_partly_cloudy_puresky_1k.hdr",children:"Kloofendal Partly Cloudy"}),(0,J.jsx)("option",{value:"kloppenheim_06_puresky_1k.hdr",children:"Kloppenheim"}),(0,J.jsx)("option",{value:"lilienstein_1k.hdr",children:"Lilienstein"}),(0,J.jsx)("option",{value:"spruit_sunrise_1k_HDR.hdr",children:"Spruit Sunrise"}),(0,J.jsx)("option",{value:"umhlanga_sunrise_1k.hdr",children:"Umhlanga Sunrise"})]})]})}function ur(){let{exposure:t,setExposure:e}=c0();return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)("label",{htmlFor:"EnvExposure",children:(0,J.jsx)(hH,{size:16})}),(0,J.jsx)("input",{"aria-label":"Exposure",id:"EnvExposure",type:"range",min:.2,max:2.2,step:.1,value:t,onChange:t=>{e(parseFloat(t.target.value))}})]})}let{animations:ui,animationLabels:un,animationLabelOverrides:us}=cf;function ua(){let{actualModel:t,selectedModelType:e,selectedAnimation:r,setSelectedAnimation:i,animationPaused:n,setAnimationPaused:s,slowModeEnabled:a,setSlowModeEnabled:o}=hz(),l=(0,Z.useMemo)(()=>{var r;return[..."player"===e?ui.global:[],...null!=(r=ui[t])?r:[]]},[t,e]);return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)("div",{className:"LabelWithControls",children:[(0,J.jsx)("label",{children:"Animation"}),(0,J.jsxs)("div",{className:"AnimationSpeed",children:[(0,J.jsx)("input",{type:"checkbox",id:"SlowDownCheckbox",checked:a,onChange:t=>{o(t.target.checked)}})," ",(0,J.jsx)("label",{htmlFor:"SlowDownCheckbox",children:"Slow?"})]})]}),(0,J.jsxs)("div",{className:"Buttons",children:[(0,J.jsxs)("select",{value:null!=r?r:"",onChange:t=>{i(t.target.value||null),s(!1)},children:[(0,J.jsx)("option",{value:"",children:"None"}),l.map(e=>{var r,i;let n=null!=(i=null==(r=us[t])?void 0:r[e])?i:un[e];return(0,J.jsx)("option",{value:e,children:null!=n?n:e},e)})]}),(0,J.jsx)("button",{type:"button",disabled:!r,onClick:()=>{s(t=>!t)},children:n||!r?(0,J.jsx)(hB,{}):(0,J.jsx)(hI,{})})]})]})}function uo(t){let{children:e}=t,[r,i]=(0,Z.useState)(null),[n,s]=(0,Z.useState)(!1),[a,o]=(0,Z.useState)(1),{basePath:l}=cb(),h=(0,Z.useMemo)(()=>{let t=r?"".concat(l,"/").concat(r):null;return{selectedEnvironment:r,setSelectedEnvironment:i,showEnvironment:n,setShowEnvironment:s,exposure:a,setExposure:o,environmentImageUrl:t}},[l,r,n,a]);return(0,J.jsx)(c$.Provider,{value:h,children:e})}function ul(t){let{children:e}=t,[r,i]=(0,Z.useState)({}),n=(0,Z.useMemo)(()=>({setSkinImages(t,e){i(r=>({...r,[t]:e}))},setColorImageUrl(t,e,r){i(i=>{var n,s;let a=Array.from(null!=(s=null==(n=i[t])?void 0:n.colorImageUrl)?s:[]);return a[r]=e,{...i,[t]:{...i[t],colorImageUrl:a}}})},setMetallicImageUrl(t,e,r){i(i=>{var n,s;let a=Array.from(null!=(s=null==(n=i[t])?void 0:n.metallicImageUrl)?s:[]);return a[r]=e,{...i,[t]:{...i[t],metallicImageUrl:a}}})}}),[]),s=(0,Z.useMemo)(()=>({materialSkins:r,getSkinImages:t=>r[t],getColorImageUrl(t,e){var i;return null==(i=r[t].colorImageUrl)?void 0:i[e]},getMetallicImageUrl(t,e){var i;return null==(i=r[t].metallicImageUrl)?void 0:i[e]},...n}),[r,n]);return(0,J.jsx)(c1.Provider,{value:s,children:e})}let{materials:uh}=cf;function uc(){let{actualModel:t}=hz(),{selectedMaterialIndex:e,setSelectedMaterialIndex:r}=a1(),i=uh[t];return(0,J.jsx)("select",{value:e,onChange:t=>{r(parseInt(t.target.value,10))},children:i.map((t,e)=>{var r;return t&&!t.hidden&&!1!==t.selectable?(0,J.jsx)("option",{value:e,children:null!=(r=t.label)?r:t.name},t.name):null})})}function uu(t){let{canvasId:e,onChange:r,baseImageUrl:i,textureSize:n,defaultDrawingMode:s=!1}=t,a=(0,Z.useRef)(null),[o,l]=(0,Z.useState)(null),{activeCanvas:h}=a1(),{canvasPadding:c}=cb(),{registerCanvas:u,unregisterCanvas:d}=a$(),[f,g]=(0,Z.useState)(s),p=(0,Z.useRef)(null),m=(0,Z.useRef)(!0),[y,x]=(0,Z.useState)(()=>[]),[b,_]=(0,Z.useState)(()=>[]),w=y.length>1,C=b.length>0,S=(0,Z.useCallback)(t=>{let e=p.current;e&&e(t)},[]),T=(0,Z.useCallback)(async()=>{if(o&&y.length>1){let[t,e]=y.slice(-2);m.current=!1,o.renderOnAddRemove=!1,o.clear(),o.loadFromJSON(t,()=>{o.renderAll(),m.current=!0,o.renderOnAddRemove=!0}),x(t=>t.slice(0,-1)),_(t=>[e,...t])}},[o,y]),O=(0,Z.useCallback)(()=>{if(o&&b.length>0){let t=b[0];m.current=!1,o.renderOnAddRemove=!1,o.clear(),o.loadFromJSON(t,()=>{o.renderAll(),m.current=!0,o.renderOnAddRemove=!0}),x(e=>[...e,t]),_(t=>t.slice(1))}},[o,b]);(0,Z.useEffect)(()=>{p.current=r},[r]);let k=h===e;return(0,Z.useEffect)(()=>{let t;if(!a.current)return;iN.ownDefaults={...iN.ownDefaults,transparentCorners:!1,borderColor:"#8afff1",cornerSize:9,cornerStyle:"circle",cornerColor:"#8afff1",cornerStrokeColor:"#1c9f7c",strokeWidth:10,perPixelTargetFind:!0};let e=new se(a.current,{preserveObjectStacking:!0,targetFindTolerance:2}),r=!1,i=()=>{S(e)};return e.on("object:modified",i),e.on("object:added",i),e.on("object:removed",i),e.on("after:render",()=>{!r&&m.current&&(clearTimeout(t),t=setTimeout(()=>{let t=(()=>{r=!0;let t=e.toDatalessJSON(["lockMovementX","lockMovementY","lockRotation","lockScalingX","lockScalingY","selectable","hoverCursor","moveCursor"]);return r=!1,t})();x(e=>{if(0===e.length)return[t];let r=e[e.length-1];return JSON.stringify(t)===JSON.stringify(r)?e:[...e.slice(-10),t]}),_([])},250))}),l(e),()=>{clearTimeout(t),l(null),e.dispose()}},[S]),(0,Z.useEffect)(()=>{o&&(o.isDrawingMode=f,f&&(o.discardActiveObject(),o.requestRenderAll()))},[o,f]),(0,Z.useEffect)(()=>{o&&k&&o.calcOffset()},[o,k]),(0,Z.useEffect)(()=>{if(o)return u(e,{canvas:o,notifyChange:()=>{o.renderAll(),S(o)},undo:T,redo:O,canUndo:w,canRedo:C,isDrawingMode:f,setDrawingMode:g}),()=>{d(e)}},[o,u,d,e,S,f,g,T,O,w,C]),(0,Z.useEffect)(()=>{x([]),_([])},[o,i,n]),(0,Z.useEffect)(()=>{if(o&&n&&(m.current=!1,o.clear(),i)){let t=!1;return(async()=>{let e=await cv(i);if(!t){if(!e.width||!e.height)throw Error("Zero-height image");e.selectable=!1,e.lockMovementX=!0,e.lockMovementY=!0,e.lockScalingX=!0,e.lockScalingY=!0,e.lockRotation=!0,e.hoverCursor="default",e.moveCursor="default";let[t,r]=n,i=e.width===t?1:t/e.width,s=e.height===r?1:r/e.height;(1!==i||1!==s)&&(e.scaleX=i,e.scaleY=s),o.centerObject(e),o.add(e)}m.current=!0,o.requestRenderAll()})(),()=>{t=!0}}},[o,i,n]),(0,J.jsx)("div",{className:"CanvasContainer","data-active":k?"true":"false",children:(0,J.jsx)("canvas",{width:n[0]+2*c,height:n[1]+2*c,ref:a})})}let ud=Z.default.createContext(null);function uf(){let t=(0,Z.useContext)(ud);if(!t)throw Error("ImageLoaderContext.Provider not found!");return t}ud.displayName="ImageLoaderContext";let ug=[512,512];function up(t){var e,r,i,n;let{materialDef:s,frameIndex:a=0}=t,{skinImageUrls:o,defaultSkinImageUrls:l}=hz(),h=null==(e=o[null!=(i=s.file)?i:s.name])?void 0:e[a],c=null==(r=l[null!=(n=s.file)?n:s.name])?void 0:r[a],{setColorImageUrl:u}=c2(),{canvasPadding:d}=cb(),[f,g]=(0,Z.useState)(null),{removeAlphaFromArrayBuffer:p}=cx(),{loadImage:m}=uf(),{sizeMultiplier:y}=a1(),x=(0,Z.useMemo)(()=>{var t;let[e,r]=null!=(t=s.size)?t:ug;return[e*y,r*y]},[s.size,y]),b=(0,Z.useCallback)(async t=>{var e;let r=t.toDataURL({format:"png",multiplier:1,top:d,left:d,width:x[0],height:x[1]});u(null!=(e=s.file)?e:s.name,r,a)},[x,d,u,s,a]);(0,Z.useEffect)(()=>{if(h){let t=!1;return(async()=>{let e;try{e=await m(h)}catch(t){if(!1===s.hasDefault)return;e=await m(c)}let r=await p(e);t||g(r)})(),()=>{t=!0}}g(null)},[s,h,c,p,m]);let _="".concat(s.name,":color:").concat(a,":").concat(y);return x?(0,J.jsx)(uu,{canvasId:_,canvasType:"color",onChange:b,baseImageUrl:f,textureSize:x},_):null}let um=[512,512];function uv(t){var e,r,i,n;let{materialDef:s,frameIndex:a=0}=t,{skinImageUrls:o,defaultSkinImageUrls:l}=hz(),h=null==(e=o[null!=(i=s.file)?i:s.name])?void 0:e[a],c=null==(r=l[null!=(n=s.file)?n:s.name])?void 0:r[a],{setMetallicImageUrl:u}=c2(),{canvasPadding:d}=cb(),[f,g]=(0,Z.useState)(null),p=(0,Z.useRef)(0),{convertGrayscaleImageUrlToMetallicRoughness:m,convertArrayBufferAlphaToGrayscale:y}=cx(),{loadImage:x}=uf(),{sizeMultiplier:b}=a1(),_=(0,Z.useMemo)(()=>{var t;let[e,r]=null!=(t=s.size)?t:um;return[e*b,r*b]},[s.size,b]),w=(0,Z.useCallback)(async t=>{let e;p.current+=1;let r=t.toDataURL({format:"png",multiplier:1,top:d,left:d,width:_[0],height:_[1]});try{e=await m(r)}finally{p.current-=1}if(0===p.current){var i;u(null!=(i=s.file)?i:s.name,e,a)}},[_,d,u,m,s,a]);(0,Z.useEffect)(()=>{if(h){let t=!1;return(async()=>{let e;try{e=await x(h)}catch(t){if(!1===s.hasDefault)return;e=await x(c)}let r=await y(e);t||g(r)})(),()=>{t=!0}}g(null)},[s,h,c,_,y,x]);let C="".concat(s.name,":metallic:").concat(a,":").concat(b);return _?(0,J.jsx)(uu,{canvasId:C,canvasType:"metallic",onChange:w,baseImageUrl:f,textureSize:_,defaultDrawingMode:!0},C):null}let{materials:uy}=cf;function ux(){let{actualModel:t}=hz(),e=uy[t];return(0,J.jsx)(J.Fragment,{children:e.map(e=>{var r;if(!e)return null;let i=0!==e.metallicFactor||1!==e.roughnessFactor,n=Array(null!=(r=e.frameCount)?r:1).fill(null);return(0,J.jsxs)(Z.default.Fragment,{children:[n.map((t,r)=>(0,J.jsx)(up,{materialDef:e,frameIndex:r},"color:".concat(r))),i?n.map((t,r)=>(0,J.jsx)(uv,{materialDef:e,frameIndex:r},"metallic:".concat(r))):null]},"".concat(t,"-").concat(e.name))})})}var ub=Z.createContext(void 0),u_=t=>{let{client:e,children:r}=t;return Z.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,J.jsx)(ub.Provider,{value:e,children:r})};function uw(t){let{children:e}=t,r=(t=>{let e=Z.useContext(ub);if(t)return t;if(!e)throw Error("No QueryClient set, use QueryClientProvider to set one");return e})(),i=(0,Z.useMemo)(()=>({loadImage:async t=>t.startsWith("data:")?(0,c_.imageUrlToArrayBuffer)(t):await r.fetchQuery({queryKey:[t]})}),[r]);return(0,J.jsx)(ud.Provider,{value:i,children:e})}function uC(t,e,r){if(!e.has(t))throw TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function uS(t,e){var r=uC(t,e,"get");return r.get?r.get.call(t):r.value}function uT(t,e){if(e.has(t))throw TypeError("Cannot initialize the same private elements twice on an object")}function uO(t,e,r){uT(t,e),e.set(t,r)}function uk(t,e,r){var i=uC(t,e,"set");if(i.set)i.set.call(t,r);else{if(!i.writable)throw TypeError("attempted to set read only private field");i.value=r}return r}function uM(t,e){var r=uC(t,e,"update");if(r.set){if(!r.get)throw TypeError("attempted to read set only private field");return"__destrWrapper"in r||(r.__destrWrapper={set value(v){r.set.call(t,v)},get value(){return r.get.call(t)}}),r.__destrWrapper}if(!r.writable)throw TypeError("attempted to set read only private field");return r}var uE={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},uD=new(m=new WeakMap,y=new WeakMap,class{setTimeoutProvider(t){uk(this,m,t)}setTimeout(t,e){return uS(this,m).setTimeout(t,e)}clearTimeout(t){uS(this,m).clearTimeout(t)}setInterval(t,e){return uS(this,m).setInterval(t,e)}clearInterval(t){uS(this,m).clearInterval(t)}constructor(){uO(this,m,{writable:!0,value:uE}),uO(this,y,{writable:!0,value:!1})}}),uj="undefined"==typeof window||"Deno"in globalThis;function uA(){}function uP(t,e){return"function"==typeof t?t(e):t}function uF(t,e){let{type:r="all",exact:i,fetchStatus:n,predicate:s,queryKey:a,stale:o}=t;if(a){if(i){if(e.queryHash!==uR(a,e.options))return!1}else if(!uB(e.queryKey,a))return!1}if("all"!==r){let t=e.isActive();if("active"===r&&!t||"inactive"===r&&t)return!1}return("boolean"!=typeof o||e.isStale()===o)&&(!n||n===e.state.fetchStatus)&&(!s||!!s(e))}function uL(t,e){let{exact:r,status:i,predicate:n,mutationKey:s}=t;if(s){if(!e.options.mutationKey)return!1;if(r){if(uI(e.options.mutationKey)!==uI(s))return!1}else if(!uB(e.options.mutationKey,s))return!1}return(!i||e.state.status===i)&&(!n||!!n(e))}function uR(t,e){return((null==e?void 0:e.queryKeyHashFn)||uI)(t)}function uI(t){return JSON.stringify(t,(t,e)=>uU(e)?Object.keys(e).sort().reduce((t,r)=>(t[r]=e[r],t),{}):e)}function uB(t,e){return t===e||typeof t==typeof e&&!!t&&!!e&&"object"==typeof t&&"object"==typeof e&&Object.keys(e).every(r=>uB(t[r],e[r]))}var uN=Object.prototype.hasOwnProperty;function uW(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function uU(t){if(!uH(t))return!1;let e=t.constructor;if(void 0===e)return!0;let r=e.prototype;return!!uH(r)&&!!r.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(t)===Object.prototype}function uH(t){return"[object Object]"===Object.prototype.toString.call(t)}function uX(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=[...t,e];return r&&i.length>r?i.slice(1):i}function uV(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=[e,...t];return r&&i.length>r?i.slice(0,-1):i}var uz=Symbol();function uY(t,e){return!t.queryFn&&(null==e?void 0:e.initialPromise)?()=>e.initialPromise:t.queryFn&&t.queryFn!==uz?t.queryFn:()=>Promise.reject(Error("Missing queryFn: '".concat(t.queryHash,"'")))}function uG(t,e,r){if(!e.has(t))throw TypeError("attempted to get private field on non-instance");return r}function uq(t,e){uT(t,e),e.add(t)}var uK=function(t){setTimeout(t,0)},uQ=function(){let t=[],e=0,r=t=>{t()},i=t=>{t()},n=uK,s=i=>{e?t.push(i):n(()=>{r(i)})};return{batch:s=>{let a;e++;try{a=s()}finally{--e||(()=>{let e=t;t=[],e.length&&n(()=>{i(()=>{e.forEach(t=>{r(t)})})})})()}return a},batchCalls:t=>function(){for(var e=arguments.length,r=Array(e),i=0;i{t(...r)})},schedule:s,setNotifyFunction:t=>{r=t},setBatchNotifyFunction:t=>{i=t},setScheduler:t=>{n=t}}}(),uJ=class{subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}},uZ=new(x=new WeakMap,b=new WeakMap,_=new WeakMap,class extends uJ{onSubscribe(){uS(this,b)||this.setEventListener(uS(this,_))}onUnsubscribe(){var t;this.hasListeners()||(null==(t=uS(this,b))||t.call(this),uk(this,b,void 0))}setEventListener(t){var e;uk(this,_,t),null==(e=uS(this,b))||e.call(this),uk(this,b,t(t=>{"boolean"==typeof t?this.setFocused(t):this.onFocus()}))}setFocused(t){uS(this,x)!==t&&(uk(this,x,t),this.onFocus())}onFocus(){let t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){var t;return"boolean"==typeof uS(this,x)?uS(this,x):(null==(t=globalThis.document)?void 0:t.visibilityState)!=="hidden"}constructor(){super(),uO(this,x,{writable:!0,value:void 0}),uO(this,b,{writable:!0,value:void 0}),uO(this,_,{writable:!0,value:void 0}),uk(this,_,t=>{if(!uj&&window.addEventListener){let e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}})}}),u$=new(w=new WeakMap,C=new WeakMap,S=new WeakMap,class extends uJ{onSubscribe(){uS(this,C)||this.setEventListener(uS(this,S))}onUnsubscribe(){var t;this.hasListeners()||(null==(t=uS(this,C))||t.call(this),uk(this,C,void 0))}setEventListener(t){var e;uk(this,S,t),null==(e=uS(this,C))||e.call(this),uk(this,C,t(this.setOnline.bind(this)))}setOnline(t){uS(this,w)!==t&&(uk(this,w,t),this.listeners.forEach(e=>{e(t)}))}isOnline(){return uS(this,w)}constructor(){super(),uO(this,w,{writable:!0,value:!0}),uO(this,C,{writable:!0,value:void 0}),uO(this,S,{writable:!0,value:void 0}),uk(this,S,t=>{if(!uj&&window.addEventListener){let e=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",r)}}})}});function u0(t){return Math.min(1e3*2**t,3e4)}function u1(t){return(null!=t?t:"online")!=="online"||u$.isOnline()}var u2=class extends Error{constructor(t){super("CancelledError"),this.revert=null==t?void 0:t.revert,this.silent=null==t?void 0:t.silent}};function u5(t){let e,r=!1,i=0,n=function(){let t,e,r=new Promise((r,i)=>{t=r,e=i});function i(t){Object.assign(r,t),delete r.resolve,delete r.reject}return r.status="pending",r.catch(()=>{}),r.resolve=e=>{i({status:"fulfilled",value:e}),t(e)},r.reject=t=>{i({status:"rejected",reason:t}),e(t)},r}(),s=()=>uZ.isFocused()&&("always"===t.networkMode||u$.isOnline())&&t.canRun(),a=()=>u1(t.networkMode)&&t.canRun(),o=t=>{"pending"===n.status&&(null==e||e(),n.resolve(t))},l=t=>{"pending"===n.status&&(null==e||e(),n.reject(t))},h=()=>new Promise(r=>{var i;e=t=>{("pending"!==n.status||s())&&r(t)},null==(i=t.onPause)||i.call(t)}).then(()=>{if(e=void 0,"pending"===n.status){var r;null==(r=t.onContinue)||r.call(t)}}),c=()=>{let e;if("pending"!==n.status)return;let a=0===i?t.initialPromise:void 0;try{e=null!=a?a:t.fn()}catch(t){e=Promise.reject(t)}Promise.resolve(e).then(o).catch(e=>{var a,o,u;if("pending"!==n.status)return;let d=null!=(o=t.retry)?o:3*!uj,f=null!=(u=t.retryDelay)?u:u0,g="function"==typeof f?f(i,e):f,p=!0===d||"number"==typeof d&&i{uD.setTimeout(t,g)}).then(()=>s()?void 0:h()).then(()=>{r?l(e):c()})})};return{promise:n,status:()=>n.status,cancel:e=>{if("pending"===n.status){var r;let i=new u2(e);l(i),null==(r=t.onCancel)||r.call(t,i)}},continue:()=>(null==e||e(),n),cancelRetry:()=>{r=!0},continueRetry:()=>{r=!1},canStart:a,start:()=>(a()?c():h().then(c),n)}}var u4=(T=new WeakMap,class{destroy(){this.clearGcTimeout()}scheduleGc(){var t;this.clearGcTimeout(),"number"==typeof(t=this.gcTime)&&t>=0&&t!==1/0&&uk(this,T,uD.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,null!=t?t:uj?1/0:3e5)}clearGcTimeout(){uS(this,T)&&(uD.clearTimeout(uS(this,T)),uk(this,T,void 0))}constructor(){uO(this,T,{writable:!0,value:void 0})}}),u3=(O=new WeakMap,k=new WeakMap,M=new WeakMap,E=new WeakMap,D=new WeakMap,j=new WeakMap,A=new WeakMap,P=new WeakSet,class extends u4{get meta(){return this.options.meta}get promise(){var t;return null==(t=uS(this,D))?void 0:t.promise}setOptions(t){if(this.options={...uS(this,j),...t},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){let t=u9(this.options);void 0!==t.data&&(this.setData(t.data,{updatedAt:t.dataUpdatedAt,manual:!0}),uk(this,O,t))}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||uS(this,M).remove(this)}setData(t,e){var r,i;let n=(r=this.state.data,"function"==typeof(i=this.options).structuralSharing?i.structuralSharing(r,t):!1!==i.structuralSharing?function t(e,r){if(e===r)return e;let i=uW(e)&&uW(r);if(!i&&!(uU(e)&&uU(r)))return r;let n=(i?e:Object.keys(e)).length,s=i?r:Object.keys(r),a=s.length,o=i?Array(a):{},l=0;for(let h=0;h{var e;return!1!==(e=t.options.enabled,"function"==typeof e?e(this):e)})}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===uz||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0&&this.observers.some(t=>"static"===uP(t.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return void 0===this.state.data||"static"!==t&&(!!this.state.isInvalidated||!Math.max(this.state.dataUpdatedAt+(t||0)-Date.now(),0))}onFocus(){var t;let e=this.observers.find(t=>t.shouldFetchOnWindowFocus());null==e||e.refetch({cancelRefetch:!1}),null==(t=uS(this,D))||t.continue()}onOnline(){var t;let e=this.observers.find(t=>t.shouldFetchOnReconnect());null==e||e.refetch({cancelRefetch:!1}),null==(t=uS(this,D))||t.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),uS(this,M).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(e=>e!==t),this.observers.length||(uS(this,D)&&(uS(this,A)?uS(this,D).cancel({revert:!0}):uS(this,D).cancelRetry()),this.scheduleGc()),uS(this,M).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||uG(this,P,u6).call(this,{type:"invalidate"})}async fetch(t,e){var r,i,n,s,a,o,l,h,c,u,d,f;if("idle"!==this.state.fetchStatus&&(null==(r=uS(this,D))?void 0:r.status())!=="rejected"){if(void 0!==this.state.data&&(null==e?void 0:e.cancelRefetch))this.cancel({silent:!0});else if(uS(this,D))return uS(this,D).continueRetry(),uS(this,D).promise}if(t&&this.setOptions(t),!this.options.queryFn){let t=this.observers.find(t=>t.options.queryFn);t&&this.setOptions(t.options)}let g=new AbortController,p=t=>{Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(uk(this,A,!0),g.signal)})},m=()=>{let t=uY(this.options,e),r=(()=>{let t={client:uS(this,E),queryKey:this.queryKey,meta:this.meta};return p(t),t})();return(uk(this,A,!1),this.options.persister)?this.options.persister(t,r,this):t(r)},y=(()=>{let t={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:uS(this,E),state:this.state,fetchFn:m};return p(t),t})();null==(i=this.options.behavior)||i.onFetch(y,this),uk(this,k,this.state),("idle"===this.state.fetchStatus||this.state.fetchMeta!==(null==(n=y.fetchOptions)?void 0:n.meta))&&uG(this,P,u6).call(this,{type:"fetch",meta:null==(s=y.fetchOptions)?void 0:s.meta}),uk(this,D,u5({initialPromise:null==e?void 0:e.initialPromise,fn:y.fetchFn,onCancel:t=>{t instanceof u2&&t.revert&&this.setState({...uS(this,k),fetchStatus:"idle"}),g.abort()},onFail:(t,e)=>{uG(this,P,u6).call(this,{type:"failed",failureCount:t,error:e})},onPause:()=>{uG(this,P,u6).call(this,{type:"pause"})},onContinue:()=>{uG(this,P,u6).call(this,{type:"continue"})},retry:y.options.retry,retryDelay:y.options.retryDelay,networkMode:y.options.networkMode,canRun:()=>!0}));try{let t=await uS(this,D).start();if(void 0===t)throw Error("".concat(this.queryHash," data is undefined"));return this.setData(t),null==(a=(o=uS(this,M).config).onSuccess)||a.call(o,t,this),null==(l=(h=uS(this,M).config).onSettled)||l.call(h,t,this.state.error,this),t}catch(t){if(t instanceof u2){if(t.silent)return uS(this,D).promise;else if(t.revert){if(void 0===this.state.data)throw t;return this.state.data}}throw uG(this,P,u6).call(this,{type:"error",error:t}),null==(c=(u=uS(this,M).config).onError)||c.call(u,t,this),null==(d=(f=uS(this,M).config).onSettled)||d.call(f,this.state.data,t,this),t}finally{this.scheduleGc()}}constructor(t){var e;super(),uq(this,P),uO(this,O,{writable:!0,value:void 0}),uO(this,k,{writable:!0,value:void 0}),uO(this,M,{writable:!0,value:void 0}),uO(this,E,{writable:!0,value:void 0}),uO(this,D,{writable:!0,value:void 0}),uO(this,j,{writable:!0,value:void 0}),uO(this,A,{writable:!0,value:void 0}),uk(this,A,!1),uk(this,j,t.defaultOptions),this.setOptions(t.options),this.observers=[],uk(this,E,t.client),uk(this,M,uS(this,E).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,uk(this,O,u9(this.options)),this.state=null!=(e=t.state)?e:uS(this,O),this.scheduleGc()}});function u9(t){let e="function"==typeof t.initialData?t.initialData():t.initialData,r=void 0!==e,i=r?"function"==typeof t.initialDataUpdatedAt?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:r?null!=i?i:Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}function u6(t){let e=e=>{var r,i,n;switch(t.type){case"failed":return{...e,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...e,fetchStatus:"paused"};case"continue":return{...e,fetchStatus:"fetching"};case"fetch":return{...e,...(n=e.data,{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:u1(this.options.networkMode)?"fetching":"paused",...void 0===n&&{error:null,status:"pending"}}),fetchMeta:null!=(r=t.meta)?r:null};case"success":let s={...e,data:t.data,dataUpdateCount:e.dataUpdateCount+1,dataUpdatedAt:null!=(i=t.dataUpdatedAt)?i:Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return uk(this,k,t.manual?s:void 0),s;case"error":let a=t.error;return{...e,error:a,errorUpdateCount:e.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:e.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error"};case"invalidate":return{...e,isInvalidated:!0};case"setState":return{...e,...t.state}}};this.state=e(this.state),uQ.batch(()=>{this.observers.forEach(t=>{t.onQueryUpdate()}),uS(this,M).notify({query:this,type:"updated",action:t})})}var u8=(F=new WeakMap,class extends uJ{build(t,e,r){var i;let n=e.queryKey,s=null!=(i=e.queryHash)?i:uR(n,e),a=this.get(s);return a||(a=new u3({client:t,queryKey:n,queryHash:s,options:t.defaultQueryOptions(e),state:r,defaultOptions:t.getQueryDefaults(n)}),this.add(a)),a}add(t){uS(this,F).has(t.queryHash)||(uS(this,F).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){let e=uS(this,F).get(t.queryHash);e&&(t.destroy(),e===t&&uS(this,F).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){uQ.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return uS(this,F).get(t)}getAll(){return[...uS(this,F).values()]}find(t){let e={exact:!0,...t};return this.getAll().find(t=>uF(e,t))}findAll(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.getAll();return Object.keys(t).length>0?e.filter(e=>uF(t,e)):e}notify(t){uQ.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){uQ.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){uQ.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}constructor(t={}){super(),uO(this,F,{writable:!0,value:void 0}),this.config=t,uk(this,F,new Map)}}),u7=(L=new WeakMap,R=new WeakMap,I=new WeakMap,B=new WeakMap,N=new WeakSet,class extends u4{setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){uS(this,R).includes(t)||(uS(this,R).push(t),this.clearGcTimeout(),uS(this,I).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){uk(this,R,uS(this,R).filter(e=>e!==t)),this.scheduleGc(),uS(this,I).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){uS(this,R).length||("pending"===this.state.status?this.scheduleGc():uS(this,I).remove(this))}continue(){var t,e;return null!=(e=null==(t=uS(this,B))?void 0:t.continue())?e:this.execute(this.state.variables)}async execute(t){var e,r,i,n,s,a,o,l,h,c,u,d,f,g,p,m,y,x,b,_,w;let C=()=>{uG(this,N,dt).call(this,{type:"continue"})},S={client:uS(this,L),meta:this.options.meta,mutationKey:this.options.mutationKey};uk(this,B,u5({fn:()=>this.options.mutationFn?this.options.mutationFn(t,S):Promise.reject(Error("No mutationFn found")),onFail:(t,e)=>{uG(this,N,dt).call(this,{type:"failed",failureCount:t,error:e})},onPause:()=>{uG(this,N,dt).call(this,{type:"pause"})},onContinue:C,retry:null!=(e=this.options.retry)?e:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>uS(this,I).canRun(this)}));let T="pending"===this.state.status,O=!uS(this,B).canStart();try{if(T)C();else{uG(this,N,dt).call(this,{type:"pending",variables:t,isPaused:O}),await (null==(c=(u=uS(this,I).config).onMutate)?void 0:c.call(u,t,this,S));let e=await (null==(d=(f=this.options).onMutate)?void 0:d.call(f,t,S));e!==this.state.context&&uG(this,N,dt).call(this,{type:"pending",context:e,variables:t,isPaused:O})}let e=await uS(this,B).start();return await (null==(r=(i=uS(this,I).config).onSuccess)?void 0:r.call(i,e,t,this.state.context,this,S)),await (null==(n=(s=this.options).onSuccess)?void 0:n.call(s,e,t,this.state.context,S)),await (null==(a=(o=uS(this,I).config).onSettled)?void 0:a.call(o,e,null,this.state.variables,this.state.context,this,S)),await (null==(l=(h=this.options).onSettled)?void 0:l.call(h,e,null,t,this.state.context,S)),uG(this,N,dt).call(this,{type:"success",data:e}),e}catch(e){try{throw await (null==(g=(p=uS(this,I).config).onError)?void 0:g.call(p,e,t,this.state.context,this,S)),await (null==(m=(y=this.options).onError)?void 0:m.call(y,e,t,this.state.context,S)),await (null==(x=(b=uS(this,I).config).onSettled)?void 0:x.call(b,void 0,e,this.state.variables,this.state.context,this,S)),await (null==(_=(w=this.options).onSettled)?void 0:_.call(w,void 0,e,t,this.state.context,S)),e}finally{uG(this,N,dt).call(this,{type:"error",error:e})}}finally{uS(this,I).runNext(this)}}constructor(t){super(),uq(this,N),uO(this,L,{writable:!0,value:void 0}),uO(this,R,{writable:!0,value:void 0}),uO(this,I,{writable:!0,value:void 0}),uO(this,B,{writable:!0,value:void 0}),uk(this,L,t.client),this.mutationId=t.mutationId,uk(this,I,t.mutationCache),uk(this,R,[]),this.state=t.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(t.options),this.scheduleGc()}});function dt(t){this.state=(e=>{switch(t.type){case"failed":return{...e,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...e,isPaused:!0};case"continue":return{...e,isPaused:!1};case"pending":return{...e,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...e,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...e,data:void 0,error:t.error,failureCount:e.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}})(this.state),uQ.batch(()=>{uS(this,R).forEach(e=>{e.onMutationUpdate(t)}),uS(this,I).notify({mutation:this,type:"updated",action:t})})}var de=(W=new WeakMap,U=new WeakMap,H=new WeakMap,class extends uJ{build(t,e,r){let i=new u7({client:t,mutationCache:this,mutationId:++uM(this,H).value,options:t.defaultMutationOptions(e),state:r});return this.add(i),i}add(t){uS(this,W).add(t);let e=dr(t);if("string"==typeof e){let r=uS(this,U).get(e);r?r.push(t):uS(this,U).set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(uS(this,W).delete(t)){let e=dr(t);if("string"==typeof e){let r=uS(this,U).get(e);if(r)if(r.length>1){let e=r.indexOf(t);-1!==e&&r.splice(e,1)}else r[0]===t&&uS(this,U).delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){let e=dr(t);if("string"!=typeof e)return!0;{let r=uS(this,U).get(e),i=null==r?void 0:r.find(t=>"pending"===t.state.status);return!i||i===t}}runNext(t){let e=dr(t);if("string"!=typeof e)return Promise.resolve();{var r,i;let n=null==(r=uS(this,U).get(e))?void 0:r.find(e=>e!==t&&e.state.isPaused);return null!=(i=null==n?void 0:n.continue())?i:Promise.resolve()}}clear(){uQ.batch(()=>{uS(this,W).forEach(t=>{this.notify({type:"removed",mutation:t})}),uS(this,W).clear(),uS(this,U).clear()})}getAll(){return Array.from(uS(this,W))}find(t){let e={exact:!0,...t};return this.getAll().find(t=>uL(e,t))}findAll(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.getAll().filter(e=>uL(t,e))}notify(t){uQ.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){let t=this.getAll().filter(t=>t.state.isPaused);return uQ.batch(()=>Promise.all(t.map(t=>t.continue().catch(uA))))}constructor(t={}){super(),uO(this,W,{writable:!0,value:void 0}),uO(this,U,{writable:!0,value:void 0}),uO(this,H,{writable:!0,value:void 0}),this.config=t,uk(this,W,new Set),uk(this,U,new Map),uk(this,H,0)}});function dr(t){var e;return null==(e=t.options.scope)?void 0:e.id}function di(t){return{onFetch:(e,r)=>{var i,n,s,a,o;let l=e.options,h=null==(s=e.fetchOptions)||null==(n=s.meta)||null==(i=n.fetchMore)?void 0:i.direction,c=(null==(a=e.state.data)?void 0:a.pages)||[],u=(null==(o=e.state.data)?void 0:o.pageParams)||[],d={pages:[],pageParams:[]},f=0,g=async()=>{let r=!1,i=uY(e.options,e.fetchOptions),n=async(t,n,s)=>{if(r)return Promise.reject();if(null==n&&t.pages.length)return Promise.resolve(t);let a=(()=>{let t={client:e.client,queryKey:e.queryKey,pageParam:n,direction:s?"backward":"forward",meta:e.options.meta};return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(e.signal.aborted?r=!0:e.signal.addEventListener("abort",()=>{r=!0}),e.signal)}),t})(),o=await i(a),{maxPages:l}=e.options,h=s?uV:uX;return{pages:h(t.pages,o,l),pageParams:h(t.pageParams,n,l)}};if(h&&c.length){let t="backward"===h,e={pages:c,pageParams:u},r=(t?function(t,e){var r;let{pages:i,pageParams:n}=e;return i.length>0?null==(r=t.getPreviousPageParam)?void 0:r.call(t,i[0],i,n[0],n):void 0}:dn)(l,e);d=await n(e,r,t)}else{let e=null!=t?t:c.length;do{var s;let t=0===f?null!=(s=u[0])?s:l.initialPageParam:dn(l,d);if(f>0&&null==t)break;d=await n(d,t),f++}while(f{var t,i;return null==(t=(i=e.options).persister)?void 0:t.call(i,g,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},r)}:e.fetchFn=g}}}function dn(t,e){let{pages:r,pageParams:i}=e,n=r.length-1;return r.length>0?t.getNextPageParam(r[n],r,i[n],i):void 0}let ds=new(X=new WeakMap,V=new WeakMap,z=new WeakMap,Y=new WeakMap,G=new WeakMap,q=new WeakMap,K=new WeakMap,Q=new WeakMap,class{mount(){uM(this,q).value++,1===uS(this,q)&&(uk(this,K,uZ.subscribe(async t=>{t&&(await this.resumePausedMutations(),uS(this,X).onFocus())})),uk(this,Q,u$.subscribe(async t=>{t&&(await this.resumePausedMutations(),uS(this,X).onOnline())})))}unmount(){var t,e;uM(this,q).value--,0===uS(this,q)&&(null==(t=uS(this,K))||t.call(this),uk(this,K,void 0),null==(e=uS(this,Q))||e.call(this),uk(this,Q,void 0))}isFetching(t){return uS(this,X).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return uS(this,V).findAll({...t,status:"pending"}).length}getQueryData(t){var e;let r=this.defaultQueryOptions({queryKey:t});return null==(e=uS(this,X).get(r.queryHash))?void 0:e.state.data}ensureQueryData(t){let e=this.defaultQueryOptions(t),r=uS(this,X).build(this,e),i=r.state.data;return void 0===i?this.fetchQuery(t):(t.revalidateIfStale&&r.isStaleByTime(uP(e.staleTime,r))&&this.prefetchQuery(e),Promise.resolve(i))}getQueriesData(t){return uS(this,X).findAll(t).map(t=>{let{queryKey:e,state:r}=t;return[e,r.data]})}setQueryData(t,e,r){let i=this.defaultQueryOptions({queryKey:t}),n=uS(this,X).get(i.queryHash),s=null==n?void 0:n.state.data,a="function"==typeof e?e(s):e;if(void 0!==a)return uS(this,X).build(this,i).setData(a,{...r,manual:!0})}setQueriesData(t,e,r){return uQ.batch(()=>uS(this,X).findAll(t).map(t=>{let{queryKey:i}=t;return[i,this.setQueryData(i,e,r)]}))}getQueryState(t){var e;let r=this.defaultQueryOptions({queryKey:t});return null==(e=uS(this,X).get(r.queryHash))?void 0:e.state}removeQueries(t){let e=uS(this,X);uQ.batch(()=>{e.findAll(t).forEach(t=>{e.remove(t)})})}resetQueries(t,e){let r=uS(this,X);return uQ.batch(()=>(r.findAll(t).forEach(t=>{t.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={revert:!0,...e};return Promise.all(uQ.batch(()=>uS(this,X).findAll(t).map(t=>t.cancel(r)))).then(uA).catch(uA)}invalidateQueries(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return uQ.batch(()=>{var r,i;return(uS(this,X).findAll(t).forEach(t=>{t.invalidate()}),(null==t?void 0:t.refetchType)==="none")?Promise.resolve():this.refetchQueries({...t,type:null!=(i=null!=(r=null==t?void 0:t.refetchType)?r:null==t?void 0:t.type)?i:"active"},e)})}refetchQueries(t){var e;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i={...r,cancelRefetch:null==(e=r.cancelRefetch)||e};return Promise.all(uQ.batch(()=>uS(this,X).findAll(t).filter(t=>!t.isDisabled()&&!t.isStatic()).map(t=>{let e=t.fetch(void 0,i);return i.throwOnError||(e=e.catch(uA)),"paused"===t.state.fetchStatus?Promise.resolve():e}))).then(uA)}fetchQuery(t){let e=this.defaultQueryOptions(t);void 0===e.retry&&(e.retry=!1);let r=uS(this,X).build(this,e);return r.isStaleByTime(uP(e.staleTime,r))?r.fetch(e):Promise.resolve(r.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(uA).catch(uA)}fetchInfiniteQuery(t){return t.behavior=di(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(uA).catch(uA)}ensureInfiniteQueryData(t){return t.behavior=di(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return u$.isOnline()?uS(this,V).resumePausedMutations():Promise.resolve()}getQueryCache(){return uS(this,X)}getMutationCache(){return uS(this,V)}getDefaultOptions(){return uS(this,z)}setDefaultOptions(t){uk(this,z,t)}setQueryDefaults(t,e){uS(this,Y).set(uI(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){let e=[...uS(this,Y).values()],r={};return e.forEach(e=>{uB(t,e.queryKey)&&Object.assign(r,e.defaultOptions)}),r}setMutationDefaults(t,e){uS(this,G).set(uI(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){let e=[...uS(this,G).values()],r={};return e.forEach(e=>{uB(t,e.mutationKey)&&Object.assign(r,e.defaultOptions)}),r}defaultQueryOptions(t){if(t._defaulted)return t;let e={...uS(this,z).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=uR(e.queryKey,e)),void 0===e.refetchOnReconnect&&(e.refetchOnReconnect="always"!==e.networkMode),void 0===e.throwOnError&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===uz&&(e.enabled=!1),e}defaultMutationOptions(t){return(null==t?void 0:t._defaulted)?t:{...uS(this,z).mutations,...(null==t?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){uS(this,X).clear(),uS(this,V).clear()}constructor(t={}){uO(this,X,{writable:!0,value:void 0}),uO(this,V,{writable:!0,value:void 0}),uO(this,z,{writable:!0,value:void 0}),uO(this,Y,{writable:!0,value:void 0}),uO(this,G,{writable:!0,value:void 0}),uO(this,q,{writable:!0,value:void 0}),uO(this,K,{writable:!0,value:void 0}),uO(this,Q,{writable:!0,value:void 0}),uk(this,X,t.queryCache||new u8),uk(this,V,t.mutationCache||new de),uk(this,z,t.defaultOptions||{}),uk(this,Y,new Map),uk(this,G,new Map),uk(this,q,0)}})({defaultOptions:{queries:{queryFn:async function(t){let{queryKey:e}=t,[r]=e;return(0,c_.imageUrlToArrayBuffer)(r)},staleTime:1/0,gcTime:6e4,refetchOnWindowFocus:!1,refetchOnReconnect:!1}}});function da(){return(0,J.jsx)(J.Fragment,{children:(0,J.jsx)(u_,{client:ds,children:(0,J.jsx)("main",{children:(0,J.jsx)(uw,{children:(0,J.jsx)(Z.Suspense,{children:(0,J.jsx)(cJ,{children:(0,J.jsx)(uo,{children:(0,J.jsxs)(ul,{children:[(0,J.jsxs)("div",{className:"Viewport",children:[(0,J.jsxs)("div",{className:"ModelTools",children:[(0,J.jsx)("div",{className:"Field",children:(0,J.jsx)(ue,{})}),(0,J.jsx)("div",{className:"Field SliderField",children:(0,J.jsx)(ur,{})}),(0,J.jsx)("div",{className:"Field",children:(0,J.jsx)(ua,{})})]}),(0,J.jsx)(ut,{})]}),(0,J.jsx)(cO,{children:(0,J.jsx)(cS,{children:(0,J.jsxs)(ck,{children:[(0,J.jsx)(cH,{}),(0,J.jsxs)("div",{className:"CanvasViewport",children:[(0,J.jsxs)("div",{className:"CanvasSelector",children:[(0,J.jsx)(cM,{}),(0,J.jsx)(uc,{})]}),(0,J.jsx)(cT,{}),(0,J.jsx)(ux,{})]}),(0,J.jsx)(cp,{}),(0,J.jsx)(cm,{})]})})})]})})})})})})})})}}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/d63fc3798baf75bd.js b/docs/_next/static/chunks/d63fc3798baf75bd.js new file mode 100644 index 0000000..dbd059f --- /dev/null +++ b/docs/_next/static/chunks/d63fc3798baf75bd.js @@ -0,0 +1 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,34582,(t,e,r)=>{"use strict";r.byteLength=function(t){var e=f(t),r=e[0],n=e[1];return(r+n)*3/4-n},r.toByteArray=function(t){var e,r,n=f(t),a=n[0],s=n[1],u=new o((a+s)*3/4-s),l=0,c=s>0?a-4:a;for(r=0;r>16&255,u[l++]=e>>8&255,u[l++]=255&e;return 2===s&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,u[l++]=255&e),1===s&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,u[l++]=e>>8&255,u[l++]=255&e),u},r.fromByteArray=function(t){for(var e,r=t.length,i=r%3,o=[],a=0,s=r-i;a>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return o.join("")}(t,a,a+16383>s?s:a+16383));return 1===i?o.push(n[(e=t[r-1])>>2]+n[e<<4&63]+"=="):2===i&&o.push(n[(e=(t[r-2]<<8)+t[r-1])>>10]+n[e>>4&63]+n[e<<2&63]+"="),o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s0)throw Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");-1===r&&(r=e);var n=r===e?0:4-r%4;return[r,n]}i[45]=62,i[95]=63},38492,(t,e,r)=>{r.read=function(t,e,r,n,i){var o,a,s=8*i-n-1,u=(1<>1,l=-7,c=r?i-1:0,h=r?-1:1,d=t[e+c];for(c+=h,o=d&(1<<-l)-1,d>>=-l,l+=s;l>0;o=256*o+t[e+c],c+=h,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=n;l>0;a=256*a+t[e+c],c+=h,l-=8);if(0===o)o=1-f;else{if(o===u)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),o-=f}return(d?-1:1)*a*Math.pow(2,o-n)},r.write=function(t,e,r,n,i,o){var a,s,u,f=8*o-i-1,l=(1<>1,h=5960464477539062e-23*(23===i),d=n?0:o-1,p=n?1:-1,y=+(e<0||0===e&&1/e<0);for(isNaN(e=Math.abs(e))||e===1/0?(s=+!!isNaN(e),a=l):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),a+c>=1?e+=h/u:e+=h*Math.pow(2,1-c),e*u>=2&&(a++,u/=2),a+c>=l?(s=0,a=l):a+c>=1?(s=(e*u-1)*Math.pow(2,i),a+=c):(s=e*Math.pow(2,c-1)*Math.pow(2,i),a=0));i>=8;t[r+d]=255&s,d+=p,s/=256,i-=8);for(a=a<0;t[r+d]=255&a,d+=p,a/=256,f-=8);t[r+d-p]|=128*y}},43943,(t,e,r)=>{"use strict";var n=t.r(34582),i=t.r(38492),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function a(t){if(t>0x7fffffff)throw RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,s.prototype),e}function s(t,e,r){if("number"==typeof t){if("string"==typeof e)throw TypeError('The "string" argument must be of type string. Received type number');return l(t)}return u(t,e,r)}function u(t,e,r){if("string"==typeof t){var n=t,i=e;if(("string"!=typeof i||""===i)&&(i="utf8"),!s.isEncoding(i))throw TypeError("Unknown encoding: "+i);var o=0|p(n,i),u=a(o),f=u.write(n,i);return f!==o&&(u=u.slice(0,f)),u}if(ArrayBuffer.isView(t)){var l=t;if(C(l,Uint8Array)){var y=new Uint8Array(l);return h(y.buffer,y.byteOffset,y.byteLength)}return c(l)}if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(C(t,ArrayBuffer)||t&&C(t.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(C(t,SharedArrayBuffer)||t&&C(t.buffer,SharedArrayBuffer)))return h(t,e,r);if("number"==typeof t)throw TypeError('The "value" argument must not be of type number. Received type number');var g=t.valueOf&&t.valueOf();if(null!=g&&g!==t)return s.from(g,e,r);var m=function(t){if(s.isBuffer(t)){var e=0|d(t.length),r=a(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||function(t){return t!=t}(t.length)?a(0):c(t):"Buffer"===t.type&&Array.isArray(t.data)?c(t.data):void 0}(t);if(m)return m;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return s.from(t[Symbol.toPrimitive]("string"),e,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function f(t){if("number"!=typeof t)throw TypeError('"size" argument must be of type number');if(t<0)throw RangeError('The value "'+t+'" is invalid for option "size"')}function l(t){return f(t),a(t<0?0:0|d(t))}function c(t){for(var e=t.length<0?0:0|d(t.length),r=a(e),n=0;n=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|t}function p(t,e){if(s.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||C(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return A(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return O(t).length;default:if(i)return n?-1:A(t).length;e=(""+e).toLowerCase(),i=!0}}function y(t,e,r){var i,o,a,s=!1;if((void 0===e||e<0)&&(e=0),e>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(e>>>=0)))return"";for(t||(t="utf8");;)switch(t){case"hex":return function(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=e;o0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),(o=r*=1)!=o&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length)if(i)return -1;else r=t.length-1;else if(r<0)if(!i)return -1;else r=0;if("string"==typeof e&&(e=s.from(e,n)),s.isBuffer(e))return 0===e.length?-1:b(t,e,r,n,i);if("number"==typeof e){if(e&=255,"function"==typeof Uint8Array.prototype.indexOf)if(i)return Uint8Array.prototype.indexOf.call(t,e,r);else return Uint8Array.prototype.lastIndexOf.call(t,e,r);return b(t,[e],r,n,i)}throw TypeError("val must be string, number or Buffer")}function b(t,e,r,n,i){var o,a=1,s=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return -1;a=2,s/=2,u/=2,r/=2}function f(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var l=-1;for(o=r;os&&(r=s-u),o=r;o>=0;o--){for(var c=!0,h=0;h239?4:f>223?3:f>191?2:1;if(i+c<=r)switch(c){case 1:f<128&&(l=f);break;case 2:(192&(o=t[i+1]))==128&&(u=(31&f)<<6|63&o)>127&&(l=u);break;case 3:o=t[i+1],a=t[i+2],(192&o)==128&&(192&a)==128&&(u=(15&f)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:o=t[i+1],a=t[i+2],s=t[i+3],(192&o)==128&&(192&a)==128&&(192&s)==128&&(u=(15&f)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,c=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),i+=c}var h=n,d=h.length;if(d<=4096)return String.fromCharCode.apply(String,h);for(var p="",y=0;yr)throw RangeError("Trying to access beyond buffer length")}function w(t,e,r,n,i,o){if(!s.isBuffer(t))throw TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw RangeError("Index out of range")}function S(t,e,r,n,i,o){if(r+n>t.length||r<0)throw RangeError("Index out of range")}function k(t,e,r,n,o){return e*=1,r>>>=0,o||S(t,e,r,4,34028234663852886e22,-34028234663852886e22),i.write(t,e,r,n,23,4),r+4}function E(t,e,r,n,o){return e*=1,r>>>=0,o||S(t,e,r,8,17976931348623157e292,-17976931348623157e292),i.write(t,e,r,n,52,8),r+8}r.Buffer=s,r.SlowBuffer=function(t){return+t!=t&&(t=0),s.alloc(+t)},r.INSPECT_MAX_BYTES=50,r.kMaxLength=0x7fffffff,s.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),s.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}}),s.poolSize=8192,s.from=function(t,e,r){return u(t,e,r)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array),s.alloc=function(t,e,r){return(f(t),t<=0)?a(t):void 0!==e?"string"==typeof r?a(t).fill(e,r):a(t).fill(e):a(t)},s.allocUnsafe=function(t){return l(t)},s.allocUnsafeSlow=function(t){return l(t)},s.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==s.prototype},s.compare=function(t,e){if(C(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),C(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(t)||!s.isBuffer(e))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);in.length?s.from(o).copy(n,i):Uint8Array.prototype.set.call(n,o,i);else if(s.isBuffer(o))o.copy(n,i);else throw TypeError('"list" argument must be an Array of Buffers');i+=o.length}return n},s.byteLength=p,s.prototype._isBuffer=!0,s.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;ee&&(t+=" ... "),""},o&&(s.prototype[o]=s.prototype.inspect),s.prototype.compare=function(t,e,r,n,i){if(C(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(t))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return -1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,i>>>=0,this===t)return 0;for(var o=i-n,a=r-e,u=Math.min(o,a),f=this.slice(n,i),l=t.slice(e,r),c=0;c>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i,o,a,s,u,f,l,c,h=this.length-e;if((void 0===r||r>h)&&(r=h),t.length>0&&(r<0||e<0)||e>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var d=!1;;)switch(n){case"hex":return function(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=e.length;n>o/2&&(n=o/2);for(var a=0;a>8,i.push(r%256),i.push(n);return i}(t,this.length-l),this,l,c);default:if(d)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),d=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},s.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||_(t,e,this.length);for(var n=this[t],i=1,o=0;++o>>=0,e>>>=0,r||_(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},s.prototype.readUint8=s.prototype.readUInt8=function(t,e){return t>>>=0,e||_(t,1,this.length),this[t]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(t,e){return t>>>=0,e||_(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(t,e){return t>>>=0,e||_(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(t,e){return t>>>=0,e||_(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+0x1000000*this[t+3]},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(t,e){return t>>>=0,e||_(t,4,this.length),0x1000000*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||_(t,e,this.length);for(var n=this[t],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*e)),n},s.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||_(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},s.prototype.readInt8=function(t,e){return(t>>>=0,e||_(t,1,this.length),128&this[t])?-((255-this[t]+1)*1):this[t]},s.prototype.readInt16LE=function(t,e){t>>>=0,e||_(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?0xffff0000|r:r},s.prototype.readInt16BE=function(t,e){t>>>=0,e||_(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?0xffff0000|r:r},s.prototype.readInt32LE=function(t,e){return t>>>=0,e||_(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return t>>>=0,e||_(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,e){return t>>>=0,e||_(t,4,this.length),i.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return t>>>=0,e||_(t,4,this.length),i.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return t>>>=0,e||_(t,8,this.length),i.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return t>>>=0,e||_(t,8,this.length),i.read(this,t,!1,52,8)},s.prototype.writeUintLE=s.prototype.writeUIntLE=function(t,e,r,n){if(t*=1,e>>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;w(this,t,e,r,i,0)}var o=1,a=0;for(this[e]=255&t;++a>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;w(this,t,e,r,i,0)}var o=r-1,a=1;for(this[e+o]=255&t;--o>=0&&(a*=256);)this[e+o]=t/a&255;return e+r},s.prototype.writeUint8=s.prototype.writeUInt8=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,1,255,0),this[e]=255&t,e+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,4,0xffffffff,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,4,0xffffffff,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeIntLE=function(t,e,r,n){if(t*=1,e>>>=0,!n){var i=Math.pow(2,8*r-1);w(this,t,e,r,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o>>=0,!n){var i=Math.pow(2,8*r-1);w(this,t,e,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a|0)-s&255;return e+r},s.prototype.writeInt8=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeInt16BE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeInt32LE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,4,0x7fffffff,-0x80000000),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},s.prototype.writeInt32BE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,4,0x7fffffff,-0x80000000),t<0&&(t=0xffffffff+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeFloatLE=function(t,e,r){return k(this,t,e,!0,r)},s.prototype.writeFloatBE=function(t,e,r){return k(this,t,e,!1,r)},s.prototype.writeDoubleLE=function(t,e,r){return E(this,t,e,!0,r)},s.prototype.writeDoubleBE=function(t,e,r){return E(this,t,e,!1,r)},s.prototype.copy=function(t,e,r,n){if(!s.isBuffer(t))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i55295&&r<57344){if(!i){if(r>56319||a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return o}function O(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(x,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function R(t,e,r,n){for(var i=0;i=e.length)&&!(i>=t.length);++i)e[i+r]=t[i];return i}function C(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}var T=function(){for(var t="0123456789abcdef",e=Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)e[n+i]=t[r]+t[i];return e}()},30662,(t,e,r)=>{!function(){"use strict";var t={864:function(t){var e,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};e=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var i=Number.isNaN||function(t){return t!=t};function o(){o.init.call(this)}t.exports=o,t.exports.once=function(t,e){return new Promise(function(r,n){var i,o,a;function s(r){t.removeListener(e,u),n(r)}function u(){"function"==typeof t.removeListener&&t.removeListener("error",s),r([].slice.call(arguments))}y(t,e,u,{once:!0}),"error"!==e&&(i=t,o=s,a={once:!0},"function"==typeof i.on&&y(i,"error",o,a))})},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var a=10;function s(t){if("function"!=typeof t)throw TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function u(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function f(t,e,r,n){if(s(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),a=o[e]),void 0===a)a=o[e]=r,++t._eventsCount;else if("function"==typeof a?a=o[e]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(i=u(t))>0&&a.length>i&&!a.warned){a.warned=!0;var i,o,a,f=Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=t,f.type=e,f.count=a.length,console&&console.warn&&console.warn(f)}return t}function l(){if(!this.fired)return(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0==arguments.length)?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function c(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=l.bind(n);return i.listener=r,n.wrapFn=i,i}function h(t,e,r){var n=t._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=Array(t.length),r=0;r0&&(a=e[0]),a instanceof Error)throw a;var a,s=Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=o[t];if(void 0===u)return!1;if("function"==typeof u)n(u,this,e);else for(var f=u.length,l=p(u,f),r=0;r=0;o--)if(r[o]===e||r[o].listener===e){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},o.prototype.listeners=function(t){return h(this,t,!0)},o.prototype.rawListeners=function(t){return h(this,t,!1)},o.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):d.call(t,e)},o.prototype.listenerCount=d,o.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}}},r={};function n(e){var i=r[e];if(void 0!==i)return i.exports;var o=r[e]={exports:{}},a=!0;try{t[e](o,o.exports,n),a=!1}finally{a&&delete r[e]}return o.exports}n.ab="/ROOT/node_modules/next/dist/compiled/events/",e.exports=n(864)}()},77398,(t,e,r)=>{var n=t.i(67034),i=t.i(47167);!function(){var r={992:function(t){t.exports=function(t,r,n){if(t.filter)return t.filter(r,n);if(null==t||"function"!=typeof r)throw TypeError();for(var i=[],o=0;o-1?i(r):r}},139:function(t,e,r){"use strict";var n=r(212),i=r(192),o=i("%Function.prototype.apply%"),a=i("%Function.prototype.call%"),s=i("%Reflect.apply%",!0)||n.call(a,o),u=i("%Object.getOwnPropertyDescriptor%",!0),f=i("%Object.defineProperty%",!0),l=i("%Math.max%");if(f)try{f({},"a",{value:1})}catch(t){f=null}t.exports=function(t){var e=s(n,a,arguments);return u&&f&&u(e,"length").configurable&&f(e,"length",{value:1+l(0,t.length-(arguments.length-1))}),e};var c=function(){return s(n,o,arguments)};f?f(t.exports,"apply",{value:c}):t.exports.apply=c},181:function(t){"use strict";t.exports=EvalError},545:function(t){"use strict";t.exports=Error},22:function(t){"use strict";t.exports=RangeError},803:function(t){"use strict";t.exports=ReferenceError},182:function(t){"use strict";t.exports=SyntaxError},202:function(t){"use strict";t.exports=TypeError},284:function(t){"use strict";t.exports=URIError},144:function(t){var e=Object.prototype.hasOwnProperty,r=Object.prototype.toString;t.exports=function(t,n,i){if("[object Function]"!==r.call(n))throw TypeError("iterator must be a function");var o=t.length;if(o===+o)for(var a=0;a1&&"boolean"!=typeof e)throw new f('"allowMissing" argument must be a boolean');if(null===I(/^%?[^%]*%?$/,t))throw new u("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=j(t),n=r.length>0?r[0]:"",i=L("%"+n+"%",e),o=i.name,a=i.value,s=!1,l=i.alias;l&&(n=l[0],R(r,O([0,1],l)));for(var c=1,h=!0;c=r.length){var m=d(a,p);a=(h=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:a[p]}else h=A(a,p),a=a[p];h&&!s&&(w[o]=a)}}return a}},14:function(t){"use strict";var e={__proto__:null,foo:{}},r=Object;t.exports=function(){return({__proto__:e}).foo===e.foo&&!(e instanceof r)}},942:function(t,e,r){"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(773);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},773:function(t){"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e||"[object Symbol]"!==Object.prototype.toString.call(e)||"[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length||"function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},115:function(t,e,r){"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(832);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},832:function(t){"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e||"[object Symbol]"!==Object.prototype.toString.call(e)||"[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length||"function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},270:function(t,e,r){"use strict";var n=Function.prototype.call,i=Object.prototype.hasOwnProperty;t.exports=r(212).call(n,i)},782:function(t){"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},157:function(t){"use strict";var e="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,r=Object.prototype.toString,n=function(t){return(!e||!t||"object"!=typeof t||!(Symbol.toStringTag in t))&&"[object Arguments]"===r.call(t)},i=function(t){return!!n(t)||null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==r.call(t)&&"[object Function]"===r.call(t.callee)},o=function(){return n(arguments)}();n.isLegacyArguments=i,t.exports=o?n:i},391:function(t){"use strict";var e=Object.prototype.toString,r=Function.prototype.toString,n=/^\s*(?:function)?\*/,i="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,o=Object.getPrototypeOf,a=function(){if(!i)return!1;try{return Function("return function*() {}")()}catch(t){}}(),s=a?o(a):{};t.exports=function(t){return"function"==typeof t&&(!!n.test(r.call(t))||(i?o(t)===s:"[object GeneratorFunction]"===e.call(t)))}},994:function(e,r,n){"use strict";var i=n(144),o=n(349),a=n(256),s=a("Object.prototype.toString"),u=n(942)()&&"symbol"==typeof Symbol.toStringTag,f=o(),l=a("Array.prototype.indexOf",!0)||function(t,e){for(var r=0;r-1)}},369:function(t){t.exports=function(t){return t instanceof n.Buffer}},584:function(t,e,r){"use strict";var n=r(157),i=r(391),o=r(490),a=r(994);function s(t){return t.call.bind(t)}var u="undefined"!=typeof BigInt,f="undefined"!=typeof Symbol,l=s(Object.prototype.toString),c=s(Number.prototype.valueOf),h=s(String.prototype.valueOf),d=s(Boolean.prototype.valueOf);if(u)var p=s(BigInt.prototype.valueOf);if(f)var y=s(Symbol.prototype.valueOf);function g(t,e){if("object"!=typeof t)return!1;try{return e(t),!0}catch(t){return!1}}function m(t){return"[object Map]"===l(t)}function b(t){return"[object Set]"===l(t)}function v(t){return"[object WeakMap]"===l(t)}function _(t){return"[object WeakSet]"===l(t)}function w(t){return"[object ArrayBuffer]"===l(t)}function S(t){return"undefined"!=typeof ArrayBuffer&&(w.working?w(t):t instanceof ArrayBuffer)}function k(t){return"[object DataView]"===l(t)}function E(t){return"undefined"!=typeof DataView&&(k.working?k(t):t instanceof DataView)}e.isArgumentsObject=n,e.isGeneratorFunction=i,e.isTypedArray=a,e.isPromise=function(t){return"undefined"!=typeof Promise&&t instanceof Promise||null!==t&&"object"==typeof t&&"function"==typeof t.then&&"function"==typeof t.catch},e.isArrayBufferView=function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):a(t)||E(t)},e.isUint8Array=function(t){return"Uint8Array"===o(t)},e.isUint8ClampedArray=function(t){return"Uint8ClampedArray"===o(t)},e.isUint16Array=function(t){return"Uint16Array"===o(t)},e.isUint32Array=function(t){return"Uint32Array"===o(t)},e.isInt8Array=function(t){return"Int8Array"===o(t)},e.isInt16Array=function(t){return"Int16Array"===o(t)},e.isInt32Array=function(t){return"Int32Array"===o(t)},e.isFloat32Array=function(t){return"Float32Array"===o(t)},e.isFloat64Array=function(t){return"Float64Array"===o(t)},e.isBigInt64Array=function(t){return"BigInt64Array"===o(t)},e.isBigUint64Array=function(t){return"BigUint64Array"===o(t)},m.working="undefined"!=typeof Map&&m(new Map),e.isMap=function(t){return"undefined"!=typeof Map&&(m.working?m(t):t instanceof Map)},b.working="undefined"!=typeof Set&&b(new Set),e.isSet=function(t){return"undefined"!=typeof Set&&(b.working?b(t):t instanceof Set)},v.working="undefined"!=typeof WeakMap&&v(new WeakMap),e.isWeakMap=function(t){return"undefined"!=typeof WeakMap&&(v.working?v(t):t instanceof WeakMap)},_.working="undefined"!=typeof WeakSet&&_(new WeakSet),e.isWeakSet=function(t){return _(t)},w.working="undefined"!=typeof ArrayBuffer&&w(new ArrayBuffer),e.isArrayBuffer=S,k.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&k(new DataView(new ArrayBuffer(1),0,1)),e.isDataView=E;var x="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function A(t){return"[object SharedArrayBuffer]"===l(t)}function O(t){return void 0!==x&&(void 0===A.working&&(A.working=A(new x)),A.working?A(t):t instanceof x)}function R(t){return g(t,c)}function C(t){return g(t,h)}function T(t){return g(t,d)}function I(t){return u&&g(t,p)}function B(t){return f&&g(t,y)}e.isSharedArrayBuffer=O,e.isAsyncFunction=function(t){return"[object AsyncFunction]"===l(t)},e.isMapIterator=function(t){return"[object Map Iterator]"===l(t)},e.isSetIterator=function(t){return"[object Set Iterator]"===l(t)},e.isGeneratorObject=function(t){return"[object Generator]"===l(t)},e.isWebAssemblyCompiledModule=function(t){return"[object WebAssembly.Module]"===l(t)},e.isNumberObject=R,e.isStringObject=C,e.isBooleanObject=T,e.isBigIntObject=I,e.isSymbolObject=B,e.isBoxedPrimitive=function(t){return R(t)||C(t)||T(t)||I(t)||B(t)},e.isAnyArrayBuffer=function(t){return"undefined"!=typeof Uint8Array&&(S(t)||O(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(t){Object.defineProperty(e,t,{enumerable:!1,value:function(){throw Error(t+" is not supported in userland")}})})},177:function(t,e,r){var n=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n=i)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}}),s=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),g(r)?n.showHidden=r:r&&e._extend(n,r),_(n.showHidden)&&(n.showHidden=!1),_(n.depth)&&(n.depth=2),_(n.colors)&&(n.colors=!1),_(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=l),h(n,t,n.depth)}function l(t,e){var r=f.styles[e];return r?"\x1b["+f.colors[r][0]+"m"+t+"\x1b["+f.colors[r][1]+"m":t}function c(t,e){return t}function h(t,r,n){if(t.customInspect&&r&&x(r.inspect)&&r.inspect!==e.inspect&&!(r.constructor&&r.constructor.prototype===r)){var i,o,a,s,u,f,l=r.inspect(n,t);return v(l)||(l=h(t,l,n)),l}var c=function(t,e){if(_(e))return t.stylize("undefined","undefined");if(v(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return b(e)?t.stylize(""+e,"number"):g(e)?t.stylize(""+e,"boolean"):m(e)?t.stylize("null","null"):void 0}(t,r);if(c)return c;var S=Object.keys(r),A=(u={},S.forEach(function(t,e){u[t]=!0}),u);if(t.showHidden&&(S=Object.getOwnPropertyNames(r)),E(r)&&(S.indexOf("message")>=0||S.indexOf("description")>=0))return d(r);if(0===S.length){if(x(r)){var O=r.name?": "+r.name:"";return t.stylize("[Function"+O+"]","special")}if(w(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(k(r))return t.stylize(Date.prototype.toString.call(r),"date");if(E(r))return d(r)}var R="",T=!1,I=["{","}"];if(y(r)&&(T=!0,I=["[","]"]),x(r)&&(R=" [Function"+(r.name?": "+r.name:"")+"]"),w(r)&&(R=" "+RegExp.prototype.toString.call(r)),k(r)&&(R=" "+Date.prototype.toUTCString.call(r)),E(r)&&(R=" "+d(r)),0===S.length&&(!T||0==r.length))return I[0]+R+I[1];if(n<0)if(w(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");else return t.stylize("[Object]","special");return t.seen.push(r),f=T?function(t,e,r,n,i){for(var o=[],a=0,s=e.length;a=0&&s++,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?a[0]+(""===o?"":o+"\n ")+" "+i.join(",\n ")+" "+a[1]:a[0]+o+" "+i.join(", ")+" "+a[1]}function d(t){return"["+Error.prototype.toString.call(t)+"]"}function p(t,e,r,n,i,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?s=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(s=t.stylize("[Setter]","special")),C(n,i)||(a="["+i+"]"),!s&&(0>t.seen.indexOf(u.value)?(s=m(r)?h(t,u.value,null):h(t,u.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+s.split("\n").map(function(t){return" "+t}).join("\n")):s=t.stylize("[Circular]","special")),_(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+s}function y(t){return Array.isArray(t)}function g(t){return"boolean"==typeof t}function m(t){return null===t}function b(t){return"number"==typeof t}function v(t){return"string"==typeof t}function _(t){return void 0===t}function w(t){return S(t)&&"[object RegExp]"===A(t)}function S(t){return"object"==typeof t&&null!==t}function k(t){return S(t)&&"[object Date]"===A(t)}function E(t){return S(t)&&("[object Error]"===A(t)||t instanceof Error)}function x(t){return"function"==typeof t}function A(t){return Object.prototype.toString.call(t)}function O(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(t){if(!a[t=t.toUpperCase()])if(s.test(t)){var r=i.default.pid;a[t]=function(){var n=e.format.apply(e,arguments);console.error("%s %d: %s",t,r,n)}}else a[t]=function(){};return a[t]},e.inspect=f,f.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},f.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.types=r(584),e.isArray=y,e.isBoolean=g,e.isNull=m,e.isNullOrUndefined=function(t){return null==t},e.isNumber=b,e.isString=v,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=_,e.isRegExp=w,e.types.isRegExp=w,e.isObject=S,e.isDate=k,e.types.isDate=k,e.isError=E,e.types.isNativeError=E,e.isFunction=x,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=r(369);var R=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function C(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){var t,r;console.log("%s - %s",(r=[O((t=new Date).getHours()),O(t.getMinutes()),O(t.getSeconds())].join(":"),[t.getDate(),R[t.getMonth()],r].join(" ")),e.format.apply(e,arguments))},e.inherits=r(782),e._extend=function(t,e){if(!e||!S(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var T="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function I(t,e){if(!t){var r=Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw TypeError('The "original" argument must be of type Function');if(T&&t[T]){var e=t[T];if("function"!=typeof e)throw TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,T,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,n=new Promise(function(t,n){e=t,r=n}),i=[],o=0;o{var n=t.i(47167);!function(){var r={782:function(t){"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},646:function(t){"use strict";let e={};function r(t,r,n){n||(n=Error);class i extends n{constructor(t,e,n){super("string"==typeof r?r:r(t,e,n))}}i.prototype.name=n.name,i.prototype.code=t,e[t]=i}function n(t,e){if(!Array.isArray(t))return"of ".concat(e," ").concat(String(t));{let r=t.length;return(t=t.map(t=>String(t)),r>2)?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}}r("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError),r("ERR_INVALID_ARG_TYPE",function(t,e,r){var i,o,a,s;let u,f;if("string"==typeof e&&(i="not ",e.substr(0,i.length)===i)?(u="must not be",e=e.replace(/^not /,"")):u="must be",o=" argument",(void 0===a||a>t.length)&&(a=t.length),t.substring(a-o.length,a)===o)f="The ".concat(t," ").concat(u," ").concat(n(e,"type"));else{let r=("number"!=typeof s&&(s=0),s+1>t.length||-1===t.indexOf(".",s))?"argument":"property";f='The "'.concat(t,'" ').concat(r," ").concat(u," ").concat(n(e,"type"))}return f+". Received type ".concat(typeof r)},TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"}),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"}),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.q=e},403:function(t,e,r){"use strict";var i=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=l;var o=r(709),a=r(337);r(782)(l,o);for(var s=i(a.prototype),u=0;u0)if("string"==typeof e||u.objectMode||Object.getPrototypeOf(e)===h.prototype||(o=e,e=h.from(o)),n)u.endEmitted?k(t,new S):R(t,u,e,!0);else if(u.ended)k(t,new _);else{if(u.destroyed)return!1;u.reading=!1,u.decoder&&!r?(e=u.decoder.write(e),u.objectMode||0!==e.length?R(t,u,e,!1):B(t,u)):R(t,u,e,!1)}else n||(u.reading=!1,B(t,u));return!u.ended&&(u.lengthe.highWaterMark&&((r=t)>=0x40000000?r=0x40000000:(r--,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r++),e.highWaterMark=r),t<=e.length)?t:e.ended?e.length:(e.needReadable=!0,0)}function T(t){var e=t._readableState;a("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(a("emitReadable",e.flowing),e.emittedReadable=!0,n.default.nextTick(I,t))}function I(t){var e=t._readableState;a("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,z(t)}function B(t,e){e.readingMore||(e.readingMore=!0,n.default.nextTick(P,t,e))}function P(t,e){for(;!e.reading&&!e.ended&&(e.length0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function L(t){a("readable nexttick read 0"),t.read(0)}function U(t,e){a("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),z(t),e.flowing&&!e.reading&&t.read(0)}function z(t){var e=t._readableState;for(a("flow",e.flowing);e.flowing&&null!==t.read(););}function D(t,e){var r;return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r)}function N(t){var e=t._readableState;a("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,n.default.nextTick(F,e,t))}function F(t,e){if(a("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function M(t,e){for(var r=0,n=t.length;r=r.highWaterMark:r.length>0)||r.ended))return a("read: emitReadable",r.length,r.ended),0===r.length&&r.ended?N(this):T(this),null;if(0===(t=C(t,r))&&r.ended)return 0===r.length&&N(this),null;var i=r.needReadable;return a("need readable",i),(0===r.length||r.length-t0?D(t,r):null)?(r.needReadable=r.length<=r.highWaterMark,t=0):(r.length-=t,r.awaitDrain=0),0===r.length&&(r.ended||(r.needReadable=!0),n!==t&&r.ended&&N(this)),null!==e&&this.emit("data",e),e},A.prototype._read=function(t){k(this,new w("_read()"))},A.prototype.pipe=function(t,e){var r,i=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=t;break;case 1:o.pipes=[o.pipes,t];break;default:o.pipes.push(t)}o.pipesCount+=1,a("pipe count=%d opts=%j",o.pipesCount,e);var s=e&&!1===e.end||t===n.default.stdout||t===n.default.stderr?g:u;function u(){a("onend"),t.end()}o.endEmitted?n.default.nextTick(s):i.once("end",s),t.on("unpipe",function e(r,n){a("onunpipe"),r===i&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,a("cleanup"),t.removeListener("close",p),t.removeListener("finish",y),t.removeListener("drain",f),t.removeListener("error",d),t.removeListener("unpipe",e),i.removeListener("end",u),i.removeListener("end",g),i.removeListener("data",h),c=!0,o.awaitDrain&&(!t._writableState||t._writableState.needDrain)&&f())});var f=(r=i,function(){var t=r._readableState;a("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&l(r,"data")&&(t.flowing=!0,z(r))});t.on("drain",f);var c=!1;function h(e){a("ondata");var r=t.write(e);a("dest.write",r),!1===r&&((1===o.pipesCount&&o.pipes===t||o.pipesCount>1&&-1!==M(o.pipes,t))&&!c&&(a("false write response, pause",o.awaitDrain),o.awaitDrain++),i.pause())}function d(e){a("onerror",e),g(),t.removeListener("error",d),0===l(t,"error")&&k(t,e)}function p(){t.removeListener("finish",y),g()}function y(){a("onfinish"),t.removeListener("close",p),g()}function g(){a("unpipe"),i.unpipe(t)}return i.on("data",h),!function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",d),t.once("close",p),t.once("finish",y),t.emit("pipe",i),o.flowing||(a("pipe resume"),i.resume()),t},A.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o0,!1!==i.flowing&&this.resume()):"readable"!==t||i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,a("on readable",i.length,i.reading),i.length?T(this):i.reading||n.default.nextTick(L,this)),r},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(t,e){var r=c.prototype.removeListener.call(this,t,e);return"readable"===t&&n.default.nextTick(j,this),r},A.prototype.removeAllListeners=function(t){var e=c.prototype.removeAllListeners.apply(this,arguments);return("readable"===t||void 0===t)&&n.default.nextTick(j,this),e},A.prototype.resume=function(){var t,e,r=this._readableState;return r.flowing||(a("resume"),r.flowing=!r.readableListening,t=this,(e=r).resumeScheduled||(e.resumeScheduled=!0,n.default.nextTick(U,t,e))),r.paused=!1,this},A.prototype.pause=function(){return a("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(a("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},A.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var i in t.on("end",function(){if(a("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)}),t.on("data",function(i){if(a("wrapped data"),r.decoder&&(i=r.decoder.write(i)),!r.objectMode||null!=i)(r.objectMode||i&&i.length)&&(e.push(i)||(n=!0,t.pause()))}),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var o=0;o-1))throw new S(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(A.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(A.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),A.prototype._write=function(t,e,r){r(new g("_write()"))},A.prototype._writev=null,A.prototype.end=function(t,e,r){var i,o,a,s=this._writableState;return"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),s.corked&&(s.corked=1,this.uncork()),s.ending||(i=this,o=s,a=r,o.ending=!0,B(i,o),a&&(o.finished?n.default.nextTick(a):i.once("finish",a)),o.ended=!0,i.writable=!1),this},Object.defineProperty(A.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),A.prototype.destroy=h.destroy,A.prototype._undestroy=h.undestroy,A.prototype._destroy=function(t,e){e(t)}},871:function(t,e,r){"use strict";function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var o,a=r(698),s=Symbol("lastResolve"),u=Symbol("lastReject"),f=Symbol("error"),l=Symbol("ended"),c=Symbol("lastPromise"),h=Symbol("handlePromise"),d=Symbol("stream");function p(t,e){return{value:t,done:e}}function y(t){var e=t[s];if(null!==e){var r=t[d].read();null!==r&&(t[c]=null,t[s]=null,t[u]=null,e(p(r,!1)))}}function g(t){n.default.nextTick(y,t)}var m=Object.getPrototypeOf(function(){}),b=Object.setPrototypeOf((i(o={get stream(){return this[d]},next:function(){var t,e,r=this,i=this[f];if(null!==i)return Promise.reject(i);if(this[l])return Promise.resolve(p(void 0,!0));if(this[d].destroyed)return new Promise(function(t,e){n.default.nextTick(function(){r[f]?e(r[f]):t(p(void 0,!0))})});var o=this[c];if(o)e=new Promise((t=this,function(e,r){o.then(function(){if(t[l])return void e(p(void 0,!0));t[h](e,r)},r)}));else{var a=this[d].read();if(null!==a)return Promise.resolve(p(a,!1));e=new Promise(this[h])}return this[c]=e,e}},Symbol.asyncIterator,function(){return this}),i(o,"return",function(){var t=this;return new Promise(function(e,r){t[d].destroy(null,function(t){if(t)return void r(t);e(p(void 0,!0))})})}),o),m);t.exports=function(t){var e,r=Object.create(b,(i(e={},d,{value:t,writable:!0}),i(e,s,{value:null,writable:!0}),i(e,u,{value:null,writable:!0}),i(e,f,{value:null,writable:!0}),i(e,l,{value:t._readableState.endEmitted,writable:!0}),i(e,h,{value:function(t,e){var n=r[d].read();n?(r[c]=null,r[s]=null,r[u]=null,t(p(n,!1))):(r[s]=t,r[u]=e)},writable:!0}),e));return r[c]=null,a(t,function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=r[u];null!==e&&(r[c]=null,r[s]=null,r[u]=null,e(t)),r[f]=t;return}var n=r[s];null!==n&&(r[c]=null,r[s]=null,r[u]=null,n(p(void 0,!0))),r[l]=!0}),t.on("readable",g.bind(null,r)),r}},379:function(t,e,r){"use strict";function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}var i=r(300).Buffer,o=r(837).inspect,a=o&&o.custom||"inspect";t.exports=function(){var t;function e(){if(!(this instanceof e))throw TypeError("Cannot call a class as a function");this.head=null,this.tail=null,this.length=0}return t=[{key:"push",value:function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return i.alloc(0);for(var e,r,n=i.allocUnsafe(t>>>0),o=this.head,a=0;o;)e=o.data,r=a,i.prototype.copy.call(e,n,r),a+=o.data.length,o=o.next;return n}},{key:"consume",value:function(t,e){var r;return ti.length?i.length:t;if(o===i.length?n+=i:n+=i.slice(0,t),0==(t-=o)){o===i.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(t){var e=i.allocUnsafe(t),r=this.head,n=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var o=r.data,a=t>o.length?o.length:t;if(o.copy(e,e.length-t,0,a),0==(t-=a)){a===o.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=o.slice(a));break}++n}return this.length-=n,e}},{key:a,value:function(t,e){return o(this,function(t){for(var e=1;e0,f=s=function(t){e||(e=t),t&&d.forEach(u),g||(d.forEach(u),h(e))},c=!1,s=function(){c||(c=!0,f.apply(void 0,arguments))},p=!1,t.on("close",function(){p=!0}),void 0===n&&(n=r(698)),n(t,{readable:g,writable:o},function(t){if(t)return s(t);p=!0,s()}),y=!1,function(e){if(!p&&!y){if(y=!0,t.setHeader&&"function"==typeof t.abort)return t.abort();if("function"==typeof t.destroy)return t.destroy();s(e||new a("pipe"))}}});return l.reduce(f)}},776:function(t,e,r){"use strict";var n=r(646).q.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(t,e,r,i){var o=null!=e.highWaterMark?e.highWaterMark:i?e[r]:null;if(null!=o){if(!(isFinite(o)&&Math.floor(o)===o)||o<0)throw new n(i?r:"highWaterMark",o);return Math.floor(o)}return t.objectMode?16:16384}}},678:function(t,e,r){t.exports=r(781)},55:function(t,e,r){var n=r(300),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function a(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=a),a.prototype=Object.create(i.prototype),o(i,a),a.from=function(t,e,r){if("number"==typeof t)throw TypeError("Argument must not be a number");return i(t,e,r)},a.alloc=function(t,e,r){if("number"!=typeof t)throw TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},a.allocUnsafe=function(t){if("number"!=typeof t)throw TypeError("Argument must be a number");return i(t)},a.allocUnsafeSlow=function(t){if("number"!=typeof t)throw TypeError("Argument must be a number");return n.SlowBuffer(t)}},173:function(t,e,r){t.exports=i;var n=r(361).EventEmitter;function i(){n.call(this)}r(782)(i,n),i.Readable=r(709),i.Writable=r(337),i.Duplex=r(403),i.Transform=r(170),i.PassThrough=r(889),i.finished=r(698),i.pipeline=r(442),i.Stream=i,i.prototype.pipe=function(t,e){var r=this;function i(e){t.writable&&!1===t.write(e)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),t.on("drain",o),t._isStdio||e&&!1===e.end||(r.on("end",s),r.on("close",u));var a=!1;function s(){a||(a=!0,t.end())}function u(){a||(a=!0,"function"==typeof t.destroy&&t.destroy())}function f(t){if(l(),0===n.listenerCount(this,"error"))throw t}function l(){r.removeListener("data",i),t.removeListener("drain",o),r.removeListener("end",s),r.removeListener("close",u),r.removeListener("error",f),t.removeListener("error",f),r.removeListener("end",l),r.removeListener("close",l),t.removeListener("close",l)}return r.on("error",f),t.on("error",f),r.on("end",l),r.on("close",l),t.on("close",l),t.emit("pipe",r),t}},704:function(t,e,r){"use strict";var n=r(55).Buffer,i=n.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){var e;if(!t)return"utf8";for(;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(n.isEncoding===i||!i(t)))throw Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=u,this.end=f,e=4;break;case"utf8":this.fillLast=s,e=4;break;case"base64":this.text=l,this.end=c,e=3;break;default:this.write=h,this.end=d;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function a(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function s(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if((192&e[0])!=128)return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if((192&e[1])!=128)return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&(192&e[2])!=128)return t.lastNeed=2,"�"}}(this,t,0);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):void(t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length)}function u(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function f(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function l(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function c(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function h(t){return t.toString(this.encoding)}function d(t){return t&&t.length?this.write(t):""}e.s=o,o.prototype.write=function(t){var e,r;if(0===t.length)return"";if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0?(i>0&&(t.lastNeed=i-1),i):--n=0?(i>0&&(t.lastNeed=i-2),i):--n=0?(i>0&&(2===i?i=0:t.lastNeed=i-3),i):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},769:function(e){e.exports=function(t,e){if(r("noDeprecation"))return t;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw Error(e);r("traceDeprecation")?console.trace(e):console.warn(e),n=!0}return t.apply(this,arguments)}};function r(e){try{if(!t.g.localStorage)return!1}catch(t){return!1}var r=t.g.localStorage[e];return null!=r&&"true"===String(r).toLowerCase()}},300:function(e){"use strict";e.exports=t.r(43943)},361:function(e){"use strict";e.exports=t.r(30662)},781:function(e){"use strict";e.exports=t.r(30662).EventEmitter},837:function(e){"use strict";e.exports=t.r(77398)}},i={};function o(t){var e=i[t];if(void 0!==e)return e.exports;var n=i[t]={exports:{}},a=!0;try{r[t](n,n.exports,o),a=!1}finally{a&&delete i[t]}return n.exports}o.ab="/ROOT/node_modules/next/dist/compiled/stream-browserify/",e.exports=o(173)}()},31032,(t,e,r)=>{"use strict";e.exports=t.r(12569)},87780,(t,e,r)=>{"use strict";var n=t.i(67034);if(r.base64=!0,r.array=!0,r.string=!0,r.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,r.nodebuffer=void 0!==n.Buffer,r.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)r.blob=!1;else{var i=new ArrayBuffer(0);try{r.blob=0===new Blob([i],{type:"application/zip"}).size}catch(t){try{var o=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);o.append(i),r.blob=0===o.getBlob("application/zip").size}catch(t){r.blob=!1}}}try{r.nodestream=!!t.r(31032).Readable}catch(t){r.nodestream=!1}},55951,(t,e,r)=>{"use strict";var n=t.r(65464),i=t.r(87780),o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";r.encode=function(t){for(var e,r,i,a,s,u,f,l=[],c=0,h=t.length,d=h,p="string"!==n.getTypeOf(t);c>2,s=(3&e)<<4|r>>4,u=d>1?(15&r)<<2|i>>6:64,f=d>2?63&i:64,l.push(o.charAt(a)+o.charAt(s)+o.charAt(u)+o.charAt(f));return l.join("")},r.decode=function(t){var e,r,n,a,s,u,f,l,c=0,h=0,d="data:";if(t.substr(0,d.length)===d)throw Error("Invalid base64 input, it looks like a data url.");var p=3*(t=t.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(t.charAt(t.length-1)===o.charAt(64)&&p--,t.charAt(t.length-2)===o.charAt(64)&&p--,p%1!=0)throw Error("Invalid base64 input, bad content length.");for(l=i.uint8array?new Uint8Array(0|p):Array(0|p);c>4,r=(15&s)<<4|u>>2,n=(3&u)<<6|f,l[h++]=e,64!==u&&(l[h++]=r),64!==f&&(l[h++]=n);return l}},42527,(t,e,r)=>{"use strict";var n=t.i(67034);e.exports={isNode:void 0!==n.Buffer,newBufferFrom:function(t,e){if(n.Buffer.from&&n.Buffer.from!==Uint8Array.from)return n.Buffer.from(t,e);if("number"==typeof t)throw Error('The "data" argument must not be a number');return new n.Buffer(t,e)},allocBuffer:function(t){if(n.Buffer.alloc)return n.Buffer.alloc(t);var e=new n.Buffer(t);return e.fill(0),e},isBuffer:function(t){return n.Buffer.isBuffer(t)},isStream:function(t){return t&&"function"==typeof t.on&&"function"==typeof t.pause&&"function"==typeof t.resume}}},27024,(t,e,r)=>{"use strict";var n,i,o=t.g.MutationObserver||t.g.WebKitMutationObserver;if(o){var a=0,s=new o(c),u=t.g.document.createTextNode("");s.observe(u,{characterData:!0}),n=function(){u.data=a=++a%2}}else if(t.g.setImmediate||void 0===t.g.MessageChannel)n="document"in t.g&&"onreadystatechange"in t.g.document.createElement("script")?function(){var e=t.g.document.createElement("script");e.onreadystatechange=function(){c(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},t.g.document.documentElement.appendChild(e)}:function(){setTimeout(c,0)};else{var f=new t.g.MessageChannel;f.port1.onmessage=c,n=function(){f.port2.postMessage(0)}}var l=[];function c(){i=!0;for(var t,e,r=l.length;r;){for(e=l,l=[],t=-1;++t{"use strict";var n=t.r(27024);function i(){}var o={},a=["REJECTED"],s=["FULFILLED"],u=["PENDING"];function f(t){if("function"!=typeof t)throw TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,t!==i&&d(this,t)}function l(t,e,r){this.promise=t,"function"==typeof e&&(this.onFulfilled=e,this.callFulfilled=this.otherCallFulfilled),"function"==typeof r&&(this.onRejected=r,this.callRejected=this.otherCallRejected)}function c(t,e,r){n(function(){var n;try{n=e(r)}catch(e){return o.reject(t,e)}n===t?o.reject(t,TypeError("Cannot resolve promise with itself")):o.resolve(t,n)})}function h(t){var e=t&&t.then;if(t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof e)return function(){e.apply(t,arguments)}}function d(t,e){var r=!1;function n(e){r||(r=!0,o.reject(t,e))}function i(e){r||(r=!0,o.resolve(t,e))}var a=p(function(){e(i,n)});"error"===a.status&&n(a.value)}function p(t,e){var r={};try{r.value=t(e),r.status="success"}catch(t){r.status="error",r.value=t}return r}e.exports=f,f.prototype.finally=function(t){if("function"!=typeof t)return this;var e=this.constructor;return this.then(function(r){return e.resolve(t()).then(function(){return r})},function(r){return e.resolve(t()).then(function(){throw r})})},f.prototype.catch=function(t){return this.then(null,t)},f.prototype.then=function(t,e){if("function"!=typeof t&&this.state===s||"function"!=typeof e&&this.state===a)return this;var r=new this.constructor(i);return this.state!==u?c(r,this.state===s?t:e,this.outcome):this.queue.push(new l(r,t,e)),r},l.prototype.callFulfilled=function(t){o.resolve(this.promise,t)},l.prototype.otherCallFulfilled=function(t){c(this.promise,this.onFulfilled,t)},l.prototype.callRejected=function(t){o.reject(this.promise,t)},l.prototype.otherCallRejected=function(t){c(this.promise,this.onRejected,t)},o.resolve=function(t,e){var r=p(h,e);if("error"===r.status)return o.reject(t,r.value);var n=r.value;if(n)d(t,n);else{t.state=s,t.outcome=e;for(var i=-1,a=t.queue.length;++i{"use strict";e.exports={Promise:"undefined"!=typeof Promise?Promise:t.r(22998)}},83986,(t,e,r)=>{var n=t.i(47167);"undefined"!=typeof __nccwpck_require__&&(__nccwpck_require__.ab="/ROOT/node_modules/next/dist/compiled/setimmediate/"),({189:function(){!function(t,e){"use strict";if(!t.setImmediate){var r,i,o,a,s,u=1,f={},l=!1,c=t.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(t);h=h&&h.setTimeout?h:t,"[object process]"===({}).toString.call(t.process)?s=function(t){n.default.nextTick(function(){p(t)})}:function(){if(t.postMessage&&!t.importScripts){var e=!0,r=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=r,e}}()?(r="setImmediate$"+Math.random()+"$",i=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(r)&&p(+e.data.slice(r.length))},t.addEventListener?t.addEventListener("message",i,!1):t.attachEvent("onmessage",i),s=function(e){t.postMessage(r+e,"*")}):t.MessageChannel?((o=new MessageChannel).port1.onmessage=function(t){p(t.data)},s=function(t){o.port2.postMessage(t)}):c&&"onreadystatechange"in c.createElement("script")?(a=c.documentElement,s=function(t){var e=c.createElement("script");e.onreadystatechange=function(){p(t),e.onreadystatechange=null,a.removeChild(e),e=null},a.appendChild(e)}):s=function(t){setTimeout(p,0,t)},h.setImmediate=function(t){"function"!=typeof t&&(t=Function(""+t));for(var e=Array(arguments.length-1),r=0;r{"use strict";var n=t.r(87780),i=t.r(55951),o=t.r(42527),a=t.r(24375);function s(t){return t}function u(t,e){for(var r=0;r1;)try{return f.stringifyByChunk(t,n,e)}catch(t){e=Math.floor(e/2)}return f.stringifyByChar(t)}function c(t,e){for(var r=0;r{"use strict";function n(t){this.name=t||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}n.prototype={push:function(t){this.emit("data",t)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(t){this.emit("error",t)}return!0},error:function(t){return!this.isFinished&&(this.isPaused?this.generatedError=t:(this.isFinished=!0,this.emit("error",t),this.previous&&this.previous.error(t),this.cleanUp()),!0)},on:function(t,e){return this._listeners[t].push(e),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(t,e){if(this._listeners[t])for(var r=0;r "+t:t}},e.exports=n},46253,(t,e,r)=>{"use strict";for(var n=t.r(65464),i=t.r(87780),o=t.r(42527),a=t.r(48913),s=Array(256),u=0;u<256;u++)s[u]=u>=252?6:u>=248?5:u>=240?4:u>=224?3:u>=192?2:1;s[254]=s[254]=1;var f=function(t){var e,r,n,o,a,s=t.length,u=0;for(o=0;o>>6:(r<65536?e[a++]=224|r>>>12:(e[a++]=240|r>>>18,e[a++]=128|r>>>12&63),e[a++]=128|r>>>6&63),e[a++]=128|63&r);return e},l=function(t,e){var r;for((e=e||t.length)>t.length&&(e=t.length),r=e-1;r>=0&&(192&t[r])==128;)r--;return r<0||0===r?e:r+s[t[r]]>e?r:e},c=function(t){var e,r,i,o,a=t.length,u=Array(2*a);for(r=0,e=0;e4){u[r++]=65533,e+=o-1;continue}for(i&=2===o?31:3===o?15:7;o>1&&e1){u[r++]=65533;continue}i<65536?u[r++]=i:(i-=65536,u[r++]=55296|i>>10&1023,u[r++]=56320|1023&i)}return u.length!==r&&(u.subarray?u=u.subarray(0,r):u.length=r),n.applyFromCharCode(u)};function h(){a.call(this,"utf-8 decode"),this.leftOver=null}function d(){a.call(this,"utf-8 encode")}r.utf8encode=function(t){return i.nodebuffer?o.newBufferFrom(t,"utf-8"):f(t)},r.utf8decode=function(t){return i.nodebuffer?n.transformTo("nodebuffer",t).toString("utf-8"):c(t=n.transformTo(i.uint8array?"uint8array":"array",t))},n.inherits(h,a),h.prototype.processChunk=function(t){var e=n.transformTo(i.uint8array?"uint8array":"array",t.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var o=e;(e=new Uint8Array(o.length+this.leftOver.length)).set(this.leftOver,0),e.set(o,this.leftOver.length)}else e=this.leftOver.concat(e);this.leftOver=null}var a=l(e),s=e;a!==e.length&&(i.uint8array?(s=e.subarray(0,a),this.leftOver=e.subarray(a,e.length)):(s=e.slice(0,a),this.leftOver=e.slice(a,e.length))),this.push({data:r.utf8decode(s),meta:t.meta})},h.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:r.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},r.Utf8DecodeWorker=h,n.inherits(d,a),d.prototype.processChunk=function(t){this.push({data:r.utf8encode(t.data),meta:t.meta})},r.Utf8EncodeWorker=d},60550,(t,e,r)=>{"use strict";var n=t.r(48913),i=t.r(65464);function o(t){n.call(this,"ConvertWorker to "+t),this.destType=t}i.inherits(o,n),o.prototype.processChunk=function(t){this.push({data:i.transformTo(this.destType,t.data),meta:t.meta})},e.exports=o},61714,(t,e,r)=>{"use strict";var n=t.r(31032).Readable;function i(t,e,r){n.call(this,e),this._helper=t;var i=this;t.on("data",function(t,e){i.push(t)||i._helper.pause(),r&&r(e)}).on("error",function(t){i.emit("error",t)}).on("end",function(){i.push(null)})}t.r(65464).inherits(i,n),i.prototype._read=function(){this._helper.resume()},e.exports=i},846,(t,e,r)=>{"use strict";var n=t.i(67034),i=t.r(65464),o=t.r(60550),a=t.r(48913),s=t.r(55951),u=t.r(87780),f=t.r(24375),l=null;if(u.nodestream)try{l=t.r(61714)}catch(t){}function c(t,e,r){var n=e;switch(e){case"blob":case"arraybuffer":n="uint8array";break;case"base64":n="string"}try{this._internalType=n,this._outputType=e,this._mimeType=r,i.checkSupport(n),this._worker=t.pipe(new o(n)),t.lock()}catch(t){this._worker=new a("error"),this._worker.error(t)}}c.prototype={accumulate:function(t){var e;return e=this,new f.Promise(function(r,o){var a=[],u=e._internalType,f=e._outputType,l=e._mimeType;e.on("data",function(e,r){a.push(e),t&&t(r)}).on("error",function(t){a=[],o(t)}).on("end",function(){try{var t=function(t,e,r){switch(t){case"blob":return i.newBlob(i.transformTo("arraybuffer",e),r);case"base64":return s.encode(e);default:return i.transformTo(t,e)}}(f,function(t,e){var r,i=0,o=null,a=0;for(r=0;r{"use strict";r.base64=!1,r.binary=!1,r.dir=!1,r.createFolders=!0,r.date=null,r.compression=null,r.compressionOptions=null,r.comment=null,r.unixPermissions=null,r.dosPermissions=null},25625,(t,e,r)=>{"use strict";var n=t.r(65464),i=t.r(48913);function o(t){i.call(this,"DataWorker");var e=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,t.then(function(t){e.dataIsReady=!0,e.data=t,e.max=t&&t.length||0,e.type=n.getTypeOf(t),e.isPaused||e._tickAndRepeat()},function(t){e.error(t)})}n.inherits(o,i),o.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},o.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,n.delay(this._tickAndRepeat,[],this)),!0)},o.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(n.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},o.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var t=null,e=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":t=this.data.substring(this.index,e);break;case"uint8array":t=this.data.subarray(this.index,e);break;case"array":case"nodebuffer":t=this.data.slice(this.index,e)}return this.index=e,this.push({data:t,meta:{percent:this.max?this.index/this.max*100:0}})},e.exports=o},63494,(t,e,r)=>{"use strict";var n=t.r(65464),i=function(){for(var t,e=[],r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=1&t?0xedb88320^t>>>1:t>>>1;e[r]=t}return e}();e.exports=function(t,e){return void 0!==t&&t.length?"string"!==n.getTypeOf(t)?function(t,e,r,n){var o=0+r;t^=-1;for(var a=0;a>>8^i[(t^e[a])&255];return -1^t}(0|e,t,t.length,0):function(t,e,r,n){var o=0+r;t^=-1;for(var a=0;a>>8^i[(t^e.charCodeAt(a))&255];return -1^t}(0|e,t,t.length,0):0}},1648,(t,e,r)=>{"use strict";var n=t.r(48913),i=t.r(63494);function o(){n.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t.r(65464).inherits(o,n),o.prototype.processChunk=function(t){this.streamInfo.crc32=i(t.data,this.streamInfo.crc32||0),this.push(t)},e.exports=o},41087,(t,e,r)=>{"use strict";var n=t.r(65464),i=t.r(48913);function o(t){i.call(this,"DataLengthProbe for "+t),this.propName=t,this.withStreamInfo(t,0)}n.inherits(o,i),o.prototype.processChunk=function(t){if(t){var e=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=e+t.data.length}i.prototype.processChunk.call(this,t)},e.exports=o},43220,(t,e,r)=>{"use strict";var n=t.r(24375),i=t.r(25625),o=t.r(1648),a=t.r(41087);function s(t,e,r,n,i){this.compressedSize=t,this.uncompressedSize=e,this.crc32=r,this.compression=n,this.compressedContent=i}s.prototype={getContentWorker:function(){var t=new i(n.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new a("data_length")),e=this;return t.on("end",function(){if(this.streamInfo.data_length!==e.uncompressedSize)throw Error("Bug : uncompressed data size mismatch")}),t},getCompressedWorker:function(){return new i(n.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},s.createWorkerFrom=function(t,e,r){return t.pipe(new o).pipe(new a("uncompressedSize")).pipe(e.compressWorker(r)).pipe(new a("compressedSize")).withStreamInfo("compression",e)},e.exports=s},52929,(t,e,r)=>{"use strict";var n=t.r(846),i=t.r(25625),o=t.r(46253),a=t.r(43220),s=t.r(48913),u=function(t,e,r){this.name=t,this.dir=r.dir,this.date=r.date,this.comment=r.comment,this.unixPermissions=r.unixPermissions,this.dosPermissions=r.dosPermissions,this._data=e,this._dataBinary=r.binary,this.options={compression:r.compression,compressionOptions:r.compressionOptions}};u.prototype={internalStream:function(t){var e=null,r="string";try{if(!t)throw Error("No output type specified.");r=t.toLowerCase();var i="string"===r||"text"===r;("binarystring"===r||"text"===r)&&(r="string"),e=this._decompressWorker();var a=!this._dataBinary;a&&!i&&(e=e.pipe(new o.Utf8EncodeWorker)),!a&&i&&(e=e.pipe(new o.Utf8DecodeWorker))}catch(t){(e=new s("error")).error(t)}return new n(e,r,"")},async:function(t,e){return this.internalStream(t).accumulate(e)},nodeStream:function(t,e){return this.internalStream(t||"nodebuffer").toNodejsStream(e)},_compressWorker:function(t,e){if(this._data instanceof a&&this._data.compression.magic===t.magic)return this._data.getCompressedWorker();var r=this._decompressWorker();return this._dataBinary||(r=r.pipe(new o.Utf8EncodeWorker)),a.createWorkerFrom(r,t,e)},_decompressWorker:function(){return this._data instanceof a?this._data.getContentWorker():this._data instanceof s?this._data:new i(this._data)}};for(var f=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],l=function(){throw Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},c=0;c{"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;r.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var r=e.shift();if(r){if("object"!=typeof r)throw TypeError(r+"must be non-object");for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}}return t},r.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var i={arraySet:function(t,e,r,n,i){if(e.subarray&&t.subarray)return void t.set(e.subarray(r,r+n),i);for(var o=0;o{"use strict";var n,i,o,a=t.r(79148);function s(t){for(var e=t.length;--e>=0;)t[e]=0}var u=573,f=[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],l=[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],c=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],h=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],d=Array(576);s(d);var p=Array(60);s(p);var y=Array(512);s(y);var g=Array(256);s(g);var m=Array(29);s(m);var b=Array(30);function v(t,e,r,n,i){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=t&&t.length}function _(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function w(t){return t<256?y[t]:y[256+(t>>>7)]}function S(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function k(t,e,r){t.bi_valid>16-r?(t.bi_buf|=e<>16-t.bi_valid,t.bi_valid+=r-16):(t.bi_buf|=e<>>=1,r<<=1;while(--e>0)return r>>>1}function A(t,e,r){var n,i,o=Array(16),a=0;for(n=1;n<=15;n++)o[n]=a=a+r[n-1]<<1;for(i=0;i<=e;i++){var s=t[2*i+1];0!==s&&(t[2*i]=x(o[s]++,s))}}function O(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function R(t){t.bi_valid>8?S(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function C(t,e,r,n){var i=2*e,o=2*r;return t[i]>1;r>=1;r--)T(t,o,r);i=f;do r=t.heap[1],t.heap[1]=t.heap[t.heap_len--],T(t,o,1),n=t.heap[1],t.heap[--t.heap_max]=r,t.heap[--t.heap_max]=n,o[2*i]=o[2*r]+o[2*n],t.depth[i]=(t.depth[r]>=t.depth[n]?t.depth[r]:t.depth[n])+1,o[2*r+1]=o[2*n+1]=i,t.heap[1]=i++,T(t,o,1);while(t.heap_len>=2)t.heap[--t.heap_max]=t.heap[1],function(t,e){var r,n,i,o,a,s,f=e.dyn_tree,l=e.max_code,c=e.stat_desc.static_tree,h=e.stat_desc.has_stree,d=e.stat_desc.extra_bits,p=e.stat_desc.extra_base,y=e.stat_desc.max_length,g=0;for(o=0;o<=15;o++)t.bl_count[o]=0;for(f[2*t.heap[t.heap_max]+1]=0,r=t.heap_max+1;ry&&(o=y,g++),f[2*n+1]=o,!(n>l)&&(t.bl_count[o]++,a=0,n>=p&&(a=d[n-p]),s=f[2*n],t.opt_len+=s*(o+a),h&&(t.static_len+=s*(c[2*n+1]+a)));if(0!==g){do{for(o=y-1;0===t.bl_count[o];)o--;t.bl_count[o]--,t.bl_count[o+1]+=2,t.bl_count[y]--,g-=2}while(g>0)for(o=y;0!==o;o--)for(n=t.bl_count[o];0!==n;)!((i=t.heap[--r])>l)&&(f[2*i+1]!==o&&(t.opt_len+=(o-f[2*i+1])*f[2*i],f[2*i+1]=o),n--)}}(t,e),A(o,l,t.bl_count)}function P(t,e,r){var n,i,o=-1,a=e[1],s=0,u=7,f=4;for(0===a&&(u=138,f=3),e[(r+1)*2+1]=65535,n=0;n<=r;n++)i=a,a=e[(n+1)*2+1],++s>=7;a<30;a++)for(t=0,b[a]=s<<7;t<1<0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,r=0xf3ffc07f;for(e=0;e<=31;e++,r>>>=1)if(1&r&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),B(t,t.l_desc),B(t,t.d_desc),a=function(t){var e;for(P(t,t.dyn_ltree,t.l_desc.max_code),P(t,t.dyn_dtree,t.d_desc.max_code),B(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*h[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),i=t.opt_len+3+7>>>3,(o=t.static_len+3+7>>>3)<=i&&(i=o)):i=o=r+5,r+4<=i&&-1!==e?U(t,e,r,n):4===t.strategy||o===i?(k(t,2+ +!!n,3),I(t,d,p)):(k(t,4+ +!!n,3),function(t,e,r,n){var i;for(k(t,e-257,5),k(t,r-1,5),k(t,n-4,4),i=0;i>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&r,t.last_lit++,0===e?t.dyn_ltree[2*r]++:(t.matches++,e--,t.dyn_ltree[(g[r]+256+1)*2]++,t.dyn_dtree[2*w(e)]++),t.last_lit===t.lit_bufsize-1},r._tr_align=function(t){k(t,2,3),E(t,256,d),16===t.bi_valid?(S(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}},74049,(t,e,r)=>{"use strict";e.exports=function(t,e,r,n){for(var i=65535&t,o=t>>>16&65535,a=0;0!==r;){a=r>2e3?2e3:r,r-=a;do o=o+(i=i+e[n++]|0)|0;while(--a)i%=65521,o%=65521}return i|o<<16}},63327,(t,e,r)=>{"use strict";var n=function(){for(var t,e=[],r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=1&t?0xedb88320^t>>>1:t>>>1;e[r]=t}return e}();e.exports=function(t,e,r,i){var o=i+r;t^=-1;for(var a=i;a>>8^n[(t^e[a])&255];return -1^t}},19558,(t,e,r)=>{"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},79674,(t,e,r)=>{"use strict";var n,i=t.r(79148),o=t.r(94333),a=t.r(74049),s=t.r(63327),u=t.r(19558),f=573;function l(t,e){return t.msg=u[e],e}function c(t){return(t<<1)-9*(t>4)}function h(t){for(var e=t.length;--e>=0;)t[e]=0}function d(t){var e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),0!==r&&(i.arraySet(t.output,e.pending_buf,e.pending_out,r,t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,0===e.pending&&(e.pending_out=0))}function p(t,e){o._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,d(t.strm)}function y(t,e){t.pending_buf[t.pending++]=e}function g(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function m(t,e){var r,n,i=t.max_chain_length,o=t.strstart,a=t.prev_length,s=t.nice_match,u=t.strstart>t.w_size-262?t.strstart-(t.w_size-262):0,f=t.window,l=t.w_mask,c=t.prev,h=t.strstart+258,d=f[o+a-1],p=f[o+a];t.prev_length>=t.good_match&&(i>>=2),s>t.lookahead&&(s=t.lookahead);do{if(f[(r=e)+a]!==p||f[r+a-1]!==d||f[r]!==f[o]||f[++r]!==f[o+1])continue;o+=2,r++;do;while(f[++o]===f[++r]&&f[++o]===f[++r]&&f[++o]===f[++r]&&f[++o]===f[++r]&&f[++o]===f[++r]&&f[++o]===f[++r]&&f[++o]===f[++r]&&f[++o]===f[++r]&&oa){if(t.match_start=e,a=n,n>=s)break;d=f[o+a-1],p=f[o+a]}}while((e=c[e&l])>u&&0!=--i)return a<=t.lookahead?a:t.lookahead}function b(t){var e,r,n,o,u,f=t.w_size;do{if(o=t.window_size-t.lookahead-t.strstart,t.strstart>=f+(f-262)){i.arraySet(t.window,t.window,f,f,0),t.match_start-=f,t.strstart-=f,t.block_start-=f,e=r=t.hash_size;do n=t.head[--e],t.head[e]=n>=f?n-f:0;while(--r)e=r=f;do n=t.prev[--e],t.prev[e]=n>=f?n-f:0;while(--r)o+=f}if(0===t.strm.avail_in)break;if(r=function(t,e,r,n){var o=t.avail_in;return(o>n&&(o=n),0===o)?0:(t.avail_in-=o,i.arraySet(e,t.input,t.next_in,o,r),1===t.state.wrap?t.adler=a(t.adler,e,o,r):2===t.state.wrap&&(t.adler=s(t.adler,e,o,r)),t.next_in+=o,t.total_in+=o,o)}(t.strm,t.window,t.strstart+t.lookahead,o),t.lookahead+=r,t.lookahead+t.insert>=3)for(u=t.strstart-t.insert,t.ins_h=t.window[u],t.ins_h=(t.ins_h<=3&&(t.ins_h=(t.ins_h<=3)if(n=o._tr_tally(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do t.strstart++,t.ins_h=(t.ins_h<=3&&(t.ins_h=(t.ins_h<4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-3,n=o._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=i&&(t.ins_h=(t.ins_h<15&&(s=2,n-=16),o<1||o>9||8!==r||n<8||n>15||e<0||e>9||a<0||a>4)return l(t,-2);8===n&&(n=9);var u=new S;return t.state=u,u.strm=t,u.wrap=s,u.gzhead=null,u.w_bits=n,u.w_size=1<t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(b(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+r;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,p(t,!1),0===t.strm.avail_out)||t.strstart-t.block_start>=t.w_size-262&&(p(t,!1),0===t.strm.avail_out))return 1}return(t.insert=0,4===e)?(p(t,!0),0===t.strm.avail_out)?3:4:(t.strstart>t.block_start&&(p(t,!1),t.strm.avail_out),1)}),new w(4,4,8,4,v),new w(4,5,16,8,v),new w(4,6,32,32,v),new w(4,4,16,16,_),new w(8,16,32,32,_),new w(8,16,128,128,_),new w(8,32,128,256,_),new w(32,128,258,1024,_),new w(32,258,258,4096,_)],r.deflateInit=function(t,e){return x(t,e,8,15,8,0)},r.deflateInit2=x,r.deflateReset=E,r.deflateResetKeep=k,r.deflateSetHeader=function(t,e){return t&&t.state&&2===t.state.wrap?(t.state.gzhead=e,0):-2},r.deflate=function(t,e){if(!t||!t.state||e>5||e<0)return t?l(t,-2):-2;if(i=t.state,!t.output||!t.input&&0!==t.avail_in||666===i.status&&4!==e)return l(t,0===t.avail_out?-5:-2);if(i.strm=t,r=i.last_flush,i.last_flush=e,42===i.status)if(2===i.wrap)t.adler=0,y(i,31),y(i,139),y(i,8),i.gzhead?(y(i,+!!i.gzhead.text+2*!!i.gzhead.hcrc+4*!!i.gzhead.extra+8*!!i.gzhead.name+16*!!i.gzhead.comment),y(i,255&i.gzhead.time),y(i,i.gzhead.time>>8&255),y(i,i.gzhead.time>>16&255),y(i,i.gzhead.time>>24&255),y(i,9===i.level?2:4*(i.strategy>=2||i.level<2)),y(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(y(i,255&i.gzhead.extra.length),y(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(t.adler=s(t.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(y(i,0),y(i,0),y(i,0),y(i,0),y(i,0),y(i,9===i.level?2:4*(i.strategy>=2||i.level<2)),y(i,3),i.status=113);else{var r,i,a,u,f=8+(i.w_bits-8<<4)<<8;f|=(i.strategy>=2||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(f|=32),f+=31-f%31,i.status=113,g(i,f),0!==i.strstart&&(g(i,t.adler>>>16),g(i,65535&t.adler)),t.adler=1}if(69===i.status)if(i.gzhead.extra){for(a=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),d(t),a=i.pending,i.pending!==i.pending_buf_size));)y(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),d(t),a=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindexa&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),0===u&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),d(t),a=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindexa&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),0===u&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&d(t),i.pending+2<=i.pending_buf_size&&(y(i,255&t.adler),y(i,t.adler>>8&255),t.adler=0,i.status=113)):i.status=113),0!==i.pending){if(d(t),0===t.avail_out)return i.last_flush=-1,0}else if(0===t.avail_in&&c(e)<=c(r)&&4!==e)return l(t,-5);if(666===i.status&&0!==t.avail_in)return l(t,-5);if(0!==t.avail_in||0!==i.lookahead||0!==e&&666!==i.status){var m=2===i.strategy?function(t,e){for(var r;;){if(0===t.lookahead&&(b(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,r=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(p(t,!1),0===t.strm.avail_out))return 1}return(t.insert=0,4===e)?(p(t,!0),0===t.strm.avail_out)?3:4:t.last_lit&&(p(t,!1),0===t.strm.avail_out)?1:2}(i,e):3===i.strategy?function(t,e){for(var r,n,i,a,s=t.window;;){if(t.lookahead<=258){if(b(t),t.lookahead<=258&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=s[i=t.strstart-1])===s[++i]&&n===s[++i]&&n===s[++i]){a=t.strstart+258;do;while(n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&it.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(r=o._tr_tally(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(p(t,!1),0===t.strm.avail_out))return 1}return(t.insert=0,4===e)?(p(t,!0),0===t.strm.avail_out)?3:4:t.last_lit&&(p(t,!1),0===t.strm.avail_out)?1:2}(i,e):n[i.level].func(i,e);if((3===m||4===m)&&(i.status=666),1===m||3===m)return 0===t.avail_out&&(i.last_flush=-1),0;if(2===m&&(1===e?o._tr_align(i):5!==e&&(o._tr_stored_block(i,0,0,!1),3===e&&(h(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),d(t),0===t.avail_out))return i.last_flush=-1,0}return 4!==e?0:i.wrap<=0?1:(2===i.wrap?(y(i,255&t.adler),y(i,t.adler>>8&255),y(i,t.adler>>16&255),y(i,t.adler>>24&255),y(i,255&t.total_in),y(i,t.total_in>>8&255),y(i,t.total_in>>16&255),y(i,t.total_in>>24&255)):(g(i,t.adler>>>16),g(i,65535&t.adler)),d(t),i.wrap>0&&(i.wrap=-i.wrap),+(0===i.pending))},r.deflateEnd=function(t){var e;return t&&t.state?42!==(e=t.state.status)&&69!==e&&73!==e&&91!==e&&103!==e&&113!==e&&666!==e?l(t,-2):(t.state=null,113===e?l(t,-3):0):-2},r.deflateSetDictionary=function(t,e){var r,n,o,s,u,f,l,c,d=e.length;if(!t||!t.state||2===(s=(r=t.state).wrap)||1===s&&42!==r.status||r.lookahead)return -2;for(1===s&&(t.adler=a(t.adler,e,d,0)),r.wrap=0,d>=r.w_size&&(0===s&&(h(r.head),r.strstart=0,r.block_start=0,r.insert=0),c=new i.Buf8(r.w_size),i.arraySet(c,e,d-r.w_size,r.w_size,0),e=c,d=r.w_size),u=t.avail_in,f=t.next_in,l=t.input,t.avail_in=d,t.next_in=0,t.input=e,b(r);r.lookahead>=3;){n=r.strstart,o=r.lookahead-2;do r.ins_h=(r.ins_h<{"use strict";var n=t.r(79148),i=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch(t){i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){o=!1}for(var a=new n.Buf8(256),s=0;s<256;s++)a[s]=s>=252?6:s>=248?5:s>=240?4:s>=224?3:s>=192?2:1;function u(t,e){if(e<65534&&(t.subarray&&o||!t.subarray&&i))return String.fromCharCode.apply(null,n.shrinkBuf(t,e));for(var r="",a=0;a>>6:(r<65536?e[a++]=224|r>>>12:(e[a++]=240|r>>>18,e[a++]=128|r>>>12&63),e[a++]=128|r>>>6&63),e[a++]=128|63&r);return e},r.buf2binstring=function(t){return u(t,t.length)},r.binstring2buf=function(t){for(var e=new n.Buf8(t.length),r=0,i=e.length;r4){f[n++]=65533,r+=o-1;continue}for(i&=2===o?31:3===o?15:7;o>1&&r1){f[n++]=65533;continue}i<65536?f[n++]=i:(i-=65536,f[n++]=55296|i>>10&1023,f[n++]=56320|1023&i)}return u(f,n)},r.utf8border=function(t,e){var r;for((e=e||t.length)>t.length&&(e=t.length),r=e-1;r>=0&&(192&t[r])==128;)r--;return r<0||0===r?e:r+a[t[r]]>e?r:e}},98899,(t,e,r)=>{"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},48901,(t,e,r)=>{"use strict";var n=t.r(79674),i=t.r(79148),o=t.r(63202),a=t.r(19558),s=t.r(98899),u=Object.prototype.toString;function f(t){if(!(this instanceof f))return new f(t);this.options=i.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},t||{});var e,r=this.options;r.raw&&r.windowBits>0?r.windowBits=-r.windowBits:r.gzip&&r.windowBits>0&&r.windowBits<16&&(r.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;var l=n.deflateInit2(this.strm,r.level,r.method,r.windowBits,r.memLevel,r.strategy);if(0!==l)throw Error(a[l]);if(r.header&&n.deflateSetHeader(this.strm,r.header),r.dictionary){if(e="string"==typeof r.dictionary?o.string2buf(r.dictionary):"[object ArrayBuffer]"===u.call(r.dictionary)?new Uint8Array(r.dictionary):r.dictionary,0!==(l=n.deflateSetDictionary(this.strm,e)))throw Error(a[l]);this._dict_set=!0}}function l(t,e){var r=new f(e);if(r.push(t,!0),r.err)throw r.msg||a[r.err];return r.result}f.prototype.push=function(t,e){var r,a,s=this.strm,f=this.options.chunkSize;if(this.ended)return!1;a=e===~~e?e:4*(!0===e),"string"==typeof t?s.input=o.string2buf(t):"[object ArrayBuffer]"===u.call(t)?s.input=new Uint8Array(t):s.input=t,s.next_in=0,s.avail_in=s.input.length;do{if(0===s.avail_out&&(s.output=new i.Buf8(f),s.next_out=0,s.avail_out=f),1!==(r=n.deflate(s,a))&&0!==r)return this.onEnd(r),this.ended=!0,!1;(0===s.avail_out||0===s.avail_in&&(4===a||2===a))&&("string"===this.options.to?this.onData(o.buf2binstring(i.shrinkBuf(s.output,s.next_out))):this.onData(i.shrinkBuf(s.output,s.next_out)))}while((s.avail_in>0||0===s.avail_out)&&1!==r)return 4===a?(r=n.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,0===r):(2===a&&(this.onEnd(0),s.avail_out=0),!0)},f.prototype.onData=function(t){this.chunks.push(t)},f.prototype.onEnd=function(t){0===t&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},r.Deflate=f,r.deflate=l,r.deflateRaw=function(t,e){return(e=e||{}).raw=!0,l(t,e)},r.gzip=function(t,e){return(e=e||{}).gzip=!0,l(t,e)}},75531,(t,e,r)=>{"use strict";e.exports=function(t,e){var r,n,i,o,a,s,u,f,l,c,h,d,p,y,g,m,b,v,_,w,S,k,E,x,A;r=t.state,n=t.next_in,x=t.input,i=n+(t.avail_in-5),o=t.next_out,A=t.output,a=o-(e-t.avail_out),s=o+(t.avail_out-257),u=r.dmax,f=r.wsize,l=r.whave,c=r.wnext,h=r.window,d=r.hold,p=r.bits,y=r.lencode,g=r.distcode,m=(1<>>=_=v>>>24,p-=_,0==(_=v>>>16&255))A[o++]=65535&v;else if(16&_)for(w=65535&v,(_&=15)&&(p<_&&(d+=x[n++]<>>=_,p-=_),p<15&&(d+=x[n++]<>>=_=v>>>24,p-=_,16&(_=v>>>16&255)){if(S=65535&v,p<(_&=15)&&(d+=x[n++]<u){t.msg="invalid distance too far back",r.mode=30;break t}if(d>>>=_,p-=_,S>(_=o-a)){if((_=S-_)>l&&r.sane){t.msg="invalid distance too far back",r.mode=30;break t}if(k=0,E=h,0===c){if(k+=f-_,_2;)A[o++]=E[k++],A[o++]=E[k++],A[o++]=E[k++],w-=3;w&&(A[o++]=E[k++],w>1&&(A[o++]=E[k++]))}else{k=o-S;do A[o++]=A[k++],A[o++]=A[k++],A[o++]=A[k++],w-=3;while(w>2)w&&(A[o++]=A[k++],w>1&&(A[o++]=A[k++]))}}else if((64&_)==0){v=g[(65535&v)+(d&(1<<_)-1)];continue}else{t.msg="invalid distance code",r.mode=30;break t}break}else if((64&_)==0){v=y[(65535&v)+(d&(1<<_)-1)];continue}else if(32&_){r.mode=12;break t}else{t.msg="invalid literal/length code",r.mode=30;break t}break}while(n>3,p-=w<<3,d&=(1<{"use strict";var n=t.r(79148),i=[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,0,0],o=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],a=[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,0,0],s=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(t,e,r,u,f,l,c,h){var d,p,y,g,m,b,v,_,w,S=h.bits,k=0,E=0,x=0,A=0,O=0,R=0,C=0,T=0,I=0,B=0,P=null,j=0,L=new n.Buf16(16),U=new n.Buf16(16),z=null,D=0;for(k=0;k<=15;k++)L[k]=0;for(E=0;E=1&&0===L[A];A--);if(O>A&&(O=A),0===A)return f[l++]=0x1400000,f[l++]=0x1400000,h.bits=1,0;for(x=1;x0&&(0===t||1!==A))return -1;for(k=1,U[1]=0;k<15;k++)U[k+1]=U[k]+L[k];for(E=0;E852||2===t&&I>592)return 1;for(;;){v=k-C,c[E]b?(_=z[D+c[E]],w=P[j+c[E]]):(_=96,w=0),d=1<>C)+(p-=d)]=v<<24|_<<16|w;while(0!==p)for(d=1<>=1;if(0!==d?(B&=d-1,B+=d):B=0,E++,0==--L[k]){if(k===A)break;k=e[r+c[E]]}if(k>O&&(B&g)!==y){for(0===C&&(C=O),m+=x,T=1<<(R=k-C);R+C852||2===t&&I>592)return 1;f[y=B&g]=O<<24|R<<16|m-l}}return 0!==B&&(f[m+B]=k-C<<24|4194304),h.bits=O,0}},57235,(t,e,r)=>{"use strict";var n,i,o=t.r(79148),a=t.r(74049),s=t.r(63327),u=t.r(75531),f=t.r(73012);function l(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function c(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new o.Buf16(320),this.work=new o.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function h(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new o.Buf32(852),e.distcode=e.distdyn=new o.Buf32(592),e.sane=1,e.back=-1,0):-2}function d(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,h(t)):-2}function p(t,e){var r,n;return t&&t.state?(n=t.state,e<0?(r=0,e=-e):(r=(e>>4)+1,e<48&&(e&=15)),e&&(e<8||e>15))?-2:(null!==n.window&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,d(t)):-2}function y(t,e){var r,n;return t?(t.state=n=new c,n.window=null,0!==(r=p(t,e))&&(t.state=null),r):-2}var g=!0;function m(t,e,r,n){var i,a=t.state;return null===a.window&&(a.wsize=1<=a.wsize?(o.arraySet(a.window,e,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):((i=a.wsize-a.wnext)>n&&(i=n),o.arraySet(a.window,e,r-n,i,a.wnext),(n-=i)?(o.arraySet(a.window,e,r-n,n,0),a.wnext=n,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave>>8&255,r.check=s(r.check,z,2,0),v=0,_=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&v)<<8)+(v>>8))%31){t.msg="incorrect header check",r.mode=30;break}if((15&v)!=8){t.msg="unknown compression method",r.mode=30;break}if(v>>>=4,_-=4,B=(15&v)+8,0===r.wbits)r.wbits=B;else if(B>r.wbits){t.msg="invalid window size",r.mode=30;break}r.dmax=1<>8&1),512&r.flags&&(z[0]=255&v,z[1]=v>>>8&255,r.check=s(r.check,z,2,0)),v=0,_=0,r.mode=3;case 3:for(;_<32;){if(0===y)break e;y--,v+=c[d++]<<_,_+=8}r.head&&(r.head.time=v),512&r.flags&&(z[0]=255&v,z[1]=v>>>8&255,z[2]=v>>>16&255,z[3]=v>>>24&255,r.check=s(r.check,z,4,0)),v=0,_=0,r.mode=4;case 4:for(;_<16;){if(0===y)break e;y--,v+=c[d++]<<_,_+=8}r.head&&(r.head.xflags=255&v,r.head.os=v>>8),512&r.flags&&(z[0]=255&v,z[1]=v>>>8&255,r.check=s(r.check,z,2,0)),v=0,_=0,r.mode=5;case 5:if(1024&r.flags){for(;_<16;){if(0===y)break e;y--,v+=c[d++]<<_,_+=8}r.length=v,r.head&&(r.head.extra_len=v),512&r.flags&&(z[0]=255&v,z[1]=v>>>8&255,r.check=s(r.check,z,2,0)),v=0,_=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((k=r.length)>y&&(k=y),k&&(r.head&&(B=r.head.extra_len-r.length,r.head.extra||(r.head.extra=Array(r.head.extra_len)),o.arraySet(r.head.extra,c,d,k,B)),512&r.flags&&(r.check=s(r.check,c,k,d)),y-=k,d+=k,r.length-=k),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===y)break e;k=0;do B=c[d+k++],r.head&&B&&r.length<65536&&(r.head.name+=String.fromCharCode(B));while(B&&k>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=12;break;case 10:for(;_<32;){if(0===y)break e;y--,v+=c[d++]<<_,_+=8}t.adler=r.check=l(v),v=0,_=0,r.mode=11;case 11:if(0===r.havedict)return t.next_out=p,t.avail_out=b,t.next_in=d,t.avail_in=y,r.hold=v,r.bits=_,2;t.adler=r.check=1,r.mode=12;case 12:if(5===e||6===e)break e;case 13:if(r.last){v>>>=7&_,_-=7&_,r.mode=27;break}for(;_<3;){if(0===y)break e;y--,v+=c[d++]<<_,_+=8}switch(r.last=1&v,_-=1,3&(v>>>=1)){case 0:r.mode=14;break;case 1:if(!function(t){if(g){var e;for(n=new o.Buf32(512),i=new o.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(f(1,t.lens,0,288,n,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;f(2,t.lens,0,32,i,0,t.work,{bits:5}),g=!1}t.lencode=n,t.lenbits=9,t.distcode=i,t.distbits=5}(r),r.mode=20,6===e){v>>>=2,_-=2;break e}break;case 2:r.mode=17;break;case 3:t.msg="invalid block type",r.mode=30}v>>>=2,_-=2;break;case 14:for(v>>>=7&_,_-=7&_;_<32;){if(0===y)break e;y--,v+=c[d++]<<_,_+=8}if((65535&v)!=(v>>>16^65535)){t.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&v,v=0,_=0,r.mode=15,6===e)break e;case 15:r.mode=16;case 16:if(k=r.length){if(k>y&&(k=y),k>b&&(k=b),0===k)break e;o.arraySet(h,c,d,k,p),y-=k,d+=k,b-=k,p+=k,r.length-=k;break}r.mode=12;break;case 17:for(;_<14;){if(0===y)break e;y--,v+=c[d++]<<_,_+=8}if(r.nlen=(31&v)+257,_-=5,r.ndist=(31&(v>>>=5))+1,_-=5,r.ncode=(15&(v>>>=5))+4,v>>>=4,_-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=30;break}r.have=0,r.mode=18;case 18:for(;r.have>>=3,_-=3}for(;r.have<19;)r.lens[D[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,j={bits:r.lenbits},P=f(0,r.lens,0,19,r.lencode,0,r.work,j),r.lenbits=j.bits,P){t.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have>>24,O=U>>>16&255,R=65535&U,!(A<=_);){if(0===y)break e;y--,v+=c[d++]<<_,_+=8}if(R<16)v>>>=A,_-=A,r.lens[r.have++]=R;else{if(16===R){for(L=A+2;_>>=A,_-=A,0===r.have){t.msg="invalid bit length repeat",r.mode=30;break}B=r.lens[r.have-1],k=3+(3&v),v>>>=2,_-=2}else if(17===R){for(L=A+3;_>>=A,_-=A,B=0,k=3+(7&v),v>>>=3,_-=3}else{for(L=A+7;_>>=A,_-=A,B=0,k=11+(127&v),v>>>=7,_-=7}if(r.have+k>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=30;break}for(;k--;)r.lens[r.have++]=B}}if(30===r.mode)break;if(0===r.lens[256]){t.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,j={bits:r.lenbits},P=f(1,r.lens,0,r.nlen,r.lencode,0,r.work,j),r.lenbits=j.bits,P){t.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,j={bits:r.distbits},P=f(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,j),r.distbits=j.bits,P){t.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===e)break e;case 20:r.mode=21;case 21:if(y>=6&&b>=258){t.next_out=p,t.avail_out=b,t.next_in=d,t.avail_in=y,r.hold=v,r.bits=_,u(t,S),p=t.next_out,h=t.output,b=t.avail_out,d=t.next_in,c=t.input,y=t.avail_in,v=r.hold,_=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;A=(U=r.lencode[v&(1<>>24,O=U>>>16&255,R=65535&U,!(A<=_);){if(0===y)break e;y--,v+=c[d++]<<_,_+=8}if(O&&(240&O)==0){for(C=A,T=O,I=R;A=(U=r.lencode[I+((v&(1<>C)])>>>24,O=U>>>16&255,R=65535&U,!(C+A<=_);){if(0===y)break e;y--,v+=c[d++]<<_,_+=8}v>>>=C,_-=C,r.back+=C}if(v>>>=A,_-=A,r.back+=A,r.length=R,0===O){r.mode=26;break}if(32&O){r.back=-1,r.mode=12;break}if(64&O){t.msg="invalid literal/length code",r.mode=30;break}r.extra=15&O,r.mode=22;case 22:if(r.extra){for(L=r.extra;_>>=r.extra,_-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;A=(U=r.distcode[v&(1<>>24,O=U>>>16&255,R=65535&U,!(A<=_);){if(0===y)break e;y--,v+=c[d++]<<_,_+=8}if((240&O)==0){for(C=A,T=O,I=R;A=(U=r.distcode[I+((v&(1<>C)])>>>24,O=U>>>16&255,R=65535&U,!(C+A<=_);){if(0===y)break e;y--,v+=c[d++]<<_,_+=8}v>>>=C,_-=C,r.back+=C}if(v>>>=A,_-=A,r.back+=A,64&O){t.msg="invalid distance code",r.mode=30;break}r.offset=R,r.extra=15&O,r.mode=24;case 24:if(r.extra){for(L=r.extra;_>>=r.extra,_-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===b)break e;if(k=S-b,r.offset>k){if((k=r.offset-k)>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=30;break}k>r.wnext?(k-=r.wnext,E=r.wsize-k):E=r.wnext-k,k>r.length&&(k=r.length),x=r.window}else x=h,E=p-r.offset,k=r.length;k>b&&(k=b),b-=k,r.length-=k;do h[p++]=x[E++];while(--k)0===r.length&&(r.mode=21);break;case 26:if(0===b)break e;h[p++]=r.length,b--,r.mode=21;break;case 27:if(r.wrap){for(;_<32;){if(0===y)break e;y--,v|=c[d++]<<_,_+=8}if(S-=b,t.total_out+=S,r.total+=S,S&&(t.adler=r.check=r.flags?s(r.check,h,S,p-S):a(r.check,h,S,p-S)),S=b,(r.flags?v:l(v))!==r.check){t.msg="incorrect data check",r.mode=30;break}v=0,_=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;_<32;){if(0===y)break e;y--,v+=c[d++]<<_,_+=8}if(v!==(0|r.total)){t.msg="incorrect length check",r.mode=30;break}v=0,_=0}r.mode=29;case 29:P=1;break e;case 30:P=-3;break e;case 31:return -4;default:return -2}return t.next_out=p,t.avail_out=b,t.next_in=d,t.avail_in=y,r.hold=v,r.bits=_,(r.wsize||S!==t.avail_out&&r.mode<30&&(r.mode<27||4!==e))&&m(t,t.output,t.next_out,S-t.avail_out),w-=t.avail_in,S-=t.avail_out,t.total_in+=w,t.total_out+=S,r.total+=S,r.wrap&&S&&(t.adler=r.check=r.flags?s(r.check,h,S,t.next_out-S):a(r.check,h,S,t.next_out-S)),t.data_type=r.bits+64*!!r.last+128*(12===r.mode)+256*(20===r.mode||15===r.mode),(0===w&&0===S||4===e)&&0===P&&(P=-5),P},r.inflateEnd=function(t){if(!t||!t.state)return -2;var e=t.state;return e.window&&(e.window=null),t.state=null,0},r.inflateGetHeader=function(t,e){var r;return t&&t.state&&(2&(r=t.state).wrap)!=0?(r.head=e,e.done=!1,0):-2},r.inflateSetDictionary=function(t,e){var r,n=e.length;return t&&t.state&&(0===(r=t.state).wrap||11===r.mode)?11===r.mode&&a(1,e,n,0)!==r.check?-3:m(t,e,n,n)?(r.mode=31,-4):(r.havedict=1,0):-2},r.inflateInfo="pako inflate (from Nodeca project)"},34131,(t,e,r)=>{"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},24448,(t,e,r)=>{"use strict";e.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},82473,(t,e,r)=>{"use strict";var n=t.r(57235),i=t.r(79148),o=t.r(63202),a=t.r(34131),s=t.r(19558),u=t.r(98899),f=t.r(24448),l=Object.prototype.toString;function c(t){if(!(this instanceof c))return new c(t);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(15&e.windowBits)==0&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0;var r=n.inflateInit2(this.strm,e.windowBits);if(r!==a.Z_OK||(this.header=new f,n.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=o.string2buf(e.dictionary):"[object ArrayBuffer]"===l.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw)&&(r=n.inflateSetDictionary(this.strm,e.dictionary))!==a.Z_OK))throw Error(s[r])}function h(t,e){var r=new c(e);if(r.push(t,!0),r.err)throw r.msg||s[r.err];return r.result}c.prototype.push=function(t,e){var r,s,u,f,c,h=this.strm,d=this.options.chunkSize,p=this.options.dictionary,y=!1;if(this.ended)return!1;s=e===~~e?e:!0===e?a.Z_FINISH:a.Z_NO_FLUSH,"string"==typeof t?h.input=o.binstring2buf(t):"[object ArrayBuffer]"===l.call(t)?h.input=new Uint8Array(t):h.input=t,h.next_in=0,h.avail_in=h.input.length;do{if(0===h.avail_out&&(h.output=new i.Buf8(d),h.next_out=0,h.avail_out=d),(r=n.inflate(h,a.Z_NO_FLUSH))===a.Z_NEED_DICT&&p&&(r=n.inflateSetDictionary(this.strm,p)),r===a.Z_BUF_ERROR&&!0===y&&(r=a.Z_OK,y=!1),r!==a.Z_STREAM_END&&r!==a.Z_OK)return this.onEnd(r),this.ended=!0,!1;h.next_out&&(0===h.avail_out||r===a.Z_STREAM_END||0===h.avail_in&&(s===a.Z_FINISH||s===a.Z_SYNC_FLUSH))&&("string"===this.options.to?(u=o.utf8border(h.output,h.next_out),f=h.next_out-u,c=o.buf2string(h.output,u),h.next_out=f,h.avail_out=d-f,f&&i.arraySet(h.output,h.output,u,f,0),this.onData(c)):this.onData(i.shrinkBuf(h.output,h.next_out))),0===h.avail_in&&0===h.avail_out&&(y=!0)}while((h.avail_in>0||0===h.avail_out)&&r!==a.Z_STREAM_END)return(r===a.Z_STREAM_END&&(s=a.Z_FINISH),s===a.Z_FINISH)?(r=n.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===a.Z_OK):(s===a.Z_SYNC_FLUSH&&(this.onEnd(a.Z_OK),h.avail_out=0),!0)},c.prototype.onData=function(t){this.chunks.push(t)},c.prototype.onEnd=function(t){t===a.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},r.Inflate=c,r.inflate=h,r.inflateRaw=function(t,e){return(e=e||{}).raw=!0,h(t,e)},r.ungzip=h},9643,(t,e,r)=>{"use strict";var n=t.r(79148).assign,i=t.r(48901),o=t.r(82473),a=t.r(34131),s={};n(s,i,o,a),e.exports=s},72488,(t,e,r)=>{"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,i=t.r(9643),o=t.r(65464),a=t.r(48913),s=n?"uint8array":"array";function u(t,e){a.call(this,"FlateWorker/"+t),this._pako=null,this._pakoAction=t,this._pakoOptions=e,this.meta={}}r.magic="\b\0",o.inherits(u,a),u.prototype.processChunk=function(t){this.meta=t.meta,null===this._pako&&this._createPako(),this._pako.push(o.transformTo(s,t.data),!1)},u.prototype.flush=function(){a.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},u.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this._pako=null},u.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var t=this;this._pako.onData=function(e){t.push({data:e,meta:t.meta})}},r.compressWorker=function(t){return new u("Deflate",t)},r.uncompressWorker=function(){return new u("Inflate",{})}},36462,(t,e,r)=>{"use strict";var n=t.r(48913);r.STORE={magic:"\0\0",compressWorker:function(){return new n("STORE compression")},uncompressWorker:function(){return new n("STORE decompression")}},r.DEFLATE=t.r(72488)},71471,(t,e,r)=>{"use strict";r.LOCAL_FILE_HEADER="PK\x03\x04",r.CENTRAL_FILE_HEADER="PK\x01\x02",r.CENTRAL_DIRECTORY_END="PK\x05\x06",r.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x06\x07",r.ZIP64_CENTRAL_DIRECTORY_END="PK\x06\x06",r.DATA_DESCRIPTOR="PK\x07\b"},21908,(t,e,r)=>{"use strict";var n=t.r(65464),i=t.r(48913),o=t.r(46253),a=t.r(63494),s=t.r(71471),u=function(t,e){var r,n="";for(r=0;r>>=8;return n},f=function(t,e){var r=t;return t||(r=e?16893:33204),(65535&r)<<16},l=function(t,e,r,i,l,c){var h,d,p=t.file,y=t.compression,g=c!==o.utf8encode,m=n.transformTo("string",c(p.name)),b=n.transformTo("string",o.utf8encode(p.name)),v=p.comment,_=n.transformTo("string",c(v)),w=n.transformTo("string",o.utf8encode(v)),S=b.length!==p.name.length,k=w.length!==v.length,E="",x="",A="",O=p.dir,R=p.date,C={crc32:0,compressedSize:0,uncompressedSize:0};(!e||r)&&(C.crc32=t.crc32,C.compressedSize=t.compressedSize,C.uncompressedSize=t.uncompressedSize);var T=0;e&&(T|=8),!g&&(S||k)&&(T|=2048);var I=0,B=0;(O&&(I|=16),"UNIX"===l)?(B=798,I|=f(p.unixPermissions,O)):(B=20,I|=63&(p.dosPermissions||0)),h=(R.getUTCHours()<<6|R.getUTCMinutes())<<5|R.getUTCSeconds()/2,d=(R.getUTCFullYear()-1980<<4|R.getUTCMonth()+1)<<5|R.getUTCDate(),S&&(x=u(1,1)+u(a(m),4)+b,E+="up"+u(x.length,2)+x),k&&(A=u(1,1)+u(a(_),4)+w,E+="uc"+u(A.length,2)+A);var P="";return P+="\n\0",P+=u(T,2),P+=y.magic,P+=u(h,2),P+=u(d,2),P+=u(C.crc32,4),P+=u(C.compressedSize,4),P+=u(C.uncompressedSize,4),P+=u(m.length,2),P+=u(E.length,2),{fileRecord:s.LOCAL_FILE_HEADER+P+m+E,dirRecord:s.CENTRAL_FILE_HEADER+u(B,2)+P+u(_.length,2)+"\0\0\0\0"+u(I,4)+u(i,4)+m+E+_}},c=function(t,e,r,i,o){var a=n.transformTo("string",o(i));return s.CENTRAL_DIRECTORY_END+"\0\0\0\0"+u(t,2)+u(t,2)+u(e,4)+u(r,4)+u(a.length,2)+a},h=function(t){return s.DATA_DESCRIPTOR+u(t.crc32,4)+u(t.compressedSize,4)+u(t.uncompressedSize,4)};function d(t,e,r,n){i.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=e,this.zipPlatform=r,this.encodeFileName=n,this.streamFiles=t,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}n.inherits(d,i),d.prototype.push=function(t){var e=t.meta.percent||0,r=this.entriesCount,n=this._sources.length;this.accumulate?this.contentBuffer.push(t):(this.bytesWritten+=t.data.length,i.prototype.push.call(this,{data:t.data,meta:{currentFile:this.currentFile,percent:r?(e+100*(r-n-1))/r:100}}))},d.prototype.openedSource=function(t){this.currentSourceOffset=this.bytesWritten,this.currentFile=t.file.name;var e=this.streamFiles&&!t.file.dir;if(e){var r=l(t,e,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}})}else this.accumulate=!0},d.prototype.closedSource=function(t){this.accumulate=!1;var e=this.streamFiles&&!t.file.dir,r=l(t,e,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),e)this.push({data:h(t),meta:{percent:100}});else for(this.push({data:r.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},d.prototype.flush=function(){for(var t=this.bytesWritten,e=0;e{"use strict";var n=t.r(36462),i=t.r(21908),o=function(t,e){var r=t||e,i=n[r];if(!i)throw Error(r+" is not a valid compression method !");return i};r.generateWorker=function(t,e,r){var n=new i(e.streamFiles,r,e.platform,e.encodeFileName),a=0;try{t.forEach(function(t,r){a++;var i=o(r.options.compression,e.compression),s=r.options.compressionOptions||e.compressionOptions||{},u=r.dir,f=r.date;r._compressWorker(i,s).withStreamInfo("file",{name:t,dir:u,date:f,comment:r.comment||"",unixPermissions:r.unixPermissions,dosPermissions:r.dosPermissions}).pipe(n)}),n.entriesCount=a}catch(t){n.error(t)}return n}},13303,(t,e,r)=>{"use strict";var n=t.r(65464),i=t.r(48913);function o(t,e){i.call(this,"Nodejs stream input adapter for "+t),this._upstreamEnded=!1,this._bindStream(e)}n.inherits(o,i),o.prototype._bindStream=function(t){var e=this;this._stream=t,t.pause(),t.on("data",function(t){e.push({data:t,meta:{percent:0}})}).on("error",function(t){e.isPaused?this.generatedError=t:e.error(t)}).on("end",function(){e.isPaused?e._upstreamEnded=!0:e.end()})},o.prototype.pause=function(){return!!i.prototype.pause.call(this)&&(this._stream.pause(),!0)},o.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},e.exports=o},1223,(t,e,r)=>{"use strict";var n=t.r(46253),i=t.r(65464),o=t.r(48913),a=t.r(846),s=t.r(13133),u=t.r(43220),f=t.r(52929),l=t.r(6664),c=t.r(42527),h=t.r(13303),d=function(t,e,r){var n,a=i.getTypeOf(e),l=i.extend(r||{},s);l.date=l.date||new Date,null!==l.compression&&(l.compression=l.compression.toUpperCase()),"string"==typeof l.unixPermissions&&(l.unixPermissions=parseInt(l.unixPermissions,8)),l.unixPermissions&&16384&l.unixPermissions&&(l.dir=!0),l.dosPermissions&&16&l.dosPermissions&&(l.dir=!0),l.dir&&(t=y(t)),l.createFolders&&(n=p(t))&&g.call(this,n,!0);var d="string"===a&&!1===l.binary&&!1===l.base64;r&&void 0!==r.binary||(l.binary=!d),(e instanceof u&&0===e.uncompressedSize||l.dir||!e||0===e.length)&&(l.base64=!1,l.binary=!0,e="",l.compression="STORE",a="string");var m=null;m=e instanceof u||e instanceof o?e:c.isNode&&c.isStream(e)?new h(t,e):i.prepareContent(t,e,l.binary,l.optimizedBinaryString,l.base64);var b=new f(t,m,l);this.files[t]=b},p=function(t){"/"===t.slice(-1)&&(t=t.substring(0,t.length-1));var e=t.lastIndexOf("/");return e>0?t.substring(0,e):""},y=function(t){return"/"!==t.slice(-1)&&(t+="/"),t},g=function(t,e){return e=void 0!==e?e:s.createFolders,t=y(t),this.files[t]||d.call(this,t,null,{dir:!0,createFolders:e}),this.files[t]};function m(t){return"[object RegExp]"===Object.prototype.toString.call(t)}e.exports={load:function(){throw Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(t){var e,r,n;for(e in this.files)n=this.files[e],(r=e.slice(this.root.length,e.length))&&e.slice(0,this.root.length)===this.root&&t(r,n)},filter:function(t){var e=[];return this.forEach(function(r,n){t(r,n)&&e.push(n)}),e},file:function(t,e,r){if(1==arguments.length)if(m(t)){var n=t;return this.filter(function(t,e){return!e.dir&&n.test(t)})}else{var i=this.files[this.root+t];return i&&!i.dir?i:null}return t=this.root+t,d.call(this,t,e,r),this},folder:function(t){if(!t)return this;if(m(t))return this.filter(function(e,r){return r.dir&&t.test(e)});var e=this.root+t,r=g.call(this,e),n=this.clone();return n.root=r.name,n},remove:function(t){t=this.root+t;var e=this.files[t];if(e||("/"!==t.slice(-1)&&(t+="/"),e=this.files[t]),e&&!e.dir)delete this.files[t];else for(var r=this.filter(function(e,r){return r.name.slice(0,t.length)===t}),n=0;n{"use strict";var n=t.r(65464);function i(t){this.data=t,this.length=t.length,this.index=0,this.zero=0}i.prototype={checkOffset:function(t){this.checkIndex(this.index+t)},checkIndex:function(t){if(this.length=this.index;e--)r=(r<<8)+this.byteAt(e);return this.index+=t,r},readString:function(t){return n.transformTo("string",this.readData(t))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var t=this.readInt(4);return new Date(Date.UTC((t>>25&127)+1980,(t>>21&15)-1,t>>16&31,t>>11&31,t>>5&63,(31&t)<<1))}},e.exports=i},12189,(t,e,r)=>{"use strict";var n=t.r(37384);function i(t){n.call(this,t);for(var e=0;e=0;--o)if(this.data[o]===e&&this.data[o+1]===r&&this.data[o+2]===n&&this.data[o+3]===i)return o-this.zero;return -1},i.prototype.readAndCheckSignature=function(t){var e=t.charCodeAt(0),r=t.charCodeAt(1),n=t.charCodeAt(2),i=t.charCodeAt(3),o=this.readData(4);return e===o[0]&&r===o[1]&&n===o[2]&&i===o[3]},i.prototype.readData=function(t){if(this.checkOffset(t),0===t)return[];var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=i},41370,(t,e,r)=>{"use strict";var n=t.r(37384);function i(t){n.call(this,t)}t.r(65464).inherits(i,n),i.prototype.byteAt=function(t){return this.data.charCodeAt(this.zero+t)},i.prototype.lastIndexOfSignature=function(t){return this.data.lastIndexOf(t)-this.zero},i.prototype.readAndCheckSignature=function(t){return t===this.readData(4)},i.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=i},15841,(t,e,r)=>{"use strict";var n=t.r(12189);function i(t){n.call(this,t)}t.r(65464).inherits(i,n),i.prototype.readData=function(t){if(this.checkOffset(t),0===t)return new Uint8Array(0);var e=this.data.subarray(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=i},44429,(t,e,r)=>{"use strict";var n=t.r(15841);function i(t){n.call(this,t)}t.r(65464).inherits(i,n),i.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=i},71770,(t,e,r)=>{"use strict";var n=t.r(65464),i=t.r(87780),o=t.r(12189),a=t.r(41370),s=t.r(44429),u=t.r(15841);e.exports=function(t){var e=n.getTypeOf(t);return(n.checkSupport(e),"string"!==e||i.uint8array)?"nodebuffer"===e?new s(t):i.uint8array?new u(n.transformTo("uint8array",t)):new o(n.transformTo("array",t)):new a(t)}},92861,(t,e,r)=>{"use strict";var n=t.r(71770),i=t.r(65464),o=t.r(43220),a=t.r(63494),s=t.r(46253),u=t.r(36462),f=t.r(87780),l=function(t){for(var e in u)if(Object.prototype.hasOwnProperty.call(u,e)&&u[e].magic===t)return u[e];return null};function c(t,e){this.options=t,this.loadOptions=e}c.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(t){var e,r;if(t.skip(22),this.fileNameLength=t.readInt(2),r=t.readInt(2),this.fileName=t.readData(this.fileNameLength),t.skip(r),-1===this.compressedSize||-1===this.uncompressedSize)throw Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(e=l(this.compressionMethod)))throw Error("Corrupted zip : compression "+i.pretty(this.compressionMethod)+" unknown (inner file : "+i.transformTo("string",this.fileName)+")");this.decompressed=new o(this.compressedSize,this.uncompressedSize,this.crc32,e,t.readData(this.compressedSize))},readCentralPart:function(t){this.versionMadeBy=t.readInt(2),t.skip(2),this.bitFlag=t.readInt(2),this.compressionMethod=t.readString(2),this.date=t.readDate(),this.crc32=t.readInt(4),this.compressedSize=t.readInt(4),this.uncompressedSize=t.readInt(4);var e=t.readInt(2);if(this.extraFieldsLength=t.readInt(2),this.fileCommentLength=t.readInt(2),this.diskNumberStart=t.readInt(2),this.internalFileAttributes=t.readInt(2),this.externalFileAttributes=t.readInt(4),this.localHeaderOffset=t.readInt(4),this.isEncrypted())throw Error("Encrypted zip are not supported");t.skip(e),this.readExtraFields(t),this.parseZIP64ExtraField(t),this.fileComment=t.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var t=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0===t&&(this.dosPermissions=63&this.externalFileAttributes),3===t&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var t=n(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4))}},readExtraFields:function(t){var e,r,n,i=t.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});t.index+4{"use strict";var n=t.r(71770),i=t.r(65464),o=t.r(71471),a=t.r(92861),s=t.r(87780);function u(t){this.files=[],this.loadOptions=t}u.prototype={checkSignature:function(t){if(!this.reader.readAndCheckSignature(t)){this.reader.index-=4;var e=this.reader.readString(4);throw Error("Corrupted zip or bug: unexpected signature ("+i.pretty(e)+", expected "+i.pretty(t)+")")}},isSignature:function(t,e){var r=this.reader.index;this.reader.setIndex(t);var n=this.reader.readString(4);return this.reader.setIndex(r),n===e},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var t=this.reader.readData(this.zipCommentLength),e=s.uint8array?"uint8array":"array",r=i.transformTo(e,t);this.zipComment=this.loadOptions.decodeFileName(r)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var t,e,r,n=this.zip64EndOfCentralSize-44;01)throw Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var t,e;for(t=0;t0)this.isSignature(e,o.CENTRAL_FILE_HEADER)||(this.reader.zero=n);else if(n<0)throw Error("Corrupted zip: missing "+Math.abs(n)+" bytes.")},prepareReader:function(t){this.reader=n(t)},load:function(t){this.prepareReader(t),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},e.exports=u},37153,(t,e,r)=>{"use strict";var n=t.r(65464),i=t.r(24375),o=t.r(46253),a=t.r(12938),s=t.r(1648),u=t.r(42527);e.exports=function(t,e){var r=this;return(e=n.extend(e||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:o.utf8decode}),u.isNode&&u.isStream(t))?i.Promise.reject(Error("JSZip can't accept a stream when loading a zip file.")):n.prepareContent("the loaded zip file",t,!0,e.optimizedBinaryString,e.base64).then(function(t){var r=new a(e);return r.load(t),r}).then(function(t){var r=[i.Promise.resolve(t)],n=t.files;if(e.checkCRC32)for(var o=0;o{"use strict";function n(){if(!(this instanceof n))return new n;if(arguments.length)throw Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var t=new n;for(var e in this)"function"!=typeof this[e]&&(t[e]=this[e]);return t}}n.prototype=t.r(1223),n.prototype.loadAsync=t.r(37153),n.support=t.r(87780),n.defaults=t.r(13133),n.version="3.10.1",n.loadAsync=function(t,e){return new n().loadAsync(t,e)},n.external=t.r(24375),e.exports=n}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/d9e502f7607fcfba.js b/docs/_next/static/chunks/d9e502f7607fcfba.js deleted file mode 100644 index 24a8f1d..0000000 --- a/docs/_next/static/chunks/d9e502f7607fcfba.js +++ /dev/null @@ -1 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,30662,(e,t,r)=>{!function(){"use strict";var e={864:function(e){var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise(function(r,n){var i,o,a;function s(r){e.removeListener(t,u),n(r)}function u(){"function"==typeof e.removeListener&&e.removeListener("error",s),r([].slice.call(arguments))}y(e,t,u,{once:!0}),"error"!==t&&(i=e,o=s,a={once:!0},"function"==typeof i.on&&y(i,"error",o,a))})},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var a=10;function s(e){if("function"!=typeof e)throw TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function l(e,t,r,n){if(s(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),a=o[t]),void 0===a)a=o[t]=r,++e._eventsCount;else if("function"==typeof a?a=o[t]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(i=u(e))>0&&a.length>i&&!a.warned){a.warned=!0;var i,o,a,l=Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=a.length,console&&console.warn&&console.warn(l)}return e}function f(){if(!this.fired)return(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0==arguments.length)?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function c(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=f.bind(n);return i.listener=r,n.wrapFn=i,i}function h(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=Array(e.length),r=0;r0&&(a=t[0]),a instanceof Error)throw a;var a,s=Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=o[e];if(void 0===u)return!1;if("function"==typeof u)n(u,this,t);else for(var l=u.length,f=p(u,l),r=0;r=0;o--)if(r[o]===t||r[o].listener===t){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return h(this,e,!0)},o.prototype.rawListeners=function(e){return h(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):d.call(e,t)},o.prototype.listenerCount=d,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}}},r={};function n(t){var i=r[t];if(void 0!==i)return i.exports;var o=r[t]={exports:{}},a=!0;try{e[t](o,o.exports,n),a=!1}finally{a&&delete r[t]}return o.exports}n.ab="/ROOT/node_modules/next/dist/compiled/events/",t.exports=n(864)}()},77398,(e,t,r)=>{var n=e.i(67034),i=e.i(47167);!function(){var r={992:function(e){e.exports=function(e,r,n){if(e.filter)return e.filter(r,n);if(null==e||"function"!=typeof r)throw TypeError();for(var i=[],o=0;o-1?i(r):r}},139:function(e,t,r){"use strict";var n=r(212),i=r(192),o=i("%Function.prototype.apply%"),a=i("%Function.prototype.call%"),s=i("%Reflect.apply%",!0)||n.call(a,o),u=i("%Object.getOwnPropertyDescriptor%",!0),l=i("%Object.defineProperty%",!0),f=i("%Math.max%");if(l)try{l({},"a",{value:1})}catch(e){l=null}e.exports=function(e){var t=s(n,a,arguments);return u&&l&&u(t,"length").configurable&&l(t,"length",{value:1+f(0,e.length-(arguments.length-1))}),t};var c=function(){return s(n,o,arguments)};l?l(e.exports,"apply",{value:c}):e.exports.apply=c},181:function(e){"use strict";e.exports=EvalError},545:function(e){"use strict";e.exports=Error},22:function(e){"use strict";e.exports=RangeError},803:function(e){"use strict";e.exports=ReferenceError},182:function(e){"use strict";e.exports=SyntaxError},202:function(e){"use strict";e.exports=TypeError},284:function(e){"use strict";e.exports=URIError},144:function(e){var t=Object.prototype.hasOwnProperty,r=Object.prototype.toString;e.exports=function(e,n,i){if("[object Function]"!==r.call(n))throw TypeError("iterator must be a function");var o=e.length;if(o===+o)for(var a=0;a1&&"boolean"!=typeof t)throw new l('"allowMissing" argument must be a boolean');if(null===P(/^%?[^%]*%?$/,e))throw new u("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=B(e),n=r.length>0?r[0]:"",i=z("%"+n+"%",t),o=i.name,a=i.value,s=!1,f=i.alias;f&&(n=f[0],R(r,O([0,1],f)));for(var c=1,h=!0;c=r.length){var m=d(a,p);a=(h=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:a[p]}else h=A(a,p),a=a[p];h&&!s&&(w[o]=a)}}return a}},14:function(e){"use strict";var t={__proto__:null,foo:{}},r=Object;e.exports=function(){return({__proto__:t}).foo===t.foo&&!(t instanceof r)}},942:function(e,t,r){"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(773);e.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},773:function(e){"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t||"[object Symbol]"!==Object.prototype.toString.call(t)||"[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length||"function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},115:function(e,t,r){"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(832);e.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},832:function(e){"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t||"[object Symbol]"!==Object.prototype.toString.call(t)||"[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length||"function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},270:function(e,t,r){"use strict";var n=Function.prototype.call,i=Object.prototype.hasOwnProperty;e.exports=r(212).call(n,i)},782:function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},157:function(e){"use strict";var t="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,r=Object.prototype.toString,n=function(e){return(!t||!e||"object"!=typeof e||!(Symbol.toStringTag in e))&&"[object Arguments]"===r.call(e)},i=function(e){return!!n(e)||null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==r.call(e)&&"[object Function]"===r.call(e.callee)},o=function(){return n(arguments)}();n.isLegacyArguments=i,e.exports=o?n:i},391:function(e){"use strict";var t=Object.prototype.toString,r=Function.prototype.toString,n=/^\s*(?:function)?\*/,i="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,o=Object.getPrototypeOf,a=function(){if(!i)return!1;try{return Function("return function*() {}")()}catch(e){}}(),s=a?o(a):{};e.exports=function(e){return"function"==typeof e&&(!!n.test(r.call(e))||(i?o(e)===s:"[object GeneratorFunction]"===t.call(e)))}},994:function(t,r,n){"use strict";var i=n(144),o=n(349),a=n(256),s=a("Object.prototype.toString"),u=n(942)()&&"symbol"==typeof Symbol.toStringTag,l=o(),f=a("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r-1)}},369:function(e){e.exports=function(e){return e instanceof n.Buffer}},584:function(e,t,r){"use strict";var n=r(157),i=r(391),o=r(490),a=r(994);function s(e){return e.call.bind(e)}var u="undefined"!=typeof BigInt,l="undefined"!=typeof Symbol,f=s(Object.prototype.toString),c=s(Number.prototype.valueOf),h=s(String.prototype.valueOf),d=s(Boolean.prototype.valueOf);if(u)var p=s(BigInt.prototype.valueOf);if(l)var y=s(Symbol.prototype.valueOf);function g(e,t){if("object"!=typeof e)return!1;try{return t(e),!0}catch(e){return!1}}function m(e){return"[object Map]"===f(e)}function b(e){return"[object Set]"===f(e)}function _(e){return"[object WeakMap]"===f(e)}function v(e){return"[object WeakSet]"===f(e)}function w(e){return"[object ArrayBuffer]"===f(e)}function S(e){return"undefined"!=typeof ArrayBuffer&&(w.working?w(e):e instanceof ArrayBuffer)}function k(e){return"[object DataView]"===f(e)}function x(e){return"undefined"!=typeof DataView&&(k.working?k(e):e instanceof DataView)}t.isArgumentsObject=n,t.isGeneratorFunction=i,t.isTypedArray=a,t.isPromise=function(e){return"undefined"!=typeof Promise&&e instanceof Promise||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch},t.isArrayBufferView=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):a(e)||x(e)},t.isUint8Array=function(e){return"Uint8Array"===o(e)},t.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===o(e)},t.isUint16Array=function(e){return"Uint16Array"===o(e)},t.isUint32Array=function(e){return"Uint32Array"===o(e)},t.isInt8Array=function(e){return"Int8Array"===o(e)},t.isInt16Array=function(e){return"Int16Array"===o(e)},t.isInt32Array=function(e){return"Int32Array"===o(e)},t.isFloat32Array=function(e){return"Float32Array"===o(e)},t.isFloat64Array=function(e){return"Float64Array"===o(e)},t.isBigInt64Array=function(e){return"BigInt64Array"===o(e)},t.isBigUint64Array=function(e){return"BigUint64Array"===o(e)},m.working="undefined"!=typeof Map&&m(new Map),t.isMap=function(e){return"undefined"!=typeof Map&&(m.working?m(e):e instanceof Map)},b.working="undefined"!=typeof Set&&b(new Set),t.isSet=function(e){return"undefined"!=typeof Set&&(b.working?b(e):e instanceof Set)},_.working="undefined"!=typeof WeakMap&&_(new WeakMap),t.isWeakMap=function(e){return"undefined"!=typeof WeakMap&&(_.working?_(e):e instanceof WeakMap)},v.working="undefined"!=typeof WeakSet&&v(new WeakSet),t.isWeakSet=function(e){return v(e)},w.working="undefined"!=typeof ArrayBuffer&&w(new ArrayBuffer),t.isArrayBuffer=S,k.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&k(new DataView(new ArrayBuffer(1),0,1)),t.isDataView=x;var E="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function A(e){return"[object SharedArrayBuffer]"===f(e)}function O(e){return void 0!==E&&(void 0===A.working&&(A.working=A(new E)),A.working?A(e):e instanceof E)}function R(e){return g(e,c)}function C(e){return g(e,h)}function T(e){return g(e,d)}function P(e){return u&&g(e,p)}function I(e){return l&&g(e,y)}t.isSharedArrayBuffer=O,t.isAsyncFunction=function(e){return"[object AsyncFunction]"===f(e)},t.isMapIterator=function(e){return"[object Map Iterator]"===f(e)},t.isSetIterator=function(e){return"[object Set Iterator]"===f(e)},t.isGeneratorObject=function(e){return"[object Generator]"===f(e)},t.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===f(e)},t.isNumberObject=R,t.isStringObject=C,t.isBooleanObject=T,t.isBigIntObject=P,t.isSymbolObject=I,t.isBoxedPrimitive=function(e){return R(e)||C(e)||T(e)||P(e)||I(e)},t.isAnyArrayBuffer=function(e){return"undefined"!=typeof Uint8Array&&(S(e)||O(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(e){Object.defineProperty(t,e,{enumerable:!1,value:function(){throw Error(e+" is not supported in userland")}})})},177:function(e,t,r){var n=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n=i)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}}),s=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),g(r)?n.showHidden=r:r&&t._extend(n,r),v(n.showHidden)&&(n.showHidden=!1),v(n.depth)&&(n.depth=2),v(n.colors)&&(n.colors=!1),v(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=f),h(n,e,n.depth)}function f(e,t){var r=l.styles[t];return r?"\x1b["+l.colors[r][0]+"m"+e+"\x1b["+l.colors[r][1]+"m":e}function c(e,t){return e}function h(e,r,n){if(e.customInspect&&r&&E(r.inspect)&&r.inspect!==t.inspect&&!(r.constructor&&r.constructor.prototype===r)){var i,o,a,s,u,l,f=r.inspect(n,e);return _(f)||(f=h(e,f,n)),f}var c=function(e,t){if(v(t))return e.stylize("undefined","undefined");if(_(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return b(t)?e.stylize(""+t,"number"):g(t)?e.stylize(""+t,"boolean"):m(t)?e.stylize("null","null"):void 0}(e,r);if(c)return c;var S=Object.keys(r),A=(u={},S.forEach(function(e,t){u[e]=!0}),u);if(e.showHidden&&(S=Object.getOwnPropertyNames(r)),x(r)&&(S.indexOf("message")>=0||S.indexOf("description")>=0))return d(r);if(0===S.length){if(E(r)){var O=r.name?": "+r.name:"";return e.stylize("[Function"+O+"]","special")}if(w(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(k(r))return e.stylize(Date.prototype.toString.call(r),"date");if(x(r))return d(r)}var R="",T=!1,P=["{","}"];if(y(r)&&(T=!0,P=["[","]"]),E(r)&&(R=" [Function"+(r.name?": "+r.name:"")+"]"),w(r)&&(R=" "+RegExp.prototype.toString.call(r)),k(r)&&(R=" "+Date.prototype.toUTCString.call(r)),x(r)&&(R=" "+d(r)),0===S.length&&(!T||0==r.length))return P[0]+R+P[1];if(n<0)if(w(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");else return e.stylize("[Object]","special");return e.seen.push(r),l=T?function(e,t,r,n,i){for(var o=[],a=0,s=t.length;a=0&&s++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?a[0]+(""===o?"":o+"\n ")+" "+i.join(",\n ")+" "+a[1]:a[0]+o+" "+i.join(", ")+" "+a[1]}function d(e){return"["+Error.prototype.toString.call(e)+"]"}function p(e,t,r,n,i,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(s=e.stylize("[Setter]","special")),C(n,i)||(a="["+i+"]"),!s&&(0>e.seen.indexOf(u.value)?(s=m(r)?h(e,u.value,null):h(e,u.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n")):s=e.stylize("[Circular]","special")),v(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function y(e){return Array.isArray(e)}function g(e){return"boolean"==typeof e}function m(e){return null===e}function b(e){return"number"==typeof e}function _(e){return"string"==typeof e}function v(e){return void 0===e}function w(e){return S(e)&&"[object RegExp]"===A(e)}function S(e){return"object"==typeof e&&null!==e}function k(e){return S(e)&&"[object Date]"===A(e)}function x(e){return S(e)&&("[object Error]"===A(e)||e instanceof Error)}function E(e){return"function"==typeof e}function A(e){return Object.prototype.toString.call(e)}function O(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(!a[e=e.toUpperCase()])if(s.test(e)){var r=i.default.pid;a[e]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",e,r,n)}}else a[e]=function(){};return a[e]},t.inspect=l,l.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},l.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=r(584),t.isArray=y,t.isBoolean=g,t.isNull=m,t.isNullOrUndefined=function(e){return null==e},t.isNumber=b,t.isString=_,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=v,t.isRegExp=w,t.types.isRegExp=w,t.isObject=S,t.isDate=k,t.types.isDate=k,t.isError=x,t.types.isNativeError=x,t.isFunction=E,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(369);var R=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function C(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){var e,r;console.log("%s - %s",(r=[O((e=new Date).getHours()),O(e.getMinutes()),O(e.getSeconds())].join(":"),[e.getDate(),R[e.getMonth()],r].join(" ")),t.format.apply(t,arguments))},t.inherits=r(782),t._extend=function(e,t){if(!t||!S(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var T="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function P(e,t){if(!e){var r=Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw TypeError('The "original" argument must be of type Function');if(T&&e[T]){var t=e[T];if("function"!=typeof t)throw TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,T,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise(function(e,n){t=e,r=n}),i=[],o=0;o{var n=e.i(47167);!function(){var r={782:function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},646:function(e){"use strict";let t={};function r(e,r,n){n||(n=Error);class i extends n{constructor(e,t,n){super("string"==typeof r?r:r(e,t,n))}}i.prototype.name=n.name,i.prototype.code=e,t[e]=i}function n(e,t){if(!Array.isArray(e))return"of ".concat(t," ").concat(String(e));{let r=e.length;return(e=e.map(e=>String(e)),r>2)?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}}r("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),r("ERR_INVALID_ARG_TYPE",function(e,t,r){var i,o,a,s;let u,l;if("string"==typeof t&&(i="not ",t.substr(0,i.length)===i)?(u="must not be",t=t.replace(/^not /,"")):u="must be",o=" argument",(void 0===a||a>e.length)&&(a=e.length),e.substring(a-o.length,a)===o)l="The ".concat(e," ").concat(u," ").concat(n(t,"type"));else{let r=("number"!=typeof s&&(s=0),s+1>e.length||-1===e.indexOf(".",s))?"argument":"property";l='The "'.concat(e,'" ').concat(r," ").concat(u," ").concat(n(t,"type"))}return l+". Received type ".concat(typeof r)},TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.q=t},403:function(e,t,r){"use strict";var i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=f;var o=r(709),a=r(337);r(782)(f,o);for(var s=i(a.prototype),u=0;u0)if("string"==typeof t||u.objectMode||Object.getPrototypeOf(t)===h.prototype||(o=t,t=h.from(o)),n)u.endEmitted?k(e,new S):R(e,u,t,!0);else if(u.ended)k(e,new v);else{if(u.destroyed)return!1;u.reading=!1,u.decoder&&!r?(t=u.decoder.write(t),u.objectMode||0!==t.length?R(e,u,t,!1):I(e,u)):R(e,u,t,!1)}else n||(u.reading=!1,I(e,u));return!u.ended&&(u.lengtht.highWaterMark&&((r=e)>=0x40000000?r=0x40000000:(r--,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r++),t.highWaterMark=r),e<=t.length)?e:t.ended?t.length:(t.needReadable=!0,0)}function T(e){var t=e._readableState;a("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(a("emitReadable",t.flowing),t.emittedReadable=!0,n.default.nextTick(P,e))}function P(e){var t=e._readableState;a("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,L(e)}function I(e,t){t.readingMore||(t.readingMore=!0,n.default.nextTick(j,e,t))}function j(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function z(e){a("readable nexttick read 0"),e.read(0)}function D(e,t){a("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),L(e),t.flowing&&!t.reading&&e.read(0)}function L(e){var t=e._readableState;for(a("flow",t.flowing);t.flowing&&null!==e.read(););}function N(e,t){var r;return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r)}function F(e){var t=e._readableState;a("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,n.default.nextTick(M,t,e))}function M(e,t){if(a("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function U(e,t){for(var r=0,n=e.length;r=r.highWaterMark:r.length>0)||r.ended))return a("read: emitReadable",r.length,r.ended),0===r.length&&r.ended?F(this):T(this),null;if(0===(e=C(e,r))&&r.ended)return 0===r.length&&F(this),null;var i=r.needReadable;return a("need readable",i),(0===r.length||r.length-e0?N(e,r):null)?(r.needReadable=r.length<=r.highWaterMark,e=0):(r.length-=e,r.awaitDrain=0),0===r.length&&(r.ended||(r.needReadable=!0),n!==e&&r.ended&&F(this)),null!==t&&this.emit("data",t),t},A.prototype._read=function(e){k(this,new w("_read()"))},A.prototype.pipe=function(e,t){var r,i=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1,a("pipe count=%d opts=%j",o.pipesCount,t);var s=t&&!1===t.end||e===n.default.stdout||e===n.default.stderr?g:u;function u(){a("onend"),e.end()}o.endEmitted?n.default.nextTick(s):i.once("end",s),e.on("unpipe",function t(r,n){a("onunpipe"),r===i&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,a("cleanup"),e.removeListener("close",p),e.removeListener("finish",y),e.removeListener("drain",l),e.removeListener("error",d),e.removeListener("unpipe",t),i.removeListener("end",u),i.removeListener("end",g),i.removeListener("data",h),c=!0,o.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&l())});var l=(r=i,function(){var e=r._readableState;a("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&f(r,"data")&&(e.flowing=!0,L(r))});e.on("drain",l);var c=!1;function h(t){a("ondata");var r=e.write(t);a("dest.write",r),!1===r&&((1===o.pipesCount&&o.pipes===e||o.pipesCount>1&&-1!==U(o.pipes,e))&&!c&&(a("false write response, pause",o.awaitDrain),o.awaitDrain++),i.pause())}function d(t){a("onerror",t),g(),e.removeListener("error",d),0===f(e,"error")&&k(e,t)}function p(){e.removeListener("finish",y),g()}function y(){a("onfinish"),e.removeListener("close",p),g()}function g(){a("unpipe"),i.unpipe(e)}return i.on("data",h),!function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",d),e.once("close",p),e.once("finish",y),e.emit("pipe",i),o.flowing||(a("pipe resume"),i.resume()),e},A.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o0,!1!==i.flowing&&this.resume()):"readable"!==e||i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,a("on readable",i.length,i.reading),i.length?T(this):i.reading||n.default.nextTick(z,this)),r},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(e,t){var r=c.prototype.removeListener.call(this,e,t);return"readable"===e&&n.default.nextTick(B,this),r},A.prototype.removeAllListeners=function(e){var t=c.prototype.removeAllListeners.apply(this,arguments);return("readable"===e||void 0===e)&&n.default.nextTick(B,this),t},A.prototype.resume=function(){var e,t,r=this._readableState;return r.flowing||(a("resume"),r.flowing=!r.readableListening,e=this,(t=r).resumeScheduled||(t.resumeScheduled=!0,n.default.nextTick(D,e,t))),r.paused=!1,this},A.prototype.pause=function(){return a("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(a("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},A.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",function(){if(a("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(i){if(a("wrapped data"),r.decoder&&(i=r.decoder.write(i)),!r.objectMode||null!=i)(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))}),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o-1))throw new S(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(A.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(A.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),A.prototype._write=function(e,t,r){r(new g("_write()"))},A.prototype._writev=null,A.prototype.end=function(e,t,r){var i,o,a,s=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),s.corked&&(s.corked=1,this.uncork()),s.ending||(i=this,o=s,a=r,o.ending=!0,I(i,o),a&&(o.finished?n.default.nextTick(a):i.once("finish",a)),o.ended=!0,i.writable=!1),this},Object.defineProperty(A.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),A.prototype.destroy=h.destroy,A.prototype._undestroy=h.undestroy,A.prototype._destroy=function(e,t){t(e)}},871:function(e,t,r){"use strict";function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var o,a=r(698),s=Symbol("lastResolve"),u=Symbol("lastReject"),l=Symbol("error"),f=Symbol("ended"),c=Symbol("lastPromise"),h=Symbol("handlePromise"),d=Symbol("stream");function p(e,t){return{value:e,done:t}}function y(e){var t=e[s];if(null!==t){var r=e[d].read();null!==r&&(e[c]=null,e[s]=null,e[u]=null,t(p(r,!1)))}}function g(e){n.default.nextTick(y,e)}var m=Object.getPrototypeOf(function(){}),b=Object.setPrototypeOf((i(o={get stream(){return this[d]},next:function(){var e,t,r=this,i=this[l];if(null!==i)return Promise.reject(i);if(this[f])return Promise.resolve(p(void 0,!0));if(this[d].destroyed)return new Promise(function(e,t){n.default.nextTick(function(){r[l]?t(r[l]):e(p(void 0,!0))})});var o=this[c];if(o)t=new Promise((e=this,function(t,r){o.then(function(){if(e[f])return void t(p(void 0,!0));e[h](t,r)},r)}));else{var a=this[d].read();if(null!==a)return Promise.resolve(p(a,!1));t=new Promise(this[h])}return this[c]=t,t}},Symbol.asyncIterator,function(){return this}),i(o,"return",function(){var e=this;return new Promise(function(t,r){e[d].destroy(null,function(e){if(e)return void r(e);t(p(void 0,!0))})})}),o),m);e.exports=function(e){var t,r=Object.create(b,(i(t={},d,{value:e,writable:!0}),i(t,s,{value:null,writable:!0}),i(t,u,{value:null,writable:!0}),i(t,l,{value:null,writable:!0}),i(t,f,{value:e._readableState.endEmitted,writable:!0}),i(t,h,{value:function(e,t){var n=r[d].read();n?(r[c]=null,r[s]=null,r[u]=null,e(p(n,!1))):(r[s]=e,r[u]=t)},writable:!0}),t));return r[c]=null,a(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[u];null!==t&&(r[c]=null,r[s]=null,r[u]=null,t(e)),r[l]=e;return}var n=r[s];null!==n&&(r[c]=null,r[s]=null,r[u]=null,n(p(void 0,!0))),r[f]=!0}),e.on("readable",g.bind(null,r)),r}},379:function(e,t,r){"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}var i=r(300).Buffer,o=r(837).inspect,a=o&&o.custom||"inspect";e.exports=function(){var e;function t(){if(!(this instanceof t))throw TypeError("Cannot call a class as a function");this.head=null,this.tail=null,this.length=0}return e=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return i.alloc(0);for(var t,r,n=i.allocUnsafe(e>>>0),o=this.head,a=0;o;)t=o.data,r=a,i.prototype.copy.call(t,n,r),a+=o.data.length,o=o.next;return n}},{key:"consume",value:function(e,t){var r;return ei.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0==(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=i.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var o=r.data,a=e>o.length?o.length:e;if(o.copy(t,t.length-e,0,a),0==(e-=a)){a===o.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=o.slice(a));break}++n}return this.length-=n,t}},{key:a,value:function(e,t){return o(this,function(e){for(var t=1;t0,l=s=function(e){t||(t=e),e&&d.forEach(u),g||(d.forEach(u),h(t))},c=!1,s=function(){c||(c=!0,l.apply(void 0,arguments))},p=!1,e.on("close",function(){p=!0}),void 0===n&&(n=r(698)),n(e,{readable:g,writable:o},function(e){if(e)return s(e);p=!0,s()}),y=!1,function(t){if(!p&&!y){if(y=!0,e.setHeader&&"function"==typeof e.abort)return e.abort();if("function"==typeof e.destroy)return e.destroy();s(t||new a("pipe"))}}});return f.reduce(l)}},776:function(e,t,r){"use strict";var n=r(646).q.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,i){var o=null!=t.highWaterMark?t.highWaterMark:i?t[r]:null;if(null!=o){if(!(isFinite(o)&&Math.floor(o)===o)||o<0)throw new n(i?r:"highWaterMark",o);return Math.floor(o)}return e.objectMode?16:16384}}},678:function(e,t,r){e.exports=r(781)},55:function(e,t,r){var n=r(300),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=a),a.prototype=Object.create(i.prototype),o(i,a),a.from=function(e,t,r){if("number"==typeof e)throw TypeError("Argument must not be a number");return i(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return n.SlowBuffer(e)}},173:function(e,t,r){e.exports=i;var n=r(361).EventEmitter;function i(){n.call(this)}r(782)(i,n),i.Readable=r(709),i.Writable=r(337),i.Duplex=r(403),i.Transform=r(170),i.PassThrough=r(889),i.finished=r(698),i.pipeline=r(442),i.Stream=i,i.prototype.pipe=function(e,t){var r=this;function i(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),e.on("drain",o),e._isStdio||t&&!1===t.end||(r.on("end",s),r.on("close",u));var a=!1;function s(){a||(a=!0,e.end())}function u(){a||(a=!0,"function"==typeof e.destroy&&e.destroy())}function l(e){if(f(),0===n.listenerCount(this,"error"))throw e}function f(){r.removeListener("data",i),e.removeListener("drain",o),r.removeListener("end",s),r.removeListener("close",u),r.removeListener("error",l),e.removeListener("error",l),r.removeListener("end",f),r.removeListener("close",f),e.removeListener("close",f)}return r.on("error",l),e.on("error",l),r.on("end",f),r.on("close",f),e.on("close",f),e.emit("pipe",r),e}},704:function(e,t,r){"use strict";var n=r(55).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;switch(this.encoding=function(e){var t=function(e){var t;if(!e)return"utf8";for(;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=l,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=f,this.end=c,t=3;break;default:this.write=h,this.end=d;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if((192&t[0])!=128)return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if((192&t[1])!=128)return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&(192&t[2])!=128)return e.lastNeed=2,"�"}}(this,e,0);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):void(e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length)}function u(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function l(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function f(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function c(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}t.s=o,o.prototype.write=function(e){var t,r;if(0===e.length)return"";if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0?(i>0&&(e.lastNeed=i-1),i):--n=0?(i>0&&(e.lastNeed=i-2),i):--n=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},769:function(t){t.exports=function(e,t){if(r("noDeprecation"))return e;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}};function r(t){try{if(!e.g.localStorage)return!1}catch(e){return!1}var r=e.g.localStorage[t];return null!=r&&"true"===String(r).toLowerCase()}},300:function(t){"use strict";t.exports=e.r(67034)},361:function(t){"use strict";t.exports=e.r(30662)},781:function(t){"use strict";t.exports=e.r(30662).EventEmitter},837:function(t){"use strict";t.exports=e.r(77398)}},i={};function o(e){var t=i[e];if(void 0!==t)return t.exports;var n=i[e]={exports:{}},a=!0;try{r[e](n,n.exports,o),a=!1}finally{a&&delete i[e]}return n.exports}o.ab="/ROOT/node_modules/next/dist/compiled/stream-browserify/",t.exports=o(173)}()},31032,(e,t,r)=>{"use strict";t.exports=e.r(12569)},87780,(e,t,r)=>{"use strict";var n=e.i(67034);if(r.base64=!0,r.array=!0,r.string=!0,r.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,r.nodebuffer=void 0!==n.Buffer,r.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)r.blob=!1;else{var i=new ArrayBuffer(0);try{r.blob=0===new Blob([i],{type:"application/zip"}).size}catch(e){try{var o=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);o.append(i),r.blob=0===o.getBlob("application/zip").size}catch(e){r.blob=!1}}}try{r.nodestream=!!e.r(31032).Readable}catch(e){r.nodestream=!1}},55951,(e,t,r)=>{"use strict";var n=e.r(65464),i=e.r(87780),o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";r.encode=function(e){for(var t,r,i,a,s,u,l,f=[],c=0,h=e.length,d=h,p="string"!==n.getTypeOf(e);c>2,s=(3&t)<<4|r>>4,u=d>1?(15&r)<<2|i>>6:64,l=d>2?63&i:64,f.push(o.charAt(a)+o.charAt(s)+o.charAt(u)+o.charAt(l));return f.join("")},r.decode=function(e){var t,r,n,a,s,u,l,f,c=0,h=0,d="data:";if(e.substr(0,d.length)===d)throw Error("Invalid base64 input, it looks like a data url.");var p=3*(e=e.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(e.charAt(e.length-1)===o.charAt(64)&&p--,e.charAt(e.length-2)===o.charAt(64)&&p--,p%1!=0)throw Error("Invalid base64 input, bad content length.");for(f=i.uint8array?new Uint8Array(0|p):Array(0|p);c>4,r=(15&s)<<4|u>>2,n=(3&u)<<6|l,f[h++]=t,64!==u&&(f[h++]=r),64!==l&&(f[h++]=n);return f}},42527,(e,t,r)=>{"use strict";var n=e.i(67034);t.exports={isNode:void 0!==n.Buffer,newBufferFrom:function(e,t){if(n.Buffer.from&&n.Buffer.from!==Uint8Array.from)return n.Buffer.from(e,t);if("number"==typeof e)throw Error('The "data" argument must not be a number');return new n.Buffer(e,t)},allocBuffer:function(e){if(n.Buffer.alloc)return n.Buffer.alloc(e);var t=new n.Buffer(e);return t.fill(0),t},isBuffer:function(e){return n.Buffer.isBuffer(e)},isStream:function(e){return e&&"function"==typeof e.on&&"function"==typeof e.pause&&"function"==typeof e.resume}}},27024,(e,t,r)=>{"use strict";var n,i,o=e.g.MutationObserver||e.g.WebKitMutationObserver;if(o){var a=0,s=new o(c),u=e.g.document.createTextNode("");s.observe(u,{characterData:!0}),n=function(){u.data=a=++a%2}}else if(e.g.setImmediate||void 0===e.g.MessageChannel)n="document"in e.g&&"onreadystatechange"in e.g.document.createElement("script")?function(){var t=e.g.document.createElement("script");t.onreadystatechange=function(){c(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.g.document.documentElement.appendChild(t)}:function(){setTimeout(c,0)};else{var l=new e.g.MessageChannel;l.port1.onmessage=c,n=function(){l.port2.postMessage(0)}}var f=[];function c(){i=!0;for(var e,t,r=f.length;r;){for(t=f,f=[],e=-1;++e{"use strict";var n=e.r(27024);function i(){}var o={},a=["REJECTED"],s=["FULFILLED"],u=["PENDING"];function l(e){if("function"!=typeof e)throw TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,e!==i&&d(this,e)}function f(e,t,r){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof r&&(this.onRejected=r,this.callRejected=this.otherCallRejected)}function c(e,t,r){n(function(){var n;try{n=t(r)}catch(t){return o.reject(e,t)}n===e?o.reject(e,TypeError("Cannot resolve promise with itself")):o.resolve(e,n)})}function h(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function d(e,t){var r=!1;function n(t){r||(r=!0,o.reject(e,t))}function i(t){r||(r=!0,o.resolve(e,t))}var a=p(function(){t(i,n)});"error"===a.status&&n(a.value)}function p(e,t){var r={};try{r.value=e(t),r.status="success"}catch(e){r.status="error",r.value=e}return r}t.exports=l,l.prototype.finally=function(e){if("function"!=typeof e)return this;var t=this.constructor;return this.then(function(r){return t.resolve(e()).then(function(){return r})},function(r){return t.resolve(e()).then(function(){throw r})})},l.prototype.catch=function(e){return this.then(null,e)},l.prototype.then=function(e,t){if("function"!=typeof e&&this.state===s||"function"!=typeof t&&this.state===a)return this;var r=new this.constructor(i);return this.state!==u?c(r,this.state===s?e:t,this.outcome):this.queue.push(new f(r,e,t)),r},f.prototype.callFulfilled=function(e){o.resolve(this.promise,e)},f.prototype.otherCallFulfilled=function(e){c(this.promise,this.onFulfilled,e)},f.prototype.callRejected=function(e){o.reject(this.promise,e)},f.prototype.otherCallRejected=function(e){c(this.promise,this.onRejected,e)},o.resolve=function(e,t){var r=p(h,t);if("error"===r.status)return o.reject(e,r.value);var n=r.value;if(n)d(e,n);else{e.state=s,e.outcome=t;for(var i=-1,a=e.queue.length;++i{"use strict";t.exports={Promise:"undefined"!=typeof Promise?Promise:e.r(22998)}},83986,(e,t,r)=>{var n=e.i(47167);"undefined"!=typeof __nccwpck_require__&&(__nccwpck_require__.ab="/ROOT/node_modules/next/dist/compiled/setimmediate/"),({189:function(){!function(e,t){"use strict";if(!e.setImmediate){var r,i,o,a,s,u=1,l={},f=!1,c=e.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(e);h=h&&h.setTimeout?h:e,"[object process]"===({}).toString.call(e.process)?s=function(e){n.default.nextTick(function(){p(e)})}:function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?(r="setImmediate$"+Math.random()+"$",i=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(r)&&p(+t.data.slice(r.length))},e.addEventListener?e.addEventListener("message",i,!1):e.attachEvent("onmessage",i),s=function(t){e.postMessage(r+t,"*")}):e.MessageChannel?((o=new MessageChannel).port1.onmessage=function(e){p(e.data)},s=function(e){o.port2.postMessage(e)}):c&&"onreadystatechange"in c.createElement("script")?(a=c.documentElement,s=function(e){var t=c.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,a.removeChild(t),t=null},a.appendChild(t)}):s=function(e){setTimeout(p,0,e)},h.setImmediate=function(e){"function"!=typeof e&&(e=Function(""+e));for(var t=Array(arguments.length-1),r=0;r{"use strict";var n=e.r(87780),i=e.r(55951),o=e.r(42527),a=e.r(24375);function s(e){return e}function u(e,t){for(var r=0;r1;)try{return l.stringifyByChunk(e,n,t)}catch(e){t=Math.floor(t/2)}return l.stringifyByChar(e)}function c(e,t){for(var r=0;r{"use strict";function n(e){this.name=e||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}n.prototype={push:function(e){this.emit("data",e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit("error",e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit("error",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var r=0;r "+e:e}},t.exports=n},46253,(e,t,r)=>{"use strict";for(var n=e.r(65464),i=e.r(87780),o=e.r(42527),a=e.r(48913),s=Array(256),u=0;u<256;u++)s[u]=u>=252?6:u>=248?5:u>=240?4:u>=224?3:u>=192?2:1;s[254]=s[254]=1;var l=function(e){var t,r,n,o,a,s=e.length,u=0;for(o=0;o>>6:(r<65536?t[a++]=224|r>>>12:(t[a++]=240|r>>>18,t[a++]=128|r>>>12&63),t[a++]=128|r>>>6&63),t[a++]=128|63&r);return t},f=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;r>=0&&(192&e[r])==128;)r--;return r<0||0===r?t:r+s[e[r]]>t?r:t},c=function(e){var t,r,i,o,a=e.length,u=Array(2*a);for(r=0,t=0;t4){u[r++]=65533,t+=o-1;continue}for(i&=2===o?31:3===o?15:7;o>1&&t1){u[r++]=65533;continue}i<65536?u[r++]=i:(i-=65536,u[r++]=55296|i>>10&1023,u[r++]=56320|1023&i)}return u.length!==r&&(u.subarray?u=u.subarray(0,r):u.length=r),n.applyFromCharCode(u)};function h(){a.call(this,"utf-8 decode"),this.leftOver=null}function d(){a.call(this,"utf-8 encode")}r.utf8encode=function(e){return i.nodebuffer?o.newBufferFrom(e,"utf-8"):l(e)},r.utf8decode=function(e){return i.nodebuffer?n.transformTo("nodebuffer",e).toString("utf-8"):c(e=n.transformTo(i.uint8array?"uint8array":"array",e))},n.inherits(h,a),h.prototype.processChunk=function(e){var t=n.transformTo(i.uint8array?"uint8array":"array",e.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var o=t;(t=new Uint8Array(o.length+this.leftOver.length)).set(this.leftOver,0),t.set(o,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var a=f(t),s=t;a!==t.length&&(i.uint8array?(s=t.subarray(0,a),this.leftOver=t.subarray(a,t.length)):(s=t.slice(0,a),this.leftOver=t.slice(a,t.length))),this.push({data:r.utf8decode(s),meta:e.meta})},h.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:r.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},r.Utf8DecodeWorker=h,n.inherits(d,a),d.prototype.processChunk=function(e){this.push({data:r.utf8encode(e.data),meta:e.meta})},r.Utf8EncodeWorker=d},60550,(e,t,r)=>{"use strict";var n=e.r(48913),i=e.r(65464);function o(e){n.call(this,"ConvertWorker to "+e),this.destType=e}i.inherits(o,n),o.prototype.processChunk=function(e){this.push({data:i.transformTo(this.destType,e.data),meta:e.meta})},t.exports=o},61714,(e,t,r)=>{"use strict";var n=e.r(31032).Readable;function i(e,t,r){n.call(this,t),this._helper=e;var i=this;e.on("data",function(e,t){i.push(e)||i._helper.pause(),r&&r(t)}).on("error",function(e){i.emit("error",e)}).on("end",function(){i.push(null)})}e.r(65464).inherits(i,n),i.prototype._read=function(){this._helper.resume()},t.exports=i},846,(e,t,r)=>{"use strict";var n=e.i(67034),i=e.r(65464),o=e.r(60550),a=e.r(48913),s=e.r(55951),u=e.r(87780),l=e.r(24375),f=null;if(u.nodestream)try{f=e.r(61714)}catch(e){}function c(e,t,r){var n=t;switch(t){case"blob":case"arraybuffer":n="uint8array";break;case"base64":n="string"}try{this._internalType=n,this._outputType=t,this._mimeType=r,i.checkSupport(n),this._worker=e.pipe(new o(n)),e.lock()}catch(e){this._worker=new a("error"),this._worker.error(e)}}c.prototype={accumulate:function(e){var t;return t=this,new l.Promise(function(r,o){var a=[],u=t._internalType,l=t._outputType,f=t._mimeType;t.on("data",function(t,r){a.push(t),e&&e(r)}).on("error",function(e){a=[],o(e)}).on("end",function(){try{var e=function(e,t,r){switch(e){case"blob":return i.newBlob(i.transformTo("arraybuffer",t),r);case"base64":return s.encode(t);default:return i.transformTo(e,t)}}(l,function(e,t){var r,i=0,o=null,a=0;for(r=0;r{"use strict";r.base64=!1,r.binary=!1,r.dir=!1,r.createFolders=!0,r.date=null,r.compression=null,r.compressionOptions=null,r.comment=null,r.unixPermissions=null,r.dosPermissions=null},25625,(e,t,r)=>{"use strict";var n=e.r(65464),i=e.r(48913);function o(e){i.call(this,"DataWorker");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,e.then(function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=n.getTypeOf(e),t.isPaused||t._tickAndRepeat()},function(e){t.error(e)})}n.inherits(o,i),o.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},o.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,n.delay(this._tickAndRepeat,[],this)),!0)},o.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(n.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},o.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":e=this.data.substring(this.index,t);break;case"uint8array":e=this.data.subarray(this.index,t);break;case"array":case"nodebuffer":e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=o},63494,(e,t,r)=>{"use strict";var n=e.r(65464),i=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?0xedb88320^e>>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t){return void 0!==e&&e.length?"string"!==n.getTypeOf(e)?function(e,t,r,n){var o=0+r;e^=-1;for(var a=0;a>>8^i[(e^t[a])&255];return -1^e}(0|t,e,e.length,0):function(e,t,r,n){var o=0+r;e^=-1;for(var a=0;a>>8^i[(e^t.charCodeAt(a))&255];return -1^e}(0|t,e,e.length,0):0}},1648,(e,t,r)=>{"use strict";var n=e.r(48913),i=e.r(63494);function o(){n.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}e.r(65464).inherits(o,n),o.prototype.processChunk=function(e){this.streamInfo.crc32=i(e.data,this.streamInfo.crc32||0),this.push(e)},t.exports=o},41087,(e,t,r)=>{"use strict";var n=e.r(65464),i=e.r(48913);function o(e){i.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}n.inherits(o,i),o.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}i.prototype.processChunk.call(this,e)},t.exports=o},43220,(e,t,r)=>{"use strict";var n=e.r(24375),i=e.r(25625),o=e.r(1648),a=e.r(41087);function s(e,t,r,n,i){this.compressedSize=e,this.uncompressedSize=t,this.crc32=r,this.compression=n,this.compressedContent=i}s.prototype={getContentWorker:function(){var e=new i(n.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new a("data_length")),t=this;return e.on("end",function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw Error("Bug : uncompressed data size mismatch")}),e},getCompressedWorker:function(){return new i(n.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},s.createWorkerFrom=function(e,t,r){return e.pipe(new o).pipe(new a("uncompressedSize")).pipe(t.compressWorker(r)).pipe(new a("compressedSize")).withStreamInfo("compression",t)},t.exports=s},52929,(e,t,r)=>{"use strict";var n=e.r(846),i=e.r(25625),o=e.r(46253),a=e.r(43220),s=e.r(48913),u=function(e,t,r){this.name=e,this.dir=r.dir,this.date=r.date,this.comment=r.comment,this.unixPermissions=r.unixPermissions,this.dosPermissions=r.dosPermissions,this._data=t,this._dataBinary=r.binary,this.options={compression:r.compression,compressionOptions:r.compressionOptions}};u.prototype={internalStream:function(e){var t=null,r="string";try{if(!e)throw Error("No output type specified.");r=e.toLowerCase();var i="string"===r||"text"===r;("binarystring"===r||"text"===r)&&(r="string"),t=this._decompressWorker();var a=!this._dataBinary;a&&!i&&(t=t.pipe(new o.Utf8EncodeWorker)),!a&&i&&(t=t.pipe(new o.Utf8DecodeWorker))}catch(e){(t=new s("error")).error(e)}return new n(t,r,"")},async:function(e,t){return this.internalStream(e).accumulate(t)},nodeStream:function(e,t){return this.internalStream(e||"nodebuffer").toNodejsStream(t)},_compressWorker:function(e,t){if(this._data instanceof a&&this._data.compression.magic===e.magic)return this._data.getCompressedWorker();var r=this._decompressWorker();return this._dataBinary||(r=r.pipe(new o.Utf8EncodeWorker)),a.createWorkerFrom(r,e,t)},_decompressWorker:function(){return this._data instanceof a?this._data.getContentWorker():this._data instanceof s?this._data:new i(this._data)}};for(var l=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],f=function(){throw Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},c=0;c{"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;r.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if("object"!=typeof r)throw TypeError(r+"must be non-object");for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}}return e},r.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var i={arraySet:function(e,t,r,n,i){if(t.subarray&&e.subarray)return void e.set(t.subarray(r,r+n),i);for(var o=0;o{"use strict";var n,i,o,a=e.r(79148);function s(e){for(var t=e.length;--t>=0;)e[t]=0}var u=573,l=[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],f=[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],c=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],h=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],d=Array(576);s(d);var p=Array(60);s(p);var y=Array(512);s(y);var g=Array(256);s(g);var m=Array(29);s(m);var b=Array(30);function _(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}function v(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function w(e){return e<256?y[e]:y[256+(e>>>7)]}function S(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function k(e,t,r){e.bi_valid>16-r?(e.bi_buf|=t<>16-e.bi_valid,e.bi_valid+=r-16):(e.bi_buf|=t<>>=1,r<<=1;while(--t>0)return r>>>1}function A(e,t,r){var n,i,o=Array(16),a=0;for(n=1;n<=15;n++)o[n]=a=a+r[n-1]<<1;for(i=0;i<=t;i++){var s=e[2*i+1];0!==s&&(e[2*i]=E(o[s]++,s))}}function O(e){var t;for(t=0;t<286;t++)e.dyn_ltree[2*t]=0;for(t=0;t<30;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function R(e){e.bi_valid>8?S(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function C(e,t,r,n){var i=2*t,o=2*r;return e[i]>1;r>=1;r--)T(e,o,r);i=l;do r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],T(e,o,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,o[2*i]=o[2*r]+o[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,o[2*r+1]=o[2*n+1]=i,e.heap[1]=i++,T(e,o,1);while(e.heap_len>=2)e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,i,o,a,s,l=t.dyn_tree,f=t.max_code,c=t.stat_desc.static_tree,h=t.stat_desc.has_stree,d=t.stat_desc.extra_bits,p=t.stat_desc.extra_base,y=t.stat_desc.max_length,g=0;for(o=0;o<=15;o++)e.bl_count[o]=0;for(l[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;ry&&(o=y,g++),l[2*n+1]=o,!(n>f)&&(e.bl_count[o]++,a=0,n>=p&&(a=d[n-p]),s=l[2*n],e.opt_len+=s*(o+a),h&&(e.static_len+=s*(c[2*n+1]+a)));if(0!==g){do{for(o=y-1;0===e.bl_count[o];)o--;e.bl_count[o]--,e.bl_count[o+1]+=2,e.bl_count[y]--,g-=2}while(g>0)for(o=y;0!==o;o--)for(n=e.bl_count[o];0!==n;)!((i=e.heap[--r])>f)&&(l[2*i+1]!==o&&(e.opt_len+=(o-l[2*i+1])*l[2*i],l[2*i+1]=o),n--)}}(e,t),A(o,f,e.bl_count)}function j(e,t,r){var n,i,o=-1,a=t[1],s=0,u=7,l=4;for(0===a&&(u=138,l=3),t[(r+1)*2+1]=65535,n=0;n<=r;n++)i=a,a=t[(n+1)*2+1],++s>=7;a<30;a++)for(e=0,b[a]=s<<7;e<1<0?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,r=0xf3ffc07f;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<256;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),I(e,e.l_desc),I(e,e.d_desc),a=function(e){var t;for(j(e,e.dyn_ltree,e.l_desc.max_code),j(e,e.dyn_dtree,e.d_desc.max_code),I(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*h[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,(o=e.static_len+3+7>>>3)<=i&&(i=o)):i=o=r+5,r+4<=i&&-1!==t?D(e,t,r,n):4===e.strategy||o===i?(k(e,2+ +!!n,3),P(e,d,p)):(k(e,4+ +!!n,3),function(e,t,r,n){var i;for(k(e,t-257,5),k(e,r-1,5),k(e,n-4,4),i=0;i>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[(g[r]+256+1)*2]++,e.dyn_dtree[2*w(t)]++),e.last_lit===e.lit_bufsize-1},r._tr_align=function(e){k(e,2,3),x(e,256,d),16===e.bi_valid?(S(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}},74049,(e,t,r)=>{"use strict";t.exports=function(e,t,r,n){for(var i=65535&e,o=e>>>16&65535,a=0;0!==r;){a=r>2e3?2e3:r,r-=a;do o=o+(i=i+t[n++]|0)|0;while(--a)i%=65521,o%=65521}return i|o<<16}},63327,(e,t,r)=>{"use strict";var n=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?0xedb88320^e>>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t,r,i){var o=i+r;e^=-1;for(var a=i;a>>8^n[(e^t[a])&255];return -1^e}},19558,(e,t,r)=>{"use strict";t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},79674,(e,t,r)=>{"use strict";var n,i=e.r(79148),o=e.r(94333),a=e.r(74049),s=e.r(63327),u=e.r(19558),l=573;function f(e,t){return e.msg=u[t],t}function c(e){return(e<<1)-9*(e>4)}function h(e){for(var t=e.length;--t>=0;)e[t]=0}function d(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(i.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function p(e,t){o._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,d(e.strm)}function y(e,t){e.pending_buf[e.pending++]=t}function g(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function m(e,t){var r,n,i=e.max_chain_length,o=e.strstart,a=e.prev_length,s=e.nice_match,u=e.strstart>e.w_size-262?e.strstart-(e.w_size-262):0,l=e.window,f=e.w_mask,c=e.prev,h=e.strstart+258,d=l[o+a-1],p=l[o+a];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(l[(r=t)+a]!==p||l[r+a-1]!==d||l[r]!==l[o]||l[++r]!==l[o+1])continue;o+=2,r++;do;while(l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&oa){if(e.match_start=t,a=n,n>=s)break;d=l[o+a-1],p=l[o+a]}}while((t=c[t&f])>u&&0!=--i)return a<=e.lookahead?a:e.lookahead}function b(e){var t,r,n,o,u,l=e.w_size;do{if(o=e.window_size-e.lookahead-e.strstart,e.strstart>=l+(l-262)){i.arraySet(e.window,e.window,l,l,0),e.match_start-=l,e.strstart-=l,e.block_start-=l,t=r=e.hash_size;do n=e.head[--t],e.head[t]=n>=l?n-l:0;while(--r)t=r=l;do n=e.prev[--t],e.prev[t]=n>=l?n-l:0;while(--r)o+=l}if(0===e.strm.avail_in)break;if(r=function(e,t,r,n){var o=e.avail_in;return(o>n&&(o=n),0===o)?0:(e.avail_in-=o,i.arraySet(t,e.input,e.next_in,o,r),1===e.state.wrap?e.adler=a(e.adler,t,o,r):2===e.state.wrap&&(e.adler=s(e.adler,t,o,r)),e.next_in+=o,e.total_in+=o,o)}(e.strm,e.window,e.strstart+e.lookahead,o),e.lookahead+=r,e.lookahead+e.insert>=3)for(u=e.strstart-e.insert,e.ins_h=e.window[u],e.ins_h=(e.ins_h<=3&&(e.ins_h=(e.ins_h<=3)if(n=o._tr_tally(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<=3&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-3,n=o._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(e.ins_h=(e.ins_h<15&&(s=2,n-=16),o<1||o>9||8!==r||n<8||n>15||t<0||t>9||a<0||a>4)return f(e,-2);8===n&&(n=9);var u=new S;return e.state=u,u.strm=e,u.wrap=s,u.gzhead=null,u.w_bits=n,u.w_size=1<e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(b(e),0===e.lookahead&&0===t)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,p(e,!1),0===e.strm.avail_out)||e.strstart-e.block_start>=e.w_size-262&&(p(e,!1),0===e.strm.avail_out))return 1}return(e.insert=0,4===t)?(p(e,!0),0===e.strm.avail_out)?3:4:(e.strstart>e.block_start&&(p(e,!1),e.strm.avail_out),1)}),new w(4,4,8,4,_),new w(4,5,16,8,_),new w(4,6,32,32,_),new w(4,4,16,16,v),new w(8,16,32,32,v),new w(8,16,128,128,v),new w(8,32,128,256,v),new w(32,128,258,1024,v),new w(32,258,258,4096,v)],r.deflateInit=function(e,t){return E(e,t,8,15,8,0)},r.deflateInit2=E,r.deflateReset=x,r.deflateResetKeep=k,r.deflateSetHeader=function(e,t){return e&&e.state&&2===e.state.wrap?(e.state.gzhead=t,0):-2},r.deflate=function(e,t){if(!e||!e.state||t>5||t<0)return e?f(e,-2):-2;if(i=e.state,!e.output||!e.input&&0!==e.avail_in||666===i.status&&4!==t)return f(e,0===e.avail_out?-5:-2);if(i.strm=e,r=i.last_flush,i.last_flush=t,42===i.status)if(2===i.wrap)e.adler=0,y(i,31),y(i,139),y(i,8),i.gzhead?(y(i,+!!i.gzhead.text+2*!!i.gzhead.hcrc+4*!!i.gzhead.extra+8*!!i.gzhead.name+16*!!i.gzhead.comment),y(i,255&i.gzhead.time),y(i,i.gzhead.time>>8&255),y(i,i.gzhead.time>>16&255),y(i,i.gzhead.time>>24&255),y(i,9===i.level?2:4*(i.strategy>=2||i.level<2)),y(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(y(i,255&i.gzhead.extra.length),y(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=s(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(y(i,0),y(i,0),y(i,0),y(i,0),y(i,0),y(i,9===i.level?2:4*(i.strategy>=2||i.level<2)),y(i,3),i.status=113);else{var r,i,a,u,l=8+(i.w_bits-8<<4)<<8;l|=(i.strategy>=2||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(l|=32),l+=31-l%31,i.status=113,g(i,l),0!==i.strstart&&(g(i,e.adler>>>16),g(i,65535&e.adler)),e.adler=1}if(69===i.status)if(i.gzhead.extra){for(a=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),d(e),a=i.pending,i.pending!==i.pending_buf_size));)y(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),d(e),a=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindexa&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),0===u&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),d(e),a=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindexa&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),0===u&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&d(e),i.pending+2<=i.pending_buf_size&&(y(i,255&e.adler),y(i,e.adler>>8&255),e.adler=0,i.status=113)):i.status=113),0!==i.pending){if(d(e),0===e.avail_out)return i.last_flush=-1,0}else if(0===e.avail_in&&c(t)<=c(r)&&4!==t)return f(e,-5);if(666===i.status&&0!==e.avail_in)return f(e,-5);if(0!==e.avail_in||0!==i.lookahead||0!==t&&666!==i.status){var m=2===i.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(b(e),0===e.lookahead)){if(0===t)return 1;break}if(e.match_length=0,r=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(p(e,!1),0===e.strm.avail_out))return 1}return(e.insert=0,4===t)?(p(e,!0),0===e.strm.avail_out)?3:4:e.last_lit&&(p(e,!1),0===e.strm.avail_out)?1:2}(i,t):3===i.strategy?function(e,t){for(var r,n,i,a,s=e.window;;){if(e.lookahead<=258){if(b(e),e.lookahead<=258&&0===t)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(n=s[i=e.strstart-1])===s[++i]&&n===s[++i]&&n===s[++i]){a=e.strstart+258;do;while(n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&ie.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(r=o._tr_tally(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(p(e,!1),0===e.strm.avail_out))return 1}return(e.insert=0,4===t)?(p(e,!0),0===e.strm.avail_out)?3:4:e.last_lit&&(p(e,!1),0===e.strm.avail_out)?1:2}(i,t):n[i.level].func(i,t);if((3===m||4===m)&&(i.status=666),1===m||3===m)return 0===e.avail_out&&(i.last_flush=-1),0;if(2===m&&(1===t?o._tr_align(i):5!==t&&(o._tr_stored_block(i,0,0,!1),3===t&&(h(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),d(e),0===e.avail_out))return i.last_flush=-1,0}return 4!==t?0:i.wrap<=0?1:(2===i.wrap?(y(i,255&e.adler),y(i,e.adler>>8&255),y(i,e.adler>>16&255),y(i,e.adler>>24&255),y(i,255&e.total_in),y(i,e.total_in>>8&255),y(i,e.total_in>>16&255),y(i,e.total_in>>24&255)):(g(i,e.adler>>>16),g(i,65535&e.adler)),d(e),i.wrap>0&&(i.wrap=-i.wrap),+(0===i.pending))},r.deflateEnd=function(e){var t;return e&&e.state?42!==(t=e.state.status)&&69!==t&&73!==t&&91!==t&&103!==t&&113!==t&&666!==t?f(e,-2):(e.state=null,113===t?f(e,-3):0):-2},r.deflateSetDictionary=function(e,t){var r,n,o,s,u,l,f,c,d=t.length;if(!e||!e.state||2===(s=(r=e.state).wrap)||1===s&&42!==r.status||r.lookahead)return -2;for(1===s&&(e.adler=a(e.adler,t,d,0)),r.wrap=0,d>=r.w_size&&(0===s&&(h(r.head),r.strstart=0,r.block_start=0,r.insert=0),c=new i.Buf8(r.w_size),i.arraySet(c,t,d-r.w_size,r.w_size,0),t=c,d=r.w_size),u=e.avail_in,l=e.next_in,f=e.input,e.avail_in=d,e.next_in=0,e.input=t,b(r);r.lookahead>=3;){n=r.strstart,o=r.lookahead-2;do r.ins_h=(r.ins_h<{"use strict";var n=e.r(79148),i=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch(e){i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){o=!1}for(var a=new n.Buf8(256),s=0;s<256;s++)a[s]=s>=252?6:s>=248?5:s>=240?4:s>=224?3:s>=192?2:1;function u(e,t){if(t<65534&&(e.subarray&&o||!e.subarray&&i))return String.fromCharCode.apply(null,n.shrinkBuf(e,t));for(var r="",a=0;a>>6:(r<65536?t[a++]=224|r>>>12:(t[a++]=240|r>>>18,t[a++]=128|r>>>12&63),t[a++]=128|r>>>6&63),t[a++]=128|63&r);return t},r.buf2binstring=function(e){return u(e,e.length)},r.binstring2buf=function(e){for(var t=new n.Buf8(e.length),r=0,i=t.length;r4){l[n++]=65533,r+=o-1;continue}for(i&=2===o?31:3===o?15:7;o>1&&r1){l[n++]=65533;continue}i<65536?l[n++]=i:(i-=65536,l[n++]=55296|i>>10&1023,l[n++]=56320|1023&i)}return u(l,n)},r.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;r>=0&&(192&e[r])==128;)r--;return r<0||0===r?t:r+a[e[r]]>t?r:t}},98899,(e,t,r)=>{"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},48901,(e,t,r)=>{"use strict";var n=e.r(79674),i=e.r(79148),o=e.r(63202),a=e.r(19558),s=e.r(98899),u=Object.prototype.toString;function l(e){if(!(this instanceof l))return new l(e);this.options=i.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},e||{});var t,r=this.options;r.raw&&r.windowBits>0?r.windowBits=-r.windowBits:r.gzip&&r.windowBits>0&&r.windowBits<16&&(r.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;var f=n.deflateInit2(this.strm,r.level,r.method,r.windowBits,r.memLevel,r.strategy);if(0!==f)throw Error(a[f]);if(r.header&&n.deflateSetHeader(this.strm,r.header),r.dictionary){if(t="string"==typeof r.dictionary?o.string2buf(r.dictionary):"[object ArrayBuffer]"===u.call(r.dictionary)?new Uint8Array(r.dictionary):r.dictionary,0!==(f=n.deflateSetDictionary(this.strm,t)))throw Error(a[f]);this._dict_set=!0}}function f(e,t){var r=new l(t);if(r.push(e,!0),r.err)throw r.msg||a[r.err];return r.result}l.prototype.push=function(e,t){var r,a,s=this.strm,l=this.options.chunkSize;if(this.ended)return!1;a=t===~~t?t:4*(!0===t),"string"==typeof e?s.input=o.string2buf(e):"[object ArrayBuffer]"===u.call(e)?s.input=new Uint8Array(e):s.input=e,s.next_in=0,s.avail_in=s.input.length;do{if(0===s.avail_out&&(s.output=new i.Buf8(l),s.next_out=0,s.avail_out=l),1!==(r=n.deflate(s,a))&&0!==r)return this.onEnd(r),this.ended=!0,!1;(0===s.avail_out||0===s.avail_in&&(4===a||2===a))&&("string"===this.options.to?this.onData(o.buf2binstring(i.shrinkBuf(s.output,s.next_out))):this.onData(i.shrinkBuf(s.output,s.next_out)))}while((s.avail_in>0||0===s.avail_out)&&1!==r)return 4===a?(r=n.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,0===r):(2===a&&(this.onEnd(0),s.avail_out=0),!0)},l.prototype.onData=function(e){this.chunks.push(e)},l.prototype.onEnd=function(e){0===e&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},r.Deflate=l,r.deflate=f,r.deflateRaw=function(e,t){return(t=t||{}).raw=!0,f(e,t)},r.gzip=function(e,t){return(t=t||{}).gzip=!0,f(e,t)}},75531,(e,t,r)=>{"use strict";t.exports=function(e,t){var r,n,i,o,a,s,u,l,f,c,h,d,p,y,g,m,b,_,v,w,S,k,x,E,A;r=e.state,n=e.next_in,E=e.input,i=n+(e.avail_in-5),o=e.next_out,A=e.output,a=o-(t-e.avail_out),s=o+(e.avail_out-257),u=r.dmax,l=r.wsize,f=r.whave,c=r.wnext,h=r.window,d=r.hold,p=r.bits,y=r.lencode,g=r.distcode,m=(1<>>=v=_>>>24,p-=v,0==(v=_>>>16&255))A[o++]=65535&_;else if(16&v)for(w=65535&_,(v&=15)&&(p>>=v,p-=v),p<15&&(d+=E[n++]<>>=v=_>>>24,p-=v,16&(v=_>>>16&255)){if(S=65535&_,p<(v&=15)&&(d+=E[n++]<u){e.msg="invalid distance too far back",r.mode=30;break e}if(d>>>=v,p-=v,S>(v=o-a)){if((v=S-v)>f&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(k=0,x=h,0===c){if(k+=l-v,v2;)A[o++]=x[k++],A[o++]=x[k++],A[o++]=x[k++],w-=3;w&&(A[o++]=x[k++],w>1&&(A[o++]=x[k++]))}else{k=o-S;do A[o++]=A[k++],A[o++]=A[k++],A[o++]=A[k++],w-=3;while(w>2)w&&(A[o++]=A[k++],w>1&&(A[o++]=A[k++]))}}else if((64&v)==0){_=g[(65535&_)+(d&(1<>3,p-=w<<3,d&=(1<{"use strict";var n=e.r(79148),i=[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,0,0],o=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],a=[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,0,0],s=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(e,t,r,u,l,f,c,h){var d,p,y,g,m,b,_,v,w,S=h.bits,k=0,x=0,E=0,A=0,O=0,R=0,C=0,T=0,P=0,I=0,j=null,B=0,z=new n.Buf16(16),D=new n.Buf16(16),L=null,N=0;for(k=0;k<=15;k++)z[k]=0;for(x=0;x=1&&0===z[A];A--);if(O>A&&(O=A),0===A)return l[f++]=0x1400000,l[f++]=0x1400000,h.bits=1,0;for(E=1;E0&&(0===e||1!==A))return -1;for(k=1,D[1]=0;k<15;k++)D[k+1]=D[k]+z[k];for(x=0;x852||2===e&&P>592)return 1;for(;;){_=k-C,c[x]b?(v=L[N+c[x]],w=j[B+c[x]]):(v=96,w=0),d=1<>C)+(p-=d)]=_<<24|v<<16|w;while(0!==p)for(d=1<>=1;if(0!==d?(I&=d-1,I+=d):I=0,x++,0==--z[k]){if(k===A)break;k=t[r+c[x]]}if(k>O&&(I&g)!==y){for(0===C&&(C=O),m+=E,T=1<<(R=k-C);R+C852||2===e&&P>592)return 1;l[y=I&g]=O<<24|R<<16|m-f}}return 0!==I&&(l[m+I]=k-C<<24|4194304),h.bits=O,0}},57235,(e,t,r)=>{"use strict";var n,i,o=e.r(79148),a=e.r(74049),s=e.r(63327),u=e.r(75531),l=e.r(73012);function f(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function c(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new o.Buf16(320),this.work=new o.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function h(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new o.Buf32(852),t.distcode=t.distdyn=new o.Buf32(592),t.sane=1,t.back=-1,0):-2}function d(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,h(e)):-2}function p(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15))?-2:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,d(e)):-2}function y(e,t){var r,n;return e?(e.state=n=new c,n.window=null,0!==(r=p(e,t))&&(e.state=null),r):-2}var g=!0;function m(e,t,r,n){var i,a=e.state;return null===a.window&&(a.wsize=1<=a.wsize?(o.arraySet(a.window,t,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):((i=a.wsize-a.wnext)>n&&(i=n),o.arraySet(a.window,t,r-n,i,a.wnext),(n-=i)?(o.arraySet(a.window,t,r-n,n,0),a.wnext=n,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave>>8&255,r.check=s(r.check,L,2,0),_=0,v=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&_)<<8)+(_>>8))%31){e.msg="incorrect header check",r.mode=30;break}if((15&_)!=8){e.msg="unknown compression method",r.mode=30;break}if(_>>>=4,v-=4,I=(15&_)+8,0===r.wbits)r.wbits=I;else if(I>r.wbits){e.msg="invalid window size",r.mode=30;break}r.dmax=1<>8&1),512&r.flags&&(L[0]=255&_,L[1]=_>>>8&255,r.check=s(r.check,L,2,0)),_=0,v=0,r.mode=3;case 3:for(;v<32;){if(0===y)break t;y--,_+=c[d++]<>>8&255,L[2]=_>>>16&255,L[3]=_>>>24&255,r.check=s(r.check,L,4,0)),_=0,v=0,r.mode=4;case 4:for(;v<16;){if(0===y)break t;y--,_+=c[d++]<>8),512&r.flags&&(L[0]=255&_,L[1]=_>>>8&255,r.check=s(r.check,L,2,0)),_=0,v=0,r.mode=5;case 5:if(1024&r.flags){for(;v<16;){if(0===y)break t;y--,_+=c[d++]<>>8&255,r.check=s(r.check,L,2,0)),_=0,v=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((k=r.length)>y&&(k=y),k&&(r.head&&(I=r.head.extra_len-r.length,r.head.extra||(r.head.extra=Array(r.head.extra_len)),o.arraySet(r.head.extra,c,d,k,I)),512&r.flags&&(r.check=s(r.check,c,k,d)),y-=k,d+=k,r.length-=k),r.length))break t;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===y)break t;k=0;do I=c[d+k++],r.head&&I&&r.length<65536&&(r.head.name+=String.fromCharCode(I));while(I&&k>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=12;break;case 10:for(;v<32;){if(0===y)break t;y--,_+=c[d++]<>>=7&v,v-=7&v,r.mode=27;break}for(;v<3;){if(0===y)break t;y--,_+=c[d++]<>>=1)){case 0:r.mode=14;break;case 1:if(!function(e){if(g){var t;for(n=new o.Buf32(512),i=new o.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(l(1,e.lens,0,288,n,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;l(2,e.lens,0,32,i,0,e.work,{bits:5}),g=!1}e.lencode=n,e.lenbits=9,e.distcode=i,e.distbits=5}(r),r.mode=20,6===t){_>>>=2,v-=2;break t}break;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=30}_>>>=2,v-=2;break;case 14:for(_>>>=7&v,v-=7&v;v<32;){if(0===y)break t;y--,_+=c[d++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&_,_=0,v=0,r.mode=15,6===t)break t;case 15:r.mode=16;case 16:if(k=r.length){if(k>y&&(k=y),k>b&&(k=b),0===k)break t;o.arraySet(h,c,d,k,p),y-=k,d+=k,b-=k,p+=k,r.length-=k;break}r.mode=12;break;case 17:for(;v<14;){if(0===y)break t;y--,_+=c[d++]<>>=5))+1,v-=5,r.ncode=(15&(_>>>=5))+4,_>>>=4,v-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=30;break}r.have=0,r.mode=18;case 18:for(;r.have>>=3,v-=3}for(;r.have<19;)r.lens[N[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,B={bits:r.lenbits},j=l(0,r.lens,0,19,r.lencode,0,r.work,B),r.lenbits=B.bits,j){e.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have>>24,O=D>>>16&255,R=65535&D,!(A<=v);){if(0===y)break t;y--,_+=c[d++]<>>=A,v-=A,r.lens[r.have++]=R;else{if(16===R){for(z=A+2;v>>=A,v-=A,0===r.have){e.msg="invalid bit length repeat",r.mode=30;break}I=r.lens[r.have-1],k=3+(3&_),_>>>=2,v-=2}else if(17===R){for(z=A+3;v>>=A,v-=A,I=0,k=3+(7&_),_>>>=3,v-=3}else{for(z=A+7;v>>=A,v-=A,I=0,k=11+(127&_),_>>>=7,v-=7}if(r.have+k>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=30;break}for(;k--;)r.lens[r.have++]=I}}if(30===r.mode)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,B={bits:r.lenbits},j=l(1,r.lens,0,r.nlen,r.lencode,0,r.work,B),r.lenbits=B.bits,j){e.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,B={bits:r.distbits},j=l(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,B),r.distbits=B.bits,j){e.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===t)break t;case 20:r.mode=21;case 21:if(y>=6&&b>=258){e.next_out=p,e.avail_out=b,e.next_in=d,e.avail_in=y,r.hold=_,r.bits=v,u(e,S),p=e.next_out,h=e.output,b=e.avail_out,d=e.next_in,c=e.input,y=e.avail_in,_=r.hold,v=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;A=(D=r.lencode[_&(1<>>24,O=D>>>16&255,R=65535&D,!(A<=v);){if(0===y)break t;y--,_+=c[d++]<>C)])>>>24,O=D>>>16&255,R=65535&D,!(C+A<=v);){if(0===y)break t;y--,_+=c[d++]<>>=C,v-=C,r.back+=C}if(_>>>=A,v-=A,r.back+=A,r.length=R,0===O){r.mode=26;break}if(32&O){r.back=-1,r.mode=12;break}if(64&O){e.msg="invalid literal/length code",r.mode=30;break}r.extra=15&O,r.mode=22;case 22:if(r.extra){for(z=r.extra;v>>=r.extra,v-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;A=(D=r.distcode[_&(1<>>24,O=D>>>16&255,R=65535&D,!(A<=v);){if(0===y)break t;y--,_+=c[d++]<>C)])>>>24,O=D>>>16&255,R=65535&D,!(C+A<=v);){if(0===y)break t;y--,_+=c[d++]<>>=C,v-=C,r.back+=C}if(_>>>=A,v-=A,r.back+=A,64&O){e.msg="invalid distance code",r.mode=30;break}r.offset=R,r.extra=15&O,r.mode=24;case 24:if(r.extra){for(z=r.extra;v>>=r.extra,v-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===b)break t;if(k=S-b,r.offset>k){if((k=r.offset-k)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=30;break}k>r.wnext?(k-=r.wnext,x=r.wsize-k):x=r.wnext-k,k>r.length&&(k=r.length),E=r.window}else E=h,x=p-r.offset,k=r.length;k>b&&(k=b),b-=k,r.length-=k;do h[p++]=E[x++];while(--k)0===r.length&&(r.mode=21);break;case 26:if(0===b)break t;h[p++]=r.length,b--,r.mode=21;break;case 27:if(r.wrap){for(;v<32;){if(0===y)break t;y--,_|=c[d++]<{"use strict";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},24448,(e,t,r)=>{"use strict";t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},82473,(e,t,r)=>{"use strict";var n=e.r(57235),i=e.r(79148),o=e.r(63202),a=e.r(34131),s=e.r(19558),u=e.r(98899),l=e.r(24448),f=Object.prototype.toString;function c(e){if(!(this instanceof c))return new c(e);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(15&t.windowBits)==0&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0;var r=n.inflateInit2(this.strm,t.windowBits);if(r!==a.Z_OK||(this.header=new l,n.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=o.string2buf(t.dictionary):"[object ArrayBuffer]"===f.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw)&&(r=n.inflateSetDictionary(this.strm,t.dictionary))!==a.Z_OK))throw Error(s[r])}function h(e,t){var r=new c(t);if(r.push(e,!0),r.err)throw r.msg||s[r.err];return r.result}c.prototype.push=function(e,t){var r,s,u,l,c,h=this.strm,d=this.options.chunkSize,p=this.options.dictionary,y=!1;if(this.ended)return!1;s=t===~~t?t:!0===t?a.Z_FINISH:a.Z_NO_FLUSH,"string"==typeof e?h.input=o.binstring2buf(e):"[object ArrayBuffer]"===f.call(e)?h.input=new Uint8Array(e):h.input=e,h.next_in=0,h.avail_in=h.input.length;do{if(0===h.avail_out&&(h.output=new i.Buf8(d),h.next_out=0,h.avail_out=d),(r=n.inflate(h,a.Z_NO_FLUSH))===a.Z_NEED_DICT&&p&&(r=n.inflateSetDictionary(this.strm,p)),r===a.Z_BUF_ERROR&&!0===y&&(r=a.Z_OK,y=!1),r!==a.Z_STREAM_END&&r!==a.Z_OK)return this.onEnd(r),this.ended=!0,!1;h.next_out&&(0===h.avail_out||r===a.Z_STREAM_END||0===h.avail_in&&(s===a.Z_FINISH||s===a.Z_SYNC_FLUSH))&&("string"===this.options.to?(u=o.utf8border(h.output,h.next_out),l=h.next_out-u,c=o.buf2string(h.output,u),h.next_out=l,h.avail_out=d-l,l&&i.arraySet(h.output,h.output,u,l,0),this.onData(c)):this.onData(i.shrinkBuf(h.output,h.next_out))),0===h.avail_in&&0===h.avail_out&&(y=!0)}while((h.avail_in>0||0===h.avail_out)&&r!==a.Z_STREAM_END)return(r===a.Z_STREAM_END&&(s=a.Z_FINISH),s===a.Z_FINISH)?(r=n.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===a.Z_OK):(s===a.Z_SYNC_FLUSH&&(this.onEnd(a.Z_OK),h.avail_out=0),!0)},c.prototype.onData=function(e){this.chunks.push(e)},c.prototype.onEnd=function(e){e===a.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},r.Inflate=c,r.inflate=h,r.inflateRaw=function(e,t){return(t=t||{}).raw=!0,h(e,t)},r.ungzip=h},9643,(e,t,r)=>{"use strict";var n=e.r(79148).assign,i=e.r(48901),o=e.r(82473),a=e.r(34131),s={};n(s,i,o,a),t.exports=s},72488,(e,t,r)=>{"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,i=e.r(9643),o=e.r(65464),a=e.r(48913),s=n?"uint8array":"array";function u(e,t){a.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}r.magic="\b\0",o.inherits(u,a),u.prototype.processChunk=function(e){this.meta=e.meta,null===this._pako&&this._createPako(),this._pako.push(o.transformTo(s,e.data),!1)},u.prototype.flush=function(){a.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},u.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this._pako=null},u.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}},r.compressWorker=function(e){return new u("Deflate",e)},r.uncompressWorker=function(){return new u("Inflate",{})}},36462,(e,t,r)=>{"use strict";var n=e.r(48913);r.STORE={magic:"\0\0",compressWorker:function(){return new n("STORE compression")},uncompressWorker:function(){return new n("STORE decompression")}},r.DEFLATE=e.r(72488)},71471,(e,t,r)=>{"use strict";r.LOCAL_FILE_HEADER="PK\x03\x04",r.CENTRAL_FILE_HEADER="PK\x01\x02",r.CENTRAL_DIRECTORY_END="PK\x05\x06",r.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x06\x07",r.ZIP64_CENTRAL_DIRECTORY_END="PK\x06\x06",r.DATA_DESCRIPTOR="PK\x07\b"},21908,(e,t,r)=>{"use strict";var n=e.r(65464),i=e.r(48913),o=e.r(46253),a=e.r(63494),s=e.r(71471),u=function(e,t){var r,n="";for(r=0;r>>=8;return n},l=function(e,t){var r=e;return e||(r=t?16893:33204),(65535&r)<<16},f=function(e,t,r,i,f,c){var h,d,p=e.file,y=e.compression,g=c!==o.utf8encode,m=n.transformTo("string",c(p.name)),b=n.transformTo("string",o.utf8encode(p.name)),_=p.comment,v=n.transformTo("string",c(_)),w=n.transformTo("string",o.utf8encode(_)),S=b.length!==p.name.length,k=w.length!==_.length,x="",E="",A="",O=p.dir,R=p.date,C={crc32:0,compressedSize:0,uncompressedSize:0};(!t||r)&&(C.crc32=e.crc32,C.compressedSize=e.compressedSize,C.uncompressedSize=e.uncompressedSize);var T=0;t&&(T|=8),!g&&(S||k)&&(T|=2048);var P=0,I=0;(O&&(P|=16),"UNIX"===f)?(I=798,P|=l(p.unixPermissions,O)):(I=20,P|=63&(p.dosPermissions||0)),h=(R.getUTCHours()<<6|R.getUTCMinutes())<<5|R.getUTCSeconds()/2,d=(R.getUTCFullYear()-1980<<4|R.getUTCMonth()+1)<<5|R.getUTCDate(),S&&(E=u(1,1)+u(a(m),4)+b,x+="up"+u(E.length,2)+E),k&&(A=u(1,1)+u(a(v),4)+w,x+="uc"+u(A.length,2)+A);var j="";return j+="\n\0",j+=u(T,2),j+=y.magic,j+=u(h,2),j+=u(d,2),j+=u(C.crc32,4),j+=u(C.compressedSize,4),j+=u(C.uncompressedSize,4),j+=u(m.length,2),j+=u(x.length,2),{fileRecord:s.LOCAL_FILE_HEADER+j+m+x,dirRecord:s.CENTRAL_FILE_HEADER+u(I,2)+j+u(v.length,2)+"\0\0\0\0"+u(P,4)+u(i,4)+m+x+v}},c=function(e,t,r,i,o){var a=n.transformTo("string",o(i));return s.CENTRAL_DIRECTORY_END+"\0\0\0\0"+u(e,2)+u(e,2)+u(t,4)+u(r,4)+u(a.length,2)+a},h=function(e){return s.DATA_DESCRIPTOR+u(e.crc32,4)+u(e.compressedSize,4)+u(e.uncompressedSize,4)};function d(e,t,r,n){i.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=r,this.encodeFileName=n,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}n.inherits(d,i),d.prototype.push=function(e){var t=e.meta.percent||0,r=this.entriesCount,n=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,i.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:r?(t+100*(r-n-1))/r:100}}))},d.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var r=f(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}})}else this.accumulate=!0},d.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,r=f(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),t)this.push({data:h(e),meta:{percent:100}});else for(this.push({data:r.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},d.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t{"use strict";var n=e.r(36462),i=e.r(21908),o=function(e,t){var r=e||t,i=n[r];if(!i)throw Error(r+" is not a valid compression method !");return i};r.generateWorker=function(e,t,r){var n=new i(t.streamFiles,r,t.platform,t.encodeFileName),a=0;try{e.forEach(function(e,r){a++;var i=o(r.options.compression,t.compression),s=r.options.compressionOptions||t.compressionOptions||{},u=r.dir,l=r.date;r._compressWorker(i,s).withStreamInfo("file",{name:e,dir:u,date:l,comment:r.comment||"",unixPermissions:r.unixPermissions,dosPermissions:r.dosPermissions}).pipe(n)}),n.entriesCount=a}catch(e){n.error(e)}return n}},13303,(e,t,r)=>{"use strict";var n=e.r(65464),i=e.r(48913);function o(e,t){i.call(this,"Nodejs stream input adapter for "+e),this._upstreamEnded=!1,this._bindStream(t)}n.inherits(o,i),o.prototype._bindStream=function(e){var t=this;this._stream=e,e.pause(),e.on("data",function(e){t.push({data:e,meta:{percent:0}})}).on("error",function(e){t.isPaused?this.generatedError=e:t.error(e)}).on("end",function(){t.isPaused?t._upstreamEnded=!0:t.end()})},o.prototype.pause=function(){return!!i.prototype.pause.call(this)&&(this._stream.pause(),!0)},o.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},t.exports=o},1223,(e,t,r)=>{"use strict";var n=e.r(46253),i=e.r(65464),o=e.r(48913),a=e.r(846),s=e.r(13133),u=e.r(43220),l=e.r(52929),f=e.r(6664),c=e.r(42527),h=e.r(13303),d=function(e,t,r){var n,a=i.getTypeOf(t),f=i.extend(r||{},s);f.date=f.date||new Date,null!==f.compression&&(f.compression=f.compression.toUpperCase()),"string"==typeof f.unixPermissions&&(f.unixPermissions=parseInt(f.unixPermissions,8)),f.unixPermissions&&16384&f.unixPermissions&&(f.dir=!0),f.dosPermissions&&16&f.dosPermissions&&(f.dir=!0),f.dir&&(e=y(e)),f.createFolders&&(n=p(e))&&g.call(this,n,!0);var d="string"===a&&!1===f.binary&&!1===f.base64;r&&void 0!==r.binary||(f.binary=!d),(t instanceof u&&0===t.uncompressedSize||f.dir||!t||0===t.length)&&(f.base64=!1,f.binary=!0,t="",f.compression="STORE",a="string");var m=null;m=t instanceof u||t instanceof o?t:c.isNode&&c.isStream(t)?new h(e,t):i.prepareContent(e,t,f.binary,f.optimizedBinaryString,f.base64);var b=new l(e,m,f);this.files[e]=b},p=function(e){"/"===e.slice(-1)&&(e=e.substring(0,e.length-1));var t=e.lastIndexOf("/");return t>0?e.substring(0,t):""},y=function(e){return"/"!==e.slice(-1)&&(e+="/"),e},g=function(e,t){return t=void 0!==t?t:s.createFolders,e=y(e),this.files[e]||d.call(this,e,null,{dir:!0,createFolders:t}),this.files[e]};function m(e){return"[object RegExp]"===Object.prototype.toString.call(e)}t.exports={load:function(){throw Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(e){var t,r,n;for(t in this.files)n=this.files[t],(r=t.slice(this.root.length,t.length))&&t.slice(0,this.root.length)===this.root&&e(r,n)},filter:function(e){var t=[];return this.forEach(function(r,n){e(r,n)&&t.push(n)}),t},file:function(e,t,r){if(1==arguments.length)if(m(e)){var n=e;return this.filter(function(e,t){return!t.dir&&n.test(e)})}else{var i=this.files[this.root+e];return i&&!i.dir?i:null}return e=this.root+e,d.call(this,e,t,r),this},folder:function(e){if(!e)return this;if(m(e))return this.filter(function(t,r){return r.dir&&e.test(t)});var t=this.root+e,r=g.call(this,t),n=this.clone();return n.root=r.name,n},remove:function(e){e=this.root+e;var t=this.files[e];if(t||("/"!==e.slice(-1)&&(e+="/"),t=this.files[e]),t&&!t.dir)delete this.files[e];else for(var r=this.filter(function(t,r){return r.name.slice(0,e.length)===e}),n=0;n{"use strict";var n=e.r(65464);function i(e){this.data=e,this.length=e.length,this.index=0,this.zero=0}i.prototype={checkOffset:function(e){this.checkIndex(this.index+e)},checkIndex:function(e){if(this.length=this.index;t--)r=(r<<8)+this.byteAt(t);return this.index+=e,r},readString:function(e){return n.transformTo("string",this.readData(e))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC((e>>25&127)+1980,(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},t.exports=i},12189,(e,t,r)=>{"use strict";var n=e.r(37384);function i(e){n.call(this,e);for(var t=0;t=0;--o)if(this.data[o]===t&&this.data[o+1]===r&&this.data[o+2]===n&&this.data[o+3]===i)return o-this.zero;return -1},i.prototype.readAndCheckSignature=function(e){var t=e.charCodeAt(0),r=e.charCodeAt(1),n=e.charCodeAt(2),i=e.charCodeAt(3),o=this.readData(4);return t===o[0]&&r===o[1]&&n===o[2]&&i===o[3]},i.prototype.readData=function(e){if(this.checkOffset(e),0===e)return[];var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},41370,(e,t,r)=>{"use strict";var n=e.r(37384);function i(e){n.call(this,e)}e.r(65464).inherits(i,n),i.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},i.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},i.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},15841,(e,t,r)=>{"use strict";var n=e.r(12189);function i(e){n.call(this,e)}e.r(65464).inherits(i,n),i.prototype.readData=function(e){if(this.checkOffset(e),0===e)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},44429,(e,t,r)=>{"use strict";var n=e.r(15841);function i(e){n.call(this,e)}e.r(65464).inherits(i,n),i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},71770,(e,t,r)=>{"use strict";var n=e.r(65464),i=e.r(87780),o=e.r(12189),a=e.r(41370),s=e.r(44429),u=e.r(15841);t.exports=function(e){var t=n.getTypeOf(e);return(n.checkSupport(t),"string"!==t||i.uint8array)?"nodebuffer"===t?new s(e):i.uint8array?new u(n.transformTo("uint8array",e)):new o(n.transformTo("array",e)):new a(e)}},92861,(e,t,r)=>{"use strict";var n=e.r(71770),i=e.r(65464),o=e.r(43220),a=e.r(63494),s=e.r(46253),u=e.r(36462),l=e.r(87780),f=function(e){for(var t in u)if(Object.prototype.hasOwnProperty.call(u,t)&&u[t].magic===e)return u[t];return null};function c(e,t){this.options=e,this.loadOptions=t}c.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(e){var t,r;if(e.skip(22),this.fileNameLength=e.readInt(2),r=e.readInt(2),this.fileName=e.readData(this.fileNameLength),e.skip(r),-1===this.compressedSize||-1===this.uncompressedSize)throw Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(t=f(this.compressionMethod)))throw Error("Corrupted zip : compression "+i.pretty(this.compressionMethod)+" unknown (inner file : "+i.transformTo("string",this.fileName)+")");this.decompressed=new o(this.compressedSize,this.uncompressedSize,this.crc32,t,e.readData(this.compressedSize))},readCentralPart:function(e){this.versionMadeBy=e.readInt(2),e.skip(2),this.bitFlag=e.readInt(2),this.compressionMethod=e.readString(2),this.date=e.readDate(),this.crc32=e.readInt(4),this.compressedSize=e.readInt(4),this.uncompressedSize=e.readInt(4);var t=e.readInt(2);if(this.extraFieldsLength=e.readInt(2),this.fileCommentLength=e.readInt(2),this.diskNumberStart=e.readInt(2),this.internalFileAttributes=e.readInt(2),this.externalFileAttributes=e.readInt(4),this.localHeaderOffset=e.readInt(4),this.isEncrypted())throw Error("Encrypted zip are not supported");e.skip(t),this.readExtraFields(e),this.parseZIP64ExtraField(e),this.fileComment=e.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var e=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0===e&&(this.dosPermissions=63&this.externalFileAttributes),3===e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var e=n(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(e){var t,r,n,i=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index+4{"use strict";var n=e.r(71770),i=e.r(65464),o=e.r(71471),a=e.r(92861),s=e.r(87780);function u(e){this.files=[],this.loadOptions=e}u.prototype={checkSignature:function(e){if(!this.reader.readAndCheckSignature(e)){this.reader.index-=4;var t=this.reader.readString(4);throw Error("Corrupted zip or bug: unexpected signature ("+i.pretty(t)+", expected "+i.pretty(e)+")")}},isSignature:function(e,t){var r=this.reader.index;this.reader.setIndex(e);var n=this.reader.readString(4);return this.reader.setIndex(r),n===t},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var e=this.reader.readData(this.zipCommentLength),t=s.uint8array?"uint8array":"array",r=i.transformTo(t,e);this.zipComment=this.loadOptions.decodeFileName(r)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var e,t,r,n=this.zip64EndOfCentralSize-44;01)throw Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var e,t;for(e=0;e0)this.isSignature(t,o.CENTRAL_FILE_HEADER)||(this.reader.zero=n);else if(n<0)throw Error("Corrupted zip: missing "+Math.abs(n)+" bytes.")},prepareReader:function(e){this.reader=n(e)},load:function(e){this.prepareReader(e),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},t.exports=u},37153,(e,t,r)=>{"use strict";var n=e.r(65464),i=e.r(24375),o=e.r(46253),a=e.r(12938),s=e.r(1648),u=e.r(42527);t.exports=function(e,t){var r=this;return(t=n.extend(t||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:o.utf8decode}),u.isNode&&u.isStream(e))?i.Promise.reject(Error("JSZip can't accept a stream when loading a zip file.")):n.prepareContent("the loaded zip file",e,!0,t.optimizedBinaryString,t.base64).then(function(e){var r=new a(t);return r.load(e),r}).then(function(e){var r=[i.Promise.resolve(e)],n=e.files;if(t.checkCRC32)for(var o=0;o{"use strict";function n(){if(!(this instanceof n))return new n;if(arguments.length)throw Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var e=new n;for(var t in this)"function"!=typeof this[t]&&(e[t]=this[t]);return e}}n.prototype=e.r(1223),n.prototype.loadAsync=e.r(37153),n.support=e.r(87780),n.defaults=e.r(13133),n.version="3.10.1",n.loadAsync=function(e,t){return new n().loadAsync(e,t)},n.external=e.r(24375),t.exports=n}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/e4e6678c9c61c198.js b/docs/_next/static/chunks/e4e6678c9c61c198.js deleted file mode 100644 index 84237f2..0000000 --- a/docs/_next/static/chunks/e4e6678c9c61c198.js +++ /dev/null @@ -1 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,88174,(t,e,i)=>{var n=t.i(67034),r=r||{version:"5.5.2"};if(i.fabric=r,"undefined"!=typeof document&&"undefined"!=typeof window)document instanceof("undefined"!=typeof HTMLDocument?HTMLDocument:Document)?r.document=document:r.document=document.implementation.createHTMLDocument(""),r.window=window;else{var s=new({}).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;r.document=s.document,r.jsdomImplForWrapper=void 0,r.nodeCanvas=void 0,r.window=s,DOMParser=r.window.DOMParser}function o(t,e){var i=t.canvas,n=e.targetCanvas,r=n.getContext("2d");r.translate(0,n.height),r.scale(1,-1);var s=i.height-n.height;r.drawImage(i,0,s,n.width,n.height,0,0,n.width,n.height)}function a(t,e){var i=e.targetCanvas.getContext("2d"),n=e.destinationWidth,r=e.destinationHeight,s=n*r*4,o=new Uint8Array(this.imageBuffer,0,s),a=new Uint8ClampedArray(this.imageBuffer,0,s);t.readPixels(0,0,n,r,t.RGBA,t.UNSIGNED_BYTE,o);var l=new ImageData(a,n,r);i.putImageData(l,0,0)}r.isTouchSupported="ontouchstart"in r.window||"ontouchstart"in r.document||r.window&&r.window.navigator&&r.window.navigator.maxTouchPoints>0,r.isLikelyNode=void 0!==n.Buffer&&"undefined"==typeof window,r.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"],r.DPI=96,r.reNum="(?:[-+]?(?:\\d+|\\d*\\.\\d+)(?:[eE][-+]?\\d+)?)",r.commaWsp="(?:\\s+,?\\s*|,\\s*)",r.rePathCommand=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/ig,r.reNonWord=/[ \n\.,;!\?\-]/,r.fontPaths={},r.iMatrix=[1,0,0,1,0,0],r.svgNS="http://www.w3.org/2000/svg",r.perfLimitSizeTotal=2097152,r.maxCacheSideLimit=4096,r.minCacheSideLimit=256,r.charWidthsCache={},r.textureSize=2048,r.disableStyleCopyPaste=!1,r.enableGLFiltering=!0,r.devicePixelRatio=r.window.devicePixelRatio||r.window.webkitDevicePixelRatio||r.window.mozDevicePixelRatio||1,r.browserShadowBlurConstant=1,r.arcToSegmentsCache={},r.boundsOfCurveCache={},r.cachesBoundsOfCurve=!0,r.forceGLPutImageData=!1,r.initFilterBackend=function(){return r.enableGLFiltering&&r.isWebglSupported&&r.isWebglSupported(r.textureSize)?(console.log("max texture size: "+r.maxTextureSize),new r.WebglFilterBackend({tileSize:r.textureSize})):r.Canvas2dFilterBackend?new r.Canvas2dFilterBackend:void 0},"undefined"!=typeof document&&"undefined"!=typeof window&&(window.fabric=r),function(){function t(t,e){if(this.__eventListeners[t]){var i=this.__eventListeners[t];e?i[i.indexOf(e)]=!1:r.util.array.fill(i,!1)}}function e(t,e){var i=(function(){e.apply(this,arguments),this.off(t,i)}).bind(this);this.on(t,i)}r.Observable={fire:function(t,e){if(!this.__eventListeners)return this;var i=this.__eventListeners[t];if(!i)return this;for(var n=0,r=i.length;n-1||!!e&&this._objects.some(function(e){return"function"==typeof e.contains&&e.contains(t,!0)})},complexity:function(){return this._objects.reduce(function(t,e){return t+(e.complexity?e.complexity():0)},0)}},r.CommonMethods={_setOptions:function(t){for(var e in t)this.set(e,t[e])},_initGradient:function(t,e){!t||!t.colorStops||t instanceof r.Gradient||this.set(e,new r.Gradient(t))},_initPattern:function(t,e,i){!t||!t.source||t instanceof r.Pattern?i&&i():this.set(e,new r.Pattern(t,i))},_setObject:function(t){for(var e in t)this._set(e,t[e])},set:function(t,e){return"object"==typeof t?this._setObject(t):this._set(t,e),this},_set:function(t,e){this[t]=e},toggle:function(t){var e=this.get(t);return"boolean"==typeof e&&this.set(t,!e),this},get:function(t){return this[t]}},function(t){var e=Math.sqrt,i=Math.atan2,n=Math.pow,s=Math.PI/180,o=Math.PI/2;r.util={cos:function(t){if(0===t)return 1;switch(t<0&&(t=-t),t/o){case 1:case 3:return 0;case 2:return -1}return Math.cos(t)},sin:function(t){if(0===t)return 0;var e=1;switch(t<0&&(e=-1),t/o){case 1:return e;case 2:return 0;case 3:return-e}return Math.sin(t)},removeFromArray:function(t,e){var i=t.indexOf(e);return -1!==i&&t.splice(i,1),t},getRandomInt:function(t,e){return Math.floor(Math.random()*(e-t+1))+t},degreesToRadians:function(t){return t*s},radiansToDegrees:function(t){return t/s},rotatePoint:function(t,e,i){var n=new r.Point(t.x-e.x,t.y-e.y),s=r.util.rotateVector(n,i);return new r.Point(s.x,s.y).addEquals(e)},rotateVector:function(t,e){var i=r.util.sin(e),n=r.util.cos(e);return{x:t.x*n-t.y*i,y:t.x*i+t.y*n}},createVector:function(t,e){return new r.Point(e.x-t.x,e.y-t.y)},calcAngleBetweenVectors:function(t,e){return Math.acos((t.x*e.x+t.y*e.y)/(Math.hypot(t.x,t.y)*Math.hypot(e.x,e.y)))},getHatVector:function(t){return new r.Point(t.x,t.y).multiply(1/Math.hypot(t.x,t.y))},getBisector:function(t,e,i){var n=r.util.createVector(t,e),s=r.util.createVector(t,i),o=r.util.calcAngleBetweenVectors(n,s),a=r.util.calcAngleBetweenVectors(r.util.rotateVector(n,o),s);return{vector:r.util.getHatVector(r.util.rotateVector(n,o*(0===a?1:-1)/2)),angle:o}},projectStrokeOnPoints:function(t,e,i){var n=[],s=e.strokeWidth/2,o=e.strokeUniform?new r.Point(1/e.scaleX,1/e.scaleY):new r.Point(1,1),a=function(t){var e=s/Math.hypot(t.x,t.y);return new r.Point(t.x*e*o.x,t.y*e*o.y)};return t.length<=1||t.forEach(function(l,c){var h,u,f=new r.Point(l.x,l.y);0===c?(u=t[c+1],h=i?a(r.util.createVector(u,f)).addEquals(f):t[t.length-1]):c===t.length-1?(h=t[c-1],u=i?a(r.util.createVector(h,f)).addEquals(f):t[0]):(h=t[c-1],u=t[c+1]);var d,g,p=r.util.getBisector(f,h,u),m=p.vector,y=p.angle;if("miter"===e.strokeLineJoin&&(d=-s/Math.sin(y/2),Math.hypot((g=new r.Point(m.x*d*o.x,m.y*d*o.y)).x,g.y)/s<=e.strokeMiterLimit)){n.push(f.add(g)),n.push(f.subtract(g));return}d=-s*Math.SQRT2,g=new r.Point(m.x*d*o.x,m.y*d*o.y),n.push(f.add(g)),n.push(f.subtract(g))}),n},transformPoint:function(t,e,i){return i?new r.Point(e[0]*t.x+e[2]*t.y,e[1]*t.x+e[3]*t.y):new r.Point(e[0]*t.x+e[2]*t.y+e[4],e[1]*t.x+e[3]*t.y+e[5])},makeBoundingBoxFromPoints:function(t,e){if(e)for(var i=0;i0&&(e>n?e-=n:e=0,i>n?i-=n:i=0);var r,s=!0,o=t.getImageData(e,i,2*n||1,2*n||1),a=o.data.length;for(r=3;r0&&(r.util.hasStyleChanged(s,c,!0)?o.push({start:n,end:n+1,style:c}):o[o.length-1].end++),s=c||{}}}return o},stylesFromArray:function(t,e){if(!Array.isArray(t))return t;for(var i=e.split("\n"),n=-1,r=0,s={},o=0;o=r?s-r:2*Math.PI-(r-s)}function s(t,e,i,n){return Math.sqrt((i-t)*(i-t)+(n-e)*(n-e))}function o(t,e,i){var n,r,o={x:e,y:i},a=0;for(r=1;r<=100;r+=1)n=t(r/100),a+=s(o.x,o.y,n.x,n.y),o=n;return a}function a(t){for(var e,i,n,r,a=0,l=t.length,c=0,h=0,u=0,f=0,d=[],g=0;gw)for(var O=1,k=m.length;O0?M-=2*c:1===a&&M<0&&(M+=2*c);for(var P=Math.ceil(Math.abs(M/c*2)),A=[],D=M/P,F=8/3*Math.sin(D/4)*Math.sin(D/4)/Math.sin(D/2),R=j+D,L=0;L2;for(e=e||0,h&&(l=t[2].xt[i-2].x?1:s.x===t[i-2].x?0:-1,c=s.y>t[i-2].y?1:s.y===t[i-2].y?0:-1),n.push(["L",s.x+l*e,s.y+c*e]),n},r.util.getPathSegmentsInfo=a,r.util.getBoundsOfCurve=function(e,i,n,s,o,a,l,c){if(r.cachesBoundsOfCurve&&(h=t.call(arguments),r.boundsOfCurveCache[h]))return r.boundsOfCurveCache[h];var h,u,f,d,g,p,m,y,b,x=Math.sqrt,_=Math.min,C=Math.max,S=Math.abs,w=[],T=[[],[]];f=6*e-12*n+6*o,u=-3*e+9*n-9*o+3*l,d=3*n-3*e;for(var O=0;O<2;++O){if(O>0&&(f=6*i-12*s+6*a,u=-3*i+9*s-9*a+3*c,d=3*s-3*i),1e-12>S(u)){if(1e-12>S(f))continue;0<(g=-d/f)&&g<1&&w.push(g);continue}!((y=f*f-4*d*u)<0)&&(0<(p=(-f+(b=x(y)))/(2*u))&&p<1&&w.push(p),0<(m=(-f-b)/(2*u))&&m<1&&w.push(m))}for(var k,E,j,M=w.length,P=M;M--;)k=(j=1-(g=w[M]))*j*j*e+3*j*j*g*n+3*j*g*g*o+g*g*g*l,T[0][M]=k,E=j*j*j*i+3*j*j*g*s+3*j*g*g*a+g*g*g*c,T[1][M]=E;T[0][P]=e,T[1][P]=i,T[0][P+1]=l,T[1][P+1]=c;var A=[{x:_.apply(null,T[0]),y:_.apply(null,T[1])},{x:C.apply(null,T[0]),y:C.apply(null,T[1])}];return r.cachesBoundsOfCurve&&(r.boundsOfCurveCache[h]=A),A},r.util.getPointOnPath=function(t,e,i){i||(i=a(t));for(var n=0;e-i[n].length>0&&n1e-4;)i=l(o),r=o,(n=s(c.x,c.y,i.x,i.y))+a>e?(o-=h,h/=2):(c=i,o+=h,a+=n);return i.angle=u(r),i}(l,e)}},r.util.transformPath=function(t,e,i){return i&&(e=r.util.multiplyTransformMatrices(e,[1,0,0,1,-i.x,-i.y])),t.map(function(t){for(var i=t.slice(0),n={},s=1;s=e})}}}(),function(){function t(e,i,n){if(n)if(!r.isLikelyNode&&i instanceof Element)e=i;else if(i instanceof Array){e=[];for(var s=0,o=i.length;s/g,">")},graphemeSplit:function(t){var e,i=0,n=[];for(i=0;i57343)return t.charAt(e);if(55296<=i&&i<=56319){if(t.length<=e+1)throw"High surrogate without following low surrogate";var n=t.charCodeAt(e+1);if(56320>n||n>57343)throw"High surrogate without following low surrogate";return t.charAt(e)+t.charAt(e+1)}if(0===e)throw"Low surrogate without preceding high surrogate";var r=t.charCodeAt(e-1);if(55296>r||r>56319)throw"Low surrogate without preceding high surrogate";return!1}(t,i))&&n.push(e);return n}},function(){var t=Array.prototype.slice,e=function(){},i=function(){for(var t in{toString:1})if("toString"===t)return!1;return!0}(),n=function(t,e,n){for(var r in e)r in t.prototype&&"function"==typeof t.prototype[r]&&(e[r]+"").indexOf("callSuper")>-1?t.prototype[r]=function(t){return function(){var i=this.constructor.superclass;this.constructor.superclass=n;var r=e[t].apply(this,arguments);if(this.constructor.superclass=i,"initialize"!==t)return r}}(r):t.prototype[r]=e[r],i&&(e.toString!==Object.prototype.toString&&(t.prototype.toString=e.toString),e.valueOf!==Object.prototype.valueOf&&(t.prototype.valueOf=e.valueOf))};function s(){}function o(e){for(var i=null,n=this;n.constructor.superclass;){var r=n.constructor.superclass.prototype[e];if(n[e]!==r){i=r;break}n=n.constructor.superclass.prototype}return i?arguments.length>1?i.apply(this,t.call(arguments,1)):i.call(this):console.log("tried to callSuper "+e+", method not found in prototype chain",this)}r.util.createClass=function(){var i=null,r=t.call(arguments,0);function a(){this.initialize.apply(this,arguments)}"function"==typeof r[0]&&(i=r.shift()),a.superclass=i,a.subclasses=[],i&&(s.prototype=i.prototype,a.prototype=new s,i.subclasses.push(a));for(var l=0,c=r.length;l-1||"touch"===t.pointerType}}(),function(){var t=r.document.createElement("div"),e="string"==typeof t.style.opacity,i="string"==typeof t.style.filter,n=/alpha\s*\(\s*opacity\s*=\s*([^\)]+)\)/,s=function(t){return t};e?s=function(t,e){return t.style.opacity=e,t}:i&&(s=function(t,e){var i=t.style;return t.currentStyle&&!t.currentStyle.hasLayout&&(i.zoom=1),n.test(i.filter)?(e=e>=.9999?"":"alpha(opacity="+100*e+")",i.filter=i.filter.replace(n,e)):i.filter+=" alpha(opacity="+100*e+")",t}),r.util.setStyle=function(t,e){var i=t.style;if(!i)return t;if("string"==typeof e)return t.style.cssText+=";"+e,e.indexOf("opacity")>-1?s(t,e.match(/opacity:\s*(\d?\.?\d*)/)[1]):t;for(var n in e)if("opacity"===n)s(t,e[n]);else{var r="float"===n||"cssFloat"===n?void 0===i.styleFloat?"cssFloat":"styleFloat":n;i.setProperty(r,e[n])}return t}}(),function(){var t,e,i,n,s=Array.prototype.slice,o=function(t){return s.call(t,0)};try{n=o(r.document.childNodes)instanceof Array}catch(t){}function a(t,e){var i=r.document.createElement(t);for(var n in e)"class"===n?i.className=e[n]:"for"===n?i.htmlFor=e[n]:i.setAttribute(n,e[n]);return i}function l(t){for(var e=0,i=0,n=r.document.documentElement,s=r.document.body||{scrollLeft:0,scrollTop:0};t&&(t.parentNode||t.host)&&((t=t.parentNode||t.host)===r.document?(e=s.scrollLeft||n.scrollLeft||0,i=s.scrollTop||n.scrollTop||0):(e+=t.scrollLeft||0,i+=t.scrollTop||0),1!==t.nodeType||"fixed"!==t.style.position););return{left:e,top:i}}n||(o=function(t){for(var e=Array(t.length),i=t.length;i--;)e[i]=t[i];return e}),i=r.document.defaultView&&r.document.defaultView.getComputedStyle?function(t,e){var i=r.document.defaultView.getComputedStyle(t,null);return i?i[e]:void 0}:function(t,e){var i=t.style[e];return!i&&t.currentStyle&&(i=t.currentStyle[e]),i},e="userSelect"in(t=r.document.documentElement.style)?"userSelect":"MozUserSelect"in t?"MozUserSelect":"WebkitUserSelect"in t?"WebkitUserSelect":"KhtmlUserSelect"in t?"KhtmlUserSelect":"",r.util.makeElementUnselectable=function(t){return void 0!==t.onselectstart&&(t.onselectstart=r.util.falseFunction),e?t.style[e]="none":"string"==typeof t.unselectable&&(t.unselectable="on"),t},r.util.makeElementSelectable=function(t){return void 0!==t.onselectstart&&(t.onselectstart=null),e?t.style[e]="":"string"==typeof t.unselectable&&(t.unselectable=""),t},r.util.setImageSmoothing=function(t,e){t.imageSmoothingEnabled=t.imageSmoothingEnabled||t.webkitImageSmoothingEnabled||t.mozImageSmoothingEnabled||t.msImageSmoothingEnabled||t.oImageSmoothingEnabled,t.imageSmoothingEnabled=e},r.util.getById=function(t){return"string"==typeof t?r.document.getElementById(t):t},r.util.toArray=o,r.util.addClass=function(t,e){t&&-1===(" "+t.className+" ").indexOf(" "+e+" ")&&(t.className+=(t.className?" ":"")+e)},r.util.makeElement=a,r.util.wrapElement=function(t,e,i){return"string"==typeof e&&(e=a(e,i)),t.parentNode&&t.parentNode.replaceChild(e,t),e.appendChild(t),e},r.util.getScrollLeftTop=l,r.util.getElementOffset=function(t){var e,n,r=t&&t.ownerDocument,s={left:0,top:0},o={left:0,top:0},a={borderLeftWidth:"left",borderTopWidth:"top",paddingLeft:"left",paddingTop:"top"};if(!r)return o;for(var c in a)o[a[c]]+=parseInt(i(t,c),10)||0;return e=r.documentElement,void 0!==t.getBoundingClientRect&&(s=t.getBoundingClientRect()),n=l(t),{left:s.left+n.left-(e.clientLeft||0)+o.left,top:s.top+n.top-(e.clientTop||0)+o.top}},r.util.getNodeCanvas=function(t){var e=r.jsdomImplForWrapper(t);return e._canvas||e._image},r.util.cleanUpJsdomNode=function(t){if(r.isLikelyNode){var e=r.jsdomImplForWrapper(t);e&&(e._image=null,e._canvas=null,e._currentSrc=null,e._attributes=null,e._classList=null)}}}(),function(){function t(){}r.util.request=function(e,i){i||(i={});var n,s,o=i.method?i.method.toUpperCase():"GET",a=i.onComplete||function(){},l=new r.window.XMLHttpRequest,c=i.body||i.parameters;return l.onreadystatechange=function(){4===l.readyState&&(a(l),l.onreadystatechange=t)},"GET"===o&&(c=null,"string"==typeof i.parameters&&(n=e,s=i.parameters,e=n+(/\?/.test(n)?"&":"?")+s)),l.open(o,e,!0),("POST"===o||"PUT"===o)&&l.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),l.send(c),l}}(),r.log=console.log,r.warn=console.warn,function(){var t=r.util.object.extend,e=r.util.object.clone,i=[];function n(){return!1}function s(t,e,i,n){return-i*Math.cos(t/n*(Math.PI/2))+i+e}r.util.object.extend(i,{cancelAll:function(){var t=this.splice(0);return t.forEach(function(t){t.cancel()}),t},cancelByCanvas:function(t){if(!t)return[];var e=this.filter(function(e){return"object"==typeof e.target&&e.target.canvas===t});return e.forEach(function(t){t.cancel()}),e},cancelByTarget:function(t){var e=this.findAnimationsByTarget(t);return e.forEach(function(t){t.cancel()}),e},findAnimationIndex:function(t){return this.indexOf(this.findAnimation(t))},findAnimation:function(t){return this.find(function(e){return e.cancel===t})},findAnimationsByTarget:function(t){return t?this.filter(function(e){return e.target===t}):[]}});var o=r.window.requestAnimationFrame||r.window.webkitRequestAnimationFrame||r.window.mozRequestAnimationFrame||r.window.oRequestAnimationFrame||r.window.msRequestAnimationFrame||function(t){return r.window.setTimeout(t,1e3/60)},a=r.window.cancelAnimationFrame||r.window.clearTimeout;function l(){return o.apply(r.window,arguments)}r.util.animate=function(i){i||(i={});var o,a=!1,c=function(){var t=r.runningAnimations.indexOf(o);return t>-1&&r.runningAnimations.splice(t,1)[0]};return o=t(e(i),{cancel:function(){return a=!0,c()},currentValue:"startValue"in i?i.startValue:0,completionRate:0,durationRate:0}),r.runningAnimations.push(o),l(function(t){var e,r=t||+new Date,h=i.duration||500,u=r+h,f=i.onChange||n,d=i.abort||n,g=i.onComplete||n,p=i.easing||s,m="startValue"in i&&i.startValue.length>0,y="startValue"in i?i.startValue:0,b="endValue"in i?i.endValue:100,x=i.byValue||(m?y.map(function(t,e){return b[e]-y[e]}):b-y);i.onStart&&i.onStart(),function t(i){var n=(e=i||+new Date)>u?h:e-r,s=n/h,_=m?y.map(function(t,e){return p(n,y[e],x[e],h)}):p(n,y,x,h),C=m?Math.abs((_[0]-y[0])/x[0]):Math.abs((_-y)/x);if(o.currentValue=m?_.slice():_,o.completionRate=C,o.durationRate=s,!a){if(d(_,C,s))return void c();if(e>u){o.currentValue=m?b.slice():b,o.completionRate=1,o.durationRate=1,f(m?b.slice():b,1,1),g(b,1,1),c();return}f(_,C,s),l(t)}}(r)}),o.cancel},r.util.requestAnimFrame=l,r.util.cancelAnimFrame=function(){return a.apply(r.window,arguments)},r.runningAnimations=i}(),function(){function t(t,e,i){var n="rgba("+parseInt(t[0]+i*(e[0]-t[0]),10)+","+parseInt(t[1]+i*(e[1]-t[1]),10)+","+parseInt(t[2]+i*(e[2]-t[2]),10);return n+(","+(t&&e?parseFloat(t[3]+i*(e[3]-t[3])):1)+")")}r.util.animateColor=function(e,i,n,s){var o=new r.Color(e).getSource(),a=new r.Color(i).getSource(),l=s.onComplete,c=s.onChange;return s=s||{},r.util.animate(r.util.object.extend(s,{duration:n||500,startValue:o,endValue:a,byValue:a,easing:function(e,i,n,r){return t(i,n,s.colorEasing?s.colorEasing(e,r):1-Math.cos(e/r*(Math.PI/2)))},onComplete:function(e,i,n){if(l)return l(t(a,a,0),i,n)},onChange:function(e,i,n){if(c){if(Array.isArray(e))return c(t(e,e,0),i,n);c(e,i,n)}}}))}}(),function(){function t(t,e,i,n){return t1;)s.shift(),o=e.util.multiplyTransformMatrices(o,s[0]);return o}}();var p=RegExp("^\\s*("+e.reNum+"+)\\s*,?\\s*("+e.reNum+"+)\\s*,?\\s*("+e.reNum+"+)\\s*,?\\s*("+e.reNum+"+)\\s*$");function m(t){if(!e.svgViewBoxElementsRegEx.test(t.nodeName))return{};var i,n,r,o,a=t.getAttribute("viewBox"),l=1,c=1,h=0,u=0,f=t.getAttribute("width"),d=t.getAttribute("height"),g=t.getAttribute("x")||0,m=t.getAttribute("y")||0,y=t.getAttribute("preserveAspectRatio")||"",b=!a||!(a=a.match(p)),x=!f||!d||"100%"===f||"100%"===d,_=b&&x,C={},S="",w=0,T=0;if(C.width=0,C.height=0,C.toBeParsed=_,b&&(g||m)&&t.parentNode&&"#document"!==t.parentNode.nodeName&&(S=" translate("+s(g)+" "+s(m)+") ",r=(t.getAttribute("transform")||"")+S,t.setAttribute("transform",r),t.removeAttribute("x"),t.removeAttribute("y")),_)return C;if(b)return C.width=s(f),C.height=s(d),C;if(h=-parseFloat(a[1]),u=-parseFloat(a[2]),i=parseFloat(a[3]),n=parseFloat(a[4]),C.minX=h,C.minY=u,C.viewBoxWidth=i,C.viewBoxHeight=n,x?(C.width=i,C.height=n):(C.width=s(f),C.height=s(d),l=C.width/i,c=C.height/n),"none"!==(y=e.util.parsePreserveAspectRatioAttribute(y)).alignX&&("meet"===y.meetOrSlice&&(c=l=l>c?c:l),"slice"===y.meetOrSlice&&(c=l=l>c?l:c),w=C.width-i*l,T=C.height-n*l,"Mid"===y.alignX&&(w/=2),"Mid"===y.alignY&&(T/=2),"Min"===y.alignX&&(w=0),"Min"===y.alignY&&(T=0)),1===l&&1===c&&0===h&&0===u&&0===g&&0===m)return C;if((g||m)&&"#document"!==t.parentNode.nodeName&&(S=" translate("+s(g)+" "+s(m)+") "),r=S+" matrix("+l+" 0 0 "+c+" "+(h*l+w)+" "+(u*c+T)+") ","svg"===t.nodeName){for(o=t.ownerDocument.createElementNS(e.svgNS,"g");t.firstChild;)o.appendChild(t.firstChild);t.appendChild(o)}else(o=t).removeAttribute("x"),o.removeAttribute("y"),r=o.getAttribute("transform")+r;return o.setAttribute("transform",r),C}e.parseSVGDocument=function(t,i,r,s){if(t){!function(t){for(var i=f(t,["use","svg:use"]),n=0;i.length&&n-1&&h>-1&&h-1&&(i="stroke")}else{if("href"===t||"xlink:href"===t||"font"===t)return i;if("imageSmoothing"===t)return"optimizeQuality"===i;a=l?i.map(s):s(i,r)}return!l&&isNaN(a)?i:a}(x=S in a?a[S]:S,y[S],m,g),C[x]=_;C&&C.font&&e.parseFontDeclaration(C.font,C);var w=i(m,C);return e.svgValidParentsRegEx.test(t.nodeName)?w:function(t){for(var i in l)if(void 0!==t[l[i]]&&""!==t[i]){if(void 0===t[i]){if(!e.Object.prototype[i])continue;t[i]=e.Object.prototype[i]}if(0!==t[i].indexOf("url(")){var n=new e.Color(t[i]);t[i]=n.setAlpha(r(n.getAlpha()*t[l[i]],2)).toRgba()}}return t}(w)}},parseElements:function(t,i,n,r,s){new e.ElementsParser(t,i,n,r,s).parse()},parseStyleAttribute:function(t){var e,i,n,r,s={},o=t.getAttribute("style");if(!o)return s;if("string"==typeof o)o.replace(/;\s*$/,"").split(";").forEach(function(t){var n=t.split(":");e=n[0].trim().toLowerCase(),i=n[1].trim(),s[e]=i});else{for(var a in o)void 0!==o[a]&&(n=a.toLowerCase(),r=o[a],s[n]=r)}return s},parsePointsAttribute:function(t){if(!t)return null;t=(t=t.replace(/,/g," ").trim()).split(/\s+/);var e,i,n=[];for(e=0,i=t.length;et.x&&this.y>t.y},gte:function(t){return this.x>=t.x&&this.y>=t.y},lerp:function(t,e){return void 0===e&&(e=.5),e=Math.max(Math.min(1,e),0),new i(this.x+(t.x-this.x)*e,this.y+(t.y-this.y)*e)},distanceFrom:function(t){var e=this.x-t.x,i=this.y-t.y;return Math.sqrt(e*e+i*i)},midPointFrom:function(t){return this.lerp(t)},min:function(t){return new i(Math.min(this.x,t.x),Math.min(this.y,t.y))},max:function(t){return new i(Math.max(this.x,t.x),Math.max(this.y,t.y))},toString:function(){return this.x+","+this.y},setXY:function(t,e){return this.x=t,this.y=e,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setFromPoint:function(t){return this.x=t.x,this.y=t.y,this},swap:function(t){var e=this.x,i=this.y;this.x=t.x,this.y=t.y,t.x=e,t.y=i},clone:function(){return new i(this.x,this.y)}}}(i),function(t){"use strict";var e=t.fabric||(t.fabric={});if(e.Intersection)return e.warn("fabric.Intersection is already defined");function i(t){this.status=t,this.points=[]}e.Intersection=i,e.Intersection.prototype={constructor:i,appendPoint:function(t){return this.points.push(t),this},appendPoints:function(t){return this.points=this.points.concat(t),this}},e.Intersection.intersectLineLine=function(t,n,r,s){var o,a=(s.x-r.x)*(t.y-r.y)-(s.y-r.y)*(t.x-r.x),l=(n.x-t.x)*(t.y-r.y)-(n.y-t.y)*(t.x-r.x),c=(s.y-r.y)*(n.x-t.x)-(s.x-r.x)*(n.y-t.y);if(0!==c){var h=a/c,u=l/c;0<=h&&h<=1&&0<=u&&u<=1?(o=new i("Intersection")).appendPoint(new e.Point(t.x+h*(n.x-t.x),t.y+h*(n.y-t.y))):o=new i}else o=new i(0===a||0===l?"Coincident":"Parallel");return o},e.Intersection.intersectLinePolygon=function(t,e,n){var r,s,o,a,l=new i,c=n.length;for(a=0;a0&&(l.status="Intersection"),l},e.Intersection.intersectPolygonPolygon=function(t,e){var n,r=new i,s=t.length;for(n=0;n0&&(r.status="Intersection"),r},e.Intersection.intersectPolygonRectangle=function(t,n,r){var s=n.min(r),o=n.max(r),a=new e.Point(o.x,s.y),l=new e.Point(s.x,o.y),c=i.intersectLinePolygon(s,a,t),h=i.intersectLinePolygon(a,o,t),u=i.intersectLinePolygon(o,l,t),f=i.intersectLinePolygon(l,s,t),d=new i;return d.appendPoints(c.points),d.appendPoints(h.points),d.appendPoints(u.points),d.appendPoints(f.points),d.points.length>0&&(d.status="Intersection"),d}}(i),function(t){"use strict";var e=t.fabric||(t.fabric={});if(e.Color)return e.warn("fabric.Color is already defined.");function i(t){t?this._tryParsingColor(t):this.setSource([0,0,0,1])}function n(t,e,i){return(i<0&&(i+=1),i>1&&(i-=1),i<1/6)?t+(e-t)*6*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}e.Color=i,e.Color.prototype={_tryParsingColor:function(t){var e;t in i.colorNameMap&&(t=i.colorNameMap[t]),"transparent"===t&&(e=[255,255,255,0]),e||(e=i.sourceFromHex(t)),e||(e=i.sourceFromRgb(t)),e||(e=i.sourceFromHsl(t)),e||(e=[0,0,0,1]),e&&this.setSource(e)},_rgbToHsl:function(t,i,n){t/=255,i/=255,n/=255;var r,s,o,a=e.util.array.max([t,i,n]),l=e.util.array.min([t,i,n]);if(o=(a+l)/2,a===l)r=s=0;else{var c=a-l;switch(s=o>.5?c/(2-a-l):c/(a+l),a){case t:r=(i-n)/c+6*(i0)-(t<0)||+t};function f(t,e){return Math.round((t.angle+h(Math.atan2(e.y,e.x))+360)%360/45)}function d(t,i){var n=i.transform.target,r=n.canvas,s=e.util.object.clone(i);s.target=n,r&&r.fire("object:"+t,s),n.fire(t,i)}function g(t,e){var i=e.canvas,n=t[i.uniScaleKey];return i.uniformScaling&&!n||!i.uniformScaling&&n}function p(t){return t.originX===l&&t.originY===l}function m(t,e,i){var n=t.lockScalingX,r=t.lockScalingY;return!!n&&!!r||!e&&(!!n||!!r)&&!!i||!!n&&"x"===e||!!r&&"y"===e||!1}function y(t,e,i,n){return{e:t,transform:e,pointer:{x:i,y:n}}}function b(t){return function(e,i,n,r){var s=i.target,o=s.getCenterPoint(),a=s.translateToOriginPoint(o,i.originX,i.originY),l=t(e,i,n,r);return s.setPositionByOrigin(a,i.originX,i.originY),l}}function x(t,e){return function(i,n,r,s){var o=e(i,n,r,s);return o&&d(t,y(i,n,r,s)),o}}function _(t,i,n,r,s){var o=t.target,a=o.controls[t.corner],l=o.canvas.getZoom(),c=o.padding/l,h=o.toLocalPoint(new e.Point(r,s),i,n);return h.x>=c&&(h.x-=c),h.x<=-c&&(h.x+=c),h.y>=c&&(h.y-=c),h.y<=c&&(h.y+=c),h.x-=a.offsetX,h.y-=a.offsetY,h}function C(t){return t.flipX!==t.flipY}function S(t,e,i,n,r){if(0!==t[e]){var s=r/t._getTransformedDimensions()[n]*t[i];t.set(i,s)}}function w(t,e,i,n){var r,l=e.target,c=l._getTransformedDimensions(0,l.skewY),u=Math.abs(2*_(e,e.originX,e.originY,i,n).x)-c.x,f=l.skewX;u<2?r=0:(r=h(Math.atan2(u/l.scaleX,c.y/l.scaleY)),e.originX===s&&e.originY===a&&(r=-r),e.originX===o&&"top"===e.originY&&(r=-r),C(l)&&(r=-r));var d=f!==r;if(d){var g=l._getTransformedDimensions().y;l.set("skewX",r),S(l,"skewY","scaleY","y",g)}return d}function T(t,e,i,n){var r,l=e.target,c=l._getTransformedDimensions(l.skewX,0),u=Math.abs(2*_(e,e.originX,e.originY,i,n).y)-c.y,f=l.skewY;u<2?r=0:(r=h(Math.atan2(u/l.scaleY,c.x/l.scaleX)),e.originX===s&&e.originY===a&&(r=-r),e.originX===o&&"top"===e.originY&&(r=-r),C(l)&&(r=-r));var d=f!==r;if(d){var g=l._getTransformedDimensions().x;l.set("skewY",r),S(l,"skewX","scaleX","x",g)}return d}function O(t,e,i,n,r){r=r||{};var s,o,a,l,h,f,d=e.target,y=d.lockScalingX,b=d.lockScalingY,x=r.by,C=g(t,d),S=m(d,x,C),w=e.gestureScale;if(S)return!1;if(w)o=e.scaleX*w,a=e.scaleY*w;else{if(s=_(e,e.originX,e.originY,i,n),h="y"!==x?u(s.x):1,f="x"!==x?u(s.y):1,e.signX||(e.signX=h),e.signY||(e.signY=f),d.lockScalingFlip&&(e.signX!==h||e.signY!==f))return!1;if(l=d._getTransformedDimensions(),C&&!x){var T=Math.abs(s.x)+Math.abs(s.y),O=e.original,k=T/(Math.abs(l.x*O.scaleX/d.scaleX)+Math.abs(l.y*O.scaleY/d.scaleY));o=O.scaleX*k,a=O.scaleY*k}else o=Math.abs(s.x*d.scaleX/l.x),a=Math.abs(s.y*d.scaleY/l.y);p(e)&&(o*=2,a*=2),e.signX!==h&&"y"!==x&&(e.originX=c[e.originX],o*=-1,e.signX=h),e.signY!==f&&"x"!==x&&(e.originY=c[e.originY],a*=-1,e.signY=f)}var E=d.scaleX,j=d.scaleY;return x?("x"===x&&d.set("scaleX",o),"y"===x&&d.set("scaleY",a)):(y||d.set("scaleX",o),b||d.set("scaleY",a)),E!==d.scaleX||j!==d.scaleY}r.scaleCursorStyleHandler=function(t,e,n){var r=g(t,n),s="";return(0!==e.x&&0===e.y?s="x":0===e.x&&0!==e.y&&(s="y"),m(n,s,r))?"not-allowed":i[f(n,e)]+"-resize"},r.skewCursorStyleHandler=function(t,e,i){return 0!==e.x&&i.lockSkewingY||0!==e.y&&i.lockSkewingX?"not-allowed":n[f(i,e)%4]+"-resize"},r.scaleSkewCursorStyleHandler=function(t,e,i){return t[i.canvas.altActionKey]?r.skewCursorStyleHandler(t,e,i):r.scaleCursorStyleHandler(t,e,i)},r.rotationWithSnapping=x("rotating",b(function(t,e,i,n){var r=e.target,s=r.translateToOriginPoint(r.getCenterPoint(),e.originX,e.originY);if(r.lockRotation)return!1;var o=Math.atan2(e.ey-s.y,e.ex-s.x),a=h(Math.atan2(n-s.y,i-s.x)-o+e.theta),l=!0;if(r.snapAngle>0){var c=r.snapAngle,u=r.snapThreshold||c,f=Math.ceil(a/c)*c,d=Math.floor(a/c)*c;Math.abs(a-d)0?s:o:(c>0&&(r="top"===h?s:o),c<0&&(r="top"===h?o:s),C(a)&&(r=r===s?o:s)),e.originX=r,x("skewing",b(w))(t,e,i,n))},r.skewHandlerY=function(t,e,i,n){var r,o=e.target,c=o.skewY,h=e.originX;return!o.lockSkewingY&&(0===c?r=_(e,l,l,i,n).y>0?"top":a:(c>0&&(r=h===s?"top":a),c<0&&(r=h===s?a:"top"),C(o)&&(r="top"===r?a:"top")),e.originY=r,x("skewing",b(T))(t,e,i,n))},r.dragHandler=function(t,e,i,n){var r=e.target,s=i-e.offsetX,o=n-e.offsetY,a=!r.get("lockMovementX")&&r.left!==s,l=!r.get("lockMovementY")&&r.top!==o;return a&&r.set("left",s),l&&r.set("top",o),(a||l)&&d("moving",y(t,e,i,n)),a||l},r.scaleOrSkewActionName=function(t,e,i){var n=t[i.canvas.altActionKey];return 0===e.x?n?"skewX":"scaleY":0===e.y?n?"skewY":"scaleX":void 0},r.rotationStyleHandler=function(t,e,i){return i.lockRotation?"not-allowed":e.cursorStyle},r.fireEvent=d,r.wrapWithFixedAnchor=b,r.wrapWithFireEvent=x,r.getLocalPoint=_,e.controlsUtils=r}(i),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.util.degreesToRadians,n=e.controlsUtils;n.renderCircleControl=function(t,e,i,n,r){n=n||{};var s,o=this.sizeX||n.cornerSize||r.cornerSize,a=this.sizeY||n.cornerSize||r.cornerSize,l=void 0!==n.transparentCorners?n.transparentCorners:r.transparentCorners,c=!l&&(n.cornerStrokeColor||r.cornerStrokeColor),h=e,u=i;t.save(),t.fillStyle=n.cornerColor||r.cornerColor,t.strokeStyle=n.cornerStrokeColor||r.cornerStrokeColor,o>a?(s=o,t.scale(1,a/o),u=i*o/a):a>o?(s=a,t.scale(o/a,1),h=e*a/o):s=o,t.lineWidth=1,t.beginPath(),t.arc(h,u,s/2,0,2*Math.PI,!1),t[l?"stroke":"fill"](),c&&t.stroke(),t.restore()},n.renderSquareControl=function(t,e,n,r,s){r=r||{};var o=this.sizeX||r.cornerSize||s.cornerSize,a=this.sizeY||r.cornerSize||s.cornerSize,l=void 0!==r.transparentCorners?r.transparentCorners:s.transparentCorners,c=!l&&(r.cornerStrokeColor||s.cornerStrokeColor),h=o/2,u=a/2;t.save(),t.fillStyle=r.cornerColor||s.cornerColor,t.strokeStyle=r.cornerStrokeColor||s.cornerStrokeColor,t.lineWidth=1,t.translate(e,n),t.rotate(i(s.angle)),t[(l?"stroke":"fill")+"Rect"](-h,-u,o,a),c&&t.strokeRect(-h,-u,o,a),t.restore()}}(i),function(t){"use strict";var e=t.fabric||(t.fabric={});e.Control=function(t){for(var e in t)this[e]=t[e]},e.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(t,e){return e.cursorStyle},getActionName:function(t,e){return e.actionName},getVisibility:function(t,e){var i=t._controlsVisibility;return i&&void 0!==i[e]?i[e]:this.visible},setVisibility:function(t){this.visible=t},positionHandler:function(t,i){return e.util.transformPoint({x:this.x*t.x+this.offsetX,y:this.y*t.y+this.offsetY},i)},calcCornerCoords:function(t,i,n,r,s){var o,a,l,c,h=s?this.touchSizeX:this.sizeX,u=s?this.touchSizeY:this.sizeY;if(h&&u&&h!==u){var f=Math.atan2(u,h),d=Math.sqrt(h*h+u*u)/2,g=f-e.util.degreesToRadians(t),p=Math.PI/2-f-e.util.degreesToRadians(t);o=d*e.util.cos(g),a=d*e.util.sin(g),l=d*e.util.cos(p),c=d*e.util.sin(p)}else{d=.7071067812*(h&&u?h:i);var g=e.util.degreesToRadians(45-t);o=l=d*e.util.cos(g),a=c=d*e.util.sin(g)}return{tl:{x:n-c,y:r-l},tr:{x:n+o,y:r-a},bl:{x:n-o,y:r+a},br:{x:n+c,y:r+l}}},render:function(t,i,n,r,s){"circle"===((r=r||{}).cornerStyle||s.cornerStyle)?e.controlsUtils.renderCircleControl.call(this,t,i,n,r,s):e.controlsUtils.renderSquareControl.call(this,t,i,n,r,s)}}}(i),function(){var t=r.util.object.clone;r.Gradient=r.util.createClass({offsetX:0,offsetY:0,gradientTransform:null,gradientUnits:"pixels",type:"linear",initialize:function(t){t||(t={}),t.coords||(t.coords={});var e,i=this;Object.keys(t).forEach(function(e){i[e]=t[e]}),this.id?this.id+="_"+r.Object.__uid++:this.id=r.Object.__uid++,e={x1:t.coords.x1||0,y1:t.coords.y1||0,x2:t.coords.x2||0,y2:t.coords.y2||0},"radial"===this.type&&(e.r1=t.coords.r1||0,e.r2=t.coords.r2||0),this.coords=e,this.colorStops=t.colorStops.slice()},addColorStop:function(t){for(var e in t){var i=new r.Color(t[e]);this.colorStops.push({offset:parseFloat(e),color:i.toRgb(),opacity:i.getAlpha()})}return this},toObject:function(t){var e={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 r.util.populateWithProperties(this,e,t),e},toSVG:function(e,i){var n,s,o,a,l=t(this.coords,!0),i=i||{},c=t(this.colorStops,!0),h=l.r1>l.r2,u=this.gradientTransform?this.gradientTransform.concat():r.iMatrix.concat(),f=-this.offsetX,d=-this.offsetY,g=!!i.additionalTransform,p="pixels"===this.gradientUnits?"userSpaceOnUse":"objectBoundingBox";if(c.sort(function(t,e){return t.offset-e.offset}),"objectBoundingBox"===p?(f/=e.width,d/=e.height):(f+=e.width/2,d+=e.height/2),"path"===e.type&&"percentage"!==this.gradientUnits&&(f-=e.pathOffset.x,d-=e.pathOffset.y),u[4]-=f,u[5]-=d,a='id="SVGID_'+this.id+'" gradientUnits="'+p+'"'+(' gradientTransform="'+(g?i.additionalTransform+" ":"")+r.util.matrixToSVG(u))+'" ',"linear"===this.type?o=["\n']:"radial"===this.type&&(o=["\n']),"radial"===this.type){if(h)for((c=c.concat()).reverse(),n=0,s=c.length;n0){var y=m/Math.max(l.r1,l.r2);for(n=0,s=c.length;n\n')}return o.push("linear"===this.type?"\n":"\n"),o.join("")},toLive:function(t){var e,i,n,s=r.util.object.clone(this.coords);if(this.type){for("linear"===this.type?e=t.createLinearGradient(s.x1,s.y1,s.x2,s.y2):"radial"===this.type&&(e=t.createRadialGradient(s.x1,s.y1,s.r1,s.x2,s.y2,s.r2)),i=0,n=this.colorStops.length;i1?1:u)&&(u=1);var f,d,g,p,m=t.getElementsByTagName("stop"),y="userSpaceOnUse"===t.getAttribute("gradientUnits")?"pixels":"percentage",b=t.getAttribute("gradientTransform")||"",x=[],_=0,C=0;for("linearGradient"===t.nodeName||"LINEARGRADIENT"===t.nodeName?(f="linear",d={x1:t.getAttribute("x1")||0,y1:t.getAttribute("y1")||0,x2:t.getAttribute("x2")||"100%",y2:t.getAttribute("y2")||0}):(f="radial",d={x1:t.getAttribute("fx")||t.getAttribute("cx")||"50%",y1:t.getAttribute("fy")||t.getAttribute("cy")||"50%",r1:0,x2:t.getAttribute("cx")||"50%",y2:t.getAttribute("cy")||"50%",r2:t.getAttribute("r")||"50%"}),g=m.length;g--;)x.push(function(t,e){var i,n,s,o,a=t.getAttribute("style"),l=t.getAttribute("offset")||0;if(l=(l=parseFloat(l)/(/%$/.test(l)?100:1))<0?0:l>1?1:l,a){var c=a.split(/\s*;\s*/);for(""===c[c.length-1]&&c.pop(),o=c.length;o--;){var h=c[o].split(/\s*:\s*/),u=h[0].trim(),f=h[1].trim();"stop-color"===u?i=f:"stop-opacity"===u&&(s=f)}}return i||(i=t.getAttribute("stop-color")||"rgb(0,0,0)"),s||(s=t.getAttribute("stop-opacity")),n=(i=new r.Color(i)).getAlpha(),s=(isNaN(parseFloat(s))?1:parseFloat(s))*(n*e),{offset:l,color:i.toRgb(),opacity:s}}(m[g],u));return p=r.parseTransformAttribute(b),s=0,o=d,a=n,l=y,Object.keys(o).forEach(function(t){"Infinity"===(c=o[t])?h=1:"-Infinity"===c?h=0:(h=parseFloat(o[t],10),"string"==typeof c&&/^(\d+\.\d+)%|(\d+)%$/.test(c)&&(h*=.01,"pixels"===l&&(("x1"===t||"x2"===t||"r2"===t)&&(h*=a.viewBoxWidth||a.width),("y1"===t||"y2"===t)&&(h*=a.viewBoxHeight||a.height)))),o[t]=h}),"pixels"===y&&(_=-e.left,C=-e.top),new r.Gradient({id:t.getAttribute("id"),type:f,coords:d,colorStops:x,gradientUnits:y,gradientTransform:p,offsetX:_,offsetY:C})}})}(),function(){"use strict";var t=r.util.toFixed;r.Pattern=r.util.createClass({repeat:"repeat",offsetX:0,offsetY:0,crossOrigin:"",patternTransform:null,initialize:function(t,e){if(t||(t={}),this.id=r.Object.__uid++,this.setOptions(t),!t.source||t.source&&"string"!=typeof t.source){e&&e(this);return}var i=this;this.source=r.util.createImage(),r.util.loadImage(t.source,function(t,n){i.source=t,e&&e(i,n)},null,this.crossOrigin)},toObject:function(e){var i,n,s=r.Object.NUM_FRACTION_DIGITS;return"string"==typeof this.source.src?i=this.source.src:"object"==typeof this.source&&this.source.toDataURL&&(i=this.source.toDataURL()),n={type:"pattern",source:i,repeat:this.repeat,crossOrigin:this.crossOrigin,offsetX:t(this.offsetX,s),offsetY:t(this.offsetY,s),patternTransform:this.patternTransform?this.patternTransform.concat():null},r.util.populateWithProperties(this,n,e),n},toSVG:function(t){var e="function"==typeof this.source?this.source():this.source,i=e.width/t.width,n=e.height/t.height,r=this.offsetX/t.width,s=this.offsetY/t.height,o="";return("repeat-x"===this.repeat||"no-repeat"===this.repeat)&&(n=1,s&&(n+=Math.abs(s))),("repeat-y"===this.repeat||"no-repeat"===this.repeat)&&(i=1,r&&(i+=Math.abs(r))),e.src?o=e.src:e.toDataURL&&(o=e.toDataURL()),'\n\n\n'},setOptions:function(t){for(var e in t)this[e]=t[e]},toLive:function(t){var e=this.source;return e&&(void 0===e.src||e.complete&&0!==e.naturalWidth&&0!==e.naturalHeight)?t.createPattern(e,this.repeat):""}})}(),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.util.toFixed;if(e.Shadow)return e.warn("fabric.Shadow is already defined.");e.Shadow=e.util.createClass({color:"rgb(0,0,0)",blur:0,offsetX:0,offsetY:0,affectStroke:!1,includeDefaultValues:!0,nonScaling:!1,initialize:function(t){for(var i in"string"==typeof t&&(t=this._parseShadow(t)),t)this[i]=t[i];this.id=e.Object.__uid++},_parseShadow:function(t){var i=t.trim(),n=e.Shadow.reOffsetsAndBlur.exec(i)||[];return{color:(i.replace(e.Shadow.reOffsetsAndBlur,"")||"rgb(0,0,0)").trim(),offsetX:parseFloat(n[1],10)||0,offsetY:parseFloat(n[2],10)||0,blur:parseFloat(n[3],10)||0}},toString:function(){return[this.offsetX,this.offsetY,this.blur,this.color].join("px ")},toSVG:function(t){var n=40,r=40,s=e.Object.NUM_FRACTION_DIGITS,o=e.util.rotateVector({x:this.offsetX,y:this.offsetY},e.util.degreesToRadians(-t.angle)),a=new e.Color(this.color);return t.width&&t.height&&(n=100*i((Math.abs(o.x)+this.blur)/t.width,s)+20,r=100*i((Math.abs(o.y)+this.blur)/t.height,s)+20),t.flipX&&(o.x*=-1),t.flipY&&(o.y*=-1),'\n \n \n \n \n \n \n \n \n\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 t={},i=e.Shadow.prototype;return["color","blur","offsetX","offsetY","affectStroke","nonScaling"].forEach(function(e){this[e]!==i[e]&&(t[e]=this[e])},this),t}}),e.Shadow.reOffsetsAndBlur=/(?:\s|^)(-?\d+(?:\.\d*)?(?:px)?(?:\s?|$))?(-?\d+(?:\.\d*)?(?:px)?(?:\s?|$))?(\d+(?:\.\d*)?(?:px)?)?(?:\s?|$)(?:$|\s)/}(i),function(){"use strict";if(r.StaticCanvas)return r.warn("fabric.StaticCanvas is already defined.");var t=r.util.object.extend,e=r.util.getElementOffset,i=r.util.removeFromArray,n=r.util.toFixed,s=r.util.transformPoint,o=r.util.invertTransform,a=r.util.getNodeCanvas,l=r.util.createCanvasElement,c=Error("Could not initialize `canvas` element");r.StaticCanvas=r.util.createClass(r.CommonMethods,{initialize:function(t,e){e||(e={}),this.renderAndResetBound=this.renderAndReset.bind(this),this.requestRenderAllBound=this.requestRenderAll.bind(this),this._initStatic(t,e)},backgroundColor:"",backgroundImage:null,overlayColor:"",overlayImage:null,includeDefaultValues:!0,stateful:!1,renderOnAddRemove:!0,controlsAboveOverlay:!1,allowTouchScrolling:!1,imageSmoothingEnabled:!0,viewportTransform:r.iMatrix.concat(),backgroundVpt:!0,overlayVpt:!0,enableRetinaScaling:!0,vptCoords:{},skipOffscreen:!0,clipPath:void 0,_initStatic:function(t,e){var i=this.requestRenderAllBound;this._objects=[],this._createLowerCanvas(t),this._initOptions(e),this.interactive||this._initRetinaScaling(),e.overlayImage&&this.setOverlayImage(e.overlayImage,i),e.backgroundImage&&this.setBackgroundImage(e.backgroundImage,i),e.backgroundColor&&this.setBackgroundColor(e.backgroundColor,i),e.overlayColor&&this.setOverlayColor(e.overlayColor,i),this.calcOffset()},_isRetinaScaling:function(){return r.devicePixelRatio>1&&this.enableRetinaScaling},getRetinaScaling:function(){return this._isRetinaScaling()?Math.max(1,r.devicePixelRatio):1},_initRetinaScaling:function(){if(this._isRetinaScaling()){var t=r.devicePixelRatio;this.__initRetinaScaling(t,this.lowerCanvasEl,this.contextContainer),this.upperCanvasEl&&this.__initRetinaScaling(t,this.upperCanvasEl,this.contextTop)}},__initRetinaScaling:function(t,e,i){e.setAttribute("width",this.width*t),e.setAttribute("height",this.height*t),i.scale(t,t)},calcOffset:function(){return this._offset=e(this.lowerCanvasEl),this},setOverlayImage:function(t,e,i){return this.__setBgOverlayImage("overlayImage",t,e,i)},setBackgroundImage:function(t,e,i){return this.__setBgOverlayImage("backgroundImage",t,e,i)},setOverlayColor:function(t,e){return this.__setBgOverlayColor("overlayColor",t,e)},setBackgroundColor:function(t,e){return this.__setBgOverlayColor("backgroundColor",t,e)},__setBgOverlayImage:function(t,e,i,n){return"string"==typeof e?r.util.loadImage(e,function(e,s){if(e){var o=new r.Image(e,n);this[t]=o,o.canvas=this}i&&i(e,s)},this,n&&n.crossOrigin):(n&&e.setOptions(n),this[t]=e,e&&(e.canvas=this),i&&i(e,!1)),this},__setBgOverlayColor:function(t,e,i){return this[t]=e,this._initGradient(e,t),this._initPattern(e,t,i),this},_createCanvasElement:function(){var t=l();if(!t||(t.style||(t.style={}),void 0===t.getContext))throw c;return t},_initOptions:function(t){var e=this.lowerCanvasEl;this._setOptions(t),this.width=this.width||parseInt(e.width,10)||0,this.height=this.height||parseInt(e.height,10)||0,this.lowerCanvasEl.style&&(e.width=this.width,e.height=this.height,e.style.width=this.width+"px",e.style.height=this.height+"px",this.viewportTransform=this.viewportTransform.slice())},_createLowerCanvas:function(t){t&&t.getContext?this.lowerCanvasEl=t:this.lowerCanvasEl=r.util.getById(t)||this._createCanvasElement(),r.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(t,e){return this.setDimensions({width:t},e)},setHeight:function(t,e){return this.setDimensions({height:t},e)},setDimensions:function(t,e){var i;for(var n in e=e||{},t)i=t[n],e.cssOnly||(this._setBackstoreDimension(n,t[n]),i+="px",this.hasLostContext=!0),e.backstoreOnly||this._setCssDimension(n,i);return this._isCurrentlyDrawing&&this.freeDrawingBrush&&this.freeDrawingBrush._setBrushStyles(this.contextTop),this._initRetinaScaling(),this.calcOffset(),e.cssOnly||this.requestRenderAll(),this},_setBackstoreDimension:function(t,e){return this.lowerCanvasEl[t]=e,this.upperCanvasEl&&(this.upperCanvasEl[t]=e),this.cacheCanvasEl&&(this.cacheCanvasEl[t]=e),this[t]=e,this},_setCssDimension:function(t,e){return this.lowerCanvasEl.style[t]=e,this.upperCanvasEl&&(this.upperCanvasEl.style[t]=e),this.wrapperEl&&(this.wrapperEl.style[t]=e),this},getZoom:function(){return this.viewportTransform[0]},setViewportTransform:function(t){var e,i,n,r=this._activeObject,s=this.backgroundImage,o=this.overlayImage;for(i=0,this.viewportTransform=t,n=this._objects.length;i\n'),this._setSVGBgOverlayColor(i,"background"),this._setSVGBgOverlayImage(i,"backgroundImage",e),this._setSVGObjects(i,e),this.clipPath&&i.push("\n"),this._setSVGBgOverlayColor(i,"overlay"),this._setSVGBgOverlayImage(i,"overlayImage",e),i.push(""),i.join("")},_setSVGPreamble:function(t,e){e.suppressPreamble||t.push('\n','\n')},_setSVGHeader:function(t,e){var i,s=e.width||this.width,o=e.height||this.height,a='viewBox="0 0 '+this.width+" "+this.height+'" ',l=r.Object.NUM_FRACTION_DIGITS;e.viewBox?a='viewBox="'+e.viewBox.x+" "+e.viewBox.y+" "+e.viewBox.width+" "+e.viewBox.height+'" ':this.svgViewportTransformation&&(a='viewBox="'+n(-(i=this.viewportTransform)[4]/i[0],l)+" "+n(-i[5]/i[3],l)+" "+n(this.width/i[0],l)+" "+n(this.height/i[3],l)+'" '),t.push("\n',"Created with Fabric.js ",r.version,"\n","\n",this.createSVGFontFacesMarkup(),this.createSVGRefElementsMarkup(),this.createSVGClipPathMarkup(e),"\n")},createSVGClipPathMarkup:function(t){var e=this.clipPath;return e?(e.clipPathId="CLIPPATH_"+r.Object.__uid++,'\n'+this.clipPath.toClipPathSVG(t.reviver)+"\n"):""},createSVGRefElementsMarkup:function(){var t=this;return["background","overlay"].map(function(e){var i=t[e+"Color"];if(i&&i.toLive){var n=t[e+"Vpt"],s=t.viewportTransform,o={width:t.width/(n?s[0]:1),height:t.height/(n?s[3]:1)};return i.toSVG(o,{additionalTransform:n?r.util.matrixToSVG(s):""})}}).join("")},createSVGFontFacesMarkup:function(){var t,e,i,n,s,o,a,l,c="",h={},u=r.fontPaths,f=[];for(this._objects.forEach(function t(e){f.push(e),e._objects&&e._objects.forEach(t)}),a=0,l=f.length;a\n"),c},_setSVGObjects:function(t,e){var i,n,r,s=this._objects;for(n=0,r=s.length;n\n")}else t.push('\n")},sendToBack:function(t){if(!t)return this;var e,n,r,s=this._activeObject;if(t===s&&"activeSelection"===t.type)for(e=(r=s._objects).length;e--;)n=r[e],i(this._objects,n),this._objects.unshift(n);else i(this._objects,t),this._objects.unshift(t);return this.renderOnAddRemove&&this.requestRenderAll(),this},bringToFront:function(t){if(!t)return this;var e,n,r,s=this._activeObject;if(t===s&&"activeSelection"===t.type)for(e=0,r=s._objects;e0+c&&(o=s-1,i(this._objects,r),this._objects.splice(o,0,r)),c++;else 0!==(s=this._objects.indexOf(t))&&(o=this._findNewLowerIndex(t,s,e),i(this._objects,t),this._objects.splice(o,0,t));return this.renderOnAddRemove&&this.requestRenderAll(),this},_findNewLowerIndex:function(t,e,i){var n,r;if(i){for(n=e,r=e-1;r>=0;--r)if(t.intersectsWithObject(this._objects[r])||t.isContainedWithinObject(this._objects[r])||this._objects[r].isContainedWithinObject(t)){n=r;break}}else n=e-1;return n},bringForward:function(t,e){if(!t)return this;var n,r,s,o,a,l=this._activeObject,c=0;if(t===l&&"activeSelection"===t.type)for(n=(a=l._objects).length;n--;)r=a[n],(s=this._objects.indexOf(r))"}}),t(r.StaticCanvas.prototype,r.Observable),t(r.StaticCanvas.prototype,r.Collection),t(r.StaticCanvas.prototype,r.DataURLExporter),t(r.StaticCanvas,{EMPTY_JSON:'{"objects": [], "background": "white"}',supports:function(t){var e=l();if(!e||!e.getContext)return null;var i=e.getContext("2d");return i&&"setLineDash"===t?void 0!==i.setLineDash:null}}),r.StaticCanvas.prototype.toJSON=r.StaticCanvas.prototype.toObject,r.isLikelyNode&&(r.StaticCanvas.prototype.createPNGStream=function(){var t=a(this.lowerCanvasEl);return t&&t.createPNGStream()},r.StaticCanvas.prototype.createJPEGStream=function(t){var e=a(this.lowerCanvasEl);return e&&e.createJPEGStream(t)})}(),r.BaseBrush=r.util.createClass({color:"rgb(0, 0, 0)",width:1,shadow:null,strokeLineCap:"round",strokeLineJoin:"round",strokeMiterLimit:10,strokeDashArray:null,limitedToCanvasSize:!1,_setBrushStyles:function(t){t.strokeStyle=this.color,t.lineWidth=this.width,t.lineCap=this.strokeLineCap,t.miterLimit=this.strokeMiterLimit,t.lineJoin=this.strokeLineJoin,t.setLineDash(this.strokeDashArray||[])},_saveAndTransform:function(t){var e=this.canvas.viewportTransform;t.save(),t.transform(e[0],e[1],e[2],e[3],e[4],e[5])},_setShadow:function(){if(this.shadow){var t=this.canvas,e=this.shadow,i=t.contextTop,n=t.getZoom();t&&t._isRetinaScaling()&&(n*=r.devicePixelRatio),i.shadowColor=e.color,i.shadowBlur=e.blur*n,i.shadowOffsetX=e.offsetX*n,i.shadowOffsetY=e.offsetY*n}},needsFullRender:function(){return 1>new r.Color(this.color).getAlpha()||!!this.shadow},_resetShadow:function(){var t=this.canvas.contextTop;t.shadowColor="",t.shadowBlur=t.shadowOffsetX=t.shadowOffsetY=0},_isOutSideCanvas:function(t){return t.x<0||t.x>this.canvas.getWidth()||t.y<0||t.y>this.canvas.getHeight()}}),r.PencilBrush=r.util.createClass(r.BaseBrush,{decimate:.4,drawStraightLine:!1,straightLineKey:"shiftKey",initialize:function(t){this.canvas=t,this._points=[]},needsFullRender:function(){return this.callSuper("needsFullRender")||this._hasStraightLine},_drawSegment:function(t,e,i){var n=e.midPointFrom(i);return t.quadraticCurveTo(e.x,e.y,n.x,n.y),n},onMouseDown:function(t,e){this.canvas._isMainEvent(e.e)&&(this.drawStraightLine=e.e[this.straightLineKey],this._prepareForDrawing(t),this._captureDrawingPath(t),this._render())},onMouseMove:function(t,e){if(this.canvas._isMainEvent(e.e)&&(this.drawStraightLine=e.e[this.straightLineKey],!(!0===this.limitedToCanvasSize&&this._isOutSideCanvas(t))&&this._captureDrawingPath(t)&&this._points.length>1))if(this.needsFullRender())this.canvas.clearContext(this.canvas.contextTop),this._render();else{var i=this._points,n=i.length,r=this.canvas.contextTop;this._saveAndTransform(r),this.oldEnd&&(r.beginPath(),r.moveTo(this.oldEnd.x,this.oldEnd.y)),this.oldEnd=this._drawSegment(r,i[n-2],i[n-1],!0),r.stroke(),r.restore()}},onMouseUp:function(t){return!this.canvas._isMainEvent(t.e)||(this.drawStraightLine=!1,this.oldEnd=void 0,this._finalizeAndAddPath(),!1)},_prepareForDrawing:function(t){var e=new r.Point(t.x,t.y);this._reset(),this._addPoint(e),this.canvas.contextTop.moveTo(e.x,e.y)},_addPoint:function(t){return!(this._points.length>1&&t.eq(this._points[this._points.length-1]))&&(this.drawStraightLine&&this._points.length>1&&(this._hasStraightLine=!0,this._points.pop()),this._points.push(t),!0)},_reset:function(){this._points=[],this._setBrushStyles(this.canvas.contextTop),this._setShadow(),this._hasStraightLine=!1},_captureDrawingPath:function(t){var e=new r.Point(t.x,t.y);return this._addPoint(e)},_render:function(t){var e,i,n=this._points[0],s=this._points[1];if(t=t||this.canvas.contextTop,this._saveAndTransform(t),t.beginPath(),2===this._points.length&&n.x===s.x&&n.y===s.y){var o=this.width/1e3;n=new r.Point(n.x,n.y),s=new r.Point(s.x,s.y),n.x-=o,s.x+=o}for(t.moveTo(n.x,n.y),e=1,i=this._points.length;e=n&&o.push(s=t[i]);return o.push(t[r]),o},_finalizeAndAddPath:function(){this.canvas.contextTop.closePath(),this.decimate&&(this._points=this.decimatePoints(this._points,this.decimate));var t=this.convertPointsToSVGPath(this._points);if(this._isEmptySVGPath(t))return void this.canvas.requestRenderAll();var e=this.createPath(t);this.canvas.clearContext(this.canvas.contextTop),this.canvas.fire("before:path:created",{path:e}),this.canvas.add(e),this.canvas.requestRenderAll(),e.setCoords(),this._resetShadow(),this.canvas.fire("path:created",{path:e})}}),r.CircleBrush=r.util.createClass(r.BaseBrush,{width:10,initialize:function(t){this.canvas=t,this.points=[]},drawDot:function(t){var e=this.addPoint(t),i=this.canvas.contextTop;this._saveAndTransform(i),this.dot(i,e),i.restore()},dot:function(t,e){t.fillStyle=e.fill,t.beginPath(),t.arc(e.x,e.y,e.radius,0,2*Math.PI,!1),t.closePath(),t.fill()},onMouseDown:function(t){this.points.length=0,this.canvas.clearContext(this.canvas.contextTop),this._setShadow(),this.drawDot(t)},_render:function(){var t,e,i=this.canvas.contextTop,n=this.points;for(this._saveAndTransform(i),t=0,e=n.length;t0&&!this.preserveObjectStacking){e=[],i=[];for(var r=0,s=this._objects.length;r1&&(this._activeObject._objects=i),e.push.apply(e,i)}else e=this._objects;return e},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 t=this.contextContainer;return this.renderCanvas(t,this._chooseObjectsToRender()),this},renderTopLayer:function(t){t.save(),this.isDrawingMode&&this._isCurrentlyDrawing&&(this.freeDrawingBrush&&this.freeDrawingBrush._render(),this.contextTopDirty=!0),this.selection&&this._groupSelector&&(this._drawSelection(t),this.contextTopDirty=!0),t.restore()},renderTop:function(){var t=this.contextTop;return this.clearContext(t),this.renderTopLayer(t),this.fire("after:render"),this},_normalizePointer:function(t,e){var i=t.calcTransformMatrix(),n=r.util.invertTransform(i),s=this.restorePointerVpt(e);return r.util.transformPoint(s,n)},isTargetTransparent:function(t,e,i){if(t.shouldCache()&&t._cacheCanvas&&t!==this._activeObject){var n=this._normalizePointer(t,{x:e,y:i}),s=Math.max(t.cacheTranslationX+n.x*t.zoomX,0),o=Math.max(t.cacheTranslationY+n.y*t.zoomY,0),a=r.util.isTransparent(t._cacheContext,Math.round(s),Math.round(o),this.targetFindTolerance);return a}var l=this.contextCache,c=t.selectionBackgroundColor,h=this.viewportTransform;t.selectionBackgroundColor="",this.clearContext(l),l.save(),l.transform(h[0],h[1],h[2],h[3],h[4],h[5]),t.render(l),l.restore(),t.selectionBackgroundColor=c;var a=r.util.isTransparent(l,e,i,this.targetFindTolerance);return a},_isSelectionKeyPressed:function(t){return Array.isArray(this.selectionKey)?!!this.selectionKey.find(function(e){return!0===t[e]}):t[this.selectionKey]},_shouldClearSelection:function(t,e){var i=this.getActiveObjects(),n=this._activeObject;return!e||e&&n&&i.length>1&&-1===i.indexOf(e)&&n!==e&&!this._isSelectionKeyPressed(t)||e&&!e.evented||e&&!e.selectable&&n&&n!==e},_shouldCenterTransform:function(t,e,i){var n;if(t)return"scale"===e||"scaleX"===e||"scaleY"===e||"resizing"===e?n=this.centeredScaling||t.centeredScaling:"rotate"===e&&(n=this.centeredRotation||t.centeredRotation),n?!i:i},_getOriginFromCorner:function(t,e){var i={x:t.originX,y:t.originY};return"ml"===e||"tl"===e||"bl"===e?i.x="right":("mr"===e||"tr"===e||"br"===e)&&(i.x="left"),"tl"===e||"mt"===e||"tr"===e?i.y="bottom":("bl"===e||"mb"===e||"br"===e)&&(i.y="top"),i},_getActionFromCorner:function(t,e,i,n){if(!e||!t)return"drag";var r=n.controls[e];return r.getActionName(i,r,n)},_setupCurrentTransform:function(t,i,n){if(i){var s=this.getPointer(t),o=i.__corner,a=i.controls[o],l=n&&o?a.getActionHandler(t,i,a):r.controlsUtils.dragHandler,c=this._getActionFromCorner(n,o,t,i),h=this._getOriginFromCorner(i,o),u=t[this.centeredKey],f={target:i,action:c,actionHandler:l,corner:o,scaleX:i.scaleX,scaleY:i.scaleY,skewX:i.skewX,skewY:i.skewY,offsetX:s.x-i.left,offsetY:s.y-i.top,originX:h.x,originY:h.y,ex:s.x,ey:s.y,lastX:s.x,lastY:s.y,theta:e(i.angle),width:i.width*i.scaleX,shiftKey:t.shiftKey,altKey:u,original:r.util.saveObjectTransform(i)};this._shouldCenterTransform(i,c,u)&&(f.originX="center",f.originY="center"),f.original.originX=h.x,f.original.originY=h.y,this._currentTransform=f,this._beforeTransform(t)}},setCursor:function(t){this.upperCanvasEl.style.cursor=t},_drawSelection:function(t){var e=this._groupSelector,i=new r.Point(e.ex,e.ey),n=r.util.transformPoint(i,this.viewportTransform),s=new r.Point(e.ex+e.left,e.ey+e.top),o=r.util.transformPoint(s,this.viewportTransform),a=Math.min(n.x,o.x),l=Math.min(n.y,o.y),c=Math.max(n.x,o.x),h=Math.max(n.y,o.y),u=this.selectionLineWidth/2;this.selectionColor&&(t.fillStyle=this.selectionColor,t.fillRect(a,l,c-a,h-l)),this.selectionLineWidth&&this.selectionBorderColor&&(t.lineWidth=this.selectionLineWidth,t.strokeStyle=this.selectionBorderColor,a+=u,l+=u,c-=u,h-=u,r.Object.prototype._setLineDash.call(this,t,this.selectionDashArray),t.strokeRect(a,l,c-a,h-l))},findTarget:function(t,e){if(!this.skipTargetFind){var n,r,s=this.getPointer(t,!0),o=this._activeObject,a=this.getActiveObjects(),l=i(t),c=a.length>1&&!e||1===a.length;if(this.targets=[],c&&o._findTargetCorner(s,l)||a.length>1&&!e&&o===this._searchPossibleTargets([o],s))return o;if(1===a.length&&o===this._searchPossibleTargets([o],s))if(!this.preserveObjectStacking)return o;else n=o,r=this.targets,this.targets=[];var h=this._searchPossibleTargets(this._objects,s);return t[this.altSelectionKey]&&h&&n&&h!==n&&(h=n,this.targets=r),h}},_checkTarget:function(t,e,i){if(e&&e.visible&&e.evented&&e.containsPoint(t)){if(!this.perPixelTargetFind&&!e.perPixelTargetFind||e.isEditing)return!0;else if(!this.isTargetTransparent(e,i.x,i.y))return!0}},_searchPossibleTargets:function(t,e){for(var i,n,s=t.length;s--;){var o=t[s],a=o.group?this._normalizePointer(o.group,e):e;if(this._checkTarget(a,o,e)){(i=t[s]).subTargetCheck&&i instanceof r.Group&&(n=this._searchPossibleTargets(i._objects,e))&&this.targets.push(n);break}}return i},restorePointerVpt:function(t){return r.util.transformPoint(t,r.util.invertTransform(this.viewportTransform))},getPointer:function(e,i){if(this._absolutePointer&&!i)return this._absolutePointer;if(this._pointer&&i)return this._pointer;var n,r=t(e),s=this.upperCanvasEl,o=s.getBoundingClientRect(),a=o.width||0,l=o.height||0;(!a||!l)&&("top"in o&&"bottom"in o&&(l=Math.abs(o.top-o.bottom)),"right"in o&&"left"in o&&(a=Math.abs(o.right-o.left))),this.calcOffset(),r.x=r.x-this._offset.left,r.y=r.y-this._offset.top,i||(r=this.restorePointerVpt(r));var c=this.getRetinaScaling();return 1!==c&&(r.x/=c,r.y/=c),n=0===a||0===l?{width:1,height:1}:{width:s.width/a,height:s.height/l},{x:r.x*n.width,y:r.y*n.height}},_createUpperCanvas:function(){var t=this.lowerCanvasEl.className.replace(/\s*lower-canvas\s*/,""),e=this.lowerCanvasEl,i=this.upperCanvasEl;i?i.className="":(i=this._createCanvasElement(),this.upperCanvasEl=i),r.util.addClass(i,"upper-canvas "+t),this.wrapperEl.appendChild(i),this._copyCanvasStyle(e,i),this._applyCanvasStyle(i),this.contextTop=i.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=r.util.wrapElement(this.lowerCanvasEl,"div",{class:this.containerClass}),r.util.setStyle(this.wrapperEl,{width:this.width+"px",height:this.height+"px",position:"relative"}),r.util.makeElementUnselectable(this.wrapperEl)},_applyCanvasStyle:function(t){var e=this.width||t.width,i=this.height||t.height;r.util.setStyle(t,{position:"absolute",width:e+"px",height:i+"px",left:0,top:0,"touch-action":this.allowTouchScrolling?"manipulation":"none","-ms-touch-action":this.allowTouchScrolling?"manipulation":"none"}),t.width=e,t.height=i,r.util.makeElementUnselectable(t)},_copyCanvasStyle:function(t,e){e.style.cssText=t.style.cssText},getSelectionContext:function(){return this.contextTop},getSelectionElement:function(){return this.upperCanvasEl},getActiveObject:function(){return this._activeObject},getActiveObjects:function(){var t=this._activeObject;if(t)if("activeSelection"===t.type&&t._objects)return t._objects.slice(0);else return[t];return[]},_onObjectRemoved:function(t){t===this._activeObject&&(this.fire("before:selection:cleared",{target:t}),this._discardActiveObject(),this.fire("selection:cleared",{target:t}),t.fire("deselected")),t===this._hoveredTarget&&(this._hoveredTarget=null,this._hoveredTargets=[]),this.callSuper("_onObjectRemoved",t)},_fireSelectionEvents:function(t,e){var i=!1,n=this.getActiveObjects(),r=[],s=[];t.forEach(function(t){-1===n.indexOf(t)&&(i=!0,t.fire("deselected",{e:e,target:t}),s.push(t))}),n.forEach(function(n){-1===t.indexOf(n)&&(i=!0,n.fire("selected",{e:e,target:n}),r.push(n))}),t.length>0&&n.length>0?i&&this.fire("selection:updated",{e:e,selected:r,deselected:s}):n.length>0?this.fire("selection:created",{e:e,selected:r}):t.length>0&&this.fire("selection:cleared",{e:e,deselected:s})},setActiveObject:function(t,e){var i=this.getActiveObjects();return this._setActiveObject(t,e),this._fireSelectionEvents(i,e),this},_setActiveObject:function(t,e){return!(this._activeObject===t||!this._discardActiveObject(e,t)||t.onSelect({e:e}))&&(this._activeObject=t,!0)},_discardActiveObject:function(t,e){var i=this._activeObject;if(i){if(i.onDeselect({e:t,object:e}))return!1;this._activeObject=null}return!0},discardActiveObject:function(t){var e=this.getActiveObjects(),i=this.getActiveObject();return e.length&&this.fire("before:selection:cleared",{target:i,e:t}),this._discardActiveObject(t),this._fireSelectionEvents(e,t),this},dispose:function(){var t=this.wrapperEl;return this.removeListeners(),t.removeChild(this.upperCanvasEl),t.removeChild(this.lowerCanvasEl),this.contextCache=null,this.contextTop=null,["upperCanvasEl","cacheCanvasEl"].forEach((function(t){r.util.cleanUpJsdomNode(this[t]),this[t]=void 0}).bind(this)),t.parentNode&&t.parentNode.replaceChild(this.lowerCanvasEl,this.wrapperEl),delete this.wrapperEl,r.StaticCanvas.prototype.dispose.call(this),this},clear:function(){return this.discardActiveObject(),this.clearContext(this.contextTop),this.callSuper("clear")},drawControls:function(t){var e=this._activeObject;e&&e._renderControls(t)},_toObject:function(t,e,i){var n=this._realizeGroupTransformOnObject(t),r=this.callSuper("_toObject",t,e,i);return this._unwindGroupTransformOnObject(t,n),r},_realizeGroupTransformOnObject:function(t){if(!t.group||"activeSelection"!==t.group.type||this._activeObject!==t.group)return null;var e={};return["angle","flipX","flipY","left","scaleX","scaleY","skewX","skewY","top"].forEach(function(i){e[i]=t[i]}),r.util.addTransformToObject(t,this._activeObject.calcOwnMatrix()),e},_unwindGroupTransformOnObject:function(t,e){e&&t.set(e)},_setSVGObject:function(t,e,i){var n=this._realizeGroupTransformOnObject(e);this.callSuper("_setSVGObject",t,e,i),this._unwindGroupTransformOnObject(e,n)},setViewportTransform:function(t){this.renderOnAddRemove&&this._activeObject&&this._activeObject.isEditing&&this._activeObject.clearContextTop(),r.StaticCanvas.prototype.setViewportTransform.call(this,t)}}),r.StaticCanvas)"prototype"!==n&&(r.Canvas[n]=r.StaticCanvas[n])}(),function(){var t=r.util.addListener,e=r.util.removeListener,i={passive:!1};function n(t,e){return t.button&&t.button===e-1}r.util.object.extend(r.Canvas.prototype,{mainTouchId:null,_initEventListeners:function(){this.removeListeners(),this._bindEvents(),this.addOrRemove(t,"add")},_getEventPrefix:function(){return this.enablePointerEvents?"pointer":"mouse"},addOrRemove:function(t,e){var n=this.upperCanvasEl,s=this._getEventPrefix();t(r.window,"resize",this._onResize),t(n,s+"down",this._onMouseDown),t(n,s+"move",this._onMouseMove,i),t(n,s+"out",this._onMouseOut),t(n,s+"enter",this._onMouseEnter),t(n,"wheel",this._onMouseWheel),t(n,"contextmenu",this._onContextMenu),t(n,"dblclick",this._onDoubleClick),t(n,"dragover",this._onDragOver),t(n,"dragenter",this._onDragEnter),t(n,"dragleave",this._onDragLeave),t(n,"drop",this._onDrop),this.enablePointerEvents||t(n,"touchstart",this._onTouchStart,i),"undefined"!=typeof eventjs&&e in eventjs&&(eventjs[e](n,"gesture",this._onGesture),eventjs[e](n,"drag",this._onDrag),eventjs[e](n,"orientation",this._onOrientationChange),eventjs[e](n,"shake",this._onShake),eventjs[e](n,"longpress",this._onLongPress))},removeListeners:function(){this.addOrRemove(e,"remove");var t=this._getEventPrefix();e(r.document,t+"up",this._onMouseUp),e(r.document,"touchend",this._onTouchEnd,i),e(r.document,t+"move",this._onMouseMove,i),e(r.document,"touchmove",this._onMouseMove,i)},_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(t,e){this.__onTransformGesture&&this.__onTransformGesture(t,e)},_onDrag:function(t,e){this.__onDrag&&this.__onDrag(t,e)},_onMouseWheel:function(t){this.__onMouseWheel(t)},_onMouseOut:function(t){var e=this._hoveredTarget;this.fire("mouse:out",{target:e,e:t}),this._hoveredTarget=null,e&&e.fire("mouseout",{e:t});var i=this;this._hoveredTargets.forEach(function(e){i.fire("mouse:out",{target:e,e:t}),e&&e.fire("mouseout",{e:t})}),this._hoveredTargets=[]},_onMouseEnter:function(t){this._currentTransform||this.findTarget(t)||(this.fire("mouse:over",{target:null,e:t}),this._hoveredTarget=null,this._hoveredTargets=[])},_onOrientationChange:function(t,e){this.__onOrientationChange&&this.__onOrientationChange(t,e)},_onShake:function(t,e){this.__onShake&&this.__onShake(t,e)},_onLongPress:function(t,e){this.__onLongPress&&this.__onLongPress(t,e)},_onDragOver:function(t){t.preventDefault();var e=this._simpleEventHandler("dragover",t);this._fireEnterLeaveEvents(e,t)},_onDrop:function(t){return this._simpleEventHandler("drop:before",t),this._simpleEventHandler("drop",t)},_onContextMenu:function(t){return this.stopContextMenu&&(t.stopPropagation(),t.preventDefault()),!1},_onDoubleClick:function(t){this._cacheTransformEventData(t),this._handleEvent(t,"dblclick"),this._resetTransformEventData(t)},getPointerId:function(t){var e=t.changedTouches;return e?e[0]&&e[0].identifier:this.enablePointerEvents?t.pointerId:-1},_isMainEvent:function(t){return!0===t.isPrimary||!1!==t.isPrimary&&("touchend"===t.type&&0===t.touches.length||!t.changedTouches||t.changedTouches[0].identifier===this.mainTouchId)},_onTouchStart:function(n){n.preventDefault(),null===this.mainTouchId&&(this.mainTouchId=this.getPointerId(n)),this.__onMouseDown(n),this._resetTransformEventData();var s=this.upperCanvasEl,o=this._getEventPrefix();t(r.document,"touchend",this._onTouchEnd,i),t(r.document,"touchmove",this._onMouseMove,i),e(s,o+"down",this._onMouseDown)},_onMouseDown:function(n){this.__onMouseDown(n),this._resetTransformEventData();var s=this.upperCanvasEl,o=this._getEventPrefix();e(s,o+"move",this._onMouseMove,i),t(r.document,o+"up",this._onMouseUp),t(r.document,o+"move",this._onMouseMove,i)},_onTouchEnd:function(n){if(!(n.touches.length>0)){this.__onMouseUp(n),this._resetTransformEventData(),this.mainTouchId=null;var s=this._getEventPrefix();e(r.document,"touchend",this._onTouchEnd,i),e(r.document,"touchmove",this._onMouseMove,i);var o=this;this._willAddMouseDown&&clearTimeout(this._willAddMouseDown),this._willAddMouseDown=setTimeout(function(){t(o.upperCanvasEl,s+"down",o._onMouseDown),o._willAddMouseDown=0},400)}},_onMouseUp:function(n){this.__onMouseUp(n),this._resetTransformEventData();var s=this.upperCanvasEl,o=this._getEventPrefix();this._isMainEvent(n)&&(e(r.document,o+"up",this._onMouseUp),e(r.document,o+"move",this._onMouseMove,i),t(s,o+"move",this._onMouseMove,i))},_onMouseMove:function(t){!this.allowTouchScrolling&&t.preventDefault&&t.preventDefault(),this.__onMouseMove(t)},_onResize:function(){this.calcOffset()},_shouldRender:function(t){var e=this._activeObject;return!!e!=!!t||!!e&&!!t&&e!==t||(e&&e.isEditing,!1)},__onMouseUp:function(t){var e,i,s,o=this._currentTransform,a=this._groupSelector,l=!1,c=!a||0===a.left&&0===a.top;if(this._cacheTransformEventData(t),s=this._target,this._handleEvent(t,"up:before"),n(t,3)){this.fireRightClick&&this._handleEvent(t,"up",3,c);return}if(n(t,2)){this.fireMiddleClick&&this._handleEvent(t,"up",2,c),this._resetTransformEventData();return}if(this.isDrawingMode&&this._isCurrentlyDrawing)return void this._onMouseUpInDrawingMode(t);if(this._isMainEvent(t)){if(o&&(this._finalizeCurrentTransform(t),l=o.actionPerformed),!c){var h=s===this._activeObject;this._maybeGroupObjects(t),l||(l=this._shouldRender(s)||!h&&s===this._activeObject)}if(s){if(e=s._findTargetCorner(this.getPointer(t,!0),r.util.isTouchEvent(t)),s.selectable&&s!==this._activeObject&&"up"===s.activeOn)this.setActiveObject(s,t),l=!0;else{var u=s.controls[e],f=u&&u.getMouseUpHandler(t,s,u);f&&(i=this.getPointer(t),f(t,o,i.x,i.y))}s.isMoving=!1}if(o&&(o.target!==s||o.corner!==e)){var d=o.target&&o.target.controls[o.corner],g=d&&d.getMouseUpHandler(t,s,u);i=i||this.getPointer(t),g&&g(t,o,i.x,i.y)}this._setCursorFromEvent(t,s),this._handleEvent(t,"up",1,c),this._groupSelector=null,this._currentTransform=null,s&&(s.__corner=0),l?this.requestRenderAll():c||this.renderTop()}},_simpleEventHandler:function(t,e){var i=this.findTarget(e),n=this.targets,r={e:e,target:i,subTargets:n};if(this.fire(t,r),i&&i.fire(t,r),!n)return i;for(var s=0;s1&&(e=new r.ActiveSelection(i.reverse(),{canvas:this}),this.setActiveObject(e,t))},_collectObjects:function(i){for(var n,s=[],o=this._groupSelector.ex,a=this._groupSelector.ey,l=o+this._groupSelector.left,c=a+this._groupSelector.top,h=new r.Point(t(o,l),t(a,c)),u=new r.Point(e(o,l),e(a,c)),f=!this.selectionFullyContained,d=o===l&&a===c,g=this._objects.length;g--&&!((n=this._objects[g])&&n.selectable&&n.visible&&(f&&n.intersectsWithRect(h,u,!0)||n.isContainedWithinRect(h,u,!0)||f&&n.containsPoint(h,null,!0)||f&&n.containsPoint(u,null,!0))&&(s.push(n),d)););return s.length>1&&(s=s.filter(function(t){return!t.onSelect({e:i})})),s},_maybeGroupObjects:function(t){this.selection&&this._groupSelector&&this._groupSelectedObjects(t),this.setCursor(this.defaultCursor),this._groupSelector=null}})}(),r.util.object.extend(r.StaticCanvas.prototype,{toDataURL:function(t){t||(t={});var e=t.format||"png",i=t.quality||1,n=(t.multiplier||1)*(t.enableRetinaScaling?this.getRetinaScaling():1),s=this.toCanvasElement(n,t);return r.util.toDataURL(s,e,i)},toCanvasElement:function(t,e){t=t||1;var i=((e=e||{}).width||this.width)*t,n=(e.height||this.height)*t,s=this.getZoom(),o=this.width,a=this.height,l=s*t,c=this.viewportTransform,h=(c[4]-(e.left||0))*t,u=(c[5]-(e.top||0))*t,f=this.interactive,d=this.enableRetinaScaling,g=r.util.createCanvasElement(),p=this.contextTop;return g.width=i,g.height=n,this.contextTop=null,this.enableRetinaScaling=!1,this.interactive=!1,this.viewportTransform=[l,0,0,l,h,u],this.width=i,this.height=n,this.calcViewportBoundaries(),this.renderCanvas(g.getContext("2d"),this._objects),this.viewportTransform=c,this.width=o,this.height=a,this.calcViewportBoundaries(),this.interactive=f,this.enableRetinaScaling=d,this.contextTop=p,g}}),r.util.object.extend(r.StaticCanvas.prototype,{loadFromJSON:function(t,e,i){if(t){var n="string"==typeof t?JSON.parse(t):r.util.object.clone(t),s=this,o=n.clipPath,a=this.renderOnAddRemove;return this.renderOnAddRemove=!1,delete n.clipPath,this._enlivenObjects(n.objects,function(t){s.clear(),s._setBgOverlay(n,function(){o?s._enlivenObjects([o],function(i){s.clipPath=i[0],s.__setupCanvas.call(s,n,t,a,e)}):s.__setupCanvas.call(s,n,t,a,e)})},i),this}},__setupCanvas:function(t,e,i,n){var r=this;e.forEach(function(t,e){r.insertAt(t,e)}),this.renderOnAddRemove=i,delete t.objects,delete t.backgroundImage,delete t.overlayImage,delete t.background,delete t.overlay,this._setOptions(t),this.renderAll(),n&&n()},_setBgOverlay:function(t,e){var i={backgroundColor:!1,overlayColor:!1,backgroundImage:!1,overlayImage:!1};if(!t.backgroundImage&&!t.overlayImage&&!t.background&&!t.overlay){e&&e();return}var n=function(){i.backgroundImage&&i.overlayImage&&i.backgroundColor&&i.overlayColor&&e&&e()};this.__setBgOverlay("backgroundImage",t.backgroundImage,i,n),this.__setBgOverlay("overlayImage",t.overlayImage,i,n),this.__setBgOverlay("backgroundColor",t.background,i,n),this.__setBgOverlay("overlayColor",t.overlay,i,n)},__setBgOverlay:function(t,e,i,n){var s=this;if(!e){i[t]=!0,n&&n();return}"backgroundImage"===t||"overlayImage"===t?r.util.enlivenObjects([e],function(e){s[t]=e[0],i[t]=!0,n&&n()}):this["set"+r.util.string.capitalize(t,!0)](e,function(){i[t]=!0,n&&n()})},_enlivenObjects:function(t,e,i){if(!t||0===t.length){e&&e([]);return}r.util.enlivenObjects(t,function(t){e&&e(t)},null,i)},_toDataURL:function(t,e){this.clone(function(i){e(i.toDataURL(t))})},_toDataURLWithMultiplier:function(t,e,i){this.clone(function(n){i(n.toDataURLWithMultiplier(t,e))})},clone:function(t,e){var i=JSON.stringify(this.toJSON(e));this.cloneWithoutData(function(e){e.loadFromJSON(i,function(){t&&t(e)})})},cloneWithoutData:function(t){var e=r.util.createCanvasElement();e.width=this.width,e.height=this.height;var i=new r.Canvas(e);this.backgroundImage?(i.setBackgroundImage(this.backgroundImage.src,function(){i.renderAll(),t&&t(i)}),i.backgroundImageOpacity=this.backgroundImageOpacity,i.backgroundImageStretch=this.backgroundImageStretch):t&&t(i)}}),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.util.object.extend,n=e.util.object.clone,r=e.util.toFixed,s=e.util.string.capitalize,o=e.util.degreesToRadians,a=!e.isLikelyNode;e.Object||(e.Object=e.util.createClass(e.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:a,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(t){t&&this.setOptions(t)},_createCacheCanvas:function(){this._cacheProperties={},this._cacheCanvas=e.util.createCanvasElement(),this._cacheContext=this._cacheCanvas.getContext("2d"),this._updateCacheCanvas(),this.dirty=!0},_limitCacheSize:function(t){var i=e.perfLimitSizeTotal,n=t.width,r=t.height,s=e.maxCacheSideLimit,o=e.minCacheSideLimit;if(n<=s&&r<=s&&n*r<=i)return nc&&(t.zoomX/=n/c,t.width=c,t.capped=!0),r>h&&(t.zoomY/=r/h,t.height=h,t.capped=!0),t},_getCacheCanvasDimensions:function(){var t=this.getTotalObjectScaling(),e=this._getTransformedDimensions(0,0),i=e.x*t.scaleX/this.scaleX,n=e.y*t.scaleY/this.scaleY;return{width:Math.ceil(i+2),height:Math.ceil(n+2),zoomX:t.scaleX,zoomY:t.scaleY,x:i,y:n}},_updateCacheCanvas:function(){var t=this.canvas;if(this.noScaleCache&&t&&t._currentTransform){var e=t._currentTransform.target,i=t._currentTransform.action;if(this===e&&i.slice&&"scale"===i.slice(0,5))return!1}var n,r,s=this._cacheCanvas,o=this._limitCacheSize(this._getCacheCanvasDimensions()),a=o.width,l=o.height,c=o.zoomX,h=o.zoomY,u=a!==this.cacheWidth||l!==this.cacheHeight,f=this.zoomX!==c||this.zoomY!==h;return(!!u||!!f)&&(u?(s.width=a,s.height=l):(this._cacheContext.setTransform(1,0,0,1,0,0),this._cacheContext.clearRect(0,0,s.width,s.height)),n=o.x/2,r=o.y/2,this.cacheTranslationX=Math.round(s.width/2-n)+n,this.cacheTranslationY=Math.round(s.height/2-r)+r,this.cacheWidth=a,this.cacheHeight=l,this._cacheContext.translate(this.cacheTranslationX,this.cacheTranslationY),this._cacheContext.scale(c,h),this.zoomX=c,this.zoomY=h,!0)},setOptions:function(t){this._setOptions(t),this._initGradient(t.fill,"fill"),this._initGradient(t.stroke,"stroke"),this._initPattern(t.fill,"fill"),this._initPattern(t.stroke,"stroke")},transform:function(t){var e=this.group&&!this.group._transformDone||this.group&&this.canvas&&t===this.canvas.contextTop,i=this.calcTransformMatrix(!e);t.transform(i[0],i[1],i[2],i[3],i[4],i[5])},toObject:function(t){var i=e.Object.NUM_FRACTION_DIGITS,n={type:this.type,version:e.version,originX:this.originX,originY:this.originY,left:r(this.left,i),top:r(this.top,i),width:r(this.width,i),height:r(this.height,i),fill:this.fill&&this.fill.toObject?this.fill.toObject():this.fill,stroke:this.stroke&&this.stroke.toObject?this.stroke.toObject():this.stroke,strokeWidth:r(this.strokeWidth,i),strokeDashArray:this.strokeDashArray?this.strokeDashArray.concat():this.strokeDashArray,strokeLineCap:this.strokeLineCap,strokeDashOffset:this.strokeDashOffset,strokeLineJoin:this.strokeLineJoin,strokeUniform:this.strokeUniform,strokeMiterLimit:r(this.strokeMiterLimit,i),scaleX:r(this.scaleX,i),scaleY:r(this.scaleY,i),angle:r(this.angle,i),flipX:this.flipX,flipY:this.flipY,opacity:r(this.opacity,i),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:r(this.skewX,i),skewY:r(this.skewY,i)};return this.clipPath&&!this.clipPath.excludeFromExport&&(n.clipPath=this.clipPath.toObject(t),n.clipPath.inverted=this.clipPath.inverted,n.clipPath.absolutePositioned=this.clipPath.absolutePositioned),e.util.populateWithProperties(this,n,t),this.includeDefaultValues||(n=this._removeDefaultValues(n)),n},toDatalessObject:function(t){return this.toObject(t)},_removeDefaultValues:function(t){var i=e.util.getKlass(t.type).prototype;return i.stateProperties.forEach(function(e){"left"!==e&&"top"!==e&&(t[e]===i[e]&&delete t[e],Array.isArray(t[e])&&Array.isArray(i[e])&&0===t[e].length&&0===i[e].length&&delete t[e])}),t},toString:function(){return"#"},getObjectScaling:function(){if(!this.group)return{scaleX:this.scaleX,scaleY:this.scaleY};var t=e.util.qrDecompose(this.calcTransformMatrix());return{scaleX:Math.abs(t.scaleX),scaleY:Math.abs(t.scaleY)}},getTotalObjectScaling:function(){var t=this.getObjectScaling(),e=t.scaleX,i=t.scaleY;if(this.canvas){var n=this.canvas.getZoom(),r=this.canvas.getRetinaScaling();e*=n*r,i*=n*r}return{scaleX:e,scaleY:i}},getObjectOpacity:function(){var t=this.opacity;return this.group&&(t*=this.group.getObjectOpacity()),t},_set:function(t,i){var n="scaleX"===t||"scaleY"===t,r=this[t]!==i,s=!1;return n&&(i=this._constrainScale(i)),"scaleX"===t&&i<0?(this.flipX=!this.flipX,i*=-1):"scaleY"===t&&i<0?(this.flipY=!this.flipY,i*=-1):"shadow"!==t||!i||i instanceof e.Shadow?"dirty"===t&&this.group&&this.group.set("dirty",i):i=new e.Shadow(i),this[t]=i,r&&(s=this.group&&this.group.isOnACache(),this.cacheProperties.indexOf(t)>-1?(this.dirty=!0,s&&this.group.set("dirty",!0)):s&&this.stateProperties.indexOf(t)>-1&&this.group.set("dirty",!0)),this},setOnGroup:function(){},getViewportTransform:function(){return this.canvas&&this.canvas.viewportTransform?this.canvas.viewportTransform:e.iMatrix.concat()},isNotVisible:function(){return 0===this.opacity||!this.width&&!this.height&&0===this.strokeWidth||!this.visible},render:function(t){!this.isNotVisible()&&(!this.canvas||!this.canvas.skipOffscreen||this.group||this.isOnScreen())&&(t.save(),this._setupCompositeOperation(t),this.drawSelectionBackground(t),this.transform(t),this._setOpacity(t),this._setShadow(t,this),this.shouldCache()?(this.renderCache(),this.drawCacheOnCanvas(t)):(this._removeCacheCanvas(),this.dirty=!1,this.drawObject(t),this.objectCaching&&this.statefullCache&&this.saveState({propertySet:"cacheProperties"})),t.restore())},renderCache:function(t){t=t||{},this._cacheCanvas&&this._cacheContext||this._createCacheCanvas(),this.isCacheDirty()&&(this.statefullCache&&this.saveState({propertySet:"cacheProperties"}),this.drawObject(this._cacheContext,t.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(t,i){if(t.save(),i.inverted?t.globalCompositeOperation="destination-out":t.globalCompositeOperation="destination-in",i.absolutePositioned){var n=e.util.invertTransform(this.calcTransformMatrix());t.transform(n[0],n[1],n[2],n[3],n[4],n[5])}i.transform(t),t.scale(1/i.zoomX,1/i.zoomY),t.drawImage(i._cacheCanvas,-i.cacheTranslationX,-i.cacheTranslationY),t.restore()},drawObject:function(t,e){var i=this.fill,n=this.stroke;e?(this.fill="black",this.stroke="",this._setClippingProperties(t)):this._renderBackground(t),this._render(t),this._drawClipPath(t,this.clipPath),this.fill=i,this.stroke=n},_drawClipPath:function(t,e){e&&(e.canvas=this.canvas,e.shouldCache(),e._transformDone=!0,e.renderCache({forClipping:!0}),this.drawClipPathOnCache(t,e))},drawCacheOnCanvas:function(t){t.scale(1/this.zoomX,1/this.zoomY),t.drawImage(this._cacheCanvas,-this.cacheTranslationX,-this.cacheTranslationY)},isCacheDirty:function(t){if(this.isNotVisible())return!1;if(this._cacheCanvas&&this._cacheContext&&!t&&this._updateCacheCanvas())return!0;if(this.dirty||this.clipPath&&this.clipPath.absolutePositioned||this.statefullCache&&this.hasStateChanged("cacheProperties")){if(this._cacheCanvas&&this._cacheContext&&!t){var e=this.cacheWidth/this.zoomX,i=this.cacheHeight/this.zoomY;this._cacheContext.clearRect(-e/2,-i/2,e,i)}return!0}return!1},_renderBackground:function(t){if(this.backgroundColor){var e=this._getNonTransformedDimensions();t.fillStyle=this.backgroundColor,t.fillRect(-e.x/2,-e.y/2,e.x,e.y),this._removeShadow(t)}},_setOpacity:function(t){this.group&&!this.group._transformDone?t.globalAlpha=this.getObjectOpacity():t.globalAlpha*=this.opacity},_setStrokeStyles:function(t,e){var i=e.stroke;i&&(t.lineWidth=e.strokeWidth,t.lineCap=e.strokeLineCap,t.lineDashOffset=e.strokeDashOffset,t.lineJoin=e.strokeLineJoin,t.miterLimit=e.strokeMiterLimit,i.toLive?"percentage"===i.gradientUnits||i.gradientTransform||i.patternTransform?this._applyPatternForTransformedGradient(t,i):(t.strokeStyle=i.toLive(t,this),this._applyPatternGradientTransform(t,i)):t.strokeStyle=e.stroke)},_setFillStyles:function(t,e){var i=e.fill;i&&(i.toLive?(t.fillStyle=i.toLive(t,this),this._applyPatternGradientTransform(t,e.fill)):t.fillStyle=i)},_setClippingProperties:function(t){t.globalAlpha=1,t.strokeStyle="transparent",t.fillStyle="#000000"},_setLineDash:function(t,e){e&&0!==e.length&&(1&e.length&&e.push.apply(e,e),t.setLineDash(e))},_renderControls:function(t,i){var n,r,s,a=this.getViewportTransform(),l=this.calcTransformMatrix();r=void 0!==(i=i||{}).hasBorders?i.hasBorders:this.hasBorders,s=void 0!==i.hasControls?i.hasControls:this.hasControls,l=e.util.multiplyTransformMatrices(a,l),n=e.util.qrDecompose(l),t.save(),t.translate(n.translateX,n.translateY),t.lineWidth=+this.borderScaleFactor,this.group||(t.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1),this.flipX&&(n.angle-=180),t.rotate(o(this.group?n.angle:this.angle)),i.forActiveSelection||this.group?r&&this.drawBordersInGroup(t,n,i):r&&this.drawBorders(t,i),s&&this.drawControls(t,i),t.restore()},_setShadow:function(t){if(this.shadow){var i,n=this.shadow,r=this.canvas,s=r&&r.viewportTransform[0]||1,o=r&&r.viewportTransform[3]||1;i=n.nonScaling?{scaleX:1,scaleY:1}:this.getObjectScaling(),r&&r._isRetinaScaling()&&(s*=e.devicePixelRatio,o*=e.devicePixelRatio),t.shadowColor=n.color,t.shadowBlur=n.blur*e.browserShadowBlurConstant*(s+o)*(i.scaleX+i.scaleY)/4,t.shadowOffsetX=n.offsetX*s*i.scaleX,t.shadowOffsetY=n.offsetY*o*i.scaleY}},_removeShadow:function(t){this.shadow&&(t.shadowColor="",t.shadowBlur=t.shadowOffsetX=t.shadowOffsetY=0)},_applyPatternGradientTransform:function(t,e){if(!e||!e.toLive)return{offsetX:0,offsetY:0};var i=e.gradientTransform||e.patternTransform,n=-this.width/2+e.offsetX||0,r=-this.height/2+e.offsetY||0;return"percentage"===e.gradientUnits?t.transform(this.width,0,0,this.height,n,r):t.transform(1,0,0,1,n,r),i&&t.transform(i[0],i[1],i[2],i[3],i[4],i[5]),{offsetX:n,offsetY:r}},_renderPaintInOrder:function(t){"stroke"===this.paintFirst?(this._renderStroke(t),this._renderFill(t)):(this._renderFill(t),this._renderStroke(t))},_render:function(){},_renderFill:function(t){this.fill&&(t.save(),this._setFillStyles(t,this),"evenodd"===this.fillRule?t.fill("evenodd"):t.fill(),t.restore())},_renderStroke:function(t){if(this.stroke&&0!==this.strokeWidth){if(this.shadow&&!this.shadow.affectStroke&&this._removeShadow(t),t.save(),this.strokeUniform&&this.group){var e=this.getObjectScaling();t.scale(1/e.scaleX,1/e.scaleY)}else this.strokeUniform&&t.scale(1/this.scaleX,1/this.scaleY);this._setLineDash(t,this.strokeDashArray),this._setStrokeStyles(t,this),t.stroke(),t.restore()}},_applyPatternForTransformedGradient:function(t,i){var n,r=this._limitCacheSize(this._getCacheCanvasDimensions()),s=e.util.createCanvasElement(),o=this.canvas.getRetinaScaling(),a=r.x/this.scaleX/o,l=r.y/this.scaleY/o;s.width=Math.ceil(a),s.height=Math.ceil(l),(n=s.getContext("2d")).beginPath(),n.moveTo(0,0),n.lineTo(a,0),n.lineTo(a,l),n.lineTo(0,l),n.closePath(),n.translate(a/2,l/2),n.scale(r.zoomX/this.scaleX/o,r.zoomY/this.scaleY/o),this._applyPatternGradientTransform(n,i),n.fillStyle=i.toLive(t),n.fill(),t.translate(-this.width/2-this.strokeWidth/2,-this.height/2-this.strokeWidth/2),t.scale(o*this.scaleX/r.zoomX,o*this.scaleY/r.zoomY),t.strokeStyle=n.createPattern(s,"no-repeat")},_findCenterFromElement:function(){return{x:this.left+this.width/2,y:this.top+this.height/2}},_assignTransformMatrixProps:function(){if(this.transformMatrix){var t=e.util.qrDecompose(this.transformMatrix);this.flipX=!1,this.flipY=!1,this.set("scaleX",t.scaleX),this.set("scaleY",t.scaleY),this.angle=t.angle,this.skewX=t.skewX,this.skewY=0}},_removeTransformMatrix:function(t){var i=this._findCenterFromElement();this.transformMatrix&&(this._assignTransformMatrixProps(),i=e.util.transformPoint(i,this.transformMatrix)),this.transformMatrix=null,t&&(this.scaleX*=t.scaleX,this.scaleY*=t.scaleY,this.cropX=t.cropX,this.cropY=t.cropY,i.x+=t.offsetLeft,i.y+=t.offsetTop,this.width=t.width,this.height=t.height),this.setPositionByOrigin(i,"center","center")},clone:function(t,i){var n=this.toObject(i);this.constructor.fromObject?this.constructor.fromObject(n,t):e.Object._fromObject("Object",n,t)},cloneAsImage:function(t,i){var n=this.toCanvasElement(i);return t&&t(new e.Image(n)),this},toCanvasElement:function(t){t||(t={});var i=e.util,n=i.saveObjectTransform(this),r=this.group,s=this.shadow,o=Math.abs,a=(t.multiplier||1)*(t.enableRetinaScaling?e.devicePixelRatio:1);delete this.group,t.withoutTransform&&i.resetObjectTransform(this),t.withoutShadow&&(this.shadow=null);var l,c,h,u,f=e.util.createCanvasElement(),d=this.getBoundingRect(!0,!0),g=this.shadow,p={x:0,y:0};g&&(c=g.blur,l=g.nonScaling?{scaleX:1,scaleY:1}:this.getObjectScaling(),p.x=2*Math.round(o(g.offsetX)+c)*o(l.scaleX),p.y=2*Math.round(o(g.offsetY)+c)*o(l.scaleY)),h=d.width+p.x,u=d.height+p.y,f.width=Math.ceil(h),f.height=Math.ceil(u);var m=new e.StaticCanvas(f,{enableRetinaScaling:!1,renderOnAddRemove:!1,skipOffscreen:!1});"jpeg"===t.format&&(m.backgroundColor="#fff"),this.setPositionByOrigin(new e.Point(m.width/2,m.height/2),"center","center");var y=this.canvas;m.add(this);var b=m.toCanvasElement(a||1,t);return this.shadow=s,this.set("canvas",y),r&&(this.group=r),this.set(n).setCoords(),m._objects=[],m.dispose(),m=null,b},toDataURL:function(t){return t||(t={}),e.util.toDataURL(this.toCanvasElement(t),t.format||"png",t.quality||1)},isType:function(t){return arguments.length>1?Array.from(arguments).includes(this.type):this.type===t},complexity:function(){return 1},toJSON:function(t){return this.toObject(t)},rotate:function(t){var e=("center"!==this.originX||"center"!==this.originY)&&this.centeredRotation;return e&&this._setOriginToCenter(),this.set("angle",t),e&&this._resetOrigin(),this},centerH:function(){return this.canvas&&this.canvas.centerObjectH(this),this},viewportCenterH:function(){return this.canvas&&this.canvas.viewportCenterObjectH(this),this},centerV:function(){return this.canvas&&this.canvas.centerObjectV(this),this},viewportCenterV:function(){return this.canvas&&this.canvas.viewportCenterObjectV(this),this},center:function(){return this.canvas&&this.canvas.centerObject(this),this},viewportCenter:function(){return this.canvas&&this.canvas.viewportCenterObject(this),this},getLocalPointer:function(t,i){i=i||this.canvas.getPointer(t);var n=new e.Point(i.x,i.y),r=this._getLeftTopCoords();return this.angle&&(n=e.util.rotatePoint(n,r,o(-this.angle))),{x:n.x-r.x,y:n.y-r.y}},_setupCompositeOperation:function(t){this.globalCompositeOperation&&(t.globalCompositeOperation=this.globalCompositeOperation)},dispose:function(){e.runningAnimations&&e.runningAnimations.cancelByTarget(this)}}),e.util.createAccessors&&e.util.createAccessors(e.Object),i(e.Object.prototype,e.Observable),e.Object.NUM_FRACTION_DIGITS=2,e.Object.ENLIVEN_PROPS=["clipPath"],e.Object._fromObject=function(t,i,r,s){var o=e[t];i=n(i,!0),e.util.enlivenPatterns([i.fill,i.stroke],function(t){void 0!==t[0]&&(i.fill=t[0]),void 0!==t[1]&&(i.stroke=t[1]),e.util.enlivenObjectEnlivables(i,i,function(){var t=s?new o(i[s],i):new o(i);r&&r(t)})})},e.Object.__uid=0)}(i),function(){var t=r.util.degreesToRadians,e={left:-.5,center:0,right:.5},i={top:-.5,center:0,bottom:.5};r.util.object.extend(r.Object.prototype,{translateToGivenOrigin:function(t,n,s,o,a){var l,c,h,u=t.x,f=t.y;return"string"==typeof n?n=e[n]:n-=.5,"string"==typeof o?o=e[o]:o-=.5,l=o-n,"string"==typeof s?s=i[s]:s-=.5,"string"==typeof a?a=i[a]:a-=.5,c=a-s,(l||c)&&(h=this._getTransformedDimensions(),u=t.x+l*h.x,f=t.y+c*h.y),new r.Point(u,f)},translateToCenterPoint:function(e,i,n){var s=this.translateToGivenOrigin(e,i,n,"center","center");return this.angle?r.util.rotatePoint(s,e,t(this.angle)):s},translateToOriginPoint:function(e,i,n){var s=this.translateToGivenOrigin(e,"center","center",i,n);return this.angle?r.util.rotatePoint(s,e,t(this.angle)):s},getCenterPoint:function(){var t=new r.Point(this.left,this.top);return this.translateToCenterPoint(t,this.originX,this.originY)},getPointByOrigin:function(t,e){var i=this.getCenterPoint();return this.translateToOriginPoint(i,t,e)},toLocalPoint:function(e,i,n){var s,o,a=this.getCenterPoint();return s=void 0!==i&&void 0!==n?this.translateToGivenOrigin(a,"center","center",i,n):new r.Point(this.left,this.top),o=new r.Point(e.x,e.y),this.angle&&(o=r.util.rotatePoint(o,a,-t(this.angle))),o.subtractEquals(s)},setPositionByOrigin:function(t,e,i){var n=this.translateToCenterPoint(t,e,i),r=this.translateToOriginPoint(n,this.originX,this.originY);this.set("left",r.x),this.set("top",r.y)},adjustPosition:function(i){var n,s,o=t(this.angle),a=this.getScaledWidth(),l=r.util.cos(o)*a,c=r.util.sin(o)*a;n="string"==typeof this.originX?e[this.originX]:this.originX-.5,s="string"==typeof i?e[i]:i-.5,this.left+=l*(s-n),this.top+=c*(s-n),this.setCoords(),this.originX=i},_setOriginToCenter:function(){this._originalOriginX=this.originX,this._originalOriginY=this.originY;var t=this.getCenterPoint();this.originX="center",this.originY="center",this.left=t.x,this.top=t.y},_resetOrigin:function(){var t=this.translateToOriginPoint(this.getCenterPoint(),this._originalOriginX,this._originalOriginY);this.originX=this._originalOriginX,this.originY=this._originalOriginY,this.left=t.x,this.top=t.y,this._originalOriginX=null,this._originalOriginY=null},_getLeftTopCoords:function(){return this.translateToOriginPoint(this.getCenterPoint(),"left","top")}})}(),function(){var t=r.util,e=t.degreesToRadians,i=t.multiplyTransformMatrices,n=t.transformPoint;t.object.extend(r.Object.prototype,{oCoords:null,aCoords:null,lineCoords:null,ownMatrixCache:null,matrixCache:null,controls:{},_getCoords:function(t,e){return e?t?this.calcACoords():this.calcLineCoords():(this.aCoords&&this.lineCoords||this.setCoords(!0),t?this.aCoords:this.lineCoords)},getCoords:function(t,e){var i;return i=this._getCoords(t,e),[new r.Point(i.tl.x,i.tl.y),new r.Point(i.tr.x,i.tr.y),new r.Point(i.br.x,i.br.y),new r.Point(i.bl.x,i.bl.y)]},intersectsWithRect:function(t,e,i,n){var s=this.getCoords(i,n);return"Intersection"===r.Intersection.intersectPolygonRectangle(s,t,e).status},intersectsWithObject:function(t,e,i){return"Intersection"===r.Intersection.intersectPolygonPolygon(this.getCoords(e,i),t.getCoords(e,i)).status||t.isContainedWithinObject(this,e,i)||this.isContainedWithinObject(t,e,i)},isContainedWithinObject:function(t,e,i){for(var n=this.getCoords(e,i),r=e?t.aCoords:t.lineCoords,s=0,o=t._getImageLines(r);s<4;s++)if(!t.containsPoint(n[s],o))return!1;return!0},isContainedWithinRect:function(t,e,i,n){var r=this.getBoundingRect(i,n);return r.left>=t.x&&r.left+r.width<=e.x&&r.top>=t.y&&r.top+r.height<=e.y},containsPoint:function(t,e,i,n){var r=this._getCoords(i,n),e=e||this._getImageLines(r),s=this._findCrossPoints(t,e);return 0!==s&&s%2==1},isOnScreen:function(t){if(!this.canvas)return!1;var e=this.canvas.vptCoords.tl,i=this.canvas.vptCoords.br;return!!(this.getCoords(!0,t).some(function(t){return t.x<=i.x&&t.x>=e.x&&t.y<=i.y&&t.y>=e.y})||this.intersectsWithRect(e,i,!0,t))||this._containsCenterOfCanvas(e,i,t)},_containsCenterOfCanvas:function(t,e,i){var n={x:(t.x+e.x)/2,y:(t.y+e.y)/2};return!!this.containsPoint(n,null,!0,i)},isPartiallyOnScreen:function(t){if(!this.canvas)return!1;var e=this.canvas.vptCoords.tl,i=this.canvas.vptCoords.br;return!!this.intersectsWithRect(e,i,!0,t)||this.getCoords(!0,t).every(function(t){return(t.x>=i.x||t.x<=e.x)&&(t.y>=i.y||t.y<=e.y)})&&this._containsCenterOfCanvas(e,i,t)},_getImageLines:function(t){return{topline:{o:t.tl,d:t.tr},rightline:{o:t.tr,d:t.br},bottomline:{o:t.br,d:t.bl},leftline:{o:t.bl,d:t.tl}}},_findCrossPoints:function(t,e){var i,n,r,s=0;for(var o in e)if((!((r=e[o]).o.y=t.y)||!(r.d.y>=t.y))&&(r.o.x===r.d.x&&r.o.x>=t.x?n=r.o.x:(i=(r.d.y-r.o.y)/(r.d.x-r.o.x),n=-(t.y-0*t.x-(r.o.y-i*r.o.x))/(0-i)),n>=t.x&&(s+=1),2===s))break;return s},getBoundingRect:function(e,i){var n=this.getCoords(e,i);return t.makeBoundingBoxFromPoints(n)},getScaledWidth:function(){return this._getTransformedDimensions().x},getScaledHeight:function(){return this._getTransformedDimensions().y},_constrainScale:function(t){if(Math.abs(t)\n')}},toSVG:function(t){return this._createBaseSVGMarkup(this._toSVG(t),{reviver:t})},toClipPathSVG:function(t){return" "+this._createBaseClipPathSVGMarkup(this._toSVG(t),{reviver:t})},_createBaseClipPathSVGMarkup:function(t,e){var i=(e=e||{}).reviver,n=e.additionalTransform||"",r=[this.getSvgTransform(!0,n),this.getSvgCommons()].join(""),s=t.indexOf("COMMON_PARTS");return t[s]=r,i?i(t.join("")):t.join("")},_createBaseSVGMarkup:function(t,e){var i,n,s=(e=e||{}).noStyle,o=e.reviver,a=s?"":'style="'+this.getSvgStyles()+'" ',l=e.withShadow?'style="'+this.getSvgFilter()+'" ':"",c=this.clipPath,h=this.strokeUniform?'vector-effect="non-scaling-stroke" ':"",u=c&&c.absolutePositioned,f=this.stroke,d=this.fill,g=this.shadow,p=[],m=t.indexOf("COMMON_PARTS"),y=e.additionalTransform;return c&&(c.clipPathId="CLIPPATH_"+r.Object.__uid++,n='\n'+c.toClipPathSVG(o)+"\n"),u&&p.push("\n"),p.push("\n"),i=""+a+h+(s?"":this.addPaintOrder())+" "+(y?'transform="'+y+'" ':""),t[m]=i,d&&d.toLive&&p.push(d.toSVG(this)),f&&f.toLive&&p.push(f.toSVG(this)),g&&p.push(g.toSVG(this)),c&&p.push(n),p.push(t.join("")),p.push("\n"),u&&p.push("\n"),o?o(p.join("")):p.join("")},addPaintOrder:function(){return"fill"!==this.paintFirst?' paint-order="'+this.paintFirst+'" ':""}})}(),function(){var t=r.util.object.extend,e="stateProperties";function i(e,i,n){var r={};n.forEach(function(t){r[t]=e[t]}),t(e[i],r,!0)}r.util.object.extend(r.Object.prototype,{hasStateChanged:function(t){var i="_"+(t=t||e);return Object.keys(this[i]).length=0;l--)if(r=a[l],this.isControlVisible(r)&&(n=this._getImageLines(e?this.oCoords[r].touchCorner:this.oCoords[r].corner),0!==(i=this._findCrossPoints({x:s,y:o},n))&&i%2==1))return this.__corner=r,r;return!1},forEachControl:function(t){for(var e in this.controls)t(this.controls[e],e,this)},_setCornerCoords:function(){var t=this.oCoords;for(var e in t){var i=this.controls[e];t[e].corner=i.calcCornerCoords(this.angle,this.cornerSize,t[e].x,t[e].y,!1),t[e].touchCorner=i.calcCornerCoords(this.angle,this.touchCornerSize,t[e].x,t[e].y,!0)}},drawSelectionBackground:function(e){if(!this.selectionBackgroundColor||this.canvas&&!this.canvas.interactive||this.canvas&&this.canvas._activeObject!==this)return this;e.save();var i=this.getCenterPoint(),n=this._calculateCurrentDimensions(),r=this.canvas.viewportTransform;return e.translate(i.x,i.y),e.scale(1/r[0],1/r[3]),e.rotate(t(this.angle)),e.fillStyle=this.selectionBackgroundColor,e.fillRect(-n.x/2,-n.y/2,n.x,n.y),e.restore(),this},drawBorders:function(t,e){e=e||{};var i=this._calculateCurrentDimensions(),n=this.borderScaleFactor,r=i.x+n,s=i.y+n,o=void 0!==e.hasControls?e.hasControls:this.hasControls,a=!1;return t.save(),t.strokeStyle=e.borderColor||this.borderColor,this._setLineDash(t,e.borderDashArray||this.borderDashArray),t.strokeRect(-r/2,-s/2,r,s),o&&(t.beginPath(),this.forEachControl(function(e,i,n){e.withConnection&&e.getVisibility(n,i)&&(a=!0,t.moveTo(e.x*r,e.y*s),t.lineTo(e.x*r+e.offsetX,e.y*s+e.offsetY))}),a&&t.stroke()),t.restore(),this},drawBordersInGroup:function(t,e,i){i=i||{};var n=r.util.sizeAfterTransform(this.width,this.height,e),s=this.strokeWidth,o=this.strokeUniform,a=this.borderScaleFactor,l=n.x+s*(o?this.canvas.getZoom():e.scaleX)+a,c=n.y+s*(o?this.canvas.getZoom():e.scaleY)+a;return t.save(),this._setLineDash(t,i.borderDashArray||this.borderDashArray),t.strokeStyle=i.borderColor||this.borderColor,t.strokeRect(-l/2,-c/2,l,c),t.restore(),this},drawControls:function(t,e){e=e||{},t.save();var i,n,s=1;return this.canvas&&(s=this.canvas.getRetinaScaling()),t.setTransform(s,0,0,s,0,0),t.strokeStyle=t.fillStyle=e.cornerColor||this.cornerColor,this.transparentCorners||(t.strokeStyle=e.cornerStrokeColor||this.cornerStrokeColor),this._setLineDash(t,e.cornerDashArray||this.cornerDashArray),this.setCoords(),this.group&&(i=this.group.calcTransformMatrix()),this.forEachControl(function(s,o,a){n=a.oCoords[o],s.getVisibility(a,o)&&(i&&(n=r.util.transformPoint(n,i)),s.render(t,n.x,n.y,e,a))}),t.restore(),this},isControlVisible:function(t){return this.controls[t]&&this.controls[t].getVisibility(this,t)},setControlVisible:function(t,e){return this._controlsVisibility||(this._controlsVisibility={}),this._controlsVisibility[t]=e,this},setControlsVisibility:function(t){for(var e in t||(t={}),t)this.setControlVisible(e,t[e]);return this},onDeselect:function(){},onSelect:function(){}})}(),r.util.object.extend(r.StaticCanvas.prototype,{FX_DURATION:500,fxCenterObjectH:function(t,e){var i=function(){},n=(e=e||{}).onComplete||i,s=e.onChange||i,o=this;return r.util.animate({target:this,startValue:t.left,endValue:this.getCenterPoint().x,duration:this.FX_DURATION,onChange:function(e){t.set("left",e),o.requestRenderAll(),s()},onComplete:function(){t.setCoords(),n()}})},fxCenterObjectV:function(t,e){var i=function(){},n=(e=e||{}).onComplete||i,s=e.onChange||i,o=this;return r.util.animate({target:this,startValue:t.top,endValue:this.getCenterPoint().y,duration:this.FX_DURATION,onChange:function(e){t.set("top",e),o.requestRenderAll(),s()},onComplete:function(){t.setCoords(),n()}})},fxRemove:function(t,e){var i=function(){},n=(e=e||{}).onComplete||i,s=e.onChange||i,o=this;return r.util.animate({target:this,startValue:t.opacity,endValue:0,duration:this.FX_DURATION,onChange:function(e){t.set("opacity",e),o.requestRenderAll(),s()},onComplete:function(){o.remove(t),n()}})}}),r.util.object.extend(r.Object.prototype,{animate:function(){if(!arguments[0]||"object"!=typeof arguments[0])return this._animate.apply(this,arguments);var t,e,i=[],n=[];for(t in arguments[0])i.push(t);for(var r=0,s=i.length;r-1||s&&o.colorProperties.indexOf(s[1])>-1,l=s?this.get(s[0])[s[1]]:this.get(t);"from"in i||(i.from=l),a||(e=~e.indexOf("=")?l+parseFloat(e.replace("=","")):parseFloat(e));var c={target:this,startValue:i.from,endValue:e,byValue:i.by,easing:i.easing,duration:i.duration,abort:i.abort&&function(t,e,n){return i.abort.call(o,t,e,n)},onChange:function(e,r,a){s?o[s[0]][s[1]]=e:o.set(t,e),!n&&i.onChange&&i.onChange(e,r,a)},onComplete:function(t,e,r){!n&&(o.setCoords(),i.onComplete&&i.onComplete(t,e,r))}};return a?r.util.animateColor(c.startValue,c.endValue,c.duration,c):r.util.animate(c)}}),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.util.object.extend,n=e.util.object.clone,r={x1:1,x2:1,y1:1,y2:1};if(e.Line)return e.warn("fabric.Line is already defined");function s(t,e){var i=t.origin,n=t.axis1,r=t.axis2,s=t.dimension,o=e.nearest,a=e.center,l=e.farthest;return function(){switch(this.get(i)){case o:return Math.min(this.get(n),this.get(r));case a:return Math.min(this.get(n),this.get(r))+.5*this.get(s);case l:return Math.max(this.get(n),this.get(r))}}}e.Line=e.util.createClass(e.Object,{type:"line",x1:0,y1:0,x2:0,y2:0,cacheProperties:e.Object.prototype.cacheProperties.concat("x1","x2","y1","y2"),initialize:function(t,e){t||(t=[0,0,0,0]),this.callSuper("initialize",e),this.set("x1",t[0]),this.set("y1",t[1]),this.set("x2",t[2]),this.set("y2",t[3]),this._setWidthHeight(e)},_setWidthHeight:function(t){t||(t={}),this.width=Math.abs(this.x2-this.x1),this.height=Math.abs(this.y2-this.y1),this.left="left"in t?t.left:this._getLeftToOriginX(),this.top="top"in t?t.top:this._getTopToOriginY()},_set:function(t,e){return this.callSuper("_set",t,e),void 0!==r[t]&&this._setWidthHeight(),this},_getLeftToOriginX:s({origin:"originX",axis1:"x1",axis2:"x2",dimension:"width"},{nearest:"left",center:"center",farthest:"right"}),_getTopToOriginY:s({origin:"originY",axis1:"y1",axis2:"y2",dimension:"height"},{nearest:"top",center:"center",farthest:"bottom"}),_render:function(t){t.beginPath();var e=this.calcLinePoints();t.moveTo(e.x1,e.y1),t.lineTo(e.x2,e.y2),t.lineWidth=this.strokeWidth;var i=t.strokeStyle;t.strokeStyle=this.stroke||t.fillStyle,this.stroke&&this._renderStroke(t),t.strokeStyle=i},_findCenterFromElement:function(){return{x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2}},toObject:function(t){return i(this.callSuper("toObject",t),this.calcLinePoints())},_getNonTransformedDimensions:function(){var t=this.callSuper("_getNonTransformedDimensions");return"butt"===this.strokeLineCap&&(0===this.width&&(t.y-=this.strokeWidth),0===this.height&&(t.x-=this.strokeWidth)),t},calcLinePoints:function(){var t=this.x1<=this.x2?-1:1,e=this.y1<=this.y2?-1:1,i=t*this.width*.5,n=e*this.height*.5;return{x1:i,x2:-(t*this.width*.5),y1:n,y2:-(e*this.height*.5)}},_toSVG:function(){var t=this.calcLinePoints();return["\n']}}),e.Line.ATTRIBUTE_NAMES=e.SHARED_ATTRIBUTES.concat("x1 y1 x2 y2".split(" ")),e.Line.fromElement=function(t,n,r){r=r||{};var s=e.parseAttributes(t,e.Line.ATTRIBUTE_NAMES),o=[s.x1||0,s.y1||0,s.x2||0,s.y2||0];n(new e.Line(o,i(s,r)))},e.Line.fromObject=function(t,i){var r=n(t,!0);r.points=[t.x1,t.y1,t.x2,t.y2],e.Object._fromObject("Line",r,function(t){delete t.points,i&&i(t)},"points")}}(i),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.util.degreesToRadians;if(e.Circle)return e.warn("fabric.Circle is already defined.");e.Circle=e.util.createClass(e.Object,{type:"circle",radius:0,startAngle:0,endAngle:360,cacheProperties:e.Object.prototype.cacheProperties.concat("radius","startAngle","endAngle"),_set:function(t,e){return this.callSuper("_set",t,e),"radius"===t&&this.setRadius(e),this},toObject:function(t){return this.callSuper("toObject",["radius","startAngle","endAngle"].concat(t))},_toSVG:function(){var t,n=(this.endAngle-this.startAngle)%360;if(0===n)t=["\n'];else{var r=i(this.startAngle),s=i(this.endAngle),o=this.radius,a=e.util.cos(r)*o,l=e.util.sin(r)*o,c=e.util.cos(s)*o,h=e.util.sin(s)*o;t=['180?"1":"0")+" 1"," "+c+" "+h,'" ',"COMMON_PARTS"," />\n"]}return t},_render:function(t){t.beginPath(),t.arc(0,0,this.radius,i(this.startAngle),i(this.endAngle),!1),this._renderPaintInOrder(t)},getRadiusX:function(){return this.get("radius")*this.get("scaleX")},getRadiusY:function(){return this.get("radius")*this.get("scaleY")},setRadius:function(t){return this.radius=t,this.set("width",2*t).set("height",2*t)}}),e.Circle.ATTRIBUTE_NAMES=e.SHARED_ATTRIBUTES.concat("cx cy r".split(" ")),e.Circle.fromElement=function(t,i){var n,r=e.parseAttributes(t,e.Circle.ATTRIBUTE_NAMES);if(!("radius"in(n=r)&&n.radius>=0))throw 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,i(new e.Circle(r))},e.Circle.fromObject=function(t,i){e.Object._fromObject("Circle",t,i)}}(i),function(t){"use strict";var e=t.fabric||(t.fabric={});if(e.Triangle)return e.warn("fabric.Triangle is already defined");e.Triangle=e.util.createClass(e.Object,{type:"triangle",width:100,height:100,_render:function(t){var e=this.width/2,i=this.height/2;t.beginPath(),t.moveTo(-e,i),t.lineTo(0,-i),t.lineTo(e,i),t.closePath(),this._renderPaintInOrder(t)},_toSVG:function(){var t=this.width/2,e=this.height/2;return["']}}),e.Triangle.fromObject=function(t,i){return e.Object._fromObject("Triangle",t,i)}}(i),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=2*Math.PI;if(e.Ellipse)return e.warn("fabric.Ellipse is already defined.");e.Ellipse=e.util.createClass(e.Object,{type:"ellipse",rx:0,ry:0,cacheProperties:e.Object.prototype.cacheProperties.concat("rx","ry"),initialize:function(t){this.callSuper("initialize",t),this.set("rx",t&&t.rx||0),this.set("ry",t&&t.ry||0)},_set:function(t,e){switch(this.callSuper("_set",t,e),t){case"rx":this.rx=e,this.set("width",2*e);break;case"ry":this.ry=e,this.set("height",2*e)}return this},getRx:function(){return this.get("rx")*this.get("scaleX")},getRy:function(){return this.get("ry")*this.get("scaleY")},toObject:function(t){return this.callSuper("toObject",["rx","ry"].concat(t))},_toSVG:function(){return["\n']},_render:function(t){t.beginPath(),t.save(),t.transform(1,0,0,this.ry/this.rx,0,0),t.arc(0,0,this.rx,0,i,!1),t.restore(),this._renderPaintInOrder(t)}}),e.Ellipse.ATTRIBUTE_NAMES=e.SHARED_ATTRIBUTES.concat("cx cy rx ry".split(" ")),e.Ellipse.fromElement=function(t,i){var n=e.parseAttributes(t,e.Ellipse.ATTRIBUTE_NAMES);n.left=(n.left||0)-n.rx,n.top=(n.top||0)-n.ry,i(new e.Ellipse(n))},e.Ellipse.fromObject=function(t,i){e.Object._fromObject("Ellipse",t,i)}}(i),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.util.object.extend;if(e.Rect)return e.warn("fabric.Rect is already defined");e.Rect=e.util.createClass(e.Object,{stateProperties:e.Object.prototype.stateProperties.concat("rx","ry"),type:"rect",rx:0,ry:0,cacheProperties:e.Object.prototype.cacheProperties.concat("rx","ry"),initialize:function(t){this.callSuper("initialize",t),this._initRxRy()},_initRxRy:function(){this.rx&&!this.ry?this.ry=this.rx:this.ry&&!this.rx&&(this.rx=this.ry)},_render:function(t){var e=this.rx?Math.min(this.rx,this.width/2):0,i=this.ry?Math.min(this.ry,this.height/2):0,n=this.width,r=this.height,s=-this.width/2,o=-this.height/2,a=0!==e||0!==i;t.beginPath(),t.moveTo(s+e,o),t.lineTo(s+n-e,o),a&&t.bezierCurveTo(s+n-.4477152502*e,o,s+n,o+.4477152502*i,s+n,o+i),t.lineTo(s+n,o+r-i),a&&t.bezierCurveTo(s+n,o+r-.4477152502*i,s+n-.4477152502*e,o+r,s+n-e,o+r),t.lineTo(s+e,o+r),a&&t.bezierCurveTo(s+.4477152502*e,o+r,s,o+r-.4477152502*i,s,o+r-i),t.lineTo(s,o+i),a&&t.bezierCurveTo(s,o+.4477152502*i,s+.4477152502*e,o,s+e,o),t.closePath(),this._renderPaintInOrder(t)},toObject:function(t){return this.callSuper("toObject",["rx","ry"].concat(t))},_toSVG:function(){return["\n']}}),e.Rect.ATTRIBUTE_NAMES=e.SHARED_ATTRIBUTES.concat("x y rx ry width height".split(" ")),e.Rect.fromElement=function(t,n,r){if(!t)return n(null);r=r||{};var s=e.parseAttributes(t,e.Rect.ATTRIBUTE_NAMES);s.left=s.left||0,s.top=s.top||0,s.height=s.height||0,s.width=s.width||0;var o=new e.Rect(i(r?e.util.object.clone(r):{},s));o.visible=o.visible&&o.width>0&&o.height>0,n(o)},e.Rect.fromObject=function(t,i){return e.Object._fromObject("Rect",t,i)}}(i),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.util.object.extend,n=e.util.array.min,r=e.util.array.max,s=e.util.toFixed,o=e.util.projectStrokeOnPoints;if(e.Polyline)return e.warn("fabric.Polyline is already defined");e.Polyline=e.util.createClass(e.Object,{type:"polyline",points:null,exactBoundingBox:!1,cacheProperties:e.Object.prototype.cacheProperties.concat("points"),initialize:function(t,e){e=e||{},this.points=t||[],this.callSuper("initialize",e),this._setPositionDimensions(e)},_projectStrokeOnPoints:function(){return o(this.points,this,!0)},_setPositionDimensions:function(t){var e,i=this._calcDimensions(t),n=this.exactBoundingBox?this.strokeWidth:0;this.width=i.width-n,this.height=i.height-n,t.fromSVG||(e=this.translateToGivenOrigin({x:i.left-this.strokeWidth/2+n/2,y:i.top-this.strokeWidth/2+n/2},"left","top",this.originX,this.originY)),void 0===t.left&&(this.left=t.fromSVG?i.left:e.x),void 0===t.top&&(this.top=t.fromSVG?i.top:e.y),this.pathOffset={x:i.left+this.width/2+n/2,y:i.top+this.height/2+n/2}},_calcDimensions:function(){var t=this.exactBoundingBox?this._projectStrokeOnPoints():this.points,e=n(t,"x")||0,i=n(t,"y")||0;return{left:e,top:i,width:(r(t,"x")||0)-e,height:(r(t,"y")||0)-i}},toObject:function(t){return i(this.callSuper("toObject",t),{points:this.points.concat()})},_toSVG:function(){for(var t=[],i=this.pathOffset.x,n=this.pathOffset.y,r=e.Object.NUM_FRACTION_DIGITS,o=0,a=this.points.length;o\n']},commonRender:function(t){var e,i=this.points.length,n=this.pathOffset.x,r=this.pathOffset.y;if(!i||isNaN(this.points[i-1].y))return!1;t.beginPath(),t.moveTo(this.points[0].x-n,this.points[0].y-r);for(var s=0;s"},toObject:function(t){return r(this.callSuper("toObject",t),{path:this.path.map(function(t){return t.slice()})})},toDatalessObject:function(t){var e=this.toObject(["sourcePath"].concat(t));return e.sourcePath&&delete e.path,e},_toSVG:function(){return["\n"]},_getOffsetTransform:function(){var t=e.Object.NUM_FRACTION_DIGITS;return" translate("+o(-this.pathOffset.x,t)+", "+o(-this.pathOffset.y,t)+")"},toClipPathSVG:function(t){var e=this._getOffsetTransform();return" "+this._createBaseClipPathSVGMarkup(this._toSVG(),{reviver:t,additionalTransform:e})},toSVG:function(t){var e=this._getOffsetTransform();return this._createBaseSVGMarkup(this._toSVG(),{reviver:t,additionalTransform:e})},complexity:function(){return this.path.length},_calcDimensions:function(){for(var t,r,s=[],o=[],a=0,l=0,c=0,h=0,u=0,f=this.path.length;u"},addWithUpdate:function(t){var i=!!this.group;return this._restoreObjectsState(),e.util.resetObjectTransform(this),t&&(i&&e.util.removeTransformFromObject(t,this.group.calcTransformMatrix()),this._objects.push(t),t.group=this,t._set("canvas",this.canvas)),this._calcBounds(),this._updateObjectsCoords(),this.dirty=!0,i?this.group.addWithUpdate():this.setCoords(),this},removeWithUpdate:function(t){return this._restoreObjectsState(),e.util.resetObjectTransform(this),this.remove(t),this._calcBounds(),this._updateObjectsCoords(),this.setCoords(),this.dirty=!0,this},_onObjectAdded:function(t){this.dirty=!0,t.group=this,t._set("canvas",this.canvas)},_onObjectRemoved:function(t){this.dirty=!0,delete t.group},_set:function(t,i){var n=this._objects.length;if(this.useSetOnGroup)for(;n--;)this._objects[n].setOnGroup(t,i);if("canvas"===t)for(;n--;)this._objects[n]._set(t,i);e.Object.prototype._set.call(this,t,i)},toObject:function(t){var i=this.includeDefaultValues,n=this._objects.filter(function(t){return!t.excludeFromExport}).map(function(e){var n=e.includeDefaultValues;e.includeDefaultValues=i;var r=e.toObject(t);return e.includeDefaultValues=n,r}),r=e.Object.prototype.toObject.call(this,t);return r.objects=n,r},toDatalessObject:function(t){var i,n=this.sourcePath;if(n)i=n;else{var r=this.includeDefaultValues;i=this._objects.map(function(e){var i=e.includeDefaultValues;e.includeDefaultValues=r;var n=e.toDatalessObject(t);return e.includeDefaultValues=i,n})}var s=e.Object.prototype.toDatalessObject.call(this,t);return s.objects=i,s},render:function(t){this._transformDone=!0,this.callSuper("render",t),this._transformDone=!1},shouldCache:function(){var t=e.Object.prototype.shouldCache.call(this);if(t){for(var i=0,n=this._objects.length;i\n"],i=0,n=this._objects.length;i\n"),e},getSvgStyles:function(){var t=void 0!==this.opacity&&1!==this.opacity?"opacity: "+this.opacity+";":"",e=this.visible?"":" visibility: hidden;";return[t,this.getSvgFilter(),e].join("")},toClipPathSVG:function(t){for(var e=[],i=0,n=this._objects.length;i"},shouldCache:function(){return!1},isOnACache:function(){return!1},_renderControls:function(t,e,i){t.save(),t.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1,void 0===(i=i||{}).hasControls&&(i.hasControls=!1),i.forActiveSelection=!0;for(var n=0,r=this._objects.length;n\n',' \n',"\n"),a=' clip-path="url(#imageCrop_'+c+')" '}if(this.imageSmoothing||(l='" image-rendering="optimizeSpeed'),i.push(" \n"),this.stroke||this.strokeDashArray){var h=this.fill;this.fill=null,t=[" \n'],this.fill=h}return"fill"!==this.paintFirst?e.concat(t,i):e.concat(i,t)},getSrc:function(t){var e=t?this._element:this._originalElement;return e?e.toDataURL?e.toDataURL():this.srcFromAttribute?e.getAttribute("src"):e.src:this.src||""},setSrc:function(t,e,i){return r.util.loadImage(t,function(t,n){this.setElement(t,i),this._setWidthHeight(),e&&e(this,n)},this,i&&i.crossOrigin),this},toString:function(){return'#'},applyResizeFilters:function(){var t=this.resizeFilter,e=this.minimumScaleTrigger,i=this.getTotalObjectScaling(),n=i.scaleX,s=i.scaleY,o=this._filteredEl||this._originalElement;if(this.group&&this.set("dirty",!0),!t||n>e&&s>e){this._element=o,this._filterScalingX=1,this._filterScalingY=1,this._lastScaleX=n,this._lastScaleY=s;return}r.filterBackend||(r.filterBackend=r.initFilterBackend());var a=r.util.createCanvasElement(),l=this._filteredEl?this.cacheKey+"_filtered":this.cacheKey,c=o.width,h=o.height;a.width=c,a.height=h,this._element=a,this._lastScaleX=t.scaleX=n,this._lastScaleY=t.scaleY=s,r.filterBackend.applyFilters([t],o,c,h,this._element,l),this._filterScalingX=a.width/this._originalElement.width,this._filterScalingY=a.height/this._originalElement.height},applyFilters:function(t){if(t=(t=t||this.filters||[]).filter(function(t){return t&&!t.isNeutralState()}),this.set("dirty",!0),this.removeTexture(this.cacheKey+"_filtered"),0===t.length)return this._element=this._originalElement,this._filteredEl=null,this._filterScalingX=1,this._filterScalingY=1,this;var e=this._originalElement,i=e.naturalWidth||e.width,n=e.naturalHeight||e.height;if(this._element===this._originalElement){var s=r.util.createCanvasElement();s.width=i,s.height=n,this._element=s,this._filteredEl=s}else this._element=this._filteredEl,this._filteredEl.getContext("2d").clearRect(0,0,i,n),this._lastScaleX=1,this._lastScaleY=1;return r.filterBackend||(r.filterBackend=r.initFilterBackend()),r.filterBackend.applyFilters(t,this._originalElement,i,n,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(t){r.util.setImageSmoothing(t,this.imageSmoothing),!0!==this.isMoving&&this.resizeFilter&&this._needsResize()&&this.applyResizeFilters(),this._stroke(t),this._renderPaintInOrder(t)},drawCacheOnCanvas:function(t){r.util.setImageSmoothing(t,this.imageSmoothing),r.Object.prototype.drawCacheOnCanvas.call(this,t)},shouldCache:function(){return this.needsItsOwnCache()},_renderFill:function(t){var e=this._element;if(e){var i=this._filterScalingX,n=this._filterScalingY,r=this.width,s=this.height,o=Math.min,a=Math.max,l=a(this.cropX,0),c=a(this.cropY,0),h=e.naturalWidth||e.width,u=e.naturalHeight||e.height,f=l*i,d=c*n,g=o(r*i,h-f),p=o(s*n,u-d),m=-r/2,y=-s/2,b=o(r,h/i-l),x=o(s,u/n-c);e&&t.drawImage(e,f,d,g,p,m,y,b,x)}},_needsResize:function(){var t=this.getTotalObjectScaling();return t.scaleX!==this._lastScaleX||t.scaleY!==this._lastScaleY},_resetWidthHeight:function(){this.set(this.getOriginalSize())},_initElement:function(t,e){this.setElement(r.util.getById(t),e),r.util.addClass(this.getElement(),r.Image.CSS_CANVAS)},_initConfig:function(t){t||(t={}),this.setOptions(t),this._setWidthHeight(t)},_initFilters:function(t,e){t&&t.length?r.util.enlivenObjects(t,function(t){e&&e(t)},"fabric.Image.filters"):e&&e()},_setWidthHeight:function(t){t||(t={});var e=this.getElement();this.width=t.width||e.naturalWidth||e.width||0,this.height=t.height||e.naturalHeight||e.height||0},parsePreserveAspectRatioAttribute:function(){var t,e=r.util.parsePreserveAspectRatioAttribute(this.preserveAspectRatio||""),i=this._element.width,n=this._element.height,s=1,o=1,a=0,l=0,c=0,h=0,u=this.width,f=this.height,d={width:u,height:f};return e&&("none"!==e.alignX||"none"!==e.alignY)?("meet"===e.meetOrSlice&&(t=(u-i*(s=o=r.util.findScaleToFit(this._element,d)))/2,"Min"===e.alignX&&(a=-t),"Max"===e.alignX&&(a=t),t=(f-n*o)/2,"Min"===e.alignY&&(l=-t),"Max"===e.alignY&&(l=t)),"slice"===e.meetOrSlice&&(t=i-u/(s=o=r.util.findScaleToCover(this._element,d)),"Mid"===e.alignX&&(c=t/2),"Max"===e.alignX&&(c=t),t=n-f/o,"Mid"===e.alignY&&(h=t/2),"Max"===e.alignY&&(h=t),i=u/s,n=f/o)):(s=u/i,o=f/n),{width:i,height:n,scaleX:s,scaleY:o,offsetLeft:a,offsetTop:l,cropX:c,cropY:h}}}),r.Image.CSS_CANVAS="canvas-img",r.Image.prototype.getSvgSrc=r.Image.prototype.getSrc,r.Image.fromObject=function(t,e){var i=r.util.object.clone(t);r.util.loadImage(i.src,function(t,n){if(n){e&&e(null,!0);return}r.Image.prototype._initFilters.call(i,i.filters,function(n){i.filters=n||[],r.Image.prototype._initFilters.call(i,[i.resizeFilter],function(n){i.resizeFilter=n[0],r.util.enlivenObjectEnlivables(i,i,function(){e(new r.Image(t,i),!1)})})})},null,i.crossOrigin)},r.Image.fromURL=function(t,e,i){r.util.loadImage(t,function(t,n){e&&e(new r.Image(t,i),n)},null,i&&i.crossOrigin)},r.Image.ATTRIBUTE_NAMES=r.SHARED_ATTRIBUTES.concat("x y width height preserveAspectRatio xlink:href crossOrigin image-rendering".split(" ")),r.Image.fromElement=function(t,i,n){var s=r.parseAttributes(t,r.Image.ATTRIBUTE_NAMES);r.Image.fromURL(s["xlink:href"],i,e(n?r.util.object.clone(n):{},s))}}(i),r.util.object.extend(r.Object.prototype,{_getAngleValueForStraighten:function(){var t=this.angle%360;return t>0?90*Math.round((t-1)/90):90*Math.round(t/90)},straighten:function(){return this.rotate(this._getAngleValueForStraighten())},fxStraighten:function(t){var e=function(){},i=(t=t||{}).onComplete||e,n=t.onChange||e,s=this;return r.util.animate({target:this,startValue:this.get("angle"),endValue:this._getAngleValueForStraighten(),duration:this.FX_DURATION,onChange:function(t){s.rotate(t),n()},onComplete:function(){s.setCoords(),i()}})}}),r.util.object.extend(r.StaticCanvas.prototype,{straightenObject:function(t){return t.straighten(),this.requestRenderAll(),this},fxStraightenObject:function(t){return t.fxStraighten({onChange:this.requestRenderAllBound})}}),function(){"use strict";function t(t){t&&t.tileSize&&(this.tileSize=t.tileSize),this.setupGLContext(this.tileSize,this.tileSize),this.captureGPUInfo()}r.isWebglSupported=function(t){if(r.isLikelyNode)return!1;t=t||r.WebglFilterBackend.prototype.tileSize;var e=document.createElement("canvas"),i=e.getContext("webgl")||e.getContext("experimental-webgl"),n=!1;if(i){r.maxTextureSize=i.getParameter(i.MAX_TEXTURE_SIZE),n=r.maxTextureSize>=t;for(var s=["highp","mediump","lowp"],o=0;o<3;o++)if(function(t,e){var i=t.createShader(t.FRAGMENT_SHADER);return t.shaderSource(i,"precision "+e+" float;\nvoid main(){}"),t.compileShader(i),!!t.getShaderParameter(i,t.COMPILE_STATUS)}(i,s[o])){r.webGlPrecision=s[o];break}}return this.isSupported=n,n},r.WebglFilterBackend=t,t.prototype={tileSize:2048,resources:{},setupGLContext:function(t,e){this.dispose(),this.createWebGLCanvas(t,e),this.aPosition=new Float32Array([0,0,0,1,1,0,1,1]),this.chooseFastestCopyGLTo2DMethod(t,e)},chooseFastestCopyGLTo2DMethod:function(t,e){var i,n,s,l=void 0!==window.performance;try{new ImageData(1,1),s=!0}catch(t){s=!1}var c="undefined"!=typeof ArrayBuffer,h="undefined"!=typeof Uint8ClampedArray;if(l&&s&&c&&h){var u=r.util.createCanvasElement(),f=new ArrayBuffer(t*e*4);if(r.forceGLPutImageData){this.imageBuffer=f,this.copyGLTo2D=a;return}var d={imageBuffer:f,destinationWidth:t,destinationHeight:e,targetCanvas:u};u.width=t,u.height=e,i=window.performance.now(),o.call(d,this.gl,d),n=window.performance.now()-i,i=window.performance.now(),a.call(d,this.gl,d),n>window.performance.now()-i?(this.imageBuffer=f,this.copyGLTo2D=a):this.copyGLTo2D=o}},createWebGLCanvas:function(t,e){var i=r.util.createCanvasElement();i.width=t,i.height=e;var n={alpha:!0,premultipliedAlpha:!1,depth:!1,stencil:!1,antialias:!1},s=i.getContext("webgl",n);s||(s=i.getContext("experimental-webgl",n)),s&&(s.clearColor(0,0,0,0),this.canvas=i,this.gl=s)},applyFilters:function(t,e,i,n,r,s){var o,a,l,c,h,u,f,d=this.gl;s&&(f=this.getCachedTexture(s,e));var g={originalWidth:e.width||e.originalWidth,originalHeight:e.height||e.originalHeight,sourceWidth:i,sourceHeight:n,destinationWidth:i,destinationHeight:n,context:d,sourceTexture:this.createTexture(d,i,n,!f&&e),targetTexture:this.createTexture(d,i,n),originalTexture:f||this.createTexture(d,i,n,!f&&e),passes:t.length,webgl:!0,aPosition:this.aPosition,programCache:this.programCache,pass:0,filterBackend:this,targetCanvas:r},p=d.createFramebuffer();return d.bindFramebuffer(d.FRAMEBUFFER,p),t.forEach(function(t){t&&t.applyTo(g)}),l=(a=(o=g).targetCanvas).width,c=a.height,h=o.destinationWidth,u=o.destinationHeight,(l!==h||c!==u)&&(a.width=h,a.height=u),this.copyGLTo2D(d,g),d.bindTexture(d.TEXTURE_2D,null),d.deleteTexture(g.sourceTexture),d.deleteTexture(g.targetTexture),d.deleteFramebuffer(p),r.getContext("2d").setTransform(1,0,0,1,0,0),g},dispose:function(){this.canvas&&(this.canvas=null,this.gl=null),this.clearWebGLCaches()},clearWebGLCaches:function(){this.programCache={},this.textureCache={}},createTexture:function(t,e,i,n,r){var s=t.createTexture();return t.bindTexture(t.TEXTURE_2D,s),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,r||t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,r||t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),n?t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,n):t.texImage2D(t.TEXTURE_2D,0,t.RGBA,e,i,0,t.RGBA,t.UNSIGNED_BYTE,null),s},getCachedTexture:function(t,e){if(this.textureCache[t])return this.textureCache[t];var i=this.createTexture(this.gl,e.width,e.height,e);return this.textureCache[t]=i,i},evictCachesForKey:function(t){this.textureCache[t]&&(this.gl.deleteTexture(this.textureCache[t]),delete this.textureCache[t])},copyGLTo2D:o,captureGPUInfo:function(){if(this.gpuInfo)return this.gpuInfo;var t=this.gl,e={renderer:"",vendor:""};if(!t)return e;var i=t.getExtension("WEBGL_debug_renderer_info");if(i){var n=t.getParameter(i.UNMASKED_RENDERER_WEBGL),r=t.getParameter(i.UNMASKED_VENDOR_WEBGL);n&&(e.renderer=n.toLowerCase()),r&&(e.vendor=r.toLowerCase())}return this.gpuInfo=e,e}}}(),!function(){"use strict";var t=function(){};function e(){}r.Canvas2dFilterBackend=e,e.prototype={evictCachesForKey:t,dispose:t,clearWebGLCaches:t,resources:{},applyFilters:function(t,e,i,n,r){var s=r.getContext("2d");s.drawImage(e,0,0,i,n);var o=s.getImageData(0,0,i,n),a=s.getImageData(0,0,i,n),l={sourceWidth:i,sourceHeight:n,imageData:o,originalEl:e,originalImageData:a,canvasEl:r,ctx:s,filterBackend:this};return t.forEach(function(t){t.applyTo(l)}),(l.imageData.width!==i||l.imageData.height!==n)&&(r.width=l.imageData.width,r.height=l.imageData.height),s.putImageData(l.imageData,0,0),l}}}(),r.Image=r.Image||{},r.Image.filters=r.Image.filters||{},r.Image.filters.BaseFilter=r.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(t){t&&this.setOptions(t)},setOptions:function(t){for(var e in t)this[e]=t[e]},createProgram:function(t,e,i){e=e||this.fragmentSource,i=i||this.vertexSource,"highp"!==r.webGlPrecision&&(e=e.replace(/precision highp float/g,"precision "+r.webGlPrecision+" float"));var n=t.createShader(t.VERTEX_SHADER);if(t.shaderSource(n,i),t.compileShader(n),!t.getShaderParameter(n,t.COMPILE_STATUS))throw Error("Vertex shader compile error for "+this.type+": "+t.getShaderInfoLog(n));var s=t.createShader(t.FRAGMENT_SHADER);if(t.shaderSource(s,e),t.compileShader(s),!t.getShaderParameter(s,t.COMPILE_STATUS))throw Error("Fragment shader compile error for "+this.type+": "+t.getShaderInfoLog(s));var o=t.createProgram();if(t.attachShader(o,n),t.attachShader(o,s),t.linkProgram(o),!t.getProgramParameter(o,t.LINK_STATUS))throw Error('Shader link error for "${this.type}" '+t.getProgramInfoLog(o));var a=this.getAttributeLocations(t,o),l=this.getUniformLocations(t,o)||{};return l.uStepW=t.getUniformLocation(o,"uStepW"),l.uStepH=t.getUniformLocation(o,"uStepH"),{program:o,attributeLocations:a,uniformLocations:l}},getAttributeLocations:function(t,e){return{aPosition:t.getAttribLocation(e,"aPosition")}},getUniformLocations:function(){return{}},sendAttributeData:function(t,e,i){var n=e.aPosition,r=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,r),t.enableVertexAttribArray(n),t.vertexAttribPointer(n,2,t.FLOAT,!1,0,0),t.bufferData(t.ARRAY_BUFFER,i,t.STATIC_DRAW)},_setupFrameBuffer:function(t){var e,i,n=t.context;t.passes>1?(e=t.destinationWidth,i=t.destinationHeight,(t.sourceWidth!==e||t.sourceHeight!==i)&&(n.deleteTexture(t.targetTexture),t.targetTexture=t.filterBackend.createTexture(n,e,i)),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,t.targetTexture,0)):(n.bindFramebuffer(n.FRAMEBUFFER,null),n.finish())},_swapTextures:function(t){t.passes--,t.pass++;var e=t.targetTexture;t.targetTexture=t.sourceTexture,t.sourceTexture=e},isNeutralState:function(){var t=this.mainParameter,e=r.Image.filters[this.type].prototype;if(!t)return!1;if(!Array.isArray(e[t]))return e[t]===this[t];for(var i=e[t].length;i--;)if(this[t][i]!==e[t][i])return!1;return!0},applyTo:function(t){t.webgl?(this._setupFrameBuffer(t),this.applyToWebGL(t),this._swapTextures(t)):this.applyTo2d(t)},retrieveShader:function(t){return t.programCache.hasOwnProperty(this.type)||(t.programCache[this.type]=this.createProgram(t.context)),t.programCache[this.type]},applyToWebGL:function(t){var e=t.context,i=this.retrieveShader(t);0===t.pass&&t.originalTexture?e.bindTexture(e.TEXTURE_2D,t.originalTexture):e.bindTexture(e.TEXTURE_2D,t.sourceTexture),e.useProgram(i.program),this.sendAttributeData(e,i.attributeLocations,t.aPosition),e.uniform1f(i.uniformLocations.uStepW,1/t.sourceWidth),e.uniform1f(i.uniformLocations.uStepH,1/t.sourceHeight),this.sendUniformData(e,i.uniformLocations),e.viewport(0,0,t.destinationWidth,t.destinationHeight),e.drawArrays(e.TRIANGLE_STRIP,0,4)},bindAdditionalTexture:function(t,e,i){t.activeTexture(i),t.bindTexture(t.TEXTURE_2D,e),t.activeTexture(t.TEXTURE0)},unbindAdditionalTexture:function(t,e){t.activeTexture(e),t.bindTexture(t.TEXTURE_2D,null),t.activeTexture(t.TEXTURE0)},getMainParameter:function(){return this[this.mainParameter]},setMainParameter:function(t){this[this.mainParameter]=t},sendUniformData:function(){},createHelpLayer:function(t){if(!t.helpLayer){var e=document.createElement("canvas");e.width=t.sourceWidth,e.height=t.sourceHeight,t.helpLayer=e}},toObject:function(){var t={type:this.type},e=this.mainParameter;return e&&(t[e]=this[e]),t},toJSON:function(){return this.toObject()}}),r.Image.filters.BaseFilter.fromObject=function(t,e){var i=new r.Image.filters[t.type](t);return e&&e(i),i},function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.Image.filters;i.ColorMatrix=(0,e.util.createClass)(i.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(t){this.callSuper("initialize",t),this.matrix=this.matrix.slice(0)},applyTo2d:function(t){var e,i,n,r,s,o=t.imageData.data,a=o.length,l=this.matrix,c=this.colorsOnly;for(s=0;s=_||o<0||o>=x||(l=(a*x+o)*4,c=m[d*y+f],e+=p[l]*c,i+=p[l+1]*c,n+=p[l+2]*c,w||(r+=p[l+3]*c));S[s]=e,S[s+1]=i,S[s+2]=n,w?S[s+3]=p[s+3]:S[s+3]=r}t.imageData=C},getUniformLocations:function(t,e){return{uMatrix:t.getUniformLocation(e,"uMatrix"),uOpaque:t.getUniformLocation(e,"uOpaque"),uHalfSize:t.getUniformLocation(e,"uHalfSize"),uSize:t.getUniformLocation(e,"uSize")}},sendUniformData:function(t,e){t.uniform1fv(e.uMatrix,this.matrix)},toObject:function(){return i(this.callSuper("toObject"),{opaque:this.opaque,matrix:this.matrix})}}),e.Image.filters.Convolute.fromObject=e.Image.filters.BaseFilter.fromObject}(i),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.Image.filters;i.Grayscale=(0,e.util.createClass)(i.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(t){var e,i,n=t.imageData.data,r=n.length,s=this.mode;for(e=0;ec[0]&&r>c[1]&&s>c[2]&&n 0.0) {\n"+this.fragmentSource[t]+"}\n}"},retrieveShader:function(t){var e,i=this.type+"_"+this.mode;return t.programCache.hasOwnProperty(i)||(e=this.buildSource(this.mode),t.programCache[i]=this.createProgram(t.context,e)),t.programCache[i]},applyTo2d:function(t){var i,n,r,s,o,a,l,c=t.imageData.data,h=c.length,u=1-this.alpha;i=(l=new e.Color(this.color).getSource())[0]*this.alpha,n=l[1]*this.alpha,r=l[2]*this.alpha;for(var f=0;f=t||e<=-t)return 0;if(e<11920929e-14&&e>-11920929e-14)return 1;var i=(e*=Math.PI)/t;return a(e)/e*a(i)/i}},applyTo2d:function(t){var e=t.imageData,i=this.scaleX,n=this.scaleY;this.rcpScaleX=1/i,this.rcpScaleY=1/n;var r,s=e.width,a=e.height,l=o(s*i),c=o(a*n);"sliceHack"===this.resizeType?r=this.sliceByTwo(t,s,a,l,c):"hermite"===this.resizeType?r=this.hermiteFastResize(t,s,a,l,c):"bilinear"===this.resizeType?r=this.bilinearFiltering(t,s,a,l,c):"lanczos"===this.resizeType&&(r=this.lanczosResize(t,s,a,l,c)),t.imageData=r},sliceByTwo:function(t,i,r,s,o){var a,l,c=t.imageData,h=!1,u=!1,f=.5*i,d=.5*r,g=e.filterBackend.resources,p=0,m=0,y=i,b=0;for(g.sliceByTwo||(g.sliceByTwo=document.createElement("canvas")),((a=g.sliceByTwo).width<1.5*i||a.height=e)){_[D=n(1e3*s(T-C.x))]||(_[D]={});for(var R=S.y-x;R<=S.y+x;R++)R<0||R>=o||(F=n(1e3*s(R-C.y)),_[D][F]||(_[D][F]=d(r(i(D*m,2)+i(F*y,2))/1e3)),(O=_[D][F])>0&&(k=(R*e+T)*4,E+=O,j+=O*h[k],M+=O*h[k+1],P+=O*h[k+2],A+=O*h[k+3]))}f[k=(w*a+l)*4]=j/E,f[k+1]=M/E,f[k+2]=P/E,f[k+3]=A/E}return++l1&&F<-1||(x=2*F*F*F-3*F*F+1)>0&&(O+=x*d[(D=4*(A+E*e))+3],C+=x,d[D+3]<255&&(x=x*d[D+3]/250),S+=x*d[D],w+=x*d[D+1],T+=x*d[D+2],_+=x)}p[b]=S/_,p[b+1]=w/_,p[b+2]=T/_,p[b+3]=O/C}return g},toObject:function(){return{type:this.type,scaleX:this.scaleX,scaleY:this.scaleY,resizeType:this.resizeType,lanczosLobes:this.lanczosLobes}}}),e.Image.filters.Resize.fromObject=e.Image.filters.BaseFilter.fromObject}(i),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.Image.filters;i.Contrast=(0,e.util.createClass)(i.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(t){if(0!==this.contrast){var e,i,n=t.imageData.data,i=n.length,r=Math.floor(255*this.contrast),s=259*(r+255)/(255*(259-r));for(e=0;e1&&(e=1/this.aspectRatio):this.aspectRatio<1&&(e=this.aspectRatio),t=e*this.blur*.12,this.horizontal?i[0]=t:i[1]=t,i}}),i.Blur.fromObject=e.Image.filters.BaseFilter.fromObject}(i),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.Image.filters;i.Gamma=(0,e.util.createClass)(i.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(t){this.gamma=[1,1,1],i.BaseFilter.prototype.initialize.call(this,t)},applyTo2d:function(t){var e,i=t.imageData.data,n=this.gamma,r=i.length,s=1/n[0],o=1/n[1],a=1/n[2];for(this.rVals||(this.rVals=new Uint8Array(256),this.gVals=new Uint8Array(256),this.bVals=new Uint8Array(256)),e=0,r=256;e'},_getCacheCanvasDimensions:function(){var t=this.callSuper("_getCacheCanvasDimensions"),e=this.fontSize;return t.width+=e*t.zoomX,t.height+=e*t.zoomY,t},_render:function(t){var e=this.path;e&&!e.isNotVisible()&&e._render(t),this._setTextStyles(t),this._renderTextLinesBackground(t),this._renderTextDecoration(t,"underline"),this._renderText(t),this._renderTextDecoration(t,"overline"),this._renderTextDecoration(t,"linethrough")},_renderText:function(t){"stroke"===this.paintFirst?(this._renderTextStroke(t),this._renderTextFill(t)):(this._renderTextFill(t),this._renderTextStroke(t))},_setTextStyles:function(t,e,i){if(t.textBaseline="alphabetic",this.path)switch(this.pathAlign){case"center":t.textBaseline="middle";break;case"ascender":t.textBaseline="top";break;case"descender":t.textBaseline="bottom"}t.font=this._getFontDeclaration(e,i)},calcTextWidth:function(){for(var t=this.getLineWidth(0),e=1,i=this._textLines.length;et&&(t=n)}return t},_renderTextLine:function(t,e,i,n,r,s){this._renderChars(t,e,i,n,r,s)},_renderTextLinesBackground:function(t){if(this.textBackgroundColor||this.styleHas("textBackgroundColor")){for(var e,i,n,r,s,o,a,l=t.fillStyle,c=this._getLeftOffset(),h=this._getTopOffset(),u=0,f=0,d=this.path,g=0,p=this._textLines.length;g=0:ia?u%=a:u<0&&(u+=a),this._setGraphemeOnPath(u,s,o),u+=s.kernedWidth}return{width:l,numOfSpaces:0}},_setGraphemeOnPath:function(t,i,n){var r=t+i.kernedWidth/2,s=this.path,o=e.util.getPointOnPath(s.path,r,s.segmentsInfo);i.renderLeft=o.x-n.x,i.renderTop=o.y-n.y,i.angle=o.angle+("right"===this.pathSide?Math.PI:0)},_getGraphemeBox:function(t,e,i,n,r){var s,o=this.getCompleteStyleDeclaration(e,i),a=n?this.getCompleteStyleDeclaration(e,i-1):{},l=this._measureChar(t,o,n,a),c=l.kernedWidth,h=l.width;0!==this.charSpacing&&(h+=s=this._getWidthOfCharSpacing(),c+=s);var u={width:h,left:0,height:o.fontSize,kernedWidth:c,deltaY:o.deltaY};if(i>0&&!r){var f=this.__charBounds[e][i-1];u.left=f.left+f.width+l.kernedWidth-l.width}return u},getHeightOfLine:function(t){if(this.__lineHeights[t])return this.__lineHeights[t];for(var e=this._textLines[t],i=this.getHeightOfChar(t,0),n=1,r=e.length;n0){var E=b+s+u;"rtl"===this.direction&&(E=this.width-E-f),c&&y&&(t.fillStyle=y,t.fillRect(E,h+S*n+o,f,this.fontSize/15)),u=d.left,f=d.width,c=g,y=m,n=r,o=a}else f+=d.kernedWidth;var E=b+s+u;"rtl"===this.direction&&(E=this.width-E-f),t.fillStyle=m,g&&m&&t.fillRect(E,h+S*n+o,f-C,this.fontSize/15),x+=i}t.restore()}},_getFontDeclaration:function(t,i){var n=t||this,r=this.fontFamily,s=e.Text.genericFonts.indexOf(r.toLowerCase())>-1,o=void 0===r||r.indexOf("'")>-1||r.indexOf(",")>-1||r.indexOf('"')>-1||s?n.fontFamily:'"'+n.fontFamily+'"';return[e.isLikelyNode?n.fontWeight:n.fontStyle,e.isLikelyNode?n.fontStyle:n.fontWeight,i?this.CACHE_FONT_SIZE+"px":n.fontSize+"px",o].join(" ")},render:function(t){this.visible&&(!this.canvas||!this.canvas.skipOffscreen||this.group||this.isOnScreen())&&(this._shouldClearDimensionCache()&&this.initDimensions(),this.callSuper("render",t))},_splitTextIntoLines:function(t){for(var i=t.split(this._reNewline),n=Array(i.length),r=["\n"],s=[],o=0;o-1&&(t.underline=!0),t.textDecoration.indexOf("line-through")>-1&&(t.linethrough=!0),t.textDecoration.indexOf("overline")>-1&&(t.overline=!0),delete t.textDecoration)}r.IText=r.util.createClass(r.Text,r.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(t,e){this.callSuper("initialize",t,e),this.initBehavior()},setSelectionStart:function(t){t=Math.max(t,0),this._updateAndFire("selectionStart",t)},setSelectionEnd:function(t){t=Math.min(t,this.text.length),this._updateAndFire("selectionEnd",t)},_updateAndFire:function(t,e){this[t]!==e&&(this._fireSelectionChanged(),this[t]=e),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(t){this.clearContextTop(),this.callSuper("render",t),this.cursorOffsetCache={},this.renderCursorOrSelection()},_render:function(t){this.callSuper("_render",t)},clearContextTop:function(t){if(this.isEditing&&this.canvas&&this.canvas.contextTop){var e=this.canvas.contextTop,i=this.canvas.viewportTransform;e.save(),e.transform(i[0],i[1],i[2],i[3],i[4],i[5]),this.transform(e),this._clearTextArea(e),t||e.restore()}},renderCursorOrSelection:function(){if(this.isEditing&&this.canvas&&this.canvas.contextTop){var t=this._getCursorBoundaries(),e=this.canvas.contextTop;this.clearContextTop(!0),this.selectionStart===this.selectionEnd?this.renderCursor(t,e):this.renderSelection(t,e),e.restore()}},_clearTextArea:function(t){var e=this.width+4,i=this.height+4;t.clearRect(-e/2,-i/2,e,i)},_getCursorBoundaries:function(t){void 0===t&&(t=this.selectionStart);var e=this._getLeftOffset(),i=this._getTopOffset(),n=this._getCursorBoundariesOffsets(t);return{left:e,top:i,leftOffset:n.left,topOffset:n.top}},_getCursorBoundariesOffsets:function(t){if(this.cursorOffsetCache&&"top"in this.cursorOffsetCache)return this.cursorOffsetCache;var e,i,n,r,s=0,o=0,a=this.get2DCursorLocation(t);n=a.charIndex,i=a.lineIndex;for(var l=0;l0?o:0)},"rtl"===this.direction&&(r.left*=-1),this.cursorOffsetCache=r,this.cursorOffsetCache},renderCursor:function(t,e){var i=this.get2DCursorLocation(),n=i.lineIndex,r=i.charIndex>0?i.charIndex-1:0,s=this.getValueOfPropertyAt(n,r,"fontSize"),o=this.scaleX*this.canvas.getZoom(),a=this.cursorWidth/o,l=t.topOffset,c=this.getValueOfPropertyAt(n,r,"deltaY");l+=(1-this._fontSizeFraction)*this.getHeightOfLine(n)/this.lineHeight-s*(1-this._fontSizeFraction),this.inCompositionMode&&this.renderSelection(t,e),e.fillStyle=this.cursorColor||this.getValueOfPropertyAt(n,r,"fill"),e.globalAlpha=this.__isMousedown?1:this._currentCursorOpacity,e.fillRect(t.left+t.leftOffset-a/2,l+t.top+c,a,s)},renderSelection:function(t,e){for(var i=this.inCompositionMode?this.hiddenTextarea.selectionStart:this.selectionStart,n=this.inCompositionMode?this.hiddenTextarea.selectionEnd:this.selectionEnd,r=-1!==this.textAlign.indexOf("justify"),s=this.get2DCursorLocation(i),o=this.get2DCursorLocation(n),a=s.lineIndex,l=o.lineIndex,c=s.charIndex<0?0:s.charIndex,h=o.charIndex<0?0:o.charIndex,u=a;u<=l;u++){var f=this._getLineLeftOffset(u)||0,d=this.getHeightOfLine(u),g=0,p=0,m=0;if(u===a&&(p=this.__charBounds[a][c].left),u>=a&&u1)&&(d/=this.lineHeight);var b=t.left+f+p,x=m-p,_=d,C=0;this.inCompositionMode?(e.fillStyle=this.compositionColor||"black",_=1,C=d):e.fillStyle=this.selectionColor,"rtl"===this.direction&&(b=this.width-b-x),e.fillRect(b,t.top+t.topOffset+C,x,_),t.topOffset+=g}},getCurrentCharFontSize:function(){var t=this._getCurrentCharIndex();return this.getValueOfPropertyAt(t.l,t.c,"fontSize")},getCurrentCharColor:function(){var t=this._getCurrentCharIndex();return this.getValueOfPropertyAt(t.l,t.c,"fill")},_getCurrentCharIndex:function(){var t=this.get2DCursorLocation(this.selectionStart,!0),e=t.charIndex>0?t.charIndex-1:0;return{l:t.lineIndex,c:e}}}),r.IText.fromObject=function(e,i){var n=r.util.stylesFromArray(e.styles,e.text),s=Object.assign({},e,{styles:n});if(delete s.path,t(s),s.styles)for(var o in s.styles)for(var a in s.styles[o])t(s.styles[o][a]);r.Object._fromObject("IText",s,function(t){e.path?r.Object._fromObject("Path",e.path,function(e){t.set("path",e),i(t)},"path"):i(t)},"text")}}(),function(){var t=r.util.object.clone;r.util.object.extend(r.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 t=this;this.on("added",function(){var e=t.canvas;e&&(e._hasITextHandlers||(e._hasITextHandlers=!0,t._initCanvasHandlers(e)),e._iTextInstances=e._iTextInstances||[],e._iTextInstances.push(t))})},initRemovedHandler:function(){var t=this;this.on("removed",function(){var e=t.canvas;e&&(e._iTextInstances=e._iTextInstances||[],r.util.removeFromArray(e._iTextInstances,t),0===e._iTextInstances.length&&(e._hasITextHandlers=!1,t._removeCanvasHandlers(e)))})},_initCanvasHandlers:function(t){t._mouseUpITextHandler=function(){t._iTextInstances&&t._iTextInstances.forEach(function(t){t.__isMousedown=!1})},t.on("mouse:up",t._mouseUpITextHandler)},_removeCanvasHandlers:function(t){t.off("mouse:up",t._mouseUpITextHandler)},_tick:function(){this._currentTickState=this._animateCursor(this,1,this.cursorDuration,"_onTickComplete")},_animateCursor:function(t,e,i,n){var r;return r={isAborted:!1,abort:function(){this.isAborted=!0}},t.animate("_currentCursorOpacity",e,{duration:i,onComplete:function(){r.isAborted||t[n]()},onChange:function(){t.canvas&&t.selectionStart===t.selectionEnd&&t.renderCursorOrSelection()},abort:function(){return r.isAborted}}),r},_onTickComplete:function(){var t=this;this._cursorTimeout1&&clearTimeout(this._cursorTimeout1),this._cursorTimeout1=setTimeout(function(){t._currentTickCompleteState=t._animateCursor(t,0,this.cursorDuration/2,"_tick")},100)},initDelayedCursor:function(t){var e=this,i=t?0:this.cursorDelay;this.abortCursorAnimation(),this._currentCursorOpacity=1,this._cursorTimeout2=setTimeout(function(){e._tick()},i)},abortCursorAnimation:function(){var t=this._currentTickState||this._currentTickCompleteState,e=this.canvas;this._currentTickState&&this._currentTickState.abort(),this._currentTickCompleteState&&this._currentTickCompleteState.abort(),clearTimeout(this._cursorTimeout1),clearTimeout(this._cursorTimeout2),this._currentCursorOpacity=0,t&&e&&e.clearContext(e.contextTop||e.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(t){var e=0,i=t-1;if(this._reSpace.test(this._text[i]))for(;this._reSpace.test(this._text[i]);)e++,i--;for(;/\S/.test(this._text[i])&&i>-1;)e++,i--;return t-e},findWordBoundaryRight:function(t){var e=0,i=t;if(this._reSpace.test(this._text[i]))for(;this._reSpace.test(this._text[i]);)e++,i++;for(;/\S/.test(this._text[i])&&i-1;)e++,i--;return t-e},findLineBoundaryRight:function(t){for(var e=0,i=t;!/\n/.test(this._text[i])&&i0&&nthis.__selectionStartOnMouseDown?(this.selectionStart=this.__selectionStartOnMouseDown,this.selectionEnd=e):(this.selectionStart=e,this.selectionEnd=this.__selectionStartOnMouseDown),(this.selectionStart!==i||this.selectionEnd!==n)&&(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(t,e,i){var n=i.slice(0,t),s=r.util.string.graphemeSplit(n).length;if(t===e)return{selectionStart:s,selectionEnd:s};var o=i.slice(t,e);return{selectionStart:s,selectionEnd:s+r.util.string.graphemeSplit(o).length}},fromGraphemeToStringSelection:function(t,e,i){var n=i.slice(0,t).join("").length;return t===e?{selectionStart:n,selectionEnd:n}:{selectionStart:n,selectionEnd:n+i.slice(t,e).join("").length}},_updateTextarea:function(){if(this.cursorOffsetCache={},this.hiddenTextarea){if(!this.inCompositionMode){var t=this.fromGraphemeToStringSelection(this.selectionStart,this.selectionEnd,this._text);this.hiddenTextarea.selectionStart=t.selectionStart,this.hiddenTextarea.selectionEnd=t.selectionEnd}this.updateTextareaPosition()}},updateFromTextArea:function(){if(this.hiddenTextarea){this.cursorOffsetCache={},this.text=this.hiddenTextarea.value,this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords());var t=this.fromStringToGraphemeSelection(this.hiddenTextarea.selectionStart,this.hiddenTextarea.selectionEnd,this.hiddenTextarea.value);this.selectionEnd=this.selectionStart=t.selectionEnd,this.inCompositionMode||(this.selectionStart=t.selectionStart),this.updateTextareaPosition()}},updateTextareaPosition:function(){if(this.selectionStart===this.selectionEnd){var t=this._calcTextareaPosition();this.hiddenTextarea.style.left=t.left,this.hiddenTextarea.style.top=t.top}},_calcTextareaPosition:function(){if(!this.canvas)return{x:1,y:1};var t=this.inCompositionMode?this.compositionStart:this.selectionStart,e=this._getCursorBoundaries(t),i=this.get2DCursorLocation(t),n=i.lineIndex,s=i.charIndex,o=this.getValueOfPropertyAt(n,s,"fontSize")*this.lineHeight,a=e.leftOffset,l=this.calcTransformMatrix(),c={x:e.left+a,y:e.top+e.topOffset+o},h=this.canvas.getRetinaScaling(),u=this.canvas.upperCanvasEl,f=u.width/h,d=u.height/h,g=f-o,p=d-o,m=u.clientWidth/f,y=u.clientHeight/d;return c=r.util.transformPoint(c,l),c=r.util.transformPoint(c,this.canvas.viewportTransform),c.x*=m,c.y*=y,c.x<0&&(c.x=0),c.x>g&&(c.x=g),c.y<0&&(c.y=0),c.y>p&&(c.y=p),c.x+=this.canvas._offset.left,c.y+=this.canvas._offset.top,{left:c.x+"px",top:c.y+"px",fontSize:o+"px",charHeight:o}},_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 t=this._textBeforeEdit!==this.text,e=this.hiddenTextarea;return this.selected=!1,this.isEditing=!1,this.selectionEnd=this.selectionStart,e&&(e.blur&&e.blur(),e.parentNode&&e.parentNode.removeChild(e)),this.hiddenTextarea=null,this.abortCursorAnimation(),this._restoreEditingProps(),this._currentCursorOpacity=0,this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this.fire("editing:exited"),t&&this.fire("modified"),this.canvas&&(this.canvas.off("mouse:move",this.mouseMoveHandler),this.canvas.fire("text:editing:exited",{target:this}),t&&this.canvas.fire("object:modified",{target:this})),this},_removeExtraneousStyles:function(){for(var t in this.styles)this._textLines[t]||delete this.styles[t]},removeStyleFromTo:function(t,e){var i,n,r=this.get2DCursorLocation(t,!0),s=this.get2DCursorLocation(e,!0),o=r.lineIndex,a=r.charIndex,l=s.lineIndex,c=s.charIndex;if(o!==l){if(this.styles[o])for(i=a;i=c&&(n[h-f]=n[u],delete n[u])}},shiftLineStyles:function(e,i){var n=t(this.styles);for(var r in this.styles){var s=parseInt(r,10);s>e&&(this.styles[s+i]=n[s],n[s-i]||delete this.styles[s])}},restartCursorIfNeeded:function(){(!this._currentTickState||this._currentTickState.isAborted||!this._currentTickCompleteState||this._currentTickCompleteState.isAborted)&&this.initDelayedCursor()},insertNewlineStyleObject:function(e,i,n,r){var s,o={},a=!1,l=this._unwrappedTextLines[e].length,c=l===i;for(var h in n||(n=1),this.shiftLineStyles(e,n),this.styles[e]&&(s=this.styles[e][0===i?i:i-1]),this.styles[e]){var u=parseInt(h,10);u>=i&&(a=!0,o[u-i]=this.styles[e][h],c&&0===i||delete this.styles[e][h])}var f=!1;for(a&&!c&&(this.styles[e+n]=o,f=!0),(f||l>i)&&n--;n>0;)r&&r[n-1]?this.styles[e+n]={0:t(r[n-1])}:s?this.styles[e+n]={0:t(s)}:delete this.styles[e+n],n--;this._forceClearCache=!0},insertCharStyleObject:function(e,i,n,r){this.styles||(this.styles={});var s=this.styles[e],o=s?t(s):{};for(var a in n||(n=1),o){var l=parseInt(a,10);l>=i&&(s[l+n]=o[l],o[l-n]||delete s[l])}if(this._forceClearCache=!0,r){for(;n--;)Object.keys(r[n]).length&&(this.styles[e]||(this.styles[e]={}),this.styles[e][i+n]=t(r[n]));return}if(s)for(var c=s[i?i-1:1];c&&n--;)this.styles[e][i+n]=t(c)},insertNewStyleBlock:function(t,e,i){for(var n=this.get2DCursorLocation(e,!0),r=[0],s=0,o=0;o0&&(this.insertCharStyleObject(n.lineIndex,n.charIndex,r[0],i),i=i&&i.slice(r[0]+1)),s&&this.insertNewlineStyleObject(n.lineIndex,n.charIndex+r[0],s);for(var o=1;o0?this.insertCharStyleObject(n.lineIndex+o,0,r[o],i):i&&this.styles[n.lineIndex+o]&&i[0]&&(this.styles[n.lineIndex+o][0]=i[0]),i=i&&i.slice(r[o]+1);r[o]>0&&this.insertCharStyleObject(n.lineIndex+o,0,r[o],i)},setSelectionStartEndWithShift:function(t,e,i){i<=t?(e===t?this._selectionDirection="left":"right"===this._selectionDirection&&(this._selectionDirection="left",this.selectionEnd=t),this.selectionStart=i):i>t&&it?this.selectionStart=t:this.selectionStart<0&&(this.selectionStart=0),this.selectionEnd>t?this.selectionEnd=t:this.selectionEnd<0&&(this.selectionEnd=0)}})}(),r.util.object.extend(r.IText.prototype,{initDoubleClickSimulation:function(){this.__lastClickTime=+new Date,this.__lastLastClickTime=+new Date,this.__lastPointer={},this.on("mousedown",this.onMouseDown)},onMouseDown:function(t){if(this.canvas){this.__newClickTime=+new Date;var e=t.pointer;this.isTripleClick(e)&&(this.fire("tripleclick",t),this._stopEvent(t.e)),this.__lastLastClickTime=this.__lastClickTime,this.__lastClickTime=this.__newClickTime,this.__lastPointer=e,this.__lastIsEditing=this.isEditing,this.__lastSelected=this.selected}},isTripleClick:function(t){return this.__newClickTime-this.__lastClickTime<500&&this.__lastClickTime-this.__lastLastClickTime<500&&this.__lastPointer.x===t.x&&this.__lastPointer.y===t.y},_stopEvent:function(t){t.preventDefault&&t.preventDefault(),t.stopPropagation&&t.stopPropagation()},initCursorSelectionHandlers:function(){this.initMousedownHandler(),this.initMouseupHandler(),this.initClicks()},doubleClickHandler:function(t){this.isEditing&&this.selectWord(this.getSelectionStartFromPointer(t.e))},tripleClickHandler:function(t){this.isEditing&&this.selectLine(this.getSelectionStartFromPointer(t.e))},initClicks:function(){this.on("mousedblclick",this.doubleClickHandler),this.on("tripleclick",this.tripleClickHandler)},_mouseDownHandler:function(t){this.canvas&&this.editable&&(!t.e.button||1===t.e.button)&&(this.__isMousedown=!0,this.selected&&(this.inCompositionMode=!1,this.setCursorByClick(t.e)),this.isEditing&&(this.__selectionStartOnMouseDown=this.selectionStart,this.selectionStart===this.selectionEnd&&this.abortCursorAnimation(),this.renderCursorOrSelection()))},_mouseDownHandlerBefore:function(t){this.canvas&&this.editable&&(!t.e.button||1===t.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(t){if(this.__isMousedown=!1,this.editable&&!this.group&&(!t.transform||!t.transform.actionPerformed)&&(!t.e.button||1===t.e.button)){if(this.canvas){var e=this.canvas._activeObject;if(e&&e!==this)return}this.__lastSelected&&!this.__corner?(this.selected=!1,this.__lastSelected=!1,this.enterEditing(t.e),this.selectionStart===this.selectionEnd?this.initDelayedCursor(!0):this.renderCursorOrSelection()):this.selected=!0}},setCursorByClick:function(t){var e=this.getSelectionStartFromPointer(t),i=this.selectionStart,n=this.selectionEnd;t.shiftKey?this.setSelectionStartEndWithShift(i,n,e):(this.selectionStart=e,this.selectionEnd=e),this.isEditing&&(this._fireSelectionChanged(),this._updateTextarea())},getSelectionStartFromPointer:function(t){for(var e,i=this.getLocalPointer(t),n=0,r=0,s=0,o=0,a=0,l=0,c=this._textLines.length;l0&&(o+=this._textLines[l-1].length+this.missingNewlineOffset(l-1));else break;r=this._getLineLeftOffset(a)*this.scaleX,e=this._textLines[a],"rtl"===this.direction&&(i.x=this.width*this.scaleX-i.x+r);for(var h=0,u=e.length;hs||o<0?0:1);return this.flipX&&(a=r-a),a>this._text.length&&(a=this._text.length),a}}),r.util.object.extend(r.IText.prototype,{initHiddenTextarea:function(){this.hiddenTextarea=r.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 t=this._calcTextareaPosition();this.hiddenTextarea.style.cssText="position: absolute; top: "+t.top+"; left: "+t.left+"; z-index: -999; opacity: 0; width: 1px; height: 1px; font-size: 1px; padding-top: "+t.fontSize+";",this.hiddenTextareaContainer?this.hiddenTextareaContainer.appendChild(this.hiddenTextarea):r.document.body.appendChild(this.hiddenTextarea),r.util.addListener(this.hiddenTextarea,"keydown",this.onKeyDown.bind(this)),r.util.addListener(this.hiddenTextarea,"keyup",this.onKeyUp.bind(this)),r.util.addListener(this.hiddenTextarea,"input",this.onInput.bind(this)),r.util.addListener(this.hiddenTextarea,"copy",this.copy.bind(this)),r.util.addListener(this.hiddenTextarea,"cut",this.copy.bind(this)),r.util.addListener(this.hiddenTextarea,"paste",this.paste.bind(this)),r.util.addListener(this.hiddenTextarea,"compositionstart",this.onCompositionStart.bind(this)),r.util.addListener(this.hiddenTextarea,"compositionupdate",this.onCompositionUpdate.bind(this)),r.util.addListener(this.hiddenTextarea,"compositionend",this.onCompositionEnd.bind(this)),!this._clickHandlerInitialized&&this.canvas&&(r.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(t){if(this.isEditing){var e="rtl"===this.direction?this.keysMapRtl:this.keysMap;if(t.keyCode in e)this[e[t.keyCode]](t);else{if(!(t.keyCode in this.ctrlKeysMapDown)||!t.ctrlKey&&!t.metaKey)return;this[this.ctrlKeysMapDown[t.keyCode]](t)}t.stopImmediatePropagation(),t.preventDefault(),t.keyCode>=33&&t.keyCode<=40?(this.inCompositionMode=!1,this.clearContextTop(),this.renderCursorOrSelection()):this.canvas&&this.canvas.requestRenderAll()}},onKeyUp:function(t){if(!this.isEditing||this._copyDone||this.inCompositionMode){this._copyDone=!1;return}t.keyCode in this.ctrlKeysMapUp&&(t.ctrlKey||t.metaKey)&&(this[this.ctrlKeysMapUp[t.keyCode]](t),t.stopImmediatePropagation(),t.preventDefault(),this.canvas&&this.canvas.requestRenderAll())},onInput:function(t){var e=this.fromPaste;if(this.fromPaste=!1,t&&t.stopPropagation(),this.isEditing){var i,n,s,o,a,l=this._splitTextIntoLines(this.hiddenTextarea.value).graphemeText,c=this._text.length,h=l.length,u=h-c,f=this.selectionStart,d=this.selectionEnd,g=f!==d;if(""===this.hiddenTextarea.value){this.styles={},this.updateFromTextArea(),this.fire("changed"),this.canvas&&(this.canvas.fire("text:changed",{target:this}),this.canvas.requestRenderAll());return}var p=this.fromStringToGraphemeSelection(this.hiddenTextarea.selectionStart,this.hiddenTextarea.selectionEnd,this.hiddenTextarea.value),m=f>p.selectionStart;g?(i=this._text.slice(f,d),u+=d-f):h0&&(n+=(i=this.__charBounds[t][e-1]).left+i.width),n},getDownCursorOffset:function(t,e){var i=this._getSelectionForOffset(t,e),n=this.get2DCursorLocation(i),r=n.lineIndex;if(r===this._textLines.length-1||t.metaKey||34===t.keyCode)return this._text.length-i;var s=n.charIndex,o=this._getWidthBeforeCursor(r,s),a=this._getIndexOnLine(r+1,o);return this._textLines[r].slice(s).length+a+1+this.missingNewlineOffset(r)},_getSelectionForOffset:function(t,e){return t.shiftKey&&this.selectionStart!==this.selectionEnd&&e?this.selectionEnd:this.selectionStart},getUpCursorOffset:function(t,e){var i=this._getSelectionForOffset(t,e),n=this.get2DCursorLocation(i),r=n.lineIndex;if(0===r||t.metaKey||33===t.keyCode)return-i;var s=n.charIndex,o=this._getWidthBeforeCursor(r,s),a=this._getIndexOnLine(r-1,o),l=this._textLines[r].slice(0,s),c=this.missingNewlineOffset(r-1);return-this._textLines[r-1].length+a-l.length+(1-c)},_getIndexOnLine:function(t,e){for(var i,n,r=this._textLines[t],s=this._getLineLeftOffset(t),o=0,a=0,l=r.length;ae){n=!0;var c=Math.abs(s-i-e);o=Math.abs(s-e)=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorUpOrDown("Down",t)},moveCursorUp:function(t){(0!==this.selectionStart||0!==this.selectionEnd)&&this._moveCursorUpOrDown("Up",t)},_moveCursorUpOrDown:function(t,e){var i=this["get"+t+"CursorOffset"](e,"right"===this._selectionDirection);e.shiftKey?this.moveCursorWithShift(i):this.moveCursorWithoutShift(i),0!==i&&(this.setSelectionInBoundaries(),this.abortCursorAnimation(),this._currentCursorOpacity=1,this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea())},moveCursorWithShift:function(t){var e="left"===this._selectionDirection?this.selectionStart+t:this.selectionEnd+t;return this.setSelectionStartEndWithShift(this.selectionStart,this.selectionEnd,e),0!==t},moveCursorWithoutShift:function(t){return t<0?(this.selectionStart+=t,this.selectionEnd=this.selectionStart):(this.selectionEnd+=t,this.selectionStart=this.selectionEnd),0!==t},moveCursorLeft:function(t){(0!==this.selectionStart||0!==this.selectionEnd)&&this._moveCursorLeftOrRight("Left",t)},_move:function(t,e,i){var n;if(t.altKey)n=this["findWordBoundary"+i](this[e]);else{if(!t.metaKey&&35!==t.keyCode&&36!==t.keyCode)return this[e]+="Left"===i?-1:1,!0;n=this["findLineBoundary"+i](this[e])}if(void 0!==n&&this[e]!==n)return this[e]=n,!0},_moveLeft:function(t,e){return this._move(t,e,"Left")},_moveRight:function(t,e){return this._move(t,e,"Right")},moveCursorLeftWithoutShift:function(t){var e=!0;return this._selectionDirection="left",this.selectionEnd===this.selectionStart&&0!==this.selectionStart&&(e=this._moveLeft(t,"selectionStart")),this.selectionEnd=this.selectionStart,e},moveCursorLeftWithShift:function(t){return"right"===this._selectionDirection&&this.selectionStart!==this.selectionEnd?this._moveLeft(t,"selectionEnd"):0!==this.selectionStart?(this._selectionDirection="left",this._moveLeft(t,"selectionStart")):void 0},moveCursorRight:function(t){this.selectionStart>=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorLeftOrRight("Right",t)},_moveCursorLeftOrRight:function(t,e){var i="moveCursor"+t+"With";this._currentCursorOpacity=1,e.shiftKey?i+="Shift":i+="outShift",this[i](e)&&(this.abortCursorAnimation(),this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea())},moveCursorRightWithShift:function(t){return"left"===this._selectionDirection&&this.selectionStart!==this.selectionEnd?this._moveRight(t,"selectionStart"):this.selectionEnd!==this._text.length?(this._selectionDirection="right",this._moveRight(t,"selectionEnd")):void 0},moveCursorRightWithoutShift:function(t){var e=!0;return this._selectionDirection="right",this.selectionStart===this.selectionEnd?(e=this._moveRight(t,"selectionStart"),this.selectionEnd=this.selectionStart):this.selectionStart=this.selectionEnd,e},removeChars:function(t,e){void 0===e&&(e=t+1),this.removeStyleFromTo(t,e),this._text.splice(t,e-t),this.text=this._text.join(""),this.set("dirty",!0),this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this._removeExtraneousStyles()},insertChars:function(t,e,i,n){void 0===n&&(n=i),n>i&&this.removeStyleFromTo(i,n);var s=r.util.string.graphemeSplit(t);this.insertNewStyleBlock(s,i,e),this._text=[].concat(this._text.slice(0,i),s,this._text.slice(n)),this.text=this._text.join(""),this.set("dirty",!0),this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this._removeExtraneousStyles()}}),function(){var t=r.util.toFixed,e=r.util.radiansToDegrees,i=r.util.calcRotateMatrix,n=r.util.transformPoint,s=/ +/g;r.util.object.extend(r.Text.prototype,{_toSVG:function(){var t=this._getSVGLeftTopOffsets(),e=this._getSVGTextAndBg(t.textTop,t.textLeft);return this._wrapSVGTextAndBg(e)},toSVG:function(t){var e=this._createBaseSVGMarkup(this._toSVG(),{reviver:t,noStyle:!0,withShadow:!0}),i=this.path;return i?e+i._createBaseSVGMarkup(i._toSVG(),{reviver:t,withShadow:!0}):e},_getSVGLeftTopOffsets:function(){return{textLeft:-this.width/2,textTop:-this.height/2,lineTop:this.getHeightOfLine(0)}},_wrapSVGTextAndBg:function(t){var e=this.getSvgTextDecoration(this);return[t.textBgRects.join(""),' ",t.textSpans.join(""),"\n"]},_getSVGTextAndBg:function(t,e){var i,n=[],r=[],s=t;this._setSVGBg(r);for(var o=0,a=this._textLines.length;o"+r.util.string.escapeXml(o)+""},_setSVGTextLineText:function(t,e,i,n){var s,o,a,l,c,h=this.getHeightOfLine(e),u=-1!==this.textAlign.indexOf("justify"),f="",d=0,g=this._textLines[e];n+=h*(1-this._fontSizeFraction)/this.lineHeight;for(var p=0,m=g.length-1;p<=m;p++)c=p===m||this.charSpacing||this.path,f+=g[p],a=this.__charBounds[e][p],0===d?(i+=a.kernedWidth-a.width,d+=a.width):d+=a.kernedWidth,u&&!c&&this._reSpaceAndTab.test(g[p])&&(c=!0),c||(s=s||this.getCompleteStyleDeclaration(e,p),o=this.getCompleteStyleDeclaration(e,p+1),c=r.util.hasStyleChanged(s,o,!0)),c&&(l=this._getStyleDeclaration(e,p)||{},t.push(this._createTextCharSpan(f,l,i,n,a)),f="",s=o,i+=d,d=0)},_pushTextBgRect:function(e,i,n,s,o,a){var l=r.Object.NUM_FRACTION_DIGITS;e.push(" \n')},_setSVGTextLineBg:function(t,e,i,n){for(var r,s,o=this._textLines[e],a=this.getHeightOfLine(e)/this.lineHeight,l=0,c=0,h=this.getValueOfPropertyAt(e,0,"textBackgroundColor"),u=0,f=o.length;uthis.width&&this._set("width",this.dynamicMinWidth),-1!==this.textAlign.indexOf("justify")&&this.enlargeSpaces(),this.height=this.calcTextHeight(),this.saveState({propertySet:"_dimensionAffectingProps"}))},_generateStyleMap:function(t){for(var e=0,i=0,n=0,r={},s=0;s0?(i=0,n++,e++):!this.splitByGrapheme&&this._reSpaceAndTab.test(t.graphemeText[n])&&s>0&&(i++,n++),r[s]={line:e,offset:i},n+=t.graphemeLines[s].length,i+=t.graphemeLines[s].length;return r},styleHas:function(t,i){if(this._styleMap&&!this.isWrapping){var n=this._styleMap[i];n&&(i=n.line)}return e.Text.prototype.styleHas.call(this,t,i)},isEmptyStyles:function(t){if(!this.styles)return!0;var e,i,n=0,r=!1,s=this._styleMap[t],o=this._styleMap[t+1];for(var a in s&&(t=s.line,n=s.offset),o&&(r=o.line===t,e=o.offset),i=void 0===t?this.styles:{line:this.styles[t]})for(var l in i[a])if(l>=n&&(!r||ln&&!m?(a.push(l),l=[],s=d,m=!0):s+=y,m||o||l.push(f),l=l.concat(h),g=o?0:this._measureWord([f],i,u),u++,m=!1,d>p&&(p=d);return b&&a.push(l),p+r>this.dynamicMinWidth&&(this.dynamicMinWidth=p-y+r),a},isEndOfWrapping:function(t){return!this._styleMap[t+1]||this._styleMap[t+1].line!==this._styleMap[t].line},missingNewlineOffset:function(t,e){return this.splitByGrapheme&&!e?+!!this.isEndOfWrapping(t):1},_splitTextIntoLines:function(t){for(var i=e.Text.prototype._splitTextIntoLines.call(this,t),n=this._wrapText(i.lines,this.width),r=Array(n.length),s=0;s{!function(){"use strict";var i={}.hasOwnProperty;function n(){for(var t=[],e=0;e{t.v(t.b(["static/chunks/9338a92aac995757.js","static/chunks/a55df98dcb3b60ad.js","static/chunks/turbopack-95cb340f669027bc.js"]))},67585,(t,e,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"BailoutToCSR",{enumerable:!0,get:function(){return r}});let n=t.r(32061);function r(t){let{reason:e,children:i}=t;if("undefined"==typeof window)throw Object.defineProperty(new n.BailoutToCSRError(e),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return i}},9885,(t,e,i)=>{"use strict";function n(t){return t.split("/").map(t=>encodeURIComponent(t)).join("/")}Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"encodeURIPath",{enumerable:!0,get:function(){return n}})},52157,(t,e,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"PreloadChunks",{enumerable:!0,get:function(){return a}});let n=t.r(43476),r=t.r(74080),s=t.r(63599),o=t.r(9885);function a(t){let{moduleIds:e}=t;if("undefined"!=typeof window)return null;let i=s.workAsyncStorage.getStore();if(void 0===i)return null;let a=[];if(i.reactLoadableManifest&&e){let t=i.reactLoadableManifest;for(let i of e){if(!t[i])continue;let e=t[i].files;a.push(...e)}}return 0===a.length?null:(0,n.jsx)(n.Fragment,{children:a.map(t=>{let e=i.assetPrefix+"/_next/"+(0,o.encodeURIPath)(t);return t.endsWith(".css")?(0,n.jsx)("link",{precedence:"dynamic",href:e,rel:"stylesheet",as:"style"},t):((0,r.preload)(e,{as:"script",fetchPriority:"low"}),null)})})}},69093,(t,e,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"default",{enumerable:!0,get:function(){return c}});let n=t.r(43476),r=t.r(71645),s=t.r(67585),o=t.r(52157);function a(t){return{default:t&&"default"in t?t.default:t}}let l={loader:()=>Promise.resolve(a(()=>null)),loading:null,ssr:!0},c=function(t){let e={...l,...t},i=(0,r.lazy)(()=>e.loader().then(a)),c=e.loading;function h(t){let a=c?(0,n.jsx)(c,{isLoading:!0,pastDelay:!0,error:null}):null,l=!e.ssr||!!e.loading,h=l?r.Suspense:r.Fragment,u=e.ssr?(0,n.jsxs)(n.Fragment,{children:["undefined"==typeof window?(0,n.jsx)(o.PreloadChunks,{moduleIds:e.modules}):null,(0,n.jsx)(i,{...t})]}):(0,n.jsx)(s.BailoutToCSR,{reason:"next/dynamic",children:(0,n.jsx)(i,{...t})});return(0,n.jsx)(h,{...l?{fallback:a}:{},children:u})}return h.displayName="LoadableComponent",h}},70703,(t,e,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"default",{enumerable:!0,get:function(){return r}});let n=t.r(55682)._(t.r(69093));function r(t,e){var i;let r={};"function"==typeof t&&(r.loader=t);let s={...r,...e};return(0,n.default)({...s,modules:null==(i=s.loadableGenerated)?void 0:i.modules})}("function"==typeof i.default||"object"==typeof i.default&&null!==i.default)&&void 0===i.default.__esModule&&(Object.defineProperty(i.default,"__esModule",{value:!0}),Object.assign(i.default,i),e.exports=i.default)},52683,t=>{"use strict";let e;t.s(["default",()=>so],52683);var i,n,r,s,o,a,l,c,h,u,f,d,g,p,m,y,b,x,_,C,S,w,T,O,k,E,j,M,P,A,D,F,R,L,I=t.i(43476),B=t.i(71645),N=t.i(88174);let U=B.default.createContext(null);U.displayName="CanvasContext";let W=function(t){var e;let i=(0,B.useContext)(U);if(!i)throw Error("No CanvasContext.Provider");return void 0===t?i:null==t?{}:null!=(e=i.canvases[t])?e:{}},H=B.default.createContext(null);function X(){let t=(0,B.useContext)(H);if(!t)throw Error("No ToolsContext.Provider");return t}H.displayName="ToolsContext";let z=Math.min,Y=Math.max,G=Math.round,V=Math.floor,q=t=>({x:t,y:t}),K={left:"right",right:"left",bottom:"top",top:"bottom"},Q={start:"end",end:"start"};function J(t,e){return"function"==typeof t?t(e):t}function $(t){return t.split("-")[0]}function Z(t){return t.split("-")[1]}function tt(t){return"y"===t?"height":"width"}let te=new Set(["top","bottom"]);function ti(t){return te.has($(t))?"y":"x"}function tn(t){return"x"===ti(t)?"y":"x"}function tr(t){return t.replace(/start|end/g,t=>Q[t])}let ts=["left","right"],to=["right","left"],ta=["top","bottom"],tl=["bottom","top"];function tc(t){return t.replace(/left|right|bottom|top/g,t=>K[t])}function th(t){let{x:e,y:i,width:n,height:r}=t;return{width:n,height:r,top:i,left:e,right:e+n,bottom:i+r,x:e,y:i}}function tu(t,e,i){let n,{reference:r,floating:s}=t,o=ti(e),a=tn(e),l=tt(a),c=$(e),h="y"===o,u=r.x+r.width/2-s.width/2,f=r.y+r.height/2-s.height/2,d=r[l]/2-s[l]/2;switch(c){case"top":n={x:u,y:r.y-s.height};break;case"bottom":n={x:u,y:r.y+r.height};break;case"right":n={x:r.x+r.width,y:f};break;case"left":n={x:r.x-s.width,y:f};break;default:n={x:r.x,y:r.y}}switch(Z(e)){case"start":n[a]-=d*(i&&h?-1:1);break;case"end":n[a]+=d*(i&&h?-1:1)}return n}let tf=async(t,e,i)=>{let{placement:n="bottom",strategy:r="absolute",middleware:s=[],platform:o}=i,a=s.filter(Boolean),l=await (null==o.isRTL?void 0:o.isRTL(e)),c=await o.getElementRects({reference:t,floating:e,strategy:r}),{x:h,y:u}=tu(c,n,l),f=n,d={},g=0;for(let i=0;i{try{return t.matches(e)}catch(t){return!1}})}let tj=["transform","translate","scale","rotate","perspective"],tM=["transform","translate","scale","rotate","perspective","filter"],tP=["paint","layout","strict","content"];function tA(t){let e=tD(),i=t_(t)?tL(t):t;return tj.some(t=>!!i[t]&&"none"!==i[t])||!!i.containerType&&"normal"!==i.containerType||!e&&!!i.backdropFilter&&"none"!==i.backdropFilter||!e&&!!i.filter&&"none"!==i.filter||tM.some(t=>(i.willChange||"").includes(t))||tP.some(t=>(i.contain||"").includes(t))}function tD(){return"undefined"!=typeof CSS&&!!CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")}let tF=new Set(["html","body","#document"]);function tR(t){return tF.has(tm(t))}function tL(t){return ty(t).getComputedStyle(t)}function tI(t){return t_(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function tB(t){if("html"===tm(t))return t;let e=t.assignedSlot||t.parentNode||tS(t)&&t.host||tb(t);return tS(e)?e.host:e}function tN(t,e,i){var n;void 0===e&&(e=[]),void 0===i&&(i=!0);let r=function t(e){let i=tB(e);return tR(i)?e.ownerDocument?e.ownerDocument.body:e.body:tC(i)&&tT(i)?i:t(i)}(t),s=r===(null==(n=t.ownerDocument)?void 0:n.body),o=ty(r);if(s){let t=tU(o);return e.concat(o,o.visualViewport||[],tT(r)?r:[],t&&i?tN(t):[])}return e.concat(r,tN(r,[],i))}function tU(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function tW(t){let e=tL(t),i=parseFloat(e.width)||0,n=parseFloat(e.height)||0,r=tC(t),s=r?t.offsetWidth:i,o=r?t.offsetHeight:n,a=G(i)!==s||G(n)!==o;return a&&(i=s,n=o),{width:i,height:n,$:a}}function tH(t){return t_(t)?t:t.contextElement}function tX(t){let e=tH(t);if(!tC(e))return q(1);let i=e.getBoundingClientRect(),{width:n,height:r,$:s}=tW(e),o=(s?G(i.width):i.width)/n,a=(s?G(i.height):i.height)/r;return o&&Number.isFinite(o)||(o=1),a&&Number.isFinite(a)||(a=1),{x:o,y:a}}let tz=q(0);function tY(t){let e=ty(t);return tD()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:tz}function tG(t,e,i,n){var r;void 0===e&&(e=!1),void 0===i&&(i=!1);let s=t.getBoundingClientRect(),o=tH(t),a=q(1);e&&(n?t_(n)&&(a=tX(n)):a=tX(t));let l=(void 0===(r=i)&&(r=!1),n&&(!r||n===ty(o))&&r)?tY(o):q(0),c=(s.left+l.x)/a.x,h=(s.top+l.y)/a.y,u=s.width/a.x,f=s.height/a.y;if(o){let t=ty(o),e=n&&t_(n)?ty(n):n,i=t,r=tU(i);for(;r&&n&&e!==i;){let t=tX(r),e=r.getBoundingClientRect(),n=tL(r),s=e.left+(r.clientLeft+parseFloat(n.paddingLeft))*t.x,o=e.top+(r.clientTop+parseFloat(n.paddingTop))*t.y;c*=t.x,h*=t.y,u*=t.x,f*=t.y,c+=s,h+=o,r=tU(i=ty(r))}}return th({width:u,height:f,x:c,y:h})}function tV(t,e){let i=tI(t).scrollLeft;return e?e.left+i:tG(tb(t)).left+i}function tq(t,e){let i=t.getBoundingClientRect();return{x:i.left+e.scrollLeft-tV(t,i),y:i.top+e.scrollTop}}let tK=new Set(["absolute","fixed"]);function tQ(t,e,i){let n;if("viewport"===e)n=function(t,e){let i=ty(t),n=tb(t),r=i.visualViewport,s=n.clientWidth,o=n.clientHeight,a=0,l=0;if(r){s=r.width,o=r.height;let t=tD();(!t||t&&"fixed"===e)&&(a=r.offsetLeft,l=r.offsetTop)}let c=tV(n);if(c<=0){let t=n.ownerDocument,e=t.body,i=getComputedStyle(e),r="CSS1Compat"===t.compatMode&&parseFloat(i.marginLeft)+parseFloat(i.marginRight)||0,o=Math.abs(n.clientWidth-e.clientWidth-r);o<=25&&(s-=o)}else c<=25&&(s+=c);return{width:s,height:o,x:a,y:l}}(t,i);else if("document"===e)n=function(t){let e=tb(t),i=tI(t),n=t.ownerDocument.body,r=Y(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=Y(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),o=-i.scrollLeft+tV(t),a=-i.scrollTop;return"rtl"===tL(n).direction&&(o+=Y(e.clientWidth,n.clientWidth)-r),{width:r,height:s,x:o,y:a}}(tb(t));else if(t_(e))n=function(t,e){let i=tG(t,!0,"fixed"===e),n=i.top+t.clientTop,r=i.left+t.clientLeft,s=tC(t)?tX(t):q(1),o=t.clientWidth*s.x,a=t.clientHeight*s.y;return{width:o,height:a,x:r*s.x,y:n*s.y}}(e,i);else{let i=tY(t);n={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return th(n)}function tJ(t){return"static"===tL(t).position}function t$(t,e){if(!tC(t)||"fixed"===tL(t).position)return null;if(e)return e(t);let i=t.offsetParent;return tb(t)===i&&(i=i.ownerDocument.body),i}function tZ(t,e){var i;let n=ty(t);if(tE(t))return n;if(!tC(t)){let e=tB(t);for(;e&&!tR(e);){if(t_(e)&&!tJ(e))return e;e=tB(e)}return n}let r=t$(t,e);for(;r&&(i=r,tO.has(tm(i)))&&tJ(r);)r=t$(r,e);return r&&tR(r)&&tJ(r)&&!tA(r)?n:r||function(t){let e=tB(t);for(;tC(e)&&!tR(e);){if(tA(e))return e;if(tE(e))break;e=tB(e)}return null}(t)||n}let t0=async function(t){let e=this.getOffsetParent||tZ,i=this.getDimensions,n=await i(t.floating);return{reference:function(t,e,i){let n=tC(e),r=tb(e),s="fixed"===i,o=tG(t,!0,s,e),a={scrollLeft:0,scrollTop:0},l=q(0);if(n||!n&&!s)if(("body"!==tm(e)||tT(r))&&(a=tI(e)),n){let t=tG(e,!0,s,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop}else r&&(l.x=tV(r));s&&!n&&r&&(l.x=tV(r));let c=!r||n||s?q(0):tq(r,a);return{x:o.left+a.scrollLeft-l.x-c.x,y:o.top+a.scrollTop-l.y-c.y,width:o.width,height:o.height}}(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}},t1={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:i,offsetParent:n,strategy:r}=t,s="fixed"===r,o=tb(n),a=!!e&&tE(e.floating);if(n===o||a&&s)return i;let l={scrollLeft:0,scrollTop:0},c=q(1),h=q(0),u=tC(n);if((u||!u&&!s)&&(("body"!==tm(n)||tT(o))&&(l=tI(n)),tC(n))){let t=tG(n);c=tX(n),h.x=t.x+n.clientLeft,h.y=t.y+n.clientTop}let f=!o||u||s?q(0):tq(o,l);return{width:i.width*c.x,height:i.height*c.y,x:i.x*c.x-l.scrollLeft*c.x+h.x+f.x,y:i.y*c.y-l.scrollTop*c.y+h.y+f.y}},getDocumentElement:tb,getClippingRect:function(t){let{element:e,boundary:i,rootBoundary:n,strategy:r}=t,s=[..."clippingAncestors"===i?tE(e)?[]:function(t,e){let i=e.get(t);if(i)return i;let n=tN(t,[],!1).filter(t=>t_(t)&&"body"!==tm(t)),r=null,s="fixed"===tL(t).position,o=s?tB(t):t;for(;t_(o)&&!tR(o);){let e=tL(o),i=tA(o);i||"fixed"!==e.position||(r=null),(s?!i&&!r:!i&&"static"===e.position&&!!r&&tK.has(r.position)||tT(o)&&!i&&function t(e,i){let n=tB(e);return!(n===i||!t_(n)||tR(n))&&("fixed"===tL(n).position||t(n,i))}(t,o))?n=n.filter(t=>t!==o):r=e,o=tB(o)}return e.set(t,n),n}(e,this._c):[].concat(i),n],o=s[0],a=s.reduce((t,i)=>{let n=tQ(e,i,r);return t.top=Y(n.top,t.top),t.right=z(n.right,t.right),t.bottom=z(n.bottom,t.bottom),t.left=Y(n.left,t.left),t},tQ(e,o,r));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:tZ,getElementRects:t0,getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){let{width:e,height:i}=tW(t);return{width:e,height:i}},getScale:tX,isElement:t_,isRTL:function(t){return"rtl"===tL(t).direction}};function t2(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function t5(t,e,i,n){let r;void 0===n&&(n={});let{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:l="function"==typeof IntersectionObserver,animationFrame:c=!1}=n,h=tH(t),u=s||o?[...h?tN(h):[],...tN(e)]:[];u.forEach(t=>{s&&t.addEventListener("scroll",i,{passive:!0}),o&&t.addEventListener("resize",i)});let f=h&&l?function(t,e){let i,n=null,r=tb(t);function s(){var t;clearTimeout(i),null==(t=n)||t.disconnect(),n=null}return!function o(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),s();let c=t.getBoundingClientRect(),{left:h,top:u,width:f,height:d}=c;if(a||e(),!f||!d)return;let g=V(u),p=V(r.clientWidth-(h+f)),m={rootMargin:-g+"px "+-p+"px "+-V(r.clientHeight-(u+d))+"px "+-V(h)+"px",threshold:Y(0,z(1,l))||1},y=!0;function b(e){let n=e[0].intersectionRatio;if(n!==l){if(!y)return o();n?o(!1,n):i=setTimeout(()=>{o(!1,1e-7)},1e3)}1!==n||t2(c,t.getBoundingClientRect())||o(),y=!1}try{n=new IntersectionObserver(b,{...m,root:r.ownerDocument})}catch(t){n=new IntersectionObserver(b,m)}n.observe(t)}(!0),s}(h,i):null,d=-1,g=null;a&&(g=new ResizeObserver(t=>{let[n]=t;n&&n.target===h&&g&&(g.unobserve(e),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var t;null==(t=g)||t.observe(e)})),i()}),h&&!c&&g.observe(h),g.observe(e));let p=c?tG(t):null;return c&&function e(){let n=tG(t);p&&!t2(p,n)&&i(),p=n,r=requestAnimationFrame(e)}(),i(),()=>{var t;u.forEach(t=>{s&&t.removeEventListener("scroll",i),o&&t.removeEventListener("resize",i)}),null==f||f(),null==(t=g)||t.disconnect(),g=null,c&&cancelAnimationFrame(r)}}var t4=t.i(74080),t3="undefined"!=typeof document?B.useLayoutEffect:function(){};function t9(t,e){let i,n,r;if(t===e)return!0;if(typeof t!=typeof e)return!1;if("function"==typeof t&&t.toString()===e.toString())return!0;if(t&&e&&"object"==typeof t){if(Array.isArray(t)){if((i=t.length)!==e.length)return!1;for(n=i;0!=n--;)if(!t9(t[n],e[n]))return!1;return!0}if((i=(r=Object.keys(t)).length)!==Object.keys(e).length)return!1;for(n=i;0!=n--;)if(!({}).hasOwnProperty.call(e,r[n]))return!1;for(n=i;0!=n--;){let i=r[n];if(("_owner"!==i||!t.$$typeof)&&!t9(t[i],e[i]))return!1}return!0}return t!=t&&e!=e}function t6(t){return"undefined"==typeof window?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function t8(t,e){let i=t6(t);return Math.round(e*i)/i}function t7(t){let e=B.useRef(t);return t3(()=>{e.current=t}),e}let et=(t,e)=>({...function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var i,n;let{x:r,y:s,placement:o,middlewareData:a}=e,l=await tp(e,t);return o===(null==(i=a.offset)?void 0:i.placement)&&null!=(n=a.arrow)&&n.alignmentOffset?{}:{x:r+l.x,y:s+l.y,data:{...l,placement:o}}}}}(t),options:[t,e]}),ee=(t,e)=>({...function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var i,n,r,s,o;let{placement:a,middlewareData:l,rects:c,initialPlacement:h,platform:u,elements:f}=e,{mainAxis:d=!0,crossAxis:g=!0,fallbackPlacements:p,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:b=!0,...x}=J(t,e);if(null!=(i=l.arrow)&&i.alignmentOffset)return{};let _=$(a),C=ti(h),S=$(h)===h,w=await (null==u.isRTL?void 0:u.isRTL(f.floating)),T=p||(S||!b?[tc(h)]:function(t){let e=tc(t);return[tr(t),e,tr(e)]}(h)),O="none"!==y;!p&&O&&T.push(...function(t,e,i,n){let r=Z(t),s=function(t,e,i){switch(t){case"top":case"bottom":if(i)return e?to:ts;return e?ts:to;case"left":case"right":return e?ta:tl;default:return[]}}($(t),"start"===i,n);return r&&(s=s.map(t=>t+"-"+r),e&&(s=s.concat(s.map(tr)))),s}(h,b,y,w));let k=[h,...T],E=await td(e,x),j=[],M=(null==(n=l.flip)?void 0:n.overflows)||[];if(d&&j.push(E[_]),g){let t=function(t,e,i){void 0===i&&(i=!1);let n=Z(t),r=tn(t),s=tt(r),o="x"===r?n===(i?"end":"start")?"right":"left":"start"===n?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=tc(o)),[o,tc(o)]}(a,c,w);j.push(E[t[0]],E[t[1]])}if(M=[...M,{placement:a,overflows:j}],!j.every(t=>t<=0)){let t=((null==(r=l.flip)?void 0:r.index)||0)+1,e=k[t];if(e&&("alignment"!==g||C===ti(e)||M.every(t=>ti(t.placement)!==C||t.overflows[0]>0)))return{data:{index:t,overflows:M},reset:{placement:e}};let i=null==(s=M.filter(t=>t.overflows[0]<=0).sort((t,e)=>t.overflows[1]-e.overflows[1])[0])?void 0:s.placement;if(!i)switch(m){case"bestFit":{let t=null==(o=M.filter(t=>{if(O){let e=ti(t.placement);return e===C||"y"===e}return!0}).map(t=>[t.placement,t.overflows.filter(t=>t>0).reduce((t,e)=>t+e,0)]).sort((t,e)=>t[1]-e[1])[0])?void 0:o[0];t&&(i=t);break}case"initialPlacement":i=h}if(a!==i)return{reset:{placement:i}}}return{}}}}(t),options:[t,e]});t.i(47167);var ei='input:not([inert]),select:not([inert]),textarea:not([inert]),a[href]:not([inert]),button:not([inert]),[tabindex]:not(slot):not([inert]),audio[controls]:not([inert]),video[controls]:not([inert]),[contenteditable]:not([contenteditable="false"]):not([inert]),details>summary:first-of-type:not([inert]),details:not([inert])',en="undefined"==typeof Element,er=en?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,es=!en&&Element.prototype.getRootNode?function(t){var e;return null==t||null==(e=t.getRootNode)?void 0:e.call(t)}:function(t){return null==t?void 0:t.ownerDocument},eo=function t(e,i){void 0===i&&(i=!0);var n,r=null==e||null==(n=e.getAttribute)?void 0:n.call(e,"inert");return""===r||"true"===r||i&&e&&t(e.parentNode)},ea=function(t){var e,i=null==t||null==(e=t.getAttribute)?void 0:e.call(t,"contenteditable");return""===i||"true"===i},el=function(t,e,i){if(eo(t))return[];var n=Array.prototype.slice.apply(t.querySelectorAll(ei));return e&&er.call(t,ei)&&n.unshift(t),n=n.filter(i)},ec=function t(e,i,n){for(var r=[],s=Array.from(e);s.length;){var o=s.shift();if(!eo(o,!1))if("SLOT"===o.tagName){var a=o.assignedElements(),l=t(a.length?a:o.children,!0,n);n.flatten?r.push.apply(r,l):r.push({scopeParent:o,candidates:l})}else{er.call(o,ei)&&n.filter(o)&&(i||!e.includes(o))&&r.push(o);var c=o.shadowRoot||"function"==typeof n.getShadowRoot&&n.getShadowRoot(o),h=!eo(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(o));if(c&&h){var u=t(!0===c?o.children:c.children,!0,n);n.flatten?r.push.apply(r,u):r.push({scopeParent:o,candidates:u})}else s.unshift.apply(s,o.children)}}return r},eh=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},eu=function(t){if(!t)throw Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||ea(t))&&!eh(t)?0:t.tabIndex},ef=function(t,e){var i=eu(t);return i<0&&e&&!eh(t)?0:i},ed=function(t,e){return t.tabIndex===e.tabIndex?t.documentOrder-e.documentOrder:t.tabIndex-e.tabIndex},eg=function(t){return"INPUT"===t.tagName},ep=function(t,e){for(var i=0;isummary:first-of-type")?t.parentElement:t;if(er.call(r,"details:not([open]) *"))return!0;if(i&&"full"!==i&&"legacy-full"!==i){if("non-zero-area"===i)return eb(t)}else{if("function"==typeof n){for(var s=t;t;){var o=t.parentElement,a=es(t);if(o&&!o.shadowRoot&&!0===n(o))return eb(t);t=t.assignedSlot?t.assignedSlot:o||a===t.ownerDocument?o:a.host}t=s}if(ey(t))return!t.getClientRects().length;if("legacy-full"!==i)return!0}return!1},e_=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var e=t.parentElement;e;){if("FIELDSET"===e.tagName&&e.disabled){for(var i=0;ieu(e))&&!!eC(t,e)},ew=function(t){var e=parseInt(t.getAttribute("tabindex"),10);return!!isNaN(e)||!!(e>=0)},eT=function t(e){var i=[],n=[];return e.forEach(function(e,r){var s=!!e.scopeParent,o=s?e.scopeParent:e,a=ef(o,s),l=s?t(e.candidates):o;0===a?s?i.push.apply(i,l):i.push(o):n.push({documentOrder:r,tabIndex:a,item:e,isScope:s,content:l})}),n.sort(ed).reduce(function(t,e){return e.isScope?t.push.apply(t,e.content):t.push(e.content),t},[]).concat(i)},eO=function(t,e){return eT((e=e||{}).getShadowRoot?ec([t],e.includeContainer,{filter:eS.bind(null,e),flatten:!1,getShadowRoot:e.getShadowRoot,shadowRootFilter:ew}):el(t,e.includeContainer,eS.bind(null,e)))},ek=function(t,e){return(e=e||{}).getShadowRoot?ec([t],e.includeContainer,{filter:eC.bind(null,e),flatten:!0,getShadowRoot:e.getShadowRoot}):el(t,e.includeContainer,eC.bind(null,e))},eE=function(t,e){if(e=e||{},!t)throw Error("No node provided");return!1!==er.call(t,ei)&&eS(e,t)};function ej(){let t=navigator.userAgentData;return t&&Array.isArray(t.brands)?t.brands.map(t=>{let{brand:e,version:i}=t;return e+"/"+i}).join(" "):navigator.userAgent}function eM(){let t=/android/i;return t.test(function(){let t=navigator.userAgentData;return null!=t&&t.platform?t.platform:navigator.platform}())||t.test(ej())}let eP="data-floating-ui-focusable";function eA(t){let e=t.activeElement;for(;(null==(i=e)||null==(i=i.shadowRoot)?void 0:i.activeElement)!=null;){var i;e=e.shadowRoot.activeElement}return e}function eD(t,e){if(!t||!e)return!1;let i=null==e.getRootNode?void 0:e.getRootNode();if(t.contains(e))return!0;if(i&&tS(i)){let i=e;for(;i;){if(t===i)return!0;i=i.parentNode||i.host}}return!1}function eF(t){return"composedPath"in t?t.composedPath()[0]:t.target}function eR(t,e){return null!=e&&("composedPath"in t?t.composedPath().includes(e):null!=t.target&&e.contains(t.target))}function eL(t){return(null==t?void 0:t.ownerDocument)||document}function eI(t){return tC(t)&&t.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}function eB(t){return!!t&&"combobox"===t.getAttribute("role")&&eI(t)}function eN(t){return t?t.hasAttribute(eP)?t:t.querySelector("["+eP+"]")||t:null}function eU(t,e,i){return void 0===i&&(i=!0),t.filter(t=>{var n;return t.parentId===e&&(!i||(null==(n=t.context)?void 0:n.open))}).flatMap(e=>[e,...eU(t,e.id,i)])}function eW(t,e){var i;let n=[],r=null==(i=t.find(t=>t.id===e))?void 0:i.parentId;for(;r;){let e=t.find(t=>t.id===r);r=null==e?void 0:e.parentId,e&&(n=n.concat(e))}return n}function eH(t){t.preventDefault(),t.stopPropagation()}function eX(t,e){let i=["mouse","pen"];return e||i.push("",void 0),i.includes(t)}var ez="undefined"!=typeof document?B.useLayoutEffect:function(){};function eY(t){let e=B.useRef(t);return ez(()=>{e.current=t}),e}let eG={...B}.useInsertionEffect||(t=>t());function eV(t){let e=B.useRef(()=>{});return eG(()=>{e.current=t}),B.useCallback(function(){for(var t=arguments.length,i=Array(t),n=0;n({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function eK(t,e){let i=eO(t,eq()),n=i.length;if(0===n)return;let r=eA(eL(t)),s=i.indexOf(r);return i[-1===s?1===e?0:n-1:s+e]}function eQ(t,e){let i=e||t.currentTarget,n=t.relatedTarget;return!n||!eD(i,n)}let eJ="active",e$="selected",eZ={...B},e0=!1,e1=0,e2=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+e1++,e5=eZ.useId||function(){let[t,e]=B.useState(()=>e0?e2():void 0);return ez(()=>{null==t&&e(e2())},[]),B.useEffect(()=>{e0=!0},[]),t},e4=B.createContext(null),e3=B.createContext(null),e9=()=>{var t;return(null==(t=B.useContext(e4))?void 0:t.id)||null},e6=()=>B.useContext(e3);function e8(t){return"data-floating-ui-"+t}let e7=0;function it(t,e){void 0===e&&(e={});let{preventScroll:i=!1,cancelPrevious:n=!0,sync:r=!1}=e;n&&cancelAnimationFrame(e7);let s=()=>null==t?void 0:t.focus({preventScroll:i});r?s():e7=requestAnimationFrame(s)}let ie={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function ii(t){return"inert"===t?ie.inert:"aria-hidden"===t?ie["aria-hidden"]:ie.none}let ir=new WeakSet,is={},io=0,ia=t=>t&&(t.host||ia(t.parentNode));function il(t,e,i){var n;void 0===e&&(e=!1),void 0===i&&(i=!1);let r=((null==(n=t[0])?void 0:n.ownerDocument)||document).body;return function(t,e,i,n){let r="data-floating-ui-inert",s=n?"inert":i?"aria-hidden":null,o=t.map(t=>{if(e.contains(t))return t;let i=ia(t);return e.contains(i)?i:null}).filter(t=>null!=t),a=new Set,l=new Set(o),c=[];is[r]||(is[r]=new WeakMap);let h=is[r];return o.forEach(function t(e){!(!e||a.has(e))&&(a.add(e),e.parentNode&&t(e.parentNode))}),function t(e){!e||l.has(e)||[].forEach.call(e.children,e=>{if("script"!==tm(e))if(a.has(e))t(e);else{let t=s?e.getAttribute(s):null,i=null!==t&&"false"!==t,n=ii(s),o=(n.get(e)||0)+1,a=(h.get(e)||0)+1;n.set(e,o),h.set(e,a),c.push(e),1===o&&i&&ir.add(e),1===a&&e.setAttribute(r,""),!i&&s&&e.setAttribute(s,"inert"===s?"":"true")}})}(e),a.clear(),io++,()=>{c.forEach(t=>{let e=ii(s),i=(e.get(t)||0)-1,n=(h.get(t)||0)-1;e.set(t,i),h.set(t,n),i||(!ir.has(t)&&s&&t.removeAttribute(s),ir.delete(t)),n||t.removeAttribute(r)}),--io||(ie.inert=new WeakMap,ie["aria-hidden"]=new WeakMap,ie.none=new WeakMap,ir=new WeakSet,is={})}}(t.concat(Array.from(r.querySelectorAll('[aria-live],[role="status"],output'))),r,e,i)}let ic={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},ih=B.forwardRef(function(t,e){let[i,n]=B.useState();ez(()=>{/apple/i.test(navigator.vendor)&&n("button")},[]);let r={ref:e,tabIndex:0,role:i,"aria-hidden":!i||void 0,[e8("focus-guard")]:"",style:ic};return(0,I.jsx)("span",{...t,...r})}),iu=B.createContext(null);function id(t){return B.useMemo(()=>e=>{t.forEach(t=>{t&&(t.current=e)})},t)}let ig=[];function ip(){ig=ig.filter(t=>t.isConnected)}function iv(){return ip(),ig[ig.length-1]}function im(t,e){var i;if(!e.current.includes("floating")&&!(null!=(i=t.getAttribute("role"))&&i.includes("dialog")))return;let n=eq(),r=ek(t,n).filter(t=>{let e=t.getAttribute("data-tabindex")||"";return eE(t,n)||t.hasAttribute("data-tabindex")&&!e.startsWith("-")}),s=t.getAttribute("tabindex");e.current.includes("floating")||0===r.length?"0"!==s&&t.setAttribute("tabindex","0"):("-1"!==s||t.hasAttribute("data-tabindex")&&"-1"!==t.getAttribute("data-tabindex"))&&(t.setAttribute("tabindex","-1"),t.setAttribute("data-tabindex","-1"))}let iy=B.forwardRef(function(t,e){return(0,I.jsx)("button",{...t,type:"button",ref:e,tabIndex:-1,style:ic})});function ib(t){let{context:e,children:i,disabled:n=!1,order:r=["content"],guards:s=!0,initialFocus:o=0,returnFocus:a=!0,restoreFocus:l=!1,modal:c=!0,visuallyHiddenDismiss:h=!1,closeOnFocusOut:u=!0,outsideElementsInert:f=!1,getInsideElements:d=()=>[]}=t,{open:g,onOpenChange:p,events:m,dataRef:y,elements:{domReference:b,floating:x}}=e,_=eV(()=>{var t;return null==(t=y.current.floatingContext)?void 0:t.nodeId}),C=eV(d),S="number"==typeof o&&o<0,w=eB(b)&&S,T="undefined"!=typeof HTMLElement&&"inert"in HTMLElement.prototype,O=!T||s,k=!O||T&&f,E=eY(r),j=eY(o),M=eY(a),P=e6(),A=B.useContext(iu),D=B.useRef(null),F=B.useRef(null),R=B.useRef(!1),L=B.useRef(!1),N=B.useRef(-1),U=B.useRef(-1),W=null!=A,H=eN(x),X=eV(function(t){return void 0===t&&(t=H),t?eO(t,eq()):[]}),z=eV(t=>{let e=X(t);return E.current.map(t=>b&&"reference"===t?b:H&&"floating"===t?H:e).filter(Boolean).flat()});B.useEffect(()=>{if(n||!c)return;function t(t){if("Tab"===t.key){eD(H,eA(eL(H)))&&0===X().length&&!w&&eH(t);let e=z(),i=eF(t);"reference"===E.current[0]&&i===b&&(eH(t),t.shiftKey?it(e[e.length-1]):it(e[1])),"floating"===E.current[1]&&i===H&&t.shiftKey&&(eH(t),it(e[0]))}}let e=eL(H);return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}},[n,b,H,c,E,w,X,z]),B.useEffect(()=>{if(!n&&x)return x.addEventListener("focusin",t),()=>{x.removeEventListener("focusin",t)};function t(t){let e=eF(t),i=X().indexOf(e);-1!==i&&(N.current=i)}},[n,x,X]),B.useEffect(()=>{if(n||!u)return;function t(){L.current=!0,setTimeout(()=>{L.current=!1})}function e(t){let e=t.relatedTarget,i=t.currentTarget,n=eF(t);queueMicrotask(()=>{let r=_(),s=!(eD(b,e)||eD(x,e)||eD(e,x)||eD(null==A?void 0:A.portalNode,e)||null!=e&&e.hasAttribute(e8("focus-guard"))||P&&(eU(P.nodesRef.current,r).find(t=>{var i,n;return eD(null==(i=t.context)?void 0:i.elements.floating,e)||eD(null==(n=t.context)?void 0:n.elements.domReference,e)})||eW(P.nodesRef.current,r).find(t=>{var i,n,r;return[null==(i=t.context)?void 0:i.elements.floating,eN(null==(n=t.context)?void 0:n.elements.floating)].includes(e)||(null==(r=t.context)?void 0:r.elements.domReference)===e})));if(i===b&&H&&im(H,E),l&&i!==b&&!(null!=n&&n.isConnected)&&eA(eL(H))===eL(H).body){tC(H)&&H.focus();let t=N.current,e=X(),i=e[t]||e[e.length-1]||H;tC(i)&&i.focus()}if(y.current.insideReactTree){y.current.insideReactTree=!1;return}(w||!c)&&e&&s&&!L.current&&e!==iv()&&(R.current=!0,p(!1,t,"focus-out"))})}let i=!!(!P&&A);function r(){-1!==U.current&&(clearTimeout(U.current),U.current=-1),y.current.insideReactTree=!0,U.current=window.setTimeout(()=>{y.current.insideReactTree=!1})}if(x&&tC(b))return b.addEventListener("focusout",e),b.addEventListener("pointerdown",t),x.addEventListener("focusout",e),i&&x.addEventListener("focusout",r,!0),()=>{b.removeEventListener("focusout",e),b.removeEventListener("pointerdown",t),x.removeEventListener("focusout",e),i&&x.removeEventListener("focusout",r,!0)}},[n,b,x,H,c,P,A,p,u,l,X,w,_,E,y]);let Y=B.useRef(null),G=B.useRef(null),V=id([Y,null==A?void 0:A.beforeInsideRef]),q=id([G,null==A?void 0:A.afterInsideRef]);function K(t){return!n&&h&&c?(0,I.jsx)(iy,{ref:"start"===t?D:F,onClick:t=>p(!1,t.nativeEvent),children:"string"==typeof h?h:"Dismiss"}):null}B.useEffect(()=>{var t,e;if(n||!x)return;let i=Array.from((null==A||null==(t=A.portalNode)?void 0:t.querySelectorAll("["+e8("portal")+"]"))||[]),r=[x,null==(e=(P?eW(P.nodesRef.current,_()):[]).find(t=>{var e;return eB((null==(e=t.context)?void 0:e.elements.domReference)||null)}))||null==(e=e.context)?void 0:e.elements.domReference,...i,...C(),D.current,F.current,Y.current,G.current,null==A?void 0:A.beforeOutsideRef.current,null==A?void 0:A.afterOutsideRef.current,E.current.includes("reference")||w?b:null].filter(t=>null!=t),s=c||w?il(r,!k,k):il(r);return()=>{s()}},[n,b,x,c,E,A,w,O,k,P,_,C]),ez(()=>{if(n||!tC(H))return;let t=eA(eL(H));queueMicrotask(()=>{let e=z(H),i=j.current,n=("number"==typeof i?e[i]:i.current)||H,r=eD(H,t);S||r||!g||it(n,{preventScroll:n===H})})},[n,g,H,S,z,j]),ez(()=>{var t;if(n||!H)return;let e=eL(H);function i(t){let{reason:e,event:i,nested:n}=t;if(["hover","safe-polygon"].includes(e)&&"mouseleave"===i.type&&(R.current=!0),"outside-press"===e)if(n)R.current=!1;else if(0===i.mozInputSource&&i.isTrusted||(eM()&&i.pointerType?"click"===i.type&&1===i.buttons:0===i.detail&&!i.pointerType)||!ej().includes("jsdom/")&&(!eM()&&0===i.width&&0===i.height||eM()&&1===i.width&&1===i.height&&0===i.pressure&&0===i.detail&&"mouse"===i.pointerType||i.width<1&&i.height<1&&0===i.pressure&&0===i.detail&&"touch"===i.pointerType))R.current=!1;else{let t=!1;document.createElement("div").focus({get preventScroll(){return t=!0,!1}}),t?R.current=!1:R.current=!0}}t=eA(e),ip(),t&&"body"!==tm(t)&&(ig.push(t),ig.length>20&&(ig=ig.slice(-20))),m.on("openchange",i);let r=e.createElement("span");return r.setAttribute("tabindex","-1"),r.setAttribute("aria-hidden","true"),Object.assign(r.style,ic),W&&b&&b.insertAdjacentElement("afterend",r),()=>{m.off("openchange",i);let t=eA(e),n=eD(x,t)||P&&eU(P.nodesRef.current,_(),!1).some(e=>{var i;return eD(null==(i=e.context)?void 0:i.elements.floating,t)}),s=function(){if("boolean"==typeof M.current){let t=b||iv();return t&&t.isConnected?t:r}return M.current.current||r}();queueMicrotask(()=>{let i=function(t){let e=eq();return eE(t,e)?t:eO(t,e)[0]||t}(s);M.current&&!R.current&&tC(i)&&(i===t||t===e.body||n)&&i.focus({preventScroll:!0}),r.remove()})}},[n,x,H,M,y,m,P,W,b,_]),B.useEffect(()=>(queueMicrotask(()=>{R.current=!1}),()=>{queueMicrotask(ip)}),[n]),ez(()=>{if(!n&&A)return A.setFocusManagerState({modal:c,closeOnFocusOut:u,open:g,onOpenChange:p,domReference:b}),()=>{A.setFocusManagerState(null)}},[n,A,c,g,p,u,b]),ez(()=>{!n&&H&&im(H,E)},[n,H,E]);let Q=!n&&O&&(!c||!w)&&(W||c);return(0,I.jsxs)(I.Fragment,{children:[Q&&(0,I.jsx)(ih,{"data-type":"inside",ref:V,onFocus:t=>{var e;if(c){let t=z();it("reference"===r[0]?t[0]:t[t.length-1])}else if(null!=A&&A.preserveTabOrder&&A.portalNode)if(R.current=!1,eQ(t,A.portalNode)){let t=eK(eL(b).body,1)||b;null==t||t.focus()}else null==(e=A.beforeOutsideRef.current)||e.focus()}}),!w&&K("start"),i,K("end"),Q&&(0,I.jsx)(ih,{"data-type":"inside",ref:q,onFocus:t=>{var e;if(c)it(z()[0]);else if(null!=A&&A.preserveTabOrder&&A.portalNode)if(u&&(R.current=!0),eQ(t,A.portalNode)){let t=eK(eL(b).body,-1)||b;null==t||t.focus()}else null==(e=A.afterOutsideRef.current)||e.focus()}})]})}function ix(t){return tC(t.target)&&"BUTTON"===t.target.tagName}function i_(t,e){void 0===e&&(e={});let{open:i,onOpenChange:n,dataRef:r,elements:{domReference:s}}=t,{enabled:o=!0,event:a="click",toggle:l=!0,ignoreMouse:c=!1,keyboardHandlers:h=!0,stickIfOpen:u=!0}=e,f=B.useRef(),d=B.useRef(!1),g=B.useMemo(()=>({onPointerDown(t){f.current=t.pointerType},onMouseDown(t){let e=f.current;0===t.button&&"click"!==a&&(eX(e,!0)&&c||(i&&l&&(!r.current.openEvent||!u||"mousedown"===r.current.openEvent.type)?n(!1,t.nativeEvent,"click"):(t.preventDefault(),n(!0,t.nativeEvent,"click"))))},onClick(t){let e=f.current;if("mousedown"===a&&f.current){f.current=void 0;return}eX(e,!0)&&c||(i&&l&&(!r.current.openEvent||!u||"click"===r.current.openEvent.type)?n(!1,t.nativeEvent,"click"):n(!0,t.nativeEvent,"click"))},onKeyDown(t){f.current=void 0,!(t.defaultPrevented||!h||ix(t))&&(" "!==t.key||eI(s)||(t.preventDefault(),d.current=!0),tC(t.target)&&"A"===t.target.tagName||"Enter"!==t.key||(i&&l?n(!1,t.nativeEvent,"click"):n(!0,t.nativeEvent,"click")))},onKeyUp(t){!(t.defaultPrevented||!h||ix(t)||eI(s))&&" "===t.key&&d.current&&(d.current=!1,i&&l?n(!1,t.nativeEvent,"click"):n(!0,t.nativeEvent,"click"))}}),[r,s,a,c,h,n,i,u,l]);return B.useMemo(()=>o?{reference:g}:{},[o,g])}let iC={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},iS={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},iw=t=>{var e,i;return{escapeKey:"boolean"==typeof t?t:null!=(e=null==t?void 0:t.escapeKey)&&e,outsidePress:"boolean"==typeof t?t:null==(i=null==t?void 0:t.outsidePress)||i}};function iT(t,e){void 0===e&&(e={});let{open:i,onOpenChange:n,elements:r,dataRef:s}=t,{enabled:o=!0,escapeKey:a=!0,outsidePress:l=!0,outsidePressEvent:c="pointerdown",referencePress:h=!1,referencePressEvent:u="pointerdown",ancestorScroll:f=!1,bubbles:d,capture:g}=e,p=e6(),m=eV("function"==typeof l?l:()=>!1),y="function"==typeof l?m:l,b=B.useRef(!1),{escapeKey:x,outsidePress:_}=iw(d),{escapeKey:C,outsidePress:S}=iw(g),w=B.useRef(!1),T=eV(t=>{var e;if(!i||!o||!a||"Escape"!==t.key||w.current)return;let r=null==(e=s.current.floatingContext)?void 0:e.nodeId,l=p?eU(p.nodesRef.current,r):[];if(!x&&(t.stopPropagation(),l.length>0)){let t=!0;if(l.forEach(e=>{var i;if(null!=(i=e.context)&&i.open&&!e.context.dataRef.current.__escapeKeyBubbles){t=!1;return}}),!t)return}n(!1,"nativeEvent"in t?t.nativeEvent:t,"escape-key")}),O=eV(t=>{var e;let i=()=>{var e;T(t),null==(e=eF(t))||e.removeEventListener("keydown",i)};null==(e=eF(t))||e.addEventListener("keydown",i)}),k=eV(t=>{var e;let i=s.current.insideReactTree;s.current.insideReactTree=!1;let o=b.current;if(b.current=!1,"click"===c&&o||i||"function"==typeof y&&!y(t))return;let a=eF(t),l="["+e8("inert")+"]",h=eL(r.floating).querySelectorAll(l),u=t_(a)?a:null;for(;u&&!tR(u);){let t=tB(u);if(tR(t)||!t_(t))break;u=t}if(h.length&&t_(a)&&!a.matches("html,body")&&!eD(a,r.floating)&&Array.from(h).every(t=>!eD(u,t)))return;if(tC(a)&&M){let e=tR(a),i=tL(a),n=/auto|scroll/,r=e||n.test(i.overflowX),s=e||n.test(i.overflowY),o=r&&a.clientWidth>0&&a.scrollWidth>a.clientWidth,l=s&&a.clientHeight>0&&a.scrollHeight>a.clientHeight,c="rtl"===i.direction,h=l&&(c?t.offsetX<=a.offsetWidth-a.clientWidth:t.offsetX>a.clientWidth),u=o&&t.offsetY>a.clientHeight;if(h||u)return}let f=null==(e=s.current.floatingContext)?void 0:e.nodeId,d=p&&eU(p.nodesRef.current,f).some(e=>{var i;return eR(t,null==(i=e.context)?void 0:i.elements.floating)});if(eR(t,r.floating)||eR(t,r.domReference)||d)return;let g=p?eU(p.nodesRef.current,f):[];if(g.length>0){let t=!0;if(g.forEach(e=>{var i;if(null!=(i=e.context)&&i.open&&!e.context.dataRef.current.__outsidePressBubbles){t=!1;return}}),!t)return}n(!1,t,"outside-press")}),E=eV(t=>{var e;let i=()=>{var e;k(t),null==(e=eF(t))||e.removeEventListener(c,i)};null==(e=eF(t))||e.addEventListener(c,i)});B.useEffect(()=>{if(!i||!o)return;s.current.__escapeKeyBubbles=x,s.current.__outsidePressBubbles=_;let t=-1;function e(t){n(!1,t,"ancestor-scroll")}function l(){window.clearTimeout(t),w.current=!0}function h(){t=window.setTimeout(()=>{w.current=!1},5*!!tD())}let u=eL(r.floating);a&&(u.addEventListener("keydown",C?O:T,C),u.addEventListener("compositionstart",l),u.addEventListener("compositionend",h)),y&&u.addEventListener(c,S?E:k,S);let d=[];return f&&(t_(r.domReference)&&(d=tN(r.domReference)),t_(r.floating)&&(d=d.concat(tN(r.floating))),!t_(r.reference)&&r.reference&&r.reference.contextElement&&(d=d.concat(tN(r.reference.contextElement)))),(d=d.filter(t=>{var e;return t!==(null==(e=u.defaultView)?void 0:e.visualViewport)})).forEach(t=>{t.addEventListener("scroll",e,{passive:!0})}),()=>{a&&(u.removeEventListener("keydown",C?O:T,C),u.removeEventListener("compositionstart",l),u.removeEventListener("compositionend",h)),y&&u.removeEventListener(c,S?E:k,S),d.forEach(t=>{t.removeEventListener("scroll",e)}),window.clearTimeout(t)}},[s,r,a,y,c,i,n,f,o,x,_,T,C,O,k,S,E]),B.useEffect(()=>{s.current.insideReactTree=!1},[s,y,c]);let j=B.useMemo(()=>({onKeyDown:T,...h&&{[iC[u]]:t=>{n(!1,t.nativeEvent,"reference-press")},..."click"!==u&&{onClick(t){n(!1,t.nativeEvent,"reference-press")}}}}),[T,n,h,u]),M=B.useMemo(()=>({onKeyDown:T,onMouseDown(){b.current=!0},onMouseUp(){b.current=!0},[iS[c]]:()=>{s.current.insideReactTree=!0}}),[T,c,s]);return B.useMemo(()=>o?{reference:j,floating:M}:{},[o,j,M])}function iO(t){void 0===t&&(t={});let{nodeId:e}=t,i=function(t){let{open:e=!1,onOpenChange:i,elements:n}=t,r=e5(),s=B.useRef({}),[o]=B.useState(()=>(function(){let t=new Map;return{emit(e,i){var n;null==(n=t.get(e))||n.forEach(t=>t(i))},on(e,i){t.has(e)||t.set(e,new Set),t.get(e).add(i)},off(e,i){var n;null==(n=t.get(e))||n.delete(i)}}})()),a=null!=e9(),[l,c]=B.useState(n.reference),h=eV((t,e,n)=>{s.current.openEvent=t?e:void 0,o.emit("openchange",{open:t,event:e,reason:n,nested:a}),null==i||i(t,e,n)}),u=B.useMemo(()=>({setPositionReference:c}),[]),f=B.useMemo(()=>({reference:l||n.reference||null,floating:n.floating||null,domReference:n.reference}),[l,n.reference,n.floating]);return B.useMemo(()=>({dataRef:s,open:e,onOpenChange:h,elements:f,events:o,floatingId:r,refs:u}),[e,h,f,o,r,u])}({...t,elements:{reference:null,floating:null,...t.elements}}),n=t.rootContext||i,r=n.elements,[s,o]=B.useState(null),[a,l]=B.useState(null),c=(null==r?void 0:r.domReference)||s,h=B.useRef(null),u=e6();ez(()=>{c&&(h.current=c)},[c]);let f=function(t){void 0===t&&(t={});let{placement:e="bottom",strategy:i="absolute",middleware:n=[],platform:r,elements:{reference:s,floating:o}={},transform:a=!0,whileElementsMounted:l,open:c}=t,[h,u]=B.useState({x:0,y:0,strategy:i,placement:e,middlewareData:{},isPositioned:!1}),[f,d]=B.useState(n);t9(f,n)||d(n);let[g,p]=B.useState(null),[m,y]=B.useState(null),b=B.useCallback(t=>{t!==S.current&&(S.current=t,p(t))},[]),x=B.useCallback(t=>{t!==w.current&&(w.current=t,y(t))},[]),_=s||g,C=o||m,S=B.useRef(null),w=B.useRef(null),T=B.useRef(h),O=null!=l,k=t7(l),E=t7(r),j=t7(c),M=B.useCallback(()=>{if(!S.current||!w.current)return;let t={placement:e,strategy:i,middleware:f};E.current&&(t.platform=E.current),((t,e,i)=>{let n=new Map,r={platform:t1,...i},s={...r.platform,_c:n};return tf(t,e,{...r,platform:s})})(S.current,w.current,t).then(t=>{let e={...t,isPositioned:!1!==j.current};P.current&&!t9(T.current,e)&&(T.current=e,t4.flushSync(()=>{u(e)}))})},[f,e,i,E,j]);t3(()=>{!1===c&&T.current.isPositioned&&(T.current.isPositioned=!1,u(t=>({...t,isPositioned:!1})))},[c]);let P=B.useRef(!1);t3(()=>(P.current=!0,()=>{P.current=!1}),[]),t3(()=>{if(_&&(S.current=_),C&&(w.current=C),_&&C){if(k.current)return k.current(_,C,M);M()}},[_,C,M,k,O]);let A=B.useMemo(()=>({reference:S,floating:w,setReference:b,setFloating:x}),[b,x]),D=B.useMemo(()=>({reference:_,floating:C}),[_,C]),F=B.useMemo(()=>{let t={position:i,left:0,top:0};if(!D.floating)return t;let e=t8(D.floating,h.x),n=t8(D.floating,h.y);return a?{...t,transform:"translate("+e+"px, "+n+"px)",...t6(D.floating)>=1.5&&{willChange:"transform"}}:{position:i,left:e,top:n}},[i,a,D.floating,h.x,h.y]);return B.useMemo(()=>({...h,update:M,refs:A,elements:D,floatingStyles:F}),[h,M,A,D,F])}({...t,elements:{...r,...a&&{reference:a}}}),d=B.useCallback(t=>{let e=t_(t)?{getBoundingClientRect:()=>t.getBoundingClientRect(),getClientRects:()=>t.getClientRects(),contextElement:t}:t;l(e),f.refs.setReference(e)},[f.refs]),g=B.useCallback(t=>{(t_(t)||null===t)&&(h.current=t,o(t)),(t_(f.refs.reference.current)||null===f.refs.reference.current||null!==t&&!t_(t))&&f.refs.setReference(t)},[f.refs]),p=B.useMemo(()=>({...f.refs,setReference:g,setPositionReference:d,domReference:h}),[f.refs,g,d]),m=B.useMemo(()=>({...f.elements,domReference:c}),[f.elements,c]),y=B.useMemo(()=>({...f,...n,refs:p,elements:m,nodeId:e}),[f,p,m,e,n]);return ez(()=>{n.dataRef.current.floatingContext=y;let t=null==u?void 0:u.nodesRef.current.find(t=>t.id===e);t&&(t.context=y)}),B.useMemo(()=>({...f,context:y,refs:p,elements:m}),[f,p,m,y])}function ik(t,e,i){let n=new Map,r="item"===i,s=t;if(r&&t){let{[eJ]:e,[e$]:i,...n}=t;s=n}return{..."floating"===i&&{tabIndex:-1,"data-floating-ui-focusable":""},...s,...e.map(e=>{let n=e?e[i]:null;return"function"==typeof n?t?n(t):null:n}).concat(t).reduce((t,e)=>(e&&Object.entries(e).forEach(e=>{let[i,s]=e;if(!(r&&[eJ,e$].includes(i)))if(0===i.indexOf("on")){if(n.has(i)||n.set(i,[]),"function"==typeof s){var o;null==(o=n.get(i))||o.push(s),t[i]=function(){for(var t,e=arguments.length,r=Array(e),s=0;st(...r)).find(t=>void 0!==t)}}}else t[i]=s}),t),{})}}function iE(t){void 0===t&&(t=[]);let e=t.map(t=>null==t?void 0:t.reference),i=t.map(t=>null==t?void 0:t.floating),n=t.map(t=>null==t?void 0:t.item),r=B.useCallback(e=>ik(e,t,"reference"),e),s=B.useCallback(e=>ik(e,t,"floating"),i),o=B.useCallback(e=>ik(e,t,"item"),n);return B.useMemo(()=>({getReferenceProps:r,getFloatingProps:s,getItemProps:o}),[r,s,o])}let ij=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function iM(t,e){var i,n;void 0===e&&(e={});let{open:r,elements:s,floatingId:o}=t,{enabled:a=!0,role:l="dialog"}=e,c=e5(),h=(null==(i=s.domReference)?void 0:i.id)||c,u=B.useMemo(()=>{var t;return(null==(t=eN(s.floating))?void 0:t.id)||o},[s.floating,o]),f=null!=(n=ij.get(l))?n:l,d=null!=e9(),g=B.useMemo(()=>"tooltip"===f||"label"===l?{["aria-"+("label"===l?"labelledby":"describedby")]:r?u:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":"alertdialog"===f?"dialog":f,"aria-controls":r?u:void 0,..."listbox"===f&&{role:"combobox"},..."menu"===f&&{id:h},..."menu"===f&&d&&{role:"menuitem"},..."select"===l&&{"aria-autocomplete":"none"},..."combobox"===l&&{"aria-autocomplete":"list"}},[f,u,d,r,h,l]),p=B.useMemo(()=>{let t={id:u,...f&&{role:f}};return"tooltip"===f||"label"===l?t:{...t,..."menu"===f&&{"aria-labelledby":h}}},[f,u,h,l]),m=B.useCallback(t=>{let{active:e,selected:i}=t,n={role:"option",...e&&{id:u+"-fui-option"}};switch(l){case"select":case"combobox":return{...n,"aria-selected":i}}return{}},[u,l]);return B.useMemo(()=>a?{reference:g,floating:p,item:m}:{},[a,g,p,m])}var iP=t.i(40141);function iA(t){return(0,iP.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M6.9998 6V3C6.9998 2.44772 7.44752 2 7.9998 2H19.9998C20.5521 2 20.9998 2.44772 20.9998 3V17C20.9998 17.5523 20.5521 18 19.9998 18H16.9998V20.9991C16.9998 21.5519 16.5499 22 15.993 22H4.00666C3.45059 22 3 21.5554 3 20.9991L3.0026 7.00087C3.0027 6.44811 3.45264 6 4.00942 6H6.9998ZM8.9998 6H16.9998V16H18.9998V4H8.9998V6Z"},child:[]}]})(t)}function iD(t){return(0,iP.GenIcon)({tag:"svg",attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M5 2a1 1 0 011 1v1h1a1 1 0 010 2H6v1a1 1 0 01-2 0V6H3a1 1 0 010-2h1V3a1 1 0 011-1zm0 10a1 1 0 011 1v1h1a1 1 0 110 2H6v1a1 1 0 11-2 0v-1H3a1 1 0 110-2h1v-1a1 1 0 011-1zM12 2a1 1 0 01.967.744L14.146 7.2 17.5 9.134a1 1 0 010 1.732l-3.354 1.935-1.18 4.455a1 1 0 01-1.933 0L9.854 12.8 6.5 10.866a1 1 0 010-1.732l3.354-1.935 1.18-4.455A1 1 0 0112 2z",clipRule:"evenodd"},child:[]}]})(t)}var iF=t.i(11152);function iR(t){return(0,iP.GenIcon)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M123.193 29.635L121 406.18l84.31-82.836 65.87 159.02 67.5-27.96-65.87-159.02L391 294.342z"},child:[]}]})(t)}function iL(t){return(0,iP.GenIcon)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M149.9 302.2c-39.1 0-70.7 31-70.7 69.3 0 30.3-27.3 46.2-47.2 46.2C53.7 446 90.7 464 126.3 464c52.1 0 94.3-41.4 94.3-92.4 0-38.4-31.6-69.4-70.7-69.4zM473.1 85.7l-31.6-31c-9.2-9-24-9-33.2 0L197 261.8l64.8 63.5 211.2-207c9.3-9 9.3-23.6.1-32.6z"},child:[]}]})(t)}function iI(t){return(0,iP.GenIcon)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M96 448h106.7V64H96v384zM309.3 64v384H416V64H309.3z"},child:[]}]})(t)}function iB(t){return(0,iP.GenIcon)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M96 52v408l320-204L96 52z"},child:[]}]})(t)}function iN(t){return(0,iP.GenIcon)({tag:"svg",attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M11.904 16c1.777-3.219 2.076-8.13-4.904-7.966v3.966l-6-6 6-6v3.881c8.359-0.218 9.29 7.378 4.904 12.119z"},child:[]}]})(t)}function iU(t){return(0,iP.GenIcon)({tag:"svg",attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9 3.881v-3.881l6 6-6 6v-3.966c-6.98-0.164-6.681 4.747-4.904 7.966-4.386-4.741-3.455-12.337 4.904-12.119z"},child:[]}]})(t)}function iW(t){return(0,iP.GenIcon)({tag:"svg",attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 0c-4.418 0-8 3.582-8 8s3.582 8 8 8 8-3.582 8-8-3.582-8-8-8zM2 8c0-3.314 2.686-6 6-6v12c-3.314 0-6-2.686-6-6z"},child:[]}]})(t)}function iH(t){return(0,iP.GenIcon)({tag:"svg",attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 4c-2.209 0-4 1.791-4 4s1.791 4 4 4 4-1.791 4-4-1.791-4-4-4zM8 10.5v-5c1.379 0 2.5 1.122 2.5 2.5s-1.121 2.5-2.5 2.5zM8 13c0.552 0 1 0.448 1 1v1c0 0.552-0.448 1-1 1s-1-0.448-1-1v-1c0-0.552 0.448-1 1-1zM8 3c-0.552 0-1-0.448-1-1v-1c0-0.552 0.448-1 1-1s1 0.448 1 1v1c0 0.552-0.448 1-1 1zM15 7c0.552 0 1 0.448 1 1s-0.448 1-1 1h-1c-0.552 0-1-0.448-1-1s0.448-1 1-1h1zM3 8c0 0.552-0.448 1-1 1h-1c-0.552 0-1-0.448-1-1s0.448-1 1-1h1c0.552 0 1 0.448 1 1zM12.95 11.536l0.707 0.707c0.39 0.39 0.39 1.024 0 1.414s-1.024 0.39-1.414 0l-0.707-0.707c-0.39-0.39-0.39-1.024 0-1.414s1.024-0.39 1.414 0zM3.050 4.464l-0.707-0.707c-0.391-0.391-0.391-1.024 0-1.414s1.024-0.391 1.414 0l0.707 0.707c0.391 0.391 0.391 1.024 0 1.414s-1.024 0.391-1.414 0zM12.95 4.464c-0.39 0.391-1.024 0.391-1.414 0s-0.39-1.024 0-1.414l0.707-0.707c0.39-0.391 1.024-0.391 1.414 0s0.39 1.024 0 1.414l-0.707 0.707zM3.050 11.536c0.39-0.39 1.024-0.39 1.414 0s0.391 1.024 0 1.414l-0.707 0.707c-0.391 0.39-1.024 0.39-1.414 0s-0.391-1.024 0-1.414l0.707-0.707z"},child:[]}]})(t)}function iX(t){return(0,iP.GenIcon)({tag:"svg",attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M15.5 6h-5.5v-5.5c0-0.276-0.224-0.5-0.5-0.5h-3c-0.276 0-0.5 0.224-0.5 0.5v5.5h-5.5c-0.276 0-0.5 0.224-0.5 0.5v3c0 0.276 0.224 0.5 0.5 0.5h5.5v5.5c0 0.276 0.224 0.5 0.5 0.5h3c0.276 0 0.5-0.224 0.5-0.5v-5.5h5.5c0.276 0 0.5-0.224 0.5-0.5v-3c0-0.276-0.224-0.5-0.5-0.5z"},child:[]}]})(t)}let iz=B.default.createContext(null);function iY(){let t=(0,B.useContext)(iz);if(!t)throw Error("No WarriorContext.Provider");return t}iz.displayName="WarriorContext";let iG="undefined"!=typeof window&&window.document&&window.document.createElement?B.useLayoutEffect:B.useEffect,iV=(t,e)=>{let i=B.useRef(!0);iG(()=>t(i.current),e),iG(()=>(i.current=!1,()=>{i.current=!0}),[])},iq=function(t){let e=B.useRef();return e.current=t,B.useCallback(function(){for(var t,i=arguments.length,n=Array(i),r=0;r{iQ.push(t)},i0.resetWarned=function(){iK={}},i0.noteOnce=function(t,e){iZ(i$,t,e)};let i1=function(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=new Set;return function t(e,r){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=n.has(e);if(i0(!o,"Warning: There may be circular references"),o)return!1;if(e===r)return!0;if(i&&s>1)return!1;n.add(e);let a=s+1;if(Array.isArray(e)){if(!Array.isArray(r)||e.length!==r.length)return!1;for(let i=0;it(e[i],r[i],a))}return!1}(t,e)};var i2=t.i(43794);function i5(t,e,i,n){let r=(e-i)/(n-i),s={};switch(t){case"rtl":s.right="".concat(100*r,"%"),s.transform="translateX(50%)";break;case"btt":s.bottom="".concat(100*r,"%"),s.transform="translateY(50%)";break;case"ttb":s.top="".concat(100*r,"%"),s.transform="translateY(-50%)";break;default:s.left="".concat(100*r,"%"),s.transform="translateX(-50%)"}return s}function i4(t,e){return Array.isArray(t)?t[e]:t}let i3={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(t){let{keyCode:e}=t;if(t.altKey&&!t.ctrlKey||t.metaKey||e>=i3.F1&&e<=i3.F12)return!1;switch(e){case i3.ALT:case i3.CAPS_LOCK:case i3.CONTEXT_MENU:case i3.CTRL:case i3.DOWN:case i3.END:case i3.ESC:case i3.HOME:case i3.INSERT:case i3.LEFT:case i3.MAC_FF_META:case i3.META:case i3.NUMLOCK:case i3.NUM_CENTER:case i3.PAGE_DOWN:case i3.PAGE_UP:case i3.PAUSE:case i3.PRINT_SCREEN:case i3.RIGHT:case i3.SHIFT:case i3.UP:case i3.WIN_KEY:case i3.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(t){if(t>=i3.ZERO&&t<=i3.NINE||t>=i3.NUM_ZERO&&t<=i3.NUM_MULTIPLY||t>=i3.A&&t<=i3.Z||-1!==window.navigator.userAgent.indexOf("WebKit")&&0===t)return!0;switch(t){case i3.SPACE:case i3.QUESTION_MARK:case i3.NUM_PLUS:case i3.NUM_MINUS:case i3.NUM_PERIOD:case i3.NUM_DIVISION:case i3.SEMICOLON:case i3.DASH:case i3.EQUALS:case i3.COMMA:case i3.PERIOD:case i3.SLASH:case i3.APOSTROPHE:case i3.SINGLE_QUOTE:case i3.OPEN_SQUARE_BRACKET:case i3.BACKSLASH:case i3.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},i9=B.createContext({min:0,max:0,direction:"ltr",step:1,includedStart:0,includedEnd:0,tabIndex:0,keyboard:!0,styles:{},classNames:{}}),i6=B.createContext({});function i8(){return(i8=Object.assign.bind()).apply(this,arguments)}let i7=B.forwardRef((t,e)=>{let{prefixCls:i,value:n,valueIndex:r,onStartMove:s,onDelete:o,style:a,render:l,dragging:c,draggingDelete:h,onOffsetChange:u,onChangeComplete:f,onFocus:d,onMouseEnter:g,...p}=t,{min:m,max:y,direction:b,disabled:x,keyboard:_,range:C,tabIndex:S,ariaLabelForHandle:w,ariaLabelledByForHandle:T,ariaRequired:O,ariaValueTextFormatterForHandle:k,styles:E,classNames:j}=B.useContext(i9),M="".concat(i,"-handle"),P=t=>{x||s(t,r)},A=i5(b,n,m,y),D={};if(null!==r){var F;D={tabIndex:x?null:i4(S,r),role:"slider","aria-valuemin":m,"aria-valuemax":y,"aria-valuenow":n,"aria-disabled":x,"aria-label":i4(w,r),"aria-labelledby":i4(T,r),"aria-required":i4(O,r),"aria-valuetext":null==(F=i4(k,r))?void 0:F(n),"aria-orientation":"ltr"===b||"rtl"===b?"horizontal":"vertical",onMouseDown:P,onTouchStart:P,onFocus:t=>{null==d||d(t,r)},onMouseEnter:t=>{g(t,r)},onKeyDown:t=>{if(!x&&_){let e=null;switch(t.which||t.keyCode){case i3.LEFT:e="ltr"===b||"btt"===b?-1:1;break;case i3.RIGHT:e="ltr"===b||"btt"===b?1:-1;break;case i3.UP:e="ttb"!==b?1:-1;break;case i3.DOWN:e="ttb"!==b?-1:1;break;case i3.HOME:e="min";break;case i3.END:e="max";break;case i3.PAGE_UP:e=2;break;case i3.PAGE_DOWN:e=-2;break;case i3.BACKSPACE:case i3.DELETE:null==o||o(r)}null!==e&&(t.preventDefault(),u(e,r))}},onKeyUp:t=>{switch(t.which||t.keyCode){case i3.LEFT:case i3.RIGHT:case i3.UP:case i3.DOWN:case i3.HOME:case i3.END:case i3.PAGE_UP:case i3.PAGE_DOWN:null==f||f()}}}}let R=B.createElement("div",i8({ref:e,className:(0,i2.default)(M,{["".concat(M,"-").concat(r+1)]:null!==r&&C,["".concat(M,"-dragging")]:c,["".concat(M,"-dragging-delete")]:h},j.handle),style:{...A,...a,...E.handle}},D,p));return l&&(R=l(R,{index:r,prefixCls:i,value:n,dragging:c,draggingDelete:h})),R});function nt(){return(nt=Object.assign.bind()).apply(this,arguments)}let ne=B.forwardRef((t,e)=>{let{prefixCls:i,style:n,onStartMove:r,onOffsetChange:s,values:o,handleRender:a,activeHandleRender:l,draggingIndex:c,draggingDelete:h,onFocus:u,...f}=t,d=B.useRef({}),[g,p]=B.useState(!1),[m,y]=B.useState(-1),b=t=>{y(t),p(!0)};B.useImperativeHandle(e,()=>({focus:t=>{var e;null==(e=d.current[t])||e.focus()},hideHelp:()=>{(0,t4.flushSync)(()=>{p(!1)})}}));let x={prefixCls:i,onStartMove:r,onOffsetChange:s,render:a,onFocus:(t,e)=>{b(e),null==u||u(t)},onMouseEnter:(t,e)=>{b(e)},...f};return B.createElement(B.Fragment,null,o.map((t,e)=>{let i=c===e;return B.createElement(i7,nt({ref:t=>{t?d.current[e]=t:delete d.current[e]},dragging:i,draggingDelete:i&&h,style:i4(n,e),key:e,value:t,valueIndex:e},x))}),l&&g&&B.createElement(i7,nt({key:"a11y"},x,{value:o[m],valueIndex:null,dragging:-1!==c,draggingDelete:h,render:l,style:{pointerEvents:"none"},tabIndex:null,"aria-hidden":!0})))}),ni=t=>{let{prefixCls:e,style:i,children:n,value:r,onClick:s}=t,{min:o,max:a,direction:l,includedStart:c,includedEnd:h,included:u}=B.useContext(i9),f="".concat(e,"-text"),d=i5(l,r,o,a);return B.createElement("span",{className:(0,i2.default)(f,{["".concat(f,"-active")]:u&&c<=r&&r<=h}),style:{...d,...i},onMouseDown:t=>{t.stopPropagation()},onClick:()=>{s(r)}},n)},nn=t=>{let{prefixCls:e,marks:i,onClick:n}=t,r="".concat(e,"-mark");return i.length?B.createElement("div",{className:r},i.map(t=>{let{value:e,style:i,label:s}=t;return B.createElement(ni,{key:e,prefixCls:r,style:i,value:e,onClick:n},s)})):null},nr=t=>{let{prefixCls:e,value:i,style:n,activeStyle:r}=t,{min:s,max:o,direction:a,included:l,includedStart:c,includedEnd:h}=B.useContext(i9),u="".concat(e,"-dot"),f=l&&c<=i&&i<=h,d={...i5(a,i,s,o),..."function"==typeof n?n(i):n};return f&&(d={...d,..."function"==typeof r?r(i):r}),B.createElement("span",{className:(0,i2.default)(u,{["".concat(u,"-active")]:f}),style:d})},ns=t=>{let{prefixCls:e,marks:i,dots:n,style:r,activeStyle:s}=t,{min:o,max:a,step:l}=B.useContext(i9),c=B.useMemo(()=>{let t=new Set;if(i.forEach(e=>{t.add(e.value)}),n&&null!==l){let e=o;for(;e<=a;)t.add(e),e+=l}return Array.from(t)},[o,a,l,n,i]);return B.createElement("div",{className:"".concat(e,"-step")},c.map(t=>B.createElement(nr,{prefixCls:e,key:t,value:t,style:r,activeStyle:s})))},no=t=>{let{prefixCls:e,style:i,start:n,end:r,index:s,onStartMove:o,replaceCls:a}=t,{direction:l,min:c,max:h,disabled:u,range:f,classNames:d}=B.useContext(i9),g="".concat(e,"-track"),p=(n-c)/(h-c),m=(r-c)/(h-c),y=t=>{!u&&o&&o(t,-1)},b={};switch(l){case"rtl":b.right="".concat(100*p,"%"),b.width="".concat(100*m-100*p,"%");break;case"btt":b.bottom="".concat(100*p,"%"),b.height="".concat(100*m-100*p,"%");break;case"ttb":b.top="".concat(100*p,"%"),b.height="".concat(100*m-100*p,"%");break;default:b.left="".concat(100*p,"%"),b.width="".concat(100*m-100*p,"%")}let x=a||(0,i2.default)(g,{["".concat(g,"-").concat(s+1)]:null!==s&&f,["".concat(e,"-track-draggable")]:o},d.track);return B.createElement("div",{className:x,style:{...b,...i},onMouseDown:y,onTouchStart:y})},na=t=>{let{prefixCls:e,style:i,values:n,startPoint:r,onStartMove:s}=t,{included:o,range:a,min:l,styles:c,classNames:h}=B.useContext(i9),u=B.useMemo(()=>{if(!a){if(0===n.length)return[];let t=null!=r?r:l,e=n[0];return[{start:Math.min(t,e),end:Math.max(t,e)}]}let t=[];for(let e=0;e{let{start:r,end:o}=t;return B.createElement(no,{index:n,prefixCls:e,style:{...i4(i,n),...c.track},start:r,end:o,key:n,onStartMove:s})}))};function nl(t){let e="targetTouches"in t?t.targetTouches[0]:t;return{pageX:e.pageX,pageY:e.pageY}}let nc=function(t,e,i,n,r,s,o,a,l,c,h){let[u,f]=B.useState(null),[d,g]=B.useState(-1),[p,m]=B.useState(!1),[y,b]=B.useState(i),[x,_]=B.useState(i),C=B.useRef(null),S=B.useRef(null),w=B.useRef(null),{onDragStart:T,onDragChange:O}=B.useContext(i6);iV(()=>{-1===d&&b(i)},[i,d]),B.useEffect(()=>()=>{document.removeEventListener("mousemove",C.current),document.removeEventListener("mouseup",S.current),w.current&&(w.current.removeEventListener("touchmove",C.current),w.current.removeEventListener("touchend",S.current))},[]);let k=(t,e,i)=>{void 0!==e&&f(e),b(t);let n=t;i&&(n=t.filter((t,e)=>e!==d)),o(n),O&&O({rawValues:t,deleteIndex:i?d:-1,draggingIndex:d,draggingValue:e})},E=iq((t,e,i)=>{if(-1===t){let t=x[0],i=x[x.length-1],o=e*(r-n);o=Math.min(o=Math.max(o,n-t),r-i),o=s(t+o)-t,k(x.map(t=>t+o))}else{let s=[...y];s[t]=x[t];let o=l(s,(r-n)*e,t,"dist");k(o.values,o.value,i)}});return[d,u,p,B.useMemo(()=>{let t=[...i].sort((t,e)=>t-e),e=[...y].sort((t,e)=>t-e),n={};e.forEach(t=>{n[t]=(n[t]||0)+1}),t.forEach(t=>{n[t]=(n[t]||0)-1});let r=+!!c;return Object.values(n).reduce((t,e)=>t+Math.abs(e),0)<=r?y:i},[i,y,c]),(n,r,s)=>{n.stopPropagation();let o=s||i,l=o[r];g(r),f(l),_(o),b(o),m(!1);let{pageX:u,pageY:d}=nl(n),p=!1;T&&T({rawValues:o,draggingIndex:r,draggingValue:l});let x=i=>{let n,s;i.preventDefault();let{pageX:o,pageY:a}=nl(i),l=o-u,f=a-d,{width:g,height:b}=t.current.getBoundingClientRect();switch(e){case"btt":n=-f/b,s=l;break;case"ttb":n=f/b,s=l;break;case"rtl":n=-l/g,s=f;break;default:n=l/g,s=f}m(p=!!c&&Math.abs(s)>130&&h{t.preventDefault(),document.removeEventListener("mouseup",O),document.removeEventListener("mousemove",x),w.current&&(w.current.removeEventListener("touchmove",C.current),w.current.removeEventListener("touchend",S.current)),C.current=null,S.current=null,w.current=null,a(p),g(-1),m(!1)};document.addEventListener("mouseup",O),document.addEventListener("mousemove",x),n.currentTarget.addEventListener("touchend",O),n.currentTarget.addEventListener("touchmove",x),C.current=x,S.current=O,w.current=n.currentTarget}]},nh=B.forwardRef((t,e)=>{let{prefixCls:i="rc-slider",className:n,style:r,classNames:s,styles:o,id:a,disabled:l=!1,keyboard:c=!0,autoFocus:h,onFocus:u,onBlur:f,min:d=0,max:g=100,step:p=1,value:m,defaultValue:y,range:b,count:x,onChange:_,onBeforeChange:C,onAfterChange:S,onChangeComplete:w,allowCross:T=!0,pushable:O=!1,reverse:k,vertical:E,included:j=!0,startPoint:M,trackStyle:P,handleStyle:A,railStyle:D,dotStyle:F,activeDotStyle:R,marks:L,dots:I,handleRender:N,activeHandleRender:U,track:W,tabIndex:H=0,ariaLabelForHandle:X,ariaLabelledByForHandle:z,ariaRequired:Y,ariaValueTextFormatterForHandle:G}=t,V=B.useRef(null),q=B.useRef(null),K=B.useMemo(()=>E?k?"ttb":"btt":k?"rtl":"ltr",[k,E]),[Q,J,$,Z,tt]=function(t){return(0,B.useMemo)(()=>{if(!0===t||!t)return[!!t,!1,!1,0];let{editable:e,draggableTrack:i,minCount:n,maxCount:r}=t;return[!0,e,!e&&i,n||0,r]},[t])}(b),te=B.useMemo(()=>isFinite(d)?d:0,[d]),ti=B.useMemo(()=>isFinite(g)?g:100,[g]),tn=B.useMemo(()=>null!==p&&p<=0?1:p,[p]),tr=B.useMemo(()=>"boolean"==typeof O?!!O&&tn:O>=0&&O,[O,tn]),ts=B.useMemo(()=>Object.keys(L||{}).map(t=>{let e=L[t],i={value:Number(t)};return e&&"object"==typeof e&&!B.isValidElement(e)&&("label"in e||"style"in e)?(i.style=e.style,i.label=e.label):i.label=e,i}).filter(t=>{let{label:e}=t;return e||"number"==typeof e}).sort((t,e)=>t.value-e.value),[L]),[to,ta]=function(t,e,i,n,r,s){let o=B.useCallback(i=>Math.max(t,Math.min(e,i)),[t,e]),a=B.useCallback(n=>{if(null!==i){let r=t+Math.round((o(n)-t)/i)*i,s=t=>(String(t).split(".")[1]||"").length,a=Math.max(s(i),s(e),s(t)),l=Number(r.toFixed(a));return t<=l&&l<=e?l:null}return null},[i,t,e,o]),l=B.useCallback(r=>{let s=o(r),l=n.map(t=>t.value);null!==i&&l.push(a(r)),l.push(t,e);let c=l[0],h=e-t;return l.forEach(t=>{let e=Math.abs(s-t);e<=h&&(c=t,h=e)}),c},[t,e,n,i,o,a]),c=function(r,s,o){let l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"unit";if("number"==typeof s){let h,u=r[o],f=u+s,d=[];n.forEach(t=>{d.push(t.value)}),d.push(t,e),d.push(a(u));let g=s>0?1:-1;"unit"===l?d.push(a(u+g*i)):d.push(a(f)),d=d.filter(t=>null!==t).filter(t=>s<0?t<=u:t>=u),"unit"===l&&(d=d.filter(t=>t!==u));let p="unit"===l?u:f,m=Math.abs((h=d[0])-p);if(d.forEach(t=>{let e=Math.abs(t-p);e1){let t=[...r];return t[o]=h,c(t,s-g,o,l)}return h}return"min"===s?t:"max"===s?e:void 0},h=function(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"unit",r=t[i],s=c(t,e,i,n);return{value:s,changed:s!==r}},u=t=>null===s&&0===t||"number"==typeof s&&t3&&void 0!==arguments[3]?arguments[3]:"unit",o=t.map(l),a=o[i],f=c(o,e,i,n);if(o[i]=f,!1===r){let t=s||0;i>0&&o[i-1]!==a&&(o[i]=Math.max(o[i],o[i-1]+t)),i0;t-=1){let e=!0;for(;u(o[t]-o[t-1])&&e;)({value:o[t-1],changed:e}=h(o,-1,t-1))}for(let t=o.length-1;t>0;t-=1){let e=!0;for(;u(o[t]-o[t-1])&&e;)({value:o[t-1],changed:e}=h(o,-1,t-1))}for(let t=0;t{t||n(e)},[e]),[r,n]}(y,m),th=B.useMemo(()=>{let t=null==tl?[]:Array.isArray(tl)?tl:[tl],[e=te]=t,i=null===tl?[]:[e];if(Q){if(i=[...t],x||void 0===tl){let t=x>=0?x+1:2;for(i=i.slice(0,t);i.lengtht-e)}return i.forEach((t,e)=>{i[e]=to(t)}),i},[tl,Q,te,x,to]),tu=t=>Q?t:t[0],tf=iq(t=>{let e=[...t].sort((t,e)=>t-e);_&&!i1(e,th,!0)&&_(tu(e)),tc(e)}),td=iq(t=>{t&&V.current.hideHelp();let e=tu(th);null==S||S(e),i0(!S,"[rc-slider] `onAfterChange` is deprecated. Please use `onChangeComplete` instead."),null==w||w(e)}),[tg,tp,tv,tm,ty]=nc(q,K,th,te,ti,to,tf,td,ta,J,Z),tb=(t,e)=>{if(!l){let r=[...th],s=0,o=0,a=ti-te;th.forEach((e,i)=>{let n=Math.abs(t-e);n<=a&&(a=n,s=i),e{if(null!==tx){let t=th.indexOf(tx);t>=0&&V.current.focus(t)}t_(null)},[tx]);let tC=B.useMemo(()=>(!$||null!==tn)&&$,[$,tn]),tS=iq((t,e)=>{ty(t,e),null==C||C(tu(th))}),tw=-1!==tg;B.useEffect(()=>{if(!tw){let t=th.lastIndexOf(tp);V.current.focus(t)}},[tw]);let tT=B.useMemo(()=>[...tm].sort((t,e)=>t-e),[tm]),[tO,tk]=B.useMemo(()=>Q?[tT[0],tT[tT.length-1]]:[te,tT[0]],[tT,Q,te]);B.useImperativeHandle(e,()=>({focus:()=>{V.current.focus(0)},blur:()=>{var t;let{activeElement:e}=document;(null==(t=q.current)?void 0:t.contains(e))&&(null==e||e.blur())}})),B.useEffect(()=>{h&&V.current.focus(0)},[]);let tE=B.useMemo(()=>({min:te,max:ti,direction:K,disabled:l,keyboard:c,step:tn,included:j,includedStart:tO,includedEnd:tk,range:Q,tabIndex:H,ariaLabelForHandle:X,ariaLabelledByForHandle:z,ariaRequired:Y,ariaValueTextFormatterForHandle:G,styles:o||{},classNames:s||{}}),[te,ti,K,l,c,tn,j,tO,tk,Q,H,X,z,Y,G,o,s]);return B.createElement(i9.Provider,{value:tE},B.createElement("div",{ref:q,className:(0,i2.default)(i,n,{["".concat(i,"-disabled")]:l,["".concat(i,"-vertical")]:E,["".concat(i,"-horizontal")]:!E,["".concat(i,"-with-marks")]:ts.length}),style:r,onMouseDown:t=>{let e;t.preventDefault();let{width:i,height:n,left:r,top:s,bottom:o,right:a}=q.current.getBoundingClientRect(),{clientX:l,clientY:c}=t;switch(K){case"btt":e=(o-c)/n;break;case"ttb":e=(c-s)/n;break;case"rtl":e=(a-l)/i;break;default:e=(l-r)/i}tb(to(te+e*(ti-te)),t)},id:a},B.createElement("div",{className:(0,i2.default)("".concat(i,"-rail"),null==s?void 0:s.rail),style:{...D,...null==o?void 0:o.rail}}),!1!==W&&B.createElement(na,{prefixCls:i,style:P,values:th,startPoint:M,onStartMove:tC?tS:void 0}),B.createElement(ns,{prefixCls:i,marks:ts,dots:I,style:F,activeStyle:R}),B.createElement(ne,{ref:V,prefixCls:i,style:A,values:tm,draggingIndex:tg,draggingDelete:tv,onStartMove:tS,onOffsetChange:(t,e)=>{if(!l){let i=ta(th,t,e);null==C||C(tu(th)),tf(i.values),t_(i.value)}},onFocus:u,onBlur:f,handleRender:N,activeHandleRender:U,onChangeComplete:td,onDelete:J?t=>{if(l||!J||th.length<=Z)return;let e=[...th];e.splice(t,1),null==C||C(tu(e)),tf(e);let i=Math.max(0,t-1);V.current.hideHelp(),V.current.focus(i)}:void 0}),B.createElement(nn,{prefixCls:i,marks:ts,onClick:tb})))}),nu={track:{height:8,background:"#03fccf"},handle:{width:20,height:20,marginTop:-6,borderColor:"#03fccf",background:"rgb(5, 69, 76)",opacity:1},rail:{height:8,border:"1px solid #555",background:"rgba(255, 255, 255, 0.3)"}};function nf(t){return(0,I.jsx)(nh,{...t,styles:{...nu,...t.styles}})}let nd=t.i(29947).default,{materials:ng}=nd;function np(){var t;let e=(0,B.useRef)(null),i=(0,B.useRef)(null),[n,r]=(0,B.useState)("vl2"),{activeCanvas:s,backgroundColor:o,setBackgroundColor:a,selectedObjects:l,lockedObjects:c,lockSelection:h,unlockSelection:u,bringForward:f,sendBackward:d,duplicate:g,deleteSelection:p,undo:m,redo:y,canUndo:b,canRedo:x,copyToMetallic:_,brushColor:C,setBrushColor:S,brushSize:w,setBrushSize:T,hueRotate:O,setHueRotate:k,saturation:E,setSaturation:j,brightness:M,setBrightness:P,contrast:A,setContrast:D,opacity:F,setOpacity:R,layerMode:L,setLayerMode:U,activeCanvasType:H,addImages:z,exportSkin:Y,selectedExportMaterials:G,setSelectedExportMaterials:V}=X(),{actualModel:q}=iY(),K=ng[q],{canvas:Q,isDrawingMode:J,setDrawingMode:$}=W(s),[Z,tt]=(0,B.useState)(!1),te=Z?"⌘":"Ctrl ",[ti,tn]=(0,B.useState)(!1),{refs:tr,floatingStyles:ts,context:to}=iO({open:ti,onOpenChange:tn,placement:"bottom-end",middleware:[ee(),et(10)],whileElementsMounted:t5}),ta=i_(to),tl=iT(to),tc=iM(to);(0,B.useEffect)(()=>{ti&&$(!0)},[ti,$]);let{getReferenceProps:th,getFloatingProps:tu}=iE([ta,tl,tc]),[tf,td]=(0,B.useState)(!1),{refs:tg,floatingStyles:tp,context:tv}=iO({open:tf,onOpenChange:td,placement:"bottom-end",middleware:[ee(),et(10)],whileElementsMounted:t5}),tm=i_(tv),{getReferenceProps:ty,getFloatingProps:tb}=iE([tm,iT(tv),iM(tv)]),[tx,t_]=(0,B.useState)(!1),{refs:tC,floatingStyles:tS,context:tw}=iO({open:tx,onOpenChange:t_,placement:"bottom-end",middleware:[ee(),et(10)],whileElementsMounted:t5}),tT=i_(tw),{getReferenceProps:tO,getFloatingProps:tk}=iE([tT,iT(tw),iM(tw)]),tE=!!l.length&&l.every(t=>c.has(t)),tj=l.length>0,tM=l.filter(t=>t instanceof N.fabric.Image).length>0,tP=t=>{a(t.target.value)};return(0,B.useEffect)(()=>{try{let t=localStorage.getItem("exportFileType");switch(t){case"vl2":case"png":r(t)}}catch(t){}},[]),(0,B.useEffect)(()=>{navigator.platform&&navigator.platform.startsWith("Mac")?tt(!0):navigator.userAgent.match(/\(Macintosh;/)&&tt(!0)},[]),(0,I.jsxs)("div",{className:"CanvasTools",children:[(0,I.jsxs)("div",{className:"CanvasBackgroundColor",children:[(0,I.jsx)("input",{className:"ColorSwatch",type:"radio",name:"backgroundColor",id:"canvasBackgroundColorBlack",value:"black",checked:"black"===o,onChange:tP}),(0,I.jsx)("label",{htmlFor:"canvasBackgroundColorBlack",children:(0,I.jsx)("span",{className:"HiddenLabel",children:"Black"})}),(0,I.jsx)("input",{className:"ColorSwatch",type:"radio",name:"backgroundColor",id:"canvasBackgroundColorMagenta",value:"magenta",checked:"magenta"===o,onChange:tP}),(0,I.jsx)("label",{htmlFor:"canvasBackgroundColorMagenta",children:(0,I.jsx)("span",{className:"HiddenLabel",children:"Magenta"})}),(0,I.jsx)("input",{className:"ColorSwatch",type:"radio",name:"backgroundColor",id:"canvasBackgroundColorWhite",value:"white",checked:"white"===o,onChange:tP}),(0,I.jsx)("label",{htmlFor:"canvasBackgroundColorWhite",children:(0,I.jsx)("span",{className:"HiddenLabel",children:"White"})})]}),(0,I.jsxs)("div",{className:"Buttons",children:["metallic"===H?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)("div",{className:"ButtonGroup",children:[(0,I.jsx)("button",{className:"ButtonGroup",type:"button","data-active":J?void 0:"","aria-label":"Select Mode",title:"Select Mode (S)",onClick:()=>{$(!1)},children:(0,I.jsx)(iR,{})}),(0,I.jsx)("button",{className:"ButtonGroup",type:"button","data-active":J?"":void 0,"aria-label":"Paint Mode",title:"Paint Mode (P)",ref:tr.setReference,...th(),children:(0,I.jsx)(iL,{})})]}),ti?(0,I.jsx)(ib,{context:to,modal:!1,children:(0,I.jsx)("div",{className:"BrushToolsPopup",ref:tr.setFloating,style:ts,...tu(),children:(0,I.jsxs)("div",{className:"Fields",children:[(0,I.jsxs)("div",{className:"Field",children:[(0,I.jsx)("label",{children:"Metallic Amount"}),(0,I.jsx)("div",{className:"SliderContainer",children:(0,I.jsx)(nf,{min:0,max:255,value:C,onChange:t=>{Array.isArray(t)&&(t=t[0]),S(t)},styles:{track:{display:"none"},handle:{width:20,height:20,marginTop:-6,borderColor:"rgb(20, 105, 241)",background:"rgb(".concat(C,", ").concat(C,", ").concat(C,")"),opacity:1},rail:{height:8,border:"1px solid #555",background:"linear-gradient(to right, black 0%, white 100%)"}}})})]}),(0,I.jsxs)("div",{className:"Field",children:[(0,I.jsx)("label",{children:"Brush Size"}),(0,I.jsx)("div",{className:"SliderContainer",children:(0,I.jsx)(nf,{min:1,max:50,value:w,onChange:t=>{Array.isArray(t)&&(t=t[0]),T(t)}})})]})]})})}):null]}):null,(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)("input",{ref:i,onChange:async t=>{z([await new Promise((e,i)=>{var n;let r=null==(n=t.target.files)?void 0:n[0];if(r){let t=new FileReader;t.addEventListener("load",t=>{var i;e(null==(i=t.target)?void 0:i.result)}),t.readAsDataURL(r)}else i(Error("No input file provided."))})])},type:"file",accept:".png, image/png",hidden:!0}),(0,I.jsx)("button",{type:"button","aria-label":"Add Image",title:"Add Image",onClick:()=>{i.current&&i.current.click()},children:(0,I.jsx)(iX,{style:{fontSize:14}})}),(0,I.jsx)("button",{type:"button","data-active":tf?"":void 0,"aria-label":"Filters",title:"Filters",disabled:tj&&!tM,ref:tg.setReference,...ty(),children:(0,I.jsx)(iW,{})}),tf?(0,I.jsx)(ib,{context:tv,modal:!1,children:(0,I.jsx)("div",{className:"BrushToolsPopup",ref:tg.setFloating,style:tp,...tb(),children:(0,I.jsxs)("div",{className:"Fields",children:[(0,I.jsxs)("div",{className:"Field ApplyTo",children:[(0,I.jsx)("label",{children:"Layer:"}),(0,I.jsx)("ul",{children:l.length?(0,I.jsxs)("li",{children:[(0,I.jsx)("input",{type:"radio",name:"FilterLayer",value:"SelectedLayer",id:"FilterLayer-SelectedLayer",checked:"SelectedLayer"===L,onChange:()=>{U("SelectedLayer")}}),(0,I.jsxs)("label",{htmlFor:"FilterLayer-SelectedLayer",children:["selected (",l.length.toLocaleString(),")"]})]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)("li",{children:[(0,I.jsx)("input",{type:"radio",name:"FilterLayer",value:"BaseLayer",id:"FilterLayer-BaseLayer",checked:"BaseLayer"===L,onChange:()=>{U("BaseLayer")}})," ",(0,I.jsx)("label",{htmlFor:"FilterLayer-BaseLayer",children:"base"})]}),(0,I.jsxs)("li",{children:[(0,I.jsx)("input",{type:"radio",name:"FilterLayer",value:"AllLayers",id:"FilterLayer-AllLayers",checked:"AllLayers"===L,onChange:()=>{U("AllLayers")}}),(0,I.jsxs)("label",{htmlFor:"FilterLayer-AllLayers",children:["all (",null!=(t=null==Q?void 0:Q._objects.filter(t=>t instanceof N.fabric.Image).length.toLocaleString())?t:0,")"]})]})]})})]}),"color"===H?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)("div",{className:"Field",children:[(0,I.jsxs)("label",{children:["Hue:"," ",(0,I.jsx)("strong",{children:null==O?"MULTIPLE VALUES":(0,I.jsxs)(I.Fragment,{children:[Math.round(180*O),"°"]})})]}),(0,I.jsx)("div",{className:"SliderContainer",children:(0,I.jsx)(nf,{min:-180,max:180,startPoint:0,value:Math.round((null!=O?O:0)*180),onChange:t=>{Array.isArray(t)&&(t=t[0]),k(t/180)}})})]}),(0,I.jsxs)("div",{className:"Field",children:[(0,I.jsxs)("label",{children:["Saturation:"," ",(0,I.jsx)("strong",{children:null==E?"MULTIPLE VALUES":"".concat(Math.round(100*E+100),"%")})]}),(0,I.jsx)("div",{className:"SliderContainer",children:(0,I.jsx)(nf,{min:-100,max:100,startPoint:0,value:Math.round((null!=E?E:0)*100),onChange:t=>{Array.isArray(t)&&(t=t[0]),j(t/100)}})})]})]}):null,(0,I.jsxs)("div",{className:"Field",children:[(0,I.jsxs)("label",{children:["Brightness:"," ",(0,I.jsx)("strong",{children:null==M?"MULTIPLE VALUES":"".concat(Math.round(100*M+100),"%")})]}),(0,I.jsx)("div",{className:"SliderContainer",children:(0,I.jsx)(nf,{min:-100,max:100,startPoint:0,value:Math.round((null!=M?M:0)*100),onChange:t=>{Array.isArray(t)&&(t=t[0]),P(t/100)}})})]}),(0,I.jsxs)("div",{className:"Field",children:[(0,I.jsxs)("label",{children:["Contrast:"," ",(0,I.jsx)("strong",{children:null==A?"MULTIPLE VALUES":"".concat(Math.round(100*A+100),"%")})]}),(0,I.jsx)("div",{className:"SliderContainer",children:(0,I.jsx)(nf,{min:-100,max:100,startPoint:0,value:Math.round((null!=A?A:0)*100),onChange:t=>{Array.isArray(t)&&(t=t[0]),D(t/100)}})})]}),(0,I.jsxs)("div",{className:"Field",children:[(0,I.jsxs)("label",{children:["Opacity:"," ",(0,I.jsx)("strong",{children:null==A?"MULTIPLE VALUES":"".concat(Math.round((null!=F?F:1)*100),"%")})]}),(0,I.jsx)("div",{className:"SliderContainer",children:(0,I.jsx)(nf,{min:0,max:100,startPoint:0,value:Math.round((null!=F?F:1)*100),onChange:t=>{Array.isArray(t)&&(t=t[0]),R(t/100)}})})]})]})})}):null,(0,I.jsx)("button",{type:"button","aria-label":tE?"Unlock":"Lock",title:tE?"Unlock (L)":"Lock (L)",onClick:tE?u:h,"data-locked":tE?"":void 0,disabled:!tj,children:tE?(0,I.jsx)(iF.FaUnlock,{style:{fontSize:14}}):(0,I.jsx)(iF.FaLock,{style:{fontSize:14}})}),(0,I.jsxs)("div",{className:"ButtonGroup",children:[(0,I.jsx)("button",{type:"button","aria-label":"Bring Forward",title:"Bring Forward (F)",onClick:f,disabled:!tj,children:(0,I.jsx)(iF.FaArrowUp,{})}),(0,I.jsx)("button",{type:"button","aria-label":"Send Backward",title:"Send Backward (B)",onClick:d,disabled:!tj,children:(0,I.jsx)(iF.FaArrowDown,{})})]}),(0,I.jsx)("button",{type:"button","aria-label":"Duplicate",title:"Duplicate (D)",onClick:g,disabled:!tj,children:(0,I.jsx)(iA,{})}),(0,I.jsx)("button",{type:"button","aria-label":"Delete",title:"Delete (Backspace)",onClick:p,disabled:tE||!tj,children:(0,I.jsx)(iF.FaTrashAlt,{})}),(0,I.jsxs)("div",{className:"ButtonGroup",children:[(0,I.jsx)("button",{type:"button","aria-label":"Undo",title:"Undo (".concat(te,"Z)"),onClick:m,disabled:!b,children:(0,I.jsx)(iN,{})}),(0,I.jsx)("button",{type:"button","aria-label":"Redo",title:"Redo (".concat(Z?"".concat("⇧").concat(te,"Z)"):"".concat(te," Y"),")"),onClick:y,disabled:!x,children:(0,I.jsx)(iU,{})})]}),"color"===H?(0,I.jsxs)("button",{type:"button",className:"MetallicButton","aria-label":"Copy to Metallic",title:"Copy to Metallic",onClick:_,children:[(0,I.jsx)(iD,{})," ",(0,I.jsx)("span",{className:"ButtonLabel",children:"Metal"})]}):null]})]}),(0,I.jsxs)("div",{className:"Export",children:[(0,I.jsx)("input",{ref:e,type:"text",name:"CustomSkinName",placeholder:"Skin Name",size:12}),(0,I.jsxs)("button",{className:"ExportOptionsButton",type:"button","data-active":tx?"":void 0,"aria-label":"Export Options",title:"Export Options",ref:tC.setReference,...tO(),children:[".",n,(0,I.jsx)(iF.FaAngleDown,{})]}),tx?(0,I.jsx)(ib,{context:tw,modal:!1,children:(0,I.jsx)("div",{className:"ExportOptionsPopup",ref:tC.setFloating,style:tS,...tk(),children:(0,I.jsxs)("div",{className:"Fields",children:[(0,I.jsxs)("div",{className:"Field",children:[(0,I.jsx)("label",{children:"Export Materials"}),(0,I.jsx)("ul",{className:"ExportOptionsList",children:K.map((t,e)=>t&&!1!==t.selectable&&!t.hidden?(0,I.jsxs)("li",{children:[(0,I.jsx)("input",{id:"MaterialSelect-".concat(t.name),type:"checkbox",checked:!1!==G[e],onChange:t=>{V(i=>{let n=i.slice();return n[e]=t.target.checked,n})}}),(0,I.jsx)("label",{htmlFor:"MaterialSelect-".concat(t.name),children:t.label})]},t.name):null)})]}),(0,I.jsxs)("div",{className:"Field",children:[(0,I.jsx)("label",{htmlFor:"ExportFormat",children:"Export Format"}),(0,I.jsxs)("select",{id:"ExportFormat",value:n,onChange:t=>{r(t.target.value);try{localStorage.setItem("exportFileType",t.target.value)}catch(t){}},children:[(0,I.jsx)("option",{value:"png",children:".png"}),(0,I.jsx)("option",{value:"vl2",children:".vl2"})]})]})]})})}):null,(0,I.jsx)("button",{type:"button",onClick:()=>{Y({name:e.current?e.current.value:"",format:n})},children:"Export"})]})]})}function nv(){return(0,I.jsxs)("footer",{className:"AppFooter",children:[(0,I.jsx)("a",{href:"https://github.com/exogen/t2-model-skinner",className:"IconLink",children:(0,I.jsx)(iF.FaGithub,{size:32})}),(0,I.jsxs)("div",{className:"Sponsor",children:[(0,I.jsx)("a",{href:"https://github.com/sponsors/exogen",target:"_blank",rel:"noreferrer",children:"Support this project"})," ",(0,I.jsx)("span",{className:"Separator",children:"or"})," ",(0,I.jsx)("a",{href:"https://www.buymeacoffee.com/mosswood",target:"_blank",rel:"noreferrer",children:(0,I.jsx)("img",{src:"https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png",alt:"Buy Me A Coffee",width:145,height:40})})]})]})}async function nm(t){let e=new Promise(e=>N.fabric.Image.fromURL(t,e,{crossOrigin:"anonymous"}));return await e}var ny=t.i(55519);function nb(){let e=(0,B.useRef)(null),i=(0,B.useRef)(null),n=(0,B.useMemo)(()=>({async combineColorAndAlphaImageUrls(){for(var t=arguments.length,e=Array(t),n=0;n{let n=new Worker(t.r(79702)),r=ny.wrap(n);return e.current=n,i.current=r,()=>{r[ny.releaseProxy](),i.current=null,n.terminate()}},[]),n}function nx(){return{canvasPadding:64,basePath:"/t2-model-skinner"}}var n_=t.i(54826);let{materials:nC}=nd,nS=[512,512];function nw(e){var i,n;let{children:r}=e,{actualModel:s,selectedModelType:o}=iY(),[a,l]=(0,B.useState)(0),[c,h]=(0,B.useState)(0),[u,f]=(0,B.useState)(1),d=nC[s],g=null!=(i=d[a])?i:null,p=null!=(n=g.frameCount)?n:1,m=p>1,[y,b]=(0,B.useState)([]),x=(0,B.useMemo)(()=>{var t;let[e,i]=null!=(t=g.size)?t:nS;return[e*u,i*u]},[g.size,u]),_=0!==g.metallicFactor||1!==g.roughnessFactor,[C,S]=(0,B.useState)("color");_||"metallic"!==C||S("color"),c>=p&&h(0),(0,B.useEffect)(()=>{try{let t=localStorage.getItem("sizeMultiplier");switch(t){case"1":case"2":case"4":f(+t)}}catch(t){}},[]),(0,B.useEffect)(()=>{b(d.map(t=>!!(t&&!1!==t.selectable&&!t.hidden)))},[d]),(0,B.useEffect)(()=>{h(0)},[g]);let[w,T]=(0,B.useState)("magenta"),[O,k]=(0,B.useState)(()=>new Set),[E,j]=(0,B.useState)(200),[M,P]=(0,B.useState)(10),[A,D]=(0,B.useState)(()=>new Map),[F,R]=(0,B.useState)(()=>[]),L=g?"".concat(g.name,":").concat(C,":").concat(c,":").concat(u):null,U=g?"".concat(g.name,":metallic:").concat(c,":").concat(u):null,{canvases:X}=W(),{canvas:z,notifyChange:Y,undo:G,redo:V,canUndo:q,canRedo:K}=W(L),{canvas:Q,setDrawingMode:J}=W(U),{combineColorAndAlphaImageUrls:$}=nb(),{canvasPadding:Z}=nx(),[tt,te]=(0,B.useState)(()=>[]),[ti,tn]=(0,B.useState)("BaseLayer");F.length?"SelectedLayer"!==ti&&tn("SelectedLayer"):"SelectedLayer"===ti&&tn("BaseLayer");let tr=(0,B.useCallback)((t,e)=>{var i,n,r;let s=[],o=new Map(A),a=F;for(let l of("AllLayers"===ti?a=null!=(i=null==z?void 0:z._objects)?i:[]:"BaseLayer"===ti&&(a=null!=(n=null==z?void 0:z._objects.slice(0,1))?n:[]),a))if(l instanceof N.fabric.Image){let i={...null!=(r=A.get(l))?r:{},[t]:e};o.set(l,i),s.push([l,i])}D(o),te(s)},[z,ti,A,F]),ts=t=>{var e,i;let n=+("Opacity"===t),r=F;if("AllLayers"===ti?r=null!=(e=null==z?void 0:z._objects)?e:[]:"BaseLayer"===ti&&(r=null!=(i=null==z?void 0:z._objects.slice(0,1))?i:[]),!(r=r.filter(t=>t instanceof N.fabric.Image)).length)return[n,e=>tr(t,e)];{let e=e=>{var i,s;return null!=(s=(null!=(i=A.get(r[e]))?i:{})[t])?s:n},i=e(0);return r.slice(1).every((t,n)=>e(n+1)===i)?[i,e=>tr(t,e)]:[null,e=>tr(t,e)]}},[to,ta]=ts("HueRotation"),[tl,tc]=ts("Saturation"),[th,tu]=ts("Brightness"),[tf,td]=ts("Contrast"),[tg,tp]=ts("Opacity");(0,B.useEffect)(()=>{if(tt.length){for(let[t,e]of tt)if(t instanceof N.fabric.Image){if(t.filters=[],"metallic"===C){let e=new N.fabric.Image.filters.Grayscale;t.filters.push(e)}for(let i in e){let n=e[i];if(null!=n)switch(i){case"HueRotation":t.filters.push(new N.fabric.Image.filters.HueRotation({rotation:n}));break;case"Saturation":t.filters.push(new N.fabric.Image.filters.Saturation({saturation:n}));break;case"Brightness":t.filters.push(new N.fabric.Image.filters.Brightness({brightness:n}));break;case"Contrast":t.filters.push(new N.fabric.Image.filters.Contrast({contrast:n}));break;case"Opacity":t.opacity=n}}t.applyFilters()}te([]),Y&&Y()}},[tt,C,Y]);let tv=(0,B.useCallback)(()=>{F.length&&k(t=>{let e=new Set(t);for(let t of F)e.add(t),t.lockMovementX=!0,t.lockMovementY=!0,t.lockScalingX=!0,t.lockScalingY=!0,t.lockRotation=!0;return e})},[F]),tm=(0,B.useCallback)(()=>{F.length&&k(t=>{let e=new Set(t);for(let t of F)e.delete(t),t.lockMovementX=!1,t.lockMovementY=!1,t.lockScalingX=!1,t.lockScalingY=!1,t.lockRotation=!1;return e})},[F]),ty=(0,B.useCallback)(async()=>{let t=z.getActiveObject();t&&(z.bringForward(t,!0),Y())},[z,Y]),tb=(0,B.useCallback)(async()=>{let t=z.getActiveObject();if(t){if(z._objects[0]===t||z._objects[1]===t)return;z.sendBackwards(t,!0),Y()}},[z,Y]),tx=(0,B.useCallback)(async t=>{let e;for(let i of t){let t=await nm(i);if(!t.width||!t.height)throw Error("Zero-height image");let n=t.width/x[0],r=t.height/x[1];if(n>1||r>1){let e;t.scaleX=e=n>r?1/n:1/r,t.scaleY=e}if("metallic"===C){t.filters||(t.filters=[]);let e=new N.fabric.Image.filters.Grayscale;t.filters.push(e),t.applyFilters()}Q&&J(!1),z.centerObject(t),z.add(t),e=t}e&&z.setActiveObject(e)},[x,C,Q,z,J]),t_=(0,B.useCallback)(async()=>{let t=z.getActiveObject();if(t){var e,i;let n=await new Promise(e=>t.clone(e));n.set({top:(null!=(e=n.top)?e:0)+20,left:(null!=(i=n.left)?i:0)+20,evented:!0}),"activeSelection"===n.type&&(n.canvas=z,n.forEachObject(t=>{z.add(t)}),n.setCoords()),z.discardActiveObject(),z.add(n),z.setActiveObject(n)}},[z]),tC=(0,B.useCallback)(async()=>{let t=z.getActiveObjects();z.discardActiveObject(),z.remove(...t),z.requestRenderAll()},[z]),tS=(0,B.useCallback)(async()=>{if("color"===C&&Q){let t=z.toDataURL({top:Z,left:Z,width:x[0],height:x[1]}),e=await nm(t);e.filters||(e.filters=[]);let i=new N.fabric.Image.filters.Grayscale;e.filters.push(i),e.applyFilters(),Q.centerObject(e),Q.add(e),Q.setActiveObject(e),J(!1),S("metallic")}},[Q,z,C,Z,J,x]),tw=(0,B.useCallback)(async e=>{let{format:i,name:n=""}=e,{savePngFile:r,saveZipFile:a,createZipFile:l}=await t.A(91135);n=n.trim()||"MyCustomSkin";let c=await Promise.all(d.filter((t,e)=>!1!==y[e]).map(t=>{var e;let i=null!=(e=t.frameCount)?e:1;return Array(i).fill(null).map(async(e,r)=>{var a,l,c,h;let f,d,g=null==(a=X["".concat(t.name,":color:").concat(r,":").concat(u)])?void 0:a.canvas,p=null==(l=X["".concat(t.name,":metallic:").concat(r,":").concat(u)])?void 0:l.canvas,m=null!=(c=t.size)?c:nS,y=[m[0]*u,m[1]*u],b=g.toDataURL({top:Z,left:Z,width:y[0],height:y[1]});if(p){let t=p.toDataURL({top:Z,left:Z,width:y[0],height:y[1]});f=await $({colorImageUrl:b,metallicImageUrl:t})}else f=b;switch(o){case"player":d="".concat(n,".").concat(s,".png");break;case"weapon":case"vehicle":if(t){let e=null!=(h=t.file)?h:t.name;if(i>1){let t=e.match(/^(.+)(\d\d)$/);if(t){let e=t[1];d="".concat(e).concat(r.toString().padStart(2,"0"),".png")}else throw Error("Unexpected animation filename")}else d="".concat(e,".png")}else d="weapon"===o?"weapon_".concat(s,".png"):"".concat(s,".png");break;default:throw Error("Unknown model type")}return{imageUrl:f,filename:d}})}).flat());switch(i){case"png":c.forEach(t=>{let{imageUrl:e,filename:i}=t;r(e,i)});break;case"vl2":{let t=l(await Promise.all(c.map(async t=>({data:await (0,n_.imageUrlToArrayBuffer)(t.imageUrl),name:t.filename})))),e=s.replace(/(?:^([a-z])|_([a-z]))/g,(t,e,i)=>(e||i).toUpperCase()),i="",r=u>1?"-@".concat(u,"x"):"";switch(o){case"player":i="zPlayerSkin-".concat(n).concat(r,".vl2");break;case"weapon":i="zWeapon".concat(e,"-").concat(n).concat(r,".vl2");break;case"vehicle":i="z".concat(e,"-").concat(n).concat(r,".vl2")}await a(t,i)}}},[d,y,X,u,Z,o,$,s]),tT=(0,B.useMemo)(()=>({activeCanvas:L,activeCanvasType:C,setActiveCanvasType:S,backgroundColor:w,setBackgroundColor:T,lockedObjects:O,setLockedObjects:k,brushColor:E,setBrushColor:j,brushSize:M,setBrushSize:P,hueRotate:to,setHueRotate:ta,saturation:tl,setSaturation:tc,brightness:th,setBrightness:tu,contrast:tf,setContrast:td,opacity:tg,setOpacity:tp,layerMode:ti,setLayerMode:tn,selectedObjects:F,lockSelection:tv,unlockSelection:tm,bringForward:ty,sendBackward:tb,addImages:tx,duplicate:t_,deleteSelection:tC,undo:G,redo:V,canUndo:q,canRedo:K,copyToMetallic:tS,exportSkin:tw,selectedMaterialIndex:a,setSelectedMaterialIndex:l,textureSize:x,hasMetallic:_,selectedFrameIndex:c,setSelectedFrameIndex:h,hasAnimation:m,frameCount:p,sizeMultiplier:u,setSizeMultiplier:f,selectedExportMaterials:y,setSelectedExportMaterials:b}),[L,C,w,O,E,M,to,ta,tl,tc,th,tu,tf,td,tg,tp,ti,F,tv,tm,ty,tb,tx,t_,tC,G,V,q,K,tS,tw,a,x,_,c,m,p,u,y]);return(0,B.useEffect)(()=>{if(z){let t=()=>{R(z.getActiveObjects())};return z.on("selection:cleared",t),z.on("selection:updated",t),z.on("selection:created",t),t(),()=>{z.off("selection:cleared",t),z.off("selection:updated",t),z.off("selection:created",t)}}},[z]),(0,B.useEffect)(()=>{Q&&(Q.freeDrawingBrush.width=M)},[Q,M]),(0,B.useEffect)(()=>{Q&&(Q.freeDrawingBrush.color="rgb(".concat(E,", ").concat(E,", ").concat(E,")"))},[Q,E]),(0,I.jsx)(H.Provider,{value:tT,children:r})}function nT(){let{backgroundColor:t,textureSize:e}=X(),{canvasPadding:i}=nx();return e?(0,I.jsx)("div",{className:"CanvasBackdrop",style:{backgroundColor:t,top:i,width:e[0],height:e[1]}}):null}function nO(t){let{children:e}=t,[i,n]=(0,B.useState)({}),r=(0,B.useCallback)((t,e)=>{n(i=>({...i,[t]:e}))},[]),s=(0,B.useCallback)(t=>{n(e=>{let{[t]:i,...n}=e;return n})},[]),o=(0,B.useMemo)(()=>({canvases:i,registerCanvas:r,unregisterCanvas:s}),[i,r,s]);return(0,I.jsx)(U.Provider,{value:o,children:e})}function nk(t){let{children:e}=t,i=(0,B.useRef)(null),{activeCanvas:n,activeCanvasType:r,bringForward:s,sendBackward:o,duplicate:a,deleteSelection:l,addImages:c,undo:h,redo:u}=X(),{canvas:f,notifyChange:d,setDrawingMode:g}=W(n),p=async function(){let{top:t=0,left:e=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};for(let r of f.getActiveObjects()){var i,n;r.top=(null!=(i=r.top)?i:0)+t,r.left=(null!=(n=r.left)?n:0)+e}d()};return(0,I.jsx)("div",{className:"CanvasInteractions",tabIndex:0,ref:i,onDrop:async t=>{t.preventDefault(),i.current&&i.current.focus();let{items:e}=t.dataTransfer,n=Array.from(e).filter(t=>"file"===t.kind&&t.type.match(/^image\//)),r=await Promise.all(n.map(async t=>{let e=t.getAsFile();if(!e)throw Error("Not a file.");let i=new FileReader;return await new Promise((t,n)=>{i.onload=async e=>{e.target&&"string"==typeof e.target.result?t(e.target.result):n(Error("Failed to load image data."))},i.readAsDataURL(e)})}).filter(Boolean));await c(r)},onKeyDown:async t=>{let e=t.target;if("INPUT"!==e.nodeName&&"TEXTAREA"!==e.nodeName){if(t.ctrlKey||t.metaKey)switch(t.key){case"z":if(t.altKey)return;if(t.shiftKey){t.preventDefault(),u();return}t.preventDefault(),h();return;case"y":if(t.altKey||t.shiftKey)return;t.preventDefault(),u();return}if(!t.altKey&&!t.ctrlKey&&!t.metaKey&&!t.shiftKey)switch(t.key){case"Backspace":case"Delete":t.preventDefault(),await l();break;case"ArrowLeft":t.preventDefault(),await p({left:-1});break;case"ArrowRight":t.preventDefault(),await p({left:1});break;case"ArrowUp":t.preventDefault(),await p({top:-1});break;case"ArrowDown":t.preventDefault(),await p({top:1});break;case"d":t.preventDefault(),await a();break;case"f":t.preventDefault(),await s();break;case"b":t.preventDefault(),await o();break;case"p":"metallic"===r&&(t.preventDefault(),g(!0));break;case"s":"metallic"===r&&(t.preventDefault(),g(!1))}}},children:e})}function nE(){let{activeCanvasType:t,setActiveCanvasType:e,hasMetallic:i,hasAnimation:n,frameCount:r,selectedFrameIndex:s,setSelectedFrameIndex:o,sizeMultiplier:a,setSizeMultiplier:l}=X();return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)("div",{className:"CanvasToggle",children:[(0,I.jsx)("button",{type:"button","data-selected":"color"===t?"":void 0,onClick:()=>{e("color")},children:"Color"}),i?(0,I.jsx)("button",{type:"button","data-selected":"metallic"===t?"":void 0,onClick:()=>{e("metallic")},children:"Metallic"}):null]}),(0,I.jsxs)("div",{className:"CanvasToggle",style:{display:"none"},children:[(0,I.jsx)("button",{type:"button","data-selected":1===a?"":void 0,onClick:()=>{l(1)},children:"1×"}),(0,I.jsx)("button",{type:"button","data-selected":2===a?"":void 0,onClick:()=>{l(2)},children:"2×"}),(0,I.jsx)("button",{type:"button","data-selected":4===a?"":void 0,onClick:()=>{l(4)},children:"4×"})]}),n?(0,I.jsxs)("div",{className:"FrameSelector",children:[(0,I.jsx)("button",{type:"button",onClick:()=>{o(t=>(r+t-1)%r)},children:(0,I.jsx)(iF.FaChevronLeft,{})}),(0,I.jsxs)("span",{className:"FrameInfo",children:[s+1," / ",r]}),(0,I.jsx)("button",{type:"button",onClick:()=>{o(t=>(t+1)%r)},children:(0,I.jsx)(iF.FaChevronRight,{})})]}):null]})}function nj(t){return(0,iP.GenIcon)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M1 2a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1zM1 7a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1zM1 12a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1z"},child:[]}]})(t)}var nM=t.i(71315);let nP=nd.materials,nA=/^(\.|__MACOSX)/;async function nD(t){let e=await nM.default.loadAsync(t);return(await Promise.all(Object.entries(e.files).map(async t=>{let[e,i]=t;if(!nA.test(e)&&/\.png$/i.exec(e)){let t=await i.async("base64");return{path:e,imageUrl:"data:image/png;base64,".concat(t)}}}))).filter(t=>!!t)}async function nF(t){return new Promise((e,i)=>{let n=new FileReader;n.addEventListener("load",t=>{var n;"string"==typeof(null==(n=t.target)?void 0:n.result)?e(t.target.result):i()}),n.addEventListener("error",t=>{i()}),n.readAsDataURL(t)})}async function nR(t){return(await Promise.all(Array.from(t).map(async t=>{var e;if(nA.test(t.name))return null;switch((e=t).name.match(/\.png$/i)?"png":e.name.match(/\.zip$/i)?"zip":e.name.match(/\.vl2$/i)?"vl2":void 0){case"zip":case"vl2":{let e=t.name.match(/^(.+)\.(zip|vl2)$/i),i=e?e[1]:t.name;return(await nD(t)).map(e=>({...e,path:"".concat(t.name,"/").concat(e.path),name:i}))}case"png":return{path:t.name,imageUrl:await nF(t),name:null};default:return null}}))).flat().filter(t=>!!t)}async function nL(t){var i=await nR(t);let n=new Map;return i.forEach(t=>{let i=function(t){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;e||(e=function(){let t=new Map;for(let e in nP)nP[e].forEach((i,n)=>{let r;if(i.fileSuffix?r=i.fileSuffix:!1!==i.selectable&&!0!==i.hidden&&(i.file||i.name)&&(r=i.file||i.name),r){var s;let o=null!=(s=t.get(r))?s:[];o.push({modelName:e,material:i,index:n}),t.set(r,o)}});return t}());let n=t.split("/").slice(-1)[0],r=n.match(/^(.+)\.(PNG|png)$/);if(r){let s=r[1],o=s.split(".");if(o.length>1){let i=".".concat(o[o.length-1]),a=e.get(i);if(a)return{path:t,basename:n,nameWithoutExtension:s,extension:r[2],skinName:o.slice(0,o.length-1).join("."),models:a}}else{let a=function(t){let i=/^(.+[^\d])(\d{2,})$/.exec(t);if(i){var n;let t=i[1],r=i[2],s=parseInt(r,10),o="".concat(t).concat("0".padStart(r.length,"0"));return(null!=(n=e.get(o))?n:[]).filter(t=>"number"==typeof t.material.frameCount).map(t=>({...t,frameIndex:s}))}return[]}(o[0]);if(a.length)return{path:t,basename:n,nameWithoutExtension:s,extension:r[2],skinName:i,models:a};{let a=e.get(o[0]);if(a)return{path:t,basename:n,nameWithoutExtension:s,extension:r[2],skinName:i,models:a}}}}return null}(t.path,t.name);i&&i.models.forEach(e=>{var r,s,o,a,l;let c=null!=(r=n.get(e.modelName))?r:new Map,h=null!=(s=c.get(i.skinName))?s:{name:i.skinName,isComplete:null,materials:new Map},u=null!=(o=e.material.file)?o:e.material.name,f=null!=(a=h.materials.get(u))?a:[];f[null!=(l=e.frameIndex)?l:0]=t.imageUrl,h.materials.set(u,f),c.set(i.skinName,h),n.set(e.modelName,c)})}),n.forEach((t,e)=>{let i=nP[e].filter(t=>!1!==t.selectable&&!0!==t.hidden&&!0!==t.optional);t.forEach(t=>{t.isComplete=i.every(e=>{var i;return t.materials.has(null!=(i=e.file)?i:e.name)})})}),n}var nI=t.i(15768);let{defaultSkins:nB,modelDefaults:nN}=nd,nU={},nW=new Map;function nH(){var t,e,i,n,r,s;let{selectedModel:o,setSelectedModel:a,selectedModelType:l,setSelectedModelType:c,selectedSkin:h,setSelectedSkin:u,setSelectedSkinType:f,actualModel:d,setSelectedAnimation:g,setAnimationPaused:p,importedSkins:m,addImportedSkins:y}=iY(),{setSelectedMaterialIndex:b}=X(),[x,_]=(0,B.useState)(nU),[C,S]=(0,B.useState)(nU),[w,T]=(0,B.useState)(null),O=(0,B.useRef)(null),[k,E]=(0,nI.default)(),j=Array.from((null!=(s=m.get(d))?s:nW).values()).filter(t=>t.isComplete);E&&(x!==k.customSkins||C!==k.newSkins)&&(_(k.customSkins),S(k.newSkins));let M=null!=h?h:"";return h&&w&&(M="".concat(w,"/").concat(h)),(0,I.jsxs)("div",{className:"Toolbar",children:[(0,I.jsxs)("div",{className:"Field",children:[(0,I.jsx)("label",{htmlFor:"ModelSelect",children:"Model"}),(0,I.jsxs)("select",{id:"ModelSelect",value:o,onChange:t=>{var e,i,n,r;let s=t.target.selectedOptions[0].parentNode,o=t.target.value,l="hfemale"===o?"hmale":o,{modelType:d}=s.dataset;if(!d)throw Error("No data-model-type found");let m=h&&((null==(e=nB[l])?void 0:e.includes(h))||(null==(i=x[l])?void 0:i.includes(h)))||!1,y=!1;h&&"new"===w&&m&&(y=null==(n=C[l])?void 0:n.includes(h)),g(null),p(!1),c(d),a(o),b(0),m||(u(null!=(r=nN[l])?r:null),f("default")),y||T(null)},children:[(0,I.jsxs)("optgroup",{label:"Players","data-model-type":"player",children:[(0,I.jsx)("option",{value:"lmale",children:"Human Male • Light"}),(0,I.jsx)("option",{value:"mmale",children:"Human Male • Medium"}),(0,I.jsx)("option",{value:"hmale",children:"Human Male • Heavy"}),(0,I.jsx)("option",{value:"lfemale",children:"Human Female • Light"}),(0,I.jsx)("option",{value:"mfemale",children:"Human Female • Medium"}),(0,I.jsx)("option",{value:"hfemale",children:"Human Female • Heavy"}),(0,I.jsx)("option",{value:"lbioderm",children:"Bioderm • Light"}),(0,I.jsx)("option",{value:"mbioderm",children:"Bioderm • Medium"}),(0,I.jsx)("option",{value:"hbioderm",children:"Bioderm • Heavy"})]}),(0,I.jsxs)("optgroup",{label:"Weapons","data-model-type":"weapon",children:[(0,I.jsx)("option",{value:"disc",children:"Disc Launcher"}),(0,I.jsx)("option",{value:"chaingun",children:"Chaingun"}),(0,I.jsx)("option",{value:"grenade_launcher",children:"Grenade Launcher"}),(0,I.jsx)("option",{value:"sniper",children:"Laser Rifle"}),(0,I.jsx)("option",{value:"plasmathrower",children:"Plasma Cannon"}),(0,I.jsx)("option",{value:"energy",children:"Blaster"}),(0,I.jsx)("option",{value:"shocklance",children:"Shocklance"}),(0,I.jsx)("option",{value:"elf",children:"ELF Projector"}),(0,I.jsx)("option",{value:"missile",children:"Missile Launcher"}),(0,I.jsx)("option",{value:"mortar",children:"Mortar"}),(0,I.jsx)("option",{value:"repair",children:"Repair Pack"}),(0,I.jsx)("option",{value:"targeting",children:"Targeting Laser"}),(0,I.jsx)("option",{value:"mine",children:"Mine"})]}),(0,I.jsxs)("optgroup",{label:"Vehicles","data-model-type":"vehicle",children:[(0,I.jsx)("option",{value:"vehicle_grav_scout",children:"Wildcat Grav Cycle"}),(0,I.jsx)("option",{value:"vehicle_grav_tank",children:"Beowulf Assault Tank"}),(0,I.jsx)("option",{value:"vehicle_land_mpbbase",children:"Jericho Mobile Point Base"}),(0,I.jsx)("option",{value:"vehicle_air_scout",children:"Shrike Scout Fighter"}),(0,I.jsx)("option",{value:"vehicle_air_bomber",children:"Thundersword Bomber"}),(0,I.jsx)("option",{value:"vehicle_air_hapc",children:"HAVOC Gunship Transport"})]})]})]}),(0,I.jsxs)("div",{className:"Field",children:[(0,I.jsx)("label",{htmlFor:"SkinSelect",children:"Skin"}),(0,I.jsxs)("div",{className:"Buttons",children:[(0,I.jsxs)("select",{id:"SkinSelect",value:M,onChange:t=>{var e,i;let n=t.target.selectedOptions[0].parentNode,r=t.target.value&&null!=(e=n.dataset.skinType)?e:null,s=t.target.value.split("/");u(null!=(i=s.slice(-1)[0])?i:null),f(r),s.length>1?T(s[0]):T(null)},children:[(0,I.jsx)("option",{value:"",children:"Select a skin…"}),"player"===l?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)("optgroup",{label:"Default Skins","data-skin-type":"default",children:null==(t=nB[d])?void 0:t.map(t=>(0,I.jsx)("option",{value:t,children:t},t))}),j.length?(0,I.jsx)("optgroup",{label:"Imported Skins","data-skin-type":"import",children:j.map(t=>{var e,i;return(0,I.jsx)("option",{value:"import/".concat(null!=(e=t.name)?e:"__untitled__"),children:t.name||"Untitled Imported Skin"},"import/".concat(null!=(i=t.name)?i:"__untitled__"))})}):null,(null==(e=C[d])?void 0:e.length)?(0,I.jsx)("optgroup",{label:"New Skins ✨","data-skin-type":"custom",children:null==(i=C[d])?void 0:i.map(t=>(0,I.jsxs)("option",{value:"new/".concat(t),children:[t," ✨"]},"new/".concat(t)))}):null,(0,I.jsx)("optgroup",{label:"Custom Skins","data-skin-type":"custom",children:x===nU?(0,I.jsx)("option",{value:"",children:"Loading…"},"loading"):null==(n=x[d])?void 0:n.map(t=>(0,I.jsx)("option",{value:t,children:t},t))})]}):null,"weapon"===l||"vehicle"===l?(0,I.jsxs)(I.Fragment,{children:[nN[d]?(0,I.jsx)("optgroup",{label:"Default Skins","data-skin-type":"default",children:(0,I.jsx)("option",{value:nN[d],children:"Default"})}):null,j.length?(0,I.jsx)("optgroup",{label:"Imported Skins","data-skin-type":"import",children:j.map(t=>{var e,i;return(0,I.jsx)("option",{value:"import/".concat(null!=(e=t.name)?e:"__untitled__"),children:t.name||"Untitled Imported Skin"},"import/".concat(null!=(i=t.name)?i:"__untitled__"))})}):null,(null==(r=x[d])?void 0:r.length)?(0,I.jsx)("optgroup",{label:"Custom Skins","data-skin-type":"custom",children:x[d].map(t=>(0,I.jsx)("option",{value:t,children:t},t))}):null]}):null]}),(0,I.jsx)("button",{type:"button","aria-label":"Load Skin",title:"Load a Skin",onClick:()=>{O.current&&O.current.click()},children:(0,I.jsx)(iF.FaFolderOpen,{style:{fontSize:18}})}),(0,I.jsx)("input",{ref:O,onChange:async t=>{var e,i,n;let r=await nL(null!=(e=t.target.files)?e:[]);y(r);let s=r.get(d);if(s){let t=Array.from(s.values()).filter(t=>t.isComplete);if(t.length){let e=t[0];f("import"),T("import"),u(null!=(i=e.name)?i:"__untitled__"),b(0),g(null);return}}for(let[t,e]of Array.from(r.entries()))for(let i of Array.from(e.values()))if(i.isComplete){a(t),c(function(t){switch(t){case"lmale":case"mmale":case"hmale":case"lfemale":case"mfemale":case"hfemale":case"lbioderm":case"mbioderm":case"hbioderm":return"player";case"disc":case"chaingun":case"grenade_launcher":case"sniper":case"plasmathrower":case"energy":case"shocklance":case"elf":case"missile":case"mortar":case"repair":case"targeting":return"weapon";case"vehicle_grav_scout":case"vehicle_grav_tank":case"vehicle_land_mpbbase":case"vehicle_air_scout":case"vehicle_air_bomber":case"vehicle_air_hapc":return"vehicle";default:throw Error("Unknown model")}}(t)),f("import"),T("import"),u(null!=(n=i.name)?n:"__untitled__"),b(0),g(null);break}},type:"file",accept:".png, image/png, .vl2, .zip, application/zip, application/zip-compressed",multiple:!0,hidden:!0})]})]}),(0,I.jsx)("div",{className:"Field GalleryField",children:(0,I.jsxs)("a",{href:"gallery/",target:"_blank",className:"GalleryLink",title:"Open skin gallery",children:[(0,I.jsx)("span",{className:"FieldLabel",children:"Gallery"}),(0,I.jsx)(nj,{})]})})]})}var nX=t.i(18566);let{materials:nz,modelDefaults:nY,defaultSkins:nG}=nd,nV="https://exogen.github.io/t2-skins/skins",nq=new Map;function nK(t,e){if(e<2)return[t];let i=t.match(/^(.+)(\d\d)$/);if(i){let t=i[1];return Array(e).fill(null).map((e,i)=>"".concat(t).concat(i.toString().padStart(2,"0")))}throw Error("Did not match expected frame format")}function nQ(t){let{basePath:e,actualModel:i,selectedModelType:n,selectedSkin:r,selectedSkinType:s}=t,o=nz[i];if(r&&"import"===s){let t=nq.get(i);if(t){let e="__untitled__"===r?null:r,i=t.get(e);if(i&&i.isComplete)return Object.fromEntries(i.materials)}throw Error("No skin found")}switch(n){case"player":switch(s){case"default":return{base:["".concat(e,"/textures/").concat(r,".").concat(i,".png")]};case"custom":return{base:["".concat(nV,"/").concat(r,".").concat(i,".png")]}}break;case"weapon":case"vehicle":return o.reduce((t,i)=>{if(i){var n,o,a,l,c;let h=null!=(n=i.frameCount)?n:1;switch(s){case"default":!1!==i.hasDefault&&(t[null!=(o=i.file)?o:i.name]=nK(null!=(a=i.file)?a:i.name,h).map(t=>"".concat(e,"/textures/").concat(t,".png")));break;case"custom":t[null!=(l=i.file)?l:i.name]=nK(null!=(c=i.file)?c:i.name,h).map(t=>"".concat(nV,"/").concat(r,"/").concat(t,".png"))}}return t},{})}return{}}function nJ(t){var e,i;let{children:n}=t,r=(0,nX.useRouter)(),s=(0,nX.usePathname)(),o=(0,nX.useSearchParams)(),[a,l]=(0,B.useState)(!1),[c,h]=(0,B.useState)("lmale"),[u,f]=(0,B.useState)("player"),[d,g]=(0,B.useState)("Blood Eagle"),[p,m]=(0,B.useState)("default"),[y,b]=(0,B.useState)(null),[x,_]=(0,B.useState)(!1),[C,S]=(0,B.useState)(!1),{basePath:w}=nx(),T="hfemale"===c?"hmale":c,O="".concat(w,"/").concat(T).concat(y?".anim":"",".glb"),[k,E]=(0,B.useState)(nq),j=(0,B.useCallback)(t=>{let e=new Map(nq.entries());t.forEach((t,i)=>{var n;let r=null!=(n=e.get(i))?n:new Map;t.forEach((t,e)=>{r.set(e,t)}),e.set(i,r)}),E(nq=e)},[]),[M,P]=(0,B.useState)(()=>nQ({basePath:w,actualModel:T,selectedModelType:u,selectedSkin:d,selectedSkinType:p})),A=(0,B.useMemo)(()=>nQ({basePath:w,actualModel:T,selectedModelType:u,selectedSkin:nY[T],selectedSkinType:"default"}),[T,w,u]),D=(0,B.useMemo)(()=>({selectedModel:c,setSelectedModel:h,selectedModelType:u,setSelectedModelType:f,actualModel:T,selectedModelUrl:O,animationPaused:x,setAnimationPaused:_,selectedSkin:d,setSelectedSkin:g,selectedSkinType:p,setSelectedSkinType:m,selectedAnimation:y,setSelectedAnimation:b,skinImageUrls:M,setSkinImageUrls:P,defaultSkinImageUrls:A,slowModeEnabled:C,setSlowModeEnabled:S,importedSkins:k,addImportedSkins:j}),[c,h,u,f,T,O,x,_,d,g,p,m,y,b,M,P,A,C,k,j]);if(!a){let t=o.get("m"),n=o.get("s");if("string"==typeof t){let r=function(t){switch(t){case"lmale":case"mmale":case"hmale":case"lfemale":case"mfemale":case"hfemale":case"lbioderm":case"mbioderm":case"hbioderm":return"player";case"disc":case"chaingun":case"grenade_launcher":case"sniper":case"plasmathrower":case"energy":case"shocklance":case"elf":case"missile":case"mortar":case"repair":case"targeting":case"mine":return"weapon";case"vehicle_grav_scout":case"vehicle_grav_tank":case"vehicle_land_mpbbase":case"vehicle_air_scout":case"vehicle_air_bomber":case"vehicle_air_hapc":return"vehicle";default:return null}}(t);if(r&&(h(t),f(r),"string"==typeof n)){let r=n===nY[e="hfemale"===t?"hmale":t]||(null==(i=nG[e])?void 0:i.includes(n))?"default":"custom";g(n),m(r)}}l(!0)}return(0,B.useEffect)(()=>{if(!d)return;let t=o.get("m"),e=o.get("s");if(t!==c||e!==d){let t=new URLSearchParams(o);t.set("m",c),t.set("s",d);let e="".concat(s,"?").concat(t);r.replace(e,{scroll:!1})}},[s,r,o,c,d]),(0,B.useEffect)(()=>{if(d)try{let t=nQ({basePath:w,actualModel:T,selectedModelType:u,selectedSkin:d,selectedSkinType:p});P(t)}catch(t){m("default"),g(nY[T])}},[T,w,u,d,p]),(0,I.jsx)(iz.Provider,{value:D,children:n})}var n$=t.i(70703);let nZ=B.default.createContext(null);function n0(){let t=(0,B.useContext)(nZ);if(!t)throw Error("No EnvironmentContext.Provider");return t}nZ.displayName="EnvironmentContext";let n1=B.default.createContext(null);function n2(){let t=(0,B.useContext)(n1);if(!t)throw Error("No SkinContext.Provider");return t}n1.displayName="SkinContext";var n5=t.i(63871);function n4(t){let{material:e,materialDef:i,textureType:n,imageUrl:r,frameRef:s,onReady:o}=t,{modelViewer:a}=(0,n5.default)(),{basePath:l}=nx(),{slowModeEnabled:c}=iY();(0,B.useEffect)(()=>{let t,h=!1;return(async()=>{if(!i||i.hidden)if("metallicRoughnessTexture"===n){o&&o();return}else e.setAlphaMode("BLEND"),e.pbrMetallicRoughness.setBaseColorFactor([0,0,0,0]),o&&o();else{let{alphaMode:u,alphaCutoff:f,baseColorFactor:d,emissiveFactor:g,emissiveTexture:p=!1,metallicFactor:m=1,roughnessFactor:y=1,frameCount:b=1,frameTimings:x}=i,_=null!=r?r:Array(b).fill("".concat(l,"/white.png"));if(_.some(t=>!t))return;switch(n){case"baseColorTexture":d&&e.pbrMetallicRoughness.setBaseColorFactor(d),u&&e.setAlphaMode(u),f&&e.setAlphaCutoff(f),g&&e.setEmissiveFactor(g);break;case"metallicRoughnessTexture":e.pbrMetallicRoughness.setMetallicFactor(m),e.pbrMetallicRoughness.setRoughnessFactor(y),0===m&&1===y&&(_=Array(b).fill("".concat(l,"/green.png")))}let C=await Promise.all(_.map(t=>a.createTexture(t)));if(!h){let i="baseColorTexture"===n,r=s.current,a=()=>{let s=C[r.frameIndex];if(e.pbrMetallicRoughness[n].setTexture(s),i&&p&&e.emissiveTexture.setTexture(s),i&&(r.frameProgress+=c?.05:1),b>1){var o;let e=null!=(o=null==x?void 0:x[r.frameIndex])?o:1;i&&r.frameProgress>=e&&(r.frameIndex=(r.frameIndex+1)%b,r.frameProgress=0),t=requestAnimationFrame(a)}};a(0),o&&o()}}})(),()=>{h=!0,null!=t&&cancelAnimationFrame(t)}},[l,a,e,i,n,r,s,c,o])}function n3(t){var e,i;let{material:n,materialDef:r,onReady:s}=t,{getSkinImages:o}=n2(),{colorImageUrl:a,metallicImageUrl:l}=null!=(i=o(null!=(e=null==r?void 0:r.file)?e:n.name))?i:{},c=(0,B.useRef)({frameIndex:0,frameProgress:0});return n4({material:n,materialDef:r,textureType:"baseColorTexture",imageUrl:a,frameRef:c}),n4({material:n,materialDef:r,textureType:"metallicRoughnessTexture",imageUrl:l,frameRef:c}),null}let{materials:n9}=nd;function n6(){let{actualModel:t}=iY(),{model:e}=(0,n5.default)(),i=n9[t];return(0,I.jsx)(I.Fragment,{children:e.materials.map((t,e)=>{let n=i[e];return(0,I.jsx)(n3,{material:t,materialDef:n},t.name)})})}let n8=(0,n$.default)(()=>t.A(22143),{loadableGenerated:{modules:[66641]},ssr:!1}),{cameraOverrides:n7}=nd;function rt(){var t,e,i,n;let{selectedModel:r,selectedModelUrl:s,selectedModelType:o,selectedAnimation:a,animationPaused:l,slowModeEnabled:c}=iY(),{environmentImageUrl:h,showEnvironment:u,exposure:f}=n0();return(0,I.jsx)(n8,{modelUrl:s,environmentImageUrl:h,showEnvironment:u,animationName:a,animationPaused:l,timeScale:c?.05:.5,cameraOrbit:null!=(n=null==(t=n7[r])?void 0:t.orbit)?n:"weapon"===o?"315deg 70deg 105%":void 0,cameraTarget:null==(e=n7[r])?void 0:e.target,fieldOfView:null==(i=n7[r])?void 0:i.fov,exposure:f,children:(0,I.jsx)(n6,{})})}function re(){let{selectedEnvironment:t,setSelectedEnvironment:e}=n0();return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)("label",{htmlFor:"EnvMapSelect",children:"Environment"}),(0,I.jsxs)("select",{id:"EnvMapSelect",value:null!=t?t:"",onChange:t=>{e(t.target.value||null)},children:[(0,I.jsx)("option",{value:"",children:"Default"}),(0,I.jsx)("option",{value:"clarens_night_02_1k.hdr",children:"Clarens Night"}),(0,I.jsx)("option",{value:"dry_cracked_lake_1k.hdr",children:"Dry Cracked Lake"}),(0,I.jsx)("option",{value:"fouriesburg_mountain_midday_1k.hdr",children:"Fouriesburg Mountain"}),(0,I.jsx)("option",{value:"goegap_1k.hdr",children:"Goegap"}),(0,I.jsx)("option",{value:"hilly_terrain_01_1k.hdr",children:"Hilly Terrain"}),(0,I.jsx)("option",{value:"kloofendal_48d_partly_cloudy_puresky_1k.hdr",children:"Kloofendal Partly Cloudy"}),(0,I.jsx)("option",{value:"kloppenheim_06_puresky_1k.hdr",children:"Kloppenheim"}),(0,I.jsx)("option",{value:"lilienstein_1k.hdr",children:"Lilienstein"}),(0,I.jsx)("option",{value:"spruit_sunrise_1k_HDR.hdr",children:"Spruit Sunrise"}),(0,I.jsx)("option",{value:"umhlanga_sunrise_1k.hdr",children:"Umhlanga Sunrise"})]})]})}function ri(){let{exposure:t,setExposure:e}=n0();return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)("label",{htmlFor:"EnvExposure",children:(0,I.jsx)(iH,{size:16})}),(0,I.jsx)("input",{"aria-label":"Exposure",id:"EnvExposure",type:"range",min:.2,max:2.2,step:.1,value:t,onChange:t=>{e(parseFloat(t.target.value))}})]})}let{animations:rn,animationLabels:rr,animationLabelOverrides:rs}=nd;function ro(){let{actualModel:t,selectedModelType:e,selectedAnimation:i,setSelectedAnimation:n,animationPaused:r,setAnimationPaused:s,slowModeEnabled:o,setSlowModeEnabled:a}=iY(),l=(0,B.useMemo)(()=>{var i;return[..."player"===e?rn.global:[],...null!=(i=rn[t])?i:[]]},[t,e]);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)("div",{className:"LabelWithControls",children:[(0,I.jsx)("label",{children:"Animation"}),(0,I.jsxs)("div",{className:"AnimationSpeed",children:[(0,I.jsx)("input",{type:"checkbox",id:"SlowDownCheckbox",checked:o,onChange:t=>{a(t.target.checked)}})," ",(0,I.jsx)("label",{htmlFor:"SlowDownCheckbox",children:"Slow?"})]})]}),(0,I.jsxs)("div",{className:"Buttons",children:[(0,I.jsxs)("select",{value:null!=i?i:"",onChange:t=>{n(t.target.value||null),s(!1)},children:[(0,I.jsx)("option",{value:"",children:"None"}),l.map(e=>{var i,n;let r=null!=(n=null==(i=rs[t])?void 0:i[e])?n:rr[e];return(0,I.jsx)("option",{value:e,children:null!=r?r:e},e)})]}),(0,I.jsx)("button",{type:"button",disabled:!i,onClick:()=>{s(t=>!t)},children:r||!i?(0,I.jsx)(iB,{}):(0,I.jsx)(iI,{})})]})]})}function ra(t){let{children:e}=t,[i,n]=(0,B.useState)(null),[r,s]=(0,B.useState)(!1),[o,a]=(0,B.useState)(1),{basePath:l}=nx(),c=(0,B.useMemo)(()=>{let t=i?"".concat(l,"/").concat(i):null;return{selectedEnvironment:i,setSelectedEnvironment:n,showEnvironment:r,setShowEnvironment:s,exposure:o,setExposure:a,environmentImageUrl:t}},[l,i,r,o]);return(0,I.jsx)(nZ.Provider,{value:c,children:e})}function rl(t){let{children:e}=t,[i,n]=(0,B.useState)({}),r=(0,B.useMemo)(()=>({setSkinImages(t,e){n(i=>({...i,[t]:e}))},setColorImageUrl(t,e,i){n(n=>{var r,s;let o=Array.from(null!=(s=null==(r=n[t])?void 0:r.colorImageUrl)?s:[]);return o[i]=e,{...n,[t]:{...n[t],colorImageUrl:o}}})},setMetallicImageUrl(t,e,i){n(n=>{var r,s;let o=Array.from(null!=(s=null==(r=n[t])?void 0:r.metallicImageUrl)?s:[]);return o[i]=e,{...n,[t]:{...n[t],metallicImageUrl:o}}})}}),[]),s=(0,B.useMemo)(()=>({materialSkins:i,getSkinImages:t=>i[t],getColorImageUrl(t,e){var n;return null==(n=i[t].colorImageUrl)?void 0:n[e]},getMetallicImageUrl(t,e){var n;return null==(n=i[t].metallicImageUrl)?void 0:n[e]},...r}),[i,r]);return(0,I.jsx)(n1.Provider,{value:s,children:e})}let{materials:rc}=nd;function rh(){let{actualModel:t}=iY(),{selectedMaterialIndex:e,setSelectedMaterialIndex:i}=X(),n=rc[t];return(0,I.jsx)("select",{value:e,onChange:t=>{i(parseInt(t.target.value,10))},children:n.map((t,e)=>{var i;return t&&!t.hidden&&!1!==t.selectable?(0,I.jsx)("option",{value:e,children:null!=(i=t.label)?i:t.name},t.name):null})})}function ru(t){let{canvasId:e,onChange:i,baseImageUrl:n,textureSize:r,defaultDrawingMode:s=!1}=t,o=(0,B.useRef)(null),[a,l]=(0,B.useState)(null),{activeCanvas:c}=X(),{canvasPadding:h}=nx(),{registerCanvas:u,unregisterCanvas:f}=W(),[d,g]=(0,B.useState)(s),p=(0,B.useRef)(null),m=(0,B.useRef)(!0),[y,b]=(0,B.useState)(()=>[]),[x,_]=(0,B.useState)(()=>[]),C=y.length>1,S=x.length>0,w=(0,B.useCallback)(t=>{let e=p.current;e&&e(t)},[]),T=(0,B.useCallback)(async()=>{if(a&&y.length>1){let[t,e]=y.slice(-2);m.current=!1,a.renderOnAddRemove=!1,a.clear(),a.loadFromJSON(t,()=>{a.renderAll(),m.current=!0,a.renderOnAddRemove=!0}),b(t=>t.slice(0,-1)),_(t=>[e,...t])}},[a,y]),O=(0,B.useCallback)(()=>{if(a&&x.length>0){let t=x[0];m.current=!1,a.renderOnAddRemove=!1,a.clear(),a.loadFromJSON(t,()=>{a.renderAll(),m.current=!0,a.renderOnAddRemove=!0}),b(e=>[...e,t]),_(t=>t.slice(1))}},[a,x]);(0,B.useEffect)(()=>{p.current=i},[i]);let k=c===e;return(0,B.useEffect)(()=>{let t;N.fabric.Object.prototype.set({transparentCorners:!1,borderColor:"#8afff1",cornerSize:9,cornerStyle:"circle",cornerColor:"#8afff1",cornerStrokeColor:"#1c9f7c",strokeWidth:10,perPixelTargetFind:!0});let e=new N.fabric.Canvas(o.current,{preserveObjectStacking:!0,targetFindTolerance:2}),i=!1,n=()=>{w(e)};return e.on("object:modified",n),e.on("object:added",n),e.on("object:removed",n),e.on("after:render",()=>{!i&&m.current&&(clearTimeout(t),t=setTimeout(()=>{let t=(()=>{i=!0;let t=e.toDatalessJSON(["lockMovementX","lockMovementY","lockRotation","lockScalingX","lockScalingY","selectable","hoverCursor","moveCursor"]);return i=!1,t})();b(e=>{if(0===e.length)return[t];let i=e[e.length-1];return JSON.stringify(t)===JSON.stringify(i)?e:[...e.slice(-5),t]}),_([])},250))}),l(e),()=>{clearTimeout(t),l(null),e.dispose()}},[w]),(0,B.useEffect)(()=>{a&&(a.isDrawingMode=d,d&&(a.discardActiveObject(),a.requestRenderAll()))},[a,d]),(0,B.useEffect)(()=>{a&&k&&a.calcOffset()},[a,k]),(0,B.useEffect)(()=>{if(a)return u(e,{canvas:a,notifyChange:()=>{a.renderAll(),w(a)},undo:T,redo:O,canUndo:C,canRedo:S,isDrawingMode:d,setDrawingMode:g}),()=>{f(e)}},[a,u,f,e,w,d,g,T,O,C,S]),(0,B.useEffect)(()=>{if(a&&r&&(m.current=!1,a.clear(),n)){let t=!1;return(async()=>{let e=await nm(n);if(!t){if(!e.width||!e.height)throw Error("Zero-height image");e.selectable=!1,e.lockMovementX=!0,e.lockMovementY=!0,e.lockScalingX=!0,e.lockScalingY=!0,e.lockRotation=!0,e.hoverCursor="default",e.moveCursor="default";let[t,i]=r,n=e.width===t?1:t/e.width,s=e.height===i?1:i/e.height;(1!==n||1!==s)&&(e.scaleX=n,e.scaleY=s),a.centerObject(e),a.add(e)}m.current=!0,a.requestRenderAll()})(),()=>{t=!0}}},[a,n,r]),(0,I.jsx)("div",{className:"CanvasContainer","data-active":k?"true":"false",children:(0,I.jsx)("canvas",{width:r[0]+2*h,height:r[1]+2*h,ref:o})})}let rf=B.default.createContext(null);function rd(){let t=(0,B.useContext)(rf);if(!t)throw Error("ImageLoaderContext.Provider not found!");return t}rf.displayName="ImageLoaderContext";let rg=[512,512];function rp(t){var e,i,n,r;let{materialDef:s,frameIndex:o=0}=t,{skinImageUrls:a,defaultSkinImageUrls:l}=iY(),c=null==(e=a[null!=(n=s.file)?n:s.name])?void 0:e[o],h=null==(i=l[null!=(r=s.file)?r:s.name])?void 0:i[o],{setColorImageUrl:u}=n2(),{canvasPadding:f}=nx(),[d,g]=(0,B.useState)(null),{removeAlphaFromArrayBuffer:p}=nb(),{loadImage:m}=rd(),{sizeMultiplier:y}=X(),b=(0,B.useMemo)(()=>{var t;let[e,i]=null!=(t=s.size)?t:rg;return[e*y,i*y]},[s.size,y]),x=(0,B.useCallback)(async t=>{var e;let i=t.toDataURL({top:f,left:f,width:b[0],height:b[1]});u(null!=(e=s.file)?e:s.name,i,o)},[b,f,u,s,o]);(0,B.useEffect)(()=>{if(c){let t=!1;return(async()=>{let e;try{e=await m(c)}catch(t){if(!1===s.hasDefault)return;e=await m(h)}let i=await p(e);t||g(i)})(),()=>{t=!0}}g(null)},[s,c,h,p,m]);let _="".concat(s.name,":color:").concat(o,":").concat(y);return b?(0,I.jsx)(ru,{canvasId:_,canvasType:"color",onChange:x,baseImageUrl:d,textureSize:b},_):null}let rv=[512,512];function rm(t){var e,i,n,r;let{materialDef:s,frameIndex:o=0}=t,{skinImageUrls:a,defaultSkinImageUrls:l}=iY(),c=null==(e=a[null!=(n=s.file)?n:s.name])?void 0:e[o],h=null==(i=l[null!=(r=s.file)?r:s.name])?void 0:i[o],{setMetallicImageUrl:u}=n2(),{canvasPadding:f}=nx(),[d,g]=(0,B.useState)(null),p=(0,B.useRef)(0),{convertGrayscaleImageUrlToMetallicRoughness:m,convertArrayBufferAlphaToGrayscale:y}=nb(),{loadImage:b}=rd(),{sizeMultiplier:x}=X(),_=(0,B.useMemo)(()=>{var t;let[e,i]=null!=(t=s.size)?t:rv;return[e*x,i*x]},[s.size,x]),C=(0,B.useCallback)(async t=>{let e;p.current+=1;let i=t.toDataURL({top:f,left:f,width:_[0],height:_[1]});try{e=await m(i)}finally{p.current-=1}if(0===p.current){var n;u(null!=(n=s.file)?n:s.name,e,o)}},[_,f,u,m,s,o]);(0,B.useEffect)(()=>{if(c){let t=!1;return(async()=>{let e;try{e=await b(c)}catch(t){if(!1===s.hasDefault)return;e=await b(h)}let i=await y(e);t||g(i)})(),()=>{t=!0}}g(null)},[s,c,h,_,y,b]);let S="".concat(s.name,":metallic:").concat(o,":").concat(x);return _?(0,I.jsx)(ru,{canvasId:S,canvasType:"metallic",onChange:C,baseImageUrl:d,textureSize:_,defaultDrawingMode:!0},S):null}let{materials:ry}=nd;function rb(){let{actualModel:t}=iY(),e=ry[t];return(0,I.jsx)(I.Fragment,{children:e.map(e=>{var i;if(!e)return null;let n=0!==e.metallicFactor||1!==e.roughnessFactor,r=Array(null!=(i=e.frameCount)?i:1).fill(null);return(0,I.jsxs)(B.default.Fragment,{children:[r.map((t,i)=>(0,I.jsx)(rp,{materialDef:e,frameIndex:i},"color:".concat(i))),n?r.map((t,i)=>(0,I.jsx)(rm,{materialDef:e,frameIndex:i},"metallic:".concat(i))):null]},"".concat(t,"-").concat(e.name))})})}var rx=B.createContext(void 0),r_=t=>{let{client:e,children:i}=t;return B.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,I.jsx)(rx.Provider,{value:e,children:i})};function rC(t){let{children:e}=t,i=(t=>{let e=B.useContext(rx);if(t)return t;if(!e)throw Error("No QueryClient set, use QueryClientProvider to set one");return e})(),n=(0,B.useMemo)(()=>({loadImage:async t=>t.startsWith("data:")?(0,n_.imageUrlToArrayBuffer)(t):await i.fetchQuery({queryKey:[t]})}),[i]);return(0,I.jsx)(rf.Provider,{value:n,children:e})}function rS(t,e,i){if(!e.has(t))throw TypeError("attempted to "+i+" private field on non-instance");return e.get(t)}function rw(t,e){var i=rS(t,e,"get");return i.get?i.get.call(t):i.value}function rT(t,e){if(e.has(t))throw TypeError("Cannot initialize the same private elements twice on an object")}function rO(t,e,i){rT(t,e),e.set(t,i)}function rk(t,e,i){var n=rS(t,e,"set");if(n.set)n.set.call(t,i);else{if(!n.writable)throw TypeError("attempted to set read only private field");n.value=i}return i}function rE(t,e){var i=rS(t,e,"update");if(i.set){if(!i.get)throw TypeError("attempted to read set only private field");return"__destrWrapper"in i||(i.__destrWrapper={set value(v){i.set.call(t,v)},get value(){return i.get.call(t)}}),i.__destrWrapper}if(!i.writable)throw TypeError("attempted to set read only private field");return i}var rj={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},rM=new(i=new WeakMap,n=new WeakMap,class{setTimeoutProvider(t){rk(this,i,t)}setTimeout(t,e){return rw(this,i).setTimeout(t,e)}clearTimeout(t){rw(this,i).clearTimeout(t)}setInterval(t,e){return rw(this,i).setInterval(t,e)}clearInterval(t){rw(this,i).clearInterval(t)}constructor(){rO(this,i,{writable:!0,value:rj}),rO(this,n,{writable:!0,value:!1})}}),rP="undefined"==typeof window||"Deno"in globalThis;function rA(){}function rD(t,e){return"function"==typeof t?t(e):t}function rF(t,e){let{type:i="all",exact:n,fetchStatus:r,predicate:s,queryKey:o,stale:a}=t;if(o){if(n){if(e.queryHash!==rL(o,e.options))return!1}else if(!rB(e.queryKey,o))return!1}if("all"!==i){let t=e.isActive();if("active"===i&&!t||"inactive"===i&&t)return!1}return("boolean"!=typeof a||e.isStale()===a)&&(!r||r===e.state.fetchStatus)&&(!s||!!s(e))}function rR(t,e){let{exact:i,status:n,predicate:r,mutationKey:s}=t;if(s){if(!e.options.mutationKey)return!1;if(i){if(rI(e.options.mutationKey)!==rI(s))return!1}else if(!rB(e.options.mutationKey,s))return!1}return(!n||e.state.status===n)&&(!r||!!r(e))}function rL(t,e){return((null==e?void 0:e.queryKeyHashFn)||rI)(t)}function rI(t){return JSON.stringify(t,(t,e)=>rW(e)?Object.keys(e).sort().reduce((t,i)=>(t[i]=e[i],t),{}):e)}function rB(t,e){return t===e||typeof t==typeof e&&!!t&&!!e&&"object"==typeof t&&"object"==typeof e&&Object.keys(e).every(i=>rB(t[i],e[i]))}var rN=Object.prototype.hasOwnProperty;function rU(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function rW(t){if(!rH(t))return!1;let e=t.constructor;if(void 0===e)return!0;let i=e.prototype;return!!rH(i)&&!!i.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(t)===Object.prototype}function rH(t){return"[object Object]"===Object.prototype.toString.call(t)}function rX(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=[...t,e];return i&&n.length>i?n.slice(1):n}function rz(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=[e,...t];return i&&n.length>i?n.slice(0,-1):n}var rY=Symbol();function rG(t,e){return!t.queryFn&&(null==e?void 0:e.initialPromise)?()=>e.initialPromise:t.queryFn&&t.queryFn!==rY?t.queryFn:()=>Promise.reject(Error("Missing queryFn: '".concat(t.queryHash,"'")))}function rV(t,e,i){if(!e.has(t))throw TypeError("attempted to get private field on non-instance");return i}function rq(t,e){rT(t,e),e.add(t)}var rK=function(t){setTimeout(t,0)},rQ=function(){let t=[],e=0,i=t=>{t()},n=t=>{t()},r=rK,s=n=>{e?t.push(n):r(()=>{i(n)})};return{batch:s=>{let o;e++;try{o=s()}finally{--e||(()=>{let e=t;t=[],e.length&&r(()=>{n(()=>{e.forEach(t=>{i(t)})})})})()}return o},batchCalls:t=>function(){for(var e=arguments.length,i=Array(e),n=0;n{t(...i)})},schedule:s,setNotifyFunction:t=>{i=t},setBatchNotifyFunction:t=>{n=t},setScheduler:t=>{r=t}}}(),rJ=class{subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}},r$=new(r=new WeakMap,s=new WeakMap,o=new WeakMap,class extends rJ{onSubscribe(){rw(this,s)||this.setEventListener(rw(this,o))}onUnsubscribe(){var t;this.hasListeners()||(null==(t=rw(this,s))||t.call(this),rk(this,s,void 0))}setEventListener(t){var e;rk(this,o,t),null==(e=rw(this,s))||e.call(this),rk(this,s,t(t=>{"boolean"==typeof t?this.setFocused(t):this.onFocus()}))}setFocused(t){rw(this,r)!==t&&(rk(this,r,t),this.onFocus())}onFocus(){let t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){var t;return"boolean"==typeof rw(this,r)?rw(this,r):(null==(t=globalThis.document)?void 0:t.visibilityState)!=="hidden"}constructor(){super(),rO(this,r,{writable:!0,value:void 0}),rO(this,s,{writable:!0,value:void 0}),rO(this,o,{writable:!0,value:void 0}),rk(this,o,t=>{if(!rP&&window.addEventListener){let e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}})}}),rZ=new(a=new WeakMap,l=new WeakMap,c=new WeakMap,class extends rJ{onSubscribe(){rw(this,l)||this.setEventListener(rw(this,c))}onUnsubscribe(){var t;this.hasListeners()||(null==(t=rw(this,l))||t.call(this),rk(this,l,void 0))}setEventListener(t){var e;rk(this,c,t),null==(e=rw(this,l))||e.call(this),rk(this,l,t(this.setOnline.bind(this)))}setOnline(t){rw(this,a)!==t&&(rk(this,a,t),this.listeners.forEach(e=>{e(t)}))}isOnline(){return rw(this,a)}constructor(){super(),rO(this,a,{writable:!0,value:!0}),rO(this,l,{writable:!0,value:void 0}),rO(this,c,{writable:!0,value:void 0}),rk(this,c,t=>{if(!rP&&window.addEventListener){let e=()=>t(!0),i=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",i)}}})}});function r0(t){return Math.min(1e3*2**t,3e4)}function r1(t){return(null!=t?t:"online")!=="online"||rZ.isOnline()}var r2=class extends Error{constructor(t){super("CancelledError"),this.revert=null==t?void 0:t.revert,this.silent=null==t?void 0:t.silent}};function r5(t){let e,i=!1,n=0,r=function(){let t,e,i=new Promise((i,n)=>{t=i,e=n});function n(t){Object.assign(i,t),delete i.resolve,delete i.reject}return i.status="pending",i.catch(()=>{}),i.resolve=e=>{n({status:"fulfilled",value:e}),t(e)},i.reject=t=>{n({status:"rejected",reason:t}),e(t)},i}(),s=()=>r$.isFocused()&&("always"===t.networkMode||rZ.isOnline())&&t.canRun(),o=()=>r1(t.networkMode)&&t.canRun(),a=t=>{"pending"===r.status&&(null==e||e(),r.resolve(t))},l=t=>{"pending"===r.status&&(null==e||e(),r.reject(t))},c=()=>new Promise(i=>{var n;e=t=>{("pending"!==r.status||s())&&i(t)},null==(n=t.onPause)||n.call(t)}).then(()=>{if(e=void 0,"pending"===r.status){var i;null==(i=t.onContinue)||i.call(t)}}),h=()=>{let e;if("pending"!==r.status)return;let o=0===n?t.initialPromise:void 0;try{e=null!=o?o:t.fn()}catch(t){e=Promise.reject(t)}Promise.resolve(e).then(a).catch(e=>{var o,a,u;if("pending"!==r.status)return;let f=null!=(a=t.retry)?a:3*!rP,d=null!=(u=t.retryDelay)?u:r0,g="function"==typeof d?d(n,e):d,p=!0===f||"number"==typeof f&&n{rM.setTimeout(t,g)}).then(()=>s()?void 0:c()).then(()=>{i?l(e):h()})})};return{promise:r,status:()=>r.status,cancel:e=>{if("pending"===r.status){var i;let n=new r2(e);l(n),null==(i=t.onCancel)||i.call(t,n)}},continue:()=>(null==e||e(),r),cancelRetry:()=>{i=!0},continueRetry:()=>{i=!1},canStart:o,start:()=>(o()?h():c().then(h),r)}}var r4=(h=new WeakMap,class{destroy(){this.clearGcTimeout()}scheduleGc(){var t;this.clearGcTimeout(),"number"==typeof(t=this.gcTime)&&t>=0&&t!==1/0&&rk(this,h,rM.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,null!=t?t:rP?1/0:3e5)}clearGcTimeout(){rw(this,h)&&(rM.clearTimeout(rw(this,h)),rk(this,h,void 0))}constructor(){rO(this,h,{writable:!0,value:void 0})}}),r3=(u=new WeakMap,f=new WeakMap,d=new WeakMap,g=new WeakMap,p=new WeakMap,m=new WeakMap,y=new WeakMap,b=new WeakSet,class extends r4{get meta(){return this.options.meta}get promise(){var t;return null==(t=rw(this,p))?void 0:t.promise}setOptions(t){if(this.options={...rw(this,m),...t},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){let t=r9(this.options);void 0!==t.data&&(this.setData(t.data,{updatedAt:t.dataUpdatedAt,manual:!0}),rk(this,u,t))}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||rw(this,d).remove(this)}setData(t,e){var i,n;let r=(i=this.state.data,"function"==typeof(n=this.options).structuralSharing?n.structuralSharing(i,t):!1!==n.structuralSharing?function t(e,i){if(e===i)return e;let n=rU(e)&&rU(i);if(!n&&!(rW(e)&&rW(i)))return i;let r=(n?e:Object.keys(e)).length,s=n?i:Object.keys(i),o=s.length,a=n?Array(o):{},l=0;for(let c=0;c{var e;return!1!==(e=t.options.enabled,"function"==typeof e?e(this):e)})}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===rY||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0&&this.observers.some(t=>"static"===rD(t.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return void 0===this.state.data||"static"!==t&&(!!this.state.isInvalidated||!Math.max(this.state.dataUpdatedAt+(t||0)-Date.now(),0))}onFocus(){var t;let e=this.observers.find(t=>t.shouldFetchOnWindowFocus());null==e||e.refetch({cancelRefetch:!1}),null==(t=rw(this,p))||t.continue()}onOnline(){var t;let e=this.observers.find(t=>t.shouldFetchOnReconnect());null==e||e.refetch({cancelRefetch:!1}),null==(t=rw(this,p))||t.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),rw(this,d).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(e=>e!==t),this.observers.length||(rw(this,p)&&(rw(this,y)?rw(this,p).cancel({revert:!0}):rw(this,p).cancelRetry()),this.scheduleGc()),rw(this,d).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||rV(this,b,r6).call(this,{type:"invalidate"})}async fetch(t,e){var i,n,r,s,o,a,l,c,h,u,m,x;if("idle"!==this.state.fetchStatus&&(null==(i=rw(this,p))?void 0:i.status())!=="rejected"){if(void 0!==this.state.data&&(null==e?void 0:e.cancelRefetch))this.cancel({silent:!0});else if(rw(this,p))return rw(this,p).continueRetry(),rw(this,p).promise}if(t&&this.setOptions(t),!this.options.queryFn){let t=this.observers.find(t=>t.options.queryFn);t&&this.setOptions(t.options)}let _=new AbortController,C=t=>{Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(rk(this,y,!0),_.signal)})},S=()=>{let t=rG(this.options,e),i=(()=>{let t={client:rw(this,g),queryKey:this.queryKey,meta:this.meta};return C(t),t})();return(rk(this,y,!1),this.options.persister)?this.options.persister(t,i,this):t(i)},w=(()=>{let t={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:rw(this,g),state:this.state,fetchFn:S};return C(t),t})();null==(n=this.options.behavior)||n.onFetch(w,this),rk(this,f,this.state),("idle"===this.state.fetchStatus||this.state.fetchMeta!==(null==(r=w.fetchOptions)?void 0:r.meta))&&rV(this,b,r6).call(this,{type:"fetch",meta:null==(s=w.fetchOptions)?void 0:s.meta}),rk(this,p,r5({initialPromise:null==e?void 0:e.initialPromise,fn:w.fetchFn,onCancel:t=>{t instanceof r2&&t.revert&&this.setState({...rw(this,f),fetchStatus:"idle"}),_.abort()},onFail:(t,e)=>{rV(this,b,r6).call(this,{type:"failed",failureCount:t,error:e})},onPause:()=>{rV(this,b,r6).call(this,{type:"pause"})},onContinue:()=>{rV(this,b,r6).call(this,{type:"continue"})},retry:w.options.retry,retryDelay:w.options.retryDelay,networkMode:w.options.networkMode,canRun:()=>!0}));try{let t=await rw(this,p).start();if(void 0===t)throw Error("".concat(this.queryHash," data is undefined"));return this.setData(t),null==(o=(a=rw(this,d).config).onSuccess)||o.call(a,t,this),null==(l=(c=rw(this,d).config).onSettled)||l.call(c,t,this.state.error,this),t}catch(t){if(t instanceof r2){if(t.silent)return rw(this,p).promise;else if(t.revert){if(void 0===this.state.data)throw t;return this.state.data}}throw rV(this,b,r6).call(this,{type:"error",error:t}),null==(h=(u=rw(this,d).config).onError)||h.call(u,t,this),null==(m=(x=rw(this,d).config).onSettled)||m.call(x,this.state.data,t,this),t}finally{this.scheduleGc()}}constructor(t){var e;super(),rq(this,b),rO(this,u,{writable:!0,value:void 0}),rO(this,f,{writable:!0,value:void 0}),rO(this,d,{writable:!0,value:void 0}),rO(this,g,{writable:!0,value:void 0}),rO(this,p,{writable:!0,value:void 0}),rO(this,m,{writable:!0,value:void 0}),rO(this,y,{writable:!0,value:void 0}),rk(this,y,!1),rk(this,m,t.defaultOptions),this.setOptions(t.options),this.observers=[],rk(this,g,t.client),rk(this,d,rw(this,g).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,rk(this,u,r9(this.options)),this.state=null!=(e=t.state)?e:rw(this,u),this.scheduleGc()}});function r9(t){let e="function"==typeof t.initialData?t.initialData():t.initialData,i=void 0!==e,n=i?"function"==typeof t.initialDataUpdatedAt?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:i?null!=n?n:Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:i?"success":"pending",fetchStatus:"idle"}}function r6(t){let e=e=>{var i,n,r;switch(t.type){case"failed":return{...e,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...e,fetchStatus:"paused"};case"continue":return{...e,fetchStatus:"fetching"};case"fetch":return{...e,...(r=e.data,{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:r1(this.options.networkMode)?"fetching":"paused",...void 0===r&&{error:null,status:"pending"}}),fetchMeta:null!=(i=t.meta)?i:null};case"success":let s={...e,data:t.data,dataUpdateCount:e.dataUpdateCount+1,dataUpdatedAt:null!=(n=t.dataUpdatedAt)?n:Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return rk(this,f,t.manual?s:void 0),s;case"error":let o=t.error;return{...e,error:o,errorUpdateCount:e.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:e.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...e,isInvalidated:!0};case"setState":return{...e,...t.state}}};this.state=e(this.state),rQ.batch(()=>{this.observers.forEach(t=>{t.onQueryUpdate()}),rw(this,d).notify({query:this,type:"updated",action:t})})}var r8=(x=new WeakMap,class extends rJ{build(t,e,i){var n;let r=e.queryKey,s=null!=(n=e.queryHash)?n:rL(r,e),o=this.get(s);return o||(o=new r3({client:t,queryKey:r,queryHash:s,options:t.defaultQueryOptions(e),state:i,defaultOptions:t.getQueryDefaults(r)}),this.add(o)),o}add(t){rw(this,x).has(t.queryHash)||(rw(this,x).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){let e=rw(this,x).get(t.queryHash);e&&(t.destroy(),e===t&&rw(this,x).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){rQ.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return rw(this,x).get(t)}getAll(){return[...rw(this,x).values()]}find(t){let e={exact:!0,...t};return this.getAll().find(t=>rF(e,t))}findAll(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.getAll();return Object.keys(t).length>0?e.filter(e=>rF(t,e)):e}notify(t){rQ.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){rQ.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){rQ.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}constructor(t={}){super(),rO(this,x,{writable:!0,value:void 0}),this.config=t,rk(this,x,new Map)}}),r7=(_=new WeakMap,C=new WeakMap,S=new WeakMap,w=new WeakMap,T=new WeakSet,class extends r4{setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){rw(this,C).includes(t)||(rw(this,C).push(t),this.clearGcTimeout(),rw(this,S).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){rk(this,C,rw(this,C).filter(e=>e!==t)),this.scheduleGc(),rw(this,S).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){rw(this,C).length||("pending"===this.state.status?this.scheduleGc():rw(this,S).remove(this))}continue(){var t,e;return null!=(e=null==(t=rw(this,w))?void 0:t.continue())?e:this.execute(this.state.variables)}async execute(t){var e,i,n,r,s,o,a,l,c,h,u,f,d,g,p,m,y,b,x,C,O;let k=()=>{rV(this,T,st).call(this,{type:"continue"})},E={client:rw(this,_),meta:this.options.meta,mutationKey:this.options.mutationKey};rk(this,w,r5({fn:()=>this.options.mutationFn?this.options.mutationFn(t,E):Promise.reject(Error("No mutationFn found")),onFail:(t,e)=>{rV(this,T,st).call(this,{type:"failed",failureCount:t,error:e})},onPause:()=>{rV(this,T,st).call(this,{type:"pause"})},onContinue:k,retry:null!=(e=this.options.retry)?e:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>rw(this,S).canRun(this)}));let j="pending"===this.state.status,M=!rw(this,w).canStart();try{if(j)k();else{rV(this,T,st).call(this,{type:"pending",variables:t,isPaused:M}),await (null==(h=(u=rw(this,S).config).onMutate)?void 0:h.call(u,t,this,E));let e=await (null==(f=(d=this.options).onMutate)?void 0:f.call(d,t,E));e!==this.state.context&&rV(this,T,st).call(this,{type:"pending",context:e,variables:t,isPaused:M})}let e=await rw(this,w).start();return await (null==(i=(n=rw(this,S).config).onSuccess)?void 0:i.call(n,e,t,this.state.context,this,E)),await (null==(r=(s=this.options).onSuccess)?void 0:r.call(s,e,t,this.state.context,E)),await (null==(o=(a=rw(this,S).config).onSettled)?void 0:o.call(a,e,null,this.state.variables,this.state.context,this,E)),await (null==(l=(c=this.options).onSettled)?void 0:l.call(c,e,null,t,this.state.context,E)),rV(this,T,st).call(this,{type:"success",data:e}),e}catch(e){try{throw await (null==(g=(p=rw(this,S).config).onError)?void 0:g.call(p,e,t,this.state.context,this,E)),await (null==(m=(y=this.options).onError)?void 0:m.call(y,e,t,this.state.context,E)),await (null==(b=(x=rw(this,S).config).onSettled)?void 0:b.call(x,void 0,e,this.state.variables,this.state.context,this,E)),await (null==(C=(O=this.options).onSettled)?void 0:C.call(O,void 0,e,t,this.state.context,E)),e}finally{rV(this,T,st).call(this,{type:"error",error:e})}}finally{rw(this,S).runNext(this)}}constructor(t){super(),rq(this,T),rO(this,_,{writable:!0,value:void 0}),rO(this,C,{writable:!0,value:void 0}),rO(this,S,{writable:!0,value:void 0}),rO(this,w,{writable:!0,value:void 0}),rk(this,_,t.client),this.mutationId=t.mutationId,rk(this,S,t.mutationCache),rk(this,C,[]),this.state=t.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(t.options),this.scheduleGc()}});function st(t){this.state=(e=>{switch(t.type){case"failed":return{...e,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...e,isPaused:!0};case"continue":return{...e,isPaused:!1};case"pending":return{...e,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...e,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...e,data:void 0,error:t.error,failureCount:e.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}})(this.state),rQ.batch(()=>{rw(this,C).forEach(e=>{e.onMutationUpdate(t)}),rw(this,S).notify({mutation:this,type:"updated",action:t})})}var se=(O=new WeakMap,k=new WeakMap,E=new WeakMap,class extends rJ{build(t,e,i){let n=new r7({client:t,mutationCache:this,mutationId:++rE(this,E).value,options:t.defaultMutationOptions(e),state:i});return this.add(n),n}add(t){rw(this,O).add(t);let e=si(t);if("string"==typeof e){let i=rw(this,k).get(e);i?i.push(t):rw(this,k).set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(rw(this,O).delete(t)){let e=si(t);if("string"==typeof e){let i=rw(this,k).get(e);if(i)if(i.length>1){let e=i.indexOf(t);-1!==e&&i.splice(e,1)}else i[0]===t&&rw(this,k).delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){let e=si(t);if("string"!=typeof e)return!0;{let i=rw(this,k).get(e),n=null==i?void 0:i.find(t=>"pending"===t.state.status);return!n||n===t}}runNext(t){let e=si(t);if("string"!=typeof e)return Promise.resolve();{var i,n;let r=null==(i=rw(this,k).get(e))?void 0:i.find(e=>e!==t&&e.state.isPaused);return null!=(n=null==r?void 0:r.continue())?n:Promise.resolve()}}clear(){rQ.batch(()=>{rw(this,O).forEach(t=>{this.notify({type:"removed",mutation:t})}),rw(this,O).clear(),rw(this,k).clear()})}getAll(){return Array.from(rw(this,O))}find(t){let e={exact:!0,...t};return this.getAll().find(t=>rR(e,t))}findAll(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.getAll().filter(e=>rR(t,e))}notify(t){rQ.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){let t=this.getAll().filter(t=>t.state.isPaused);return rQ.batch(()=>Promise.all(t.map(t=>t.continue().catch(rA))))}constructor(t={}){super(),rO(this,O,{writable:!0,value:void 0}),rO(this,k,{writable:!0,value:void 0}),rO(this,E,{writable:!0,value:void 0}),this.config=t,rk(this,O,new Set),rk(this,k,new Map),rk(this,E,0)}});function si(t){var e;return null==(e=t.options.scope)?void 0:e.id}function sn(t){return{onFetch:(e,i)=>{var n,r,s,o,a;let l=e.options,c=null==(s=e.fetchOptions)||null==(r=s.meta)||null==(n=r.fetchMore)?void 0:n.direction,h=(null==(o=e.state.data)?void 0:o.pages)||[],u=(null==(a=e.state.data)?void 0:a.pageParams)||[],f={pages:[],pageParams:[]},d=0,g=async()=>{let i=!1,n=rG(e.options,e.fetchOptions),r=async(t,r,s)=>{if(i)return Promise.reject();if(null==r&&t.pages.length)return Promise.resolve(t);let o=(()=>{let t={client:e.client,queryKey:e.queryKey,pageParam:r,direction:s?"backward":"forward",meta:e.options.meta};return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(e.signal.aborted?i=!0:e.signal.addEventListener("abort",()=>{i=!0}),e.signal)}),t})(),a=await n(o),{maxPages:l}=e.options,c=s?rz:rX;return{pages:c(t.pages,a,l),pageParams:c(t.pageParams,r,l)}};if(c&&h.length){let t="backward"===c,e={pages:h,pageParams:u},i=(t?function(t,e){var i;let{pages:n,pageParams:r}=e;return n.length>0?null==(i=t.getPreviousPageParam)?void 0:i.call(t,n[0],n,r[0],r):void 0}:sr)(l,e);f=await r(e,i,t)}else{let e=null!=t?t:h.length;do{var s;let t=0===d?null!=(s=u[0])?s:l.initialPageParam:sr(l,f);if(d>0&&null==t)break;f=await r(f,t),d++}while(d{var t,n;return null==(t=(n=e.options).persister)?void 0:t.call(n,g,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},i)}:e.fetchFn=g}}}function sr(t,e){let{pages:i,pageParams:n}=e,r=i.length-1;return i.length>0?t.getNextPageParam(i[r],i,n[r],n):void 0}let ss=new(j=new WeakMap,M=new WeakMap,P=new WeakMap,A=new WeakMap,D=new WeakMap,F=new WeakMap,R=new WeakMap,L=new WeakMap,class{mount(){rE(this,F).value++,1===rw(this,F)&&(rk(this,R,r$.subscribe(async t=>{t&&(await this.resumePausedMutations(),rw(this,j).onFocus())})),rk(this,L,rZ.subscribe(async t=>{t&&(await this.resumePausedMutations(),rw(this,j).onOnline())})))}unmount(){var t,e;rE(this,F).value--,0===rw(this,F)&&(null==(t=rw(this,R))||t.call(this),rk(this,R,void 0),null==(e=rw(this,L))||e.call(this),rk(this,L,void 0))}isFetching(t){return rw(this,j).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return rw(this,M).findAll({...t,status:"pending"}).length}getQueryData(t){var e;let i=this.defaultQueryOptions({queryKey:t});return null==(e=rw(this,j).get(i.queryHash))?void 0:e.state.data}ensureQueryData(t){let e=this.defaultQueryOptions(t),i=rw(this,j).build(this,e),n=i.state.data;return void 0===n?this.fetchQuery(t):(t.revalidateIfStale&&i.isStaleByTime(rD(e.staleTime,i))&&this.prefetchQuery(e),Promise.resolve(n))}getQueriesData(t){return rw(this,j).findAll(t).map(t=>{let{queryKey:e,state:i}=t;return[e,i.data]})}setQueryData(t,e,i){let n=this.defaultQueryOptions({queryKey:t}),r=rw(this,j).get(n.queryHash),s=null==r?void 0:r.state.data,o="function"==typeof e?e(s):e;if(void 0!==o)return rw(this,j).build(this,n).setData(o,{...i,manual:!0})}setQueriesData(t,e,i){return rQ.batch(()=>rw(this,j).findAll(t).map(t=>{let{queryKey:n}=t;return[n,this.setQueryData(n,e,i)]}))}getQueryState(t){var e;let i=this.defaultQueryOptions({queryKey:t});return null==(e=rw(this,j).get(i.queryHash))?void 0:e.state}removeQueries(t){let e=rw(this,j);rQ.batch(()=>{e.findAll(t).forEach(t=>{e.remove(t)})})}resetQueries(t,e){let i=rw(this,j);return rQ.batch(()=>(i.findAll(t).forEach(t=>{t.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i={revert:!0,...e};return Promise.all(rQ.batch(()=>rw(this,j).findAll(t).map(t=>t.cancel(i)))).then(rA).catch(rA)}invalidateQueries(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return rQ.batch(()=>{var i,n;return(rw(this,j).findAll(t).forEach(t=>{t.invalidate()}),(null==t?void 0:t.refetchType)==="none")?Promise.resolve():this.refetchQueries({...t,type:null!=(n=null!=(i=null==t?void 0:t.refetchType)?i:null==t?void 0:t.type)?n:"active"},e)})}refetchQueries(t){var e;let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={...i,cancelRefetch:null==(e=i.cancelRefetch)||e};return Promise.all(rQ.batch(()=>rw(this,j).findAll(t).filter(t=>!t.isDisabled()&&!t.isStatic()).map(t=>{let e=t.fetch(void 0,n);return n.throwOnError||(e=e.catch(rA)),"paused"===t.state.fetchStatus?Promise.resolve():e}))).then(rA)}fetchQuery(t){let e=this.defaultQueryOptions(t);void 0===e.retry&&(e.retry=!1);let i=rw(this,j).build(this,e);return i.isStaleByTime(rD(e.staleTime,i))?i.fetch(e):Promise.resolve(i.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(rA).catch(rA)}fetchInfiniteQuery(t){return t.behavior=sn(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(rA).catch(rA)}ensureInfiniteQueryData(t){return t.behavior=sn(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return rZ.isOnline()?rw(this,M).resumePausedMutations():Promise.resolve()}getQueryCache(){return rw(this,j)}getMutationCache(){return rw(this,M)}getDefaultOptions(){return rw(this,P)}setDefaultOptions(t){rk(this,P,t)}setQueryDefaults(t,e){rw(this,A).set(rI(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){let e=[...rw(this,A).values()],i={};return e.forEach(e=>{rB(t,e.queryKey)&&Object.assign(i,e.defaultOptions)}),i}setMutationDefaults(t,e){rw(this,D).set(rI(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){let e=[...rw(this,D).values()],i={};return e.forEach(e=>{rB(t,e.mutationKey)&&Object.assign(i,e.defaultOptions)}),i}defaultQueryOptions(t){if(t._defaulted)return t;let e={...rw(this,P).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=rL(e.queryKey,e)),void 0===e.refetchOnReconnect&&(e.refetchOnReconnect="always"!==e.networkMode),void 0===e.throwOnError&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===rY&&(e.enabled=!1),e}defaultMutationOptions(t){return(null==t?void 0:t._defaulted)?t:{...rw(this,P).mutations,...(null==t?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){rw(this,j).clear(),rw(this,M).clear()}constructor(t={}){rO(this,j,{writable:!0,value:void 0}),rO(this,M,{writable:!0,value:void 0}),rO(this,P,{writable:!0,value:void 0}),rO(this,A,{writable:!0,value:void 0}),rO(this,D,{writable:!0,value:void 0}),rO(this,F,{writable:!0,value:void 0}),rO(this,R,{writable:!0,value:void 0}),rO(this,L,{writable:!0,value:void 0}),rk(this,j,t.queryCache||new r8),rk(this,M,t.mutationCache||new se),rk(this,P,t.defaultOptions||{}),rk(this,A,new Map),rk(this,D,new Map),rk(this,F,0)}})({defaultOptions:{queries:{queryFn:async function(t){let{queryKey:e}=t,[i]=e;return(0,n_.imageUrlToArrayBuffer)(i)},staleTime:1/0,gcTime:6e4,refetchOnWindowFocus:!1,refetchOnReconnect:!1}}});function so(){return(0,I.jsx)(I.Fragment,{children:(0,I.jsx)(r_,{client:ss,children:(0,I.jsx)("main",{children:(0,I.jsx)(rC,{children:(0,I.jsx)(B.Suspense,{children:(0,I.jsx)(nJ,{children:(0,I.jsx)(ra,{children:(0,I.jsxs)(rl,{children:[(0,I.jsxs)("div",{className:"Viewport",children:[(0,I.jsxs)("div",{className:"ModelTools",children:[(0,I.jsx)("div",{className:"Field",children:(0,I.jsx)(re,{})}),(0,I.jsx)("div",{className:"Field SliderField",children:(0,I.jsx)(ri,{})}),(0,I.jsx)("div",{className:"Field",children:(0,I.jsx)(ro,{})})]}),(0,I.jsx)(rt,{})]}),(0,I.jsx)(nO,{children:(0,I.jsx)(nw,{children:(0,I.jsxs)(nk,{children:[(0,I.jsx)(nH,{}),(0,I.jsxs)("div",{className:"CanvasViewport",children:[(0,I.jsxs)("div",{className:"CanvasSelector",children:[(0,I.jsx)(nE,{}),(0,I.jsx)(rh,{})]}),(0,I.jsx)(nT,{}),(0,I.jsx)(rb,{})]}),(0,I.jsx)(np,{}),(0,I.jsx)(nv,{})]})})})]})})})})})})})})}}]); \ No newline at end of file diff --git a/docs/gallery/index.html b/docs/gallery/index.html index 8943259..30d57de 100644 --- a/docs/gallery/index.html +++ b/docs/gallery/index.html @@ -1 +1 @@ -T2 Model Viewer & Skinner \ No newline at end of file +T2 Model Viewer & Skinner \ No newline at end of file diff --git a/docs/gallery/index.txt b/docs/gallery/index.txt index 434c56a..5a90222 100644 --- a/docs/gallery/index.txt +++ b/docs/gallery/index.txt @@ -11,7 +11,7 @@ f:"$Sreact.suspense" 11:I[68027,[],"default"] :HL["/t2-model-skinner/_next/static/chunks/258ad065ddacdc6d.css","style"] :HL["/t2-model-skinner/_next/static/chunks/be25e0c53b3e76c3.css","style"] -0:{"P":null,"b":"VY3oqBwyqvlStXl38ih2v","p":"/t2-model-skinner","c":["","gallery",""],"i":false,"f":[[["",{"children":["gallery",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-model-skinner/_next/static/chunks/258ad065ddacdc6d.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]]}],{"children":["gallery",["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":["__PAGE__",["$","$1","c",{"children":[["$","$L4",null,{"Component":"$5","searchParams":{},"params":{},"promises":["$@6","$@7"]}],[["$","link","0",{"rel":"stylesheet","href":"/t2-model-skinner/_next/static/chunks/be25e0c53b3e76c3.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-model-skinner/_next/static/chunks/ff1a16fafef87110.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/t2-model-skinner/_next/static/chunks/6d7b92f74fb4b5af.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/t2-model-skinner/_next/static/chunks/3710394f99078da4.js","async":true,"nonce":"$undefined"}]],["$","$L8",null,{"children":["$L9",["$","$La",null,{"promise":"$@b"}]]}]]}],{},null,false]},null,false]},null,false],["$","$1","h",{"children":[null,[["$","$Lc",null,{"children":"$Ld"}],null],["$","$Le",null,{"children":["$","div",null,{"hidden":true,"children":["$","$f",null,{"fallback":null,"children":"$L10"}]}]}]]}],false]],"m":"$undefined","G":["$11",[["$","link","0",{"rel":"stylesheet","href":"/t2-model-skinner/_next/static/chunks/258ad065ddacdc6d.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]]],"s":false,"S":true} +0:{"P":null,"b":"-yFPMzbzcZfNmotCttmg4","p":"/t2-model-skinner","c":["","gallery",""],"i":false,"f":[[["",{"children":["gallery",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-model-skinner/_next/static/chunks/258ad065ddacdc6d.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]]}],{"children":["gallery",["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":["__PAGE__",["$","$1","c",{"children":[["$","$L4",null,{"Component":"$5","searchParams":{},"params":{},"promises":["$@6","$@7"]}],[["$","link","0",{"rel":"stylesheet","href":"/t2-model-skinner/_next/static/chunks/be25e0c53b3e76c3.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-model-skinner/_next/static/chunks/ff1a16fafef87110.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/t2-model-skinner/_next/static/chunks/6d7b92f74fb4b5af.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/t2-model-skinner/_next/static/chunks/3710394f99078da4.js","async":true,"nonce":"$undefined"}]],["$","$L8",null,{"children":["$L9",["$","$La",null,{"promise":"$@b"}]]}]]}],{},null,false]},null,false]},null,false],["$","$1","h",{"children":[null,[["$","$Lc",null,{"children":"$Ld"}],null],["$","$Le",null,{"children":["$","div",null,{"hidden":true,"children":["$","$f",null,{"fallback":null,"children":"$L10"}]}]}]]}],false]],"m":"$undefined","G":["$11",[["$","link","0",{"rel":"stylesheet","href":"/t2-model-skinner/_next/static/chunks/258ad065ddacdc6d.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]]],"s":false,"S":true} 6:{} 7:"$0:f:0:1:2:children:2:children:1:props:children:0:props:params" d:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]] diff --git a/docs/index.html b/docs/index.html index ba5c469..913e1a4 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1 +1 @@ -T2 Model Viewer & Skinner
\ No newline at end of file +T2 Model Viewer & Skinner
\ No newline at end of file diff --git a/docs/index.txt b/docs/index.txt index 5db5410..211f4ff 100644 --- a/docs/index.txt +++ b/docs/index.txt @@ -2,7 +2,7 @@ 2:I[39756,["/t2-model-skinner/_next/static/chunks/ff1a16fafef87110.js","/t2-model-skinner/_next/static/chunks/7dd66bdf8a7e5707.js"],"default"] 3:I[37457,["/t2-model-skinner/_next/static/chunks/ff1a16fafef87110.js","/t2-model-skinner/_next/static/chunks/7dd66bdf8a7e5707.js"],"default"] 4:I[47257,["/t2-model-skinner/_next/static/chunks/ff1a16fafef87110.js","/t2-model-skinner/_next/static/chunks/7dd66bdf8a7e5707.js"],"ClientPageRoot"] -5:I[52683,["/t2-model-skinner/_next/static/chunks/00e36f5c4a673582.js","/t2-model-skinner/_next/static/chunks/d9e502f7607fcfba.js","/t2-model-skinner/_next/static/chunks/ada16a90703ade36.js","/t2-model-skinner/_next/static/chunks/e4e6678c9c61c198.js","/t2-model-skinner/_next/static/chunks/a55df98dcb3b60ad.js"],"default"] +5:I[52683,["/t2-model-skinner/_next/static/chunks/00e36f5c4a673582.js","/t2-model-skinner/_next/static/chunks/d63fc3798baf75bd.js","/t2-model-skinner/_next/static/chunks/a55df98dcb3b60ad.js","/t2-model-skinner/_next/static/chunks/6cb39dc61a422734.js","/t2-model-skinner/_next/static/chunks/ada16a90703ade36.js"],"default"] 8:I[97367,["/t2-model-skinner/_next/static/chunks/ff1a16fafef87110.js","/t2-model-skinner/_next/static/chunks/7dd66bdf8a7e5707.js"],"OutletBoundary"] a:I[11533,["/t2-model-skinner/_next/static/chunks/ff1a16fafef87110.js","/t2-model-skinner/_next/static/chunks/7dd66bdf8a7e5707.js"],"AsyncMetadataOutlet"] c:I[97367,["/t2-model-skinner/_next/static/chunks/ff1a16fafef87110.js","/t2-model-skinner/_next/static/chunks/7dd66bdf8a7e5707.js"],"ViewportBoundary"] @@ -11,7 +11,7 @@ f:"$Sreact.suspense" 11:I[68027,[],"default"] :HL["/t2-model-skinner/_next/static/chunks/258ad065ddacdc6d.css","style"] :HL["/t2-model-skinner/_next/static/chunks/df18f9fdc6a3cb7c.css","style"] -0:{"P":null,"b":"VY3oqBwyqvlStXl38ih2v","p":"/t2-model-skinner","c":["",""],"i":false,"f":[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],["",["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-model-skinner/_next/static/chunks/258ad065ddacdc6d.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]]}],{"children":["__PAGE__",["$","$1","c",{"children":[["$","$L4",null,{"Component":"$5","searchParams":{},"params":{},"promises":["$@6","$@7"]}],[["$","link","0",{"rel":"stylesheet","href":"/t2-model-skinner/_next/static/chunks/df18f9fdc6a3cb7c.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-model-skinner/_next/static/chunks/00e36f5c4a673582.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/t2-model-skinner/_next/static/chunks/d9e502f7607fcfba.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/t2-model-skinner/_next/static/chunks/ada16a90703ade36.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/t2-model-skinner/_next/static/chunks/e4e6678c9c61c198.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/t2-model-skinner/_next/static/chunks/a55df98dcb3b60ad.js","async":true,"nonce":"$undefined"}]],["$","$L8",null,{"children":["$L9",["$","$La",null,{"promise":"$@b"}]]}]]}],{},null,false]},null,false],["$","$1","h",{"children":[null,[["$","$Lc",null,{"children":"$Ld"}],null],["$","$Le",null,{"children":["$","div",null,{"hidden":true,"children":["$","$f",null,{"fallback":null,"children":"$L10"}]}]}]]}],false]],"m":"$undefined","G":["$11",[["$","link","0",{"rel":"stylesheet","href":"/t2-model-skinner/_next/static/chunks/258ad065ddacdc6d.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]]],"s":false,"S":true} +0:{"P":null,"b":"-yFPMzbzcZfNmotCttmg4","p":"/t2-model-skinner","c":["",""],"i":false,"f":[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],["",["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-model-skinner/_next/static/chunks/258ad065ddacdc6d.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]]}],{"children":["__PAGE__",["$","$1","c",{"children":[["$","$L4",null,{"Component":"$5","searchParams":{},"params":{},"promises":["$@6","$@7"]}],[["$","link","0",{"rel":"stylesheet","href":"/t2-model-skinner/_next/static/chunks/df18f9fdc6a3cb7c.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-model-skinner/_next/static/chunks/00e36f5c4a673582.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/t2-model-skinner/_next/static/chunks/d63fc3798baf75bd.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/t2-model-skinner/_next/static/chunks/a55df98dcb3b60ad.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/t2-model-skinner/_next/static/chunks/6cb39dc61a422734.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/t2-model-skinner/_next/static/chunks/ada16a90703ade36.js","async":true,"nonce":"$undefined"}]],["$","$L8",null,{"children":["$L9",["$","$La",null,{"promise":"$@b"}]]}]]}],{},null,false]},null,false],["$","$1","h",{"children":[null,[["$","$Lc",null,{"children":"$Ld"}],null],["$","$Le",null,{"children":["$","div",null,{"hidden":true,"children":["$","$f",null,{"fallback":null,"children":"$L10"}]}]}]]}],false]],"m":"$undefined","G":["$11",[["$","link","0",{"rel":"stylesheet","href":"/t2-model-skinner/_next/static/chunks/258ad065ddacdc6d.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]]],"s":false,"S":true} 6:{} 7:"$0:f:0:1:2:children:1:props:children:0:props:params" d:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]] diff --git a/package-lock.json b/package-lock.json index fe55ee8..d48b34a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,7 @@ "@rc-component/slider": "^1.0.0", "@tanstack/react-query": "^5.90.5", "comlink": "^4.4.2", - "fabric": "^5.5.2-browser", + "fabric": "^6.7.1", "file-saver": "^2.0.5", "globby": "^13.1.2", "jszip": "^3.10.1", @@ -30,13 +30,10 @@ "@eslint/js": "^9.38.0", "@next/bundle-analyzer": "^15.5.6", "@next/eslint-plugin-next": "^15.5.6", - "@types/fabric": "^5.3.10", "@types/file-saver": "^2.0.7", "@types/lodash.orderby": "^4.6.9", "@types/pngjs": "^6.0.5", "@types/react": "^19.2.2", - "@typescript-eslint/eslint-plugin": "^8.46.1", - "@typescript-eslint/parser": "^8.46.1", "eslint": "^9.38.0", "eslint-plugin-react": "^7.37.5", "eslint-plugin-react-hooks": "^7.0.0", @@ -1301,6 +1298,54 @@ "@lit-labs/ssr-dom-shim": "^1.0.0" } }, + "node_modules/@mapbox/node-pre-gyp": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.11.tgz", + "integrity": "sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==", + "license": "BSD-3-Clause", + "optional": true, + "dependencies": { + "detect-libc": "^2.0.0", + "https-proxy-agent": "^5.0.0", + "make-dir": "^3.1.0", + "node-fetch": "^2.6.7", + "nopt": "^5.0.0", + "npmlog": "^5.0.1", + "rimraf": "^3.0.2", + "semver": "^7.3.5", + "tar": "^6.1.11" + }, + "bin": { + "node-pre-gyp": "bin/node-pre-gyp" + } + }, + "node_modules/@mapbox/node-pre-gyp/node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/@mapbox/node-pre-gyp/node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "license": "MIT", + "optional": true, + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/@monogrid/gainmap-js": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/@monogrid/gainmap-js/-/gainmap-js-3.1.0.tgz", @@ -1588,6 +1633,16 @@ "react": "^18 || ^19" } }, + "node_modules/@tootallnate/once": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", + "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 10" + } + }, "node_modules/@types/estree": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", @@ -1595,13 +1650,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@types/fabric": { - "version": "5.3.10", - "resolved": "https://registry.npmjs.org/@types/fabric/-/fabric-5.3.10.tgz", - "integrity": "sha512-fsJIuVkU+B2AnmQh+Ml2X0ax3NmRIqLvEXmZ+squX60HaF89TvdIP6tI6Uk5srXaauswTwPOOfWE7k2QboUZCg==", - "dev": true, - "license": "MIT" - }, "node_modules/@types/file-saver": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/@types/file-saver/-/file-saver-2.0.7.tgz", @@ -1954,11 +2002,26 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/abab": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", + "integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==", + "deprecated": "Use your platform's native atob() and btoa() methods instead", + "license": "BSD-3-Clause", + "optional": true + }, + "node_modules/abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "license": "ISC", + "optional": true + }, "node_modules/acorn": { "version": "8.15.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", - "dev": true, + "devOptional": true, "license": "MIT", "peer": true, "bin": { @@ -1968,6 +2031,17 @@ "node": ">=0.4.0" } }, + "node_modules/acorn-globals": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-7.0.1.tgz", + "integrity": "sha512-umOSDSDrfHbTNPuNpC2NSnnA3LUrqpevPb4T9jRx4MagXNS0rs+gwiTcAvqCRmsD6utzsrzNt+ebm00SNWiC3Q==", + "license": "MIT", + "optional": true, + "dependencies": { + "acorn": "^8.1.0", + "acorn-walk": "^8.0.2" + } + }, "node_modules/acorn-jsx": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", @@ -1982,7 +2056,7 @@ "version": "8.2.0", "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", - "dev": true, + "devOptional": true, "engines": { "node": ">=0.4.0" } @@ -2014,6 +2088,16 @@ "url": "https://github.com/sponsors/epoberezkin" } }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=8" + } + }, "node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -2029,6 +2113,43 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/aproba": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.1.0.tgz", + "integrity": "sha512-tLIEcj5GuR2RSTnxNKdkK0dJ/GrC7P38sUkiDmDuHfsHmbagTFAxDVIBltoklXEVIQ/f14IL8IMJ5pn9Hez1Ew==", + "license": "ISC", + "optional": true + }, + "node_modules/are-we-there-yet": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz", + "integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==", + "deprecated": "This package is no longer supported.", + "license": "ISC", + "optional": true, + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/are-we-there-yet/node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "license": "MIT", + "optional": true, + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", @@ -2184,6 +2305,13 @@ "node": ">= 0.4" } }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "license": "MIT", + "optional": true + }, "node_modules/available-typed-arrays": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", @@ -2204,7 +2332,29 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true + "devOptional": true + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "optional": true }, "node_modules/baseline-browser-mapping": { "version": "2.8.17", @@ -2226,11 +2376,40 @@ "require-from-string": "^2.0.2" } }, + "node_modules/bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "node_modules/bl/node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, + "devOptional": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -2283,6 +2462,32 @@ "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" } }, + "node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "optional": true, + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, "node_modules/call-bind": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", @@ -2306,7 +2511,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "es-errors": "^1.3.0", @@ -2391,6 +2596,14 @@ "node": ">=8" } }, + "node_modules/chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", + "dev": true, + "license": "ISC", + "optional": true + }, "node_modules/classnames": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.3.2.tgz", @@ -2420,6 +2633,29 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, + "node_modules/color-support": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", + "license": "ISC", + "optional": true, + "bin": { + "color-support": "bin.js" + } + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "license": "MIT", + "optional": true, + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/comlink": { "version": "4.4.2", "resolved": "https://registry.npmjs.org/comlink/-/comlink-4.4.2.tgz", @@ -2440,7 +2676,14 @@ "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true + "devOptional": true + }, + "node_modules/console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==", + "license": "ISC", + "optional": true }, "node_modules/convert-source-map": { "version": "2.0.0", @@ -2483,6 +2726,13 @@ "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0" } }, + "node_modules/cssom": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.5.0.tgz", + "integrity": "sha512-iKuQcq+NdHqlAcwUY0o/HL69XQrUaQdMjmStJ8JFmUaiiQErlhrmuigkg/CU4E2J0IyUKUrMAgl36TvN67MqTw==", + "license": "MIT", + "optional": true + }, "node_modules/cssstyle": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-5.3.1.tgz", @@ -2583,7 +2833,7 @@ "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, + "devOptional": true, "dependencies": { "ms": "2.1.2" }, @@ -2600,9 +2850,37 @@ "version": "10.6.0", "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.6.0.tgz", "integrity": "sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg==", - "dev": true, + "devOptional": true, "license": "MIT" }, + "node_modules/decompress-response": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", + "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "mimic-response": "^3.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=4.0.0" + } + }, "node_modules/deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", @@ -2644,6 +2922,23 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==", + "license": "MIT", + "optional": true + }, "node_modules/detect-libc": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", @@ -2678,11 +2973,35 @@ "node": ">=0.10.0" } }, + "node_modules/domexception": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz", + "integrity": "sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==", + "deprecated": "Use your platform's native DOMException instead", + "license": "MIT", + "optional": true, + "dependencies": { + "webidl-conversions": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/domexception/node_modules/webidl-conversions": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", + "license": "BSD-2-Clause", + "optional": true, + "engines": { + "node": ">=12" + } + }, "node_modules/dunder-proto": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "call-bind-apply-helpers": "^1.0.1", @@ -2707,11 +3026,29 @@ "dev": true, "license": "ISC" }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "license": "MIT", + "optional": true + }, + "node_modules/end-of-stream": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz", + "integrity": "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "once": "^1.4.0" + } + }, "node_modules/entities": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/entities/-/entities-6.0.1.tgz", "integrity": "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==", - "dev": true, + "devOptional": true, "license": "BSD-2-Clause", "engines": { "node": ">=0.12" @@ -2793,7 +3130,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", - "dev": true, + "devOptional": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -2803,7 +3140,7 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", - "dev": true, + "devOptional": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -2841,7 +3178,7 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "es-errors": "^1.3.0" @@ -2854,7 +3191,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "es-errors": "^1.3.0", @@ -2919,6 +3256,28 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/escodegen": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz", + "integrity": "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==", + "license": "BSD-2-Clause", + "optional": true, + "dependencies": { + "esprima": "^4.0.1", + "estraverse": "^5.2.0", + "esutils": "^2.0.2" + }, + "bin": { + "escodegen": "bin/escodegen.js", + "esgenerate": "bin/esgenerate.js" + }, + "engines": { + "node": ">=6.0" + }, + "optionalDependencies": { + "source-map": "~0.6.1" + } + }, "node_modules/eslint": { "version": "9.38.0", "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.38.0.tgz", @@ -3178,6 +3537,20 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "license": "BSD-2-Clause", + "optional": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/esquery": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", @@ -3207,7 +3580,7 @@ "version": "5.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, + "devOptional": true, "engines": { "node": ">=4.0" } @@ -3216,18 +3589,319 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true, + "devOptional": true, "engines": { "node": ">=0.10.0" } }, + "node_modules/expand-template": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", + "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", + "dev": true, + "license": "(MIT OR WTFPL)", + "optional": true, + "engines": { + "node": ">=6" + } + }, "node_modules/fabric": { - "version": "5.5.2-browser", - "resolved": "https://registry.npmjs.org/fabric/-/fabric-5.5.2-browser.tgz", - "integrity": "sha512-YAp0AmkkDNweR39NkfZRTrn3HvhZALFLydzfGxCzaethO7TL3T0G1TDIpzsDbwDuvcMRR38AKkDp2fKPwJhqnA==", + "version": "6.7.1", + "resolved": "https://registry.npmjs.org/fabric/-/fabric-6.7.1.tgz", + "integrity": "sha512-dLxSmIvN4InJf4xOjbl1LFWh8WGOUIYtcuDIGs2IN0Z9lI0zGobfesDauyEhI1+owMLTPCCiEv01rpYXm7g2EQ==", "license": "MIT", "engines": { - "node": ">=14.0.0" + "node": ">=16.20.0" + }, + "optionalDependencies": { + "canvas": "^2.11.2", + "jsdom": "^20.0.1" + } + }, + "node_modules/fabric/node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/fabric/node_modules/cssstyle": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-2.3.0.tgz", + "integrity": "sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A==", + "license": "MIT", + "optional": true, + "dependencies": { + "cssom": "~0.3.6" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/fabric/node_modules/cssstyle/node_modules/cssom": { + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz", + "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==", + "license": "MIT", + "optional": true + }, + "node_modules/fabric/node_modules/data-urls": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-3.0.2.tgz", + "integrity": "sha512-Jy/tj3ldjZJo63sVAvg6LHt2mHvl4V6AgRAmNDtLdm7faqtsx+aJG42rsyCo9JCoRVKwPFzKlIPx3DIibwSIaQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "abab": "^2.0.6", + "whatwg-mimetype": "^3.0.0", + "whatwg-url": "^11.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/fabric/node_modules/decompress-response": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-4.2.1.tgz", + "integrity": "sha512-jOSne2qbyE+/r8G1VU+G/82LBs2Fs4LAsTiLSHOCOMZQl2OKZ6i8i4IyHemTe+/yIXOtTcRQMzPcgyhoFlqPkw==", + "license": "MIT", + "optional": true, + "dependencies": { + "mimic-response": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/fabric/node_modules/html-encoding-sniffer": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", + "integrity": "sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA==", + "license": "MIT", + "optional": true, + "dependencies": { + "whatwg-encoding": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/fabric/node_modules/http-proxy-agent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", + "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", + "license": "MIT", + "optional": true, + "dependencies": { + "@tootallnate/once": "2", + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fabric/node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "license": "MIT", + "optional": true, + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fabric/node_modules/jsdom": { + "version": "20.0.3", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-20.0.3.tgz", + "integrity": "sha512-SYhBvTh89tTfCD/CRdSOm13mOBa42iTaTyfyEWBdKcGdPxPtLFBXuHR8XHb33YNYaP+lLbmSvBTsnoesCNJEsQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "abab": "^2.0.6", + "acorn": "^8.8.1", + "acorn-globals": "^7.0.0", + "cssom": "^0.5.0", + "cssstyle": "^2.3.0", + "data-urls": "^3.0.2", + "decimal.js": "^10.4.2", + "domexception": "^4.0.0", + "escodegen": "^2.0.0", + "form-data": "^4.0.0", + "html-encoding-sniffer": "^3.0.0", + "http-proxy-agent": "^5.0.0", + "https-proxy-agent": "^5.0.1", + "is-potential-custom-element-name": "^1.0.1", + "nwsapi": "^2.2.2", + "parse5": "^7.1.1", + "saxes": "^6.0.0", + "symbol-tree": "^3.2.4", + "tough-cookie": "^4.1.2", + "w3c-xmlserializer": "^4.0.0", + "webidl-conversions": "^7.0.0", + "whatwg-encoding": "^2.0.0", + "whatwg-mimetype": "^3.0.0", + "whatwg-url": "^11.0.0", + "ws": "^8.11.0", + "xml-name-validator": "^4.0.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "canvas": "^2.5.0" + }, + "peerDependenciesMeta": { + "canvas": { + "optional": true + } + } + }, + "node_modules/fabric/node_modules/mimic-response": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.1.0.tgz", + "integrity": "sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/fabric/node_modules/parse5": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.3.0.tgz", + "integrity": "sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==", + "license": "MIT", + "optional": true, + "dependencies": { + "entities": "^6.0.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/fabric/node_modules/simple-get": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-3.1.1.tgz", + "integrity": "sha512-CQ5LTKGfCpvE1K0n2us+kuMPbk/q0EKl82s4aheV9oXjFEz6W/Y7oQFVJuU6QG77hRT4Ghb5RURteF5vnWjupA==", + "license": "MIT", + "optional": true, + "dependencies": { + "decompress-response": "^4.2.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, + "node_modules/fabric/node_modules/tough-cookie": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.4.tgz", + "integrity": "sha512-Loo5UUvLD9ScZ6jh8beX1T6sO1w2/MpCRpEP7V280GKMVUQ0Jzar2U3UJPsrdbziLEMMhu3Ujnq//rhiFuIeag==", + "license": "BSD-3-Clause", + "optional": true, + "dependencies": { + "psl": "^1.1.33", + "punycode": "^2.1.1", + "universalify": "^0.2.0", + "url-parse": "^1.5.3" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/fabric/node_modules/tr46": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-3.0.0.tgz", + "integrity": "sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==", + "license": "MIT", + "optional": true, + "dependencies": { + "punycode": "^2.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/fabric/node_modules/w3c-xmlserializer": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-4.0.0.tgz", + "integrity": "sha512-d+BFHzbiCx6zGfz0HyQ6Rg69w9k19nviJspaj4yNscGjrHu94sVP+aRm75yEbCh+r2/yR+7q6hux9LVtbuTGBw==", + "license": "MIT", + "optional": true, + "dependencies": { + "xml-name-validator": "^4.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/fabric/node_modules/webidl-conversions": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", + "license": "BSD-2-Clause", + "optional": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/fabric/node_modules/whatwg-encoding": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz", + "integrity": "sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg==", + "license": "MIT", + "optional": true, + "dependencies": { + "iconv-lite": "0.6.3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/fabric/node_modules/whatwg-mimetype": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz", + "integrity": "sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/fabric/node_modules/whatwg-url": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-11.0.0.tgz", + "integrity": "sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "tr46": "^3.0.0", + "webidl-conversions": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/fabric/node_modules/xml-name-validator": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-4.0.0.tgz", + "integrity": "sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==", + "license": "Apache-2.0", + "optional": true, + "engines": { + "node": ">=12" } }, "node_modules/fast-deep-equal": { @@ -3357,11 +4031,76 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/form-data": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.4.tgz", + "integrity": "sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow==", + "license": "MIT", + "optional": true, + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.2", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fs-constants": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", + "dev": true, + "license": "MIT", + "optional": true + }, + "node_modules/fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "license": "ISC", + "optional": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/fs-minipass/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "license": "ISC", + "optional": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/fs-minipass/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "license": "ISC", + "optional": true + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "license": "ISC", + "optional": true + }, "node_modules/function-bind": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "dev": true, + "devOptional": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -3397,6 +4136,28 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/gauge": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", + "integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==", + "deprecated": "This package is no longer supported.", + "license": "ISC", + "optional": true, + "dependencies": { + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.2", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.1", + "object-assign": "^4.1.1", + "signal-exit": "^3.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.2" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/generator-function": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/generator-function/-/generator-function-2.0.1.tgz", @@ -3421,7 +4182,7 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "call-bind-apply-helpers": "^1.0.2", @@ -3446,7 +4207,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "dunder-proto": "^1.0.1", @@ -3474,6 +4235,36 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/github-from-package": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", + "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==", + "dev": true, + "license": "MIT", + "optional": true + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "license": "ISC", + "optional": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/glob-parent": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", @@ -3537,7 +4328,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", - "dev": true, + "devOptional": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -3623,7 +4414,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", - "dev": true, + "devOptional": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -3636,7 +4427,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "has-symbols": "^1.0.3" @@ -3648,11 +4439,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==", + "license": "ISC", + "optional": true + }, "node_modules/hasown": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "function-bind": "^1.1.2" @@ -3730,7 +4528,7 @@ "version": "0.6.3", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" @@ -3739,6 +4537,28 @@ "node": ">=0.10.0" } }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "BSD-3-Clause", + "optional": true + }, "node_modules/ignore": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", @@ -3778,11 +4598,31 @@ "node": ">=0.8.19" } }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "license": "ISC", + "optional": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, + "node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true, + "license": "ISC", + "optional": true + }, "node_modules/internal-slot": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.1.0.tgz", @@ -3957,6 +4797,16 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=8" + } + }, "node_modules/is-generator-function": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.1.2.tgz", @@ -4060,7 +4910,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", - "dev": true + "devOptional": true }, "node_modules/is-promise": { "version": "2.2.2", @@ -4483,11 +5333,37 @@ "node": "20 || >=22" } }, + "node_modules/make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "license": "MIT", + "optional": true, + "dependencies": { + "semver": "^6.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/make-dir/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "license": "ISC", + "optional": true, + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/math-intrinsics": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", - "dev": true, + "devOptional": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -4521,11 +5397,48 @@ "node": ">=8.6" } }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", + "optional": true, + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mimic-response": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", + "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, + "devOptional": true, "dependencies": { "brace-expansion": "^1.1.7" }, @@ -4533,6 +5446,82 @@ "node": "*" } }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true, + "license": "MIT", + "optional": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "license": "ISC", + "optional": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "license": "MIT", + "optional": true, + "dependencies": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minizlib/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "license": "ISC", + "optional": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minizlib/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "license": "ISC", + "optional": true + }, + "node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "license": "MIT", + "optional": true, + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/mkdirp-classic": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", + "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==", + "dev": true, + "license": "MIT", + "optional": true + }, "node_modules/mrmime": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/mrmime/-/mrmime-2.0.1.tgz", @@ -4547,7 +5536,14 @@ "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true + "devOptional": true + }, + "node_modules/nan": { + "version": "2.23.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.23.0.tgz", + "integrity": "sha512-1UxuyYGdoQHcGg87Lkqm3FzefucTa0NAiOcuRsDmysep3c1LVCRK2krrUDafMWtjSG04htvAmvg96+SDknOmgQ==", + "license": "MIT", + "optional": true }, "node_modules/nanoid": { "version": "3.3.7", @@ -4566,6 +5562,14 @@ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, + "node_modules/napi-build-utils": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-2.0.0.tgz", + "integrity": "sha512-GEbrYkbfF7MoNaoh2iGG84Mnf/WZfB0GdGEsM8wz7Expx/LlWf5U8t9nvJKXSp3qr5IsEbK04cBGhol/KwOsWA==", + "dev": true, + "license": "MIT", + "optional": true + }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -4624,6 +5628,74 @@ } } }, + "node_modules/node-abi": { + "version": "3.78.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.78.0.tgz", + "integrity": "sha512-E2wEyrgX/CqvicaQYU3Ze1PFGjc4QYPGsjUrlYkqAE0WjHEZwgOsGMPMzkMse4LjJbDmaEuDX3CM036j5K2DSQ==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "semver": "^7.3.5" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/node-addon-api": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.1.tgz", + "integrity": "sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==", + "dev": true, + "license": "MIT", + "optional": true + }, + "node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "license": "MIT", + "optional": true, + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/node-fetch/node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "license": "MIT", + "optional": true + }, + "node_modules/node-fetch/node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "license": "BSD-2-Clause", + "optional": true + }, + "node_modules/node-fetch/node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "license": "MIT", + "optional": true, + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, "node_modules/node-releases": { "version": "2.0.25", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.25.tgz", @@ -4631,11 +5703,48 @@ "dev": true, "license": "MIT" }, + "node_modules/nopt": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", + "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", + "license": "ISC", + "optional": true, + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/npmlog": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz", + "integrity": "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==", + "deprecated": "This package is no longer supported.", + "license": "ISC", + "optional": true, + "dependencies": { + "are-we-there-yet": "^2.0.0", + "console-control-strings": "^1.1.0", + "gauge": "^3.0.0", + "set-blocking": "^2.0.0" + } + }, + "node_modules/nwsapi": { + "version": "2.2.22", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.22.tgz", + "integrity": "sha512-ujSMe1OWVn55euT1ihwCI1ZcAaAU3nxUiDwfDQldc51ZXaB9m2AyOn6/jh1BLe2t/G8xd6uKG1UBF2aZJeg2SQ==", + "license": "MIT", + "optional": true + }, "node_modules/object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "dev": true, + "devOptional": true, "engines": { "node": ">=0.10.0" } @@ -4737,6 +5846,16 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "license": "ISC", + "optional": true, + "dependencies": { + "wrappy": "1" + } + }, "node_modules/opener": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/opener/-/opener-1.5.2.tgz", @@ -4835,6 +5954,16 @@ "node": ">=8" } }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/path-key": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", @@ -4924,6 +6053,34 @@ "node": "^10 || ^12 || >=14" } }, + "node_modules/prebuild-install": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.3.tgz", + "integrity": "sha512-8Mf2cbV7x1cXPUILADGI3wuhfqWvtiLA1iclTDbFRZkgRQS0NqsPZphna9V+HyTEadheuPmjaJMsbzKQFOzLug==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "detect-libc": "^2.0.0", + "expand-template": "^2.0.3", + "github-from-package": "0.0.0", + "minimist": "^1.2.3", + "mkdirp-classic": "^0.5.3", + "napi-build-utils": "^2.0.0", + "node-abi": "^3.3.0", + "pump": "^3.0.0", + "rc": "^1.2.7", + "simple-get": "^4.0.0", + "tar-fs": "^2.0.0", + "tunnel-agent": "^0.6.0" + }, + "bin": { + "prebuild-install": "bin.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -4950,16 +6107,48 @@ "react-is": "^16.13.1" } }, + "node_modules/psl": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.15.0.tgz", + "integrity": "sha512-JZd3gMVBAVQkSs6HdNZo9Sdo0LNcQeMNP3CozBJb3JYC/QUYZTnKxP+f8oWRX4rHP5EurWxqAHTSwUCjlNKa1w==", + "license": "MIT", + "optional": true, + "dependencies": { + "punycode": "^2.3.1" + }, + "funding": { + "url": "https://github.com/sponsors/lupomontero" + } + }, + "node_modules/pump": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.3.tgz", + "integrity": "sha512-todwxLMY7/heScKmntwQG8CXVkWUOdYxIvY2s0VWAAMh/nd8SoYiRaKjlr7+iCs984f2P8zvrfWcDDYVb73NfA==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, "node_modules/punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", - "dev": true, + "devOptional": true, "license": "MIT", "engines": { "node": ">=6" } }, + "node_modules/querystringify": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", + "license": "MIT", + "optional": true + }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -4979,6 +6168,34 @@ } ] }, + "node_modules/rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "dev": true, + "license": "(BSD-2-Clause OR MIT OR Apache-2.0)", + "optional": true, + "dependencies": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "bin": { + "rc": "cli.js" + } + }, + "node_modules/rc/node_modules/strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/react": { "version": "19.2.0", "resolved": "https://registry.npmjs.org/react/-/react-19.2.0.tgz", @@ -5090,6 +6307,13 @@ "node": ">=0.10.0" } }, + "node_modules/requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", + "license": "MIT", + "optional": true + }, "node_modules/resolve": { "version": "2.0.0-next.5", "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.5.tgz", @@ -5127,6 +6351,23 @@ "node": ">=0.10.0" } }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "license": "ISC", + "optional": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/rrweb-cssom": { "version": "0.8.0", "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.8.0.tgz", @@ -5183,6 +6424,28 @@ "dev": true, "license": "MIT" }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "optional": true + }, "node_modules/safe-push-apply": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/safe-push-apply/-/safe-push-apply-1.0.0.tgz", @@ -5229,14 +6492,14 @@ "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true, + "devOptional": true, "license": "MIT" }, "node_modules/saxes": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/saxes/-/saxes-6.0.0.tgz", "integrity": "sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==", - "dev": true, + "devOptional": true, "dependencies": { "xmlchars": "^2.2.0" }, @@ -5263,6 +6526,13 @@ "node": ">=10" } }, + "node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", + "license": "ISC", + "optional": true + }, "node_modules/set-function-length": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", @@ -5459,6 +6729,61 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "license": "ISC", + "optional": true + }, + "node_modules/simple-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", + "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "optional": true + }, + "node_modules/simple-get": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz", + "integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "optional": true, + "dependencies": { + "decompress-response": "^6.0.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, "node_modules/sirv": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/sirv/-/sirv-2.0.4.tgz", @@ -5485,6 +6810,16 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "license": "BSD-3-Clause", + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/source-map-js": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", @@ -5520,6 +6855,21 @@ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", + "optional": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/string.prototype.matchall": { "version": "4.0.12", "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.12.tgz", @@ -5618,6 +6968,19 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", + "optional": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", @@ -5671,7 +7034,7 @@ "version": "3.2.4", "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", - "dev": true + "devOptional": true }, "node_modules/tabbable": { "version": "6.2.0", @@ -5679,6 +7042,89 @@ "integrity": "sha512-Cat63mxsVJlzYvN51JmVXIgNoUokrIaT2zLclCXjRd8boZ0004U4KCs/sToJ75C6sdlByWxpYnb5Boif1VSFew==", "license": "MIT" }, + "node_modules/tar": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", + "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", + "license": "ISC", + "optional": true, + "dependencies": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^5.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/tar-fs": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.4.tgz", + "integrity": "sha512-mDAjwmZdh7LTT6pNleZ05Yt65HC3E+NiQzl672vQG38jIrehtJk/J3mNwIg+vShQPcLF/LV7CMnDW6vjj6sfYQ==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "chownr": "^1.1.1", + "mkdirp-classic": "^0.5.2", + "pump": "^3.0.0", + "tar-stream": "^2.1.4" + } + }, + "node_modules/tar-stream": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", + "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "bl": "^4.0.3", + "end-of-stream": "^1.4.1", + "fs-constants": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/tar-stream/node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/tar/node_modules/chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "license": "ISC", + "optional": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/tar/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "license": "ISC", + "optional": true + }, "node_modules/three": { "version": "0.163.0", "resolved": "https://registry.npmjs.org/three/-/three-0.163.0.tgz", @@ -5773,6 +7219,20 @@ "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", "license": "0BSD" }, + "node_modules/tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", + "dev": true, + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "safe-buffer": "^5.0.1" + }, + "engines": { + "node": "*" + } + }, "node_modules/typed-array-buffer": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz", @@ -5909,6 +7369,16 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/universalify": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz", + "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 4.0.0" + } + }, "node_modules/update-browserslist-db": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.3.tgz", @@ -5950,6 +7420,17 @@ "punycode": "^2.1.0" } }, + "node_modules/url-parse": { + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", + "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "querystringify": "^2.1.1", + "requires-port": "^1.0.0" + } + }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -6177,11 +7658,28 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/wide-align": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", + "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", + "license": "ISC", + "optional": true, + "dependencies": { + "string-width": "^1.0.2 || 2 || 3 || 4" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "license": "ISC", + "optional": true + }, "node_modules/ws": { "version": "8.18.3", "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.3.tgz", "integrity": "sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==", - "dev": true, + "devOptional": true, "license": "MIT", "engines": { "node": ">=10.0.0" @@ -6213,7 +7711,7 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", - "dev": true + "devOptional": true }, "node_modules/yallist": { "version": "3.1.1", @@ -6960,6 +8458,43 @@ "@lit-labs/ssr-dom-shim": "^1.0.0" } }, + "@mapbox/node-pre-gyp": { + "version": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.11.tgz", + "integrity": "sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==", + "optional": true, + "requires": { + "detect-libc": "^2.0.0", + "https-proxy-agent": "^5.0.0", + "make-dir": "^3.1.0", + "node-fetch": "^2.6.7", + "nopt": "^5.0.0", + "npmlog": "^5.0.1", + "rimraf": "^3.0.2", + "semver": "^7.3.5", + "tar": "^6.1.11" + }, + "dependencies": { + "agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "optional": true, + "requires": { + "debug": "4" + } + }, + "https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "optional": true, + "requires": { + "agent-base": "6", + "debug": "4" + } + } + } + }, "@monogrid/gainmap-js": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/@monogrid/gainmap-js/-/gainmap-js-3.1.0.tgz", @@ -7119,18 +8654,18 @@ "@tanstack/query-core": "5.90.5" } }, + "@tootallnate/once": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", + "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", + "optional": true + }, "@types/estree": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", "dev": true }, - "@types/fabric": { - "version": "5.3.10", - "resolved": "https://registry.npmjs.org/@types/fabric/-/fabric-5.3.10.tgz", - "integrity": "sha512-fsJIuVkU+B2AnmQh+Ml2X0ax3NmRIqLvEXmZ+squX60HaF89TvdIP6tI6Uk5srXaauswTwPOOfWE7k2QboUZCg==", - "dev": true - }, "@types/file-saver": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/@types/file-saver/-/file-saver-2.0.7.tgz", @@ -7354,13 +8889,35 @@ } } }, + "abab": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", + "integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==", + "optional": true + }, + "abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "optional": true + }, "acorn": { "version": "8.15.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", - "dev": true, + "devOptional": true, "peer": true }, + "acorn-globals": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-7.0.1.tgz", + "integrity": "sha512-umOSDSDrfHbTNPuNpC2NSnnA3LUrqpevPb4T9jRx4MagXNS0rs+gwiTcAvqCRmsD6utzsrzNt+ebm00SNWiC3Q==", + "optional": true, + "requires": { + "acorn": "^8.1.0", + "acorn-walk": "^8.0.2" + } + }, "acorn-jsx": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", @@ -7372,7 +8929,7 @@ "version": "8.2.0", "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", - "dev": true + "devOptional": true }, "agent-base": { "version": "7.1.4", @@ -7392,6 +8949,12 @@ "uri-js": "^4.2.2" } }, + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "optional": true + }, "ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -7401,6 +8964,35 @@ "color-convert": "^2.0.1" } }, + "aproba": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.1.0.tgz", + "integrity": "sha512-tLIEcj5GuR2RSTnxNKdkK0dJ/GrC7P38sUkiDmDuHfsHmbagTFAxDVIBltoklXEVIQ/f14IL8IMJ5pn9Hez1Ew==", + "optional": true + }, + "are-we-there-yet": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz", + "integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==", + "optional": true, + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" + }, + "dependencies": { + "readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "optional": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + } + } + }, "argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", @@ -7505,6 +9097,12 @@ "integrity": "sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA==", "dev": true }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "optional": true + }, "available-typed-arrays": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", @@ -7518,7 +9116,14 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true + "devOptional": true + }, + "base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "dev": true, + "optional": true }, "baseline-browser-mapping": { "version": "2.8.17", @@ -7535,11 +9140,37 @@ "require-from-string": "^2.0.2" } }, + "bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "dev": true, + "optional": true, + "requires": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + }, + "dependencies": { + "readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dev": true, + "optional": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + } + } + }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, + "devOptional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -7567,6 +9198,17 @@ "update-browserslist-db": "^1.1.3" } }, + "buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "dev": true, + "optional": true, + "requires": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, "call-bind": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", @@ -7583,7 +9225,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", - "dev": true, + "devOptional": true, "requires": { "es-errors": "^1.3.0", "function-bind": "^1.1.2" @@ -7631,6 +9273,13 @@ } } }, + "chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", + "dev": true, + "optional": true + }, "classnames": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.3.2.tgz", @@ -7656,6 +9305,21 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, + "color-support": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", + "optional": true + }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "optional": true, + "requires": { + "delayed-stream": "~1.0.0" + } + }, "comlink": { "version": "4.4.2", "resolved": "https://registry.npmjs.org/comlink/-/comlink-4.4.2.tgz", @@ -7671,7 +9335,13 @@ "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true + "devOptional": true + }, + "console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==", + "optional": true }, "convert-source-map": { "version": "2.0.0", @@ -7705,6 +9375,12 @@ "source-map-js": "^1.0.1" } }, + "cssom": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.5.0.tgz", + "integrity": "sha512-iKuQcq+NdHqlAcwUY0o/HL69XQrUaQdMjmStJ8JFmUaiiQErlhrmuigkg/CU4E2J0IyUKUrMAgl36TvN67MqTw==", + "optional": true + }, "cssstyle": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-5.3.1.tgz", @@ -7775,7 +9451,7 @@ "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, + "devOptional": true, "requires": { "ms": "2.1.2" } @@ -7784,7 +9460,24 @@ "version": "10.6.0", "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.6.0.tgz", "integrity": "sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg==", - "dev": true + "devOptional": true + }, + "decompress-response": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", + "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", + "dev": true, + "optional": true, + "requires": { + "mimic-response": "^3.1.0" + } + }, + "deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "dev": true, + "optional": true }, "deep-is": { "version": "0.1.4", @@ -7814,6 +9507,18 @@ "object-keys": "^1.1.1" } }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "optional": true + }, + "delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==", + "optional": true + }, "detect-libc": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", @@ -7837,11 +9542,28 @@ "esutils": "^2.0.2" } }, + "domexception": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz", + "integrity": "sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==", + "optional": true, + "requires": { + "webidl-conversions": "^7.0.0" + }, + "dependencies": { + "webidl-conversions": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", + "optional": true + } + } + }, "dunder-proto": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", - "dev": true, + "devOptional": true, "requires": { "call-bind-apply-helpers": "^1.0.1", "es-errors": "^1.3.0", @@ -7860,11 +9582,27 @@ "integrity": "sha512-icUt1NvfhGLar5lSWH3tHNzablaA5js3HVHacQimfP8ViEBOQv+L7DKEuHdbTZ0SKCO1ogTJTIL1Gwk9S6Qvcg==", "dev": true }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "optional": true + }, + "end-of-stream": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz", + "integrity": "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==", + "dev": true, + "optional": true, + "requires": { + "once": "^1.4.0" + } + }, "entities": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/entities/-/entities-6.0.1.tgz", "integrity": "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==", - "dev": true + "devOptional": true }, "es-abstract": { "version": "1.24.0", @@ -7932,13 +9670,13 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", - "dev": true + "devOptional": true }, "es-errors": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", - "dev": true + "devOptional": true }, "es-iterator-helpers": { "version": "1.2.1", @@ -7968,7 +9706,7 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", - "dev": true, + "devOptional": true, "requires": { "es-errors": "^1.3.0" } @@ -7977,7 +9715,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", - "dev": true, + "devOptional": true, "requires": { "es-errors": "^1.3.0", "get-intrinsic": "^1.2.6", @@ -8017,6 +9755,18 @@ "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true }, + "escodegen": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz", + "integrity": "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==", + "optional": true, + "requires": { + "esprima": "^4.0.1", + "estraverse": "^5.2.0", + "esutils": "^2.0.2", + "source-map": "~0.6.1" + } + }, "eslint": { "version": "9.38.0", "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.38.0.tgz", @@ -8198,6 +9948,12 @@ } } }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "optional": true + }, "esquery": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", @@ -8220,18 +9976,233 @@ "version": "5.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true + "devOptional": true }, "esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true + "devOptional": true + }, + "expand-template": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", + "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", + "dev": true, + "optional": true }, "fabric": { - "version": "5.5.2-browser", - "resolved": "https://registry.npmjs.org/fabric/-/fabric-5.5.2-browser.tgz", - "integrity": "sha512-YAp0AmkkDNweR39NkfZRTrn3HvhZALFLydzfGxCzaethO7TL3T0G1TDIpzsDbwDuvcMRR38AKkDp2fKPwJhqnA==" + "version": "6.7.1", + "resolved": "https://registry.npmjs.org/fabric/-/fabric-6.7.1.tgz", + "integrity": "sha512-dLxSmIvN4InJf4xOjbl1LFWh8WGOUIYtcuDIGs2IN0Z9lI0zGobfesDauyEhI1+owMLTPCCiEv01rpYXm7g2EQ==", + "requires": { + "canvas": "^2.11.2", + "jsdom": "^20.0.1" + }, + "dependencies": { + "agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "optional": true, + "requires": { + "debug": "4" + } + }, + "cssstyle": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-2.3.0.tgz", + "integrity": "sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A==", + "optional": true, + "requires": { + "cssom": "~0.3.6" + }, + "dependencies": { + "cssom": { + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz", + "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==", + "optional": true + } + } + }, + "data-urls": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-3.0.2.tgz", + "integrity": "sha512-Jy/tj3ldjZJo63sVAvg6LHt2mHvl4V6AgRAmNDtLdm7faqtsx+aJG42rsyCo9JCoRVKwPFzKlIPx3DIibwSIaQ==", + "optional": true, + "requires": { + "abab": "^2.0.6", + "whatwg-mimetype": "^3.0.0", + "whatwg-url": "^11.0.0" + } + }, + "decompress-response": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-4.2.1.tgz", + "integrity": "sha512-jOSne2qbyE+/r8G1VU+G/82LBs2Fs4LAsTiLSHOCOMZQl2OKZ6i8i4IyHemTe+/yIXOtTcRQMzPcgyhoFlqPkw==", + "optional": true, + "requires": { + "mimic-response": "^2.0.0" + } + }, + "html-encoding-sniffer": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", + "integrity": "sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA==", + "optional": true, + "requires": { + "whatwg-encoding": "^2.0.0" + } + }, + "http-proxy-agent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", + "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", + "optional": true, + "requires": { + "@tootallnate/once": "2", + "agent-base": "6", + "debug": "4" + } + }, + "https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "optional": true, + "requires": { + "agent-base": "6", + "debug": "4" + } + }, + "jsdom": { + "version": "20.0.3", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-20.0.3.tgz", + "integrity": "sha512-SYhBvTh89tTfCD/CRdSOm13mOBa42iTaTyfyEWBdKcGdPxPtLFBXuHR8XHb33YNYaP+lLbmSvBTsnoesCNJEsQ==", + "optional": true, + "requires": { + "abab": "^2.0.6", + "acorn": "^8.8.1", + "acorn-globals": "^7.0.0", + "cssom": "^0.5.0", + "cssstyle": "^2.3.0", + "data-urls": "^3.0.2", + "decimal.js": "^10.4.2", + "domexception": "^4.0.0", + "escodegen": "^2.0.0", + "form-data": "^4.0.0", + "html-encoding-sniffer": "^3.0.0", + "http-proxy-agent": "^5.0.0", + "https-proxy-agent": "^5.0.1", + "is-potential-custom-element-name": "^1.0.1", + "nwsapi": "^2.2.2", + "parse5": "^7.1.1", + "saxes": "^6.0.0", + "symbol-tree": "^3.2.4", + "tough-cookie": "^4.1.2", + "w3c-xmlserializer": "^4.0.0", + "webidl-conversions": "^7.0.0", + "whatwg-encoding": "^2.0.0", + "whatwg-mimetype": "^3.0.0", + "whatwg-url": "^11.0.0", + "ws": "^8.11.0", + "xml-name-validator": "^4.0.0" + } + }, + "mimic-response": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.1.0.tgz", + "integrity": "sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA==", + "optional": true + }, + "parse5": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.3.0.tgz", + "integrity": "sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==", + "optional": true, + "requires": { + "entities": "^6.0.0" + } + }, + "simple-get": { + "version": "https://registry.npmjs.org/simple-get/-/simple-get-3.1.1.tgz", + "integrity": "sha512-CQ5LTKGfCpvE1K0n2us+kuMPbk/q0EKl82s4aheV9oXjFEz6W/Y7oQFVJuU6QG77hRT4Ghb5RURteF5vnWjupA==", + "optional": true, + "requires": { + "decompress-response": "^4.2.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, + "tough-cookie": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.4.tgz", + "integrity": "sha512-Loo5UUvLD9ScZ6jh8beX1T6sO1w2/MpCRpEP7V280GKMVUQ0Jzar2U3UJPsrdbziLEMMhu3Ujnq//rhiFuIeag==", + "optional": true, + "requires": { + "psl": "^1.1.33", + "punycode": "^2.1.1", + "universalify": "^0.2.0", + "url-parse": "^1.5.3" + } + }, + "tr46": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-3.0.0.tgz", + "integrity": "sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==", + "optional": true, + "requires": { + "punycode": "^2.1.1" + } + }, + "w3c-xmlserializer": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-4.0.0.tgz", + "integrity": "sha512-d+BFHzbiCx6zGfz0HyQ6Rg69w9k19nviJspaj4yNscGjrHu94sVP+aRm75yEbCh+r2/yR+7q6hux9LVtbuTGBw==", + "optional": true, + "requires": { + "xml-name-validator": "^4.0.0" + } + }, + "webidl-conversions": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", + "optional": true + }, + "whatwg-encoding": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz", + "integrity": "sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg==", + "optional": true, + "requires": { + "iconv-lite": "0.6.3" + } + }, + "whatwg-mimetype": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz", + "integrity": "sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==", + "optional": true + }, + "whatwg-url": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-11.0.0.tgz", + "integrity": "sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ==", + "optional": true, + "requires": { + "tr46": "^3.0.0", + "webidl-conversions": "^7.0.0" + } + }, + "xml-name-validator": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-4.0.0.tgz", + "integrity": "sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==", + "optional": true + } + } }, "fast-deep-equal": { "version": "3.1.3", @@ -8328,11 +10299,63 @@ "is-callable": "^1.2.7" } }, + "form-data": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.4.tgz", + "integrity": "sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow==", + "optional": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.2", + "mime-types": "^2.1.12" + } + }, + "fs-constants": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", + "dev": true, + "optional": true + }, + "fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "optional": true, + "requires": { + "minipass": "^3.0.0" + }, + "dependencies": { + "minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "optional": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "optional": true + } + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "optional": true + }, "function-bind": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "dev": true + "devOptional": true }, "function.prototype.name": { "version": "1.1.8", @@ -8354,6 +10377,23 @@ "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", "dev": true }, + "gauge": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", + "integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==", + "optional": true, + "requires": { + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.2", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.1", + "object-assign": "^4.1.1", + "signal-exit": "^3.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.2" + } + }, "generator-function": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/generator-function/-/generator-function-2.0.1.tgz", @@ -8370,7 +10410,7 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", - "dev": true, + "devOptional": true, "requires": { "call-bind-apply-helpers": "^1.0.2", "es-define-property": "^1.0.1", @@ -8388,7 +10428,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", - "dev": true, + "devOptional": true, "requires": { "dunder-proto": "^1.0.1", "es-object-atoms": "^1.0.0" @@ -8405,6 +10445,27 @@ "get-intrinsic": "^1.2.6" } }, + "github-from-package": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", + "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==", + "dev": true, + "optional": true + }, + "glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "optional": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, "glob-parent": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", @@ -8445,7 +10506,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", - "dev": true + "devOptional": true }, "graphemer": { "version": "1.4.0", @@ -8496,22 +10557,28 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", - "dev": true + "devOptional": true }, "has-tostringtag": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", - "dev": true, + "devOptional": true, "requires": { "has-symbols": "^1.0.3" } }, + "has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==", + "optional": true + }, "hasown": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", - "dev": true, + "devOptional": true, "requires": { "function-bind": "^1.1.2" } @@ -8570,11 +10637,18 @@ "version": "0.6.3", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", - "dev": true, + "devOptional": true, "requires": { "safer-buffer": ">= 2.1.2 < 3.0.0" } }, + "ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "dev": true, + "optional": true + }, "ignore": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", @@ -8601,11 +10675,28 @@ "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", "dev": true }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "optional": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, "inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, + "ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true, + "optional": true + }, "internal-slot": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.1.0.tgz", @@ -8710,6 +10801,12 @@ "call-bound": "^1.0.3" } }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "optional": true + }, "is-generator-function": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.1.2.tgz", @@ -8773,7 +10870,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", - "dev": true + "devOptional": true }, "is-promise": { "version": "2.2.2", @@ -9070,11 +11167,28 @@ "integrity": "sha512-F9ODfyqML2coTIsQpSkRHnLSZMtkU8Q+mSfcaIyKwy58u+8k5nvAYeiNhsyMARvzNcXJ9QfWVrcPsC9e9rAxtg==", "dev": true }, + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "optional": true, + "requires": { + "semver": "^6.0.0" + }, + "dependencies": { + "semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "optional": true + } + } + }, "math-intrinsics": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", - "dev": true + "devOptional": true }, "mdn-data": { "version": "2.12.2", @@ -9096,15 +11210,90 @@ "picomatch": "^2.3.1" } }, + "mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "optional": true + }, + "mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "optional": true, + "requires": { + "mime-db": "1.52.0" + } + }, + "mimic-response": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", + "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", + "dev": true, + "optional": true + }, "minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, + "devOptional": true, "requires": { "brace-expansion": "^1.1.7" } }, + "minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true, + "optional": true + }, + "minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "optional": true + }, + "minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "optional": true, + "requires": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, + "dependencies": { + "minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "optional": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "optional": true + } + } + }, + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "optional": true + }, + "mkdirp-classic": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", + "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==", + "dev": true, + "optional": true + }, "mrmime": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/mrmime/-/mrmime-2.0.1.tgz", @@ -9115,13 +11304,25 @@ "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true + "devOptional": true + }, + "nan": { + "version": "https://registry.npmjs.org/nan/-/nan-2.23.0.tgz", + "integrity": "sha512-1UxuyYGdoQHcGg87Lkqm3FzefucTa0NAiOcuRsDmysep3c1LVCRK2krrUDafMWtjSG04htvAmvg96+SDknOmgQ==", + "optional": true }, "nanoid": { "version": "3.3.7", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==" }, + "napi-build-utils": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-2.0.0.tgz", + "integrity": "sha512-GEbrYkbfF7MoNaoh2iGG84Mnf/WZfB0GdGEsM8wz7Expx/LlWf5U8t9nvJKXSp3qr5IsEbK04cBGhol/KwOsWA==", + "dev": true, + "optional": true + }, "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -9149,17 +11350,93 @@ "styled-jsx": "5.1.6" } }, + "node-abi": { + "version": "3.78.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.78.0.tgz", + "integrity": "sha512-E2wEyrgX/CqvicaQYU3Ze1PFGjc4QYPGsjUrlYkqAE0WjHEZwgOsGMPMzkMse4LjJbDmaEuDX3CM036j5K2DSQ==", + "dev": true, + "optional": true, + "requires": { + "semver": "^7.3.5" + } + }, + "node-addon-api": { + "version": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.1.tgz", + "integrity": "sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==", + "dev": true, + "optional": true + }, + "node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "optional": true, + "requires": { + "whatwg-url": "^5.0.0" + }, + "dependencies": { + "tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "optional": true + }, + "webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "optional": true + }, + "whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "optional": true, + "requires": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + } + } + }, "node-releases": { "version": "2.0.25", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.25.tgz", "integrity": "sha512-4auku8B/vw5psvTiiN9j1dAOsXvMoGqJuKJcR+dTdqiXEK20mMTk1UEo3HS16LeGQsVG6+qKTPM9u/qQ2LqATA==", "dev": true }, + "nopt": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", + "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", + "optional": true, + "requires": { + "abbrev": "1" + } + }, + "npmlog": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz", + "integrity": "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==", + "optional": true, + "requires": { + "are-we-there-yet": "^2.0.0", + "console-control-strings": "^1.1.0", + "gauge": "^3.0.0", + "set-blocking": "^2.0.0" + } + }, + "nwsapi": { + "version": "2.2.22", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.22.tgz", + "integrity": "sha512-ujSMe1OWVn55euT1ihwCI1ZcAaAU3nxUiDwfDQldc51ZXaB9m2AyOn6/jh1BLe2t/G8xd6uKG1UBF2aZJeg2SQ==", + "optional": true + }, "object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "dev": true + "devOptional": true }, "object-inspect": { "version": "1.13.4", @@ -9223,6 +11500,15 @@ "es-object-atoms": "^1.0.0" } }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "optional": true, + "requires": { + "wrappy": "1" + } + }, "opener": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/opener/-/opener-1.5.2.tgz", @@ -9287,6 +11573,12 @@ "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "optional": true + }, "path-key": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", @@ -9336,6 +11628,26 @@ "source-map-js": "^1.0.2" } }, + "prebuild-install": { + "version": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.3.tgz", + "integrity": "sha512-8Mf2cbV7x1cXPUILADGI3wuhfqWvtiLA1iclTDbFRZkgRQS0NqsPZphna9V+HyTEadheuPmjaJMsbzKQFOzLug==", + "dev": true, + "optional": true, + "requires": { + "detect-libc": "^2.0.0", + "expand-template": "^2.0.3", + "github-from-package": "0.0.0", + "minimist": "^1.2.3", + "mkdirp-classic": "^0.5.3", + "napi-build-utils": "^2.0.0", + "node-abi": "^3.3.0", + "pump": "^3.0.0", + "rc": "^1.2.7", + "simple-get": "^4.0.0", + "tar-fs": "^2.0.0", + "tunnel-agent": "^0.6.0" + } + }, "process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -9361,17 +11673,65 @@ "react-is": "^16.13.1" } }, + "psl": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.15.0.tgz", + "integrity": "sha512-JZd3gMVBAVQkSs6HdNZo9Sdo0LNcQeMNP3CozBJb3JYC/QUYZTnKxP+f8oWRX4rHP5EurWxqAHTSwUCjlNKa1w==", + "optional": true, + "requires": { + "punycode": "^2.3.1" + } + }, + "pump": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.3.tgz", + "integrity": "sha512-todwxLMY7/heScKmntwQG8CXVkWUOdYxIvY2s0VWAAMh/nd8SoYiRaKjlr7+iCs984f2P8zvrfWcDDYVb73NfA==", + "dev": true, + "optional": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, "punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", - "dev": true + "devOptional": true + }, + "querystringify": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", + "optional": true }, "queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==" }, + "rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "dev": true, + "optional": true, + "requires": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "dependencies": { + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", + "dev": true, + "optional": true + } + } + }, "react": { "version": "19.2.0", "resolved": "https://registry.npmjs.org/react/-/react-19.2.0.tgz", @@ -9456,6 +11816,12 @@ "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", "dev": true }, + "requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", + "optional": true + }, "resolve": { "version": "2.0.0-next.5", "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.5.tgz", @@ -9478,6 +11844,15 @@ "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==" }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "optional": true, + "requires": { + "glob": "^7.1.3" + } + }, "rrweb-cssom": { "version": "0.8.0", "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.8.0.tgz", @@ -9513,6 +11888,13 @@ } } }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "optional": true + }, "safe-push-apply": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/safe-push-apply/-/safe-push-apply-1.0.0.tgz", @@ -9546,13 +11928,13 @@ "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true + "devOptional": true }, "saxes": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/saxes/-/saxes-6.0.0.tgz", "integrity": "sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==", - "dev": true, + "devOptional": true, "requires": { "xmlchars": "^2.2.0" } @@ -9568,6 +11950,12 @@ "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", "devOptional": true }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", + "optional": true + }, "set-function-length": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", @@ -9706,6 +12094,30 @@ "side-channel-map": "^1.0.1" } }, + "signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "optional": true + }, + "simple-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", + "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", + "optional": true + }, + "simple-get": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz", + "integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==", + "dev": true, + "optional": true, + "requires": { + "decompress-response": "^6.0.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, "sirv": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/sirv/-/sirv-2.0.4.tgz", @@ -9722,6 +12134,12 @@ "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==" }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "optional": true + }, "source-map-js": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", @@ -9752,6 +12170,17 @@ } } }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "optional": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, "string.prototype.matchall": { "version": "4.0.12", "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.12.tgz", @@ -9821,6 +12250,15 @@ "es-object-atoms": "^1.0.0" } }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "optional": true, + "requires": { + "ansi-regex": "^5.0.1" + } + }, "strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", @@ -9845,13 +12283,82 @@ "version": "3.2.4", "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", - "dev": true + "devOptional": true }, "tabbable": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/tabbable/-/tabbable-6.2.0.tgz", "integrity": "sha512-Cat63mxsVJlzYvN51JmVXIgNoUokrIaT2zLclCXjRd8boZ0004U4KCs/sToJ75C6sdlByWxpYnb5Boif1VSFew==" }, + "tar": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", + "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", + "optional": true, + "requires": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^5.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + }, + "dependencies": { + "chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "optional": true + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "optional": true + } + } + }, + "tar-fs": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.4.tgz", + "integrity": "sha512-mDAjwmZdh7LTT6pNleZ05Yt65HC3E+NiQzl672vQG38jIrehtJk/J3mNwIg+vShQPcLF/LV7CMnDW6vjj6sfYQ==", + "dev": true, + "optional": true, + "requires": { + "chownr": "^1.1.1", + "mkdirp-classic": "^0.5.2", + "pump": "^3.0.0", + "tar-stream": "^2.1.4" + } + }, + "tar-stream": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", + "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", + "dev": true, + "optional": true, + "requires": { + "bl": "^4.0.3", + "end-of-stream": "^1.4.1", + "fs-constants": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1" + }, + "dependencies": { + "readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dev": true, + "optional": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + } + } + }, "three": { "version": "0.163.0", "resolved": "https://registry.npmjs.org/three/-/three-0.163.0.tgz", @@ -9917,6 +12424,16 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==" }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", + "dev": true, + "optional": true, + "requires": { + "safe-buffer": "^5.0.1" + } + }, "typed-array-buffer": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz", @@ -10001,6 +12518,12 @@ "which-boxed-primitive": "^1.1.1" } }, + "universalify": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz", + "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", + "optional": true + }, "update-browserslist-db": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.3.tgz", @@ -10020,6 +12543,16 @@ "punycode": "^2.1.0" } }, + "url-parse": { + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", + "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", + "optional": true, + "requires": { + "querystringify": "^2.1.1", + "requires-port": "^1.0.0" + } + }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -10173,11 +12706,26 @@ "has-tostringtag": "^1.0.2" } }, + "wide-align": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", + "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", + "optional": true, + "requires": { + "string-width": "^1.0.2 || 2 || 3 || 4" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "optional": true + }, "ws": { "version": "8.18.3", "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.3.tgz", "integrity": "sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==", - "dev": true, + "devOptional": true, "requires": {} }, "xml-name-validator": { @@ -10190,7 +12738,7 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", - "dev": true + "devOptional": true }, "yallist": { "version": "3.1.1", diff --git a/package.json b/package.json index 96da7e8..6aa3c9a 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "@rc-component/slider": "^1.0.0", "@tanstack/react-query": "^5.90.5", "comlink": "^4.4.2", - "fabric": "^5.5.2-browser", + "fabric": "^6.7.1", "file-saver": "^2.0.5", "globby": "^13.1.2", "jszip": "^3.10.1", @@ -35,13 +35,10 @@ "@eslint/js": "^9.38.0", "@next/bundle-analyzer": "^15.5.6", "@next/eslint-plugin-next": "^15.5.6", - "@types/fabric": "^5.3.10", "@types/file-saver": "^2.0.7", "@types/lodash.orderby": "^4.6.9", "@types/pngjs": "^6.0.5", "@types/react": "^19.2.2", - "@typescript-eslint/eslint-plugin": "^8.46.1", - "@typescript-eslint/parser": "^8.46.1", "eslint": "^9.38.0", "eslint-plugin-react": "^7.37.5", "eslint-plugin-react-hooks": "^7.0.0", diff --git a/src/Canvas.tsx b/src/Canvas.tsx index 1979030..717003d 100644 --- a/src/Canvas.tsx +++ b/src/Canvas.tsx @@ -3,13 +3,14 @@ import { useCallback, useEffect, useRef, useState } from "react"; import useCanvas from "./useCanvas"; import useSettings from "./useSettings"; import useTools from "./useTools"; -import { fabric } from "fabric"; +import { Canvas as FabricCanvas, InteractiveFabricObject } from "fabric"; import { createFabricImage } from "./fabricUtils"; type JSONSnapshot = ReturnType<(typeof Canvas.prototype)["toDatalessJSON"]>; function updateObjectControlOptions() { - fabric.Object.prototype.set({ + InteractiveFabricObject.ownDefaults = { + ...InteractiveFabricObject.ownDefaults, transparentCorners: false, borderColor: "#8afff1", cornerSize: 9, @@ -18,13 +19,13 @@ function updateObjectControlOptions() { cornerStrokeColor: "#1c9f7c", strokeWidth: 10, perPixelTargetFind: true, - }); + }; } export interface CanvasProps { canvasId: string; canvasType: "color" | "metallic"; - onChange: (canvas: fabric.Canvas) => void; + onChange: (canvas: FabricCanvas) => void; baseImageUrl: string | null; textureSize: [number, number]; defaultDrawingMode?: boolean; @@ -38,7 +39,7 @@ export default function Canvas({ defaultDrawingMode = false, }: CanvasProps) { const canvasElementRef = useRef(null); - const [canvas, setCanvas] = useState(null); + const [canvas, setCanvas] = useState(null); const { activeCanvas } = useTools(); const { canvasPadding } = useSettings(); const { registerCanvas, unregisterCanvas } = useCanvas(); @@ -105,13 +106,18 @@ export default function Canvas({ const isActive = activeCanvas === canvasId; useEffect(() => { + if (!canvasElementRef.current) { + return; + } + const options = { preserveObjectStacking: true, targetFindTolerance: 2, }; + updateObjectControlOptions(); - const canvas = new fabric.Canvas(canvasElementRef.current, options); + const canvas = new FabricCanvas(canvasElementRef.current, options); let isSnapshotting = false; let changeTimer: ReturnType; @@ -138,7 +144,7 @@ export default function Canvas({ if (JSON.stringify(snapshot) === JSON.stringify(lastSnapshot)) { return history; } else { - return [...history.slice(-5), snapshot]; + return [...history.slice(-10), snapshot]; } }); setRedoHistory([]); @@ -225,6 +231,11 @@ export default function Canvas({ canRedo, ]); + useEffect(() => { + setUndoHistory([]); + setRedoHistory([]); + }, [canvas, baseImageUrl, textureSize]); + useEffect(() => { if (canvas && textureSize) { trackChanges.current = false; diff --git a/src/CanvasInteractions.tsx b/src/CanvasInteractions.tsx index e2733fb..dfcbad2 100644 --- a/src/CanvasInteractions.tsx +++ b/src/CanvasInteractions.tsx @@ -35,6 +35,9 @@ export default function CanvasInteractions({ className="CanvasInteractions" tabIndex={0} ref={ref} + onDragOver={(event) => { + event.preventDefault(); + }} onDrop={async (event) => { event.preventDefault(); if (ref.current) { diff --git a/src/CanvasTools.tsx b/src/CanvasTools.tsx index d492976..18be784 100644 --- a/src/CanvasTools.tsx +++ b/src/CanvasTools.tsx @@ -1,6 +1,6 @@ "use client"; import { InputHTMLAttributes, useEffect, useRef, useState } from "react"; -import { fabric } from "fabric"; +import { FabricImage } from "fabric"; import useCanvas from "./useCanvas"; import useTools from "./useTools"; import { @@ -168,7 +168,7 @@ export default function CanvasTools() { const hasSelection = selectedObjects.length > 0; const selectionHasImages = - selectedObjects.filter((object) => object instanceof fabric.Image).length > + selectedObjects.filter((object) => object instanceof FabricImage).length > 0; const handleBackgroundColorChange: InputHTMLAttributes["onChange"] = @@ -441,7 +441,7 @@ export default function CanvasTools() { all ( {canvas?._objects .filter( - (object) => object instanceof fabric.Image + (object) => object instanceof FabricImage ) .length.toLocaleString() ?? 0} ) @@ -561,7 +561,7 @@ export default function CanvasTools() {