lido-player 0.0.2-beta-15-dev → 0.0.2-beta-16-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import{r as t,h as i,H as e,a as n,c as r,d as s}from"./p-Dq-Z8Dx0.js";import{R as o,s as a,i as h,c as u,p as c,e as l,S as d,a as f,A as p,b as g,d as m,t as b,C as v,h as w,f as y,L as x,T as k,j as A,k as S,l as j,r as M,m as E,n as O,o as C,g as $,q as I,u as _,v as T,G as P,w as z,x as W,y as D,z as L,B as F,N as R,P as B,D as N,E as U,F as H,H as q,I as X,J as V,K as G,M as Y,O as Z,Q as K,U as J,V as Q,W as tt,X as it,Y as et,Z as nt,_ as rt}from"./p-0l6uR1lH.js";var st,ot,at={exports:{}},ht=st?at.exports:(st=1,ot=()=>(()=>{var t=[,(t,i,e)=>{var n;e.r(i),e.d(i,{default:()=>r});const r=(n="undefined"!=typeof document?document.currentScript?.src:void 0,function(t={}){var i,e,r=t,s=new Promise(((t,n)=>{i=t,e=n})),o="object"==typeof window,a="function"==typeof importScripts;function h(){function t(t){const s=n;e=i=0,n=new Map,s.forEach((i=>{try{i(t)}catch(t){console.error(t)}})),this.nb(),r&&r.Pb()}let i=0,e=0,n=new Map,r=null,s=null;this.requestAnimationFrame=function(r){i||=requestAnimationFrame(t.bind(this));const s=++e;return n.set(s,r),s},this.cancelAnimationFrame=function(t){n.delete(t),i&&0==n.size&&(cancelAnimationFrame(i),i=0)},this.Nb=function(t){s&&(document.body.remove(s),s=null),t||(s=document.createElement("div"),s.style.backgroundColor="black",s.style.position="fixed",s.style.right=0,s.style.top=0,s.style.color="white",s.style.padding="4px",s.innerHTML="RIVE FPS",t=function(t){s.innerHTML="RIVE FPS "+t.toFixed(1)},document.body.appendChild(s)),r=new function(){let i=0,e=0;this.Pb=function(){var n=performance.now();e?(++i,1e3<(n-=e)&&(t(1e3*i/n),i=e=0)):(e=n,i=0)}}},this.Kb=function(){s&&(document.body.remove(s),s=null),r=null},this.nb=function(){}}function u(t){console.assert(!0);const i=new Map;let e=-1/0;this.push=function(n){return i.has(n=n+((1<<t)-1)>>t)&&clearTimeout(i.get(n)),i.set(n,setTimeout((function(){i.delete(n),0==i.length?e=-1/0:n==e&&(e=Math.max(...i.keys()),console.assert(e<n))}),1e3)),e=Math.max(n,e),e<<t}}const c=r.onRuntimeInitialized;r.onRuntimeInitialized=function(){c&&c();let t=r.decodeAudio;r.decodeAudio=function(i,e){e(i=t(i))};let i=r.decodeFont;r.decodeFont=function(t,e){e(t=i(t))};const e=r.FileAssetLoader;r.ptrToAsset=t=>{let i=r.ptrToFileAsset(t);return i.isImage?r.ptrToImageAsset(t):i.isFont?r.ptrToFontAsset(t):i.isAudio?r.ptrToAudioAsset(t):i},r.CustomFileAssetLoader=e.extend("CustomFileAssetLoader",{__construct:function({loadContents:t}){this.__parent.__construct.call(this),this.Db=t},loadContents:function(t,i){return t=r.ptrToAsset(t),this.Db(t,i)}}),r.CDNFileAssetLoader=e.extend("CDNFileAssetLoader",{__construct:function(){this.__parent.__construct.call(this)},loadContents:function(t){let i=r.ptrToAsset(t);return""!==(t=i.cdnUuid)&&(e=i.cdnBaseUrl+"/"+t,(n=new XMLHttpRequest).responseType="arraybuffer",n.onreadystatechange=function(){4==n.readyState&&200==n.status&&(t=>{i.decode(new Uint8Array(t.response))})(n)},n.open("GET",e,!0),n.send(null),!0);var e,n}}),r.FallbackFileAssetLoader=e.extend("FallbackFileAssetLoader",{__construct:function(){this.__parent.__construct.call(this),this.jb=[]},addLoader:function(t){this.jb.push(t)},loadContents:function(t,i){for(let e of this.jb)if(e.loadContents(t,i))return!0;return!1}});let n=r.computeAlignment;r.computeAlignment=function(t,i,e,r,s=1){return n.call(this,t,i,e,r,s)}};const l="createConicGradient createImageData createLinearGradient createPattern createRadialGradient getContextAttributes getImageData getLineDash getTransform isContextLost isPointInPath isPointInStroke measureText".split(" "),d=new function(){function t(){if(!i){var t=document.createElement("canvas"),o={alpha:1,depth:0,stencil:0,antialias:0,premultipliedAlpha:1,preserveDrawingBuffer:0,powerPreference:"high-performance",failIfMajorPerformanceCaveat:0,enableExtensionsByDefault:1,explicitSwapControl:1,renderViaOffscreenBackBuffer:1};let a;if(/iPhone|iPad|iPod/i.test(navigator.userAgent)){if(a=t.getContext("webgl",o),e=1,!a)return console.log("No WebGL support. Image mesh will not be drawn."),!1}else if(a=t.getContext("webgl2",o))e=2;else{if(!(a=t.getContext("webgl",o)))return console.log("No WebGL support. Image mesh will not be drawn."),!1;e=1}function u(t,i,e){if(i=a.createShader(i),a.shaderSource(i,e),a.compileShader(i),0<((e=a.getShaderInfoLog(i))||"").length)throw e;a.attachShader(t,i)}if(a=new Proxy(a,{get:(t,i)=>t.isContextLost()?(h||(console.error("Cannot render the mesh because the GL Context was lost. Tried to invoke ",i),h=!0),"function"==typeof t[i]?function(){}:void 0):"function"==typeof t[i]?function(...e){return t[i].apply(t,e)}:t[i],set(t,i,e){if(!t.isContextLost())return t[i]=e,!0;h||(console.error("Cannot render the mesh because the GL Context was lost. Tried to set property "+i),h=!0)}}),n=Math.min(a.getParameter(a.MAX_RENDERBUFFER_SIZE),a.getParameter(a.MAX_TEXTURE_SIZE)),u(t=a.createProgram(),a.VERTEX_SHADER,"attribute vec2 vertex;\n attribute vec2 uv;\n uniform vec4 mat;\n uniform vec2 translate;\n varying vec2 st;\n void main() {\n st = uv;\n gl_Position = vec4(mat2(mat) * vertex + translate, 0, 1);\n }"),u(t,a.FRAGMENT_SHADER,"precision highp float;\n uniform sampler2D image;\n varying vec2 st;\n void main() {\n gl_FragColor = texture2D(image, st);\n }"),a.bindAttribLocation(t,0,"vertex"),a.bindAttribLocation(t,1,"uv"),a.linkProgram(t),0<((o=a.getProgramInfoLog(t))||"").trim().length)throw o;r=a.getUniformLocation(t,"mat"),s=a.getUniformLocation(t,"translate"),a.useProgram(t),a.bindBuffer(a.ARRAY_BUFFER,a.createBuffer()),a.enableVertexAttribArray(0),a.enableVertexAttribArray(1),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,a.createBuffer()),a.uniform1i(a.getUniformLocation(t,"image"),0),a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),i=a}return!0}let i=null,e=0,n=0,r=null,s=null,o=0,a=0,h=!1;t(),this.ac=function(){return t(),n},this.Jb=function(t){i.deleteTexture&&i.deleteTexture(t)},this.Ib=function(n){if(!t())return null;const r=i.createTexture();return r?(i.bindTexture(i.TEXTURE_2D,r),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,n),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),2==e?(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR_MIPMAP_LINEAR),i.generateMipmap(i.TEXTURE_2D)):i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),r):null};const c=new u(8),l=new u(8),d=new u(10),f=new u(10);this.Mb=function(e,n,h,u,p){if(t()){var g=c.push(e),m=l.push(n);if(i.canvas){for(var b of(i.canvas.width==g&&i.canvas.height==m||(i.canvas.width=g,i.canvas.height=m),i.viewport(0,m-n,e,n),i.disable(i.SCISSOR_TEST),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),i.enable(i.SCISSOR_TEST),h.sort(((t,i)=>i.ub-t.ub)),g=d.push(u),o!=g&&(i.bufferData(i.ARRAY_BUFFER,8*g,i.DYNAMIC_DRAW),o=g),g=0,h))i.bufferSubData(i.ARRAY_BUFFER,g,b.Sa),g+=4*b.Sa.length;for(var v of(console.assert(g==4*u),h))i.bufferSubData(i.ARRAY_BUFFER,g,v.Ab),g+=4*v.Ab.length;for(var w of(console.assert(g==8*u),g=f.push(p),a!=g&&(i.bufferData(i.ELEMENT_ARRAY_BUFFER,2*g,i.DYNAMIC_DRAW),a=g),b=0,h))i.bufferSubData(i.ELEMENT_ARRAY_BUFFER,b,w.indices),b+=2*w.indices.length;console.assert(b==2*p),w=0,v=!0,g=b=0;for(const t of h){t.image.Ia!=w&&(i.bindTexture(i.TEXTURE_2D,t.image.Ha||null),w=t.image.Ia),t.fc?(i.scissor(t.Ya,m-t.Za-t.ib,t.tc,t.ib),v=!0):v&&(i.scissor(0,m-n,e,n),v=!1);const o=-2/n;i.uniform4f(r,t.ga[0]*(h=2/e)*t.za,t.ga[1]*o*t.Aa,t.ga[2]*h*t.za,t.ga[3]*o*t.Aa),i.uniform2f(s,t.ga[4]*h*t.za+h*(t.Ya-t.bc*t.za)-1,t.ga[5]*o*t.Aa+o*(t.Za-t.cc*t.Aa)+1),i.vertexAttribPointer(0,2,i.FLOAT,!1,0,g),i.vertexAttribPointer(1,2,i.FLOAT,!1,0,g+4*u),i.drawElements(i.TRIANGLES,t.indices.length,i.UNSIGNED_SHORT,b),g+=4*t.Sa.length,b+=2*t.indices.length}console.assert(g==4*u),console.assert(b==2*p)}}},this.canvas=function(){return t()&&i.canvas}},f=r.onRuntimeInitialized;r.onRuntimeInitialized=function(){function t(t){switch(t){case p.srcOver:return"source-over";case p.screen:return"screen";case p.overlay:return"overlay";case p.darken:return"darken";case p.lighten:return"lighten";case p.colorDodge:return"color-dodge";case p.colorBurn:return"color-burn";case p.hardLight:return"hard-light";case p.softLight:return"soft-light";case p.difference:return"difference";case p.exclusion:return"exclusion";case p.multiply:return"multiply";case p.hue:return"hue";case p.saturation:return"saturation";case p.color:return"color";case p.luminosity:return"luminosity"}}function i(t){return"rgba("+((16711680&t)>>>16)+","+((65280&t)>>>8)+","+((255&t)>>>0)+","+((4278190080&t)>>>24)/255+")"}function e(){0<S.length&&(d.Mb(A.drawWidth(),A.drawHeight(),S,j,M),S=[],M=j=0,A.reset(512,512));for(const t of k){for(const i of t.H)i();t.H=[]}k.clear()}f&&f();var n=r.RenderPaintStyle;const s=r.RenderPath,o=r.RenderPaint,a=r.Renderer,u=r.StrokeCap,c=r.StrokeJoin,p=r.BlendMode,g=n.fill,m=n.stroke,b=r.FillRule.evenOdd;let v=1;var w=r.RenderImage.extend("CanvasRenderImage",{__construct:function({ka:t,va:i}={}){this.__parent.__construct.call(this),this.Ia=v,v=v+1&2147483647||1,this.ka=t,this.va=i},__destruct:function(){this.Ha&&(d.Jb(this.Ha),URL.revokeObjectURL(this.Va)),this.__parent.__destruct.call(this)},decode:function(t){var i=this;i.va&&i.va(i);var e=new Image;i.Va=URL.createObjectURL(new Blob([t],{type:"image/png"})),e.onload=function(){i.Cb=e,i.Ha=d.Ib(e),i.size(e.width,e.height),i.ka&&i.ka(i)},e.src=i.Va}}),y=s.extend("CanvasRenderPath",{__construct:function(){this.__parent.__construct.call(this),this.T=new Path2D},rewind:function(){this.T=new Path2D},addPath:function(t,i,e,n,r,s,o){var a=this.T,h=a.addPath;t=t.T;const u=new DOMMatrix;u.a=i,u.b=e,u.c=n,u.d=r,u.e=s,u.f=o,h.call(a,t,u)},fillRule:function(t){this.Ua=t},moveTo:function(t,i){this.T.moveTo(t,i)},lineTo:function(t,i){this.T.lineTo(t,i)},cubicTo:function(t,i,e,n,r,s){this.T.bezierCurveTo(t,i,e,n,r,s)},close:function(){this.T.closePath()}}),x=o.extend("CanvasRenderPaint",{color:function(t){this.Wa=i(t)},thickness:function(t){this.Fb=t},join:function(t){switch(t){case c.miter:this.Ga="miter";break;case c.round:this.Ga="round";break;case c.bevel:this.Ga="bevel"}},cap:function(t){switch(t){case u.butt:this.Fa="butt";break;case u.round:this.Fa="round";break;case u.square:this.Fa="square"}},style:function(t){this.Eb=t},blendMode:function(i){this.Bb=t(i)},clearGradient:function(){this.ia=null},linearGradient:function(t,i,e,n){this.ia={wb:t,xb:i,bb:e,cb:n,Pa:[]}},radialGradient:function(t,i,e,n){this.ia={wb:t,xb:i,bb:e,cb:n,Pa:[],$b:!0}},addStop:function(t,i){this.ia.Pa.push({color:t,stop:i})},completeGradient:function(){},draw:function(t,e,n){let r=this.Eb;var s=this.Wa,o=this.ia;if(t.globalCompositeOperation=this.Bb,null!=o){s=o.wb;var a=o.xb;const e=o.bb;var h=o.cb;const n=o.Pa;o.$b?(o=e-s,h-=a,s=t.createRadialGradient(s,a,0,s,a,Math.sqrt(o*o+h*h))):s=t.createLinearGradient(s,a,e,h);for(let t=0,e=n.length;t<e;t++)s.addColorStop((a=n[t]).stop,i(a.color));this.Wa=s,this.ia=null}switch(r){case m:t.strokeStyle=s,t.lineWidth=this.Fb,t.lineCap=this.Fa,t.lineJoin=this.Ga,t.stroke(e);break;case g:t.fillStyle=s,t.fill(e,n)}}});const k=new Set;let A=null,S=[],j=0,M=0;var E=r.CanvasRenderer=a.extend("Renderer",{__construct:function(t){this.__parent.__construct.call(this),this.S=[1,0,0,1,0,0],this.B=t.getContext("2d"),this.Ta=t,this.H=[]},save:function(){this.S.push(...this.S.slice(this.S.length-6)),this.H.push(this.B.save.bind(this.B))},restore:function(){const t=this.S.length-6;if(6>t)throw"restore() called without matching save().";this.S.splice(t),this.H.push(this.B.restore.bind(this.B))},transform:function(t,i,e,n,r,s){const o=this.S,a=o.length-6;o.splice(a,6,o[a]*t+o[a+2]*i,o[a+1]*t+o[a+3]*i,o[a]*e+o[a+2]*n,o[a+1]*e+o[a+3]*n,o[a]*r+o[a+2]*s+o[a+4],o[a+1]*r+o[a+3]*s+o[a+5]),this.H.push(this.B.transform.bind(this.B,t,i,e,n,r,s))},rotate:function(t){const i=Math.sin(t);t=Math.cos(t),this.transform(t,i,-i,t,0,0)},_drawPath:function(t,i){this.H.push(i.draw.bind(i,this.B,t.T,t.Ua===b?"evenodd":"nonzero"))},_drawRiveImage:function(i,e,n,r){var s=i.Cb;if(s){var o=this.B,a=t(n);this.H.push((function(){o.globalCompositeOperation=a,o.globalAlpha=r,o.drawImage(s,0,0),o.globalAlpha=1}))}},_getMatrix:function(t){const i=this.S,e=i.length-6;for(let n=0;6>n;++n)t[n]=i[e+n]},_drawImageMesh:function(i,n,s,o,a,h,u,c,l,f,p){n=this.B.canvas.width;var g=this.B.canvas.height;const m=f-c,b=p-l;c=Math.max(c,0),l=Math.max(l,0),f=Math.min(f,n),p=Math.min(p,g);const v=f-c,w=p-l;if(console.assert(v<=Math.min(m,n)),console.assert(w<=Math.min(b,g)),!(0>=v||0>=w)){f=v<m||w<b,n=p=1;var y=Math.ceil(v*p),x=Math.ceil(w*n);g=d.ac(),y>g&&(p*=g/y,y=g),x>g&&(n*=g/x,x=g),A||(A=new r.DynamicRectanizer(g),A.reset(512,512)),0>(g=A.addRect(y,x))&&(e(),k.add(this),g=A.addRect(y,x),console.assert(0<=g));var E=65535&g,O=g>>16;S.push({ga:this.S.slice(this.S.length-6),image:i,Ya:E,Za:O,bc:c,cc:l,tc:y,ib:x,za:p,Aa:n,Sa:new Float32Array(a),Ab:new Float32Array(h),indices:new Uint16Array(u),fc:f,ub:i.Ia<<1|(f?1:0)}),j+=a.length,M+=u.length;var C=this.B,$=t(s);this.H.push((function(){C.save(),C.resetTransform(),C.globalCompositeOperation=$,C.globalAlpha=o;const t=d.canvas();t&&C.drawImage(t,E,O,y,x,c,l,v,w),C.restore()}))}},_clipPath:function(t){this.H.push(this.B.clip.bind(this.B,t.T,t.Ua===b?"evenodd":"nonzero"))},clear:function(){k.add(this),this.H.push(this.B.clearRect.bind(this.B,0,0,this.Ta.width,this.Ta.height))},flush:function(){},translate:function(t,i){this.transform(1,0,0,1,t,i)}});r.makeRenderer=function(t){const i=new E(t),e=i.B;return new Proxy(i,{get(t,n){if("function"==typeof t[n])return function(...i){return t[n].apply(t,i)};if("function"==typeof e[n]){if(-1<l.indexOf(n))throw Error("RiveException: Method call to '"+n+"()' is not allowed, as the renderer cannot immediately pass through the return values of any canvas 2d context methods.");return function(...t){i.H.push(e[n].bind(e,...t))}}return t[n]},set(t,n,r){if(n in e)return i.H.push((()=>{e[n]=r})),!0}})},r.decodeImage=function(t,i){new w({ka:i}).decode(t)},r.renderFactory={makeRenderPaint:function(){return new x},makeRenderPath:function(){return new y},makeRenderImage:function(){let t=C;return new w({va:()=>{t.total++},ka:()=>{if(t.loaded++,t.loaded===t.total){const i=t.ready;i&&(i(),t.ready=null)}}})}};let O=r.load,C=null;r.load=function(t,i,e=!0){const n=new r.FallbackFileAssetLoader;return void 0!==i&&n.addLoader(i),e&&(i=new r.CDNFileAssetLoader,n.addLoader(i)),new Promise((function(i){let e=null;C={total:0,loaded:0,ready:function(){i(e)}},e=O(t,n),0==C.total&&i(e)}))};let $=r.RendererWrapper.prototype.align;r.RendererWrapper.prototype.align=function(t,i,e,n,r=1){$.call(this,t,i,e,n,r)},n=new h,r.requestAnimationFrame=n.requestAnimationFrame.bind(n),r.cancelAnimationFrame=n.cancelAnimationFrame.bind(n),r.enableFPSCounter=n.Nb.bind(n),r.disableFPSCounter=n.Kb,n.nb=e,r.resolveAnimationFrame=e,r.cleanup=function(){A&&A.delete()}};var p,g,m=Object.assign({},r),b="./this.program",v="";(o||a)&&(a?v=self.location.href:"undefined"!=typeof document&&document.currentScript&&(v=document.currentScript.src),n&&(v=n),v=v.startsWith("blob:")?"":v.substr(0,v.replace(/[?#].*/,"").lastIndexOf("/")+1),a&&(g=t=>{var i=new XMLHttpRequest;return i.open("GET",t,!1),i.responseType="arraybuffer",i.send(null),new Uint8Array(i.response)}),p=(t,i,e)=>{if(N(t)){var n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?i(n.response):e()},n.onerror=e,n.send(null)}else fetch(t,{credentials:"same-origin"}).then((t=>t.ok?t.arrayBuffer():Promise.reject(Error(t.status+" : "+t.url)))).then(i,e)});var w,y=r.print||console.log.bind(console),x=r.printErr||console.error.bind(console);Object.assign(r,m),m=null,r.thisProgram&&(b=r.thisProgram),r.wasmBinary&&(w=r.wasmBinary);var k,A,S,j,M,E,O,C,$,I=!1;function _(){var t=k.buffer;r.HEAP8=A=new Int8Array(t),r.HEAP16=j=new Int16Array(t),r.HEAPU8=S=new Uint8Array(t),r.HEAPU16=M=new Uint16Array(t),r.HEAP32=E=new Int32Array(t),r.HEAPU32=O=new Uint32Array(t),r.HEAPF32=C=new Float32Array(t),r.HEAPF64=$=new Float64Array(t)}var T=[],P=[],z=[];function W(){var t=r.preRun.shift();T.unshift(t)}var D=0,L=null;function F(t){throw r.onAbort?.(t),x(t="Aborted("+t+")"),I=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),e(t),t}var R,B=t=>t.startsWith("data:application/octet-stream;base64,"),N=t=>t.startsWith("file://");function U(t){if(t==R&&w)return new Uint8Array(w);if(g)return g(t);throw"both async and sync fetching of the wasm failed"}function H(t,i,e){return function(t){return w?Promise.resolve().then((()=>U(t))):new Promise(((i,e)=>{p(t,(t=>i(new Uint8Array(t))),(()=>{try{i(U(t))}catch(t){e(t)}}))}))}(t).then((t=>WebAssembly.instantiate(t,i))).then(e,(t=>{x(`failed to asynchronously prepare wasm: ${t}`),F(t)}))}var q,X,V={464256:(t,i,e,n,r)=>{if("undefined"==typeof window||void 0===(window.AudioContext||window.webkitAudioContext))return 0;if(void 0===window.h){window.h={ya:0},window.h.I={},window.h.I.wa=t,window.h.I.capture=i,window.h.I.Ja=e,window.h.fa={},window.h.fa.stopped=n,window.h.fa.vb=r;let s=window.h;s.D=[],s.rc=function(t){for(var i=0;i<s.D.length;++i)if(null==s.D[i])return s.D[i]=t,i;return s.D.push(t),s.D.length-1},s.zb=function(t){for(s.D[t]=null;0<s.D.length&&null==s.D[s.D.length-1];)s.D.pop()},s.Oc=function(t){for(var i=0;i<s.D.length;++i)if(s.D[i]==t)return s.zb(i)},s.pa=function(t){return s.D[t]},s.Ra=["touchend","click"],s.unlock=function(){for(var t=0;t<s.D.length;++t){var i=s.D[t];null!=i&&null!=i.K&&i.state===s.fa.vb&&i.K.resume().then((()=>{Ee(i.ob)}),(t=>{console.error("Failed to resume audiocontext",t)}))}s.Ra.map((function(t){document.removeEventListener(t,s.unlock,!0)}))},s.Ra.map((function(t){document.addEventListener(t,s.unlock,!0)}))}return window.h.ya+=1,1},466434:()=>{void 0!==window.h&&(window.h.Ra.map((function(t){document.removeEventListener(t,window.h.unlock,!0)})),--window.h.ya,0===window.h.ya&&delete window.h)},466738:()=>void 0!==navigator.mediaDevices&&void 0!==navigator.mediaDevices.getUserMedia,466842:()=>{try{var t=new(window.AudioContext||window.webkitAudioContext),i=t.sampleRate;return t.close(),i}catch(t){return 0}},467013:(t,i,e,n,r,s)=>{if(void 0===window.h)return-1;var o={},a={};return t==window.h.I.wa&&0!=e&&(a.sampleRate=e),o.K=new(window.AudioContext||window.webkitAudioContext)(a),o.K.suspend(),o.state=window.h.fa.stopped,e=0,t!=window.h.I.wa&&(e=i),o.Y=o.K.createScriptProcessor(n,e,i),o.Y.onaudioprocess=function(e){if(null!=o.qa&&0!=o.qa.length||(o.qa=new Float32Array(C.buffer,r,n*i)),t==window.h.I.capture||t==window.h.I.Ja){for(var a=0;a<i;a+=1)for(var h=e.inputBuffer.getChannelData(a),u=o.qa,c=0;c<n;c+=1)u[c*i+a]=h[c];Ce(s,n,r)}if(t==window.h.I.wa||t==window.h.I.Ja)for($e(s,n,r),a=0;a<e.outputBuffer.numberOfChannels;++a)for(h=e.outputBuffer.getChannelData(a),u=o.qa,c=0;c<n;c+=1)h[c]=u[c*i+a];else for(a=0;a<e.outputBuffer.numberOfChannels;++a)e.outputBuffer.getChannelData(a).fill(0)},t!=window.h.I.capture&&t!=window.h.I.Ja||navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then((function(t){o.Ba=o.K.createMediaStreamSource(t),o.Ba.connect(o.Y),o.Y.connect(o.K.destination)})).catch((function(t){console.log("Failed to get user media: "+t)})),t==window.h.I.wa&&o.Y.connect(o.K.destination),o.ob=s,window.h.rc(o)},469890:t=>window.h.pa(t).K.sampleRate,469963:t=>{void 0!==(t=window.h.pa(t)).Y&&(t.Y.onaudioprocess=function(){},t.Y.disconnect(),t.Y=void 0),void 0!==t.Ba&&(t.Ba.disconnect(),t.Ba=void 0),t.K.close(),t.K=void 0,t.ob=void 0},470363:t=>{window.h.zb(t)},470413:t=>{(t=window.h.pa(t)).K.resume(),t.state=window.h.fa.vb},470552:t=>{(t=window.h.pa(t)).K.suspend(),t.state=window.h.fa.stopped}},G=t=>{for(;0<t.length;)t.shift()(r)};function Y(){var t=E[+ti>>2];return ti+=4,t}var Z=(t,i)=>{for(var e=0,n=t.length-1;0<=n;n--){var r=t[n];"."===r?t.splice(n,1):".."===r?(t.splice(n,1),e++):e&&(t.splice(n,1),e--)}if(i)for(;e;e--)t.unshift("..");return t},K=t=>{var i="/"===t.charAt(0),e="/"===t.substr(-1);return(t=Z(t.split("/").filter((t=>!!t)),!i).join("/"))||i||(t="."),t&&e&&(t+="/"),(i?"/":"")+t},J=t=>{var i=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(t).slice(1);return t=i[0],i=i[1],t||i?(i&&=i.substr(0,i.length-1),t+i):"."},Q=t=>{if("/"===t)return"/";var i=(t=(t=K(t)).replace(/\/$/,"")).lastIndexOf("/");return-1===i?t:t.substr(i+1)},tt=t=>(tt=(()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return t=>crypto.getRandomValues(t);F("initRandomDevice")})())(t),it=(...t)=>{for(var i="",e=!1,n=t.length-1;-1<=n&&!e;n--){if("string"!=typeof(e=0<=n?t[n]:"/"))throw new TypeError("Arguments to path.resolve must be strings");if(!e)return"";i=e+"/"+i,e="/"===e.charAt(0)}return(e?"/":"")+(i=Z(i.split("/").filter((t=>!!t)),!e).join("/"))||"."},et="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0,nt=(t,i,e)=>{var n=i+e;for(e=i;t[e]&&!(e>=n);)++e;if(16<e-i&&t.buffer&&et)return et.decode(t.subarray(i,e));for(n="";i<e;){var r=t[i++];if(128&r){var s=63&t[i++];if(192==(224&r))n+=String.fromCharCode((31&r)<<6|s);else{var o=63&t[i++];65536>(r=224==(240&r)?(15&r)<<12|s<<6|o:(7&r)<<18|s<<12|o<<6|63&t[i++])?n+=String.fromCharCode(r):(r-=65536,n+=String.fromCharCode(55296|r>>10,56320|1023&r))}}else n+=String.fromCharCode(r)}return n},rt=[],st=t=>{for(var i=0,e=0;e<t.length;++e){var n=t.charCodeAt(e);127>=n?i++:2047>=n?i+=2:55296<=n&&57343>=n?(i+=4,++e):i+=3}return i},ot=(t,i,e,n)=>{if(!(0<n))return 0;var r=e;n=e+n-1;for(var s=0;s<t.length;++s){var o=t.charCodeAt(s);if(55296<=o&&57343>=o&&(o=65536+((1023&o)<<10)|1023&t.charCodeAt(++s)),127>=o){if(e>=n)break;i[e++]=o}else{if(2047>=o){if(e+1>=n)break;i[e++]=192|o>>6}else{if(65535>=o){if(e+2>=n)break;i[e++]=224|o>>12}else{if(e+3>=n)break;i[e++]=240|o>>18,i[e++]=128|o>>12&63}i[e++]=128|o>>6&63}i[e++]=128|63&o}}return i[e]=0,e-r};function at(t,i){var e=Array(st(t)+1);return t=ot(t,e,0,e.length),i&&(e.length=t),e}var ht=[];function ut(t,i){ht[t]={input:[],G:[],V:i},Dt(t,ct)}var ct={open(t){var i=ht[t.node.xa];if(!i)throw new xt(43);t.s=i,t.seekable=!1},close(t){t.s.V.oa(t.s)},oa(t){t.s.V.oa(t.s)},read(t,i,e,n){if(!t.s||!t.s.V.hb)throw new xt(60);for(var r=0,s=0;s<n;s++){try{var o=t.s.V.hb(t.s)}catch(t){throw new xt(29)}if(void 0===o&&0===r)throw new xt(6);if(null==o)break;r++,i[e+s]=o}return r&&(t.node.timestamp=Date.now()),r},write(t,i,e,n){if(!t.s||!t.s.V.Ma)throw new xt(60);try{for(var r=0;r<n;r++)t.s.V.Ma(t.s,i[e+r])}catch(t){throw new xt(29)}return n&&(t.node.timestamp=Date.now()),r}},lt={hb(){t:{if(!rt.length){var t=null;if("undefined"!=typeof window&&"function"==typeof window.prompt&&null!==(t=window.prompt("Input: "))&&(t+="\n"),!t){t=null;break t}rt=at(t,!0)}t=rt.shift()}return t},Ma(t,i){null===i||10===i?(y(nt(t.G,0)),t.G=[]):0!=i&&t.G.push(i)},oa(t){t.G&&0<t.G.length&&(y(nt(t.G,0)),t.G=[])},Xb:()=>({zc:25856,Bc:5,yc:191,Ac:35387,xc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}),Yb:()=>0,Zb:()=>[24,80]},dt={Ma(t,i){null===i||10===i?(x(nt(t.G,0)),t.G=[]):0!=i&&t.G.push(i)},oa(t){t.G&&0<t.G.length&&(x(nt(t.G,0)),t.G=[])}};function ft(t,i){var e=t.l?t.l.length:0;e>=i||(i=Math.max(i,e*(1048576>e?2:1.125)>>>0),0!=e&&(i=Math.max(i,256)),e=t.l,t.l=new Uint8Array(i),0<t.v&&t.l.set(e.subarray(0,t.v),0))}var pt={N:null,U:()=>pt.createNode(null,"/",16895,0),createNode(t,i,e,n){if(24576==(61440&e)||4096==(61440&e))throw new xt(63);return pt.N||(pt.N={dir:{node:{X:pt.j.X,P:pt.j.P,ja:pt.j.ja,ta:pt.j.ta,sb:pt.j.sb,yb:pt.j.yb,tb:pt.j.tb,rb:pt.j.rb,Ca:pt.j.Ca},stream:{aa:pt.m.aa}},file:{node:{X:pt.j.X,P:pt.j.P},stream:{aa:pt.m.aa,read:pt.m.read,write:pt.m.write,Xa:pt.m.Xa,kb:pt.m.kb,mb:pt.m.mb}},link:{node:{X:pt.j.X,P:pt.j.P,la:pt.j.la},stream:{}},$a:{node:{X:pt.j.X,P:pt.j.P},stream:Wt}}),16384==(61440&(e=Ct(t,i,e,n)).mode)?(e.j=pt.N.dir.node,e.m=pt.N.dir.stream,e.l={}):32768==(61440&e.mode)?(e.j=pt.N.file.node,e.m=pt.N.file.stream,e.v=0,e.l=null):40960==(61440&e.mode)?(e.j=pt.N.link.node,e.m=pt.N.link.stream):8192==(61440&e.mode)&&(e.j=pt.N.$a.node,e.m=pt.N.$a.stream),e.timestamp=Date.now(),t&&(t.l[i]=e,t.timestamp=e.timestamp),e},Fc:t=>t.l?t.l.subarray?t.l.subarray(0,t.v):new Uint8Array(t.l):new Uint8Array(0),j:{X(t){var i={};return i.Dc=8192==(61440&t.mode)?t.id:1,i.Hc=t.id,i.mode=t.mode,i.Kc=1,i.uid=0,i.Gc=0,i.xa=t.xa,i.size=16384==(61440&t.mode)?4096:32768==(61440&t.mode)?t.v:40960==(61440&t.mode)?t.link.length:0,i.vc=new Date(t.timestamp),i.Jc=new Date(t.timestamp),i.Cc=new Date(t.timestamp),i.Gb=4096,i.wc=Math.ceil(i.size/i.Gb),i},P(t,i){if(void 0!==i.mode&&(t.mode=i.mode),void 0!==i.timestamp&&(t.timestamp=i.timestamp),void 0!==i.size&&t.v!=(i=i.size))if(0==i)t.l=null,t.v=0;else{var e=t.l;t.l=new Uint8Array(i),e&&t.l.set(e.subarray(0,Math.min(i,t.v))),t.v=i}},ja(){throw kt[44]},ta:(t,i,e,n)=>pt.createNode(t,i,e,n),sb(t,i,e){if(16384==(61440&t.mode)){try{var n=Ot(i,e)}catch(t){}if(n)for(var r in n.l)throw new xt(55)}delete t.parent.l[t.name],t.parent.timestamp=Date.now(),t.name=e,i.l[e]=t,i.timestamp=t.parent.timestamp},yb(t,i){delete t.l[i],t.timestamp=Date.now()},tb(t,i){var e,n=Ot(t,i);for(e in n.l)throw new xt(55);delete t.l[i],t.timestamp=Date.now()},rb(t){var i,e=[".",".."];for(i of Object.keys(t.l))e.push(i);return e},Ca:(t,i,e)=>((t=pt.createNode(t,i,41471,0)).link=e,t),la(t){if(40960!=(61440&t.mode))throw new xt(28);return t.link}},m:{read(t,i,e,n,r){var s=t.node.l;if(r>=t.node.v)return 0;if(8<(t=Math.min(t.node.v-r,n))&&s.subarray)i.set(s.subarray(r,r+t),e);else for(n=0;n<t;n++)i[e+n]=s[r+n];return t},write(t,i,e,n,r,s){if(i.buffer===A.buffer&&(s=!1),!n)return 0;if((t=t.node).timestamp=Date.now(),i.subarray&&(!t.l||t.l.subarray)){if(s)return t.l=i.subarray(e,e+n),t.v=n;if(0===t.v&&0===r)return t.l=i.slice(e,e+n),t.v=n;if(r+n<=t.v)return t.l.set(i.subarray(e,e+n),r),n}if(ft(t,r+n),t.l.subarray&&i.subarray)t.l.set(i.subarray(e,e+n),r);else for(s=0;s<n;s++)t.l[r+s]=i[e+s];return t.v=Math.max(t.v,r+n),n},aa(t,i,e){if(1===e?i+=t.position:2===e&&32768==(61440&t.node.mode)&&(i+=t.node.v),0>i)throw new xt(28);return i},Xa(t,i,e){ft(t.node,i+e),t.node.v=Math.max(t.node.v,i+e)},kb(t,i,e,n,r){if(32768!=(61440&t.node.mode))throw new xt(43);if(t=t.node.l,2&r||t.buffer!==A.buffer){if((0<e||e+i<t.length)&&(t=t.subarray?t.subarray(e,e+i):Array.prototype.slice.call(t,e,e+i)),e=!0,F(),!(i=void 0))throw new xt(48);A.set(t,i)}else e=!1,i=t.byteOffset;return{o:i,uc:e}},mb:(t,i,e,n)=>(pt.m.write(t,i,0,n,e,!1),0)}},gt=null,mt={},bt=[],vt=1,wt=null,yt=!0,xt=class{constructor(t){this.name="ErrnoError",this.$=t}},kt={},At=class{constructor(){this.h={},this.node=null}get flags(){return this.h.flags}set flags(t){this.h.flags=t}get position(){return this.h.position}set position(t){this.h.position=t}},St=class{constructor(t,i,e,n){t||=this,this.parent=t,this.U=t.U,this.ua=null,this.id=vt++,this.name=i,this.mode=e,this.j={},this.m={},this.xa=n}get read(){return!(365&~this.mode)}set read(t){t?this.mode|=365:this.mode&=-366}get write(){return!(146&~this.mode)}set write(t){t?this.mode|=146:this.mode&=-147}};function jt(t,i={}){if(!(t=it(t)))return{path:"",node:null};if(8<(i=Object.assign({gb:!0,Oa:0},i)).Oa)throw new xt(32);t=t.split("/").filter((t=>!!t));for(var e=gt,n="/",r=0;r<t.length;r++){var s=r===t.length-1;if(s&&i.parent)break;if(e=Ot(e,t[r]),n=K(n+"/"+t[r]),e.ua&&(!s||s&&i.gb)&&(e=e.ua.root),!s||i.fb)for(s=0;40960==(61440&e.mode);)if(e=Ut(n),e=jt(n=it(J(n),e),{Oa:i.Oa+1}).node,40<s++)throw new xt(32)}return{path:n,node:e}}function Mt(t){for(var i;;){if(t===t.parent)return t=t.U.lb,i?"/"!==t[t.length-1]?`${t}/${i}`:t+i:t;i=i?`${t.name}/${i}`:t.name,t=t.parent}}function Et(t,i){for(var e=0,n=0;n<i.length;n++)e=(e<<5)-e+i.charCodeAt(n)|0;return(t+e>>>0)%wt.length}function Ot(t,i){var e=16384==(61440&t.mode)?(e=It(t,"x"))?e:t.j.ja?0:2:54;if(e)throw new xt(e);for(e=wt[Et(t.id,i)];e;e=e.ec)if(e.parent.id===t.id&&e.name===i)return e;return t.j.ja(t,i)}function Ct(t,i,e,n){return i=Et((t=new St(t,i,e,n)).parent.id,t.name),t.ec=wt[i],wt[i]=t}function $t(t){var i=["r","w","rw"][3&t];return 512&t&&(i+="w"),i}function It(t,i){return yt?0:!i.includes("r")||292&t.mode?i.includes("w")&&!(146&t.mode)||i.includes("x")&&!(73&t.mode)?2:0:2}function _t(t,i){try{return Ot(t,i),20}catch(t){}return It(t,"wx")}function Tt(t){if(!(t=bt[t]))throw new xt(8);return t}function Pt(t,i=-1){if(t=Object.assign(new At,t),-1==i)t:{for(i=0;4096>=i;i++)if(!bt[i])break t;throw new xt(33)}return t.W=i,bt[i]=t}var zt,Wt={open(t){t.m=mt[t.node.xa].m,t.m.open?.(t)},aa(){throw new xt(70)}};function Dt(t,i){mt[t]={m:i}}function Lt(t,i){var e="/"===i;if(e&&gt)throw new xt(10);if(!e&&i){var n=jt(i,{gb:!1});if(i=n.path,(n=n.node).ua)throw new xt(10);if(16384!=(61440&n.mode))throw new xt(54)}(t=t.U(i={type:t,Mc:{},lb:i,dc:[]})).U=i,i.root=t,e?gt=t:n&&(n.ua=i,n.U&&n.U.dc.push(i))}function Ft(t,i,e){var n=jt(t,{parent:!0}).node;if(!(t=Q(t))||"."===t||".."===t)throw new xt(28);var r=_t(n,t);if(r)throw new xt(r);if(!n.j.ta)throw new xt(63);return n.j.ta(n,t,i,e)}function Rt(t){return Ft(t,16895,0)}function Bt(t,i,e){void 0===e&&(e=i,i=438),Ft(t,8192|i,e)}function Nt(t,i){if(!it(t))throw new xt(44);var e=jt(i,{parent:!0}).node;if(!e)throw new xt(44);var n=_t(e,i=Q(i));if(n)throw new xt(n);if(!e.j.Ca)throw new xt(63);e.j.Ca(e,i,t)}function Ut(t){if(!(t=jt(t).node))throw new xt(44);if(!t.j.la)throw new xt(28);return it(Mt(t.parent),t.j.la(t))}function Ht(t,i,e){if(""===t)throw new xt(44);if("string"==typeof i){var n={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[i];if(void 0===n)throw Error(`Unknown file open mode: ${i}`);i=n}if(e=64&i?4095&(void 0===e?438:e)|32768:0,"object"==typeof t)var s=t;else{t=K(t);try{s=jt(t,{fb:!(131072&i)}).node}catch(t){}}if(n=!1,64&i)if(s){if(128&i)throw new xt(20)}else s=Ft(t,e,0),n=!0;if(!s)throw new xt(44);if(8192==(61440&s.mode)&&(i&=-513),65536&i&&16384!=(61440&s.mode))throw new xt(54);if(!n&&(e=s?40960==(61440&s.mode)?32:16384==(61440&s.mode)&&("r"!==$t(i)||512&i)?31:It(s,$t(i)):44))throw new xt(e);if(512&i&&!n){if(!(e="string"==typeof(e=s)?jt(e,{fb:!0}).node:e).j.P)throw new xt(63);if(16384==(61440&e.mode))throw new xt(31);if(32768!=(61440&e.mode))throw new xt(28);if(n=It(e,"w"))throw new xt(n);e.j.P(e,{size:0,timestamp:Date.now()})}return i&=-131713,(s=Pt({node:s,path:Mt(s),flags:i,seekable:!0,position:0,m:s.m,sc:[],error:!1})).m.open&&s.m.open(s),!r.logReadFiles||1&i||(Gt||={},t in Gt||(Gt[t]=1)),s}function qt(t,i,e){if(null===t.W)throw new xt(8);if(!t.seekable||!t.m.aa)throw new xt(70);if(0!=e&&1!=e&&2!=e)throw new xt(28);t.position=t.m.aa(t,i,e),t.sc=[]}function Xt(t,i,e){t=K("/dev/"+t);var n=((t,i)=>{var e=0;return t&&(e|=365),i&&(e|=146),e})(!!i,!!e);Vt||=64;var r=Vt++<<8;Dt(r,{open(t){t.seekable=!1},close(){e?.buffer?.length&&e(10)},read(t,e,n,r){for(var s=0,o=0;o<r;o++){try{var a=i()}catch(t){throw new xt(29)}if(void 0===a&&0===s)throw new xt(6);if(null==a)break;s++,e[n+o]=a}return s&&(t.node.timestamp=Date.now()),s},write(t,i,n,r){for(var s=0;s<r;s++)try{e(i[n+s])}catch(t){throw new xt(29)}return r&&(t.node.timestamp=Date.now()),s}}),Bt(t,n,r)}var Vt,Gt,Yt,Zt,Kt,Jt,Qt,ti=void 0,ii=(t,i)=>Object.defineProperty(i,"name",{value:t}),ei=[],ni=[],ri=t=>{if(!t)throw new Yt("Cannot use deleted val. handle = "+t);return ni[t]},si=t=>{switch(t){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:const i=ei.pop()||ni.length;return ni[i]=t,ni[i+1]=1,i}},oi=t=>{var i=Error,e=ii(t,(function(i){this.name=t,this.message=i,void 0!==(i=Error(i).stack)&&(this.stack=this.toString()+"\n"+i.replace(/^Error(:[^\n]*)?\n/,""))}));return e.prototype=Object.create(i.prototype),e.prototype.constructor=e,e.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},e},ai=t=>{for(var i="";S[t];)i+=Kt[S[t++]];return i},hi=[],ui=()=>{for(;hi.length;){var t=hi.pop();t.g.ea=!1,t.delete()}},ci={},li=(t,i)=>{if(void 0===i)throw new Yt("ptr should not be undefined");for(;t.C;)i=t.ma(i),t=t.C;return i},di={},fi=t=>{t=Me(t);var i=ai(t);return Se(t),i},pi=(t,i)=>{var e=di[t];if(void 0===e)throw t=`${i} has unknown type ${fi(t)}`,new Yt(t);return e},gi=()=>{},mi=!1,bi=(t,i,e)=>i===e?t:void 0===e.C||null===(t=bi(t,i,e.C))?null:e.Lb(t),vi={},wi=(t,i)=>{if(!i.u||!i.o)throw new Qt("makeClassHandle requires ptr and ptrType");if(!!i.J!=!!i.F)throw new Qt("Both smartPtrType and smartPtr must be specified");return i.count={value:1},yi(Object.create(t,{g:{value:i,writable:!0}}))},yi=t=>"undefined"==typeof FinalizationRegistry?(yi=t=>t,t):(mi=new FinalizationRegistry((t=>{--(t=t.g).count.value,0===t.count.value&&(t.F?t.J.O(t.F):t.u.i.O(t.o))})),gi=t=>{mi.unregister(t)},(yi=t=>{var i=t.g;return i.F&&mi.register(t,{g:i},t),t})(t)),xi={},ki=t=>{for(;t.length;){var i=t.pop();t.pop()(i)}};function Ai(t){return this.fromWireType(O[t>>2])}var Si={},ji={},Mi=(t,i,e)=>{function n(i){if((i=e(i)).length!==t.length)throw new Qt("Mismatched type converter count");for(var n=0;n<t.length;++n)Ei(t[n],i[n])}t.forEach((function(t){ji[t]=i}));var r=Array(i.length),s=[],o=0;i.forEach(((t,i)=>{di.hasOwnProperty(t)?r[i]=di[t]:(s.push(t),Si.hasOwnProperty(t)||(Si[t]=[]),Si[t].push((()=>{r[i]=di[t],++o===s.length&&n(r)})))})),0===s.length&&n(r)};function Ei(t,i,e={}){if(!("argPackAdvance"in i))throw new TypeError("registerType registeredInstance requires argPackAdvance");return function(t,i,e={}){var n=i.name;if(!t)throw new Yt(`type "${n}" must have a positive integer typeid pointer`);if(di.hasOwnProperty(t)){if(e.Vb)return;throw new Yt(`Cannot register type '${n}' twice`)}di[t]=i,delete ji[t],Si.hasOwnProperty(t)&&(i=Si[t],delete Si[t],i.forEach((t=>t())))}(t,i,e)}var Oi=t=>{throw new Yt(t.g.u.i.name+" instance already deleted")};function Ci(){}var $i=(t,i,e)=>{if(void 0===t[i].A){var n=t[i];t[i]=function(...n){if(!t[i].A.hasOwnProperty(n.length))throw new Yt(`Function '${e}' called with an invalid number of arguments (${n.length}) - expects one of (${t[i].A})!`);return t[i].A[n.length].apply(this,n)},t[i].A=[],t[i].A[n.da]=n}},Ii=(t,i,e)=>{if(r.hasOwnProperty(t)){if(void 0===e||void 0!==r[t].A&&void 0!==r[t].A[e])throw new Yt(`Cannot register public name '${t}' twice`);if($i(r,t,t),r.hasOwnProperty(e))throw new Yt(`Cannot register multiple overloads of a function with the same number of arguments (${e})!`);r[t].A[e]=i}else r[t]=i,void 0!==e&&(r[t].Lc=e)};function _i(t,i,e,n,r,s,o,a){this.name=t,this.constructor=i,this.M=e,this.O=n,this.C=r,this.Qb=s,this.ma=o,this.Lb=a,this.pb=[]}var Ti=(t,i,e)=>{for(;i!==e;){if(!i.ma)throw new Yt(`Expected null or instance of ${e.name}, got an instance of ${i.name}`);t=i.ma(t),i=i.C}return t};function Pi(t,i){if(null===i){if(this.La)throw new Yt(`null is not a valid ${this.name}`);return 0}if(!i.g)throw new Yt(`Cannot pass "${Qi(i)}" as a ${this.name}`);if(!i.g.o)throw new Yt(`Cannot pass deleted object as a pointer of type ${this.name}`);return Ti(i.g.o,i.g.u.i,this.i)}function zi(t,i){if(null===i){if(this.La)throw new Yt(`null is not a valid ${this.name}`);if(this.sa){var e=this.Na();return null!==t&&t.push(this.O,e),e}return 0}if(!i||!i.g)throw new Yt(`Cannot pass "${Qi(i)}" as a ${this.name}`);if(!i.g.o)throw new Yt(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.ra&&i.g.u.ra)throw new Yt(`Cannot convert argument of type ${i.g.J?i.g.J.name:i.g.u.name} to parameter type ${this.name}`);if(e=Ti(i.g.o,i.g.u.i,this.i),this.sa){if(void 0===i.g.F)throw new Yt("Passing raw pointer to smart pointer is illegal");switch(this.mc){case 0:if(i.g.J!==this)throw new Yt(`Cannot convert argument of type ${i.g.J?i.g.J.name:i.g.u.name} to parameter type ${this.name}`);e=i.g.F;break;case 1:e=i.g.F;break;case 2:if(i.g.J===this)e=i.g.F;else{var n=i.clone();e=this.ic(e,si((()=>n.delete()))),null!==t&&t.push(this.O,e)}break;default:throw new Yt("Unsupporting sharing policy")}}return e}function Wi(t,i){if(null===i){if(this.La)throw new Yt(`null is not a valid ${this.name}`);return 0}if(!i.g)throw new Yt(`Cannot pass "${Qi(i)}" as a ${this.name}`);if(!i.g.o)throw new Yt(`Cannot pass deleted object as a pointer of type ${this.name}`);if(i.g.u.ra)throw new Yt(`Cannot convert argument of type ${i.g.u.name} to parameter type ${this.name}`);return Ti(i.g.o,i.g.u.i,this.i)}function Di(t,i,e,n,r,s,o,a,h,u,c){this.name=t,this.i=i,this.La=e,this.ra=n,this.sa=r,this.hc=s,this.mc=o,this.qb=a,this.Na=h,this.ic=u,this.O=c,r||void 0!==i.C?this.toWireType=zi:(this.toWireType=n?Pi:Wi,this.L=null)}var Li,Fi,Ri=(t,i,e)=>{if(!r.hasOwnProperty(t))throw new Qt("Replacing nonexistent public symbol");void 0!==r[t].A&&void 0!==e?r[t].A[e]=i:(r[t]=i,r[t].da=e)},Bi=[],Ni=t=>{var i=Bi[t];return i||(t>=Bi.length&&(Bi.length=t+1),Bi[t]=i=Li.get(t)),i},Ui=(t,i)=>{var e=(t=ai(t)).includes("j")?((t,i)=>(...e)=>((t,i,e=[])=>(t.includes("j")?(t=t.replace(/p/g,"i"),i=(0,r["dynCall_"+t])(i,...e)):i=Ni(i)(...e),i))(t,i,e))(t,i):Ni(i);if("function"!=typeof e)throw new Yt(`unknown function pointer with signature ${t}: ${i}`);return e},Hi=(t,i)=>{var e=[],n={};throw i.forEach((function t(i){n[i]||di[i]||(ji[i]?ji[i].forEach(t):(e.push(i),n[i]=!0))})),new Fi(`${t}: `+e.map(fi).join([", "]))};function qi(t,i,e,n,r){var s=i.length;if(2>s)throw new Yt("argTypes array size mismatch! Must at least get return value and 'this' types!");var o=null!==i[1]&&null!==e,a=function(t){for(var i=1;i<t.length;++i)if(null!==t[i]&&void 0===t[i].L)return!0;return!1}(i),h="void"!==i[0].name,u=s-2,c=Array(u),l=[],d=[];return ii(t,(function(...e){if(e.length!==u)throw new Yt(`function ${t} called with ${e.length} arguments, expected ${u}`);if(d.length=0,l.length=o?2:1,l[0]=r,o){var s=i[1].toWireType(d,this);l[1]=s}for(var f=0;f<u;++f)c[f]=i[f+2].toWireType(d,e[f]),l.push(c[f]);if(e=n(...l),a)ki(d);else for(f=o?1:2;f<i.length;f++)null!==i[f].L&&i[f].L(1===f?s:c[f-2]);return h?i[0].fromWireType(e):void 0}))}var Xi,Vi=(t,i)=>{for(var e=[],n=0;n<t;n++)e.push(O[i+4*n>>2]);return e},Gi=t=>{const i=(t=t.trim()).indexOf("(");return-1!==i?t.substr(0,i):t},Yi=(t,i,e)=>{if(!(t instanceof Object))throw new Yt(`${e} with invalid "this": ${t}`);if(!(t instanceof i.i.constructor))throw new Yt(`${e} incompatible with "this" of type ${t.constructor.name}`);if(!t.g.o)throw new Yt(`cannot call emscripten binding method ${e} on deleted object`);return Ti(t.g.o,t.g.u.i,i.i)},Zi=t=>{9<t&&0==--ni[t+1]&&(ni[t]=void 0,ei.push(t))},Ki={name:"emscripten::val",fromWireType:t=>{var i=ri(t);return Zi(t),i},toWireType:(t,i)=>si(i),argPackAdvance:8,readValueFromPointer:Ai,L:null},Ji=(t,i,e)=>{switch(i){case 1:return e?function(t){return this.fromWireType(A[t])}:function(t){return this.fromWireType(S[t])};case 2:return e?function(t){return this.fromWireType(j[t>>1])}:function(t){return this.fromWireType(M[t>>1])};case 4:return e?function(t){return this.fromWireType(E[t>>2])}:function(t){return this.fromWireType(O[t>>2])};default:throw new TypeError(`invalid integer width (${i}): ${t}`)}},Qi=t=>{if(null===t)return"null";var i=typeof t;return"object"===i||"array"===i||"function"===i?t.toString():""+t},te=(t,i)=>{switch(i){case 4:return function(t){return this.fromWireType(C[t>>2])};case 8:return function(t){return this.fromWireType($[t>>3])};default:throw new TypeError(`invalid float width (${i}): ${t}`)}},ie=(t,i,e)=>{switch(i){case 1:return e?t=>A[t]:t=>S[t];case 2:return e?t=>j[t>>1]:t=>M[t>>1];case 4:return e?t=>E[t>>2]:t=>O[t>>2];default:throw new TypeError(`invalid integer width (${i}): ${t}`)}},ee="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,ne=(t,i)=>{for(var e=t>>1,n=e+i/2;!(e>=n)&&M[e];)++e;if(32<(e<<=1)-t&&ee)return ee.decode(S.subarray(t,e));for(e="",n=0;!(n>=i/2);++n){var r=j[t+2*n>>1];if(0==r)break;e+=String.fromCharCode(r)}return e},re=(t,i,e)=>{if(e??=2147483647,2>e)return 0;var n=i;e=(e-=2)<2*t.length?e/2:t.length;for(var r=0;r<e;++r)j[i>>1]=t.charCodeAt(r),i+=2;return j[i>>1]=0,i-n},se=t=>2*t.length,oe=(t,i)=>{for(var e=0,n="";!(e>=i/4);){var r=E[t+4*e>>2];if(0==r)break;++e,65536<=r?(r-=65536,n+=String.fromCharCode(55296|r>>10,56320|1023&r)):n+=String.fromCharCode(r)}return n},ae=(t,i,e)=>{if(e??=2147483647,4>e)return 0;var n=i;e=n+e-4;for(var r=0;r<t.length;++r){var s=t.charCodeAt(r);if(55296<=s&&57343>=s&&(s=65536+((1023&s)<<10)|1023&t.charCodeAt(++r)),E[i>>2]=s,(i+=4)+4>e)break}return E[i>>2]=0,i-n},he=t=>{for(var i=0,e=0;e<t.length;++e){var n=t.charCodeAt(e);55296<=n&&57343>=n&&++e,i+=4}return i},ue=(t,i,e)=>{var n=[];return t=t.toWireType(n,e),n.length&&(O[i>>2]=si(n)),t},ce={},le=t=>{var i=ce[t];return void 0===i?ai(t):i},de=[],fe=Reflect.construct,pe=[],ge={},me=()=>{if(!Xi){var t,i={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:b||"./this.program"};for(t in ge)void 0===ge[t]?delete i[t]:i[t]=ge[t];var e=[];for(t in i)e.push(`${t}=${i[t]}`);Xi=e}return Xi},be=t=>0==t%4&&(0!=t%100||0==t%400),ve=[31,29,31,30,31,30,31,31,30,31,30,31],we=[31,28,31,30,31,30,31,31,30,31,30,31];[44].forEach((t=>{kt[t]=new xt(t),kt[t].stack="<generic error, no stack>"})),wt=Array(4096),Lt(pt,"/"),Rt("/tmp"),Rt("/home"),Rt("/home/web_user"),function(){Rt("/dev"),Dt(259,{read:()=>0,write:(t,i,e,n)=>n}),Bt("/dev/null",259),ut(1280,lt),ut(1536,dt),Bt("/dev/tty",1280),Bt("/dev/tty1",1536);var t=new Uint8Array(1024),i=0,e=()=>(0===i&&(i=tt(t).byteLength),t[--i]);Xt("random",e),Xt("urandom",e),Rt("/dev/shm"),Rt("/dev/shm/tmp")}(),function(){Rt("/proc");var t=Rt("/proc/self");Rt("/proc/self/fd"),Lt({U(){var i=Ct(t,"fd",16895,73);return i.j={ja(t,i){var e=Tt(+i);return(t={parent:null,U:{lb:"fake"},j:{la:()=>e.path}}).parent=t}},i}},"/proc/self/fd")}(),Yt=r.BindingError=class extends Error{constructor(t){super(t),this.name="BindingError"}},ni.push(0,1,void 0,1,null,1,!0,1,!1,1),r.count_emval_handles=()=>ni.length/2-5-ei.length,Zt=r.PureVirtualError=oi("PureVirtualError");for(var ye=Array(256),xe=0;256>xe;++xe)ye[xe]=String.fromCharCode(xe);Kt=ye,r.getInheritedInstanceCount=()=>Object.keys(ci).length,r.getLiveInheritedInstances=()=>{var t,i=[];for(t in ci)ci.hasOwnProperty(t)&&i.push(ci[t]);return i},r.flushPendingDeletes=ui,r.setDelayFunction=t=>{Jt=t,hi.length&&Jt&&Jt(ui)},Qt=r.InternalError=class extends Error{constructor(t){super(t),this.name="InternalError"}},Object.assign(Ci.prototype,{isAliasOf:function(t){if(!(this instanceof Ci&&t instanceof Ci))return!1;var i=this.g.u.i,e=this.g.o;t.g=t.g;var n=t.g.u.i;for(t=t.g.o;i.C;)e=i.ma(e),i=i.C;for(;n.C;)t=n.ma(t),n=n.C;return i===n&&e===t},clone:function(){if(this.g.o||Oi(this),this.g.ha)return this.g.count.value+=1,this;var t=yi,i=Object,e=i.create,n=Object.getPrototypeOf(this),r=this.g;return(t=t(e.call(i,n,{g:{value:{count:r.count,ea:r.ea,ha:r.ha,o:r.o,u:r.u,F:r.F,J:r.J}}}))).g.count.value+=1,t.g.ea=!1,t},delete(){if(this.g.o||Oi(this),this.g.ea&&!this.g.ha)throw new Yt("Object already scheduled for deletion");gi(this);var t=this.g;--t.count.value,0===t.count.value&&(t.F?t.J.O(t.F):t.u.i.O(t.o)),this.g.ha||(this.g.F=void 0,this.g.o=void 0)},isDeleted:function(){return!this.g.o},deleteLater:function(){if(this.g.o||Oi(this),this.g.ea&&!this.g.ha)throw new Yt("Object already scheduled for deletion");return hi.push(this),1===hi.length&&Jt&&Jt(ui),this.g.ea=!0,this}}),Object.assign(Di.prototype,{Rb(t){return this.qb&&(t=this.qb(t)),t},ab(t){this.O?.(t)},argPackAdvance:8,readValueFromPointer:Ai,fromWireType:function(t){function i(){return wi(this.i.M,this.sa?{u:this.hc,o:e,J:this,F:t}:{u:this,o:t})}var e=this.Rb(t);if(!e)return this.ab(t),null;var n=((t,i)=>(i=li(this.i,i),ci[i]))(0,e);if(void 0!==n)return 0===n.g.count.value?(n.g.o=e,n.g.F=t,n.clone()):(n=n.clone(),this.ab(t),n);if(n=this.i.Qb(e),!(n=vi[n]))return i.call(this);var r=bi(e,this.i,(n=this.ra?n.Hb:n.pointerType).i);return null===r?i.call(this):wi(n.i.M,this.sa?{u:n,o:r,J:this,F:t}:{u:n,o:r})}}),Fi=r.UnboundTypeError=oi("UnboundTypeError");var ke={__syscall_fcntl64:function(t,i,e){ti=e;try{var n=Tt(t);switch(i){case 0:var r=Y();if(0>r)break;for(;bt[r];)r++;return function(t,i=-1){return t=Pt(t,i),t.m?.Ec?.(t),t}(n,r).W;case 1:case 2:case 13:case 14:return 0;case 3:return n.flags;case 4:return r=Y(),n.flags|=r,0;case 12:return r=Y(),j[r+0>>1]=2,0}return-28}catch(t){if("ErrnoError"!==t.name)throw t;return-t.$}},__syscall_ioctl:function(t,i,e){ti=e;try{var n=Tt(t);switch(i){case 21509:case 21510:case 21511:case 21512:case 21524:case 21515:return n.s?0:-59;case 21505:if(!n.s)return-59;if(n.s.V.Xb){t=[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];var r=Y();E[r>>2]=25856,E[r+4>>2]=5,E[r+8>>2]=191,E[r+12>>2]=35387;for(var s=0;32>s;s++)A[r+s+17]=t[s]||0}return 0;case 21506:case 21507:case 21508:if(!n.s)return-59;if(n.s.V.Yb)for(r=Y(),t=[],s=0;32>s;s++)t.push(A[r+s+17]);return 0;case 21519:return n.s?(r=Y(),E[r>>2]=0):-59;case 21520:return n.s?-28:-59;case 21531:if(r=Y(),!n.m.Wb)throw new xt(59);return n.m.Wb(n,i,r);case 21523:return n.s?(n.s.V.Zb&&(s=[24,80],r=Y(),j[r>>1]=s[0],j[r+2>>1]=s[1]),0):-59;default:return-28}}catch(t){if("ErrnoError"!==t.name)throw t;return-t.$}},__syscall_openat:function(t,i,e,n){ti=n;try{var r=i=i?nt(S,i):"";if("/"===r.charAt(0))i=r;else{var s=-100===t?"/":Tt(t).path;if(0==r.length)throw new xt(44);i=K(s+"/"+r)}return Ht(i,e,n?Y():0).W}catch(t){if("ErrnoError"!==t.name)throw t;return-t.$}},_abort_js:()=>{F("")},_embind_create_inheriting_constructor:(t,i,e)=>{t=ai(t),i=pi(i,"wrapper"),e=ri(e);var n=i.i,r=n.M,s=n.C.M,o=n.C.constructor;return t=ii(t,(function(...t){n.C.pb.forEach(function(t){if(this[t]===s[t])throw new Zt(`Pure virtual function ${t} must be implemented in JavaScript`)}.bind(this)),Object.defineProperty(this,"__parent",{value:r}),this.__construct(...t)})),r.__construct=function(...t){if(this===r)throw new Yt("Pass correct 'this' to __construct");t=o.implement(this,...t),gi(t);var i=t.g;if(t.notifyOnDestruction(),i.ha=!0,Object.defineProperties(this,{g:{value:i}}),yi(this),t=li(n,t=i.o),ci.hasOwnProperty(t))throw new Yt(`Tried to register registered instance: ${t}`);ci[t]=this},r.__destruct=function(){if(this===r)throw new Yt("Pass correct 'this' to __destruct");gi(this);var t=this.g.o;if(t=li(n,t),!ci.hasOwnProperty(t))throw new Yt(`Tried to unregister unregistered instance: ${t}`);delete ci[t]},t.prototype=Object.create(r),Object.assign(t.prototype,e),si(t)},_embind_finalize_value_object:t=>{var i=xi[t];delete xi[t];var e=i.Na,n=i.O,r=i.eb,s=r.map((t=>t.Ub)).concat(r.map((t=>t.kc)));Mi([t],s,(t=>{var s={};return r.forEach(((i,e)=>{var n=t[e],o=i.Sb,a=i.Tb,h=t[e+r.length],u=i.jc,c=i.lc;s[i.Ob]={read:t=>n.fromWireType(o(a,t)),write:(t,i)=>{var e=[];u(c,t,h.toWireType(e,i)),ki(e)}}})),[{name:i.name,fromWireType:t=>{var i,e={};for(i in s)e[i]=s[i].read(t);return n(t),e},toWireType:(t,i)=>{for(var r in s)if(!(r in i))throw new TypeError(`Missing field: "${r}"`);var o=e();for(r in s)s[r].write(o,i[r]);return null!==t&&t.push(n,o),o},argPackAdvance:8,readValueFromPointer:Ai,L:n}]}))},_embind_register_bigint:()=>{},_embind_register_bool:(t,i,e,n)=>{Ei(t,{name:i=ai(i),fromWireType:function(t){return!!t},toWireType:function(t,i){return i?e:n},argPackAdvance:8,readValueFromPointer:function(t){return this.fromWireType(S[t])},L:null})},_embind_register_class:(t,i,e,n,r,s,o,a,h,u,c,l,d)=>{c=ai(c),s=Ui(r,s),a&&=Ui(o,a),u&&=Ui(h,u),d=Ui(l,d);var f=(t=>{if(void 0===t)return"_unknown";var i=(t=t.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return 48<=i&&57>=i?`_${t}`:t})(c);Ii(f,(function(){Hi(`Cannot construct ${c} due to unbound types`,[n])})),Mi([t,i,e],n?[n]:[],(i=>{if(i=i[0],n)var e=i.i,r=e.M;else r=Ci.prototype;i=ii(c,(function(...t){if(Object.getPrototypeOf(this)!==o)throw new Yt("Use 'new' to construct "+c);if(void 0===l.Z)throw new Yt(c+" has no accessible constructor");var i=l.Z[t.length];if(void 0===i)throw new Yt(`Tried to invoke ctor of ${c} with invalid number of parameters (${t.length}) - expected (${Object.keys(l.Z).toString()}) parameters instead!`);return i.apply(this,t)}));var o=Object.create(r,{constructor:{value:i}});i.prototype=o;var h,l=new _i(c,i,o,d,e,s,a,u);return l.C&&((h=l.C).na??(h.na=[]),l.C.na.push(l)),e=new Di(c,l,!0,!1,!1),h=new Di(c+"*",l,!1,!1,!1),r=new Di(c+" const*",l,!1,!0,!1),vi[t]={pointerType:h,Hb:r},Ri(f,i),[e,h,r]}))},_embind_register_class_class_function:(t,i,e,n,r,s,o)=>{var a=Vi(e,n);i=ai(i),i=Gi(i),s=Ui(r,s),Mi([],[t],(t=>{function n(){Hi(`Cannot call ${r} due to unbound types`,a)}var r=`${(t=t[0]).name}.${i}`;i.startsWith("@@")&&(i=Symbol[i.substring(2)]);var h=t.i.constructor;return void 0===h[i]?(n.da=e-1,h[i]=n):($i(h,i,r),h[i].A[e-1]=n),Mi([],a,(n=>{if(n=qi(r,[n[0],null].concat(n.slice(1)),null,s,o),void 0===h[i].A?(n.da=e-1,h[i]=n):h[i].A[e-1]=n,t.i.na)for(const e of t.i.na)e.constructor.hasOwnProperty(i)||(e.constructor[i]=n);return[]})),[]}))},_embind_register_class_class_property:(t,i,e,n,r,s,o,a)=>{i=ai(i),s=Ui(r,s),Mi([],[t],(t=>{var r=`${(t=t[0]).name}.${i}`,h={get(){Hi(`Cannot access ${r} due to unbound types`,[e])},enumerable:!0,configurable:!0};return h.set=a?()=>{Hi(`Cannot access ${r} due to unbound types`,[e])}:()=>{throw new Yt(`${r} is a read-only property`)},Object.defineProperty(t.i.constructor,i,h),Mi([],[e],(e=>{e=e[0];var r={get:()=>e.fromWireType(s(n)),enumerable:!0};return a&&(a=Ui(o,a),r.set=t=>{var i=[];a(n,e.toWireType(i,t)),ki(i)}),Object.defineProperty(t.i.constructor,i,r),[]})),[]}))},_embind_register_class_constructor:(t,i,e,n,r,s)=>{var o=Vi(i,e);r=Ui(n,r),Mi([],[t],(t=>{var e=`constructor ${(t=t[0]).name}`;if(void 0===t.i.Z&&(t.i.Z=[]),void 0!==t.i.Z[i-1])throw new Yt(`Cannot register multiple constructors with identical number of parameters (${i-1}) for class '${t.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return t.i.Z[i-1]=()=>{Hi(`Cannot construct ${t.name} due to unbound types`,o)},Mi([],o,(n=>(n.splice(1,0,null),t.i.Z[i-1]=qi(e,n,null,r,s),[]))),[]}))},_embind_register_class_function:(t,i,e,n,r,s,o,a)=>{var h=Vi(e,n);i=ai(i),i=Gi(i),s=Ui(r,s),Mi([],[t],(t=>{function n(){Hi(`Cannot call ${r} due to unbound types`,h)}var r=`${(t=t[0]).name}.${i}`;i.startsWith("@@")&&(i=Symbol[i.substring(2)]),a&&t.i.pb.push(i);var u=t.i.M,c=u[i];return void 0===c||void 0===c.A&&c.className!==t.name&&c.da===e-2?(n.da=e-2,n.className=t.name,u[i]=n):($i(u,i,r),u[i].A[e-2]=n),Mi([],h,(n=>(n=qi(r,n,t,s,o),void 0===u[i].A?(n.da=e-2,u[i]=n):u[i].A[e-2]=n,[]))),[]}))},_embind_register_class_property:(t,i,e,n,r,s,o,a,h,u)=>{i=ai(i),r=Ui(n,r),Mi([],[t],(t=>{var n=`${(t=t[0]).name}.${i}`,c={get(){Hi(`Cannot access ${n} due to unbound types`,[e,o])},enumerable:!0,configurable:!0};return c.set=h?()=>Hi(`Cannot access ${n} due to unbound types`,[e,o]):()=>{throw new Yt(n+" is a read-only property")},Object.defineProperty(t.i.M,i,c),Mi([],h?[e,o]:[e],(e=>{var o=e[0],c={get(){var i=Yi(this,t,n+" getter");return o.fromWireType(r(s,i))},enumerable:!0};if(h){h=Ui(a,h);var l=e[1];c.set=function(i){var e=Yi(this,t,n+" setter"),r=[];h(u,e,l.toWireType(r,i)),ki(r)}}return Object.defineProperty(t.i.M,i,c),[]})),[]}))},_embind_register_emval:t=>Ei(t,Ki),_embind_register_enum:(t,i,e,n)=>{function r(){}i=ai(i),r.values={},Ei(t,{name:i,constructor:r,fromWireType:function(t){return this.constructor.values[t]},toWireType:(t,i)=>i.value,argPackAdvance:8,readValueFromPointer:Ji(i,e,n),L:null}),Ii(i,r)},_embind_register_enum_value:(t,i,e)=>{var n=pi(t,"enum");i=ai(i),t=n.constructor,n=Object.create(n.constructor.prototype,{value:{value:e},constructor:{value:ii(`${n.name}_${i}`,(function(){}))}}),t.values[e]=n,t[i]=n},_embind_register_float:(t,i,e)=>{Ei(t,{name:i=ai(i),fromWireType:t=>t,toWireType:(t,i)=>i,argPackAdvance:8,readValueFromPointer:te(i,e),L:null})},_embind_register_function:(t,i,e,n,r,s)=>{var o=Vi(i,e);t=ai(t),t=Gi(t),r=Ui(n,r),Ii(t,(function(){Hi(`Cannot call ${t} due to unbound types`,o)}),i-1),Mi([],o,(e=>(Ri(t,qi(t,[e[0],null].concat(e.slice(1)),null,r,s),i-1),[])))},_embind_register_integer:(t,i,e,n,r)=>{if(i=ai(i),-1===r&&(r=4294967295),r=t=>t,0===n){var s=32-8*e;r=t=>t<<s>>>s}var o=i.includes("unsigned")?function(t,i){return i>>>0}:function(t,i){return i};Ei(t,{name:i,fromWireType:r,toWireType:o,argPackAdvance:8,readValueFromPointer:ie(i,e,0!==n),L:null})},_embind_register_memory_view:(t,i,e)=>{function n(t){return new r(A.buffer,O[t+4>>2],O[t>>2])}var r=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][i];Ei(t,{name:e=ai(e),fromWireType:n,argPackAdvance:8,readValueFromPointer:n},{Vb:!0})},_embind_register_std_string:(t,i)=>{var e="std::string"===(i=ai(i));Ei(t,{name:i,fromWireType:function(t){var i=O[t>>2],n=t+4;if(e)for(var r=n,s=0;s<=i;++s){var o=n+s;if(s==i||0==S[o]){if(r=r?nt(S,r,o-r):"",void 0===a)var a=r;else a+=String.fromCharCode(0),a+=r;r=o+1}}else{for(a=Array(i),s=0;s<i;++s)a[s]=String.fromCharCode(S[n+s]);a=a.join("")}return Se(t),a},toWireType:function(t,i){i instanceof ArrayBuffer&&(i=new Uint8Array(i));var n="string"==typeof i;if(!(n||i instanceof Uint8Array||i instanceof Uint8ClampedArray||i instanceof Int8Array))throw new Yt("Cannot pass non-string to std::string");var r=e&&n?st(i):i.length,s=je(4+r+1),o=s+4;if(O[s>>2]=r,e&&n)ot(i,S,o,r+1);else if(n)for(n=0;n<r;++n){var a=i.charCodeAt(n);if(255<a)throw Se(o),new Yt("String has UTF-16 code units that do not fit in 8 bits");S[o+n]=a}else for(n=0;n<r;++n)S[o+n]=i[n];return null!==t&&t.push(Se,s),s},argPackAdvance:8,readValueFromPointer:Ai,L(t){Se(t)}})},_embind_register_std_wstring:(t,i,e)=>{if(e=ai(e),2===i)var n=ne,r=re,s=se,o=t=>M[t>>1];else 4===i&&(n=oe,r=ae,s=he,o=t=>O[t>>2]);Ei(t,{name:e,fromWireType:t=>{for(var e,r=O[t>>2],s=t+4,a=0;a<=r;++a){var h=t+4+a*i;a!=r&&0!=o(h)||(s=n(s,h-s),void 0===e?e=s:(e+=String.fromCharCode(0),e+=s),s=h+i)}return Se(t),e},toWireType:(t,n)=>{if("string"!=typeof n)throw new Yt(`Cannot pass non-string to C++ string type ${e}`);var o=s(n),a=je(4+o+i);return O[a>>2]=o/i,r(n,a+4,o+i),null!==t&&t.push(Se,a),a},argPackAdvance:8,readValueFromPointer:Ai,L(t){Se(t)}})},_embind_register_value_object:(t,i,e,n,r,s)=>{xi[t]={name:ai(i),Na:Ui(e,n),O:Ui(r,s),eb:[]}},_embind_register_value_object_field:(t,i,e,n,r,s,o,a,h,u)=>{xi[t].eb.push({Ob:ai(i),Ub:e,Sb:Ui(n,r),Tb:s,kc:o,jc:Ui(a,h),lc:u})},_embind_register_void:(t,i)=>{Ei(t,{Ic:!0,name:i=ai(i),argPackAdvance:0,fromWireType:()=>{},toWireType:()=>{}})},_emscripten_get_now_is_monotonic:()=>1,_emscripten_memcpy_js:(t,i,e)=>S.copyWithin(t,i,i+e),_emval_as:(t,i,e)=>(t=ri(t),i=pi(i,"emval::as"),ue(i,e,t)),_emval_call_method:(t,i,e,n,r)=>(t=de[t])(i=ri(i),i[e=le(e)],n,r),_emval_decref:Zi,_emval_get_method_caller:(t,i,e)=>{var n=((t,i)=>{for(var e=Array(t),n=0;n<t;++n)e[n]=pi(O[i+4*n>>2],"parameter "+n);return e})(t,i),r=n.shift();t--;var s=Array(t);return i=`methodCaller<(${n.map((t=>t.name)).join(", ")}) => ${r.name}>`,(t=>{var i=de.length;return de.push(t),i})(ii(i,((i,o,a,h)=>{for(var u=0,c=0;c<t;++c)s[c]=n[c].readValueFromPointer(h+u),u+=n[c].argPackAdvance;return i=1===e?fe(o,s):o.apply(i,s),ue(r,a,i)})))},_emval_get_module_property:t=>(t=le(t),si(r[t])),_emval_get_property:(t,i)=>(t=ri(t),i=ri(i),si(t[i])),_emval_incref:t=>{9<t&&(ni[t+1]+=1)},_emval_new_array:()=>si([]),_emval_new_cstring:t=>si(le(t)),_emval_new_object:()=>si({}),_emval_run_destructors:t=>{var i=ri(t);ki(i),Zi(t)},_emval_set_property:(t,i,e)=>{t=ri(t),i=ri(i),e=ri(e),t[i]=e},_emval_take_value:(t,i)=>(t=(t=pi(t,"_emval_take_value")).readValueFromPointer(i),si(t)),emscripten_asm_const_int:(t,i,e)=>{pe.length=0;for(var n;n=S[i++];){var r=105!=n;e+=(r&=112!=n)&&e%8?4:0,pe.push(112==n?O[e>>2]:105==n?E[e>>2]:$[e>>3]),e+=r?8:4}return V[t](...pe)},emscripten_date_now:()=>Date.now(),emscripten_get_now:()=>performance.now(),emscripten_resize_heap:t=>{var i=S.length;if(2147483648<(t>>>=0))return!1;for(var e=1;4>=e;e*=2){var n=i*(1+.2/e);n=Math.min(n,t+100663296);var r=Math;n=Math.max(t,n);t:{r=(r.min.call(r,2147483648,n+(65536-n%65536)%65536)-k.buffer.byteLength+65535)/65536;try{k.grow(r),_();var s=1;break t}catch(t){}s=void 0}if(s)return!0}return!1},environ_get:(t,i)=>{var e=0;return me().forEach(((n,r)=>{var s=i+e;for(r=O[t+4*r>>2]=s,s=0;s<n.length;++s)A[r++]=n.charCodeAt(s);A[r]=0,e+=n.length+1})),0},environ_sizes_get:(t,i)=>{var e=me();O[t>>2]=e.length;var n=0;return e.forEach((t=>n+=t.length+1)),O[i>>2]=n,0},fd_close:function(t){try{var i=Tt(t);if(null===i.W)throw new xt(8);i.Ka&&(i.Ka=null);try{i.m.close&&i.m.close(i)}catch(t){throw t}finally{bt[i.W]=null}return i.W=null,0}catch(t){if("ErrnoError"!==t.name)throw t;return t.$}},fd_read:function(t,i,e,n){try{t:{var r=Tt(t);t=i;for(var s,o=i=0;o<e;o++){var a=O[t>>2],h=O[t+4>>2];t+=8;var u=r,c=s,l=A;if(0>h||0>c)throw new xt(28);if(null===u.W)throw new xt(8);if(1==(2097155&u.flags))throw new xt(8);if(16384==(61440&u.node.mode))throw new xt(31);if(!u.m.read)throw new xt(28);var d=void 0!==c;if(d){if(!u.seekable)throw new xt(70)}else c=u.position;var f=u.m.read(u,l,a,h,c);d||(u.position+=f);var p=f;if(0>p){var g=-1;break t}if(i+=p,p<h)break;void 0!==s&&(s+=p)}g=i}return O[n>>2]=g,0}catch(t){if("ErrnoError"!==t.name)throw t;return t.$}},fd_seek:function(t,i,e,n,r){i=e+2097152>>>0<4194305-!!i?(i>>>0)+4294967296*e:NaN;try{if(isNaN(i))return 61;var s=Tt(t);return qt(s,i,n),X=[s.position>>>0,(q=s.position,1<=+Math.abs(q)?0<q?+Math.floor(q/4294967296)>>>0:~~+Math.ceil((q-+(~~q>>>0))/4294967296)>>>0:0)],E[r>>2]=X[0],E[r+4>>2]=X[1],s.Ka&&0===i&&0===n&&(s.Ka=null),0}catch(t){if("ErrnoError"!==t.name)throw t;return t.$}},fd_write:function(t,i,e,n){try{t:{var r=Tt(t);t=i;for(var s,o=i=0;o<e;o++){var a=O[t>>2],h=O[t+4>>2];t+=8;var u=r,c=a,l=h,d=s,f=A;if(0>l||0>d)throw new xt(28);if(null===u.W)throw new xt(8);if(!(2097155&u.flags))throw new xt(8);if(16384==(61440&u.node.mode))throw new xt(31);if(!u.m.write)throw new xt(28);u.seekable&&1024&u.flags&&qt(u,0,2);var p=void 0!==d;if(p){if(!u.seekable)throw new xt(70)}else d=u.position;var g=u.m.write(u,f,c,l,d,void 0);p||(u.position+=g);var m=g;if(0>m){var b=-1;break t}i+=m,void 0!==s&&(s+=m)}b=i}return O[n>>2]=b,0}catch(t){if("ErrnoError"!==t.name)throw t;return t.$}},strftime_l:(t,i,e,n)=>((t,i,e,n)=>{function r(t,i,e){for(t="number"==typeof t?t.toString():t||"";t.length<i;)t=e[0]+t;return t}function s(t,i){return r(t,i,"0")}function o(t,i){function e(t){return 0>t?-1:0<t?1:0}var n;return 0===(n=e(t.getFullYear()-i.getFullYear()))&&0===(n=e(t.getMonth()-i.getMonth()))&&(n=e(t.getDate()-i.getDate())),n}function a(t){switch(t.getDay()){case 0:return new Date(t.getFullYear()-1,11,29);case 1:return t;case 2:return new Date(t.getFullYear(),0,3);case 3:return new Date(t.getFullYear(),0,2);case 4:return new Date(t.getFullYear(),0,1);case 5:return new Date(t.getFullYear()-1,11,31);case 6:return new Date(t.getFullYear()-1,11,30)}}function h(t){var i=t.ba;for(t=new Date(new Date(t.ca+1900,0,1).getTime());0<i;){var e=t.getMonth(),n=(be(t.getFullYear())?ve:we)[e];if(!(i>n-t.getDate())){t.setDate(t.getDate()+i);break}i-=n-t.getDate()+1,t.setDate(1),11>e?t.setMonth(e+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return e=new Date(t.getFullYear()+1,0,4),i=a(new Date(t.getFullYear(),0,4)),e=a(e),0>=o(i,t)?0>=o(e,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var u=O[n+40>>2];for(var c in n={pc:E[n>>2],oc:E[n+4>>2],Da:E[n+8>>2],Qa:E[n+12>>2],Ea:E[n+16>>2],ca:E[n+20>>2],R:E[n+24>>2],ba:E[n+28>>2],Nc:E[n+32>>2],nc:E[n+36>>2],qc:u&&u?nt(S,u):""},e=e?nt(S,e):"",u={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})e=e.replace(new RegExp(c,"g"),u[c]);var l="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),d="January February March April May June July August September October November December".split(" ");for(c in u={"%a":t=>l[t.R].substring(0,3),"%A":t=>l[t.R],"%b":t=>d[t.Ea].substring(0,3),"%B":t=>d[t.Ea],"%C":t=>s((t.ca+1900)/100|0,2),"%d":t=>s(t.Qa,2),"%e":t=>r(t.Qa,2," "),"%g":t=>h(t).toString().substring(2),"%G":h,"%H":t=>s(t.Da,2),"%I":t=>(0==(t=t.Da)?t=12:12<t&&(t-=12),s(t,2)),"%j":t=>{for(var i=0,e=0;e<=t.Ea-1;i+=(be(t.ca+1900)?ve:we)[e++]);return s(t.Qa+i,3)},"%m":t=>s(t.Ea+1,2),"%M":t=>s(t.oc,2),"%n":()=>"\n","%p":t=>0<=t.Da&&12>t.Da?"AM":"PM","%S":t=>s(t.pc,2),"%t":()=>"\t","%u":t=>t.R||7,"%U":t=>s(Math.floor((t.ba+7-t.R)/7),2),"%V":t=>{var i=Math.floor((t.ba+7-(t.R+6)%7)/7);if(2>=(t.R+371-t.ba-2)%7&&i++,i)53==i&&(4==(e=(t.R+371-t.ba)%7)||3==e&&be(t.ca)||(i=1));else{i=52;var e=(t.R+7-t.ba-1)%7;(4==e||5==e&&be(t.ca%400-1))&&i++}return s(i,2)},"%w":t=>t.R,"%W":t=>s(Math.floor((t.ba+7-(t.R+6)%7)/7),2),"%y":t=>(t.ca+1900).toString().substring(2),"%Y":t=>t.ca+1900,"%z":t=>{var i=0<=(t=t.nc);return t=Math.abs(t)/60,(i?"+":"-")+String("0000"+(t/60*100+t%60)).slice(-4)},"%Z":t=>t.qc,"%%":()=>"%"},e=e.replace(/%%/g,"\0\0"),u)e.includes(c)&&(e=e.replace(new RegExp(c,"g"),u[c](n)));return(c=at(e=e.replace(/\0\0/g,"%"),!1)).length>i?0:(A.set(c,t),c.length-1)})(t,i,e,n)},Ae=function(){function t(t){return k=(Ae=t.exports).memory,_(),Li=Ae.__indirect_function_table,P.unshift(Ae.__wasm_call_ctors),D--,r.monitorRunDependencies?.(D),0==D&&L&&(t=L,L=null,t()),Ae}var i={env:ke,wasi_snapshot_preview1:ke};if(D++,r.monitorRunDependencies?.(D),r.instantiateWasm)try{return r.instantiateWasm(i,t)}catch(t){x(`Module.instantiateWasm callback failed with error: ${t}`),e(t)}return R||=B("canvas_advanced.wasm")?"canvas_advanced.wasm":r.locateFile?r.locateFile("canvas_advanced.wasm",v):v+"canvas_advanced.wasm",function(t,i){var e=R;return w||"function"!=typeof WebAssembly.instantiateStreaming||B(e)||N(e)||"function"!=typeof fetch?H(e,t,i):fetch(e,{credentials:"same-origin"}).then((n=>WebAssembly.instantiateStreaming(n,t).then(i,(function(n){return x(`wasm streaming compile failed: ${n}`),x("falling back to ArrayBuffer instantiation"),H(e,t,i)}))))}(i,(function(i){t(i.instance)})).catch(e),{}}(),Se=t=>(Se=Ae.free)(t),je=t=>(je=Ae.malloc)(t),Me=t=>(Me=Ae.__getTypeName)(t),Ee=r._ma_device__on_notification_unlocked=t=>(Ee=r._ma_device__on_notification_unlocked=Ae.ma_device__on_notification_unlocked)(t);r._ma_malloc_emscripten=(t,i)=>(r._ma_malloc_emscripten=Ae.ma_malloc_emscripten)(t,i),r._ma_free_emscripten=(t,i)=>(r._ma_free_emscripten=Ae.ma_free_emscripten)(t,i);var Oe,Ce=r._ma_device_process_pcm_frames_capture__webaudio=(t,i,e)=>(Ce=r._ma_device_process_pcm_frames_capture__webaudio=Ae.ma_device_process_pcm_frames_capture__webaudio)(t,i,e),$e=r._ma_device_process_pcm_frames_playback__webaudio=(t,i,e)=>($e=r._ma_device_process_pcm_frames_playback__webaudio=Ae.ma_device_process_pcm_frames_playback__webaudio)(t,i,e);function Ie(){function t(){if(!Oe&&(Oe=!0,r.calledRun=!0,!I)){if(r.noFSInit||zt||(zt=!0,r.stdin=r.stdin,r.stdout=r.stdout,r.stderr=r.stderr,r.stdin?Xt("stdin",r.stdin):Nt("/dev/tty","/dev/stdin"),r.stdout?Xt("stdout",null,r.stdout):Nt("/dev/tty","/dev/stdout"),r.stderr?Xt("stderr",null,r.stderr):Nt("/dev/tty1","/dev/stderr"),Ht("/dev/stdin",0),Ht("/dev/stdout",1),Ht("/dev/stderr",1)),yt=!1,G(P),i(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),r.postRun)for("function"==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;){var t=r.postRun.shift();z.unshift(t)}G(z)}}if(!(0<D)){if(r.preRun)for("function"==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;)W();G(T),0<D||(r.setStatus?(r.setStatus("Running..."),setTimeout((function(){setTimeout((function(){r.setStatus("")}),1),t()}),1)):t())}}if(r.dynCall_iiji=(t,i,e,n,s)=>(r.dynCall_iiji=Ae.dynCall_iiji)(t,i,e,n,s),r.dynCall_jiji=(t,i,e,n,s)=>(r.dynCall_jiji=Ae.dynCall_jiji)(t,i,e,n,s),r.dynCall_iiiji=(t,i,e,n,s,o)=>(r.dynCall_iiiji=Ae.dynCall_iiiji)(t,i,e,n,s,o),r.dynCall_iij=(t,i,e,n)=>(r.dynCall_iij=Ae.dynCall_iij)(t,i,e,n),r.dynCall_jii=(t,i,e)=>(r.dynCall_jii=Ae.dynCall_jii)(t,i,e),r.dynCall_viijii=(t,i,e,n,s,o,a)=>(r.dynCall_viijii=Ae.dynCall_viijii)(t,i,e,n,s,o,a),r.dynCall_iiiiij=(t,i,e,n,s,o,a)=>(r.dynCall_iiiiij=Ae.dynCall_iiiiij)(t,i,e,n,s,o,a),r.dynCall_iiiiijj=(t,i,e,n,s,o,a,h,u)=>(r.dynCall_iiiiijj=Ae.dynCall_iiiiijj)(t,i,e,n,s,o,a,h,u),r.dynCall_iiiiiijj=(t,i,e,n,s,o,a,h,u,c)=>(r.dynCall_iiiiiijj=Ae.dynCall_iiiiiijj)(t,i,e,n,s,o,a,h,u,c),L=function t(){Oe||Ie(),Oe||(L=t)},r.preInit)for("function"==typeof r.preInit&&(r.preInit=[r.preInit]);0<r.preInit.length;)r.preInit.pop()();return Ie(),s})},t=>{t.exports=JSON.parse('{"name":"@rive-app/canvas","version":"2.32.0","description":"Rive\'s canvas based web api.","main":"rive.js","homepage":"https://rive.app","repository":{"type":"git","url":"https://github.com/rive-app/rive-wasm/tree/master/js"},"keywords":["rive","animation"],"author":"Rive","contributors":["Luigi Rosso <luigi@rive.app> (https://rive.app)","Maxwell Talbot <max@rive.app> (https://rive.app)","Arthur Vivian <arthur@rive.app> (https://rive.app)","Umberto Sonnino <umberto@rive.app> (https://rive.app)","Matthew Sullivan <matt.j.sullivan@gmail.com> (mailto:matt.j.sullivan@gmail.com)"],"license":"MIT","files":["rive.js","rive.js.map","rive.wasm","rive_fallback.wasm","rive.d.ts","rive_advanced.mjs.d.ts"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}')},(t,i,e)=>{e.r(i),e.d(i,{Animation:()=>n.Animation});var n=e(4)},(t,i,e)=>{e.r(i),e.d(i,{Animation:()=>n});var n=function(){function t(t,i,e,n){this.animation=t,this.artboard=i,this.playing=n,this.loopCount=0,this.scrubTo=null,this.instance=new e.LinearAnimationInstance(t,i)}return Object.defineProperty(t.prototype,"name",{get:function(){return this.animation.name},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time",{get:function(){return this.instance.time},set:function(t){this.instance.time=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"loopValue",{get:function(){return this.animation.loopValue},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"needsScrub",{get:function(){return null!==this.scrubTo},enumerable:!1,configurable:!0}),t.prototype.advance=function(t){null===this.scrubTo?this.instance.advance(t):(this.instance.time=0,this.instance.advance(this.scrubTo),this.scrubTo=null)},t.prototype.apply=function(t){this.instance.apply(t)},t.prototype.cleanup=function(){this.instance.delete()},t}()},(t,i,e)=>{e.r(i),e.d(i,{AudioAssetWrapper:()=>s.AudioAssetWrapper,AudioWrapper:()=>s.AudioWrapper,BLANK_URL:()=>r.BLANK_URL,CustomFileAssetLoaderWrapper:()=>s.CustomFileAssetLoaderWrapper,FileAssetWrapper:()=>s.FileAssetWrapper,FileFinalizer:()=>s.FileFinalizer,FontAssetWrapper:()=>s.FontAssetWrapper,FontWrapper:()=>s.FontWrapper,ImageAssetWrapper:()=>s.ImageAssetWrapper,ImageWrapper:()=>s.ImageWrapper,createFinalization:()=>s.createFinalization,finalizationRegistry:()=>s.finalizationRegistry,registerTouchInteractions:()=>n.registerTouchInteractions,sanitizeUrl:()=>r.sanitizeUrl});var n=e(6),r=e(7),s=e(8)},(t,i,e)=>{e.r(i),e.d(i,{registerTouchInteractions:()=>n});var n=function(t){var i=t.canvas,e=t.artboard,n=t.stateMachines,r=void 0===n?[]:n,s=t.rive,o=t.fit,a=t.alignment,h=t.isTouchScrollEnabled,u=void 0!==h&&h,c=t.dispatchPointerExit,l=void 0===c||c,d=t.enableMultiTouch,f=void 0!==d&&d,p=t.layoutScaleFactor,g=void 0===p?1:p;if(!(i&&r.length&&t.renderer&&s&&e&&"undefined"!=typeof window))return null;var m=null,b=!1,v=function(t){if(b&&t instanceof MouseEvent)"mouseup"==t.type&&(b=!1);else{b=u&&"touchend"===t.type&&"touchstart"===m,m=t.type;var i=t.currentTarget.getBoundingClientRect(),n=function(t,i,e){var n,r,s=[];if(["touchstart","touchmove"].indexOf(t.type)>-1&&(null===(n=t.changedTouches)||void 0===n?void 0:n.length)){i||t.preventDefault();for(var o=0,a=e?t.changedTouches.length:1;o<a;)s.push({clientX:(h=t.changedTouches[o]).clientX,clientY:h.clientY,identifier:h.identifier}),o++}else if("touchend"===t.type&&(null===(r=t.changedTouches)||void 0===r?void 0:r.length))for(o=0,a=e?t.changedTouches.length:1;o<a;){var h;s.push({clientX:(h=t.changedTouches[o]).clientX,clientY:h.clientY,identifier:h.identifier}),o++}else s.push({clientX:t.clientX,clientY:t.clientY,identifier:0});return s}(t,u,f),h=s.computeAlignment(o,a,{minX:0,minY:0,maxX:i.width,maxY:i.height},e.bounds,g),c=new s.Mat2D;switch(h.invert(c),n.forEach((function(t){var e=t.clientX,n=t.clientY;if(e||n){var r=new s.Vec2D(e-i.left,n-i.top),o=s.mapXY(c,r),a=o.x(),h=o.y();t.transformedX=a,t.transformedY=h,o.delete(),r.delete()}})),c.delete(),h.delete(),t.type){case"mouseout":for(var d=function(t){n.forEach(l?function(i){t.pointerExit(i.transformedX,i.transformedY,i.identifier)}:function(i){t.pointerMove(i.transformedX,i.transformedY,i.identifier)})},p=0,v=r;p<v.length;p++)d(v[p]);break;case"touchmove":case"mouseover":case"mousemove":for(var w=function(t){n.forEach((function(i){t.pointerMove(i.transformedX,i.transformedY,i.identifier)}))},y=0,x=r;y<x.length;y++)w(x[y]);break;case"touchstart":case"mousedown":for(var k=function(t){n.forEach((function(i){t.pointerDown(i.transformedX,i.transformedY,i.identifier)}))},A=0,S=r;A<S.length;A++)k(S[A]);break;case"touchend":for(var j=function(t){n.forEach((function(i){t.pointerUp(i.transformedX,i.transformedY,i.identifier),t.pointerExit(i.transformedX,i.transformedY,i.identifier)}))},M=0,E=r;M<E.length;M++)j(E[M]);break;case"mouseup":for(var O=function(t){n.forEach((function(i){t.pointerUp(i.transformedX,i.transformedY,i.identifier)}))},C=0,$=r;C<$.length;C++)O($[C])}}}.bind(void 0);return i.addEventListener("mouseover",v),i.addEventListener("mouseout",v),i.addEventListener("mousemove",v),i.addEventListener("mousedown",v),i.addEventListener("mouseup",v),i.addEventListener("touchmove",v,{passive:u}),i.addEventListener("touchstart",v,{passive:u}),i.addEventListener("touchend",v),function(){i.removeEventListener("mouseover",v),i.removeEventListener("mouseout",v),i.removeEventListener("mousemove",v),i.removeEventListener("mousedown",v),i.removeEventListener("mouseup",v),i.removeEventListener("touchmove",v),i.removeEventListener("touchstart",v),i.removeEventListener("touchend",v)}}},(t,i,e)=>{e.r(i),e.d(i,{BLANK_URL:()=>u,sanitizeUrl:()=>c});var n=/^([^\w]*)(javascript|data|vbscript)/im,r=/&#(\w+)(^\w|;)?/g,s=/&(newline|tab);/gi,o=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,a=/^.+(:|&colon;)/gim,h=[".","/"],u="about:blank";function c(t){if(!t)return u;var i,e=(i=t,i.replace(o,"").replace(r,(function(t,i){return String.fromCharCode(i)}))).replace(s,"").replace(o,"").trim();if(!e)return u;if(function(t){return h.indexOf(t[0])>-1}(e))return e;var c=e.match(a);return c&&n.test(c[0])?u:e}},(t,i,e)=>{e.r(i),e.d(i,{AudioAssetWrapper:()=>p,AudioWrapper:()=>u,CustomFileAssetLoaderWrapper:()=>l,FileAssetWrapper:()=>d,FileFinalizer:()=>s,FontAssetWrapper:()=>g,FontWrapper:()=>c,ImageAssetWrapper:()=>f,ImageWrapper:()=>h,createFinalization:()=>v,finalizationRegistry:()=>b});var n,r=(n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var e in i)Object.prototype.hasOwnProperty.call(i,e)&&(t[e]=i[e])},n(t,i)},function(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function e(){this.constructor=t}n(t,i),t.prototype=null===i?Object.create(i):(e.prototype=i.prototype,new e)}),s=function(){function t(t){this.selfUnref=!1,this._file=t}return t.prototype.unref=function(){this._file&&this._file.unref()},t}(),o=function(){function t(t){this._finalizableObject=t}return t.prototype.unref=function(){this._finalizableObject.unref()},t}(),a=function(){function t(){this.selfUnref=!1}return t.prototype.unref=function(){},t}(),h=function(t){function i(i){var e=t.call(this)||this;return e._nativeImage=i,e}return r(i,t),Object.defineProperty(i.prototype,"nativeImage",{get:function(){return this._nativeImage},enumerable:!1,configurable:!0}),i.prototype.unref=function(){this.selfUnref&&this._nativeImage.unref()},i}(a),u=function(t){function i(i){var e=t.call(this)||this;return e._nativeAudio=i,e}return r(i,t),Object.defineProperty(i.prototype,"nativeAudio",{get:function(){return this._nativeAudio},enumerable:!1,configurable:!0}),i.prototype.unref=function(){this.selfUnref&&this._nativeAudio.unref()},i}(a),c=function(t){function i(i){var e=t.call(this)||this;return e._nativeFont=i,e}return r(i,t),Object.defineProperty(i.prototype,"nativeFont",{get:function(){return this._nativeFont},enumerable:!1,configurable:!0}),i.prototype.unref=function(){this.selfUnref&&this._nativeFont.unref()},i}(a),l=function(){function t(t,i){this._assetLoaderCallback=i,this.assetLoader=new t.CustomFileAssetLoader({loadContents:this.loadContents.bind(this)})}return t.prototype.loadContents=function(t,i){var e;return t.isImage?e=new f(t):t.isAudio?e=new p(t):t.isFont&&(e=new g(t)),this._assetLoaderCallback(e,i)},t}(),d=function(){function t(t){this._nativeFileAsset=t}return t.prototype.decode=function(t){this._nativeFileAsset.decode(t)},Object.defineProperty(t.prototype,"name",{get:function(){return this._nativeFileAsset.name},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fileExtension",{get:function(){return this._nativeFileAsset.fileExtension},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"uniqueFilename",{get:function(){return this._nativeFileAsset.uniqueFilename},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isAudio",{get:function(){return this._nativeFileAsset.isAudio},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isImage",{get:function(){return this._nativeFileAsset.isImage},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFont",{get:function(){return this._nativeFileAsset.isFont},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cdnUuid",{get:function(){return this._nativeFileAsset.cdnUuid},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nativeFileAsset",{get:function(){return this._nativeFileAsset},enumerable:!1,configurable:!0}),t}(),f=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return r(i,t),i.prototype.setRenderImage=function(t){this._nativeFileAsset.setRenderImage(t.nativeImage)},i}(d),p=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return r(i,t),i.prototype.setAudioSource=function(t){this._nativeFileAsset.setAudioSource(t.nativeAudio)},i}(d),g=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return r(i,t),i.prototype.setFont=function(t){this._nativeFileAsset.setFont(t.nativeFont)},i}(d),m=function(){function t(){}return t.prototype.register=function(t){t.selfUnref=!0},t.prototype.unregister=function(){},t}(),b=new("undefined"!=typeof FinalizationRegistry?FinalizationRegistry:m)((function(t){null==t||t.unref()})),v=function(t,i){var e=new o(i);b.register(t,e)}}],i={};function e(n){var r=i[n];if(void 0!==r)return r.exports;var s=i[n]={exports:{}};return t[n](s,s.exports,e),s.exports}e.d=(t,i)=>{for(var n in i)e.o(i,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:i[n]})},e.o=(t,i)=>Object.prototype.hasOwnProperty.call(t,i),e.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{e.r(n),e.d(n,{Alignment:()=>r,DataEnum:()=>L,EventType:()=>y,Fit:()=>i,Layout:()=>m,LoopType:()=>x,Rive:()=>W,RiveEventType:()=>v,RiveFile:()=>z,RuntimeLoader:()=>b,StateMachineInput:()=>w,StateMachineInputType:()=>g,Testing:()=>J,ViewModel:()=>D,ViewModelInstance:()=>F,ViewModelInstanceArtboard:()=>Y,ViewModelInstanceAssetImage:()=>G,ViewModelInstanceBoolean:()=>U,ViewModelInstanceColor:()=>V,ViewModelInstanceEnum:()=>q,ViewModelInstanceList:()=>X,ViewModelInstanceNumber:()=>N,ViewModelInstanceString:()=>B,ViewModelInstanceTrigger:()=>H,ViewModelInstanceValue:()=>R,decodeAudio:()=>Q,decodeFont:()=>it,decodeImage:()=>tt});var t,i,r,s=e(1),o=e(2),a=e(3),h=e(5),u=(t=function(i,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var e in i)Object.prototype.hasOwnProperty.call(i,e)&&(t[e]=i[e])},t(i,e)},function(i,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=i}t(i,e),i.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),c=function(){return c=Object.assign||function(t){for(var i,e=1,n=arguments.length;e<n;e++)for(var r in i=arguments[e])Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r]);return t},c.apply(this,arguments)},l=function(t,i,e,n){return new(e||(e=Promise))((function(r,s){function o(t){try{h(n.next(t))}catch(t){s(t)}}function a(t){try{h(n.throw(t))}catch(t){s(t)}}function h(t){var i;t.done?r(t.value):(i=t.value,i instanceof e?i:new e((function(t){t(i)}))).then(o,a)}h((n=n.apply(t,i||[])).next())}))},d=function(t,i){var e,n,r,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(h){return function(a){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(e=1,n&&(r=2&a[0]?n.return:a[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,a[1])).done)return r;switch(n=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((r=(r=s.trys).length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){s.label=a[1];break}if(6===a[0]&&s.label<r[1]){s.label=r[1],r=a;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(a);break}r[2]&&s.ops.pop(),s.trys.pop();continue}a=i.call(t,s)}catch(t){a=[6,t],n=0}finally{e=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,h])}}},f=function(t,i,e){if(e||2===arguments.length)for(var n,r=0,s=i.length;r<s;r++)!n&&r in i||(n||(n=Array.prototype.slice.call(i,0,r)),n[r]=i[r]);return t.concat(n||Array.prototype.slice.call(i))},p=function(t){function i(){var i=null!==t&&t.apply(this,arguments)||this;return i.isHandledError=!0,i}return u(i,t),i}(Error);!function(t){t.Cover="cover",t.Contain="contain",t.Fill="fill",t.FitWidth="fitWidth",t.FitHeight="fitHeight",t.None="none",t.ScaleDown="scaleDown",t.Layout="layout"}(i||(i={})),function(t){t.Center="center",t.TopLeft="topLeft",t.TopCenter="topCenter",t.TopRight="topRight",t.CenterLeft="centerLeft",t.CenterRight="centerRight",t.BottomLeft="bottomLeft",t.BottomCenter="bottomCenter",t.BottomRight="bottomRight"}(r||(r={}));var g,m=function(){function t(t){var e,n,s,o,a,h,u;this.fit=null!==(e=null==t?void 0:t.fit)&&void 0!==e?e:i.Contain,this.alignment=null!==(n=null==t?void 0:t.alignment)&&void 0!==n?n:r.Center,this.layoutScaleFactor=null!==(s=null==t?void 0:t.layoutScaleFactor)&&void 0!==s?s:1,this.minX=null!==(o=null==t?void 0:t.minX)&&void 0!==o?o:0,this.minY=null!==(a=null==t?void 0:t.minY)&&void 0!==a?a:0,this.maxX=null!==(h=null==t?void 0:t.maxX)&&void 0!==h?h:0,this.maxY=null!==(u=null==t?void 0:t.maxY)&&void 0!==u?u:0}return t.new=function(i){var e=i.fit,n=i.alignment,r=i.minX,s=i.minY,o=i.maxX,a=i.maxY;return console.warn("This function is deprecated: please use `new Layout({})` instead"),new t({fit:e,alignment:n,minX:r,minY:s,maxX:o,maxY:a})},t.prototype.copyWith=function(i){var e=i.fit,n=i.alignment,r=i.layoutScaleFactor,s=i.minX,o=i.minY,a=i.maxX,h=i.maxY;return new t({fit:null!=e?e:this.fit,alignment:null!=n?n:this.alignment,layoutScaleFactor:null!=r?r:this.layoutScaleFactor,minX:null!=s?s:this.minX,minY:null!=o?o:this.minY,maxX:null!=a?a:this.maxX,maxY:null!=h?h:this.maxY})},t.prototype.runtimeFit=function(t){return this.cachedRuntimeFit?this.cachedRuntimeFit:(this.cachedRuntimeFit=e=this.fit===i.Cover?t.Fit.cover:this.fit===i.Contain?t.Fit.contain:this.fit===i.Fill?t.Fit.fill:this.fit===i.FitWidth?t.Fit.fitWidth:this.fit===i.FitHeight?t.Fit.fitHeight:this.fit===i.ScaleDown?t.Fit.scaleDown:this.fit===i.Layout?t.Fit.layout:t.Fit.none,e);var e},t.prototype.runtimeAlignment=function(t){return this.cachedRuntimeAlignment?this.cachedRuntimeAlignment:(this.cachedRuntimeAlignment=i=this.alignment===r.TopLeft?t.Alignment.topLeft:this.alignment===r.TopCenter?t.Alignment.topCenter:this.alignment===r.TopRight?t.Alignment.topRight:this.alignment===r.CenterLeft?t.Alignment.centerLeft:this.alignment===r.CenterRight?t.Alignment.centerRight:this.alignment===r.BottomLeft?t.Alignment.bottomLeft:this.alignment===r.BottomCenter?t.Alignment.bottomCenter:this.alignment===r.BottomRight?t.Alignment.bottomRight:t.Alignment.center,i);var i},t}(),b=function(){function t(){}return t.loadRuntime=function(){s.default({locateFile:function(){return t.wasmURL}}).then((function(i){var e;for(t.runtime=i;t.callBackQueue.length>0;)null===(e=t.callBackQueue.shift())||void 0===e||e(t.runtime)})).catch((function(i){var e={message:(null==i?void 0:i.message)||"Unknown error",type:(null==i?void 0:i.name)||"Error",wasmError:i instanceof WebAssembly.CompileError||i instanceof WebAssembly.RuntimeError,originalError:i};console.debug("Rive WASM load error details:",e);var n="https://cdn.jsdelivr.net/npm/".concat(o.name,"@").concat(o.version,"/rive_fallback.wasm");if(t.wasmURL.toLowerCase()!==n)console.warn("Failed to load WASM from ".concat(t.wasmURL," (").concat(e.message,"), trying jsdelivr as a backup")),t.setWasmUrl(n),t.loadRuntime();else{var r=["Could not load Rive WASM file from ".concat(t.wasmURL," or ").concat(n,"."),"Possible reasons:","- Network connection is down","- WebAssembly is not supported in this environment","- The WASM file is corrupted or incompatible","\nError details:","- Type: ".concat(e.type),"- Message: ".concat(e.message),"- WebAssembly-specific error: ".concat(e.wasmError),"\nTo resolve, you may need to:","1. Check your network connection","2. Set a new WASM source via RuntimeLoader.setWasmUrl()","3. Call RuntimeLoader.loadRuntime() again"].join("\n");console.error(r)}}))},t.getInstance=function(i){t.isLoading||(t.isLoading=!0,t.loadRuntime()),t.runtime?i(t.runtime):t.callBackQueue.push(i)},t.awaitInstance=function(){return new Promise((function(i){return t.getInstance((function(t){return i(t)}))}))},t.setWasmUrl=function(i){t.wasmURL=i},t.getWasmUrl=function(){return t.wasmURL},t.isLoading=!1,t.callBackQueue=[],t.wasmURL="https://unpkg.com/".concat(o.name,"@").concat(o.version,"/rive.wasm"),t}();!function(t){t[t.Number=56]="Number",t[t.Trigger=58]="Trigger",t[t.Boolean=59]="Boolean"}(g||(g={}));var v,w=function(){function t(t,i){this.type=t,this.runtimeInput=i}return Object.defineProperty(t.prototype,"name",{get:function(){return this.runtimeInput.name},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.runtimeInput.value},set:function(t){this.runtimeInput.value=t},enumerable:!1,configurable:!0}),t.prototype.fire=function(){this.type===g.Trigger&&this.runtimeInput.fire()},t.prototype.delete=function(){this.runtimeInput=null},t}();!function(t){t[t.General=128]="General",t[t.OpenUrl=131]="OpenUrl"}(v||(v={}));var y,x,k=function(t){this.isBindableArtboard=!1,this.isBindableArtboard=t},A=function(t){function i(i,e){var n=t.call(this,!1)||this;return n.nativeArtboard=i,n.file=e,n}return u(i,t),i}(k),S=function(t){function i(i){var e=t.call(this,!0)||this;return e.selfUnref=!1,e.nativeArtboard=i,e}return u(i,t),i.prototype.destroy=function(){this.selfUnref&&this.nativeArtboard.unref()},i}(k),j=function(){function t(t,i,e,n){this.stateMachine=t,this.playing=e,this.artboard=n,this.inputs=[],this.instance=new i.StateMachineInstance(t,n),this.initInputs(i)}return Object.defineProperty(t.prototype,"name",{get:function(){return this.stateMachine.name},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"statesChanged",{get:function(){for(var t=[],i=0;i<this.instance.stateChangedCount();i++)t.push(this.instance.stateChangedNameByIndex(i));return t},enumerable:!1,configurable:!0}),t.prototype.advance=function(t){this.instance.advance(t)},t.prototype.advanceAndApply=function(t){this.instance.advanceAndApply(t)},t.prototype.reportedEventCount=function(){return this.instance.reportedEventCount()},t.prototype.reportedEventAt=function(t){return this.instance.reportedEventAt(t)},t.prototype.initInputs=function(t){for(var i=0;i<this.instance.inputCount();i++){var e=this.instance.input(i);this.inputs.push(this.mapRuntimeInput(e,t))}},t.prototype.mapRuntimeInput=function(t,i){return t.type===i.SMIInput.bool?new w(g.Boolean,t.asBool()):t.type===i.SMIInput.number?new w(g.Number,t.asNumber()):t.type===i.SMIInput.trigger?new w(g.Trigger,t.asTrigger()):void 0},t.prototype.cleanup=function(){this.inputs.forEach((function(t){t.delete()})),this.inputs.length=0,this.instance.delete()},t.prototype.bindViewModelInstance=function(t){null!=t.runtimeInstance&&this.instance.bindViewModelInstance(t.runtimeInstance)},t}(),M=function(){function t(t,i,e,n,r){void 0===n&&(n=[]),void 0===r&&(r=[]),this.runtime=t,this.artboard=i,this.eventManager=e,this.animations=n,this.stateMachines=r}return t.prototype.add=function(t,i,e){if(void 0===e&&(e=!0),0===(t=K(t)).length)this.animations.forEach((function(t){return t.playing=i})),this.stateMachines.forEach((function(t){return t.playing=i}));else for(var n=this.animations.map((function(t){return t.name})),r=this.stateMachines.map((function(t){return t.name})),s=0;s<t.length;s++){var o=n.indexOf(t[s]),h=r.indexOf(t[s]);if(o>=0||h>=0)o>=0?this.animations[o].playing=i:this.stateMachines[h].playing=i;else{var u=this.artboard.animationByName(t[s]);if(u){var c=new a.Animation(u,this.artboard,this.runtime,i);c.advance(0),c.apply(1),this.animations.push(c)}else{var l=this.artboard.stateMachineByName(t[s]);if(l){var d=new j(l,this.runtime,i,this.artboard);this.stateMachines.push(d)}}}}return e&&this.eventManager.fire(i?{type:y.Play,data:this.playing}:{type:y.Pause,data:this.paused}),i?this.playing:this.paused},t.prototype.initLinearAnimations=function(t,i){for(var e=this.animations.map((function(t){return t.name})),n=0;n<t.length;n++){var r=e.indexOf(t[n]);if(r>=0)this.animations[r].playing=i;else{var s=this.artboard.animationByName(t[n]);if(s){var o=new a.Animation(s,this.artboard,this.runtime,i);o.advance(0),o.apply(1),this.animations.push(o)}else console.error("Animation with name ".concat(t[n]," not found."))}}},t.prototype.initStateMachines=function(t,i){for(var e=this.stateMachines.map((function(t){return t.name})),n=0;n<t.length;n++){var r=e.indexOf(t[n]);if(r>=0)this.stateMachines[r].playing=i;else{var s=this.artboard.stateMachineByName(t[n]);if(s){var o=new j(s,this.runtime,i,this.artboard);this.stateMachines.push(o)}else console.warn("State Machine with name ".concat(t[n]," not found.")),this.initLinearAnimations([t[n]],i)}}},t.prototype.play=function(t){return this.add(t,!0)},t.prototype.advanceIfPaused=function(){this.stateMachines.forEach((function(t){t.playing||t.advanceAndApply(0)}))},t.prototype.pause=function(t){return this.add(t,!1)},t.prototype.scrub=function(t,i){var e=this.animations.filter((function(i){return t.includes(i.name)}));return e.forEach((function(t){return t.scrubTo=i})),e.map((function(t){return t.name}))},Object.defineProperty(t.prototype,"playing",{get:function(){return this.animations.filter((function(t){return t.playing})).map((function(t){return t.name})).concat(this.stateMachines.filter((function(t){return t.playing})).map((function(t){return t.name})))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"paused",{get:function(){return this.animations.filter((function(t){return!t.playing})).map((function(t){return t.name})).concat(this.stateMachines.filter((function(t){return!t.playing})).map((function(t){return t.name})))},enumerable:!1,configurable:!0}),t.prototype.stop=function(t){var i=this,e=[];if(0===(t=K(t)).length)e=this.animations.map((function(t){return t.name})).concat(this.stateMachines.map((function(t){return t.name}))),this.animations.forEach((function(t){return t.cleanup()})),this.stateMachines.forEach((function(t){return t.cleanup()})),this.animations.splice(0,this.animations.length),this.stateMachines.splice(0,this.stateMachines.length);else{var n=this.animations.filter((function(i){return t.includes(i.name)}));n.forEach((function(t){t.cleanup(),i.animations.splice(i.animations.indexOf(t),1)}));var r=this.stateMachines.filter((function(i){return t.includes(i.name)}));r.forEach((function(t){t.cleanup(),i.stateMachines.splice(i.stateMachines.indexOf(t),1)})),e=n.map((function(t){return t.name})).concat(r.map((function(t){return t.name})))}return this.eventManager.fire({type:y.Stop,data:e}),e},Object.defineProperty(t.prototype,"isPlaying",{get:function(){return this.animations.reduce((function(t,i){return t||i.playing}),!1)||this.stateMachines.reduce((function(t,i){return t||i.playing}),!1)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isPaused",{get:function(){return!this.isPlaying&&(this.animations.length>0||this.stateMachines.length>0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isStopped",{get:function(){return 0===this.animations.length&&0===this.stateMachines.length},enumerable:!1,configurable:!0}),t.prototype.atLeastOne=function(t,i){var e;return void 0===i&&(i=!0),0===this.animations.length&&0===this.stateMachines.length&&(this.artboard.animationCount()>0?this.add([e=this.artboard.animationByIndex(0).name],t,i):this.artboard.stateMachineCount()>0&&this.add([e=this.artboard.stateMachineByIndex(0).name],t,i)),e},t.prototype.handleLooping=function(){for(var t=0,i=this.animations.filter((function(t){return t.playing}));t<i.length;t++){var e=i[t];0===e.loopValue&&e.loopCount?(e.loopCount=0,this.stop(e.name)):1===e.loopValue&&e.loopCount?(this.eventManager.fire({type:y.Loop,data:{animation:e.name,type:x.Loop}}),e.loopCount=0):2===e.loopValue&&e.loopCount>1&&(this.eventManager.fire({type:y.Loop,data:{animation:e.name,type:x.PingPong}}),e.loopCount=0)}},t.prototype.handleStateChanges=function(){for(var t=[],i=0,e=this.stateMachines.filter((function(t){return t.playing}));i<e.length;i++)t.push.apply(t,e[i].statesChanged);t.length>0&&this.eventManager.fire({type:y.StateChange,data:t})},t.prototype.handleAdvancing=function(t){this.eventManager.fire({type:y.Advance,data:t})},t}();!function(t){t.Load="load",t.LoadError="loaderror",t.Play="play",t.Pause="pause",t.Stop="stop",t.Loop="loop",t.Draw="draw",t.Advance="advance",t.StateChange="statechange",t.RiveEvent="riveevent",t.AudioStatusChange="audiostatuschange"}(y||(y={})),function(t){t.OneShot="oneshot",t.Loop="loop",t.PingPong="pingpong"}(x||(x={}));var E,O=function(){function t(t){void 0===t&&(t=[]),this.listeners=t}return t.prototype.getListeners=function(t){return this.listeners.filter((function(i){return i.type===t}))},t.prototype.add=function(t){this.listeners.includes(t)||this.listeners.push(t)},t.prototype.remove=function(t){for(var i=0;i<this.listeners.length;i++){var e=this.listeners[i];if(e.type===t.type&&e.callback===t.callback){this.listeners.splice(i,1);break}}},t.prototype.removeAll=function(t){var i=this;t?this.listeners.filter((function(i){return i.type===t})).forEach((function(t){return i.remove(t)})):this.listeners.splice(0,this.listeners.length)},t.prototype.fire=function(t){this.getListeners(t.type).forEach((function(i){return i.callback(t)}))},t}(),C=function(){function t(t){this.eventManager=t,this.queue=[]}return t.prototype.add=function(t){this.queue.push(t)},t.prototype.process=function(){for(;this.queue.length>0;){var t=this.queue.shift();(null==t?void 0:t.action)&&t.action(),(null==t?void 0:t.event)&&this.eventManager.fire(t.event)}},t}();!function(t){t[t.AVAILABLE=0]="AVAILABLE",t[t.UNAVAILABLE=1]="UNAVAILABLE"}(E||(E={}));var $,I=new(function(t){function i(){var i=null!==t&&t.apply(this,arguments)||this;return i._started=!1,i._enabled=!1,i._status=E.UNAVAILABLE,i}return u(i,t),i.prototype.delay=function(t){return l(this,void 0,void 0,(function(){return d(this,(function(){return[2,new Promise((function(i){return setTimeout(i,t)}))]}))}))},i.prototype.timeout=function(){return l(this,void 0,void 0,(function(){return d(this,(function(){return[2,new Promise((function(t,i){return setTimeout(i,50)}))]}))}))},i.prototype.reportToListeners=function(){this.fire({type:y.AudioStatusChange}),this.removeAll()},i.prototype.enableAudio=function(){return l(this,void 0,void 0,(function(){return d(this,(function(){return this._enabled||(this._enabled=!0,this._status=E.AVAILABLE,this.reportToListeners()),[2]}))}))},i.prototype.testAudio=function(){return l(this,void 0,void 0,(function(){return d(this,(function(t){switch(t.label){case 0:if(this._status!==E.UNAVAILABLE||null===this._audioContext)return[3,4];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,Promise.race([this._audioContext.resume(),this.timeout()])];case 2:return t.sent(),this.enableAudio(),[3,4];case 3:return t.sent(),[3,4];case 4:return[2]}}))}))},i.prototype._establishAudio=function(){return l(this,void 0,void 0,(function(){return d(this,(function(t){switch(t.label){case 0:return this._started?[3,5]:(this._started=!0,"undefined"!=typeof window?[3,1]:(this.enableAudio(),[3,5]));case 1:this._audioContext=new AudioContext,this.listenForUserAction(),t.label=2;case 2:return this._status!==E.UNAVAILABLE?[3,5]:[4,this.testAudio()];case 3:return t.sent(),[4,this.delay(1e3)];case 4:return t.sent(),[3,2];case 5:return[2]}}))}))},i.prototype.listenForUserAction=function(){var t=this;document.addEventListener("pointerdown",(function(){return l(t,void 0,void 0,(function(){return d(this,(function(){return this.enableAudio(),[2]}))}))}),{once:!0})},i.prototype.establishAudio=function(){return l(this,void 0,void 0,(function(){return d(this,(function(){return this._establishAudio(),[2]}))}))},Object.defineProperty(i.prototype,"systemVolume",{get:function(){return this._status===E.UNAVAILABLE?(this.testAudio(),0):1},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"status",{get:function(){return this._status},enumerable:!1,configurable:!0}),i}(O)),_=function(){function t(){}return t.prototype.observe=function(){},t.prototype.unobserve=function(){},t.prototype.disconnect=function(){},t}(),T=globalThis.ResizeObserver||_,P=new(function(){function t(){var t=this;this._elementsMap=new Map,this._onObservedEntry=function(i){var e=t._elementsMap.get(i.target);null!==e?e.onResize(0==i.target.clientWidth||0==i.target.clientHeight):t._resizeObserver.unobserve(i.target)},this._onObserved=function(i){i.forEach(t._onObservedEntry)},this._resizeObserver=new T(this._onObserved)}return t.prototype.add=function(t,i){var e={onResize:i,element:t};return this._elementsMap.set(t,e),this._resizeObserver.observe(t),e},t.prototype.remove=function(t){this._resizeObserver.unobserve(t.element),this._elementsMap.delete(t.element)},t}()),z=function(){function t(t){this.enableRiveAssetCDN=!0,this.referenceCount=0,this.destroyed=!1,this.selfUnref=!1,this.bindableArtboards=[],this.src=t.src,this.buffer=t.buffer,t.assetLoader&&(this.assetLoader=t.assetLoader),this.enableRiveAssetCDN="boolean"!=typeof t.enableRiveAssetCDN||t.enableRiveAssetCDN,this.eventManager=new O,t.onLoad&&this.on(y.Load,t.onLoad),t.onLoadError&&this.on(y.LoadError,t.onLoadError)}return t.prototype.releaseFile=function(){var t;this.selfUnref&&(null===(t=this.file)||void 0===t||t.unref()),this.file=null},t.prototype.releaseBindableArtboards=function(){this.bindableArtboards.forEach((function(t){return t.destroy()}))},t.prototype.initData=function(){return l(this,void 0,void 0,(function(){var i,e,n,r,s;return d(this,(function(o){switch(o.label){case 0:return this.src?(i=this,[4,Z(this.src)]):[3,2];case 1:i.buffer=o.sent(),o.label=2;case 2:return this.destroyed?[2]:(this.assetLoader&&(n=new h.CustomFileAssetLoaderWrapper(this.runtime,this.assetLoader),e=n.assetLoader),r=this,[4,this.runtime.load(new Uint8Array(this.buffer),e,this.enableRiveAssetCDN)]);case 3:return r.file=o.sent(),s=new h.FileFinalizer(this.file),h.finalizationRegistry.register(this,s),this.destroyed?(this.releaseFile(),[2]):(null!==this.file?this.eventManager.fire({type:y.Load,data:this}):this.fireLoadError(t.fileLoadErrorMessage),[2])}}))}))},t.prototype.init=function(){return l(this,void 0,void 0,(function(){var i,e;return d(this,(function(n){switch(n.label){case 0:if(!this.src&&!this.buffer)return this.fireLoadError(t.missingErrorMessage),[2];n.label=1;case 1:return n.trys.push([1,4,,5]),i=this,[4,b.awaitInstance()];case 2:return i.runtime=n.sent(),this.destroyed?[2]:[4,this.initData()];case 3:return n.sent(),[3,5];case 4:return e=n.sent(),this.fireLoadError(e instanceof Error?e.message:t.fileLoadErrorMessage),[3,5];case 5:return[2]}}))}))},t.prototype.fireLoadError=function(t){throw this.eventManager.fire({type:y.LoadError,data:t}),new Error(t)},t.prototype.on=function(t,i){this.eventManager.add({type:t,callback:i})},t.prototype.off=function(t,i){this.eventManager.remove({type:t,callback:i})},t.prototype.cleanup=function(){this.referenceCount-=1,this.referenceCount<=0&&(this.removeAllRiveEventListeners(),this.releaseFile(),this.releaseBindableArtboards(),this.destroyed=!0)},t.prototype.removeAllRiveEventListeners=function(t){this.eventManager.removeAll(t)},t.prototype.getInstance=function(){if(null!==this.file)return this.referenceCount+=1,this.file},t.prototype.destroyIfUnused=function(){this.referenceCount<=0&&this.cleanup()},t.prototype.createBindableArtboard=function(t){if(null!=t){var i=new S(t);return(0,h.createFinalization)(i,i.nativeArtboard),this.bindableArtboards.push(i),i}return null},t.prototype.getArtboard=function(t){var i=this.file.artboardByName(t);if(null!=i)return new A(i,this)},t.prototype.getBindableArtboard=function(t){var i=this.file.bindableArtboardByName(t);return this.createBindableArtboard(i)},t.prototype.getDefaultBindableArtboard=function(){var t=this.file.bindableArtboardDefault();return this.createBindableArtboard(t)},t.prototype.internalBindableArtboardFromArtboard=function(t){var i=this.file.internalBindableArtboardFromArtboard(t);return this.createBindableArtboard(i)},t.missingErrorMessage="Rive source file or data buffer required",t.fileLoadErrorMessage="The file failed to load",t}(),W=function(){function t(t){var i,e=this;this.loaded=!1,this.destroyed=!1,this._observed=null,this.readyForPlaying=!1,this.artboard=null,this.eventCleanup=null,this.shouldDisableRiveListeners=!1,this.automaticallyHandleEvents=!1,this.dispatchPointerExit=!0,this.enableMultiTouch=!1,this.enableRiveAssetCDN=!0,this._volume=1,this._artboardWidth=void 0,this._artboardHeight=void 0,this._devicePixelRatioUsed=1,this._hasZeroSize=!1,this._audioEventListener=null,this._boundDraw=null,this._viewModelInstance=null,this._dataEnums=null,this.durations=[],this.frameTimes=[],this.frameCount=0,this.isTouchScrollEnabled=!1,this.onCanvasResize=function(t){var i=e._hasZeroSize!==t;e._hasZeroSize=t,t?e._layout.maxX&&e._layout.maxY||e.resizeToCanvas():i&&e.resizeDrawingSurfaceToCanvas()},this.renderSecondTimer=0,this._boundDraw=this.draw.bind(this),this.canvas=t.canvas,t.canvas.constructor===HTMLCanvasElement&&(this._observed=P.add(this.canvas,this.onCanvasResize)),this.src=t.src,this.buffer=t.buffer,this.riveFile=t.riveFile,this.layout=null!==(i=t.layout)&&void 0!==i?i:new m,this.shouldDisableRiveListeners=!!t.shouldDisableRiveListeners,this.isTouchScrollEnabled=!!t.isTouchScrollEnabled,this.automaticallyHandleEvents=!!t.automaticallyHandleEvents,this.dispatchPointerExit=!1===t.dispatchPointerExit?t.dispatchPointerExit:this.dispatchPointerExit,this.enableMultiTouch=!!t.enableMultiTouch,this.enableRiveAssetCDN=void 0===t.enableRiveAssetCDN||t.enableRiveAssetCDN,this.eventManager=new O,t.onLoad&&this.on(y.Load,t.onLoad),t.onLoadError&&this.on(y.LoadError,t.onLoadError),t.onPlay&&this.on(y.Play,t.onPlay),t.onPause&&this.on(y.Pause,t.onPause),t.onStop&&this.on(y.Stop,t.onStop),t.onLoop&&this.on(y.Loop,t.onLoop),t.onStateChange&&this.on(y.StateChange,t.onStateChange),t.onAdvance&&this.on(y.Advance,t.onAdvance),t.onload&&!t.onLoad&&this.on(y.Load,t.onload),t.onloaderror&&!t.onLoadError&&this.on(y.LoadError,t.onloaderror),t.onplay&&!t.onPlay&&this.on(y.Play,t.onplay),t.onpause&&!t.onPause&&this.on(y.Pause,t.onpause),t.onstop&&!t.onStop&&this.on(y.Stop,t.onstop),t.onloop&&!t.onLoop&&this.on(y.Loop,t.onloop),t.onstatechange&&!t.onStateChange&&this.on(y.StateChange,t.onstatechange),t.assetLoader&&(this.assetLoader=t.assetLoader),this.taskQueue=new C(this.eventManager),this.init({src:this.src,buffer:this.buffer,riveFile:this.riveFile,autoplay:t.autoplay,autoBind:t.autoBind,animations:t.animations,stateMachines:t.stateMachines,artboard:t.artboard,useOffscreenRenderer:t.useOffscreenRenderer})}return Object.defineProperty(t.prototype,"viewModelCount",{get:function(){return this.file.viewModelCount()},enumerable:!1,configurable:!0}),t.new=function(i){return console.warn("This function is deprecated: please use `new Rive({})` instead"),new t(i)},t.prototype.onSystemAudioChanged=function(){this.volume=this._volume},t.prototype.init=function(i){var e=this,n=i.buffer,r=i.riveFile,s=i.animations,o=i.stateMachines,a=i.artboard,h=i.autoplay,u=void 0!==h&&h,c=i.useOffscreenRenderer,l=void 0!==c&&c,d=i.autoBind,f=void 0!==d&&d;if(!this.destroyed){if(this.src=i.src,this.buffer=n,this.riveFile=r,!this.src&&!this.buffer&&!this.riveFile)throw new p(t.missingErrorMessage);var g=K(s),m=K(o);this.loaded=!1,this.readyForPlaying=!1,b.awaitInstance().then((function(t){e.destroyed||(e.runtime=t,e.removeRiveListeners(),e.deleteRiveRenderer(),e.renderer=e.runtime.makeRenderer(e.canvas,l),e.canvas.width||e.canvas.height||e.resizeDrawingSurfaceToCanvas(),e.initData(a,g,m,u,f).then((function(t){if(t)return e.setupRiveListeners()})).catch((function(t){console.error(t)})))})).catch((function(t){console.error(t)}))}},t.prototype.setupRiveListeners=function(t){var i=this;if(this.eventCleanup&&this.eventCleanup(),!this.shouldDisableRiveListeners){var e=(this.animator.stateMachines||[]).filter((function(t){return t.playing&&i.runtime.hasListeners(t.instance)})).map((function(t){return t.instance})),n=this.isTouchScrollEnabled,r=this.dispatchPointerExit,s=this.enableMultiTouch;t&&"isTouchScrollEnabled"in t&&(n=t.isTouchScrollEnabled),this.eventCleanup=(0,h.registerTouchInteractions)({canvas:this.canvas,artboard:this.artboard,stateMachines:e,renderer:this.renderer,rive:this.runtime,fit:this._layout.runtimeFit(this.runtime),alignment:this._layout.runtimeAlignment(this.runtime),isTouchScrollEnabled:n,dispatchPointerExit:r,enableMultiTouch:s,layoutScaleFactor:this._layout.layoutScaleFactor})}},t.prototype.removeRiveListeners=function(){this.eventCleanup&&(this.eventCleanup(),this.eventCleanup=null)},t.prototype.initializeAudio=function(){var t,i=this;I.status==E.UNAVAILABLE&&(null===(t=this.artboard)||void 0===t?void 0:t.hasAudio)&&null===this._audioEventListener&&(this._audioEventListener={type:y.AudioStatusChange,callback:function(){return i.onSystemAudioChanged()}},I.add(this._audioEventListener),I.establishAudio())},t.prototype.initArtboardSize=function(){this.artboard&&(this._artboardWidth=this.artboard.width=this._artboardWidth||this.artboard.width,this._artboardHeight=this.artboard.height=this._artboardHeight||this.artboard.height)},t.prototype.initData=function(t,i,e,n,r){return l(this,void 0,void 0,(function(){var s,o,a,h;return d(this,(function(u){switch(u.label){case 0:return u.trys.push([0,3,,4]),null!=this.riveFile?[3,2]:(s=new z({src:this.src,buffer:this.buffer,enableRiveAssetCDN:this.enableRiveAssetCDN,assetLoader:this.assetLoader}),this.riveFile=s,[4,s.init()]);case 1:if(u.sent(),this.destroyed)return s.destroyIfUnused(),[2,!1];u.label=2;case 2:return this.file=this.riveFile.getInstance(),this.initArtboard(t,i,e,n,r),this.initArtboardSize(),this.initializeAudio(),this.loaded=!0,this.eventManager.fire({type:y.Load,data:null!==(h=this.src)&&void 0!==h?h:"buffer"}),this.animator.advanceIfPaused(),this.readyForPlaying=!0,this.taskQueue.process(),this.drawFrame(),[2,!0];case 3:return o=u.sent(),a=(c=o)&&c.isHandledError?c.message:"Problem loading file; may be corrupt!",console.warn(a),this.eventManager.fire({type:y.LoadError,data:a}),[2,Promise.reject(a)];case 4:return[2]}var c}))}))},t.prototype.initArtboard=function(t,i,e,n,r){if(this.file){var s,o=t?this.file.artboardByName(t):this.file.defaultArtboard();if(!o){var a="Invalid artboard name or no default artboard";return console.warn(a),void this.eventManager.fire({type:y.LoadError,data:a})}if(this.artboard=o,o.volume=this._volume*I.systemVolume,this.animator=new M(this.runtime,this.artboard,this.eventManager),i.length>0||e.length>0?(s=i.concat(e),this.animator.initLinearAnimations(i,n),this.animator.initStateMachines(e,n)):s=[this.animator.atLeastOne(n,!1)],this.taskQueue.add({event:{type:n?y.Play:y.Pause,data:s}}),r){var u=this.file.defaultArtboardViewModel(o);if(null!==u){var c=u.defaultInstance();if(null!==c){var l=new F(c,null);(0,h.createFinalization)(l,l.runtimeInstance),this.bindViewModelInstance(l)}}}}},t.prototype.drawFrame=function(){var t,i;(null===(t=null===document||void 0===document?void 0:document.timeline)||void 0===t?void 0:t.currentTime)?this.loaded&&this.artboard&&!this.frameRequestId&&(this._boundDraw(document.timeline.currentTime),null===(i=this.runtime)||void 0===i||i.resolveAnimationFrame()):this.startRendering()},t.prototype.draw=function(t,i){var e;this.frameRequestId=null;var n=performance.now();this.lastRenderTime||(this.lastRenderTime=t),this.renderSecondTimer+=t-this.lastRenderTime,this.renderSecondTimer>5e3&&(this.renderSecondTimer=0,null==i||i());var r=(t-this.lastRenderTime)/1e3;this.lastRenderTime=t;for(var s=0,o=this.animator.animations.filter((function(t){return t.playing||t.needsScrub})).sort((function(t){return t.needsScrub?-1:1}));s<o.length;s++){var a=o[s];a.advance(r),a.instance.didLoop&&(a.loopCount+=1),a.apply(1)}for(var u=0,c=this.animator.stateMachines.filter((function(t){return t.playing}));u<c.length;u++){var l=c[u],d=l.reportedEventCount();if(d)for(var f=0;f<d;f++){var p=l.reportedEventAt(f);if(p)if(p.type===v.OpenUrl){if(this.eventManager.fire({type:y.RiveEvent,data:p}),this.automaticallyHandleEvents){var g=document.createElement("a"),m=p.url,b=p.target,w=(0,h.sanitizeUrl)(m);m&&g.setAttribute("href",w),b&&g.setAttribute("target",b),w&&w!==h.BLANK_URL&&g.click()}}else this.eventManager.fire({type:y.RiveEvent,data:p})}l.advanceAndApply(r)}0==this.animator.stateMachines.length&&this.artboard.advance(r);var x=this.renderer;x.clear(),x.save(),this.alignRenderer(),this._hasZeroSize||this.artboard.draw(x),x.restore(),x.flush(),this.animator.handleLooping(),this.animator.handleStateChanges(),this.animator.handleAdvancing(r),this.frameCount++;var k=performance.now();for(this.frameTimes.push(k),this.durations.push(k-n);this.frameTimes[0]<=k-1e3;)this.frameTimes.shift(),this.durations.shift();null===(e=this._viewModelInstance)||void 0===e||e.handleCallbacks(),this.animator.isPlaying?this.startRendering():(this.animator.isPaused||this.animator.isStopped)&&(this.lastRenderTime=0)},t.prototype.alignRenderer=function(){var t=this,i=t.runtime,e=t._layout,n=t.artboard;t.renderer.align(e.runtimeFit(i),e.runtimeAlignment(i),{minX:e.minX,minY:e.minY,maxX:e.maxX,maxY:e.maxY},n.bounds,this._devicePixelRatioUsed*e.layoutScaleFactor)},Object.defineProperty(t.prototype,"fps",{get:function(){return this.durations.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"frameTime",{get:function(){return 0===this.durations.length?0:(this.durations.reduce((function(t,i){return t+i}),0)/this.durations.length).toFixed(4)},enumerable:!1,configurable:!0}),t.prototype.cleanup=function(){var t,i;this.destroyed=!0,this.stopRendering(),this.cleanupInstances(),null!==this._observed&&P.remove(this._observed),this.removeRiveListeners(),this.file&&(null===(t=this.riveFile)||void 0===t||t.cleanup(),this.file=null),this.riveFile=null,this.deleteRiveRenderer(),null!==this._audioEventListener&&(I.remove(this._audioEventListener),this._audioEventListener=null),null===(i=this._viewModelInstance)||void 0===i||i.cleanup(),this._viewModelInstance=null,this._dataEnums=null},t.prototype.deleteRiveRenderer=function(){var t;null===(t=this.renderer)||void 0===t||t.delete(),this.renderer=null},t.prototype.cleanupInstances=function(){null!==this.eventCleanup&&this.eventCleanup(),this.stop(),this.artboard&&(this.artboard.delete(),this.artboard=null)},t.prototype.retrieveTextRun=function(t){var i;if(t)if(this.artboard){var e=this.artboard.textRun(t);if(e)return e;console.warn("Could not access a text run with name '".concat(t,"' in the '").concat(null===(i=this.artboard)||void 0===i?void 0:i.name,"' Artboard. Note that you must rename a text run node in the Rive editor to make it queryable at runtime."))}else console.warn("Tried to access text run, but the Artboard is null");else console.warn("No text run name provided")},t.prototype.getTextRunValue=function(t){var i=this.retrieveTextRun(t);return i?i.text:void 0},t.prototype.setTextRunValue=function(t,i){var e=this.retrieveTextRun(t);e&&(e.text=i)},t.prototype.play=function(t,i){var e=this;t=K(t),this.readyForPlaying?(this.animator.play(t),this.eventCleanup&&this.eventCleanup(),this.setupRiveListeners(),this.startRendering()):this.taskQueue.add({action:function(){return e.play(t,i)}})},t.prototype.pause=function(t){var i=this;t=K(t),this.readyForPlaying?(this.eventCleanup&&this.eventCleanup(),this.animator.pause(t)):this.taskQueue.add({action:function(){return i.pause(t)}})},t.prototype.scrub=function(t,i){var e=this;t=K(t),this.readyForPlaying?(this.animator.scrub(t,i||0),this.drawFrame()):this.taskQueue.add({action:function(){return e.scrub(t,i)}})},t.prototype.stop=function(t){var i=this;t=K(t),this.readyForPlaying?(this.animator&&this.animator.stop(t),this.eventCleanup&&this.eventCleanup()):this.taskQueue.add({action:function(){return i.stop(t)}})},t.prototype.reset=function(t){var i,e,n=null==t?void 0:t.artboard,r=K(null==t?void 0:t.animations),s=K(null==t?void 0:t.stateMachines),o=null!==(i=null==t?void 0:t.autoplay)&&void 0!==i&&i,a=null!==(e=null==t?void 0:t.autoBind)&&void 0!==e&&e;this.cleanupInstances(),this.initArtboard(n,r,s,o,a),this.taskQueue.process()},t.prototype.load=function(t){this.file=null,this.stop(),this.init(t)},Object.defineProperty(t.prototype,"layout",{get:function(){return this._layout},set:function(t){this._layout=t,t.maxX&&t.maxY||this.resizeToCanvas(),this.loaded&&!this.animator.isPlaying&&this.drawFrame()},enumerable:!1,configurable:!0}),t.prototype.resizeToCanvas=function(){this._layout=this.layout.copyWith({minX:0,minY:0,maxX:this.canvas.width,maxY:this.canvas.height})},t.prototype.resizeDrawingSurfaceToCanvas=function(t){if(this.canvas instanceof HTMLCanvasElement&&window){var e=this.canvas.getBoundingClientRect(),n=e.width,r=e.height,s=t||window.devicePixelRatio||1;if(this.devicePixelRatioUsed=s,this.canvas.width=s*n,this.canvas.height=s*r,this.resizeToCanvas(),this.drawFrame(),this.layout.fit===i.Layout){var o=this._layout.layoutScaleFactor;this.artboard.width=n/o,this.artboard.height=r/o}}},Object.defineProperty(t.prototype,"source",{get:function(){return this.src},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"activeArtboard",{get:function(){return this.artboard?this.artboard.name:""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"animationNames",{get:function(){if(!this.loaded||!this.artboard)return[];for(var t=[],i=0;i<this.artboard.animationCount();i++)t.push(this.artboard.animationByIndex(i).name);return t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"stateMachineNames",{get:function(){if(!this.loaded||!this.artboard)return[];for(var t=[],i=0;i<this.artboard.stateMachineCount();i++)t.push(this.artboard.stateMachineByIndex(i).name);return t},enumerable:!1,configurable:!0}),t.prototype.stateMachineInputs=function(t){if(this.loaded){var i=this.animator.stateMachines.find((function(i){return i.name===t}));return null==i?void 0:i.inputs}},t.prototype.retrieveInputAtPath=function(t,i){if(t)if(this.artboard){var e=this.artboard.inputByPath(t,i);if(e)return e;console.warn("Could not access an input with name: '".concat(t,"', at path:'").concat(i,"'"))}else console.warn("Tried to access input: '".concat(t,"', at path: '").concat(i,"', but the Artboard is null"));else console.warn("No input name provided for path '".concat(i,"'"))},t.prototype.setBooleanStateAtPath=function(t,i,e){var n=this.retrieveInputAtPath(t,e);n&&(n.type===g.Boolean?n.asBool().value=i:console.warn("Input with name: '".concat(t,"', at path:'").concat(e,"' is not a boolean")))},t.prototype.setNumberStateAtPath=function(t,i,e){var n=this.retrieveInputAtPath(t,e);n&&(n.type===g.Number?n.asNumber().value=i:console.warn("Input with name: '".concat(t,"', at path:'").concat(e,"' is not a number")))},t.prototype.fireStateAtPath=function(t,i){var e=this.retrieveInputAtPath(t,i);e&&(e.type===g.Trigger?e.asTrigger().fire():console.warn("Input with name: '".concat(t,"', at path:'").concat(i,"' is not a trigger")))},t.prototype.retrieveTextAtPath=function(t,i){if(t)if(i)if(this.artboard){var e=this.artboard.textByPath(t,i);if(e)return e;console.warn("Could not access text with name: '".concat(t,"', at path:'").concat(i,"'"))}else console.warn("Tried to access text: '".concat(t,"', at path: '").concat(i,"', but the Artboard is null"));else console.warn("No path provided for text '".concat(t,"'"));else console.warn("No text name provided for path '".concat(i,"'"))},t.prototype.getTextRunValueAtPath=function(t,i){var e=this.retrieveTextAtPath(t,i);if(e)return e.text;console.warn("Could not get text with name: '".concat(t,"', at path:'").concat(i,"'"))},t.prototype.setTextRunValueAtPath=function(t,i,e){var n=this.retrieveTextAtPath(t,e);n?n.text=i:console.warn("Could not set text with name: '".concat(t,"', at path:'").concat(e,"'"))},Object.defineProperty(t.prototype,"playingStateMachineNames",{get:function(){return this.loaded?this.animator.stateMachines.filter((function(t){return t.playing})).map((function(t){return t.name})):[]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"playingAnimationNames",{get:function(){return this.loaded?this.animator.animations.filter((function(t){return t.playing})).map((function(t){return t.name})):[]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pausedAnimationNames",{get:function(){return this.loaded?this.animator.animations.filter((function(t){return!t.playing})).map((function(t){return t.name})):[]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pausedStateMachineNames",{get:function(){return this.loaded?this.animator.stateMachines.filter((function(t){return!t.playing})).map((function(t){return t.name})):[]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isPlaying",{get:function(){return this.animator.isPlaying},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isPaused",{get:function(){return this.animator.isPaused},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isStopped",{get:function(){return this.animator.isStopped},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bounds",{get:function(){return this.artboard?this.artboard.bounds:void 0},enumerable:!1,configurable:!0}),t.prototype.on=function(t,i){this.eventManager.add({type:t,callback:i})},t.prototype.off=function(t,i){this.eventManager.remove({type:t,callback:i})},t.prototype.unsubscribe=function(t,i){console.warn("This function is deprecated: please use `off()` instead."),this.off(t,i)},t.prototype.removeAllRiveEventListeners=function(t){this.eventManager.removeAll(t)},t.prototype.unsubscribeAll=function(t){console.warn("This function is deprecated: please use `removeAllRiveEventListeners()` instead."),this.removeAllRiveEventListeners(t)},t.prototype.stopRendering=function(){this.loaded&&this.frameRequestId&&(this.runtime.cancelAnimationFrame?this.runtime.cancelAnimationFrame(this.frameRequestId):cancelAnimationFrame(this.frameRequestId),this.frameRequestId=null)},t.prototype.startRendering=function(){this.loaded&&this.artboard&&!this.frameRequestId&&(this.frameRequestId=this.runtime.requestAnimationFrame?this.runtime.requestAnimationFrame(this._boundDraw):requestAnimationFrame(this._boundDraw))},t.prototype.enableFPSCounter=function(t){this.runtime.enableFPSCounter(t)},t.prototype.disableFPSCounter=function(){this.runtime.disableFPSCounter()},Object.defineProperty(t.prototype,"contents",{get:function(){if(this.loaded){for(var t={artboards:[]},i=0;i<this.file.artboardCount();i++){for(var e=this.file.artboardByIndex(i),n={name:e.name,animations:[],stateMachines:[]},r=0;r<e.animationCount();r++){var s=e.animationByIndex(r);n.animations.push(s.name)}for(var o=0;o<e.stateMachineCount();o++){for(var a=e.stateMachineByIndex(o),h=a.name,u=new this.runtime.StateMachineInstance(a,e),c=[],l=0;l<u.inputCount();l++){var d=u.input(l);c.push({name:d.name,type:d.type})}n.stateMachines.push({name:h,inputs:c})}t.artboards.push(n)}return t}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"volume",{get:function(){return this.artboard&&this.artboard.volume!==this._volume&&(this._volume=this.artboard.volume),this._volume},set:function(t){this._volume=t,this.artboard&&(this.artboard.volume=t*I.systemVolume)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"artboardWidth",{get:function(){var t;return this.artboard?this.artboard.width:null!==(t=this._artboardWidth)&&void 0!==t?t:0},set:function(t){this._artboardWidth=t,this.artboard&&(this.artboard.width=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"artboardHeight",{get:function(){var t;return this.artboard?this.artboard.height:null!==(t=this._artboardHeight)&&void 0!==t?t:0},set:function(t){this._artboardHeight=t,this.artboard&&(this.artboard.height=t)},enumerable:!1,configurable:!0}),t.prototype.resetArtboardSize=function(){this.artboard?(this.artboard.resetArtboardSize(),this._artboardWidth=this.artboard.width,this._artboardHeight=this.artboard.height):(this._artboardWidth=void 0,this._artboardHeight=void 0)},Object.defineProperty(t.prototype,"devicePixelRatioUsed",{get:function(){return this._devicePixelRatioUsed},set:function(t){this._devicePixelRatioUsed=t},enumerable:!1,configurable:!0}),t.prototype.bindViewModelInstance=function(t){var i;this.artboard&&!this.destroyed&&t&&t.runtimeInstance&&(t.internalIncrementReferenceCount(),null===(i=this._viewModelInstance)||void 0===i||i.cleanup(),this._viewModelInstance=t,this.animator.stateMachines.length>0?this.animator.stateMachines.forEach((function(i){return i.bindViewModelInstance(t)})):this.artboard.bindViewModelInstance(t.runtimeInstance))},Object.defineProperty(t.prototype,"viewModelInstance",{get:function(){return this._viewModelInstance},enumerable:!1,configurable:!0}),t.prototype.viewModelByIndex=function(t){var i=this.file.viewModelByIndex(t);return null!==i?new D(i):null},t.prototype.viewModelByName=function(t){var i=this.file.viewModelByName(t);return null!==i?new D(i):null},t.prototype.enums=function(){if(null===this._dataEnums){var t=this.file.enums();this._dataEnums=t.map((function(t){return new L(t)}))}return this._dataEnums},t.prototype.defaultViewModel=function(){if(this.artboard){var t=this.file.defaultArtboardViewModel(this.artboard);if(t)return new D(t)}return null},t.prototype.getArtboard=function(t){var i,e;return null!==(e=null===(i=this.riveFile)||void 0===i?void 0:i.getArtboard(t))&&void 0!==e?e:null},t.prototype.getBindableArtboard=function(t){var i,e;return null!==(e=null===(i=this.riveFile)||void 0===i?void 0:i.getBindableArtboard(t))&&void 0!==e?e:null},t.prototype.getDefaultBindableArtboard=function(){var t,i;return null!==(i=null===(t=this.riveFile)||void 0===t?void 0:t.getDefaultBindableArtboard())&&void 0!==i?i:null},t.missingErrorMessage="Rive source file or data buffer required",t.cleanupErrorMessage="Attempt to use file after calling cleanup.",t}(),D=function(){function t(t){this._viewModel=t}return Object.defineProperty(t.prototype,"instanceCount",{get:function(){return this._viewModel.instanceCount},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this._viewModel.name},enumerable:!1,configurable:!0}),t.prototype.instanceByIndex=function(t){var i=this._viewModel.instanceByIndex(t);if(null!==i){var e=new F(i,null);return(0,h.createFinalization)(e,i),e}return null},t.prototype.instanceByName=function(t){var i=this._viewModel.instanceByName(t);if(null!==i){var e=new F(i,null);return(0,h.createFinalization)(e,i),e}return null},t.prototype.defaultInstance=function(){var t=this._viewModel.defaultInstance();if(null!==t){var i=new F(t,null);return(0,h.createFinalization)(i,t),i}return null},t.prototype.instance=function(){var t=this._viewModel.instance();if(null!==t){var i=new F(t,null);return(0,h.createFinalization)(i,t),i}return null},Object.defineProperty(t.prototype,"properties",{get:function(){return this._viewModel.getProperties()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"instanceNames",{get:function(){return this._viewModel.getInstanceNames()},enumerable:!1,configurable:!0}),t}(),L=function(){function t(t){this._dataEnum=t}return Object.defineProperty(t.prototype,"name",{get:function(){return this._dataEnum.name},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"values",{get:function(){return this._dataEnum.values},enumerable:!1,configurable:!0}),t}();!function(t){t.Number="number",t.String="string",t.Boolean="boolean",t.Color="color",t.Trigger="trigger",t.Enum="enum",t.List="list",t.Image="image",t.Artboard="artboard"}($||($={}));var F=function(){function t(t,i){this._parents=[],this._children=[],this._viewModelInstances=new Map,this._propertiesWithCallbacks=[],this._referenceCount=0,this.selfUnref=!1,this._runtimeInstance=t,null!==i&&this._parents.push(i)}return Object.defineProperty(t.prototype,"runtimeInstance",{get:function(){return this._runtimeInstance},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nativeInstance",{get:function(){return this._runtimeInstance},enumerable:!1,configurable:!0}),t.prototype.handleCallbacks=function(){0!==this._propertiesWithCallbacks.length&&(this._propertiesWithCallbacks.forEach((function(t){t.handleCallbacks()})),this._propertiesWithCallbacks.forEach((function(t){t.clearChanges()}))),this._children.forEach((function(t){return t.handleCallbacks()}))},t.prototype.addParent=function(t){this._parents.includes(t)||(this._parents.push(t),(this._propertiesWithCallbacks.length>0||this._children.length>0)&&t.addToViewModelCallbacks(this))},t.prototype.removeParent=function(t){var i=this._parents.indexOf(t);-1!==i&&(this._parents[i].removeFromViewModelCallbacks(this),this._parents.splice(i,1))},t.prototype.addToPropertyCallbacks=function(t){var i=this;this._propertiesWithCallbacks.includes(t)||(this._propertiesWithCallbacks.push(t),this._propertiesWithCallbacks.length>0&&this._parents.forEach((function(t){t.addToViewModelCallbacks(i)})))},t.prototype.removeFromPropertyCallbacks=function(t){var i=this;this._propertiesWithCallbacks.includes(t)&&(this._propertiesWithCallbacks=this._propertiesWithCallbacks.filter((function(i){return i!==t})),0===this._children.length&&0===this._propertiesWithCallbacks.length&&this._parents.forEach((function(t){t.removeFromViewModelCallbacks(i)})))},t.prototype.addToViewModelCallbacks=function(t){var i=this;this._children.includes(t)||(this._children.push(t),this._parents.forEach((function(t){t.addToViewModelCallbacks(i)})))},t.prototype.removeFromViewModelCallbacks=function(t){var i=this;this._children.includes(t)&&(this._children=this._children.filter((function(i){return i!==t})),0===this._children.length&&0===this._propertiesWithCallbacks.length&&this._parents.forEach((function(t){t.removeFromViewModelCallbacks(i)})))},t.prototype.clearCallbacks=function(){this._propertiesWithCallbacks.forEach((function(t){t.clearCallbacks()}))},t.prototype.propertyFromPath=function(t,i){var e=t.split("/");return this.propertyFromPathSegments(e,0,i)},t.prototype.viewModelFromPathSegments=function(t,i){var e=this.internalViewModelInstance(t[i]);return null!==e?i==t.length-1?e:e.viewModelFromPathSegments(t,i++):null},t.prototype.propertyFromPathSegments=function(t,i,e){var n,r,s,o,a,h,u,c,l,d,f,p,g,m,b,v,w,y;if(i<t.length-1){var x=this.internalViewModelInstance(t[i]);return null!==x?x.propertyFromPathSegments(t,i+1,e):null}var k=null;switch(e){case $.Number:if(null!==(k=null!==(r=null===(n=this._runtimeInstance)||void 0===n?void 0:n.number(t[i]))&&void 0!==r?r:null))return new N(k,this);break;case $.String:if(null!==(k=null!==(o=null===(s=this._runtimeInstance)||void 0===s?void 0:s.string(t[i]))&&void 0!==o?o:null))return new B(k,this);break;case $.Boolean:if(null!==(k=null!==(h=null===(a=this._runtimeInstance)||void 0===a?void 0:a.boolean(t[i]))&&void 0!==h?h:null))return new U(k,this);break;case $.Color:if(null!==(k=null!==(c=null===(u=this._runtimeInstance)||void 0===u?void 0:u.color(t[i]))&&void 0!==c?c:null))return new V(k,this);break;case $.Trigger:if(null!==(k=null!==(d=null===(l=this._runtimeInstance)||void 0===l?void 0:l.trigger(t[i]))&&void 0!==d?d:null))return new H(k,this);break;case $.Enum:if(null!==(k=null!==(p=null===(f=this._runtimeInstance)||void 0===f?void 0:f.enum(t[i]))&&void 0!==p?p:null))return new q(k,this);break;case $.List:if(null!==(k=null!==(m=null===(g=this._runtimeInstance)||void 0===g?void 0:g.list(t[i]))&&void 0!==m?m:null))return new X(k,this);break;case $.Image:if(null!==(k=null!==(v=null===(b=this._runtimeInstance)||void 0===b?void 0:b.image(t[i]))&&void 0!==v?v:null))return new G(k,this);break;case $.Artboard:if(null!==(k=null!==(y=null===(w=this._runtimeInstance)||void 0===w?void 0:w.artboard(t[i]))&&void 0!==y?y:null))return new Y(k,this)}return null},t.prototype.internalViewModelInstance=function(i){var e;if(this._viewModelInstances.has(i))return this._viewModelInstances.get(i);var n=null===(e=this._runtimeInstance)||void 0===e?void 0:e.viewModel(i);if(null!==n){var r=new t(n,this);return(0,h.createFinalization)(r,n),r.internalIncrementReferenceCount(),this._viewModelInstances.set(i,r),r}return null},t.prototype.number=function(t){return this.propertyFromPath(t,$.Number)},t.prototype.string=function(t){return this.propertyFromPath(t,$.String)},t.prototype.boolean=function(t){return this.propertyFromPath(t,$.Boolean)},t.prototype.color=function(t){return this.propertyFromPath(t,$.Color)},t.prototype.trigger=function(t){return this.propertyFromPath(t,$.Trigger)},t.prototype.enum=function(t){return this.propertyFromPath(t,$.Enum)},t.prototype.list=function(t){return this.propertyFromPath(t,$.List)},t.prototype.image=function(t){return this.propertyFromPath(t,$.Image)},t.prototype.artboard=function(t){return this.propertyFromPath(t,$.Artboard)},t.prototype.viewModel=function(t){var i=t.split("/"),e=i.length>1?this.viewModelFromPathSegments(i.slice(0,i.length-1),0):this;return null!=e?e.internalViewModelInstance(i[i.length-1]):null},t.prototype.internalReplaceViewModel=function(t,i){var e;if(null!==i.runtimeInstance){var n=(null===(e=this._runtimeInstance)||void 0===e?void 0:e.replaceViewModel(t,i.runtimeInstance))||!1;if(n){i.internalIncrementReferenceCount();var r=this.internalViewModelInstance(t);null!==r&&(r.removeParent(this),this._children.includes(r)&&(this._children=this._children.filter((function(t){return t!==r}))),r.cleanup()),this._viewModelInstances.set(t,i),i.addParent(this)}return n}return!1},t.prototype.replaceViewModel=function(t,i){var e,n=t.split("/"),r=n.length>1?this.viewModelFromPathSegments(n.slice(0,n.length-1),0):this;return null!==(e=null==r?void 0:r.internalReplaceViewModel(n[n.length-1],i))&&void 0!==e&&e},t.prototype.incrementReferenceCount=function(){var t;this._referenceCount++,null===(t=this._runtimeInstance)||void 0===t||t.incrementReferenceCount()},t.prototype.decrementReferenceCount=function(){var t;this._referenceCount--,null===(t=this._runtimeInstance)||void 0===t||t.decrementReferenceCount()},Object.defineProperty(t.prototype,"properties",{get:function(){var t;return(null===(t=this._runtimeInstance)||void 0===t?void 0:t.getProperties().map((function(t){return c({},t)})))||[]},enumerable:!1,configurable:!0}),t.prototype.internalIncrementReferenceCount=function(){this._referenceCount++},t.prototype.cleanup=function(){var t,i=this;if(this._referenceCount--,this._referenceCount<=0){this.selfUnref&&(null===(t=this._runtimeInstance)||void 0===t||t.unref()),this._runtimeInstance=null,this.clearCallbacks(),this._propertiesWithCallbacks=[],this._viewModelInstances.forEach((function(t){t.cleanup()})),this._viewModelInstances.clear();var e=f([],this._children,!0);this._children.length=0;var n=f([],this._parents,!0);this._parents.length=0,e.forEach((function(t){t.removeParent(i)})),n.forEach((function(t){t.removeFromViewModelCallbacks(i)}))}},t}(),R=function(){function t(t,i){this.callbacks=[],this._viewModelInstanceValue=t,this._parentViewModel=i}return t.prototype.on=function(t){0===this.callbacks.length&&this._viewModelInstanceValue.clearChanges(),this.callbacks.includes(t)||(this.callbacks.push(t),this._parentViewModel.addToPropertyCallbacks(this))},t.prototype.off=function(t){t?this.callbacks=this.callbacks.filter((function(i){return i!==t})):this.callbacks.length=0,0===this.callbacks.length&&this._parentViewModel.removeFromPropertyCallbacks(this)},t.prototype.internalHandleCallback=function(){},t.prototype.handleCallbacks=function(){var t=this;this._viewModelInstanceValue.hasChanged&&this.callbacks.forEach((function(i){t.internalHandleCallback(i)}))},t.prototype.clearChanges=function(){this._viewModelInstanceValue.clearChanges()},t.prototype.clearCallbacks=function(){this.callbacks.length=0},Object.defineProperty(t.prototype,"name",{get:function(){return this._viewModelInstanceValue.name},enumerable:!1,configurable:!0}),t}(),B=function(t){function i(i,e){return t.call(this,i,e)||this}return u(i,t),Object.defineProperty(i.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(t){this._viewModelInstanceValue.value=t},enumerable:!1,configurable:!0}),i.prototype.internalHandleCallback=function(t){t(this.value)},i}(R),N=function(t){function i(i,e){return t.call(this,i,e)||this}return u(i,t),Object.defineProperty(i.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(t){this._viewModelInstanceValue.value=t},enumerable:!1,configurable:!0}),i.prototype.internalHandleCallback=function(t){t(this.value)},i}(R),U=function(t){function i(i,e){return t.call(this,i,e)||this}return u(i,t),Object.defineProperty(i.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(t){this._viewModelInstanceValue.value=t},enumerable:!1,configurable:!0}),i.prototype.internalHandleCallback=function(t){t(this.value)},i}(R),H=function(t){function i(i,e){return t.call(this,i,e)||this}return u(i,t),i.prototype.trigger=function(){return this._viewModelInstanceValue.trigger()},i.prototype.internalHandleCallback=function(t){t()},i}(R),q=function(t){function i(i,e){return t.call(this,i,e)||this}return u(i,t),Object.defineProperty(i.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(t){this._viewModelInstanceValue.value=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"valueIndex",{get:function(){return this._viewModelInstanceValue.valueIndex},set:function(t){this._viewModelInstanceValue.valueIndex=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"values",{get:function(){return this._viewModelInstanceValue.values},enumerable:!1,configurable:!0}),i.prototype.internalHandleCallback=function(t){t(this.value)},i}(R),X=function(t){function i(i,e){return t.call(this,i,e)||this}return u(i,t),Object.defineProperty(i.prototype,"length",{get:function(){return this._viewModelInstanceValue.size},enumerable:!1,configurable:!0}),i.prototype.addInstance=function(t){null!=t.runtimeInstance&&(this._viewModelInstanceValue.addInstance(t.runtimeInstance),t.addParent(this._parentViewModel))},i.prototype.addInstanceAt=function(t,i){return!(null==t.runtimeInstance||!this._viewModelInstanceValue.addInstanceAt(t.runtimeInstance,i)||(t.addParent(this._parentViewModel),0))},i.prototype.removeInstance=function(t){null!=t.runtimeInstance&&(this._viewModelInstanceValue.removeInstance(t.runtimeInstance),t.removeParent(this._parentViewModel))},i.prototype.removeInstanceAt=function(t){this._viewModelInstanceValue.removeInstanceAt(t)},i.prototype.instanceAt=function(t){var i=this._viewModelInstanceValue.instanceAt(t);if(null!=i){var e=new F(i,this._parentViewModel);return(0,h.createFinalization)(e,i),e}return null},i.prototype.swap=function(t,i){this._viewModelInstanceValue.swap(t,i)},i.prototype.internalHandleCallback=function(t){t()},i}(R),V=function(t){function i(i,e){return t.call(this,i,e)||this}return u(i,t),Object.defineProperty(i.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(t){this._viewModelInstanceValue.value=t},enumerable:!1,configurable:!0}),i.prototype.rgb=function(t,i,e){this._viewModelInstanceValue.rgb(t,i,e)},i.prototype.rgba=function(t,i,e,n){this._viewModelInstanceValue.argb(n,t,i,e)},i.prototype.argb=function(t,i,e,n){this._viewModelInstanceValue.argb(t,i,e,n)},i.prototype.alpha=function(t){this._viewModelInstanceValue.alpha(t)},i.prototype.opacity=function(t){this._viewModelInstanceValue.alpha(Math.round(255*Math.max(0,Math.min(1,t))))},i.prototype.internalHandleCallback=function(t){t(this.value)},i}(R),G=function(t){function i(i,e){return t.call(this,i,e)||this}return u(i,t),Object.defineProperty(i.prototype,"value",{set:function(t){var i;this._viewModelInstanceValue.value(null!==(i=null==t?void 0:t.nativeImage)&&void 0!==i?i:null)},enumerable:!1,configurable:!0}),i.prototype.internalHandleCallback=function(t){t()},i}(R),Y=function(t){function i(i,e){return t.call(this,i,e)||this}return u(i,t),Object.defineProperty(i.prototype,"value",{set:function(t){var i,e;e=t.isBindableArtboard?t:t.file.internalBindableArtboardFromArtboard(t.nativeArtboard),this._viewModelInstanceValue.value(null!==(i=null==e?void 0:e.nativeArtboard)&&void 0!==i?i:null)},enumerable:!1,configurable:!0}),i.prototype.internalHandleCallback=function(t){t()},i}(R),Z=function(t){return l(void 0,void 0,void 0,(function(){var i;return d(this,(function(e){switch(e.label){case 0:return i=new Request(t),[4,fetch(i)];case 1:return[4,e.sent().arrayBuffer()];case 2:return[2,e.sent()]}}))}))},K=function(t){return"string"==typeof t?[t]:t instanceof Array?t:[]},J={EventManager:O,TaskQueueManager:C},Q=function(t){return l(void 0,void 0,void 0,(function(){var i,e;return d(this,(function(n){switch(n.label){case 0:return[4,new Promise((function(i){return b.getInstance((function(e){e.decodeAudio(t,i)}))}))];case 1:return i=n.sent(),e=new h.AudioWrapper(i),h.finalizationRegistry.register(e,i),[2,e]}}))}))},tt=function(t){return l(void 0,void 0,void 0,(function(){var i,e;return d(this,(function(n){switch(n.label){case 0:return[4,new Promise((function(i){return b.getInstance((function(e){e.decodeImage(t,i)}))}))];case 1:return i=n.sent(),e=new h.ImageWrapper(i),h.finalizationRegistry.register(e,i),[2,e]}}))}))},it=function(t){return l(void 0,void 0,void 0,(function(){var i,e;return d(this,(function(n){switch(n.label){case 0:return[4,new Promise((function(i){return b.getInstance((function(e){e.decodeFont(t,i)}))}))];case 1:return i=n.sent(),e=new h.FontWrapper(i),h.finalizationRegistry.register(e,i),[2,e]}}))}))}})(),n})(),at.exports=ot());const ut=class{constructor(i){t(this,i),this.id="",this.value="",this.height="",this.width="auto",this.ariaLabel="",this.ariaHidden="",this.x="0px",this.y="0px",this.z="0",this.bgColor="",this.type="",this.tabIndex=0,this.visible=!1,this.audio="",this.src="",this.onTouch="",this.onInCorrect="",this.onCorrect="",this.onEntry="",this.delayVisible="",this.initializeRive=t=>{const i=o.getInstance(),e=this.el.querySelector("canvas");this.riveInstance=new ht.Rive({src:t,canvas:e,stateMachines:"Idle",autoplay:!0,onLoad:()=>{this.riveInstance.resizeDrawingSurfaceToCanvas(),i.setRiveInstance(this.riveInstance)}})}}async componentDidLoad(){ht.RuntimeLoader.setWasmUrl(ut.RIVE_WASM_URL),a(this.el,this.delayVisible),h(this.el,this.type),this.initializeRive(u(this.src))}render(){return i(e,{key:"14599bbd626e766d35b9611f80dd401ee76717b4",id:this.id,type:this.type,"tab-index":this.tabIndex,value:this.value,style:{height:this.height,width:this.width,backgroundColor:this.bgColor,top:this.y,left:this.x,display:this.visible?"flex":"none",zIndex:this.z},"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,audio:this.audio,onTouch:this.onTouch,onCorrect:this.onCorrect,onInCorrect:this.onInCorrect,onEntry:this.onEntry,src:this.src},i("canvas",{key:"6f128e61bee6797c0cf83c15b3fd3ba4d1d7b1ea",class:"lido-canvas"}))}static get assetsDirs(){return["."]}get el(){return n(this)}};ut.RIVE_WASM_URL="https://unpkg.com/@rive-app/canvas@2.32.0/rive.wasm",ut.style=".lido-canvas{height:100%;width:100%}";const ct=class{constructor(i){t(this,i),this.pivotimage="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/balancing/Display%20stand.svg",this.scaleimage="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/balancing/Bar.svg",this.handlerimage="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/balancing/Stands.svg",this.fill="brown",this.tilt=0,this.maxTilt=9.5,this.onEntry="",this.height="auto",this.width="auto",this.x="0px",this.y="0px",this.z="0",this.visible=!1,this.margin="",this.padding="",this.balanceSymbol="=",this.showSymbol=!1,this.operation="count",this.pivotSvg="",this.scaleSvg="",this.handlerSvg="",this.style={},this.tiltf=0,this.leftVal=0,this.rightVal=0,this.currentAngle=0}async revealSymbol(){this.showSymbol=!0}async hideSymbol(){this.showSymbol=!1}async componentWillLoad(){this.updateStyles(),this.pivotSvg=await this.fetchAndApplyFill(u(this.pivotimage)),this.scaleSvg=await this.fetchAndApplyFill(u(this.scaleimage)),this.handlerSvg=await this.fetchAndApplyFill(u(this.handlerimage))}componentDidLoad(){this.animateBalance(),this.leftParentEl=document.getElementById("leftparent"),this.rightParentEl=document.getElementById("rightparent"),h(this.el)}disconnectedCallback(){null!=this.animationFrameId&&cancelAnimationFrame(this.animationFrameId)}async fetchAndApplyFill(t){try{const i=await fetch(t);if(!i.ok)return"";let e=await i.text();return e=e.replace(/fill="[^"]*"/g,""),e=e.replace(/stroke="[^"]*"/g,""),e=e.replace(/<svg([^>]*)>/,`<svg$1 fill="${this.fill}" stroke="${this.fill}">`),e}catch(t){return console.error("SVG fetch failed:",t),""}}tiltChanged(t){this.tiltf=t}async updateTilt(t,i){const e=Math.max(-5,Math.min(5,i-t));await new Promise((t=>setTimeout(t,350))),this.tiltf=e}animateBalance(){const t=()=>{let i=this.tiltf/5*this.maxTilt;if(i>this.maxTilt&&(i=this.maxTilt),i<-this.maxTilt&&(i=-this.maxTilt),this.currentAngle+=.1*(i-this.currentAngle),this.currentAngle>this.maxTilt&&(this.currentAngle=this.maxTilt),this.currentAngle<-this.maxTilt&&(this.currentAngle=-this.maxTilt),this.scaleEl&&(this.scaleEl.style.transform=`rotate(${this.currentAngle}deg)`,this.scaleEl.style.transformOrigin="50% 80%"),this.leftParentEl&&this.rightParentEl){const t=window.innerHeight>window.innerWidth,i=this.currentAngle/this.maxTilt*(t?40:60);this.leftParentEl.style.transform=`translateY(${-i}px)`,this.rightParentEl.style.transform=`translateY(${i}px)`}if(this.leftHandleEl&&this.rightHandleEl){const t=window.innerHeight>window.innerWidth,i=this.currentAngle/this.maxTilt*(t?40:60);this.leftHandleEl.style.transform=`translateY(${-i}px)`,this.rightHandleEl.style.transform=`translateY(${i}px)`}this.animationFrameId=requestAnimationFrame(t)};t()}updateStyles(){const t=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:c(this.height,t),width:c(this.width,t),top:c(this.y,t),left:c(this.x,t),zIndex:this.z,display:"true"===c(`${this.visible}`,t)?"flex":"none",margin:c(this.margin,t),padding:c(this.padding,t)}}render(){return i(e,{key:"2d7a59cde91392b0e19efb592a81e6aa9466654d",id:"lido-balance","bg-color":"red",onEntry:this.onEntry,class:"lido-balance",tilt:this.tilt.toString(),style:this.style,operation:this.operation.toString(),"pivot-image":this.pivotSvg,"scale-image":this.scaleSvg,"handler-image":this.handlerSvg},i("div",{key:"7048f924b6f45de2023f28e19c486810e109d94e",innerHTML:this.pivotSvg,id:"pivotimg",class:"pivot"}),i("div",{key:"05c1ab110c0c4ca918fa452b5d0cfbe57d3e6a1a",innerHTML:this.scaleSvg,id:"scaleimg",class:"scale",ref:t=>this.scaleEl=t}),i("div",{key:"5db42befb11d6505a6167d93e8e9015d65dc0f8a",innerHTML:this.handlerSvg,id:"handlerimg",class:"handler",ref:t=>this.leftHandleEl=t}),i("div",{key:"bce64e72aeaf1a99d6ef381da369d393f300e025",innerHTML:this.handlerSvg,id:"handimg",class:"hand",ref:t=>this.rightHandleEl=t}),i("div",{key:"ee8b45ff347a6421169c9c7fce66b9079e930424",id:"balanceSymbol",class:"lido-balance-symbol","aria-hidden":!this.showSymbol},this.showSymbol?this.balanceSymbol:""))}get el(){return n(this)}static get watchers(){return{tilt:[{tiltChanged:0}]}}};ct.style='#lido-balance{position:relative;height:500px;width:1205px;top:20%;left:-91px;z-index:0}.lido-balance-symbol{position:absolute;top:64%;left:50%;transform:translate(-50%, -50%);font-size:5vw;font-weight:bold;color:black;pointer-events:none;z-index:999}@media (orientation: portrait){.lido-balance-shadow{height:100px;position:absolute;top:80%;left:28%}}@media (orientation: landscape){.lido-balance-shadow{height:100px;position:absolute;top:90%;left:33%}}@media (orientation: portrait){#pivotimg{position:absolute;height:auto;width:23%;bottom:18%;left:38%;z-index:100}}#pivotimg::after{content:"";position:absolute;bottom:-30px;left:50%;transform:translateX(-50%);width:120%;height:60px;background-image:url("https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/balancing/Shadow.svg");background-size:contain;background-repeat:no-repeat;background-position:center;pointer-events:none;z-index:10}@media (orientation: landscape){#pivotimg{position:absolute;height:auto;width:23%;bottom:8%;left:38%;z-index:100}}.lido-balance .pivot svg{width:100%;height:auto}#scaleimg{position:absolute;width:73%;height:auto;top:61%;left:14%;z-index:90}.lido-balance .scale svg{width:100%;height:auto}@media (orientation: landscape){#handlerimg{position:absolute;width:35%;height:auto;top:49%;left:2%}}@media (orientation:portrait ){#handlerimg{position:absolute;width:35%;height:auto;top:53%;left:2%}}.lido-balance .handler svg{width:100%;height:auto;fill:brown}@media (orientation: landscape){#handimg{position:absolute;width:35%;height:auto;top:49%;right:2%}}@media (orientation:portrait){#handimg{position:absolute;width:35%;height:auto;top:53%;right:2%}}.lido-balance .hand svg{width:100%;height:auto;fill:brown}.pivot svg path:nth-of-type(1){fill:brown}.pivot svg path[d^="M78.9414"]{fill:white}';const lt=class{constructor(i){t(this,i),this.onOk=r(this,"onOk"),this.width="479px",this.visible=!1,this.height="711px",this.objective="",this.onEntry="",this.x="0px",this.y="0px",this.bgColor="#60DADA",this.penIcon="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/calculator/penIcon.png",this.displayValue="",this.style={},this.userAnswers=[],this.tempInputs=[]}updateValueAttr(){this.el.setAttribute("value",this.displayValue)}componentWillLoad(){if(!this.objective){const t=this.el.closest("lido-container");t&&(this.objective=(t.getAttribute("objective")||"").replace("=","").trim())}this.updateValueAttr()}handleClick(t){"OK"===t?this.verifyAnswer():"←"===t?this.displayValue=this.displayValue.slice(0,-1):this.displayValue.length<8&&(this.displayValue+=t),this.updateValueAttr()}async verifyAnswer(){var t;const i=this.displayValue.trim();if(!i)return;let e=!1;const n=this.el.closest("lido-container");if(!n)return;if(this.objective&&""!=this.objective&&!this.objective.includes(","))e=Number(i)===Number(this.objective);else if(this.objective&&this.objective.includes(",")){const t="true"===n.getAttribute("is-continue-on-correct"),r=this.objective.split(",").map((t=>t.trim())),s=this.userAnswers.length;s<r.length&&Number(i)===Number(r[s])&&(e=!0),t?e&&this.userAnswers.push(Number(i)):this.userAnswers.push(Number(i))}else if(""===this.objective){const t=n.getAttribute("equationCheck")||"";if(!t)return;try{const n=l(t);e=Number(n)===Number(i.trim())}catch(t){console.error("Error evaluating equation:",t),e=!1}}this.onOk.emit(e);const r=document.getElementById("btn-11");if(e){const s="nimbleTable"===n.getAttribute("template-id"),o=this.objective.includes(",");s&&o||n.setAttribute("game-completed","true"),this.tempInputs.push(i);const a=JSON.parse(null!==(t=n.getAttribute(d))&&void 0!==t?t:"[]"),h=Array.isArray(a)?a.filter((t=>""!==String(t).trim())):[],u=this.tempInputs[this.tempInputs.length-1];if(""!==String(u).trim()&&h.push(u),n.setAttribute(d,JSON.stringify(h)),r.style.pointerEvents="none",this.displayValue="",f(e,v),s&&o){const t=n.querySelector("[type='calculate']");t&&(t.getAttribute("audio")||"").trim()&&(t.style.boxShadow="none !important",t.setAttribute("onCorrect","this.speak='true'"),p.getI().play(t))}const c=(null==n?void 0:n.getAttribute("onCorrect"))||"";if(await g(c,n),!c.includes("scrollCellAfterEquationSolved"))if(o){const t=this.objective.split(",").map((t=>t.trim()));this.userAnswers.length>=t.length&&(n.setAttribute("game-completed","true"),m(),b())}else m(),b()}else{r.style.pointerEvents="none",this.displayValue="",f(e,v);const t=(null==n?void 0:n.getAttribute("onInCorrect"))||"",i=(null==n?void 0:n.getAttribute("onCorrect"))||"",s="true"===n.getAttribute("is-continue-on-correct");s?await g(t,n):await g(i,n),s||(n.setAttribute("game-completed","true"),m(),b())}r.style.pointerEvents="auto"}render(){return i(e,{key:"63cfc3e353a89b76ad809a921cc7b51ce6d06e93",onEntry:this.onEntry,id:"lidoCalculator",style:{width:this.width,height:this.height,backgroundColor:this.bgColor,left:this.x,top:this.y}},i("lido-cell",{key:"66cc572079209533f8fd4f6c4ca76fdb9435b3b8",visible:"true",height:"94px",width:"60px"},i("lido-text",{key:"aca3392da8c74ab136268296f2ff584bf5cacd61",visible:"true",id:"lido-calculator-penIcon",type:"click",height:"80px",x:"204%",width:"89px",onEntry:"this.position='relative';",class:"top-icon"},i("img",{key:"46275d788f7bb3132e657d4902d4471cc7928b39",src:u(this.penIcon),alt:"pen",style:{width:"100%",height:"100%"}}))),i("div",{key:"5adb6fbdefa7d9d8c4bd2ada68f580c8c1af298e",class:"lido-calculator-displayParent"},i("div",{key:"cca5a9c232f9d4dfa31e193e8d9eaddcd83a5052",class:"lido-calculator-display"},this.displayValue)),i("div",{key:"64b70b100e8165dfe6d0dd9522b0362f12856a9e",class:"lido-calculator-buttons"},["1","2","3","4","5","6","7","8","9","←","0","OK"].map(((t,e)=>i("lido-text",{id:`btn-${e}`,string:t,visible:"true",type:"click",class:{"lido-calculator-btn-special":"←"===t||"OK"===t,"lido-calculator-btn-default":"←"!==t&&"OK"!==t},onClick:()=>this.handleClick(t)})))))}get el(){return n(this)}};lt.style="#lidoCalculator{border-radius:19px;border:5px solid #029A9A;position:relative;display:flex;flex-direction:column;padding:2%;box-sizing:border-box}.lido-calculator-btn-special{--btn-bg-color:#014D4D !important;background-color:#014D4D !important;--btn-shadow-color:#0a2f2f !important}.lido-calculator-btn-default{--btn-bg-color:#029A9A !important;background-color:#029A9A !important;color:#000;--btn-shadow-color:#0f4242 !important}#lido-calculator-penIcon{--btn-bg-color:#FB7038 !important;--btn-shadow-px:0 8px 0 !important;--btn-shadow-color:#D74B12 !important;border-radius:5px !important}.lido-calculator-displayParent{width:89%;height:107px;background-color:rgb(68, 186, 186);border-radius:5px;margin:14px auto 17px auto;overflow:hidden;display:flex;align-items:end}.lido-calculator-display{width:97%;height:94px;background:#029A9A;color:#fff;text-align:right;display:flex;justify-content:flex-end;align-items:center;font-size:72px;font-weight:700;font-family:'Baloo Bhai 2', serif;border-radius:5px 0px 0px 5px;box-sizing:border-box;margin:0 0px -6px auto}.lido-calculator-buttons{flex:1;display:grid;grid-template-columns:repeat(3, 1fr);grid-auto-rows:1fr;gap:0%;width:100%;justify-items:center;align-items:center;position:relative;top:-1%}.lido-calculator-buttons lido-text{display:flex !important;justify-content:center;align-items:center;width:100px !important;height:88px !important;font-size:80px !important;font-weight:700 !important;color:#fff;border-radius:5px !important;cursor:pointer;text-align:center;line-height:1;box-sizing:border-box;transition:transform 0.1s}.lido-calculator-buttons lido-text:active{transform:scale(0.95)}";const dt=class{constructor(i){t(this,i),this.width="800px",this.height="700px",this.visible=!1,this.z="0",this.x="0px",this.y="0px",this.onEntry="",this.drawing=!1,this.style={},this.handleWindowPointerUp=()=>this.stop(),this.handleWindowResize=()=>this.updateStyles()}updateStyles(){const t=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={width:c(this.width,t),height:c(this.height,t),left:c(this.x,t),top:c(this.y,t),zIndex:this.z,display:"true"===c(`${this.visible}`,t)?"block":"none",position:"absolute"},this.canvas&&(this.canvas.width=parseInt(c(this.width,t)),this.canvas.height=parseInt(c(this.height,t)),this.ctx.strokeStyle="#000",this.ctx.lineWidth=10,this.ctx.lineCap="round",this.ctx.lineJoin="round")}componentDidLoad(){this.canvas=this.el.shadowRoot.querySelector("#lido-canvas"),this.ctx=this.canvas.getContext("2d"),this.ctx.strokeStyle="#000",this.ctx.lineWidth=10,this.ctx.lineCap="round",this.ctx.lineJoin="round",this.updateStyles(),this.canvas.addEventListener("pointerdown",(t=>this.start(t))),this.canvas.addEventListener("pointermove",(t=>this.move(t))),window.addEventListener("pointerup",this.handleWindowPointerUp),window.addEventListener("resize",this.handleWindowResize)}disconnectedCallback(){window.removeEventListener("pointerup",this.handleWindowPointerUp),window.removeEventListener("resize",this.handleWindowResize)}loadBackground(){if(!this.bgImage)return this.ctx.fillStyle="#fff",void this.ctx.fillRect(0,0,this.canvas.width,this.canvas.height);const t=new Image;t.crossOrigin="anonymous",t.src=this.bgImage,t.onload=()=>{this.ctx.drawImage(t,0,0,this.canvas.width,this.canvas.height)}}getPos(t){const i=this.canvas.getBoundingClientRect();return{x:this.canvas.width/i.width*(t.clientX-i.left),y:this.canvas.height/i.height*(t.clientY-i.top)}}start(t){this.drawing=!0;const i=this.getPos(t);this.ctx.beginPath(),this.ctx.moveTo(i.x,i.y)}move(t){if(!this.drawing)return;const i=this.getPos(t);this.ctx.lineTo(i.x,i.y),this.ctx.stroke()}stop(){this.drawing=!1,this.ctx.closePath()}clearCanvas(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height)}render(){return i(e,{key:"6bb47f06656ce667d23236e9f3c3a8f383885a43",id:"lido-canvas",class:"lido-canvas",style:this.style},i("button",{key:"fd0d1217bda63071fbf6496c2538c2a944b14181",id:"lido-exit-button",onClick:()=>this.clearCanvas()}),i("canvas",{key:"ed0333972bb7ce0fc4e14c81bb466ea895ce65e0",id:"lido-canvas"}))}get el(){return n(this)}};dt.style=":host{box-sizing:border-box}.lido-canvas{background:transparent;border:none;border-radius:0;overflow:hidden;box-sizing:border-box}#lido-exit-button{padding:6px 14px;border:none;background:transparent;color:#fff;border-radius:6px;cursor:pointer;font-size:14px;position:absolute;top:0;right:0;z-index:15}canvas{touch-action:none;display:block;width:100%;height:100%;z-index:10}";const ft=class{constructor(i){t(this,i),this.showSpeakIcon=!1,this.scrollbarWidth="",this.id="",this.value="",this.height="auto",this.width="auto",this.ariaLabel="",this.ariaHidden="",this.x="0px",this.y="0px",this.z="0",this.gap="0",this.bgColor="",this.type="",this.tabIndex=0,this.visible="false",this.audio="",this.onTouch="",this.onInCorrect="",this.onCorrect="",this.onEntry="",this.childElementsLength=9999,this.minLength=0,this.maxLength=9999,this.layout="wrap",this.minDrops=1,this.maxDrops=1,this.margin="",this.padding="",this.alignItems="",this.borderRadius="0px",this.flexDirection="",this.style={},this.handleWindowResize=()=>this.updateStyles(),this.handleWindowLoad=()=>this.updateStyles(),this.delayVisible="",this.disableSpeak=!1}componentDidLoad(){a(this.el,this.delayVisible),h(this.el,this.type),w(this.el,this.minLength,this.maxLength,this.childElementsLength),setTimeout((()=>{const t=this.el.className.includes("lido-random")?this.el:null;if(t){const i=t.parentElement;if(!i)return;const e=i.offsetWidth,n=i.offsetHeight;Array.from(t.children).forEach((t=>{const i=e-t.offsetWidth,r=n-t.offsetHeight,s=Math.random()*i,o=Math.random()*r;t.style.position="absolute",t.style.left=`${s}px`,t.style.top=`${o}px`}))}}),50),this.showSpeakIcon&&y(this.el)}componentWillLoad(){this.updateStyles(),window.addEventListener("resize",this.handleWindowResize),window.addEventListener("load",this.handleWindowLoad)}disconnectedCallback(){window.removeEventListener("resize",this.handleWindowResize),window.removeEventListener("load",this.handleWindowLoad)}updateStyles(){const t=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:c(this.height,t),width:c(this.width,t),backgroundColor:c(this.bgColor,t),top:c(this.y,t),left:c(this.x,t),zIndex:this.z,margin:c(this.margin,t),padding:c(this.padding,t),borderRadius:c(this.borderRadius,t),gap:c(this.gap,t),"--scrollbar-width":c(this.scrollbarWidth||"0px",t),display:JSON.parse(c(`${this.visible}`,t))?"wrap"===c(this.layout,t)?"grid":"pos"===c(this.layout,t)||"random"===c(this.layout,t)?"block":"flex":"none",flexDirection:this.flexDirection?c(this.flexDirection,t):"",alignItems:this.alignItems?c(this.alignItems,t):""},this.el.className=`lido-${c(this.layout,t)}`}render(){return i(e,{key:"73bdf9dd33fdd8322c35465de011697da112193a",id:this.id,class:"lido-cell",value:this.value,type:this.type,"tab-index":this.tabIndex,style:this.style,minDrops:this.minDrops,maxDrops:this.maxDrops,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,audio:this.audio,onTouch:this.onTouch,onCorrect:this.onCorrect,onInCorrect:this.onInCorrect,onEntry:this.onEntry,"flex-direction":this.flexDirection,"disable-speak":this.disableSpeak},i("slot",{key:"6e9d4507b36716f04853d39ef66015441782aa88"}))}get el(){return n(this)}};ft.style=".lido-col{top:var(--y, 0);left:var(--x, 0);height:var(--height, 100%);width:var(--width, 100%);background-color:var(--bgColor, #eeeeee);padding:15px;border-radius:10px;display:flex;justify-content:space-around;flex-direction:column;align-items:center}.lido-col>*{}.lido-row{display:flex;justify-content:space-around;align-items:center;}.lido-row>*{}.lido-wrap{display:grid;grid-gap:10px;grid-template-columns:repeat(auto-fill, minmax(186px, auto))}.lido-wrap>*{padding:10px;box-sizing:border-box}.lido-flex{display:flex;flex-wrap:wrap;align-content:flex-start;gap:10px}.lido-pos{top:var(--y, 0);left:var(--x, 0);height:var(--height, 100%);width:var(--width, 100%);background-color:var(--bgColor, #eeeeee);display:flex;justify-content:space-around;flex-direction:column;position:fixed}.lido-pos>*{position:absolute}.lido-random{position:relative;width:100%;height:100%}.lido-random>*{position:absolute}.lido-col::-webkit-scrollbar,.lido-wrap::-webkit-scrollbar,.lido-flex::-webkit-scrollbar{width:var(--scrollbar-width);height:var(--scrollbar-width)}.lido-col::-webkit-scrollbar-thumb,.lido-wrap::-webkit-scrollbar-thumb,.lido-flex::-webkit-scrollbar-thumb{background-color:#888;border-radius:10px;border:3px solid transparent;background-clip:content-box}.lido-col::-webkit-scrollbar-track,.lido-wrap::-webkit-scrollbar-track,.lido-flex::-webkit-scrollbar-track{background:#f1f1f1}";const pt=class{constructor(i){t(this,i),this.showSpeakIcon=!1,this.minDrops=1,this.maxDrops=1,this.margin="",this.style={},this.handleWindowResize=()=>this.updateStyles(),this.handleWindowLoad=()=>this.updateStyles()}componentDidLoad(){h(this.el,this.type),w(this.el,this.minLength,this.maxLength,this.childElementsLength),this.showSpeakIcon&&y(this.el)}componentWillLoad(){this.updateStyles(),window.addEventListener("resize",this.handleWindowResize),window.addEventListener("load",this.handleWindowLoad)}disconnectedCallback(){window.removeEventListener("resize",this.handleWindowResize),window.removeEventListener("load",this.handleWindowLoad)}updateStyles(){const t=this.borderImage?u(this.borderImage):"",i=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:c(this.height,i),width:c(this.width,i),backgroundColor:c(this.bgColor,i),top:c(this.y,i),left:c(this.x,i),zIndex:this.z,display:this.visible?"flex":"none",flexDirection:this.direction?c(this.direction,i):"column",borderImage:`url(${t})`,borderImageSlice:t?"0 fill":"",boxShadow:this.boxShadow?this.boxShadow:"unset",margin:c(this.margin,i)}}render(){return i(e,{key:"334206d6054442fec787cfb479a68ae164404730",id:this.id,class:"lido-col",type:this.type,"tab-index":this.tabIndex,value:this.value,style:this.style,minDrops:this.minDrops,maxDrops:this.maxDrops,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,audio:this.audio,onTouch:this.onTouch,onCorrect:this.onCorrect,onInCorrect:this.onInCorrect,onEntry:this.onEntry},i("slot",{key:"590cd219bc5a02e6b96eafe108fb8b310daf941d"}))}get el(){return n(this)}};pt.style=".lido-col{top:var(--y, 0);left:var(--x, 0);height:var(--height, 100%);width:var(--width, 100%);background-color:var(--bgColor, #eeeeee);padding:15px;border-radius:10px;display:flex;justify-content:space-around;flex-direction:column;align-items:center}.lido-col>*{}";const gt=t=>"string"==typeof t,mt=()=>{let t,i;const e=new Promise(((e,n)=>{t=e,i=n}));return e.resolve=t,e.reject=i,e},bt=t=>null==t?"":""+t,vt=/###/g,wt=t=>t&&t.indexOf("###")>-1?t.replace(vt,"."):t,yt=t=>!t||gt(t),xt=(t,i,e)=>{const n=gt(i)?i.split("."):i;let r=0;for(;r<n.length-1;){if(yt(t))return{};const i=wt(n[r]);!t[i]&&e&&(t[i]=new e),t=Object.prototype.hasOwnProperty.call(t,i)?t[i]:{},++r}return yt(t)?{}:{obj:t,k:wt(n[r])}},kt=(t,i,e)=>{const{obj:n,k:r}=xt(t,i,Object);if(void 0!==n||1===i.length)return void(n[r]=e);let s=i[i.length-1],o=i.slice(0,i.length-1),a=xt(t,o,Object);for(;void 0===a.obj&&o.length;)s=`${o[o.length-1]}.${s}`,o=o.slice(0,o.length-1),a=xt(t,o,Object),a?.obj&&void 0!==a.obj[`${a.k}.${s}`]&&(a.obj=void 0);a.obj[`${a.k}.${s}`]=e},At=(t,i)=>{const{obj:e,k:n}=xt(t,i);if(e&&Object.prototype.hasOwnProperty.call(e,n))return e[n]},St=(t,i,e)=>{for(const n in i)"__proto__"!==n&&"constructor"!==n&&(n in t?gt(t[n])||t[n]instanceof String||gt(i[n])||i[n]instanceof String?e&&(t[n]=i[n]):St(t[n],i[n],e):t[n]=i[n]);return t},jt=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Mt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const Et=t=>gt(t)?t.replace(/[&<>"'\/]/g,(t=>Mt[t])):t,Ot=[" ",",","?","!",";"],Ct=new class{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const i=this.regExpMap.get(t);if(void 0!==i)return i;const e=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,e),this.regExpQueue.push(t),e}}(20),$t=(t,i,e=".")=>{if(!t)return;if(t[i]){if(!Object.prototype.hasOwnProperty.call(t,i))return;return t[i]}const n=i.split(e);let r=t;for(let t=0;t<n.length;){if(!r||"object"!=typeof r)return;let i,s="";for(let o=t;o<n.length;++o)if(o!==t&&(s+=e),s+=n[o],i=r[s],void 0!==i){if(["string","number","boolean"].indexOf(typeof i)>-1&&o<n.length-1)continue;t+=o-t+1;break}r=i}return r},It=t=>t?.replace(/_/g,"-"),_t={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,i){console?.[t]?.apply?.(console,i)}};class Tt{constructor(t,i={}){this.init(t,i)}init(t,i={}){this.prefix=i.prefix||"i18next:",this.logger=t||_t,this.options=i,this.debug=i.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,i,e,n){return n&&!this.debug?null:(gt(t[0])&&(t[0]=`${e}${this.prefix} ${t[0]}`),this.logger[i](t))}create(t){return new Tt(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return(t=t||this.options).prefix=t.prefix||this.prefix,new Tt(this.logger,t)}}var Pt=new Tt;class zt{constructor(){this.observers={}}on(t,i){return t.split(" ").forEach((t=>{this.observers[t]||(this.observers[t]=new Map);const e=this.observers[t].get(i)||0;this.observers[t].set(i,e+1)})),this}off(t,i){this.observers[t]&&(i?this.observers[t].delete(i):delete this.observers[t])}emit(t,...i){this.observers[t]&&Array.from(this.observers[t].entries()).forEach((([t,e])=>{for(let n=0;n<e;n++)t(...i)})),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach((([e,n])=>{for(let r=0;r<n;r++)e.apply(e,[t,...i])}))}}class Wt extends zt{constructor(t,i={ns:["translation"],defaultNS:"translation"}){super(),this.data=t||{},this.options=i,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const i=this.options.ns.indexOf(t);i>-1&&this.options.ns.splice(i,1)}getResource(t,i,e,n={}){const r=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,s=void 0!==n.ignoreJSONStructure?n.ignoreJSONStructure:this.options.ignoreJSONStructure;let o;t.indexOf(".")>-1?o=t.split("."):(o=[t,i],e&&(Array.isArray(e)?o.push(...e):gt(e)&&r?o.push(...e.split(r)):o.push(e)));const a=At(this.data,o);return!a&&!i&&!e&&t.indexOf(".")>-1&&(t=o[0],i=o[1],e=o.slice(2).join(".")),!a&&s&&gt(e)?$t(this.data?.[t]?.[i],e,r):a}addResource(t,i,e,n,r={silent:!1}){const s=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator;let o=[t,i];e&&(o=o.concat(s?e.split(s):e)),t.indexOf(".")>-1&&(o=t.split("."),n=i,i=o[1]),this.addNamespaces(i),kt(this.data,o,n),r.silent||this.emit("added",t,i,e,n)}addResources(t,i,e,n={silent:!1}){for(const n in e)(gt(e[n])||Array.isArray(e[n]))&&this.addResource(t,i,n,e[n],{silent:!0});n.silent||this.emit("added",t,i,e)}addResourceBundle(t,i,e,n,r,s={silent:!1,skipCopy:!1}){let o=[t,i];t.indexOf(".")>-1&&(o=t.split("."),n=e,e=i,i=o[1]),this.addNamespaces(i);let a=At(this.data,o)||{};s.skipCopy||(e=JSON.parse(JSON.stringify(e))),n?St(a,e,r):a={...a,...e},kt(this.data,o,a),s.silent||this.emit("added",t,i,e)}removeResourceBundle(t,i){this.hasResourceBundle(t,i)&&delete this.data[t][i],this.removeNamespaces(i),this.emit("removed",t,i)}hasResourceBundle(t,i){return void 0!==this.getResource(t,i)}getResourceBundle(t,i){return i||(i=this.options.defaultNS),this.getResource(t,i)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const i=this.getDataByLanguage(t);return!!(i&&Object.keys(i)||[]).find((t=>i[t]&&Object.keys(i[t]).length>0))}toJSON(){return this.data}}var Dt={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,i,e,n,r){return t.forEach((t=>{i=this.processors[t]?.process(i,e,n,r)??i})),i}};const Lt=Symbol("i18next/PATH_KEY");function Ft(t,i){const{[Lt]:e}=t(function(){const t=[],i=Object.create(null);let e;return i.get=(n,r)=>(e?.revoke?.(),r===Lt?t:(t.push(r),e=Proxy.revocable(n,i),e.proxy)),Proxy.revocable(Object.create(null),i).proxy}()),n=i?.keySeparator??".",r=i?.nsSeparator??":";if(e.length>1&&r){const t=i?.ns,s=Array.isArray(t)?t:null;if(s&&s.length>1&&s.slice(1).includes(e[0]))return`${e[0]}${r}${e.slice(1).join(n)}`}return e.join(n)}const Rt={},Bt=t=>!gt(t)&&"boolean"!=typeof t&&"number"!=typeof t;class Nt extends zt{constructor(t,i={}){var e,n;super(),e=t,n=this,["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"].forEach((t=>{e[t]&&(n[t]=e[t])})),this.options=i,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=Pt.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t,i={interpolation:{}}){const e={...i};if(null==t)return!1;const n=this.resolve(t,e);if(void 0===n?.res)return!1;const r=Bt(n.res);return!1!==e.returnObjects||!r}extractFromKey(t,i){let e=void 0!==i.nsSeparator?i.nsSeparator:this.options.nsSeparator;void 0===e&&(e=":");const n=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator;let r=i.ns||this.options.defaultNS||[];const s=e&&t.indexOf(e)>-1,o=!(this.options.userDefinedKeySeparator||i.keySeparator||this.options.userDefinedNsSeparator||i.nsSeparator||((t,i,e)=>{i=i||"",e=e||"";const n=Ot.filter((t=>i.indexOf(t)<0&&e.indexOf(t)<0));if(0===n.length)return!0;const r=Ct.getRegExp(`(${n.map((t=>"?"===t?"\\?":t)).join("|")})`);let s=!r.test(t);if(!s){const i=t.indexOf(e);i>0&&!r.test(t.substring(0,i))&&(s=!0)}return s})(t,e,n));if(s&&!o){const i=t.match(this.interpolator.nestingRegexp);if(i&&i.length>0)return{key:t,namespaces:gt(r)?[r]:r};const s=t.split(e);(e!==n||e===n&&this.options.ns.indexOf(s[0])>-1)&&(r=s.shift()),t=s.join(n)}return{key:t,namespaces:gt(r)?[r]:r}}translate(t,i,e){let n="object"==typeof i?{...i}:i;if("object"!=typeof n&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof n&&(n={...n}),n||(n={}),null==t)return"";"function"==typeof t&&(t=Ft(t,{...this.options,...n})),Array.isArray(t)||(t=[String(t)]),t=t.map((t=>"function"==typeof t?Ft(t,{...this.options,...n}):String(t)));const r=void 0!==n.returnDetails?n.returnDetails:this.options.returnDetails,s=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,{key:o,namespaces:a}=this.extractFromKey(t[t.length-1],n),h=a[a.length-1];let u=void 0!==n.nsSeparator?n.nsSeparator:this.options.nsSeparator;void 0===u&&(u=":");const c=n.lng||this.language,l=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if("cimode"===c?.toLowerCase())return l?r?{res:`${h}${u}${o}`,usedKey:o,exactUsedKey:o,usedLng:c,usedNS:h,usedParams:this.getUsedParamsDetails(n)}:`${h}${u}${o}`:r?{res:o,usedKey:o,exactUsedKey:o,usedLng:c,usedNS:h,usedParams:this.getUsedParamsDetails(n)}:o;const d=this.resolve(t,n);let f=d?.res;const p=d?.usedKey||o,g=d?.exactUsedKey||o,m=void 0!==n.joinArrays?n.joinArrays:this.options.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject,v=void 0!==n.count&&!gt(n.count),w=Nt.hasDefaultValue(n),y=v?this.pluralResolver.getSuffix(c,n.count,n):"",x=n.ordinal&&v?this.pluralResolver.getSuffix(c,n.count,{ordinal:!1}):"",k=v&&!n.ordinal&&0===n.count,A=k&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${y}`]||n[`defaultValue${x}`]||n.defaultValue;let S=f;b&&!f&&w&&(S=A);const j=Bt(S),M=Object.prototype.toString.apply(S);if(!(b&&S&&j&&["[object Number]","[object Function]","[object RegExp]"].indexOf(M)<0)||gt(m)&&Array.isArray(S))if(b&&gt(m)&&Array.isArray(f))f=f.join(m),f&&(f=this.extendTranslation(f,t,n,e));else{let i=!1,r=!1;!this.isValidLookup(f)&&w&&(i=!0,f=A),this.isValidLookup(f)||(r=!0,f=o);const a=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&r?void 0:f,l=w&&A!==f&&this.options.updateMissing;if(r||i||l){if(this.logger.log(l?"updateKey":"missingKey",c,h,o,l?A:f),s){const t=this.resolve(o,{...n,keySeparator:!1});t&&t.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let t=[];const i=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if("fallback"===this.options.saveMissingTo&&i&&i[0])for(let e=0;e<i.length;e++)t.push(i[e]);else"all"===this.options.saveMissingTo?t=this.languageUtils.toResolveHierarchy(n.lng||this.language):t.push(n.lng||this.language);const e=(t,i,e)=>{const r=w&&e!==f?e:a;this.options.missingKeyHandler?this.options.missingKeyHandler(t,h,i,r,l,n):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(t,h,i,r,l,n),this.emit("missingKey",t,h,i,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&v?t.forEach((t=>{const i=this.pluralResolver.getSuffixes(t,n);k&&n[`defaultValue${this.options.pluralSeparator}zero`]&&i.indexOf(`${this.options.pluralSeparator}zero`)<0&&i.push(`${this.options.pluralSeparator}zero`),i.forEach((i=>{e([t],o+i,n[`defaultValue${i}`]||A)}))})):e(t,o,A))}f=this.extendTranslation(f,t,n,d,e),r&&f===o&&this.options.appendNamespaceToMissingKey&&(f=`${h}${u}${o}`),(r||i)&&this.options.parseMissingKeyHandler&&(f=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${h}${u}${o}`:o,i?f:void 0,n))}else{if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const t=this.options.returnedObjectHandler?this.options.returnedObjectHandler(p,S,{...n,ns:a}):`key '${o} (${this.language})' returned an object instead of string.`;return r?(d.res=t,d.usedParams=this.getUsedParamsDetails(n),d):t}if(s){const t=Array.isArray(S),i=t?[]:{},e=t?g:p;for(const t in S)if(Object.prototype.hasOwnProperty.call(S,t)){const r=`${e}${s}${t}`;i[t]=this.translate(r,w&&!f?{...n,defaultValue:Bt(A)?A[t]:void 0,joinArrays:!1,ns:a}:{...n,joinArrays:!1,ns:a}),i[t]===r&&(i[t]=S[t])}f=i}}return r?(d.res=f,d.usedParams=this.getUsedParamsDetails(n),d):f}extendTranslation(t,i,e,n,r){if(this.i18nFormat?.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...e},e.lng||this.language||n.usedLng,n.usedNS,n.usedKey,{resolved:n});else if(!e.skipInterpolation){e.interpolation&&this.interpolator.init({...e,interpolation:{...this.options.interpolation,...e.interpolation}});const s=gt(t)&&(void 0!==e?.interpolation?.skipOnVariables?e.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let o;if(s){const i=t.match(this.interpolator.nestingRegexp);o=i&&i.length}let a=e.replace&&!gt(e.replace)?e.replace:e;if(this.options.interpolation.defaultVariables&&(a={...this.options.interpolation.defaultVariables,...a}),t=this.interpolator.interpolate(t,a,e.lng||this.language||n.usedLng,e),s){const i=t.match(this.interpolator.nestingRegexp);o<(i&&i.length)&&(e.nest=!1)}!e.lng&&n&&n.res&&(e.lng=this.language||n.usedLng),!1!==e.nest&&(t=this.interpolator.nest(t,((...t)=>r?.[0]!==t[0]||e.context?this.translate(...t,i):(this.logger.warn(`It seems you are nesting recursively key: ${t[0]} in key: ${i[0]}`),null)),e)),e.interpolation&&this.interpolator.reset()}const s=e.postProcess||this.options.postProcess,o=gt(s)?[s]:s;return null!=t&&o?.length&&!1!==e.applyPostProcessor&&(t=Dt.handle(o,t,i,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...n,usedParams:this.getUsedParamsDetails(e)},...e}:e,this)),t}resolve(t,i={}){let e,n,r,s,o;return gt(t)&&(t=[t]),Array.isArray(t)&&(t=t.map((t=>"function"==typeof t?Ft(t,{...this.options,...i}):t))),t.forEach((t=>{if(this.isValidLookup(e))return;const a=this.extractFromKey(t,i),h=a.key;n=h;let u=a.namespaces;this.options.fallbackNS&&(u=u.concat(this.options.fallbackNS));const c=void 0!==i.count&&!gt(i.count),l=c&&!i.ordinal&&0===i.count,d=void 0!==i.context&&(gt(i.context)||"number"==typeof i.context)&&""!==i.context,f=i.lngs?i.lngs:this.languageUtils.toResolveHierarchy(i.lng||this.language,i.fallbackLng);u.forEach((t=>{this.isValidLookup(e)||(o=t,Rt[`${f[0]}-${t}`]||!this.utils?.hasLoadedNamespace||this.utils?.hasLoadedNamespace(o)||(Rt[`${f[0]}-${t}`]=!0,this.logger.warn(`key "${n}" for languages "${f.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),f.forEach((n=>{if(this.isValidLookup(e))return;s=n;const o=[h];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(o,h,n,t,i);else{let t;c&&(t=this.pluralResolver.getSuffix(n,i.count,i));const e=`${this.options.pluralSeparator}zero`,r=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(c&&(i.ordinal&&0===t.indexOf(r)&&o.push(h+t.replace(r,this.options.pluralSeparator)),o.push(h+t),l&&o.push(h+e)),d){const n=`${h}${this.options.contextSeparator||"_"}${i.context}`;o.push(n),c&&(i.ordinal&&0===t.indexOf(r)&&o.push(n+t.replace(r,this.options.pluralSeparator)),o.push(n+t),l&&o.push(n+e))}}let a;for(;a=o.pop();)this.isValidLookup(e)||(r=a,e=this.getResource(n,t,a,i))})))}))})),{res:e,usedKey:n,exactUsedKey:r,usedLng:s,usedNS:o}}isValidLookup(t){return!(void 0===t||!this.options.returnNull&&null===t||!this.options.returnEmptyString&&""===t)}getResource(t,i,e,n={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(t,i,e,n):this.resourceStore.getResource(t,i,e,n)}getUsedParamsDetails(t={}){const i=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],e=t.replace&&!gt(t.replace);let n=e?t.replace:t;if(e&&void 0!==t.count&&(n.count=t.count),this.options.interpolation.defaultVariables&&(n={...this.options.interpolation.defaultVariables,...n}),!e){n={...n};for(const t of i)delete n[t]}return n}static hasDefaultValue(t){for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&"defaultValue"===i.substring(0,12)&&void 0!==t[i])return!0;return!1}}class Ut{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Pt.create("languageUtils")}getScriptPartFromCode(t){if(!(t=It(t))||t.indexOf("-")<0)return null;const i=t.split("-");return 2===i.length?null:(i.pop(),"x"===i[i.length-1].toLowerCase()?null:this.formatLanguageCode(i.join("-")))}getLanguagePartFromCode(t){if(!(t=It(t))||t.indexOf("-")<0)return t;const i=t.split("-");return this.formatLanguageCode(i[0])}formatLanguageCode(t){if(gt(t)&&t.indexOf("-")>-1){let i;try{i=Intl.getCanonicalLocales(t)[0]}catch(t){}return i&&this.options.lowerCaseLng&&(i=i.toLowerCase()),i||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let i;return t.forEach((t=>{if(i)return;const e=this.formatLanguageCode(t);this.options.supportedLngs&&!this.isSupportedCode(e)||(i=e)})),!i&&this.options.supportedLngs&&t.forEach((t=>{if(i)return;const e=this.getScriptPartFromCode(t);if(this.isSupportedCode(e))return i=e;const n=this.getLanguagePartFromCode(t);if(this.isSupportedCode(n))return i=n;i=this.options.supportedLngs.find((t=>t===n?t:t.indexOf("-")<0&&n.indexOf("-")<0?void 0:t.indexOf("-")>0&&n.indexOf("-")<0&&t.substring(0,t.indexOf("-"))===n||0===t.indexOf(n)&&n.length>1?t:void 0))})),i||(i=this.getFallbackCodes(this.options.fallbackLng)[0]),i}getFallbackCodes(t,i){if(!t)return[];if("function"==typeof t&&(t=t(i)),gt(t)&&(t=[t]),Array.isArray(t))return t;if(!i)return t.default||[];let e=t[i];return e||(e=t[this.getScriptPartFromCode(i)]),e||(e=t[this.formatLanguageCode(i)]),e||(e=t[this.getLanguagePartFromCode(i)]),e||(e=t.default),e||[]}toResolveHierarchy(t,i){const e=this.getFallbackCodes((!1===i?[]:i)||this.options.fallbackLng||[],t),n=[],r=t=>{t&&(this.isSupportedCode(t)?n.push(t):this.logger.warn(`rejecting language code not found in supportedLngs: ${t}`))};return gt(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?("languageOnly"!==this.options.load&&r(this.formatLanguageCode(t)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&r(this.getScriptPartFromCode(t)),"currentOnly"!==this.options.load&&r(this.getLanguagePartFromCode(t))):gt(t)&&r(this.formatLanguageCode(t)),e.forEach((t=>{n.indexOf(t)<0&&r(this.formatLanguageCode(t))})),n}}const Ht={zero:0,one:1,two:2,few:3,many:4,other:5},qt={select:t=>1===t?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Xt{constructor(t,i={}){this.languageUtils=t,this.options=i,this.logger=Pt.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,i={}){const e=It("dev"===t?"en":t),n=i.ordinal?"ordinal":"cardinal",r=JSON.stringify({cleanedCode:e,type:n});if(r in this.pluralRulesCache)return this.pluralRulesCache[r];let s;try{s=new Intl.PluralRules(e,{type:n})}catch(e){if("undefined"==typeof Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),qt;if(!t.match(/-|_/))return qt;const n=this.languageUtils.getLanguagePartFromCode(t);s=this.getRule(n,i)}return this.pluralRulesCache[r]=s,s}needsPlural(t,i={}){let e=this.getRule(t,i);return e||(e=this.getRule("dev",i)),e?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(t,i,e={}){return this.getSuffixes(t,e).map((t=>`${i}${t}`))}getSuffixes(t,i={}){let e=this.getRule(t,i);return e||(e=this.getRule("dev",i)),e?e.resolvedOptions().pluralCategories.sort(((t,i)=>Ht[t]-Ht[i])).map((t=>`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${t}`)):[]}getSuffix(t,i,e={}){const n=this.getRule(t,e);return n?`${this.options.prepend}${e.ordinal?`ordinal${this.options.prepend}`:""}${n.select(i)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",i,e))}}const Vt=(t,i,e,n=".",r=!0)=>{let s=((t,i,e)=>{const n=At(t,e);return void 0!==n?n:At(i,e)})(t,i,e);return!s&&r&&gt(e)&&(s=$t(t,e,n),void 0===s&&(s=$t(i,e,n))),s},Gt=t=>t.replace(/\$/g,"$$$$");class Yt{constructor(t={}){this.logger=Pt.create("interpolator"),this.options=t,this.format=t?.interpolation?.format||(t=>t),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:i,escapeValue:e,useRawValueToEscape:n,prefix:r,prefixEscaped:s,suffix:o,suffixEscaped:a,formatSeparator:h,unescapeSuffix:u,unescapePrefix:c,nestingPrefix:l,nestingPrefixEscaped:d,nestingSuffix:f,nestingSuffixEscaped:p,nestingOptionsSeparator:g,maxReplaces:m,alwaysFormat:b}=t.interpolation;this.escape=void 0!==i?i:Et,this.escapeValue=void 0===e||e,this.useRawValueToEscape=void 0!==n&&n,this.prefix=r?jt(r):s||"{{",this.suffix=o?jt(o):a||"}}",this.formatSeparator=h||",",this.unescapePrefix=u?"":c||"-",this.unescapeSuffix=this.unescapePrefix?"":u||"",this.nestingPrefix=l?jt(l):d||jt("$t("),this.nestingSuffix=f?jt(f):p||jt(")"),this.nestingOptionsSeparator=g||",",this.maxReplaces=m||1e3,this.alwaysFormat=void 0!==b&&b,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(t,i)=>t?.source===i?(t.lastIndex=0,t):new RegExp(i,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,i,e,n){let r,s,o;const a=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},h=t=>{if(t.indexOf(this.formatSeparator)<0){const r=Vt(i,a,t,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(r,void 0,e,{...n,...i,interpolationkey:t}):r}const r=t.split(this.formatSeparator),s=r.shift().trim(),o=r.join(this.formatSeparator).trim();return this.format(Vt(i,a,s,this.options.keySeparator,this.options.ignoreJSONStructure),o,e,{...n,...i,interpolationkey:s})};this.resetRegExp();const u=n?.missingInterpolationHandler||this.options.missingInterpolationHandler,c=void 0!==n?.interpolation?.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:t=>Gt(t)},{regex:this.regexp,safeValue:t=>Gt(this.escapeValue?this.escape(t):t)}].forEach((i=>{for(o=0;r=i.regex.exec(t);){const e=r[1].trim();if(s=h(e),void 0===s)if("function"==typeof u){const i=u(t,r,n);s=gt(i)?i:""}else if(n&&Object.prototype.hasOwnProperty.call(n,e))s="";else{if(c){s=r[0];continue}this.logger.warn(`missed to pass in variable ${e} for interpolating ${t}`),s=""}else gt(s)||this.useRawValueToEscape||(s=bt(s));const a=i.safeValue(s);if(t=t.replace(r[0],a),c?(i.regex.lastIndex+=s.length,i.regex.lastIndex-=r[0].length):i.regex.lastIndex=0,o++,o>=this.maxReplaces)break}})),t}nest(t,i,e={}){let n,r,s;const o=(t,i)=>{const e=this.nestingOptionsSeparator;if(t.indexOf(e)<0)return t;const n=t.split(new RegExp(`${jt(e)}[ ]*{`));let r=`{${n[1]}`;t=n[0],r=this.interpolate(r,s);const o=r.match(/'/g),a=r.match(/"/g);((o?.length??0)%2==0&&!a||(a?.length??0)%2!=0)&&(r=r.replace(/'/g,'"'));try{s=JSON.parse(r),i&&(s={...i,...s})}catch(i){return this.logger.warn(`failed parsing options string in nesting for key ${t}`,i),`${t}${e}${r}`}return s.defaultValue&&s.defaultValue.indexOf(this.prefix)>-1&&delete s.defaultValue,t};for(;n=this.nestingRegexp.exec(t);){let a=[];s={...e},s=s.replace&&!gt(s.replace)?s.replace:s,s.applyPostProcessor=!1,delete s.defaultValue;const h=/{.*}/.test(n[1])?n[1].lastIndexOf("}")+1:n[1].indexOf(this.formatSeparator);if(-1!==h&&(a=n[1].slice(h).split(this.formatSeparator).map((t=>t.trim())).filter(Boolean),n[1]=n[1].slice(0,h)),r=i(o.call(this,n[1].trim(),s),s),r&&n[0]===t&&!gt(r))return r;gt(r)||(r=bt(r)),r||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${t}`),r=""),a.length&&(r=a.reduce(((t,i)=>this.format(t,i,e.lng,{...e,interpolationkey:n[1].trim()})),r.trim())),t=t.replace(n[0],r),this.regexp.lastIndex=0}return t}}const Zt=t=>{const i={};return(e,n,r)=>{let s=r;r&&r.interpolationkey&&r.formatParams&&r.formatParams[r.interpolationkey]&&r[r.interpolationkey]&&(s={...s,[r.interpolationkey]:void 0});const o=n+JSON.stringify(s);let a=i[o];return a||(a=t(It(n),r),i[o]=a),a(e)}},Kt=t=>(i,e,n)=>t(It(e),n)(i);class Jt{constructor(t={}){this.logger=Pt.create("formatter"),this.options=t,this.init(t)}init(t,i={interpolation:{}}){this.formatSeparator=i.interpolation.formatSeparator||",";const e=i.cacheInBuiltFormats?Zt:Kt;this.formats={number:e(((t,i)=>{const e=new Intl.NumberFormat(t,{...i});return t=>e.format(t)})),currency:e(((t,i)=>{const e=new Intl.NumberFormat(t,{...i,style:"currency"});return t=>e.format(t)})),datetime:e(((t,i)=>{const e=new Intl.DateTimeFormat(t,{...i});return t=>e.format(t)})),relativetime:e(((t,i)=>{const e=new Intl.RelativeTimeFormat(t,{...i});return t=>e.format(t,i.range||"day")})),list:e(((t,i)=>{const e=new Intl.ListFormat(t,{...i});return t=>e.format(t)}))}}add(t,i){this.formats[t.toLowerCase().trim()]=i}addCached(t,i){this.formats[t.toLowerCase().trim()]=Zt(i)}format(t,i,e,n={}){const r=i.split(this.formatSeparator);if(r.length>1&&r[0].indexOf("(")>1&&r[0].indexOf(")")<0&&r.find((t=>t.indexOf(")")>-1))){const t=r.findIndex((t=>t.indexOf(")")>-1));r[0]=[r[0],...r.splice(1,t)].join(this.formatSeparator)}return r.reduce(((t,i)=>{const{formatName:r,formatOptions:s}=(t=>{let i=t.toLowerCase().trim();const e={};if(t.indexOf("(")>-1){const n=t.split("(");i=n[0].toLowerCase().trim();const r=n[1].substring(0,n[1].length-1);"currency"===i&&r.indexOf(":")<0?e.currency||(e.currency=r.trim()):"relativetime"===i&&r.indexOf(":")<0?e.range||(e.range=r.trim()):r.split(";").forEach((t=>{if(t){const[i,...n]=t.split(":"),r=n.join(":").trim().replace(/^'+|'+$/g,""),s=i.trim();e[s]||(e[s]=r),"false"===r&&(e[s]=!1),"true"===r&&(e[s]=!0),isNaN(r)||(e[s]=parseInt(r,10))}}))}return{formatName:i,formatOptions:e}})(i);if(this.formats[r]){let i=t;try{const o=n?.formatParams?.[n.interpolationkey]||{};i=this.formats[r](t,o.locale||o.lng||n.locale||n.lng||e,{...s,...n,...o})}catch(t){this.logger.warn(t)}return i}return this.logger.warn(`there was no format function for ${r}`),t}),t)}}class Qt extends zt{constructor(t,i,e,n={}){super(),this.backend=t,this.store=i,this.services=e,this.languageUtils=e.languageUtils,this.options=n,this.logger=Pt.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=n.maxParallelReads||10,this.readingCalls=0,this.maxRetries=n.maxRetries>=0?n.maxRetries:5,this.retryTimeout=n.retryTimeout>=1?n.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(e,n.backend,n)}queueLoad(t,i,e,n){const r={},s={},o={},a={};return t.forEach((t=>{let n=!0;i.forEach((i=>{const o=`${t}|${i}`;!e.reload&&this.store.hasResourceBundle(t,i)?this.state[o]=2:this.state[o]<0||(1===this.state[o]?void 0===s[o]&&(s[o]=!0):(this.state[o]=1,n=!1,void 0===s[o]&&(s[o]=!0),void 0===r[o]&&(r[o]=!0),void 0===a[i]&&(a[i]=!0)))})),n||(o[t]=!0)})),(Object.keys(r).length||Object.keys(s).length)&&this.queue.push({pending:s,pendingCount:Object.keys(s).length,loaded:{},errors:[],callback:n}),{toLoad:Object.keys(r),pending:Object.keys(s),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(a)}}loaded(t,i,e){const n=t.split("|"),r=n[0],s=n[1];i&&this.emit("failedLoading",r,s,i),!i&&e&&this.store.addResourceBundle(r,s,e,void 0,void 0,{skipCopy:!0}),this.state[t]=i?-1:2,i&&e&&(this.state[t]=0);const o={};this.queue.forEach((e=>{((t,i,e)=>{const{obj:n,k:r}=xt(t,i,Object);n[r]=n[r]||[],n[r].push(e)})(e.loaded,[r],s),((t,i)=>{void 0!==t.pending[i]&&(delete t.pending[i],t.pendingCount--)})(e,t),i&&e.errors.push(i),0!==e.pendingCount||e.done||(Object.keys(e.loaded).forEach((t=>{o[t]||(o[t]={});const i=e.loaded[t];i.length&&i.forEach((i=>{void 0===o[t][i]&&(o[t][i]=!0)}))})),e.done=!0,e.errors.length?e.callback(e.errors):e.callback())})),this.emit("loaded",o),this.queue=this.queue.filter((t=>!t.done))}read(t,i,e,n=0,r=this.retryTimeout,s){if(!t.length)return s(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:t,ns:i,fcName:e,tried:n,wait:r,callback:s});this.readingCalls++;const o=(o,a)=>{if(this.readingCalls--,this.waitingReads.length>0){const t=this.waitingReads.shift();this.read(t.lng,t.ns,t.fcName,t.tried,t.wait,t.callback)}o&&a&&n<this.maxRetries?setTimeout((()=>{this.read.call(this,t,i,e,n+1,2*r,s)}),r):s(o,a)},a=this.backend[e].bind(this.backend);if(2!==a.length)return a(t,i,o);try{const e=a(t,i);e&&"function"==typeof e.then?e.then((t=>o(null,t))).catch(o):o(null,e)}catch(t){o(t)}}prepareLoading(t,i,e={},n){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),n&&n();gt(t)&&(t=this.languageUtils.toResolveHierarchy(t)),gt(i)&&(i=[i]);const r=this.queueLoad(t,i,e,n);if(!r.toLoad.length)return r.pending.length||n(),null;r.toLoad.forEach((t=>{this.loadOne(t)}))}load(t,i,e){this.prepareLoading(t,i,{},e)}reload(t,i,e){this.prepareLoading(t,i,{reload:!0},e)}loadOne(t,i=""){const e=t.split("|"),n=e[0],r=e[1];this.read(n,r,"read",void 0,void 0,((e,s)=>{e&&this.logger.warn(`${i}loading namespace ${r} for language ${n} failed`,e),!e&&s&&this.logger.log(`${i}loaded namespace ${r} for language ${n}`,s),this.loaded(t,e,s)}))}saveMissing(t,i,e,n,r,s={},o=()=>{}){if(!this.services?.utils?.hasLoadedNamespace||this.services?.utils?.hasLoadedNamespace(i)){if(null!=e&&""!==e){if(this.backend?.create){const a={...s,isUpdate:r},h=this.backend.create.bind(this.backend);if(h.length<6)try{let r;r=5===h.length?h(t,i,e,n,a):h(t,i,e,n),r&&"function"==typeof r.then?r.then((t=>o(null,t))).catch(o):o(null,r)}catch(t){o(t)}else h(t,i,e,n,o,a)}t&&t[0]&&this.store.addResource(t[0],i,e,n)}}else this.logger.warn(`did not save key "${e}" as the namespace "${i}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")}}const ti=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let i={};if("object"==typeof t[1]&&(i=t[1]),gt(t[1])&&(i.defaultValue=t[1]),gt(t[2])&&(i.tDescription=t[2]),"object"==typeof t[2]||"object"==typeof t[3]){const e=t[3]||t[2];Object.keys(e).forEach((t=>{i[t]=e[t]}))}return i},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),ii=t=>(gt(t.ns)&&(t.ns=[t.ns]),gt(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),gt(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs?.indexOf?.("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),"boolean"==typeof t.initImmediate&&(t.initAsync=t.initImmediate),t),ei=()=>{},ni="__i18next_supportNoticeShown";class ri extends zt{constructor(t={},i){var e;if(super(),this.options=ii(t),this.services={},this.logger=Pt,this.modules={external:[]},e=this,Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((t=>{"function"==typeof e[t]&&(e[t]=e[t].bind(e))})),i&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,i),this;setTimeout((()=>{this.init(t,i)}),0)}}init(t={},i){this.isInitializing=!0,"function"==typeof t&&(i=t,t={}),null==t.defaultNS&&t.ns&&(gt(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const e=ti();var n;this.options={...e,...this.options,...ii(t)},this.options.interpolation={...e.interpolation,...this.options.interpolation},void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator),"function"!=typeof this.options.overloadTranslationOptionHandler&&(this.options.overloadTranslationOptionHandler=e.overloadTranslationOptionHandler),!1===this.options.showSupportNotice||(n=this,n?.modules?.backend?.name?.indexOf("Locize")>0||n?.modules?.backend?.constructor?.name?.indexOf("Locize")>0||n?.options?.backend?.backends&&n.options.backend.backends.some((t=>t?.name?.indexOf("Locize")>0||t?.constructor?.name?.indexOf("Locize")>0))||n?.options?.backend?.projectId||n?.options?.backend?.backendOptions&&n.options.backend.backendOptions.some((t=>t?.projectId)))||"undefined"!=typeof globalThis&&globalThis[ni]||"undefined"!=typeof process&&process.env&&process.env.I18NEXT_NO_SUPPORT_NOTICE||"undefined"!=typeof process&&process.env||("undefined"!=typeof console&&void 0!==console.info&&console.info("🌐 i18next is made possible by our own product, Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙"),"undefined"!=typeof globalThis&&(globalThis[ni]=!0));const r=t=>t?"function"==typeof t?new t:t:null;if(!this.options.isClone){let t;Pt.init(this.modules.logger?r(this.modules.logger):null,this.options),t=this.modules.formatter?this.modules.formatter:Jt;const i=new Ut(this.options);this.store=new Wt(this.options.resources,this.options);const n=this.services;n.logger=Pt,n.resourceStore=this.store,n.languageUtils=i,n.pluralResolver=new Xt(i,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==e.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),!t||this.options.interpolation.format&&this.options.interpolation.format!==e.interpolation.format||(n.formatter=r(t),n.formatter.init&&n.formatter.init(n,this.options),this.options.interpolation.format=n.formatter.format.bind(n.formatter)),n.interpolator=new Yt(this.options),n.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},n.backendConnector=new Qt(r(this.modules.backend),n.resourceStore,n,this.options),n.backendConnector.on("*",((t,...i)=>{this.emit(t,...i)})),this.modules.languageDetector&&(n.languageDetector=r(this.modules.languageDetector),n.languageDetector.init&&n.languageDetector.init(n,this.options.detection,this.options)),this.modules.i18nFormat&&(n.i18nFormat=r(this.modules.i18nFormat),n.i18nFormat.init&&n.i18nFormat.init(this)),this.translator=new Nt(this.services,this.options),this.translator.on("*",((t,...i)=>{this.emit(t,...i)})),this.modules.external.forEach((t=>{t.init&&t.init(this)}))}if(this.format=this.options.interpolation.format,i||(i=ei),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const t=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);t.length>0&&"dev"!==t[0]&&(this.options.lng=t[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((t=>{this[t]=(...i)=>this.store[t](...i)})),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((t=>{this[t]=(...i)=>(this.store[t](...i),this)}));const s=mt(),o=()=>{const t=(t,e)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),s.resolve(e),i(t,e)};if(this.languages&&!this.isInitialized)return t(null,this.t.bind(this));this.changeLanguage(this.options.lng,t)};return this.options.resources||!this.options.initAsync?o():setTimeout(o,0),s}loadResources(t,i=ei){let e=i;const n=gt(t)?t:this.language;if("function"==typeof t&&(e=t),!this.options.resources||this.options.partialBundledLanguages){if("cimode"===n?.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return e();const t=[],i=i=>{i&&"cimode"!==i&&this.services.languageUtils.toResolveHierarchy(i).forEach((i=>{"cimode"!==i&&t.indexOf(i)<0&&t.push(i)}))};n?i(n):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((t=>i(t))),this.options.preload?.forEach?.((t=>i(t))),this.services.backendConnector.load(t,this.options.ns,(t=>{t||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),e(t)}))}else e(null)}reloadResources(t,i,e){const n=mt();return"function"==typeof t&&(e=t,t=void 0),"function"==typeof i&&(e=i,i=void 0),t||(t=this.languages),i||(i=this.options.ns),e||(e=ei),this.services.backendConnector.reload(t,i,(t=>{n.resolve(),e(t)})),n}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===t.type&&(this.modules.backend=t),("logger"===t.type||t.log&&t.warn&&t.error)&&(this.modules.logger=t),"languageDetector"===t.type&&(this.modules.languageDetector=t),"i18nFormat"===t.type&&(this.modules.i18nFormat=t),"postProcessor"===t.type&&Dt.addPostProcessor(t),"formatter"===t.type&&(this.modules.formatter=t),"3rdParty"===t.type&&this.modules.external.push(t),this}setResolvedLanguage(t){if(t&&this.languages&&!(["cimode","dev"].indexOf(t)>-1)){for(let t=0;t<this.languages.length;t++){const i=this.languages[t];if(!(["cimode","dev"].indexOf(i)>-1)&&this.store.hasLanguageSomeTranslations(i)){this.resolvedLanguage=i;break}}!this.resolvedLanguage&&this.languages.indexOf(t)<0&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,i){this.isLanguageChangingTo=t;const e=mt();this.emit("languageChanging",t);const n=t=>{this.language=t,this.languages=this.services.languageUtils.toResolveHierarchy(t),this.resolvedLanguage=void 0,this.setResolvedLanguage(t)},r=(r,s)=>{s?this.isLanguageChangingTo===t&&(n(s),this.translator.changeLanguage(s),this.isLanguageChangingTo=void 0,this.emit("languageChanged",s),this.logger.log("languageChanged",s)):this.isLanguageChangingTo=void 0,e.resolve(((...t)=>this.t(...t))),i&&i(r,((...t)=>this.t(...t)))},s=i=>{t||i||!this.services.languageDetector||(i=[]);const e=gt(i)?i:i&&i[0],s=this.store.hasLanguageSomeTranslations(e)?e:this.services.languageUtils.getBestMatchFromCodes(gt(i)?[i]:i);s&&(this.language||n(s),this.translator.language||this.translator.changeLanguage(s),this.services.languageDetector?.cacheUserLanguage?.(s)),this.loadResources(s,(t=>{r(t,s)}))};return t||!this.services.languageDetector||this.services.languageDetector.async?!t&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(s):this.services.languageDetector.detect(s):s(t):s(this.services.languageDetector.detect()),e}getFixedT(t,i,e){const n=(t,i,...r)=>{let s;s="object"!=typeof i?this.options.overloadTranslationOptionHandler([t,i].concat(r)):{...i},s.lng=s.lng||n.lng,s.lngs=s.lngs||n.lngs,s.ns=s.ns||n.ns,""!==s.keyPrefix&&(s.keyPrefix=s.keyPrefix||e||n.keyPrefix);const o={...this.options,...s};"function"==typeof s.keyPrefix&&(s.keyPrefix=Ft(s.keyPrefix,o));const a=this.options.keySeparator||".";let h;return s.keyPrefix&&Array.isArray(t)?h=t.map((t=>("function"==typeof t&&(t=Ft(t,o)),`${s.keyPrefix}${a}${t}`))):("function"==typeof t&&(t=Ft(t,o)),h=s.keyPrefix?`${s.keyPrefix}${a}${t}`:t),this.t(h,s)};return gt(t)?n.lng=t:n.lngs=t,n.ns=i,n.keyPrefix=e,n}t(...t){return this.translator?.translate(...t)}exists(...t){return this.translator?.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,i={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const e=i.lng||this.resolvedLanguage||this.languages[0],n=!!this.options&&this.options.fallbackLng,r=this.languages[this.languages.length-1];if("cimode"===e.toLowerCase())return!0;const s=(t,i)=>{const e=this.services.backendConnector.state[`${t}|${i}`];return-1===e||0===e||2===e};if(i.precheck){const t=i.precheck(this,s);if(void 0!==t)return t}return!(!this.hasResourceBundle(e,t)&&this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages)&&(!s(e,t)||n&&!s(r,t)))}loadNamespaces(t,i){const e=mt();return this.options.ns?(gt(t)&&(t=[t]),t.forEach((t=>{this.options.ns.indexOf(t)<0&&this.options.ns.push(t)})),this.loadResources((t=>{e.resolve(),i&&i(t)})),e):(i&&i(),Promise.resolve())}loadLanguages(t,i){const e=mt();gt(t)&&(t=[t]);const n=this.options.preload||[],r=t.filter((t=>n.indexOf(t)<0&&this.services.languageUtils.isSupportedCode(t)));return r.length?(this.options.preload=n.concat(r),this.loadResources((t=>{e.resolve(),i&&i(t)})),e):(i&&i(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!t)return"rtl";try{const i=new Intl.Locale(t);if(i&&i.getTextInfo){const t=i.getTextInfo();if(t&&t.direction)return t.direction}}catch(t){}const i=this.services?.languageUtils||new Ut(ti());return t.toLowerCase().indexOf("-latn")>1?"ltr":["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(i.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},i){const e=new ri(t,i);return e.createInstance=ri.createInstance,e}cloneInstance(t={},i=ei){const e=t.forkResourceStore;e&&delete t.forkResourceStore;const n={...this.options,...t,isClone:!0},r=new ri(n);if(void 0===t.debug&&void 0===t.prefix||(r.logger=r.logger.clone(t)),["store","services","language"].forEach((t=>{r[t]=this[t]})),r.services={...this.services},r.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},e){const t=Object.keys(this.store.data).reduce(((t,i)=>(t[i]={...this.store.data[i]},t[i]=Object.keys(t[i]).reduce(((e,n)=>(e[n]={...t[i][n]},e)),t[i]),t)),{});r.store=new Wt(t,n),r.services.resourceStore=r.store}if(t.interpolation){const i={...ti().interpolation,...this.options.interpolation,...t.interpolation},e={...n,interpolation:i};r.services.interpolator=new Yt(e)}return r.translator=new Nt(r.services,n),r.translator.on("*",((t,...i)=>{r.emit(t,...i)})),r.init(n,i),r.translator.options=n,r.translator.backendConnector.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},r}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const si=ri.createInstance(),{slice:oi,forEach:ai}=[],hi=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,ui={create(t,i,e,n){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{path:"/",sameSite:"strict"};e&&(r.expires=new Date,r.expires.setTime(r.expires.getTime()+60*e*1e3)),n&&(r.domain=n),document.cookie=function(t,i){const e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{path:"/"};let n=`${t}=${encodeURIComponent(i)}`;if(e.maxAge>0){const t=e.maxAge-0;if(Number.isNaN(t))throw new Error("maxAge should be a Number");n+=`; Max-Age=${Math.floor(t)}`}if(e.domain){if(!hi.test(e.domain))throw new TypeError("option domain is invalid");n+=`; Domain=${e.domain}`}if(e.path){if(!hi.test(e.path))throw new TypeError("option path is invalid");n+=`; Path=${e.path}`}if(e.expires){if("function"!=typeof e.expires.toUTCString)throw new TypeError("option expires is invalid");n+=`; Expires=${e.expires.toUTCString()}`}if(e.httpOnly&&(n+="; HttpOnly"),e.secure&&(n+="; Secure"),e.sameSite)switch("string"==typeof e.sameSite?e.sameSite.toLowerCase():e.sameSite){case!0:n+="; SameSite=Strict";break;case"lax":n+="; SameSite=Lax";break;case"strict":n+="; SameSite=Strict";break;case"none":n+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return e.partitioned&&(n+="; Partitioned"),n}(t,i,r)},read(t){const i=`${t}=`,e=document.cookie.split(";");for(let t=0;t<e.length;t++){let n=e[t];for(;" "===n.charAt(0);)n=n.substring(1,n.length);if(0===n.indexOf(i))return n.substring(i.length,n.length)}return null},remove(t,i){this.create(t,"",-1,i)}};var ci={name:"cookie",lookup(t){let{lookupCookie:i}=t;if(i&&"undefined"!=typeof document)return ui.read(i)||void 0},cacheUserLanguage(t,i){let{lookupCookie:e,cookieMinutes:n,cookieDomain:r,cookieOptions:s}=i;e&&"undefined"!=typeof document&&ui.create(e,t,n,r,s)}},li={name:"querystring",lookup(t){let i,{lookupQuerystring:e}=t;if("undefined"!=typeof window){let{search:t}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(t=window.location.hash.substring(window.location.hash.indexOf("?")));const n=t.substring(1).split("&");for(let t=0;t<n.length;t++){const r=n[t].indexOf("=");r>0&&n[t].substring(0,r)===e&&(i=n[t].substring(r+1))}}return i}},di={name:"hash",lookup(t){let i,{lookupHash:e,lookupFromHashIndex:n}=t;if("undefined"!=typeof window){const{hash:t}=window.location;if(t&&t.length>2){const r=t.substring(1);if(e){const t=r.split("&");for(let n=0;n<t.length;n++){const r=t[n].indexOf("=");r>0&&t[n].substring(0,r)===e&&(i=t[n].substring(r+1))}}if(i)return i;if(!i&&n>-1){const i=t.match(/\/([a-zA-Z-]*)/g);if(!Array.isArray(i))return;const e="number"==typeof n?n:0;return i[e]?.replace("/","")}}}return i}};let fi=null;const pi=()=>{if(null!==fi)return fi;try{if(fi="undefined"!=typeof window&&null!==window.localStorage,!fi)return!1;const t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch(t){fi=!1}return fi};var gi={name:"localStorage",lookup(t){let{lookupLocalStorage:i}=t;if(i&&pi())return window.localStorage.getItem(i)||void 0},cacheUserLanguage(t,i){let{lookupLocalStorage:e}=i;e&&pi()&&window.localStorage.setItem(e,t)}};let mi=null;const bi=()=>{if(null!==mi)return mi;try{if(mi="undefined"!=typeof window&&null!==window.sessionStorage,!mi)return!1;const t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch(t){mi=!1}return mi};var vi={name:"sessionStorage",lookup(t){let{lookupSessionStorage:i}=t;if(i&&bi())return window.sessionStorage.getItem(i)||void 0},cacheUserLanguage(t,i){let{lookupSessionStorage:e}=i;e&&bi()&&window.sessionStorage.setItem(e,t)}},wi={name:"navigator",lookup(t){const i=[];if("undefined"!=typeof navigator){const{languages:t,userLanguage:e,language:n}=navigator;if(t)for(let e=0;e<t.length;e++)i.push(t[e]);e&&i.push(e),n&&i.push(n)}return i.length>0?i:void 0}},yi={name:"htmlTag",lookup(t){let i,{htmlTag:e}=t;const n=e||("undefined"!=typeof document?document.documentElement:null);return n&&"function"==typeof n.getAttribute&&(i=n.getAttribute("lang")),i}},xi={name:"path",lookup(t){let{lookupFromPathIndex:i}=t;if("undefined"==typeof window)return;const e=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(!Array.isArray(e))return;const n="number"==typeof i?i:0;return e[n]?.replace("/","")}},ki={name:"subdomain",lookup(t){let{lookupFromSubdomainIndex:i}=t;const e="number"==typeof i?i+1:1,n="undefined"!=typeof window&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(n)return n[e]}};let Ai=!1;try{Ai=!0}catch(t){}const Si=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];Ai||Si.splice(1,1);class ji{constructor(t){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(t,i)}init(){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{languageUtils:{}},this.options=function(t){return ai.call(oi.call(arguments,1),(i=>{if(i)for(const e in i)void 0===t[e]&&(t[e]=i[e])})),t}(t,this.options||{},{order:Si,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:t=>t}),"string"==typeof this.options.convertDetectedLanguage&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=t=>t.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=i,this.addDetector(ci),this.addDetector(li),this.addDetector(gi),this.addDetector(vi),this.addDetector(wi),this.addDetector(yi),this.addDetector(xi),this.addDetector(ki),this.addDetector(di)}addDetector(t){return this.detectors[t.name]=t,this}detect(){let t=[];return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.order).forEach((i=>{if(this.detectors[i]){let e=this.detectors[i].lookup(this.options);e&&"string"==typeof e&&(e=[e]),e&&(t=t.concat(e))}})),t=t.filter((t=>{return null!=t&&!("string"==typeof(i=t)&&[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some((t=>t.test(i))));var i})).map((t=>this.options.convertDetectedLanguage(t))),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?t:t.length>0?t[0]:null}cacheUserLanguage(t){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.caches;i&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(t)>-1||i.forEach((i=>{this.detectors[i]&&this.detectors[i].cacheUserLanguage(t,this.options)})))}}ji.type="languageDetector";si.use(ji).init({resources:{en:{translation:{"Do you want to exit? button":"Do you want to exit?","Exit button":"Exit","Continue playing button":"Continue playing","Drop the elements to match the given symbol order":"Drop the elements to match the given symbol order","Fill in the blanks":"Fill in the blanks",instruction:{dragAndDrop:"Match the items by dragging and dropping them into the correct places.",mcq:"Select the correct answer from the options provided.",tracing:"Trace the shape by following the outline carefully.",flashcards:"Review the flashcards to reinforce your learning.",substractionWithImage:"substractionWithImageEngAudio",substractionWithoutImage:"substractionWithoutImageEngAudio",numberIdentificationWithImage:"numberIdentificationWithImageEngAudio",numberIdentificationWithoutImage:"numberIdentificationWithoutImageEngAudio",wordBuildingWithImage:"wordBuildingWithImageEngAudio",wordBuildingWithoutImage:"wordBuildingWithoutImageEngAudio",pictureClues:"pictureCluesEngAudio",pictureWordMatchMultipleImages:"pictureWordMatchMultipleImagesEngAudio",pictureWordMatchSingleImage:"pictureWordMatchSingleImageEngAudio",sentenceMatch:"sentenceMatchEngAudio",imageMatch:"imageMatchEngAudio",palStoryTale:"palStoryTaleEngAudio",palEgmaPatternMatching:"palEgmaPatternMatchingEngAudio",palEgmaWordProblemDragnDrop:"palEgmaWordProblemDragnDropEngAudio",palEgmaWordProblemClick:"palEgmaWordProblemClickEngAudio",palEgraOddOneOut:"palEgraOddOneOutEngAudio",palEgraArrangePictures:"palEgraArrangePicturesEngAudio",palEgraBuildWord:"palEgraBuildWordEngAudio",palEgraWordFormation:"palEgraWordFormationEngAudio",palInventedSpelling:"palInventedSpellingEngAudio",palLetterIdentification:"palLetterIdentificationEngAudio",palStoryMaking:"palStoryMakingEngAudio",palegmasumtogether:"palegmasumtogetherEngAudio",palegmamultioption:"palegmamultioptionEngAudio",palegraoptionaudio:"palegraoptionaudioEngAudio",palegrawordmatch:"palegrawordmatchEngAudio",palegramcqimages:"palegramcqimagesEngAudio"}}},fr:{translation:{"Do you want to exit? button":"Voulez-vous quitter?","Exit button":"Quitter","Continue playing button":"Continuer à jouer","Drop the elements to match the given symbol order":"Déposez les éléments pour correspondre au symbole donné","Fill in the blanks":"Remplissez les blancs",instruction:{dragAndDrop:"Faites glisser les objets vers le bon emplacement.",mcq:"Choisissez la bonne réponse parmi les options proposées.",tracing:"Tracez soigneusement la forme en suivant la ligne.",flashcards:"Regardez les cartes mémoire pour renforcer l’apprentissage."}}},hi:{translation:{"Do you want to exit? button":"क्या आप बाहर निकलना चाहते हैं?","Exit button":"बाहर निकलें","Continue playing button":"खेलना जारी रखें","Drop the elements to match the given symbol order":"दिए गए चिन्ह से मिलाने के लिए तत्वों को ड्रॉप करें","Fill in the blanks":"रिक्त स्थान भरें",instruction:{dragAndDrop:"Match the items by dragging and dropping them into the correct places.",mcq:"Select the correct answer from the options provided.",tracing:"Trace the shape by following the outline carefully.",flashcards:"Review the flashcards to reinforce your learning.",substractionWithImage:"substractionWithImageHiAudio",substractionWithoutImage:"substractionWithoutImageHiAudio",numberIdentificationWithImage:"numberIdentificationWithImageHiAudio",numberIdentificationWithoutImage:"numberIdentificationWithoutImageHiAudio",wordBuildingWithImage:"wordBuildingWithImageHiAudio",wordBuildingWithoutImage:"wordBuildingWithoutImageHiAudio",pictureClues:"pictureCluesHiAudio",pictureWordMatchMultipleImages:"pictureWordMatchMultipleImagesHiAudio",pictureWordMatchSingleImage:"pictureWordMatchSingleImageHiAudio",sentenceMatch:"sentenceMatchHiAudio",imageMatch:"imageMatchHiAudio",palStoryTale:"palStoryTaleHiAudio",palEgmaPatternMatching:"palEgmaPatternMatchingHiAudio",palEgmaWordProblemDragnDrop:"palEgmaWordProblemDragnDropHiAudio",palEgmaWordProblemClick:"palEgmaWordProblemClickHiAudio",palEgraOddOneOut:"palEgraOddOneOutHiAudio",palEgraArrangePictures:"palEgraArrangePicturesHiAudio",palEgraBuildWord:"palEgraBuildWordHiAudio",palEgraWordFormation:"palEgraWordFormationHiAudio",palInventedSpelling:"palInventedSpellingHiAudio",palLetterIdentification:"palLetterIdentificationHiAudio",palStoryMaking:"palStoryMakingHiAudio",palegmasumtogether:"palegmasumtogetherHiAudio",palegmamultioption:"palegmamultioptionHiAudio",palegraoptionaudio:"palegraoptionaudioHiAudio",palegrawordmatch:"palegrawordmatchHiAudio",palegramcqimages:"palegramcqimagesHiAudio"}}},kn:{translation:{"Do you want to exit? button":"ನೀವು ನಿರ್ಗಮಿಸಲು ಬಯಸುವಿರಾ?","Exit button":"ನಿರ್ಗಮಿಸು","Continue playing button":"ಆಟವನ್ನು ಮುಂದುವರಿಸಿ","Drop the elements to match the given symbol order":"ನೀಡಿರುವ ಸಂಕೇತಕ್ಕೆ ಹೊಂದುವಂತೆ ಅಂಶಗಳನ್ನು ಬಿಡಿ","Fill in the blanks":"ಖಾಲಿ ಸ್ಥಳಗಳನ್ನು ಭರ್ತಿ ಮಾಡಿ",instruction:{dragAndDrop:"Match the items by dragging and dropping them into the correct places.",mcq:"Select the correct answer from the options provided.",tracing:"Trace the shape by following the outline carefully.",flashcards:"Review the flashcards to reinforce your learning.",substractionWithImage:"substractionWithImageKaAudio",substractionWithoutImage:"substractionWithoutImageKaAudio",numberIdentificationWithImage:"numberIdentificationWithImageKaAudio",numberIdentificationWithoutImage:"numberIdentificationWithoutImageKaAudio",wordBuildingWithImage:"wordBuildingWithImageKaAudio",wordBuildingWithoutImage:"wordBuildingWithoutImageKaAudio",pictureClues:"pictureCluesKaAudio",pictureWordMatchMultipleImages:"pictureWordMatchMultipleImagesKaAudio",pictureWordMatchSingleImage:"pictureWordMatchSingleImageKaAudio",sentenceMatch:"sentenceMatchKaAudio",imageMatch:"imageMatchKaAudio",palStoryTale:"palStoryTaleKaAudio",palEgmaPatternMatching:"palEgmaPatternMatchingKaAudio",palEgmaWordProblemDragnDrop:"palEgmaWordProblemDragnDropKaAudio",palEgmaWordProblemClick:"palEgmaWordProblemClickKaAudio",palEgraOddOneOut:"palEgraOddOneOutKaAudio",palEgraArrangePictures:"palEgraArrangePicturesKaAudio",palEgraBuildWord:"palEgraBuildWordKaAudio",palEgraWordFormation:"palEgraWordFormationKaAudio",palInventedSpelling:"palInventedSpellingKaAudio",palLetterIdentification:"palLetterIdentificationKaAudio",palStoryMaking:"palStoryMakingKaAudio",palegmasumtogether:"palegmasumtogetherKaAudio",palegmamultioption:"palegmamultioptionKaAudio",palegraoptionaudio:"palegraoptionaudioKaAudio",palegrawordmatch:"palegrawordmatchKaAudio",palegramcqimages:"palegramcqimagesKaAudio"}}},te:{translation:{"Do you want to exit? button":"మీరు బయటకు వెళ్లాలనుకుంటున్నారా?","Exit button":"బయటకు వెళ్ళు","Continue playing button":"ఆటను కొనసాగించు","Drop the elements to match the given symbol order":"ఇచ్చిన చిహ్నానికి సరిపడేలా అంశాలను డ్రాప్ చేయಂడಿ","Fill in the blanks":"ಖಾಲಿ ಸ್ಥಳಗಳನ್ನು ಭರ್ತಿ ಮಾಡಿ"}},pt:{translation:{"Do you want to exit? button":"Você deseja sair?","Exit button":"Sair","Continue playing button":"Continuar jogando","Drop the elements to match the given symbol order":"Solte os elementos para corresponder à ordem dos símbolos fornecida","Fill in the blanks":"Preencha os espaços em branco"}},mr:{translation:{"Do you want to exit? button":"तुम्हाला बाहेर पडायचे आहे का?","Exit button":"बाहेर पडा","Continue playing button":"खेळ सुरू ठेवा",instruction:{dragAndDrop:"वस्तू योग्य ठिकाणी ओढून आणि सोडून जुळवा.",mcq:"दिलेल्या पर्यायांमधून योग्य उत्तर निवडा.",tracing:"रेषेचा काळजीपूर्वक मागोवा घेत आकृती काढा.",flashcards:"तुमचे शिक्षण मजबूत करण्यासाठी फ्लॅशकार्ड्स पाहा."}}}},fallbackLng:"en",debug:!1,interpolation:{escapeValue:!1},detection:{order:["querystring","localStorage","navigator","htmlTag"],caches:["localStorage"]}});const Mi=class{constructor(i){t(this,i),this.Lang="",this.showDropBorder=!0,this.appendToDropOnCompletion=!1,this.id="",this.objective="",this.customStyle="",this.value="",this.height="auto",this.width="auto",this.ariaLabel="auto",this.ariaHidden="",this.x="0px",this.y="0px",this.z="0",this.bgColor="",this.bgImage="",this.type="",this.tabIndex=0,this.visible=!1,this.audio="",this.onTouch="",this.onInCorrect="",this.onCorrect="",this.onEntry="",this.canplay=!0,this.showCheck=!1,this.isContinueOnCorrect=!1,this.isAllowOnlyCorrect=!1,this.baseUrl="",this.margin="",this.showPrevButton="false",this.showNextButton="false",this.delayVisible="",this.disableSpeak=!1,this.templateId="",this.highlightWordByWord=!1,this.instructName="",this.speakFlag=!1,this.handleWindowResize=()=>this.scaleContainer(this.el),this.handleWindowLoad=()=>this.scaleContainer(this.el)}cleanupInteractionHandlers(){this.el.querySelectorAll('[type="drag"], [type="slide"], [move="true"]').forEach((t=>{t.dispatchEvent(new Event(x))}))}languageChanged(t){const i=t||this.resolveLanguage();this.updateChildTextLanguage(i)}componentWillLoad(){const t=this.resolveLanguage();this.updateChildTextLanguage(t),this.resolveInstructionAudio()}resolveInstructionAudio(){var t;this.instructName=null!==(t={flashcard:"instruction.flashcards",mcq:"instruction.mcq",tracing:"instruction.tracing",dragAndDrop:"instruction.dragAndDrop",arrangeLetters:"arrangeLetters",balancing:"balancing",balloonPop:"balloonPop",blender:"blender",bubbleType:"bubbleType",calculator:"calculator",categorize:"categorize",checkerBlocks:"checkerBlocks",createSentence:"createSentence",fillAnswer:"fillAnswer",fillBlank:"fillBlank",fillUp:"fillUp",flashcardtemplate:"flashcard",foodJar:"foodJar",grid:"grid",imageMatchWithQuestionImageAndMultiOption:"imageMatchWithQuestionImageAndMultiOption",inventedSpelling:"inventedSpelling",jumpSentence:"jumpSentence",letterBoard:"letterBoard",letterIdentification:"letterIdentification",letterPairing:"letterPairing",makeSentence:"makeSentence",matchingCard:"matchingCard",multiplyBeeds:"multiplyBeeds",nimbleTable:"nimbleTable",numberBoardOneTwo:"numberBoardOneTwo",numberPair:"numberPair",openWindow:"openWindow",orderTractor:"orderTractor",phonicTractor:"phonicTractor",pictureMeaningCocos:"pictureMeaningCocos",pictureWordMatch1:"pictureWordMatch1",pictureWordMatch2:"pictureWordMatch2",puzzleGame:"puzzleGame",questionBoard:"questionBoard",quizLiteracySentenceSentence:"quizLiteracySentenceSentence",quizLiteracySoundOnlyImage:"quizLiteracySoundOnlyImage",quizLiteracySoundOnlySentence:"quizLiteracySoundOnlySentence",quizLiteracySoundOnlyWord:"quizLiteracySoundonlyWord",quizLiteracyAndShapes1:"quizLiteracyAndShapes1",quizLiteracyImageWithText:"quizLiteracyImageWithText",quizliteracyImageWord:"quizliteracyImageWord",quizMathBiggerAndSmaller:"quizMathBiggerAndSmaller",quizMathBiggestAndSmallest:"quizMathBiggestAndSmallest",quizmathCustomNumberMagnitude:"quizmathCustomNumberMagnitude",quizMathHowMany:"quizMathHowMany",quizmathMissingnumberDrag:"quizmathMissingnumberDrag",quizMathNumberIdentification:"quizMathNumberIdentification",quizMathOperationWithobjects:"quizMathOperationWithobjects",quizMathoperationWithoutObjects:"quizMathoperationWithoutObjects",quizMathRecognizeNumber:"quizMathRecognizeNumber",quizMathShapes:"quizMathShapes",reorder:"reorder",rocketGame:"rocketGame",rowBlock:"rowBlock",sequenceBox1:"sequenceBox1",shapeTractor:"shapeTractor",spellDoor:"spellDoor",storyMaking:"storyMaking",storyTale:"storyTale",sumTogether:"sumTogether",tag:"tag",total:"total",writeCard:"writeCard",writeLetter:"writeLetter",writeNumber:"writeNumber",writeSet:"writeSet",writeWord:"writeWord",numberIdentification:"numberIdentification",wordBuildingWithAndWithoutImage:"wordBuildingWithAndWithoutImage",subsWithAndWithoutImage:"subsWithAndWithoutImage",sentenceMatchTemplate:"sentenceMatch",pictureClues:"pictureClues",palEgmaCalculateSumAndSumTogether:"palEgmaCalculateSumAndSumTogether",palEgmaPatternMatching:"palEgmaPatternMatchingAudio",palEgmaWordProblem:"palEgmaWordProblem",palEgraArrangePictures:"palEgraArrangePicturesAudio",palEgraBuildWord:"palEgraBuildWordAudio",palEgraMCQWithImage:"palEgraMCQWithImage",palEgraOddOneOut:"palEgraOddOneOutAudio",palEgraOptionWithAudio:"palEgraOptionWithAudio",palEgraWordFormation:"palEgraWordFormationAudio",palEgraWordMatch:"palEgraWordMatch",substractionWithImage:"substractionWithImageAudio",substractionWithoutImage:"substractionWithoutImageAudio",numberIdentificationWithImage:"numberIdentificationWithImageAudio",numberIdentificationWithoutImage:"numberIdentificationWithoutImageAudio",wordBuildingWithImage:"wordBuildingWithImageAudio",wordBuildingWithoutImage:"wordBuildingWithoutImageAudio",pictureWordMatchMultipleImages:"pictureWordMatchMultipleImagesAudio",pictureWordMatchSingleImage:"pictureWordMatchSingleImageAudio",sentenceMatch:"sentenceMatchAudio",imageMatch:"imageMatchAudio",palStoryTale:"palStoryTaleAudio",palEgmaWordProblemDragnDrop:"palEgmaWordProblemDragnDropAudio",palEgmaWordProblemClick:"palEgmaWordProblemClickAudio",palInventedSpelling:"palInventedSpellingAudio",palLetterIdentification:"palLetterIdentificationAudio",palStoryMaking:"palStoryMakingAudio",palegmasumtogether:"palegmasumtogetherAudio",palegmamultioption:"palegmamultioptionAudio",palegraoptionaudio:"palegraoptionAudio",palegrawordmatch:"palegrawordmatchAudio",palegramcqimages:"palegramcqimagesAudio",drawShape:"drawshape",drawshape:"drawshape"}[this.templateId])&&void 0!==t?t:"";const i=document.querySelector("lido-home");if(!i)return;const e=i.getAttribute(k)||"";this.speakFlag=e.includes(this.templateId),this.speakFlag||i.setAttribute(k,[e,this.templateId].filter(Boolean).join(","))}resolveLanguage(){var t,i;const e=this.el.closest("lido-root"),n=(null==e?void 0:e.Lang)||"";if(null==n?void 0:n.trim())return n;if(null===(t=this.Lang)||void 0===t?void 0:t.trim())return this.Lang;const r=this.el.getAttribute("Lang");return(null==r?void 0:r.trim())?r:null===(i=this.el.textContent)||void 0===i?void 0:i.trim()}convertToPixels(t,i=document.body){if(!t)return 0;if(t.endsWith("px"))return parseFloat(t);const e=document.createElement("div");e.style.position="absolute",e.style.visibility="hidden",e.style.height=t,i.appendChild(e);const n=e.offsetHeight;return i.removeChild(e),n}scaleContainer(t){const i=this.getClosestParentWithWidth();let e=0;i&&(e=Math.min(i.clientWidth/1600,i.clientHeight/900)),t.style.transform=`translate(-50%, -50%) scale(${0!=e?e:A()})`,t.style.left="50%",t.style.top="50%",t.style.position="absolute",this.screenOrientation()}getClosestParentWithWidth(){let t=this.el.parentElement;for(;t;){if(t.offsetWidth>0)return t;t=t.parentElement}return null}screenOrientation(){window.innerHeight>window.innerWidth?(this.el.style.height="1600px",this.el.style.width="900px"):(this.el.style.height="900px",this.el.style.width="1600px")}updateChildTextLanguage(t){const i=t||si.language||"en";si.changeLanguage(i),this.el.querySelectorAll("lido-text").forEach((t=>{t.Lang=i,t.dispatchEvent(new CustomEvent("languageChanged",{bubbles:!0}))}))}componentDidLoad(){this.scaleContainer(this.el);const t=this.bgImage?u(this.bgImage):"",i=this.el.closest("lido-standalone"),e="true"===(null==i?void 0:i.getAttribute("bg-image"))?i:document.body;if(e.style.backgroundColor=this.bgColor,e.style.backgroundImage=t?`url(${t})`:"none",e.style.backgroundPosition=t?"bottom":"none",document.body.style.pointerEvents="auto",window.addEventListener("resize",this.handleWindowResize),window.addEventListener("load",this.handleWindowLoad),this.templateId?setTimeout((()=>{this.el.setAttribute("onEntry",`${this.templateId}.speak='${!this.speakFlag}'; `+this.el.getAttribute("onEntry")),h(this.el,this.type)}),100):h(this.el,this.type),this.customStyle){const t=document.createElement("style");t.innerHTML=this.customStyle,document.head.appendChild(t)}const n=this.resolveLanguage();this.updateChildTextLanguage(n),setTimeout((()=>{S()}),100),M(),j.getI().start()}disconnectedCallback(){this.cleanupInteractionHandlers(),window.removeEventListener("resize",this.handleWindowResize),window.removeEventListener("load",this.handleWindowLoad),document.body.style.backgroundColor="",document.body.style.backgroundImage="",M(),j.getI().stop()}render(){return i(e,{key:"1862e30fedda58726edc107f81fae1f63e96d009",id:"lido-container",Lang:this.Lang,"tab-index":0,class:"lido-container",objective:this.objective,baseUrl:this.baseUrl,style:{backgroundColor:this.bgColor,position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",margin:this.margin,userSelect:"none"},"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,onTouch:this.onTouch,onInCorrect:this.onInCorrect,onCorrect:this.onCorrect,onEntry:this.onEntry,"show-check":`${this.showCheck}`,"is-continue-on-correct":`${this.isContinueOnCorrect}`,"is-allow-only-correct":`${this.isAllowOnlyCorrect}`,canplay:`${this.canplay}`,appendToDropOnCompletion:`${this.appendToDropOnCompletion}`,"show-prev-button":`${this.showPrevButton}`,"show-next-button":`${this.showNextButton}`,"show-drop-border":`${this.showDropBorder}`,"bg-image":this.bgImage,"exit-button-url":this.exitButtonUrl,"prev-button-url":this.prevButtonUrl,"next-button-url":this.nextButtonUrl,"speaker-button-url":this.speakerButtonUrl,"disable-speak":`${this.disableSpeak}`,"template-id":this.templateId,audio:this.audio,"highlight-word-by-word":`${this.highlightWordByWord}`},i("lido-text",{key:"86fd014a61ba9cba6d67e2d921b2d8a8a289dbc7",visible:"false",id:this.templateId,audio:"",string:this.instructName}),i("slot",{key:"c3128ea2164892757b32cb076d717436947f9a4c"}))}get el(){return n(this)}static get watchers(){return{Lang:[{languageChanged:0}]}}};Mi.style=".lido-container{position:relative;height:100%;width:100%;background-color:var(--bgColor, transparent);display:flex;flex-direction:column;justify-content:center;align-items:center}";const Ei=class{constructor(i){t(this,i),this.value="",this.height="auto",this.width="auto",this.ariaLabel="",this.ariaHidden="",this.x="0px",this.y="0px",this.z="0",this.bgColor="",this.type="",this.tabIndex=0,this.visible=!0,this.audio="",this.onTouch="",this.onInCorrect="",this.onCorrect="",this.onEntry="",this.flipped=!1,this.margin="",this.disableSpeak=!1,this.style={},this.delayVisible="",this.updateStyles=()=>{const t=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:c(this.height,t)||"200px",width:c(this.width,t)||"200px",backgroundColor:c(this.bgColor,t),top:c(this.y,t),left:c(this.x,t),zIndex:this.z,display:this.visible?this.display?c(this.display,t):"inline-block":"none",flexDirection:this.direction?c(this.direction,t):void 0,margin:c(this.margin,t)}},this.handleFlip=()=>{this.flipped=!this.flipped}}handleFlippedChange(){}componentWillLoad(){this.updateStyles(),window.addEventListener("resize",this.updateStyles),window.addEventListener("load",this.updateStyles)}componentDidLoad(){a(this.el,this.delayVisible);const t=this.el.querySelector(".card");t&&setTimeout((()=>{t.classList.add("flipped"),setTimeout((()=>{t.classList.remove("flipped")}),500)}),500),h(this.el,this.type)}disconnectedCallback(){window.removeEventListener("resize",this.updateStyles),window.removeEventListener("load",this.updateStyles)}render(){return i(e,{key:"db8de4cdb5466700ca29fba17e2a5ffb01907559",value:this.value,"tab-index":this.tabIndex,style:this.style,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,audio:this.audio,onTouch:this.onTouch,onCorrect:this.onCorrect,onInCorrect:this.onInCorrect,onEntry:this.onEntry,type:this.type,onClick:this.handleFlip,"disable-speak":this.disableSpeak},i("div",{key:"ec3aeff247e581f4aef061b7fea5b752a64804b3",class:"card "+(this.flipped?"flipped":"")},i("div",{key:"cb7ffa64077c89157a0d75720964605eed639363",class:"card-face card-front"},null!=this.front?this.front:i("slot",{name:"front"})),i("div",{key:"537e1b60c82be542b2a8a8426abc4b801865688e",class:"card-face card-back"},null!=this.back?this.back:i("slot",{name:"back"}))))}get el(){return n(this)}static get watchers(){return{flipped:[{handleFlippedChange:0}]}}};Ei.style=".card{position:relative;width:100%;height:100%;transform-style:preserve-3d;transition:transform 0.6s ease;cursor:pointer}.card.flipped{transform:rotateY(180deg)}.card-face{position:absolute;width:100%;height:100%;backface-visibility:hidden;display:flex;align-items:center;justify-content:center}.card-back{transform:rotateY(180deg)}";const Oi=class{constructor(i){t(this,i),this.id="",this.value="",this.z="0",this.tabIndex=0,this.visible=!1,this.onEntry="",this.delayVisible="",this.floatDirection="bottomToTop",this.handleWindowResize=()=>this.updateStyles(),this.handleWindowLoad=()=>this.updateStyles()}componentDidLoad(){a(this.el,this.delayVisible),h(this.el,this.type),this.initializeFloatElement()}componentWillLoad(){this.updateStyles(),window.addEventListener("resize",this.handleWindowResize),window.addEventListener("load",this.handleWindowLoad)}disconnectedCallback(){window.removeEventListener("resize",this.handleWindowResize),window.removeEventListener("load",this.handleWindowLoad)}initializeFloatElement(){let t=0;Array.from(this.el.children).forEach((i=>{const e=i;e.style.visibility="hidden",setTimeout((()=>{e.style.visibility="visible",E(e)}),t),t+=1e3,i.addEventListener("click",(()=>{O(e)}))}))}updateStyles(){const t=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:"leftToRight"!==this.floatDirection?"100%":c(this.height,t),width:"leftToRight"===this.floatDirection?"100%":c(this.width,t),backgroundColor:c(this.bgColor,t),zIndex:this.z,display:this.visible?"flex":"none"}}render(){return i(e,{key:"c461f1142dd6addd9ceb41ade183b044b875681f",class:"lido-float","float-direction":this.floatDirection,id:this.id,"tab-index":this.tabIndex,style:this.style,onEntry:this.onEntry},i("slot",{key:"240439bfda6a9e4e2d67e6ae2b5c878d99e632b3"}))}get el(){return n(this)}};function Ci(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}Oi.style=".lido-float{position:relative}.lido-float>*{position:absolute;cursor:pointer}@keyframes float-up{from{top:var(--el-top)}to{top:-500px}}#removeShadow{box-shadow:unset !important}@keyframes float-lr{from{right:var(--el-left)}to{right:-500px}}";var $i,Ii={exports:{}},_i=($i||($i=1,Ii.exports=function t(i,e,n){function r(o,a){if(!e[o]){if(!i[o]){if(!a&&Ci)return Ci(o);if(s)return s(o,!0);var h=new Error("Cannot find module '"+o+"'");throw h.code="MODULE_NOT_FOUND",h}var u=e[o]={exports:{}};i[o][0].call(u.exports,(function(t){return r(i[o][1][t]||t)}),u,u.exports,t,i,e,n)}return e[o].exports}for(var s=Ci,o=0;o<n.length;o++)r(n[o]);return r}({1:[function(t,i,e){var n=t("./utils"),r=t("./support"),s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";e.encode=function(t){for(var i,e,r,o,a,h,u=[],c=0,l=t.length,d=l,f="string"!==n.getTypeOf(t);c<t.length;)d=l-c,r=f?(i=t[c++],e=c<l?t[c++]:0,c<l?t[c++]:0):(i=t.charCodeAt(c++),e=c<l?t.charCodeAt(c++):0,c<l?t.charCodeAt(c++):0),o=(3&i)<<4|e>>4,a=1<d?(15&e)<<2|r>>6:64,h=2<d?63&r:64,u.push(s.charAt(i>>2)+s.charAt(o)+s.charAt(a)+s.charAt(h));return u.join("")},e.decode=function(t){var i,e,n,o,a,h,u=0,c=0,l="data:";if(t.substr(0,5)===l)throw new Error("Invalid base64 input, it looks like a data url.");var d,f=3*(t=t.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(t.charAt(t.length-1)===s.charAt(64)&&f--,t.charAt(t.length-2)===s.charAt(64)&&f--,f%1!=0)throw new Error("Invalid base64 input, bad content length.");for(d=r.uint8array?new Uint8Array(0|f):new Array(0|f);u<t.length;)i=s.indexOf(t.charAt(u++))<<2|(o=s.indexOf(t.charAt(u++)))>>4,e=(15&o)<<4|(a=s.indexOf(t.charAt(u++)))>>2,n=(3&a)<<6|(h=s.indexOf(t.charAt(u++))),d[c++]=i,64!==a&&(d[c++]=e),64!==h&&(d[c++]=n);return d}},{"./support":30,"./utils":32}],2:[function(t,i){var e=t("./external"),n=t("./stream/DataWorker"),r=t("./stream/Crc32Probe"),s=t("./stream/DataLengthProbe");function o(t,i,e,n,r){this.compressedSize=t,this.uncompressedSize=i,this.crc32=e,this.compression=n,this.compressedContent=r}o.prototype={getContentWorker:function(){var t=new n(e.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new s("data_length")),i=this;return t.on("end",(function(){if(this.streamInfo.data_length!==i.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")})),t},getCompressedWorker:function(){return new n(e.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},o.createWorkerFrom=function(t,i,e){return t.pipe(new r).pipe(new s("uncompressedSize")).pipe(i.compressWorker(e)).pipe(new s("compressedSize")).withStreamInfo("compression",i)},i.exports=o},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(t,i,e){var n=t("./stream/GenericWorker");e.STORE={magic:"\0\0",compressWorker:function(){return new n("STORE compression")},uncompressWorker:function(){return new n("STORE decompression")}},e.DEFLATE=t("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(t,i){var e=t("./utils"),n=function(){for(var t,i=[],e=0;e<256;e++){t=e;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;i[e]=t}return i}();i.exports=function(t,i){return void 0!==t&&t.length?"string"!==e.getTypeOf(t)?function(t,i,e){var r=n,s=0+e;t^=-1;for(var o=0;o<s;o++)t=t>>>8^r[255&(t^i[o])];return~t}(0|i,t,t.length):function(t,i,e){var r=n,s=0+e;t^=-1;for(var o=0;o<s;o++)t=t>>>8^r[255&(t^i.charCodeAt(o))];return~t}(0|i,t,t.length):0}},{"./utils":32}],5:[function(t,i,e){e.base64=!1,e.binary=!1,e.dir=!1,e.createFolders=!0,e.date=null,e.compression=null,e.compressionOptions=null,e.comment=null,e.unixPermissions=null,e.dosPermissions=null},{}],6:[function(t,i){var e;e="undefined"!=typeof Promise?Promise:t("lie"),i.exports={Promise:e}},{lie:37}],7:[function(t,i,e){var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,r=t("pako"),s=t("./utils"),o=t("./stream/GenericWorker"),a=n?"uint8array":"array";function h(t,i){o.call(this,"FlateWorker/"+t),this._pako=null,this._pakoAction=t,this._pakoOptions=i,this.meta={}}e.magic="\b\0",s.inherits(h,o),h.prototype.processChunk=function(t){this.meta=t.meta,null===this._pako&&this._createPako(),this._pako.push(s.transformTo(a,t.data),!1)},h.prototype.flush=function(){o.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},h.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this._pako=null},h.prototype._createPako=function(){this._pako=new r[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var t=this;this._pako.onData=function(i){t.push({data:i,meta:t.meta})}},e.compressWorker=function(t){return new h("Deflate",t)},e.uncompressWorker=function(){return new h("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(t,i){function e(t,i){var e,n="";for(e=0;e<i;e++)n+=String.fromCharCode(255&t),t>>>=8;return n}function n(t,i,n,s,u,c){var l,d,f=t.file,p=t.compression,g=c!==o.utf8encode,m=r.transformTo("string",c(f.name)),b=r.transformTo("string",o.utf8encode(f.name)),v=f.comment,w=r.transformTo("string",c(v)),y=r.transformTo("string",o.utf8encode(v)),x=b.length!==f.name.length,k=y.length!==v.length,A="",S="",j="",M=f.dir,E=f.date,O={crc32:0,compressedSize:0,uncompressedSize:0};i&&!n||(O.crc32=t.crc32,O.compressedSize=t.compressedSize,O.uncompressedSize=t.uncompressedSize);var C=0;i&&(C|=8),g||!x&&!k||(C|=2048);var $=0,I=0;M&&($|=16),"UNIX"===u?(I=798,$|=function(t,i){var e=t;return t||(e=i?16893:33204),(65535&e)<<16}(f.unixPermissions,M)):(I=20,$|=function(t){return 63&(t||0)}(f.dosPermissions)),l=E.getUTCHours(),l<<=6,l|=E.getUTCMinutes(),l<<=5,l|=E.getUTCSeconds()/2,d=E.getUTCFullYear()-1980,d<<=4,d|=E.getUTCMonth()+1,d<<=5,d|=E.getUTCDate(),x&&(S=e(1,1)+e(a(m),4)+b,A+="up"+e(S.length,2)+S),k&&(j=e(1,1)+e(a(w),4)+y,A+="uc"+e(j.length,2)+j);var _="";return _+="\n\0",_+=e(C,2),_+=p.magic,_+=e(l,2),_+=e(d,2),_+=e(O.crc32,4),_+=e(O.compressedSize,4),_+=e(O.uncompressedSize,4),_+=e(m.length,2),_+=e(A.length,2),{fileRecord:h.LOCAL_FILE_HEADER+_+m+A,dirRecord:h.CENTRAL_FILE_HEADER+e(I,2)+_+e(w.length,2)+"\0\0\0\0"+e($,4)+e(s,4)+m+A+w}}var r=t("../utils"),s=t("../stream/GenericWorker"),o=t("../utf8"),a=t("../crc32"),h=t("../signature");function u(t,i,e,n){s.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=i,this.zipPlatform=e,this.encodeFileName=n,this.streamFiles=t,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}r.inherits(u,s),u.prototype.push=function(t){var i=t.meta.percent||0,e=this.entriesCount,n=this._sources.length;this.accumulate?this.contentBuffer.push(t):(this.bytesWritten+=t.data.length,s.prototype.push.call(this,{data:t.data,meta:{currentFile:this.currentFile,percent:e?(i+100*(e-n-1))/e:100}}))},u.prototype.openedSource=function(t){this.currentSourceOffset=this.bytesWritten,this.currentFile=t.file.name;var i=this.streamFiles&&!t.file.dir;if(i){var e=n(t,i,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:e.fileRecord,meta:{percent:0}})}else this.accumulate=!0},u.prototype.closedSource=function(t){this.accumulate=!1;var i=this.streamFiles&&!t.file.dir,r=n(t,i,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),i)this.push({data:function(t){return h.DATA_DESCRIPTOR+e(t.crc32,4)+e(t.compressedSize,4)+e(t.uncompressedSize,4)}(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},u.prototype.flush=function(){for(var t=this.bytesWritten,i=0;i<this.dirRecords.length;i++)this.push({data:this.dirRecords[i],meta:{percent:100}});var n=function(t,i,n,s,o){var a=r.transformTo("string",o(s));return h.CENTRAL_DIRECTORY_END+"\0\0\0\0"+e(t,2)+e(t,2)+e(i,4)+e(n,4)+e(a.length,2)+a}(this.dirRecords.length,this.bytesWritten-t,t,this.zipComment,this.encodeFileName);this.push({data:n,meta:{percent:100}})},u.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},u.prototype.registerPrevious=function(t){this._sources.push(t);var i=this;return t.on("data",(function(t){i.processChunk(t)})),t.on("end",(function(){i.closedSource(i.previous.streamInfo),i._sources.length?i.prepareNextSource():i.end()})),t.on("error",(function(t){i.error(t)})),this},u.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},u.prototype.error=function(t){var i=this._sources;if(!s.prototype.error.call(this,t))return!1;for(var e=0;e<i.length;e++)try{i[e].error(t)}catch(t){}return!0},u.prototype.lock=function(){s.prototype.lock.call(this);for(var t=this._sources,i=0;i<t.length;i++)t[i].lock()},i.exports=u},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(t,i,e){var n=t("../compressions"),r=t("./ZipFileWorker");e.generateWorker=function(t,i,e){var s=new r(i.streamFiles,e,i.platform,i.encodeFileName),o=0;try{t.forEach((function(t,e){o++;var r=function(t,i){var e=t||i,r=n[e];if(!r)throw new Error(e+" is not a valid compression method !");return r}(e.options.compression,i.compression),a=e.dir,h=e.date;e._compressWorker(r,e.options.compressionOptions||i.compressionOptions||{}).withStreamInfo("file",{name:t,dir:a,date:h,comment:e.comment||"",unixPermissions:e.unixPermissions,dosPermissions:e.dosPermissions}).pipe(s)})),s.entriesCount=o}catch(t){s.error(t)}return s}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(t,i){function e(){if(!(this instanceof e))return new e;if(arguments.length)throw new 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 e;for(var i in this)"function"!=typeof this[i]&&(t[i]=this[i]);return t}}(e.prototype=t("./object")).loadAsync=t("./load"),e.support=t("./support"),e.defaults=t("./defaults"),e.version="3.10.1",e.loadAsync=function(t,i){return(new e).loadAsync(t,i)},e.external=t("./external"),i.exports=e},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(t,i){var e=t("./utils"),n=t("./external"),r=t("./utf8"),s=t("./zipEntries"),o=t("./stream/Crc32Probe"),a=t("./nodejsUtils");function h(t){return new n.Promise((function(i,e){var n=t.decompressed.getContentWorker().pipe(new o);n.on("error",(function(t){e(t)})).on("end",(function(){n.streamInfo.crc32!==t.decompressed.crc32?e(new Error("Corrupted zip : CRC32 mismatch")):i()})).resume()}))}i.exports=function(t,i){var o=this;return i=e.extend(i||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:r.utf8decode}),a.isNode&&a.isStream(t)?n.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):e.prepareContent("the loaded zip file",t,!0,i.optimizedBinaryString,i.base64).then((function(t){var e=new s(i);return e.load(t),e})).then((function(t){var e=[n.Promise.resolve(t)],r=t.files;if(i.checkCRC32)for(var s=0;s<r.length;s++)e.push(h(r[s]));return n.Promise.all(e)})).then((function(t){for(var n=t.shift(),r=n.files,s=0;s<r.length;s++){var a=r[s],h=a.fileNameStr,u=e.resolve(a.fileNameStr);o.file(u,a.decompressed,{binary:!0,optimizedBinaryString:!0,date:a.date,dir:a.dir,comment:a.fileCommentStr.length?a.fileCommentStr:null,unixPermissions:a.unixPermissions,dosPermissions:a.dosPermissions,createFolders:i.createFolders}),a.dir||(o.file(u).unsafeOriginalName=h)}return n.zipComment.length&&(o.comment=n.zipComment),o}))}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(t,i){var e=t("../utils"),n=t("../stream/GenericWorker");function r(t,i){n.call(this,"Nodejs stream input adapter for "+t),this._upstreamEnded=!1,this._bindStream(i)}e.inherits(r,n),r.prototype._bindStream=function(t){var i=this;(this._stream=t).pause(),t.on("data",(function(t){i.push({data:t,meta:{percent:0}})})).on("error",(function(t){i.isPaused?this.generatedError=t:i.error(t)})).on("end",(function(){i.isPaused?i._upstreamEnded=!0:i.end()}))},r.prototype.pause=function(){return!!n.prototype.pause.call(this)&&(this._stream.pause(),!0)},r.prototype.resume=function(){return!!n.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},i.exports=r},{"../stream/GenericWorker":28,"../utils":32}],13:[function(t,i){var e=t("readable-stream").Readable;function n(t,i,n){e.call(this,i),this._helper=t;var r=this;t.on("data",(function(t,i){r.push(t)||r._helper.pause(),n&&n(i)})).on("error",(function(t){r.emit("error",t)})).on("end",(function(){r.push(null)}))}t("../utils").inherits(n,e),n.prototype._read=function(){this._helper.resume()},i.exports=n},{"../utils":32,"readable-stream":16}],14:[function(t,i){i.exports={isNode:"undefined"!=typeof Buffer,newBufferFrom:function(t,i){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(t,i);if("number"==typeof t)throw new Error('The "data" argument must not be a number');return new Buffer(t,i)},allocBuffer:function(t){if(Buffer.alloc)return Buffer.alloc(t);var i=new Buffer(t);return i.fill(0),i},isBuffer:function(t){return Buffer.isBuffer(t)},isStream:function(t){return t&&"function"==typeof t.on&&"function"==typeof t.pause&&"function"==typeof t.resume}}},{}],15:[function(t,i){function e(t,i,e){var n,o=r.getTypeOf(i),c=r.extend(e||{},a);c.date=c.date||new Date,null!==c.compression&&(c.compression=c.compression.toUpperCase()),"string"==typeof c.unixPermissions&&(c.unixPermissions=parseInt(c.unixPermissions,8)),c.unixPermissions&&16384&c.unixPermissions&&(c.dir=!0),c.dosPermissions&&16&c.dosPermissions&&(c.dir=!0),c.dir&&(t=p(t)),c.createFolders&&(n=f(t))&&g.call(this,n,!0),e&&void 0!==e.binary||(c.binary=!("string"===o&&!1===c.binary&&!1===c.base64)),(i instanceof h&&0===i.uncompressedSize||c.dir||!i||0===i.length)&&(c.base64=!1,c.binary=!0,i="",c.compression="STORE",o="string");var m;m=i instanceof h||i instanceof s?i:l.isNode&&l.isStream(i)?new d(t,i):r.prepareContent(t,i,c.binary,c.optimizedBinaryString,c.base64);var b=new u(t,m,c);this.files[t]=b}var n=t("./utf8"),r=t("./utils"),s=t("./stream/GenericWorker"),o=t("./stream/StreamHelper"),a=t("./defaults"),h=t("./compressedObject"),u=t("./zipObject"),c=t("./generate"),l=t("./nodejsUtils"),d=t("./nodejs/NodejsStreamInputAdapter"),f=function(t){"/"===t.slice(-1)&&(t=t.substring(0,t.length-1));var i=t.lastIndexOf("/");return 0<i?t.substring(0,i):""},p=function(t){return"/"!==t.slice(-1)&&(t+="/"),t},g=function(t,i){return i=void 0!==i?i:a.createFolders,t=p(t),this.files[t]||e.call(this,t,null,{dir:!0,createFolders:i}),this.files[t]};function m(t){return"[object RegExp]"===Object.prototype.toString.call(t)}var b={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(t){var i,e,n;for(i in this.files)n=this.files[i],(e=i.slice(this.root.length,i.length))&&i.slice(0,this.root.length)===this.root&&t(e,n)},filter:function(t){var i=[];return this.forEach((function(e,n){t(e,n)&&i.push(n)})),i},file:function(t,i,n){if(1!==arguments.length)return e.call(this,t=this.root+t,i,n),this;if(m(t)){var r=t;return this.filter((function(t,i){return!i.dir&&r.test(t)}))}var s=this.files[this.root+t];return s&&!s.dir?s:null},folder:function(t){if(!t)return this;if(m(t))return this.filter((function(i,e){return e.dir&&t.test(i)}));var i=g.call(this,this.root+t),e=this.clone();return e.root=i.name,e},remove:function(t){var i=this.files[t=this.root+t];if(i||("/"!==t.slice(-1)&&(t+="/"),i=this.files[t]),i&&!i.dir)delete this.files[t];else for(var e=this.filter((function(i,e){return e.name.slice(0,t.length)===t})),n=0;n<e.length;n++)delete this.files[e[n].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(t){var i,e={};try{if((e=r.extend(t||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:n.utf8encode})).type=e.type.toLowerCase(),e.compression=e.compression.toUpperCase(),"binarystring"===e.type&&(e.type="string"),!e.type)throw new Error("No output type specified.");r.checkSupport(e.type),"darwin"!==e.platform&&"freebsd"!==e.platform&&"linux"!==e.platform&&"sunos"!==e.platform||(e.platform="UNIX"),"win32"===e.platform&&(e.platform="DOS"),i=c.generateWorker(this,e,e.comment||this.comment||"")}catch(t){(i=new s("error")).error(t)}return new o(i,e.type||"string",e.mimeType)},generateAsync:function(t,i){return this.generateInternalStream(t).accumulate(i)},generateNodeStream:function(t,i){return(t=t||{}).type||(t.type="nodebuffer"),this.generateInternalStream(t).toNodejsStream(i)}};i.exports=b},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(t,i){i.exports=t("stream")},{stream:void 0}],17:[function(t,i){var e=t("./DataReader");function n(t){e.call(this,t);for(var i=0;i<this.data.length;i++)t[i]=255&t[i]}t("../utils").inherits(n,e),n.prototype.byteAt=function(t){return this.data[this.zero+t]},n.prototype.lastIndexOfSignature=function(t){for(var i=t.charCodeAt(0),e=t.charCodeAt(1),n=t.charCodeAt(2),r=t.charCodeAt(3),s=this.length-4;0<=s;--s)if(this.data[s]===i&&this.data[s+1]===e&&this.data[s+2]===n&&this.data[s+3]===r)return s-this.zero;return-1},n.prototype.readAndCheckSignature=function(t){var i=t.charCodeAt(0),e=t.charCodeAt(1),n=t.charCodeAt(2),r=t.charCodeAt(3),s=this.readData(4);return i===s[0]&&e===s[1]&&n===s[2]&&r===s[3]},n.prototype.readData=function(t){if(this.checkOffset(t),0===t)return[];var i=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,i},i.exports=n},{"../utils":32,"./DataReader":18}],18:[function(t,i){var e=t("../utils");function n(t){this.data=t,this.length=t.length,this.index=0,this.zero=0}n.prototype={checkOffset:function(t){this.checkIndex(this.index+t)},checkIndex:function(t){if(this.length<this.zero+t||t<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+t+"). Corrupted zip ?")},setIndex:function(t){this.checkIndex(t),this.index=t},skip:function(t){this.setIndex(this.index+t)},byteAt:function(){},readInt:function(t){var i,e=0;for(this.checkOffset(t),i=this.index+t-1;i>=this.index;i--)e=(e<<8)+this.byteAt(i);return this.index+=t,e},readString:function(t){return e.transformTo("string",this.readData(t))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var t=this.readInt(4);return new Date(Date.UTC(1980+(t>>25&127),(t>>21&15)-1,t>>16&31,t>>11&31,t>>5&63,(31&t)<<1))}},i.exports=n},{"../utils":32}],19:[function(t,i){var e=t("./Uint8ArrayReader");function n(t){e.call(this,t)}t("../utils").inherits(n,e),n.prototype.readData=function(t){this.checkOffset(t);var i=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,i},i.exports=n},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(t,i){var e=t("./DataReader");function n(t){e.call(this,t)}t("../utils").inherits(n,e),n.prototype.byteAt=function(t){return this.data.charCodeAt(this.zero+t)},n.prototype.lastIndexOfSignature=function(t){return this.data.lastIndexOf(t)-this.zero},n.prototype.readAndCheckSignature=function(t){return t===this.readData(4)},n.prototype.readData=function(t){this.checkOffset(t);var i=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,i},i.exports=n},{"../utils":32,"./DataReader":18}],21:[function(t,i){var e=t("./ArrayReader");function n(t){e.call(this,t)}t("../utils").inherits(n,e),n.prototype.readData=function(t){if(this.checkOffset(t),0===t)return new Uint8Array(0);var i=this.data.subarray(this.zero+this.index,this.zero+this.index+t);return this.index+=t,i},i.exports=n},{"../utils":32,"./ArrayReader":17}],22:[function(t,i){var e=t("../utils"),n=t("../support"),r=t("./ArrayReader"),s=t("./StringReader"),o=t("./NodeBufferReader"),a=t("./Uint8ArrayReader");i.exports=function(t){var i=e.getTypeOf(t);return e.checkSupport(i),"string"!==i||n.uint8array?"nodebuffer"===i?new o(t):n.uint8array?new a(e.transformTo("uint8array",t)):new r(e.transformTo("array",t)):new s(t)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(t,i,e){e.LOCAL_FILE_HEADER="PK",e.CENTRAL_FILE_HEADER="PK",e.CENTRAL_DIRECTORY_END="PK",e.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",e.ZIP64_CENTRAL_DIRECTORY_END="PK",e.DATA_DESCRIPTOR="PK\b"},{}],24:[function(t,i){var e=t("./GenericWorker"),n=t("../utils");function r(t){e.call(this,"ConvertWorker to "+t),this.destType=t}n.inherits(r,e),r.prototype.processChunk=function(t){this.push({data:n.transformTo(this.destType,t.data),meta:t.meta})},i.exports=r},{"../utils":32,"./GenericWorker":28}],25:[function(t,i){var e=t("./GenericWorker"),n=t("../crc32");function r(){e.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t("../utils").inherits(r,e),r.prototype.processChunk=function(t){this.streamInfo.crc32=n(t.data,this.streamInfo.crc32||0),this.push(t)},i.exports=r},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(t,i){var e=t("../utils"),n=t("./GenericWorker");function r(t){n.call(this,"DataLengthProbe for "+t),this.propName=t,this.withStreamInfo(t,0)}e.inherits(r,n),r.prototype.processChunk=function(t){t&&(this.streamInfo[this.propName]=(this.streamInfo[this.propName]||0)+t.data.length),n.prototype.processChunk.call(this,t)},i.exports=r},{"../utils":32,"./GenericWorker":28}],27:[function(t,i){var e=t("../utils"),n=t("./GenericWorker");function r(t){n.call(this,"DataWorker");var i=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,t.then((function(t){i.dataIsReady=!0,i.data=t,i.max=t&&t.length||0,i.type=e.getTypeOf(t),i.isPaused||i._tickAndRepeat()}),(function(t){i.error(t)}))}e.inherits(r,n),r.prototype.cleanUp=function(){n.prototype.cleanUp.call(this),this.data=null},r.prototype.resume=function(){return!!n.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,e.delay(this._tickAndRepeat,[],this)),!0)},r.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(e.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},r.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var t=null,i=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,i);break;case"uint8array":t=this.data.subarray(this.index,i);break;case"array":case"nodebuffer":t=this.data.slice(this.index,i)}return this.index=i,this.push({data:t,meta:{percent:this.max?this.index/this.max*100:0}})},i.exports=r},{"../utils":32,"./GenericWorker":28}],28:[function(t,i){function e(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}e.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,i){return this._listeners[t].push(i),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(t,i){if(this._listeners[t])for(var e=0;e<this._listeners[t].length;e++)this._listeners[t][e].call(this,i)},pipe:function(t){return t.registerPrevious(this)},registerPrevious:function(t){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=t.streamInfo,this.mergeStreamInfo(),this.previous=t;var i=this;return t.on("data",(function(t){i.processChunk(t)})),t.on("end",(function(){i.end()})),t.on("error",(function(t){i.error(t)})),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var t=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),t=!0),this.previous&&this.previous.resume(),!t},flush:function(){},processChunk:function(t){this.push(t)},withStreamInfo:function(t,i){return this.extraStreamInfo[t]=i,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var t in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,t)&&(this.streamInfo[t]=this.extraStreamInfo[t])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var t="Worker "+this.name;return this.previous?this.previous+" -> "+t:t}},i.exports=e},{}],29:[function(t,i){var e=t("../utils"),n=t("./ConvertWorker"),r=t("./GenericWorker"),s=t("../base64"),o=t("../support"),a=t("../external"),h=null;if(o.nodestream)try{h=t("../nodejs/NodejsStreamOutputAdapter")}catch(t){}function u(t,i,s){var o=i;switch(i){case"blob":case"arraybuffer":o="uint8array";break;case"base64":o="string"}try{this._internalType=o,this._outputType=i,this._mimeType=s,e.checkSupport(o),this._worker=t.pipe(new n(o)),t.lock()}catch(t){this._worker=new r("error"),this._worker.error(t)}}u.prototype={accumulate:function(t){return function(t,i){return new a.Promise((function(n,r){var o=[],a=t._internalType,h=t._outputType,u=t._mimeType;t.on("data",(function(t,e){o.push(t),i&&i(e)})).on("error",(function(t){o=[],r(t)})).on("end",(function(){try{var t=function(t,i,n){switch(t){case"blob":return e.newBlob(e.transformTo("arraybuffer",i),n);case"base64":return s.encode(i);default:return e.transformTo(t,i)}}(h,function(t,i){var e,n=0,r=null,s=0;for(e=0;e<i.length;e++)s+=i[e].length;switch(t){case"string":return i.join("");case"array":return Array.prototype.concat.apply([],i);case"uint8array":for(r=new Uint8Array(s),e=0;e<i.length;e++)r.set(i[e],n),n+=i[e].length;return r;case"nodebuffer":return Buffer.concat(i);default:throw new Error("concat : unsupported type '"+t+"'")}}(a,o),u);n(t)}catch(t){r(t)}o=[]})).resume()}))}(this,t)},on:function(t,i){var n=this;return this._worker.on(t,"data"===t?function(t){i.call(n,t.data,t.meta)}:function(){e.delay(i,arguments,n)}),this},resume:function(){return e.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(t){if(e.checkSupport("nodestream"),"nodebuffer"!==this._outputType)throw new Error(this._outputType+" is not supported by this method");return new h(this,{objectMode:"nodebuffer"!==this._outputType},t)}},i.exports=u},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(t,i,e){if(e.base64=!0,e.array=!0,e.string=!0,e.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,e.nodebuffer="undefined"!=typeof Buffer,e.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)e.blob=!1;else{var n=new ArrayBuffer(0);try{e.blob=0===new Blob([n],{type:"application/zip"}).size}catch(t){try{var r=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);r.append(n),e.blob=0===r.getBlob("application/zip").size}catch(t){e.blob=!1}}}try{e.nodestream=!!t("readable-stream").Readable}catch(t){e.nodestream=!1}},{"readable-stream":16}],31:[function(t,i,e){for(var n=t("./utils"),r=t("./support"),s=t("./nodejsUtils"),o=t("./stream/GenericWorker"),a=new Array(256),h=0;h<256;h++)a[h]=252<=h?6:248<=h?5:240<=h?4:224<=h?3:192<=h?2:1;function u(){o.call(this,"utf-8 decode"),this.leftOver=null}function c(){o.call(this,"utf-8 encode")}a[254]=a[254]=1,e.utf8encode=function(t){return r.nodebuffer?s.newBufferFrom(t,"utf-8"):function(t){var i,e,n,s,o,a=t.length,h=0;for(s=0;s<a;s++)55296==(64512&(e=t.charCodeAt(s)))&&s+1<a&&56320==(64512&(n=t.charCodeAt(s+1)))&&(e=65536+(e-55296<<10)+(n-56320),s++),h+=e<128?1:e<2048?2:e<65536?3:4;for(i=r.uint8array?new Uint8Array(h):new Array(h),s=o=0;o<h;s++)55296==(64512&(e=t.charCodeAt(s)))&&s+1<a&&56320==(64512&(n=t.charCodeAt(s+1)))&&(e=65536+(e-55296<<10)+(n-56320),s++),e<128?i[o++]=e:(e<2048?i[o++]=192|e>>>6:(e<65536?i[o++]=224|e>>>12:(i[o++]=240|e>>>18,i[o++]=128|e>>>12&63),i[o++]=128|e>>>6&63),i[o++]=128|63&e);return i}(t)},e.utf8decode=function(t){return r.nodebuffer?n.transformTo("nodebuffer",t).toString("utf-8"):function(t){var i,e,r,s,o=t.length,h=new Array(2*o);for(i=e=0;i<o;)if((r=t[i++])<128)h[e++]=r;else if(4<(s=a[r]))h[e++]=65533,i+=s-1;else{for(r&=2===s?31:3===s?15:7;1<s&&i<o;)r=r<<6|63&t[i++],s--;1<s?h[e++]=65533:r<65536?h[e++]=r:(h[e++]=55296|(r-=65536)>>10&1023,h[e++]=56320|1023&r)}return h.length!==e&&(h.subarray?h=h.subarray(0,e):h.length=e),n.applyFromCharCode(h)}(t=n.transformTo(r.uint8array?"uint8array":"array",t))},n.inherits(u,o),u.prototype.processChunk=function(t){var i=n.transformTo(r.uint8array?"uint8array":"array",t.data);if(this.leftOver&&this.leftOver.length){if(r.uint8array){var s=i;(i=new Uint8Array(s.length+this.leftOver.length)).set(this.leftOver,0),i.set(s,this.leftOver.length)}else i=this.leftOver.concat(i);this.leftOver=null}var o=function(t,i){var e;for((i=i||t.length)>t.length&&(i=t.length),e=i-1;0<=e&&128==(192&t[e]);)e--;return e<0||0===e?i:e+a[t[e]]>i?e:i}(i),h=i;o!==i.length&&(r.uint8array?(h=i.subarray(0,o),this.leftOver=i.subarray(o,i.length)):(h=i.slice(0,o),this.leftOver=i.slice(o,i.length))),this.push({data:e.utf8decode(h),meta:t.meta})},u.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:e.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},e.Utf8DecodeWorker=u,n.inherits(c,o),c.prototype.processChunk=function(t){this.push({data:e.utf8encode(t.data),meta:t.meta})},e.Utf8EncodeWorker=c},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,i,e){var n=t("./support"),r=t("./base64"),s=t("./nodejsUtils"),o=t("./external");function a(t){return t}function h(t,i){for(var e=0;e<t.length;++e)i[e]=255&t.charCodeAt(e);return i}t("setimmediate"),e.newBlob=function(t,i){e.checkSupport("blob");try{return new Blob([t],{type:i})}catch(e){try{var n=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return n.append(t),n.getBlob(i)}catch(t){throw new Error("Bug : can't construct the Blob.")}}};var u={stringifyByChunk:function(t,i,e){var n=[],r=0,s=t.length;if(s<=e)return String.fromCharCode.apply(null,t);for(;r<s;)n.push(String.fromCharCode.apply(null,"array"===i||"nodebuffer"===i?t.slice(r,Math.min(r+e,s)):t.subarray(r,Math.min(r+e,s)))),r+=e;return n.join("")},stringifyByChar:function(t){for(var i="",e=0;e<t.length;e++)i+=String.fromCharCode(t[e]);return i},applyCanBeUsed:{uint8array:function(){try{return n.uint8array&&1===String.fromCharCode.apply(null,new Uint8Array(1)).length}catch(t){return!1}}(),nodebuffer:function(){try{return n.nodebuffer&&1===String.fromCharCode.apply(null,s.allocBuffer(1)).length}catch(t){return!1}}()}};function c(t){var i=65536,n=e.getTypeOf(t),r=!0;if("uint8array"===n?r=u.applyCanBeUsed.uint8array:"nodebuffer"===n&&(r=u.applyCanBeUsed.nodebuffer),r)for(;1<i;)try{return u.stringifyByChunk(t,n,i)}catch(t){i=Math.floor(i/2)}return u.stringifyByChar(t)}function l(t,i){for(var e=0;e<t.length;e++)i[e]=t[e];return i}e.applyFromCharCode=c;var d={};d.string={string:a,array:function(t){return h(t,new Array(t.length))},arraybuffer:function(t){return d.string.uint8array(t).buffer},uint8array:function(t){return h(t,new Uint8Array(t.length))},nodebuffer:function(t){return h(t,s.allocBuffer(t.length))}},d.array={string:c,array:a,arraybuffer:function(t){return new Uint8Array(t).buffer},uint8array:function(t){return new Uint8Array(t)},nodebuffer:function(t){return s.newBufferFrom(t)}},d.arraybuffer={string:function(t){return c(new Uint8Array(t))},array:function(t){return l(new Uint8Array(t),new Array(t.byteLength))},arraybuffer:a,uint8array:function(t){return new Uint8Array(t)},nodebuffer:function(t){return s.newBufferFrom(new Uint8Array(t))}},d.uint8array={string:c,array:function(t){return l(t,new Array(t.length))},arraybuffer:function(t){return t.buffer},uint8array:a,nodebuffer:function(t){return s.newBufferFrom(t)}},d.nodebuffer={string:c,array:function(t){return l(t,new Array(t.length))},arraybuffer:function(t){return d.nodebuffer.uint8array(t).buffer},uint8array:function(t){return l(t,new Uint8Array(t.length))},nodebuffer:a},e.transformTo=function(t,i){if(i=i||"",!t)return i;e.checkSupport(t);var n=e.getTypeOf(i);return d[n][t](i)},e.resolve=function(t){for(var i=t.split("/"),e=[],n=0;n<i.length;n++){var r=i[n];"."===r||""===r&&0!==n&&n!==i.length-1||(".."===r?e.pop():e.push(r))}return e.join("/")},e.getTypeOf=function(t){return"string"==typeof t?"string":"[object Array]"===Object.prototype.toString.call(t)?"array":n.nodebuffer&&s.isBuffer(t)?"nodebuffer":n.uint8array&&t instanceof Uint8Array?"uint8array":n.arraybuffer&&t instanceof ArrayBuffer?"arraybuffer":void 0},e.checkSupport=function(t){if(!n[t.toLowerCase()])throw new Error(t+" is not supported by this platform")},e.MAX_VALUE_16BITS=65535,e.MAX_VALUE_32BITS=-1,e.pretty=function(t){var i,e,n="";for(e=0;e<(t||"").length;e++)n+="\\x"+((i=t.charCodeAt(e))<16?"0":"")+i.toString(16).toUpperCase();return n},e.delay=function(t,i,e){setImmediate((function(){t.apply(e||null,i||[])}))},e.inherits=function(t,i){function e(){}e.prototype=i.prototype,t.prototype=new e},e.extend=function(){var t,i,e={};for(t=0;t<arguments.length;t++)for(i in arguments[t])Object.prototype.hasOwnProperty.call(arguments[t],i)&&void 0===e[i]&&(e[i]=arguments[t][i]);return e},e.prepareContent=function(t,i,s,a,u){return o.Promise.resolve(i).then((function(t){return n.blob&&(t instanceof Blob||-1!==["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(t)))&&"undefined"!=typeof FileReader?new o.Promise((function(i,e){var n=new FileReader;n.onload=function(t){i(t.target.result)},n.onerror=function(t){e(t.target.error)},n.readAsArrayBuffer(t)})):t})).then((function(i){var c=e.getTypeOf(i);return c?("arraybuffer"===c?i=e.transformTo("uint8array",i):"string"===c&&(u?i=r.decode(i):s&&!0!==a&&(i=function(t){return h(t,n.uint8array?new Uint8Array(t.length):new Array(t.length))}(i))),i):o.Promise.reject(new Error("Can't read the data of '"+t+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))}))}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(t,i){var e=t("./reader/readerFor"),n=t("./utils"),r=t("./signature"),s=t("./zipEntry"),o=t("./support");function a(t){this.files=[],this.loadOptions=t}a.prototype={checkSignature:function(t){if(!this.reader.readAndCheckSignature(t)){this.reader.index-=4;var i=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+n.pretty(i)+", expected "+n.pretty(t)+")")}},isSignature:function(t,i){var e=this.reader.index;this.reader.setIndex(t);var n=this.reader.readString(4)===i;return this.reader.setIndex(e),n},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),i=n.transformTo(o.uint8array?"uint8array":"array",t);this.zipComment=this.loadOptions.decodeFileName(i)},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,i,e,n=this.zip64EndOfCentralSize-44;0<n;)t=this.reader.readInt(2),i=this.reader.readInt(4),e=this.reader.readData(i),this.zip64ExtensibleData[t]={id:t,length:i,value:e}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var t,i;for(t=0;t<this.files.length;t++)this.reader.setIndex((i=this.files[t]).localHeaderOffset),this.checkSignature(r.LOCAL_FILE_HEADER),i.readLocalPart(this.reader),i.handleUTF8(),i.processAttributes()},readCentralDir:function(){var t;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(r.CENTRAL_FILE_HEADER);)(t=new s({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(t);if(this.centralDirRecords!==this.files.length&&0!==this.centralDirRecords&&0===this.files.length)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var t=this.reader.lastIndexOfSignature(r.CENTRAL_DIRECTORY_END);if(t<0)throw this.isSignature(0,r.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(t);var i=t;if(this.checkSignature(r.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===n.MAX_VALUE_16BITS||this.diskWithCentralDirStart===n.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===n.MAX_VALUE_16BITS||this.centralDirRecords===n.MAX_VALUE_16BITS||this.centralDirSize===n.MAX_VALUE_32BITS||this.centralDirOffset===n.MAX_VALUE_32BITS){if(this.zip64=!0,(t=this.reader.lastIndexOfSignature(r.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(t),this.checkSignature(r.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,r.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(r.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(r.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var e=this.centralDirOffset+this.centralDirSize;this.zip64&&(e+=20,e+=12+this.zip64EndOfCentralSize);var s=i-e;if(0<s)this.isSignature(i,r.CENTRAL_FILE_HEADER)||(this.reader.zero=s);else if(s<0)throw new Error("Corrupted zip: missing "+Math.abs(s)+" bytes.")},prepareReader:function(t){this.reader=e(t)},load:function(t){this.prepareReader(t),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},i.exports=a},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(t,i){var e=t("./reader/readerFor"),n=t("./utils"),r=t("./compressedObject"),s=t("./crc32"),o=t("./utf8"),a=t("./compressions"),h=t("./support");function u(t,i){this.options=t,this.loadOptions=i}u.prototype={isEncrypted:function(){return!(1&~this.bitFlag)},useUTF8:function(){return!(2048&~this.bitFlag)},readLocalPart:function(t){var i,e;if(t.skip(22),this.fileNameLength=t.readInt(2),e=t.readInt(2),this.fileName=t.readData(this.fileNameLength),t.skip(e),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(i=function(t){for(var i in a)if(Object.prototype.hasOwnProperty.call(a,i)&&a[i].magic===t)return a[i];return null}(this.compressionMethod)))throw new Error("Corrupted zip : compression "+n.pretty(this.compressionMethod)+" unknown (inner file : "+n.transformTo("string",this.fileName)+")");this.decompressed=new r(this.compressedSize,this.uncompressedSize,this.crc32,i,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 i=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 new Error("Encrypted zip are not supported");t.skip(i),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=e(this.extraFields[1].value);this.uncompressedSize===n.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===n.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===n.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===n.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4))}},readExtraFields:function(t){var i,e,n,r=t.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});t.index+4<r;)i=t.readInt(2),e=t.readInt(2),n=t.readData(e),this.extraFields[i]={id:i,length:e,value:n};t.setIndex(r)},handleUTF8:function(){var t=h.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=o.utf8decode(this.fileName),this.fileCommentStr=o.utf8decode(this.fileComment);else{var i=this.findExtraFieldUnicodePath();if(null!==i)this.fileNameStr=i;else{var e=n.transformTo(t,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(e)}var r=this.findExtraFieldUnicodeComment();if(null!==r)this.fileCommentStr=r;else{var s=n.transformTo(t,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(s)}}},findExtraFieldUnicodePath:function(){var t=this.extraFields[28789];if(t){var i=e(t.value);return 1!==i.readInt(1)||s(this.fileName)!==i.readInt(4)?null:o.utf8decode(i.readData(t.length-5))}return null},findExtraFieldUnicodeComment:function(){var t=this.extraFields[25461];if(t){var i=e(t.value);return 1!==i.readInt(1)||s(this.fileComment)!==i.readInt(4)?null:o.utf8decode(i.readData(t.length-5))}return null}},i.exports=u},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(t,i){function e(t,i,e){this.name=t,this.dir=e.dir,this.date=e.date,this.comment=e.comment,this.unixPermissions=e.unixPermissions,this.dosPermissions=e.dosPermissions,this._data=i,this._dataBinary=e.binary,this.options={compression:e.compression,compressionOptions:e.compressionOptions}}var n=t("./stream/StreamHelper"),r=t("./stream/DataWorker"),s=t("./utf8"),o=t("./compressedObject"),a=t("./stream/GenericWorker");e.prototype={internalStream:function(t){var i=null,e="string";try{if(!t)throw new Error("No output type specified.");var r="string"===(e=t.toLowerCase())||"text"===e;"binarystring"!==e&&"text"!==e||(e="string"),i=this._decompressWorker();var o=!this._dataBinary;o&&!r&&(i=i.pipe(new s.Utf8EncodeWorker)),!o&&r&&(i=i.pipe(new s.Utf8DecodeWorker))}catch(t){(i=new a("error")).error(t)}return new n(i,e,"")},async:function(t,i){return this.internalStream(t).accumulate(i)},nodeStream:function(t,i){return this.internalStream(t||"nodebuffer").toNodejsStream(i)},_compressWorker:function(t,i){if(this._data instanceof o&&this._data.compression.magic===t.magic)return this._data.getCompressedWorker();var e=this._decompressWorker();return this._dataBinary||(e=e.pipe(new s.Utf8EncodeWorker)),o.createWorkerFrom(e,t,i)},_decompressWorker:function(){return this._data instanceof o?this._data.getContentWorker():this._data instanceof a?this._data:new r(this._data)}};for(var h=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],u=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},c=0;c<h.length;c++)e.prototype[h[c]]=u;i.exports=e},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(t,i){(function(t){var e,n,r=t.MutationObserver||t.WebKitMutationObserver;if(r){var s=0,o=new r(c),a=t.document.createTextNode("");o.observe(a,{characterData:!0}),e=function(){a.data=s=++s%2}}else if(t.setImmediate||void 0===t.MessageChannel)e="document"in t&&"onreadystatechange"in t.document.createElement("script")?function(){var i=t.document.createElement("script");i.onreadystatechange=function(){c(),i.onreadystatechange=null,i.parentNode.removeChild(i),i=null},t.document.documentElement.appendChild(i)}:function(){setTimeout(c,0)};else{var h=new t.MessageChannel;h.port1.onmessage=c,e=function(){h.port2.postMessage(0)}}var u=[];function c(){var t,i;n=!0;for(var e=u.length;e;){for(i=u,u=[],t=-1;++t<e;)i[t]();e=u.length}n=!1}i.exports=function(t){1!==u.push(t)||n||e()}}).call(this,void 0!==C?C:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],37:[function(t,i){var e=t("immediate");function n(){}var r={},s=["REJECTED"],o=["FULFILLED"],a=["PENDING"];function h(t){if("function"!=typeof t)throw new TypeError("resolver must be a function");this.state=a,this.queue=[],this.outcome=void 0,t!==n&&d(this,t)}function u(t,i,e){this.promise=t,"function"==typeof i&&(this.onFulfilled=i,this.callFulfilled=this.otherCallFulfilled),"function"==typeof e&&(this.onRejected=e,this.callRejected=this.otherCallRejected)}function c(t,i,n){e((function(){var e;try{e=i(n)}catch(e){return r.reject(t,e)}e===t?r.reject(t,new TypeError("Cannot resolve promise with itself")):r.resolve(t,e)}))}function l(t){var i=t&&t.then;if(t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof i)return function(){i.apply(t,arguments)}}function d(t,i){var e=!1;function n(i){e||(e=!0,r.reject(t,i))}function s(i){e||(e=!0,r.resolve(t,i))}var o=f((function(){i(s,n)}));"error"===o.status&&n(o.value)}function f(t,i){var e={};try{e.value=t(i),e.status="success"}catch(t){e.status="error",e.value=t}return e}(i.exports=h).prototype.finally=function(t){if("function"!=typeof t)return this;var i=this.constructor;return this.then((function(e){return i.resolve(t()).then((function(){return e}))}),(function(e){return i.resolve(t()).then((function(){throw e}))}))},h.prototype.catch=function(t){return this.then(null,t)},h.prototype.then=function(t,i){if("function"!=typeof t&&this.state===o||"function"!=typeof i&&this.state===s)return this;var e=new this.constructor(n);return this.state!==a?c(e,this.state===o?t:i,this.outcome):this.queue.push(new u(e,t,i)),e},u.prototype.callFulfilled=function(t){r.resolve(this.promise,t)},u.prototype.otherCallFulfilled=function(t){c(this.promise,this.onFulfilled,t)},u.prototype.callRejected=function(t){r.reject(this.promise,t)},u.prototype.otherCallRejected=function(t){c(this.promise,this.onRejected,t)},r.resolve=function(t,i){var e=f(l,i);if("error"===e.status)return r.reject(t,e.value);var n=e.value;if(n)d(t,n);else{t.state=o,t.outcome=i;for(var s=-1,a=t.queue.length;++s<a;)t.queue[s].callFulfilled(i)}return t},r.reject=function(t,i){t.state=s,t.outcome=i;for(var e=-1,n=t.queue.length;++e<n;)t.queue[e].callRejected(i);return t},h.resolve=function(t){return t instanceof this?t:r.resolve(new this(n),t)},h.reject=function(t){var i=new this(n);return r.reject(i,t)},h.all=function(t){var i=this;if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var e=t.length,s=!1;if(!e)return this.resolve([]);for(var o=new Array(e),a=0,h=-1,u=new this(n);++h<e;)c(t[h],h);return u;function c(t,n){i.resolve(t).then((function(t){o[n]=t,++a!==e||s||(s=!0,r.resolve(u,o))}),(function(t){s||(s=!0,r.reject(u,t))}))}},h.race=function(t){if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var i=t.length,e=!1;if(!i)return this.resolve([]);for(var s=-1,o=new this(n);++s<i;)this.resolve(t[s]).then((function(t){e||(e=!0,r.resolve(o,t))}),(function(t){e||(e=!0,r.reject(o,t))}));return o}},{immediate:36}],38:[function(t,i){var e={};(0,t("./lib/utils/common").assign)(e,t("./lib/deflate"),t("./lib/inflate"),t("./lib/zlib/constants")),i.exports=e},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(t,i,e){var n=t("./zlib/deflate"),r=t("./utils/common"),s=t("./utils/strings"),o=t("./zlib/messages"),a=t("./zlib/zstream"),h=Object.prototype.toString;function u(t){if(!(this instanceof u))return new u(t);this.options=r.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},t||{});var i=this.options;i.raw&&0<i.windowBits?i.windowBits=-i.windowBits:i.gzip&&0<i.windowBits&&i.windowBits<16&&(i.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new a,this.strm.avail_out=0;var e=n.deflateInit2(this.strm,i.level,i.method,i.windowBits,i.memLevel,i.strategy);if(0!==e)throw new Error(o[e]);if(i.header&&n.deflateSetHeader(this.strm,i.header),i.dictionary){var c;if(c="string"==typeof i.dictionary?s.string2buf(i.dictionary):"[object ArrayBuffer]"===h.call(i.dictionary)?new Uint8Array(i.dictionary):i.dictionary,0!==(e=n.deflateSetDictionary(this.strm,c)))throw new Error(o[e]);this._dict_set=!0}}function c(t,i){var e=new u(i);if(e.push(t,!0),e.err)throw e.msg||o[e.err];return e.result}u.prototype.push=function(t,i){var e,o,a=this.strm,u=this.options.chunkSize;if(this.ended)return!1;o=i===~~i?i:!0===i?4:0,a.input="string"==typeof t?s.string2buf(t):"[object ArrayBuffer]"===h.call(t)?new Uint8Array(t):t,a.next_in=0,a.avail_in=a.input.length;do{if(0===a.avail_out&&(a.output=new r.Buf8(u),a.next_out=0,a.avail_out=u),1!==(e=n.deflate(a,o))&&0!==e)return this.onEnd(e),!(this.ended=!0);0!==a.avail_out&&(0!==a.avail_in||4!==o&&2!==o)||this.onData("string"===this.options.to?s.buf2binstring(r.shrinkBuf(a.output,a.next_out)):r.shrinkBuf(a.output,a.next_out))}while((0<a.avail_in||0===a.avail_out)&&1!==e);return 4===o?(e=n.deflateEnd(this.strm),this.onEnd(e),this.ended=!0,0===e):2!==o||(this.onEnd(0),!(a.avail_out=0))},u.prototype.onData=function(t){this.chunks.push(t)},u.prototype.onEnd=function(t){0===t&&(this.result="string"===this.options.to?this.chunks.join(""):r.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},e.Deflate=u,e.deflate=c,e.deflateRaw=function(t,i){return(i=i||{}).raw=!0,c(t,i)},e.gzip=function(t,i){return(i=i||{}).gzip=!0,c(t,i)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(t,i,e){var n=t("./zlib/inflate"),r=t("./utils/common"),s=t("./utils/strings"),o=t("./zlib/constants"),a=t("./zlib/messages"),h=t("./zlib/zstream"),u=t("./zlib/gzheader"),c=Object.prototype.toString;function l(t){if(!(this instanceof l))return new l(t);this.options=r.assign({chunkSize:16384,windowBits:0,to:""},t||{});var i=this.options;i.raw&&0<=i.windowBits&&i.windowBits<16&&(i.windowBits=-i.windowBits,0===i.windowBits&&(i.windowBits=-15)),!(0<=i.windowBits&&i.windowBits<16)||t&&t.windowBits||(i.windowBits+=32),15<i.windowBits&&i.windowBits<48&&!(15&i.windowBits)&&(i.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new h,this.strm.avail_out=0;var e=n.inflateInit2(this.strm,i.windowBits);if(e!==o.Z_OK)throw new Error(a[e]);this.header=new u,n.inflateGetHeader(this.strm,this.header)}function d(t,i){var e=new l(i);if(e.push(t,!0),e.err)throw e.msg||a[e.err];return e.result}l.prototype.push=function(t,i){var e,a,h,u,l,d,f=this.strm,p=this.options.chunkSize,g=this.options.dictionary,m=!1;if(this.ended)return!1;a=i===~~i?i:!0===i?o.Z_FINISH:o.Z_NO_FLUSH,f.input="string"==typeof t?s.binstring2buf(t):"[object ArrayBuffer]"===c.call(t)?new Uint8Array(t):t,f.next_in=0,f.avail_in=f.input.length;do{if(0===f.avail_out&&(f.output=new r.Buf8(p),f.next_out=0,f.avail_out=p),(e=n.inflate(f,o.Z_NO_FLUSH))===o.Z_NEED_DICT&&g&&(d="string"==typeof g?s.string2buf(g):"[object ArrayBuffer]"===c.call(g)?new Uint8Array(g):g,e=n.inflateSetDictionary(this.strm,d)),e===o.Z_BUF_ERROR&&!0===m&&(e=o.Z_OK,m=!1),e!==o.Z_STREAM_END&&e!==o.Z_OK)return this.onEnd(e),!(this.ended=!0);f.next_out&&(0!==f.avail_out&&e!==o.Z_STREAM_END&&(0!==f.avail_in||a!==o.Z_FINISH&&a!==o.Z_SYNC_FLUSH)||("string"===this.options.to?(h=s.utf8border(f.output,f.next_out),u=f.next_out-h,l=s.buf2string(f.output,h),f.next_out=u,f.avail_out=p-u,u&&r.arraySet(f.output,f.output,h,u,0),this.onData(l)):this.onData(r.shrinkBuf(f.output,f.next_out)))),0===f.avail_in&&0===f.avail_out&&(m=!0)}while((0<f.avail_in||0===f.avail_out)&&e!==o.Z_STREAM_END);return e===o.Z_STREAM_END&&(a=o.Z_FINISH),a===o.Z_FINISH?(e=n.inflateEnd(this.strm),this.onEnd(e),this.ended=!0,e===o.Z_OK):a!==o.Z_SYNC_FLUSH||(this.onEnd(o.Z_OK),!(f.avail_out=0))},l.prototype.onData=function(t){this.chunks.push(t)},l.prototype.onEnd=function(t){t===o.Z_OK&&(this.result="string"===this.options.to?this.chunks.join(""):r.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},e.Inflate=l,e.inflate=d,e.inflateRaw=function(t,i){return(i=i||{}).raw=!0,d(t,i)},e.ungzip=d},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(t,i,e){var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;e.assign=function(t){for(var i=Array.prototype.slice.call(arguments,1);i.length;){var e=i.shift();if(e){if("object"!=typeof e)throw new TypeError(e+"must be non-object");for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])}}return t},e.shrinkBuf=function(t,i){return t.length===i?t:t.subarray?t.subarray(0,i):(t.length=i,t)};var r={arraySet:function(t,i,e,n,r){if(i.subarray&&t.subarray)t.set(i.subarray(e,e+n),r);else for(var s=0;s<n;s++)t[r+s]=i[e+s]},flattenChunks:function(t){var i,e,n,r,s,o;for(i=n=0,e=t.length;i<e;i++)n+=t[i].length;for(o=new Uint8Array(n),i=r=0,e=t.length;i<e;i++)o.set(s=t[i],r),r+=s.length;return o}},s={arraySet:function(t,i,e,n,r){for(var s=0;s<n;s++)t[r+s]=i[e+s]},flattenChunks:function(t){return[].concat.apply([],t)}};e.setTyped=function(t){t?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,r)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,s))},e.setTyped(n)},{}],42:[function(t,i,e){var n=t("./common"),r=!0,s=!0;try{String.fromCharCode.apply(null,[0])}catch(t){r=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){s=!1}for(var o=new n.Buf8(256),a=0;a<256;a++)o[a]=252<=a?6:248<=a?5:240<=a?4:224<=a?3:192<=a?2:1;function h(t,i){if(i<65537&&(t.subarray&&s||!t.subarray&&r))return String.fromCharCode.apply(null,n.shrinkBuf(t,i));for(var e="",o=0;o<i;o++)e+=String.fromCharCode(t[o]);return e}o[254]=o[254]=1,e.string2buf=function(t){var i,e,r,s,o,a=t.length,h=0;for(s=0;s<a;s++)55296==(64512&(e=t.charCodeAt(s)))&&s+1<a&&56320==(64512&(r=t.charCodeAt(s+1)))&&(e=65536+(e-55296<<10)+(r-56320),s++),h+=e<128?1:e<2048?2:e<65536?3:4;for(i=new n.Buf8(h),s=o=0;o<h;s++)55296==(64512&(e=t.charCodeAt(s)))&&s+1<a&&56320==(64512&(r=t.charCodeAt(s+1)))&&(e=65536+(e-55296<<10)+(r-56320),s++),e<128?i[o++]=e:(e<2048?i[o++]=192|e>>>6:(e<65536?i[o++]=224|e>>>12:(i[o++]=240|e>>>18,i[o++]=128|e>>>12&63),i[o++]=128|e>>>6&63),i[o++]=128|63&e);return i},e.buf2binstring=function(t){return h(t,t.length)},e.binstring2buf=function(t){for(var i=new n.Buf8(t.length),e=0,r=i.length;e<r;e++)i[e]=t.charCodeAt(e);return i},e.buf2string=function(t,i){var e,n,r,s,a=i||t.length,u=new Array(2*a);for(e=n=0;e<a;)if((r=t[e++])<128)u[n++]=r;else if(4<(s=o[r]))u[n++]=65533,e+=s-1;else{for(r&=2===s?31:3===s?15:7;1<s&&e<a;)r=r<<6|63&t[e++],s--;1<s?u[n++]=65533:r<65536?u[n++]=r:(u[n++]=55296|(r-=65536)>>10&1023,u[n++]=56320|1023&r)}return h(u,n)},e.utf8border=function(t,i){var e;for((i=i||t.length)>t.length&&(i=t.length),e=i-1;0<=e&&128==(192&t[e]);)e--;return e<0||0===e?i:e+o[t[e]]>i?e:i}},{"./common":41}],43:[function(t,i){i.exports=function(t,i,e,n){for(var r=65535&t,s=t>>>16&65535,o=0;0!==e;){for(e-=o=2e3<e?2e3:e;s=s+(r=r+i[n++]|0)|0,--o;);r%=65521,s%=65521}return r|s<<16}},{}],44:[function(t,i){i.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}},{}],45:[function(t,i){var e=function(){for(var t,i=[],e=0;e<256;e++){t=e;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;i[e]=t}return i}();i.exports=function(t,i,n,r){var s=e,o=r+n;t^=-1;for(var a=r;a<o;a++)t=t>>>8^s[255&(t^i[a])];return~t}},{}],46:[function(t,i,e){var n,r=t("../utils/common"),s=t("./trees"),o=t("./adler32"),a=t("./crc32"),h=t("./messages"),u=-2,c=258,l=262,d=113;function f(t,i){return t.msg=h[i],i}function p(t){return(t<<1)-(4<t?9:0)}function g(t){for(var i=t.length;0<=--i;)t[i]=0}function m(t){var i=t.state,e=i.pending;e>t.avail_out&&(e=t.avail_out),0!==e&&(r.arraySet(t.output,i.pending_buf,i.pending_out,e,t.next_out),t.next_out+=e,i.pending_out+=e,t.total_out+=e,t.avail_out-=e,i.pending-=e,0===i.pending&&(i.pending_out=0))}function b(t,i){s._tr_flush_block(t,0<=t.block_start?t.block_start:-1,t.strstart-t.block_start,i),t.block_start=t.strstart,m(t.strm)}function v(t,i){t.pending_buf[t.pending++]=i}function w(t,i){t.pending_buf[t.pending++]=i>>>8&255,t.pending_buf[t.pending++]=255&i}function y(t,i){var e,n,r=t.max_chain_length,s=t.strstart,o=t.prev_length,a=t.nice_match,h=t.strstart>t.w_size-l?t.strstart-(t.w_size-l):0,u=t.window,d=t.w_mask,f=t.prev,p=t.strstart+c,g=u[s+o-1],m=u[s+o];t.prev_length>=t.good_match&&(r>>=2),a>t.lookahead&&(a=t.lookahead);do{if(u[(e=i)+o]===m&&u[e+o-1]===g&&u[e]===u[s]&&u[++e]===u[s+1]){s+=2,e++;do{}while(u[++s]===u[++e]&&u[++s]===u[++e]&&u[++s]===u[++e]&&u[++s]===u[++e]&&u[++s]===u[++e]&&u[++s]===u[++e]&&u[++s]===u[++e]&&u[++s]===u[++e]&&s<p);if(n=c-(p-s),s=p-c,o<n){if(t.match_start=i,a<=(o=n))break;g=u[s+o-1],m=u[s+o]}}}while((i=f[i&d])>h&&0!=--r);return o<=t.lookahead?o:t.lookahead}function x(t){var i,e,n,s,h,u,c,d,f,p,g=t.w_size;do{if(s=t.window_size-t.lookahead-t.strstart,t.strstart>=g+(g-l)){for(r.arraySet(t.window,t.window,g,g,0),t.match_start-=g,t.strstart-=g,t.block_start-=g,i=e=t.hash_size;n=t.head[--i],t.head[i]=g<=n?n-g:0,--e;);for(i=e=g;n=t.prev[--i],t.prev[i]=g<=n?n-g:0,--e;);s+=g}if(0===t.strm.avail_in)break;if(c=t.window,d=t.strstart+t.lookahead,p=void 0,(f=s)<(p=(u=t.strm).avail_in)&&(p=f),e=0===p?0:(u.avail_in-=p,r.arraySet(c,u.input,u.next_in,p,d),1===u.state.wrap?u.adler=o(u.adler,c,p,d):2===u.state.wrap&&(u.adler=a(u.adler,c,p,d)),u.next_in+=p,u.total_in+=p,p),t.lookahead+=e,t.lookahead+t.insert>=3)for(t.ins_h=t.window[h=t.strstart-t.insert],t.ins_h=(t.ins_h<<t.hash_shift^t.window[h+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[h+3-1])&t.hash_mask,t.prev[h&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=h,h++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<l&&0!==t.strm.avail_in)}function k(t,i){for(var e,n;;){if(t.lookahead<l){if(x(t),t.lookahead<l&&0===i)return 1;if(0===t.lookahead)break}if(e=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,e=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==e&&t.strstart-e<=t.w_size-l&&(t.match_length=y(t,e)),t.match_length>=3)if(n=s._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){for(t.match_length--;t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,e=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart,0!=--t.match_length;);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else n=s._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(b(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===i?(b(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(b(t,!1),0===t.strm.avail_out)?1:2}function A(t,i){for(var e,n,r;;){if(t.lookahead<l){if(x(t),t.lookahead<l&&0===i)return 1;if(0===t.lookahead)break}if(e=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,e=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==e&&t.prev_length<t.max_lazy_match&&t.strstart-e<=t.w_size-l&&(t.match_length=y(t,e),t.match_length<=5&&(1===t.strategy||3===t.match_length&&4096<t.strstart-t.match_start)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){for(r=t.strstart+t.lookahead-3,n=s._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;++t.strstart<=r&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,e=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!=--t.prev_length;);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(b(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((n=s._tr_tally(t,0,t.window[t.strstart-1]))&&b(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=s._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===i?(b(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(b(t,!1),0===t.strm.avail_out)?1:2}function S(t,i,e,n,r){this.good_length=t,this.max_lazy=i,this.nice_length=e,this.max_chain=n,this.func=r}function j(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new r.Buf16(1146),this.dyn_dtree=new r.Buf16(122),this.bl_tree=new r.Buf16(78),g(this.dyn_ltree),g(this.dyn_dtree),g(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new r.Buf16(16),this.heap=new r.Buf16(573),g(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new r.Buf16(573),g(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function M(t){var i;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=2,(i=t.state).pending=0,i.pending_out=0,i.wrap<0&&(i.wrap=-i.wrap),i.status=i.wrap?42:d,t.adler=2===i.wrap?0:1,i.last_flush=0,s._tr_init(i),0):f(t,u)}function E(t){var i=M(t);return 0===i&&function(t){t.window_size=2*t.w_size,g(t.head),t.max_lazy_match=n[t.level].max_lazy,t.good_match=n[t.level].good_length,t.nice_match=n[t.level].nice_length,t.max_chain_length=n[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=2,t.match_available=0,t.ins_h=0}(t.state),i}function O(t,i,e,n,s,o){if(!t)return u;var a=1;if(-1===i&&(i=6),n<0?(a=0,n=-n):15<n&&(a=2,n-=16),s<1||9<s||8!==e||n<8||15<n||i<0||9<i||o<0||4<o)return f(t,u);8===n&&(n=9);var h=new j;return(t.state=h).strm=t,h.wrap=a,h.gzhead=null,h.w_bits=n,h.w_size=1<<h.w_bits,h.w_mask=h.w_size-1,h.hash_bits=s+7,h.hash_size=1<<h.hash_bits,h.hash_mask=h.hash_size-1,h.hash_shift=~~((h.hash_bits+3-1)/3),h.window=new r.Buf8(2*h.w_size),h.head=new r.Buf16(h.hash_size),h.prev=new r.Buf16(h.w_size),h.lit_bufsize=1<<s+6,h.pending_buf_size=4*h.lit_bufsize,h.pending_buf=new r.Buf8(h.pending_buf_size),h.d_buf=1*h.lit_bufsize,h.l_buf=3*h.lit_bufsize,h.level=i,h.strategy=o,h.method=e,E(t)}n=[new S(0,0,0,0,(function(t,i){var e=65535;for(e>t.pending_buf_size-5&&(e=t.pending_buf_size-5);;){if(t.lookahead<=1){if(x(t),0===t.lookahead&&0===i)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+e;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,b(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-l&&(b(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===i?(b(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&b(t,!1),1)})),new S(4,4,8,4,k),new S(4,5,16,8,k),new S(4,6,32,32,k),new S(4,4,16,16,A),new S(8,16,32,32,A),new S(8,16,128,128,A),new S(8,32,128,256,A),new S(32,128,258,1024,A),new S(32,258,258,4096,A)],e.deflateInit=function(t,i){return O(t,i,8,15,8,0)},e.deflateInit2=O,e.deflateReset=E,e.deflateResetKeep=M,e.deflateSetHeader=function(t,i){return t&&t.state?2!==t.state.wrap?u:(t.state.gzhead=i,0):u},e.deflate=function(t,i){var e,r,o,h;if(!t||!t.state||5<i||i<0)return t?f(t,u):u;if(r=t.state,!t.output||!t.input&&0!==t.avail_in||666===r.status&&4!==i)return f(t,0===t.avail_out?-5:u);if(r.strm=t,e=r.last_flush,r.last_flush=i,42===r.status)if(2===r.wrap)t.adler=0,v(r,31),v(r,139),v(r,8),r.gzhead?(v(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),v(r,255&r.gzhead.time),v(r,r.gzhead.time>>8&255),v(r,r.gzhead.time>>16&255),v(r,r.gzhead.time>>24&255),v(r,9===r.level?2:2<=r.strategy||r.level<2?4:0),v(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(v(r,255&r.gzhead.extra.length),v(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=a(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(v(r,0),v(r,0),v(r,0),v(r,0),v(r,0),v(r,9===r.level?2:2<=r.strategy||r.level<2?4:0),v(r,3),r.status=d);else{var l=8+(r.w_bits-8<<4)<<8;l|=(2<=r.strategy||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(l|=32),l+=31-l%31,r.status=d,w(r,l),0!==r.strstart&&(w(r,t.adler>>>16),w(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(o=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>o&&(t.adler=a(t.adler,r.pending_buf,r.pending-o,o)),m(t),o=r.pending,r.pending!==r.pending_buf_size));)v(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>o&&(t.adler=a(t.adler,r.pending_buf,r.pending-o,o)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){o=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>o&&(t.adler=a(t.adler,r.pending_buf,r.pending-o,o)),m(t),o=r.pending,r.pending===r.pending_buf_size)){h=1;break}h=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,v(r,h)}while(0!==h);r.gzhead.hcrc&&r.pending>o&&(t.adler=a(t.adler,r.pending_buf,r.pending-o,o)),0===h&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){o=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>o&&(t.adler=a(t.adler,r.pending_buf,r.pending-o,o)),m(t),o=r.pending,r.pending===r.pending_buf_size)){h=1;break}h=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,v(r,h)}while(0!==h);r.gzhead.hcrc&&r.pending>o&&(t.adler=a(t.adler,r.pending_buf,r.pending-o,o)),0===h&&(r.status=103)}else r.status=103;if(103===r.status&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&m(t),r.pending+2<=r.pending_buf_size&&(v(r,255&t.adler),v(r,t.adler>>8&255),t.adler=0,r.status=d)):r.status=d),0!==r.pending){if(m(t),0===t.avail_out)return r.last_flush=-1,0}else if(0===t.avail_in&&p(i)<=p(e)&&4!==i)return f(t,-5);if(666===r.status&&0!==t.avail_in)return f(t,-5);if(0!==t.avail_in||0!==r.lookahead||0!==i&&666!==r.status){var y=2===r.strategy?function(t,i){for(var e;;){if(0===t.lookahead&&(x(t),0===t.lookahead)){if(0===i)return 1;break}if(t.match_length=0,e=s._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,e&&(b(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===i?(b(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(b(t,!1),0===t.strm.avail_out)?1:2}(r,i):3===r.strategy?function(t,i){for(var e,n,r,o,a=t.window;;){if(t.lookahead<=c){if(x(t),t.lookahead<=c&&0===i)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&0<t.strstart&&(n=a[r=t.strstart-1])===a[++r]&&n===a[++r]&&n===a[++r]){o=t.strstart+c;do{}while(n===a[++r]&&n===a[++r]&&n===a[++r]&&n===a[++r]&&n===a[++r]&&n===a[++r]&&n===a[++r]&&n===a[++r]&&r<o);t.match_length=c-(o-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(e=s._tr_tally(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(e=s._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),e&&(b(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===i?(b(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(b(t,!1),0===t.strm.avail_out)?1:2}(r,i):n[r.level].func(r,i);if(3!==y&&4!==y||(r.status=666),1===y||3===y)return 0===t.avail_out&&(r.last_flush=-1),0;if(2===y&&(1===i?s._tr_align(r):5!==i&&(s._tr_stored_block(r,0,0,!1),3===i&&(g(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),m(t),0===t.avail_out))return r.last_flush=-1,0}return 4!==i?0:r.wrap<=0?1:(2===r.wrap?(v(r,255&t.adler),v(r,t.adler>>8&255),v(r,t.adler>>16&255),v(r,t.adler>>24&255),v(r,255&t.total_in),v(r,t.total_in>>8&255),v(r,t.total_in>>16&255),v(r,t.total_in>>24&255)):(w(r,t.adler>>>16),w(r,65535&t.adler)),m(t),0<r.wrap&&(r.wrap=-r.wrap),0!==r.pending?0:1)},e.deflateEnd=function(t){var i;return t&&t.state?42!==(i=t.state.status)&&69!==i&&73!==i&&91!==i&&103!==i&&i!==d&&666!==i?f(t,u):(t.state=null,i===d?f(t,-3):0):u},e.deflateSetDictionary=function(t,i){var e,n,s,a,h,c,l,d,f=i.length;if(!t||!t.state)return u;if(2===(a=(e=t.state).wrap)||1===a&&42!==e.status||e.lookahead)return u;for(1===a&&(t.adler=o(t.adler,i,f,0)),e.wrap=0,f>=e.w_size&&(0===a&&(g(e.head),e.strstart=0,e.block_start=0,e.insert=0),d=new r.Buf8(e.w_size),r.arraySet(d,i,f-e.w_size,e.w_size,0),i=d,f=e.w_size),h=t.avail_in,c=t.next_in,l=t.input,t.avail_in=f,t.next_in=0,t.input=i,x(e);e.lookahead>=3;){for(n=e.strstart,s=e.lookahead-2;e.ins_h=(e.ins_h<<e.hash_shift^e.window[n+3-1])&e.hash_mask,e.prev[n&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=n,n++,--s;);e.strstart=n,e.lookahead=2,x(e)}return e.strstart+=e.lookahead,e.block_start=e.strstart,e.insert=e.lookahead,e.lookahead=0,e.match_length=e.prev_length=2,e.match_available=0,t.next_in=c,t.input=l,t.avail_in=h,e.wrap=a,0},e.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(t,i){i.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}},{}],48:[function(t,i){i.exports=function(t,i){var e,n,r,s,o,a,h,u,c,l,d,f,p,g,m,b,v,w,y,x,k,A,S,j,M;j=t.input,r=(n=t.next_in)+(t.avail_in-5),M=t.output,o=(s=t.next_out)-(i-t.avail_out),a=s+(t.avail_out-257),h=(e=t.state).dmax,u=e.wsize,c=e.whave,l=e.wnext,d=e.window,f=e.hold,p=e.bits,g=e.lencode,m=e.distcode,b=(1<<e.lenbits)-1,v=(1<<e.distbits)-1;t:do{p<15&&(f+=j[n++]<<p,f+=j[n++]<<(p+=8),p+=8),w=g[f&b];i:for(;;){if(f>>>=y=w>>>24,p-=y,0==(y=w>>>16&255))M[s++]=65535&w;else{if(!(16&y)){if(!(64&y)){w=g[(65535&w)+(f&(1<<y)-1)];continue i}if(32&y){e.mode=12;break t}t.msg="invalid literal/length code",e.mode=30;break t}x=65535&w,(y&=15)&&(p<y&&(f+=j[n++]<<p,p+=8),x+=f&(1<<y)-1,f>>>=y,p-=y),p<15&&(f+=j[n++]<<p,f+=j[n++]<<(p+=8),p+=8),w=m[f&v];e:for(;;){if(f>>>=y=w>>>24,p-=y,!(16&(y=w>>>16&255))){if(!(64&y)){w=m[(65535&w)+(f&(1<<y)-1)];continue e}t.msg="invalid distance code",e.mode=30;break t}if(k=65535&w,p<(y&=15)&&(f+=j[n++]<<p,(p+=8)<y&&(f+=j[n++]<<p,p+=8)),h<(k+=f&(1<<y)-1)){t.msg="invalid distance too far back",e.mode=30;break t}if(f>>>=y,p-=y,(y=s-o)<k){if(c<(y=k-y)&&e.sane){t.msg="invalid distance too far back",e.mode=30;break t}if(S=d,(A=0)===l){if(A+=u-y,y<x){for(x-=y;M[s++]=d[A++],--y;);A=s-k,S=M}}else if(l<y){if(A+=u+l-y,(y-=l)<x){for(x-=y;M[s++]=d[A++],--y;);if(A=0,l<x){for(x-=y=l;M[s++]=d[A++],--y;);A=s-k,S=M}}}else if(A+=l-y,y<x){for(x-=y;M[s++]=d[A++],--y;);A=s-k,S=M}for(;2<x;)M[s++]=S[A++],M[s++]=S[A++],M[s++]=S[A++],x-=3;x&&(M[s++]=S[A++],1<x&&(M[s++]=S[A++]))}else{for(A=s-k;M[s++]=M[A++],M[s++]=M[A++],M[s++]=M[A++],2<(x-=3););x&&(M[s++]=M[A++],1<x&&(M[s++]=M[A++]))}break}}break}}while(n<r&&s<a);n-=x=p>>3,f&=(1<<(p-=x<<3))-1,t.next_in=n,t.next_out=s,t.avail_in=n<r?r-n+5:5-(n-r),t.avail_out=s<a?a-s+257:257-(s-a),e.hold=f,e.bits=p}},{}],49:[function(t,i,e){var n=t("../utils/common"),r=t("./adler32"),s=t("./crc32"),o=t("./inffast"),a=t("./inftrees"),h=-2;function u(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 n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function l(t){var i;return t&&t.state?(t.total_in=t.total_out=(i=t.state).total=0,t.msg="",i.wrap&&(t.adler=1&i.wrap),i.mode=1,i.last=0,i.havedict=0,i.dmax=32768,i.head=null,i.hold=0,i.bits=0,i.lencode=i.lendyn=new n.Buf32(852),i.distcode=i.distdyn=new n.Buf32(592),i.sane=1,i.back=-1,0):h}function d(t){var i;return t&&t.state?((i=t.state).wsize=0,i.whave=0,i.wnext=0,l(t)):h}function f(t,i){var e,n;return t&&t.state?(n=t.state,i<0?(e=0,i=-i):(e=1+(i>>4),i<48&&(i&=15)),i&&(i<8||15<i)?h:(null!==n.window&&n.wbits!==i&&(n.window=null),n.wrap=e,n.wbits=i,d(t))):h}function p(t,i){var e,n;return t?(n=new c,(t.state=n).window=null,0!==(e=f(t,i))&&(t.state=null),e):h}var g,m,b=!0;function v(t){if(b){var i;for(g=new n.Buf32(512),m=new n.Buf32(32),i=0;i<144;)t.lens[i++]=8;for(;i<256;)t.lens[i++]=9;for(;i<280;)t.lens[i++]=7;for(;i<288;)t.lens[i++]=8;for(a(1,t.lens,0,288,g,0,t.work,{bits:9}),i=0;i<32;)t.lens[i++]=5;a(2,t.lens,0,32,m,0,t.work,{bits:5}),b=!1}t.lencode=g,t.lenbits=9,t.distcode=m,t.distbits=5}function w(t,i,e,r){var s,o=t.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new n.Buf8(o.wsize)),r>=o.wsize?(n.arraySet(o.window,i,e-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(r<(s=o.wsize-o.wnext)&&(s=r),n.arraySet(o.window,i,e-r,s,o.wnext),(r-=s)?(n.arraySet(o.window,i,e-r,r,0),o.wnext=r,o.whave=o.wsize):(o.wnext+=s,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=s))),0}e.inflateReset=d,e.inflateReset2=f,e.inflateResetKeep=l,e.inflateInit=function(t){return p(t,15)},e.inflateInit2=p,e.inflate=function(t,i){var e,c,l,d,f,p,g,m,b,y,x,k,A,S,j,M,E,O,C,$,I,_,T,P,z=0,W=new n.Buf8(4),D=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return h;12===(e=t.state).mode&&(e.mode=13),f=t.next_out,l=t.output,d=t.next_in,c=t.input,m=e.hold,b=e.bits,y=p=t.avail_in,x=g=t.avail_out,_=0;t:for(;;)switch(e.mode){case 1:if(0===e.wrap){e.mode=13;break}for(;b<16;){if(0===p)break t;p--,m+=c[d++]<<b,b+=8}if(2&e.wrap&&35615===m){W[e.check=0]=255&m,W[1]=m>>>8&255,e.check=s(e.check,W,2,0),b=m=0,e.mode=2;break}if(e.flags=0,e.head&&(e.head.done=!1),!(1&e.wrap)||(((255&m)<<8)+(m>>8))%31){t.msg="incorrect header check",e.mode=30;break}if(8!=(15&m)){t.msg="unknown compression method",e.mode=30;break}if(b-=4,I=8+(15&(m>>>=4)),0===e.wbits)e.wbits=I;else if(I>e.wbits){t.msg="invalid window size",e.mode=30;break}e.dmax=1<<I,t.adler=e.check=1,e.mode=512&m?10:12,b=m=0;break;case 2:for(;b<16;){if(0===p)break t;p--,m+=c[d++]<<b,b+=8}if(e.flags=m,8!=(255&e.flags)){t.msg="unknown compression method",e.mode=30;break}if(57344&e.flags){t.msg="unknown header flags set",e.mode=30;break}e.head&&(e.head.text=m>>8&1),512&e.flags&&(W[0]=255&m,W[1]=m>>>8&255,e.check=s(e.check,W,2,0)),b=m=0,e.mode=3;case 3:for(;b<32;){if(0===p)break t;p--,m+=c[d++]<<b,b+=8}e.head&&(e.head.time=m),512&e.flags&&(W[0]=255&m,W[1]=m>>>8&255,W[2]=m>>>16&255,W[3]=m>>>24&255,e.check=s(e.check,W,4,0)),b=m=0,e.mode=4;case 4:for(;b<16;){if(0===p)break t;p--,m+=c[d++]<<b,b+=8}e.head&&(e.head.xflags=255&m,e.head.os=m>>8),512&e.flags&&(W[0]=255&m,W[1]=m>>>8&255,e.check=s(e.check,W,2,0)),b=m=0,e.mode=5;case 5:if(1024&e.flags){for(;b<16;){if(0===p)break t;p--,m+=c[d++]<<b,b+=8}e.length=m,e.head&&(e.head.extra_len=m),512&e.flags&&(W[0]=255&m,W[1]=m>>>8&255,e.check=s(e.check,W,2,0)),b=m=0}else e.head&&(e.head.extra=null);e.mode=6;case 6:if(1024&e.flags&&(p<(k=e.length)&&(k=p),k&&(e.head&&(I=e.head.extra_len-e.length,e.head.extra||(e.head.extra=new Array(e.head.extra_len)),n.arraySet(e.head.extra,c,d,k,I)),512&e.flags&&(e.check=s(e.check,c,k,d)),p-=k,d+=k,e.length-=k),e.length))break t;e.length=0,e.mode=7;case 7:if(2048&e.flags){if(0===p)break t;for(k=0;I=c[d+k++],e.head&&I&&e.length<65536&&(e.head.name+=String.fromCharCode(I)),I&&k<p;);if(512&e.flags&&(e.check=s(e.check,c,k,d)),p-=k,d+=k,I)break t}else e.head&&(e.head.name=null);e.length=0,e.mode=8;case 8:if(4096&e.flags){if(0===p)break t;for(k=0;I=c[d+k++],e.head&&I&&e.length<65536&&(e.head.comment+=String.fromCharCode(I)),I&&k<p;);if(512&e.flags&&(e.check=s(e.check,c,k,d)),p-=k,d+=k,I)break t}else e.head&&(e.head.comment=null);e.mode=9;case 9:if(512&e.flags){for(;b<16;){if(0===p)break t;p--,m+=c[d++]<<b,b+=8}if(m!==(65535&e.check)){t.msg="header crc mismatch",e.mode=30;break}b=m=0}e.head&&(e.head.hcrc=e.flags>>9&1,e.head.done=!0),t.adler=e.check=0,e.mode=12;break;case 10:for(;b<32;){if(0===p)break t;p--,m+=c[d++]<<b,b+=8}t.adler=e.check=u(m),b=m=0,e.mode=11;case 11:if(0===e.havedict)return t.next_out=f,t.avail_out=g,t.next_in=d,t.avail_in=p,e.hold=m,e.bits=b,2;t.adler=e.check=1,e.mode=12;case 12:if(5===i||6===i)break t;case 13:if(e.last){m>>>=7&b,b-=7&b,e.mode=27;break}for(;b<3;){if(0===p)break t;p--,m+=c[d++]<<b,b+=8}switch(e.last=1&m,b-=1,3&(m>>>=1)){case 0:e.mode=14;break;case 1:if(v(e),e.mode=20,6!==i)break;m>>>=2,b-=2;break t;case 2:e.mode=17;break;case 3:t.msg="invalid block type",e.mode=30}m>>>=2,b-=2;break;case 14:for(m>>>=7&b,b-=7&b;b<32;){if(0===p)break t;p--,m+=c[d++]<<b,b+=8}if((65535&m)!=(m>>>16^65535)){t.msg="invalid stored block lengths",e.mode=30;break}if(e.length=65535&m,b=m=0,e.mode=15,6===i)break t;case 15:e.mode=16;case 16:if(k=e.length){if(p<k&&(k=p),g<k&&(k=g),0===k)break t;n.arraySet(l,c,d,k,f),p-=k,d+=k,g-=k,f+=k,e.length-=k;break}e.mode=12;break;case 17:for(;b<14;){if(0===p)break t;p--,m+=c[d++]<<b,b+=8}if(e.nlen=257+(31&m),b-=5,e.ndist=1+(31&(m>>>=5)),b-=5,e.ncode=4+(15&(m>>>=5)),m>>>=4,b-=4,286<e.nlen||30<e.ndist){t.msg="too many length or distance symbols",e.mode=30;break}e.have=0,e.mode=18;case 18:for(;e.have<e.ncode;){for(;b<3;){if(0===p)break t;p--,m+=c[d++]<<b,b+=8}e.lens[D[e.have++]]=7&m,m>>>=3,b-=3}for(;e.have<19;)e.lens[D[e.have++]]=0;if(e.lencode=e.lendyn,e.lenbits=7,_=a(0,e.lens,0,19,e.lencode,0,e.work,T={bits:e.lenbits}),e.lenbits=T.bits,_){t.msg="invalid code lengths set",e.mode=30;break}e.have=0,e.mode=19;case 19:for(;e.have<e.nlen+e.ndist;){for(;M=(z=e.lencode[m&(1<<e.lenbits)-1])>>>16&255,E=65535&z,!((j=z>>>24)<=b);){if(0===p)break t;p--,m+=c[d++]<<b,b+=8}if(E<16)m>>>=j,b-=j,e.lens[e.have++]=E;else{if(16===E){for(P=j+2;b<P;){if(0===p)break t;p--,m+=c[d++]<<b,b+=8}if(m>>>=j,b-=j,0===e.have){t.msg="invalid bit length repeat",e.mode=30;break}I=e.lens[e.have-1],k=3+(3&m),m>>>=2,b-=2}else if(17===E){for(P=j+3;b<P;){if(0===p)break t;p--,m+=c[d++]<<b,b+=8}b-=j,I=0,k=3+(7&(m>>>=j)),m>>>=3,b-=3}else{for(P=j+7;b<P;){if(0===p)break t;p--,m+=c[d++]<<b,b+=8}b-=j,I=0,k=11+(127&(m>>>=j)),m>>>=7,b-=7}if(e.have+k>e.nlen+e.ndist){t.msg="invalid bit length repeat",e.mode=30;break}for(;k--;)e.lens[e.have++]=I}}if(30===e.mode)break;if(0===e.lens[256]){t.msg="invalid code -- missing end-of-block",e.mode=30;break}if(e.lenbits=9,_=a(1,e.lens,0,e.nlen,e.lencode,0,e.work,T={bits:e.lenbits}),e.lenbits=T.bits,_){t.msg="invalid literal/lengths set",e.mode=30;break}if(e.distbits=6,e.distcode=e.distdyn,_=a(2,e.lens,e.nlen,e.ndist,e.distcode,0,e.work,T={bits:e.distbits}),e.distbits=T.bits,_){t.msg="invalid distances set",e.mode=30;break}if(e.mode=20,6===i)break t;case 20:e.mode=21;case 21:if(6<=p&&258<=g){t.next_out=f,t.avail_out=g,t.next_in=d,t.avail_in=p,e.hold=m,e.bits=b,o(t,x),f=t.next_out,l=t.output,g=t.avail_out,d=t.next_in,c=t.input,p=t.avail_in,m=e.hold,b=e.bits,12===e.mode&&(e.back=-1);break}for(e.back=0;M=(z=e.lencode[m&(1<<e.lenbits)-1])>>>16&255,E=65535&z,!((j=z>>>24)<=b);){if(0===p)break t;p--,m+=c[d++]<<b,b+=8}if(M&&!(240&M)){for(O=j,C=M,$=E;M=(z=e.lencode[$+((m&(1<<O+C)-1)>>O)])>>>16&255,E=65535&z,!(O+(j=z>>>24)<=b);){if(0===p)break t;p--,m+=c[d++]<<b,b+=8}m>>>=O,b-=O,e.back+=O}if(m>>>=j,b-=j,e.back+=j,e.length=E,0===M){e.mode=26;break}if(32&M){e.back=-1,e.mode=12;break}if(64&M){t.msg="invalid literal/length code",e.mode=30;break}e.extra=15&M,e.mode=22;case 22:if(e.extra){for(P=e.extra;b<P;){if(0===p)break t;p--,m+=c[d++]<<b,b+=8}e.length+=m&(1<<e.extra)-1,m>>>=e.extra,b-=e.extra,e.back+=e.extra}e.was=e.length,e.mode=23;case 23:for(;M=(z=e.distcode[m&(1<<e.distbits)-1])>>>16&255,E=65535&z,!((j=z>>>24)<=b);){if(0===p)break t;p--,m+=c[d++]<<b,b+=8}if(!(240&M)){for(O=j,C=M,$=E;M=(z=e.distcode[$+((m&(1<<O+C)-1)>>O)])>>>16&255,E=65535&z,!(O+(j=z>>>24)<=b);){if(0===p)break t;p--,m+=c[d++]<<b,b+=8}m>>>=O,b-=O,e.back+=O}if(m>>>=j,b-=j,e.back+=j,64&M){t.msg="invalid distance code",e.mode=30;break}e.offset=E,e.extra=15&M,e.mode=24;case 24:if(e.extra){for(P=e.extra;b<P;){if(0===p)break t;p--,m+=c[d++]<<b,b+=8}e.offset+=m&(1<<e.extra)-1,m>>>=e.extra,b-=e.extra,e.back+=e.extra}if(e.offset>e.dmax){t.msg="invalid distance too far back",e.mode=30;break}e.mode=25;case 25:if(0===g)break t;if(e.offset>(k=x-g)){if((k=e.offset-k)>e.whave&&e.sane){t.msg="invalid distance too far back",e.mode=30;break}A=k>e.wnext?e.wsize-(k-=e.wnext):e.wnext-k,k>e.length&&(k=e.length),S=e.window}else S=l,A=f-e.offset,k=e.length;for(g<k&&(k=g),g-=k,e.length-=k;l[f++]=S[A++],--k;);0===e.length&&(e.mode=21);break;case 26:if(0===g)break t;l[f++]=e.length,g--,e.mode=21;break;case 27:if(e.wrap){for(;b<32;){if(0===p)break t;p--,m|=c[d++]<<b,b+=8}if(t.total_out+=x-=g,e.total+=x,x&&(t.adler=e.check=e.flags?s(e.check,l,x,f-x):r(e.check,l,x,f-x)),x=g,(e.flags?m:u(m))!==e.check){t.msg="incorrect data check",e.mode=30;break}b=m=0}e.mode=28;case 28:if(e.wrap&&e.flags){for(;b<32;){if(0===p)break t;p--,m+=c[d++]<<b,b+=8}if(m!==(4294967295&e.total)){t.msg="incorrect length check",e.mode=30;break}b=m=0}e.mode=29;case 29:_=1;break t;case 30:_=-3;break t;case 31:return-4;default:return h}return t.next_out=f,t.avail_out=g,t.next_in=d,t.avail_in=p,e.hold=m,e.bits=b,(e.wsize||x!==t.avail_out&&e.mode<30&&(e.mode<27||4!==i))&&w(t,t.output,t.next_out,x-t.avail_out)?(e.mode=31,-4):(x-=t.avail_out,t.total_in+=y-=t.avail_in,t.total_out+=x,e.total+=x,e.wrap&&x&&(t.adler=e.check=e.flags?s(e.check,l,x,t.next_out-x):r(e.check,l,x,t.next_out-x)),t.data_type=e.bits+(e.last?64:0)+(12===e.mode?128:0)+(20===e.mode||15===e.mode?256:0),(0==y&&0===x||4===i)&&0===_&&(_=-5),_)},e.inflateEnd=function(t){if(!t||!t.state)return h;var i=t.state;return i.window&&(i.window=null),t.state=null,0},e.inflateGetHeader=function(t,i){var e;return t&&t.state&&2&(e=t.state).wrap?((e.head=i).done=!1,0):h},e.inflateSetDictionary=function(t,i){var e,n=i.length;return t&&t.state?0!==(e=t.state).wrap&&11!==e.mode?h:11===e.mode&&r(1,i,n,0)!==e.check?-3:w(t,i,n,n)?(e.mode=31,-4):(e.havedict=1,0):h},e.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(t,i){var e=t("../utils/common"),n=[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],r=[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],s=[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],o=[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];i.exports=function(t,i,a,h,u,c,l,d){var f,p,g,m,b,v,w,y,x,k=d.bits,A=0,S=0,j=0,M=0,E=0,O=0,C=0,$=0,I=0,_=0,T=null,P=0,z=new e.Buf16(16),W=new e.Buf16(16),D=null,L=0;for(A=0;A<=15;A++)z[A]=0;for(S=0;S<h;S++)z[i[a+S]]++;for(E=k,M=15;1<=M&&0===z[M];M--);if(M<E&&(E=M),0===M)return u[c++]=20971520,u[c++]=20971520,d.bits=1,0;for(j=1;j<M&&0===z[j];j++);for(E<j&&(E=j),A=$=1;A<=15;A++)if($<<=1,($-=z[A])<0)return-1;if(0<$&&(0===t||1!==M))return-1;for(W[1]=0,A=1;A<15;A++)W[A+1]=W[A]+z[A];for(S=0;S<h;S++)0!==i[a+S]&&(l[W[i[a+S]]++]=S);if(v=0===t?(T=D=l,19):1===t?(T=n,P-=257,D=r,L-=257,256):(T=s,D=o,-1),A=j,b=c,C=S=_=0,g=-1,m=(I=1<<(O=E))-1,1===t&&852<I||2===t&&592<I)return 1;for(;;){for(w=A-C,x=l[S]<v?(y=0,l[S]):l[S]>v?(y=D[L+l[S]],T[P+l[S]]):(y=96,0),f=1<<A-C,j=p=1<<O;u[b+(_>>C)+(p-=f)]=w<<24|y<<16|x,0!==p;);for(f=1<<A-1;_&f;)f>>=1;if(0!==f?(_&=f-1,_+=f):_=0,S++,0==--z[A]){if(A===M)break;A=i[a+l[S]]}if(E<A&&(_&m)!==g){for(0===C&&(C=E),b+=j,$=1<<(O=A-C);O+C<M&&!(($-=z[O+C])<=0);)O++,$<<=1;if(I+=1<<O,1===t&&852<I||2===t&&592<I)return 1;u[g=_&m]=E<<24|O<<16|b-c}}return 0!==_&&(u[b+_]=A-C<<24|64<<16),d.bits=E,0}},{"../utils/common":41}],51:[function(t,i){i.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"}},{}],52:[function(t,i,e){var n=t("../utils/common");function r(t){for(var i=t.length;0<=--i;)t[i]=0}var s=256,o=286,a=30,h=15,u=[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],c=[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],l=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],d=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],f=new Array(576);r(f);var p=new Array(60);r(p);var g=new Array(512);r(g);var m=new Array(256);r(m);var b=new Array(29);r(b);var v,w,y,x=new Array(a);function k(t,i,e,n,r){this.static_tree=t,this.extra_bits=i,this.extra_base=e,this.elems=n,this.max_length=r,this.has_stree=t&&t.length}function A(t,i){this.dyn_tree=t,this.max_code=0,this.stat_desc=i}function S(t){return t<256?g[t]:g[256+(t>>>7)]}function j(t,i){t.pending_buf[t.pending++]=255&i,t.pending_buf[t.pending++]=i>>>8&255}function M(t,i,e){t.bi_valid>16-e?(t.bi_buf|=i<<t.bi_valid&65535,j(t,t.bi_buf),t.bi_buf=i>>16-t.bi_valid,t.bi_valid+=e-16):(t.bi_buf|=i<<t.bi_valid&65535,t.bi_valid+=e)}function E(t,i,e){M(t,e[2*i],e[2*i+1])}function O(t,i){for(var e=0;e|=1&t,t>>>=1,e<<=1,0<--i;);return e>>>1}function C(t,i,e){var n,r,s=new Array(16),o=0;for(n=1;n<=h;n++)s[n]=o=o+e[n-1]<<1;for(r=0;r<=i;r++){var a=t[2*r+1];0!==a&&(t[2*r]=O(s[a]++,a))}}function $(t){var i;for(i=0;i<o;i++)t.dyn_ltree[2*i]=0;for(i=0;i<a;i++)t.dyn_dtree[2*i]=0;for(i=0;i<19;i++)t.bl_tree[2*i]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function I(t){8<t.bi_valid?j(t,t.bi_buf):0<t.bi_valid&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function _(t,i,e,n){var r=2*i,s=2*e;return t[r]<t[s]||t[r]===t[s]&&n[i]<=n[e]}function T(t,i,e){for(var n=t.heap[e],r=e<<1;r<=t.heap_len&&(r<t.heap_len&&_(i,t.heap[r+1],t.heap[r],t.depth)&&r++,!_(i,n,t.heap[r],t.depth));)t.heap[e]=t.heap[r],e=r,r<<=1;t.heap[e]=n}function P(t,i,e){var n,r,o,a,h=0;if(0!==t.last_lit)for(;n=t.pending_buf[t.d_buf+2*h]<<8|t.pending_buf[t.d_buf+2*h+1],r=t.pending_buf[t.l_buf+h],h++,0===n?E(t,r,i):(E(t,(o=m[r])+s+1,i),0!==(a=u[o])&&M(t,r-=b[o],a),E(t,o=S(--n),e),0!==(a=c[o])&&M(t,n-=x[o],a)),h<t.last_lit;);E(t,256,i)}function z(t,i){var e,n,r,s=i.dyn_tree,o=i.stat_desc.static_tree,a=i.stat_desc.has_stree,u=i.stat_desc.elems,c=-1;for(t.heap_len=0,t.heap_max=573,e=0;e<u;e++)0!==s[2*e]?(t.heap[++t.heap_len]=c=e,t.depth[e]=0):s[2*e+1]=0;for(;t.heap_len<2;)s[2*(r=t.heap[++t.heap_len]=c<2?++c:0)]=1,t.depth[r]=0,t.opt_len--,a&&(t.static_len-=o[2*r+1]);for(i.max_code=c,e=t.heap_len>>1;1<=e;e--)T(t,s,e);for(r=u;e=t.heap[1],t.heap[1]=t.heap[t.heap_len--],T(t,s,1),n=t.heap[1],t.heap[--t.heap_max]=e,t.heap[--t.heap_max]=n,s[2*r]=s[2*e]+s[2*n],t.depth[r]=(t.depth[e]>=t.depth[n]?t.depth[e]:t.depth[n])+1,s[2*e+1]=s[2*n+1]=r,t.heap[1]=r++,T(t,s,1),2<=t.heap_len;);t.heap[--t.heap_max]=t.heap[1],function(t,i){var e,n,r,s,o,a,u=i.dyn_tree,c=i.max_code,l=i.stat_desc.static_tree,d=i.stat_desc.has_stree,f=i.stat_desc.extra_bits,p=i.stat_desc.extra_base,g=i.stat_desc.max_length,m=0;for(s=0;s<=h;s++)t.bl_count[s]=0;for(u[2*t.heap[t.heap_max]+1]=0,e=t.heap_max+1;e<573;e++)g<(s=u[2*u[2*(n=t.heap[e])+1]+1]+1)&&(s=g,m++),u[2*n+1]=s,c<n||(t.bl_count[s]++,o=0,p<=n&&(o=f[n-p]),t.opt_len+=(a=u[2*n])*(s+o),d&&(t.static_len+=a*(l[2*n+1]+o)));if(0!==m){do{for(s=g-1;0===t.bl_count[s];)s--;t.bl_count[s]--,t.bl_count[s+1]+=2,t.bl_count[g]--,m-=2}while(0<m);for(s=g;0!==s;s--)for(n=t.bl_count[s];0!==n;)c<(r=t.heap[--e])||(u[2*r+1]!==s&&(t.opt_len+=(s-u[2*r+1])*u[2*r],u[2*r+1]=s),n--)}}(t,i),C(s,c,t.bl_count)}function W(t,i,e){var n,r,s=-1,o=i[1],a=0,h=7,u=4;for(0===o&&(h=138,u=3),i[2*(e+1)+1]=65535,n=0;n<=e;n++)r=o,o=i[2*(n+1)+1],++a<h&&r===o||(a<u?t.bl_tree[2*r]+=a:0!==r?(r!==s&&t.bl_tree[2*r]++,t.bl_tree[32]++):a<=10?t.bl_tree[34]++:t.bl_tree[36]++,s=r,u=(a=0)===o?(h=138,3):r===o?(h=6,3):(h=7,4))}function D(t,i,e){var n,r,s=-1,o=i[1],a=0,h=7,u=4;for(0===o&&(h=138,u=3),n=0;n<=e;n++)if(r=o,o=i[2*(n+1)+1],!(++a<h&&r===o)){if(a<u)for(;E(t,r,t.bl_tree),0!=--a;);else 0!==r?(r!==s&&(E(t,r,t.bl_tree),a--),E(t,16,t.bl_tree),M(t,a-3,2)):a<=10?(E(t,17,t.bl_tree),M(t,a-3,3)):(E(t,18,t.bl_tree),M(t,a-11,7));s=r,u=(a=0)===o?(h=138,3):r===o?(h=6,3):(h=7,4)}}r(x);var L=!1;function F(t,i,e,r){M(t,0+(r?1:0),3),function(t,i,e){I(t),j(t,e),j(t,~e),n.arraySet(t.pending_buf,t.window,i,e,t.pending),t.pending+=e}(t,i,e)}e._tr_init=function(t){L||(function(){var t,i,e,n,r,s=new Array(16);for(n=e=0;n<28;n++)for(b[n]=e,t=0;t<1<<u[n];t++)m[e++]=n;for(m[e-1]=n,n=r=0;n<16;n++)for(x[n]=r,t=0;t<1<<c[n];t++)g[r++]=n;for(r>>=7;n<a;n++)for(x[n]=r<<7,t=0;t<1<<c[n]-7;t++)g[256+r++]=n;for(i=0;i<=h;i++)s[i]=0;for(t=0;t<=143;)f[2*t+1]=8,t++,s[8]++;for(;t<=255;)f[2*t+1]=9,t++,s[9]++;for(;t<=279;)f[2*t+1]=7,t++,s[7]++;for(;t<=287;)f[2*t+1]=8,t++,s[8]++;for(C(f,287,s),t=0;t<a;t++)p[2*t+1]=5,p[2*t]=O(t,5);v=new k(f,u,257,o,h),w=new k(p,c,0,a,h),y=new k(new Array(0),l,0,19,7)}(),L=!0),t.l_desc=new A(t.dyn_ltree,v),t.d_desc=new A(t.dyn_dtree,w),t.bl_desc=new A(t.bl_tree,y),t.bi_buf=0,t.bi_valid=0,$(t)},e._tr_stored_block=F,e._tr_flush_block=function(t,i,e,n){var r,o,a=0;0<t.level?(2===t.strm.data_type&&(t.strm.data_type=function(t){var i,e=4093624447;for(i=0;i<=31;i++,e>>>=1)if(1&e&&0!==t.dyn_ltree[2*i])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(i=32;i<s;i++)if(0!==t.dyn_ltree[2*i])return 1;return 0}(t)),z(t,t.l_desc),z(t,t.d_desc),a=function(t){var i;for(W(t,t.dyn_ltree,t.l_desc.max_code),W(t,t.dyn_dtree,t.d_desc.max_code),z(t,t.bl_desc),i=18;3<=i&&0===t.bl_tree[2*d[i]+1];i--);return t.opt_len+=3*(i+1)+5+5+4,i}(t),(o=t.static_len+3+7>>>3)<=(r=t.opt_len+3+7>>>3)&&(r=o)):r=o=e+5,e+4<=r&&-1!==i?F(t,i,e,n):4===t.strategy||o===r?(M(t,2+(n?1:0),3),P(t,f,p)):(M(t,4+(n?1:0),3),function(t,i,e,n){var r;for(M(t,i-257,5),M(t,e-1,5),M(t,n-4,4),r=0;r<n;r++)M(t,t.bl_tree[2*d[r]+1],3);D(t,t.dyn_ltree,i-1),D(t,t.dyn_dtree,e-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,a+1),P(t,t.dyn_ltree,t.dyn_dtree)),$(t),n&&I(t)},e._tr_tally=function(t,i,e){return t.pending_buf[t.d_buf+2*t.last_lit]=i>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&i,t.pending_buf[t.l_buf+t.last_lit]=255&e,t.last_lit++,0===i?t.dyn_ltree[2*e]++:(t.matches++,i--,t.dyn_ltree[2*(m[e]+s+1)]++,t.dyn_dtree[2*S(i)]++),t.last_lit===t.lit_bufsize-1},e._tr_align=function(t){M(t,2,3),E(t,256,f),function(t){16===t.bi_valid?(j(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):8<=t.bi_valid&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},{"../utils/common":41}],53:[function(t,i){i.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}},{}],54:[function(){(function(t){!function(t){if(!t.setImmediate){var i,e,n,r,s=1,o={},a=!1,h=t.document,u=Object.getPrototypeOf&&Object.getPrototypeOf(t);u=u&&u.setTimeout?u:t,i="[object process]"==={}.toString.call(t.process)?function(t){process.nextTick((function(){l(t)}))}:function(){if(t.postMessage&&!t.importScripts){var i=!0,e=t.onmessage;return t.onmessage=function(){i=!1},t.postMessage("","*"),t.onmessage=e,i}}()?(r="setImmediate$"+Math.random()+"$",t.addEventListener?t.addEventListener("message",d,!1):t.attachEvent("onmessage",d),function(i){t.postMessage(r+i,"*")}):t.MessageChannel?((n=new MessageChannel).port1.onmessage=function(t){l(t.data)},function(t){n.port2.postMessage(t)}):h&&"onreadystatechange"in h.createElement("script")?(e=h.documentElement,function(t){var i=h.createElement("script");i.onreadystatechange=function(){l(t),i.onreadystatechange=null,e.removeChild(i),i=null},e.appendChild(i)}):function(t){setTimeout(l,0,t)},u.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n<e.length;n++)e[n]=arguments[n+1];return o[s]={callback:t,args:e},i(s),s++},u.clearImmediate=c}function c(t){delete o[t]}function l(t){if(a)setTimeout(l,0,t);else{var i=o[t];if(i){a=!0;try{!function(t){var i=t.callback,e=t.args;switch(e.length){case 0:i();break;case 1:i(e[0]);break;case 2:i(e[0],e[1]);break;case 3:i(e[0],e[1],e[2]);break;default:i.apply(undefined,e)}}(i)}finally{c(t),a=!1}}}}function d(i){i.source===t&&"string"==typeof i.data&&0===i.data.indexOf(r)&&l(+i.data.slice(r.length))}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,void 0!==C?C:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[10])(10)),Ii.exports),Ti=$(_i);
1
+ import{r as t,h as i,H as e,a as n,c as r,d as s}from"./p-Dq-Z8Dx0.js";import{R as o,s as a,i as h,c as u,p as c,e as l,S as d,a as f,A as p,b as g,d as m,t as b,C as v,h as w,f as y,L as x,T as k,j as A,k as S,l as j,r as M,m as E,n as O,o as C,g as $,q as I,u as _,v as T,G as P,w as z,x as W,y as D,z as L,B as F,N as R,P as B,D as N,E as U,F as H,H as q,I as X,J as V,K as G,M as Y,O as Z,Q as K,U as J,V as Q,W as tt,X as it,Y as et,Z as nt,_ as rt}from"./p-C4OTDhbr.js";var st,ot,at={exports:{}},ht=st?at.exports:(st=1,ot=()=>(()=>{var t=[,(t,i,e)=>{var n;e.r(i),e.d(i,{default:()=>r});const r=(n="undefined"!=typeof document?document.currentScript?.src:void 0,function(t={}){var i,e,r=t,s=new Promise(((t,n)=>{i=t,e=n})),o="object"==typeof window,a="function"==typeof importScripts;function h(){function t(t){const s=n;e=i=0,n=new Map,s.forEach((i=>{try{i(t)}catch(t){console.error(t)}})),this.nb(),r&&r.Pb()}let i=0,e=0,n=new Map,r=null,s=null;this.requestAnimationFrame=function(r){i||=requestAnimationFrame(t.bind(this));const s=++e;return n.set(s,r),s},this.cancelAnimationFrame=function(t){n.delete(t),i&&0==n.size&&(cancelAnimationFrame(i),i=0)},this.Nb=function(t){s&&(document.body.remove(s),s=null),t||(s=document.createElement("div"),s.style.backgroundColor="black",s.style.position="fixed",s.style.right=0,s.style.top=0,s.style.color="white",s.style.padding="4px",s.innerHTML="RIVE FPS",t=function(t){s.innerHTML="RIVE FPS "+t.toFixed(1)},document.body.appendChild(s)),r=new function(){let i=0,e=0;this.Pb=function(){var n=performance.now();e?(++i,1e3<(n-=e)&&(t(1e3*i/n),i=e=0)):(e=n,i=0)}}},this.Kb=function(){s&&(document.body.remove(s),s=null),r=null},this.nb=function(){}}function u(t){console.assert(!0);const i=new Map;let e=-1/0;this.push=function(n){return i.has(n=n+((1<<t)-1)>>t)&&clearTimeout(i.get(n)),i.set(n,setTimeout((function(){i.delete(n),0==i.length?e=-1/0:n==e&&(e=Math.max(...i.keys()),console.assert(e<n))}),1e3)),e=Math.max(n,e),e<<t}}const c=r.onRuntimeInitialized;r.onRuntimeInitialized=function(){c&&c();let t=r.decodeAudio;r.decodeAudio=function(i,e){e(i=t(i))};let i=r.decodeFont;r.decodeFont=function(t,e){e(t=i(t))};const e=r.FileAssetLoader;r.ptrToAsset=t=>{let i=r.ptrToFileAsset(t);return i.isImage?r.ptrToImageAsset(t):i.isFont?r.ptrToFontAsset(t):i.isAudio?r.ptrToAudioAsset(t):i},r.CustomFileAssetLoader=e.extend("CustomFileAssetLoader",{__construct:function({loadContents:t}){this.__parent.__construct.call(this),this.Db=t},loadContents:function(t,i){return t=r.ptrToAsset(t),this.Db(t,i)}}),r.CDNFileAssetLoader=e.extend("CDNFileAssetLoader",{__construct:function(){this.__parent.__construct.call(this)},loadContents:function(t){let i=r.ptrToAsset(t);return""!==(t=i.cdnUuid)&&(e=i.cdnBaseUrl+"/"+t,(n=new XMLHttpRequest).responseType="arraybuffer",n.onreadystatechange=function(){4==n.readyState&&200==n.status&&(t=>{i.decode(new Uint8Array(t.response))})(n)},n.open("GET",e,!0),n.send(null),!0);var e,n}}),r.FallbackFileAssetLoader=e.extend("FallbackFileAssetLoader",{__construct:function(){this.__parent.__construct.call(this),this.jb=[]},addLoader:function(t){this.jb.push(t)},loadContents:function(t,i){for(let e of this.jb)if(e.loadContents(t,i))return!0;return!1}});let n=r.computeAlignment;r.computeAlignment=function(t,i,e,r,s=1){return n.call(this,t,i,e,r,s)}};const l="createConicGradient createImageData createLinearGradient createPattern createRadialGradient getContextAttributes getImageData getLineDash getTransform isContextLost isPointInPath isPointInStroke measureText".split(" "),d=new function(){function t(){if(!i){var t=document.createElement("canvas"),o={alpha:1,depth:0,stencil:0,antialias:0,premultipliedAlpha:1,preserveDrawingBuffer:0,powerPreference:"high-performance",failIfMajorPerformanceCaveat:0,enableExtensionsByDefault:1,explicitSwapControl:1,renderViaOffscreenBackBuffer:1};let a;if(/iPhone|iPad|iPod/i.test(navigator.userAgent)){if(a=t.getContext("webgl",o),e=1,!a)return console.log("No WebGL support. Image mesh will not be drawn."),!1}else if(a=t.getContext("webgl2",o))e=2;else{if(!(a=t.getContext("webgl",o)))return console.log("No WebGL support. Image mesh will not be drawn."),!1;e=1}function u(t,i,e){if(i=a.createShader(i),a.shaderSource(i,e),a.compileShader(i),0<((e=a.getShaderInfoLog(i))||"").length)throw e;a.attachShader(t,i)}if(a=new Proxy(a,{get:(t,i)=>t.isContextLost()?(h||(console.error("Cannot render the mesh because the GL Context was lost. Tried to invoke ",i),h=!0),"function"==typeof t[i]?function(){}:void 0):"function"==typeof t[i]?function(...e){return t[i].apply(t,e)}:t[i],set(t,i,e){if(!t.isContextLost())return t[i]=e,!0;h||(console.error("Cannot render the mesh because the GL Context was lost. Tried to set property "+i),h=!0)}}),n=Math.min(a.getParameter(a.MAX_RENDERBUFFER_SIZE),a.getParameter(a.MAX_TEXTURE_SIZE)),u(t=a.createProgram(),a.VERTEX_SHADER,"attribute vec2 vertex;\n attribute vec2 uv;\n uniform vec4 mat;\n uniform vec2 translate;\n varying vec2 st;\n void main() {\n st = uv;\n gl_Position = vec4(mat2(mat) * vertex + translate, 0, 1);\n }"),u(t,a.FRAGMENT_SHADER,"precision highp float;\n uniform sampler2D image;\n varying vec2 st;\n void main() {\n gl_FragColor = texture2D(image, st);\n }"),a.bindAttribLocation(t,0,"vertex"),a.bindAttribLocation(t,1,"uv"),a.linkProgram(t),0<((o=a.getProgramInfoLog(t))||"").trim().length)throw o;r=a.getUniformLocation(t,"mat"),s=a.getUniformLocation(t,"translate"),a.useProgram(t),a.bindBuffer(a.ARRAY_BUFFER,a.createBuffer()),a.enableVertexAttribArray(0),a.enableVertexAttribArray(1),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,a.createBuffer()),a.uniform1i(a.getUniformLocation(t,"image"),0),a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),i=a}return!0}let i=null,e=0,n=0,r=null,s=null,o=0,a=0,h=!1;t(),this.ac=function(){return t(),n},this.Jb=function(t){i.deleteTexture&&i.deleteTexture(t)},this.Ib=function(n){if(!t())return null;const r=i.createTexture();return r?(i.bindTexture(i.TEXTURE_2D,r),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,n),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),2==e?(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR_MIPMAP_LINEAR),i.generateMipmap(i.TEXTURE_2D)):i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),r):null};const c=new u(8),l=new u(8),d=new u(10),f=new u(10);this.Mb=function(e,n,h,u,p){if(t()){var g=c.push(e),m=l.push(n);if(i.canvas){for(var b of(i.canvas.width==g&&i.canvas.height==m||(i.canvas.width=g,i.canvas.height=m),i.viewport(0,m-n,e,n),i.disable(i.SCISSOR_TEST),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),i.enable(i.SCISSOR_TEST),h.sort(((t,i)=>i.ub-t.ub)),g=d.push(u),o!=g&&(i.bufferData(i.ARRAY_BUFFER,8*g,i.DYNAMIC_DRAW),o=g),g=0,h))i.bufferSubData(i.ARRAY_BUFFER,g,b.Sa),g+=4*b.Sa.length;for(var v of(console.assert(g==4*u),h))i.bufferSubData(i.ARRAY_BUFFER,g,v.Ab),g+=4*v.Ab.length;for(var w of(console.assert(g==8*u),g=f.push(p),a!=g&&(i.bufferData(i.ELEMENT_ARRAY_BUFFER,2*g,i.DYNAMIC_DRAW),a=g),b=0,h))i.bufferSubData(i.ELEMENT_ARRAY_BUFFER,b,w.indices),b+=2*w.indices.length;console.assert(b==2*p),w=0,v=!0,g=b=0;for(const t of h){t.image.Ia!=w&&(i.bindTexture(i.TEXTURE_2D,t.image.Ha||null),w=t.image.Ia),t.fc?(i.scissor(t.Ya,m-t.Za-t.ib,t.tc,t.ib),v=!0):v&&(i.scissor(0,m-n,e,n),v=!1);const o=-2/n;i.uniform4f(r,t.ga[0]*(h=2/e)*t.za,t.ga[1]*o*t.Aa,t.ga[2]*h*t.za,t.ga[3]*o*t.Aa),i.uniform2f(s,t.ga[4]*h*t.za+h*(t.Ya-t.bc*t.za)-1,t.ga[5]*o*t.Aa+o*(t.Za-t.cc*t.Aa)+1),i.vertexAttribPointer(0,2,i.FLOAT,!1,0,g),i.vertexAttribPointer(1,2,i.FLOAT,!1,0,g+4*u),i.drawElements(i.TRIANGLES,t.indices.length,i.UNSIGNED_SHORT,b),g+=4*t.Sa.length,b+=2*t.indices.length}console.assert(g==4*u),console.assert(b==2*p)}}},this.canvas=function(){return t()&&i.canvas}},f=r.onRuntimeInitialized;r.onRuntimeInitialized=function(){function t(t){switch(t){case p.srcOver:return"source-over";case p.screen:return"screen";case p.overlay:return"overlay";case p.darken:return"darken";case p.lighten:return"lighten";case p.colorDodge:return"color-dodge";case p.colorBurn:return"color-burn";case p.hardLight:return"hard-light";case p.softLight:return"soft-light";case p.difference:return"difference";case p.exclusion:return"exclusion";case p.multiply:return"multiply";case p.hue:return"hue";case p.saturation:return"saturation";case p.color:return"color";case p.luminosity:return"luminosity"}}function i(t){return"rgba("+((16711680&t)>>>16)+","+((65280&t)>>>8)+","+((255&t)>>>0)+","+((4278190080&t)>>>24)/255+")"}function e(){0<S.length&&(d.Mb(A.drawWidth(),A.drawHeight(),S,j,M),S=[],M=j=0,A.reset(512,512));for(const t of k){for(const i of t.H)i();t.H=[]}k.clear()}f&&f();var n=r.RenderPaintStyle;const s=r.RenderPath,o=r.RenderPaint,a=r.Renderer,u=r.StrokeCap,c=r.StrokeJoin,p=r.BlendMode,g=n.fill,m=n.stroke,b=r.FillRule.evenOdd;let v=1;var w=r.RenderImage.extend("CanvasRenderImage",{__construct:function({ka:t,va:i}={}){this.__parent.__construct.call(this),this.Ia=v,v=v+1&2147483647||1,this.ka=t,this.va=i},__destruct:function(){this.Ha&&(d.Jb(this.Ha),URL.revokeObjectURL(this.Va)),this.__parent.__destruct.call(this)},decode:function(t){var i=this;i.va&&i.va(i);var e=new Image;i.Va=URL.createObjectURL(new Blob([t],{type:"image/png"})),e.onload=function(){i.Cb=e,i.Ha=d.Ib(e),i.size(e.width,e.height),i.ka&&i.ka(i)},e.src=i.Va}}),y=s.extend("CanvasRenderPath",{__construct:function(){this.__parent.__construct.call(this),this.T=new Path2D},rewind:function(){this.T=new Path2D},addPath:function(t,i,e,n,r,s,o){var a=this.T,h=a.addPath;t=t.T;const u=new DOMMatrix;u.a=i,u.b=e,u.c=n,u.d=r,u.e=s,u.f=o,h.call(a,t,u)},fillRule:function(t){this.Ua=t},moveTo:function(t,i){this.T.moveTo(t,i)},lineTo:function(t,i){this.T.lineTo(t,i)},cubicTo:function(t,i,e,n,r,s){this.T.bezierCurveTo(t,i,e,n,r,s)},close:function(){this.T.closePath()}}),x=o.extend("CanvasRenderPaint",{color:function(t){this.Wa=i(t)},thickness:function(t){this.Fb=t},join:function(t){switch(t){case c.miter:this.Ga="miter";break;case c.round:this.Ga="round";break;case c.bevel:this.Ga="bevel"}},cap:function(t){switch(t){case u.butt:this.Fa="butt";break;case u.round:this.Fa="round";break;case u.square:this.Fa="square"}},style:function(t){this.Eb=t},blendMode:function(i){this.Bb=t(i)},clearGradient:function(){this.ia=null},linearGradient:function(t,i,e,n){this.ia={wb:t,xb:i,bb:e,cb:n,Pa:[]}},radialGradient:function(t,i,e,n){this.ia={wb:t,xb:i,bb:e,cb:n,Pa:[],$b:!0}},addStop:function(t,i){this.ia.Pa.push({color:t,stop:i})},completeGradient:function(){},draw:function(t,e,n){let r=this.Eb;var s=this.Wa,o=this.ia;if(t.globalCompositeOperation=this.Bb,null!=o){s=o.wb;var a=o.xb;const e=o.bb;var h=o.cb;const n=o.Pa;o.$b?(o=e-s,h-=a,s=t.createRadialGradient(s,a,0,s,a,Math.sqrt(o*o+h*h))):s=t.createLinearGradient(s,a,e,h);for(let t=0,e=n.length;t<e;t++)s.addColorStop((a=n[t]).stop,i(a.color));this.Wa=s,this.ia=null}switch(r){case m:t.strokeStyle=s,t.lineWidth=this.Fb,t.lineCap=this.Fa,t.lineJoin=this.Ga,t.stroke(e);break;case g:t.fillStyle=s,t.fill(e,n)}}});const k=new Set;let A=null,S=[],j=0,M=0;var E=r.CanvasRenderer=a.extend("Renderer",{__construct:function(t){this.__parent.__construct.call(this),this.S=[1,0,0,1,0,0],this.B=t.getContext("2d"),this.Ta=t,this.H=[]},save:function(){this.S.push(...this.S.slice(this.S.length-6)),this.H.push(this.B.save.bind(this.B))},restore:function(){const t=this.S.length-6;if(6>t)throw"restore() called without matching save().";this.S.splice(t),this.H.push(this.B.restore.bind(this.B))},transform:function(t,i,e,n,r,s){const o=this.S,a=o.length-6;o.splice(a,6,o[a]*t+o[a+2]*i,o[a+1]*t+o[a+3]*i,o[a]*e+o[a+2]*n,o[a+1]*e+o[a+3]*n,o[a]*r+o[a+2]*s+o[a+4],o[a+1]*r+o[a+3]*s+o[a+5]),this.H.push(this.B.transform.bind(this.B,t,i,e,n,r,s))},rotate:function(t){const i=Math.sin(t);t=Math.cos(t),this.transform(t,i,-i,t,0,0)},_drawPath:function(t,i){this.H.push(i.draw.bind(i,this.B,t.T,t.Ua===b?"evenodd":"nonzero"))},_drawRiveImage:function(i,e,n,r){var s=i.Cb;if(s){var o=this.B,a=t(n);this.H.push((function(){o.globalCompositeOperation=a,o.globalAlpha=r,o.drawImage(s,0,0),o.globalAlpha=1}))}},_getMatrix:function(t){const i=this.S,e=i.length-6;for(let n=0;6>n;++n)t[n]=i[e+n]},_drawImageMesh:function(i,n,s,o,a,h,u,c,l,f,p){n=this.B.canvas.width;var g=this.B.canvas.height;const m=f-c,b=p-l;c=Math.max(c,0),l=Math.max(l,0),f=Math.min(f,n),p=Math.min(p,g);const v=f-c,w=p-l;if(console.assert(v<=Math.min(m,n)),console.assert(w<=Math.min(b,g)),!(0>=v||0>=w)){f=v<m||w<b,n=p=1;var y=Math.ceil(v*p),x=Math.ceil(w*n);g=d.ac(),y>g&&(p*=g/y,y=g),x>g&&(n*=g/x,x=g),A||(A=new r.DynamicRectanizer(g),A.reset(512,512)),0>(g=A.addRect(y,x))&&(e(),k.add(this),g=A.addRect(y,x),console.assert(0<=g));var E=65535&g,O=g>>16;S.push({ga:this.S.slice(this.S.length-6),image:i,Ya:E,Za:O,bc:c,cc:l,tc:y,ib:x,za:p,Aa:n,Sa:new Float32Array(a),Ab:new Float32Array(h),indices:new Uint16Array(u),fc:f,ub:i.Ia<<1|(f?1:0)}),j+=a.length,M+=u.length;var C=this.B,$=t(s);this.H.push((function(){C.save(),C.resetTransform(),C.globalCompositeOperation=$,C.globalAlpha=o;const t=d.canvas();t&&C.drawImage(t,E,O,y,x,c,l,v,w),C.restore()}))}},_clipPath:function(t){this.H.push(this.B.clip.bind(this.B,t.T,t.Ua===b?"evenodd":"nonzero"))},clear:function(){k.add(this),this.H.push(this.B.clearRect.bind(this.B,0,0,this.Ta.width,this.Ta.height))},flush:function(){},translate:function(t,i){this.transform(1,0,0,1,t,i)}});r.makeRenderer=function(t){const i=new E(t),e=i.B;return new Proxy(i,{get(t,n){if("function"==typeof t[n])return function(...i){return t[n].apply(t,i)};if("function"==typeof e[n]){if(-1<l.indexOf(n))throw Error("RiveException: Method call to '"+n+"()' is not allowed, as the renderer cannot immediately pass through the return values of any canvas 2d context methods.");return function(...t){i.H.push(e[n].bind(e,...t))}}return t[n]},set(t,n,r){if(n in e)return i.H.push((()=>{e[n]=r})),!0}})},r.decodeImage=function(t,i){new w({ka:i}).decode(t)},r.renderFactory={makeRenderPaint:function(){return new x},makeRenderPath:function(){return new y},makeRenderImage:function(){let t=C;return new w({va:()=>{t.total++},ka:()=>{if(t.loaded++,t.loaded===t.total){const i=t.ready;i&&(i(),t.ready=null)}}})}};let O=r.load,C=null;r.load=function(t,i,e=!0){const n=new r.FallbackFileAssetLoader;return void 0!==i&&n.addLoader(i),e&&(i=new r.CDNFileAssetLoader,n.addLoader(i)),new Promise((function(i){let e=null;C={total:0,loaded:0,ready:function(){i(e)}},e=O(t,n),0==C.total&&i(e)}))};let $=r.RendererWrapper.prototype.align;r.RendererWrapper.prototype.align=function(t,i,e,n,r=1){$.call(this,t,i,e,n,r)},n=new h,r.requestAnimationFrame=n.requestAnimationFrame.bind(n),r.cancelAnimationFrame=n.cancelAnimationFrame.bind(n),r.enableFPSCounter=n.Nb.bind(n),r.disableFPSCounter=n.Kb,n.nb=e,r.resolveAnimationFrame=e,r.cleanup=function(){A&&A.delete()}};var p,g,m=Object.assign({},r),b="./this.program",v="";(o||a)&&(a?v=self.location.href:"undefined"!=typeof document&&document.currentScript&&(v=document.currentScript.src),n&&(v=n),v=v.startsWith("blob:")?"":v.substr(0,v.replace(/[?#].*/,"").lastIndexOf("/")+1),a&&(g=t=>{var i=new XMLHttpRequest;return i.open("GET",t,!1),i.responseType="arraybuffer",i.send(null),new Uint8Array(i.response)}),p=(t,i,e)=>{if(N(t)){var n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?i(n.response):e()},n.onerror=e,n.send(null)}else fetch(t,{credentials:"same-origin"}).then((t=>t.ok?t.arrayBuffer():Promise.reject(Error(t.status+" : "+t.url)))).then(i,e)});var w,y=r.print||console.log.bind(console),x=r.printErr||console.error.bind(console);Object.assign(r,m),m=null,r.thisProgram&&(b=r.thisProgram),r.wasmBinary&&(w=r.wasmBinary);var k,A,S,j,M,E,O,C,$,I=!1;function _(){var t=k.buffer;r.HEAP8=A=new Int8Array(t),r.HEAP16=j=new Int16Array(t),r.HEAPU8=S=new Uint8Array(t),r.HEAPU16=M=new Uint16Array(t),r.HEAP32=E=new Int32Array(t),r.HEAPU32=O=new Uint32Array(t),r.HEAPF32=C=new Float32Array(t),r.HEAPF64=$=new Float64Array(t)}var T=[],P=[],z=[];function W(){var t=r.preRun.shift();T.unshift(t)}var D=0,L=null;function F(t){throw r.onAbort?.(t),x(t="Aborted("+t+")"),I=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),e(t),t}var R,B=t=>t.startsWith("data:application/octet-stream;base64,"),N=t=>t.startsWith("file://");function U(t){if(t==R&&w)return new Uint8Array(w);if(g)return g(t);throw"both async and sync fetching of the wasm failed"}function H(t,i,e){return function(t){return w?Promise.resolve().then((()=>U(t))):new Promise(((i,e)=>{p(t,(t=>i(new Uint8Array(t))),(()=>{try{i(U(t))}catch(t){e(t)}}))}))}(t).then((t=>WebAssembly.instantiate(t,i))).then(e,(t=>{x(`failed to asynchronously prepare wasm: ${t}`),F(t)}))}var q,X,V={464256:(t,i,e,n,r)=>{if("undefined"==typeof window||void 0===(window.AudioContext||window.webkitAudioContext))return 0;if(void 0===window.h){window.h={ya:0},window.h.I={},window.h.I.wa=t,window.h.I.capture=i,window.h.I.Ja=e,window.h.fa={},window.h.fa.stopped=n,window.h.fa.vb=r;let s=window.h;s.D=[],s.rc=function(t){for(var i=0;i<s.D.length;++i)if(null==s.D[i])return s.D[i]=t,i;return s.D.push(t),s.D.length-1},s.zb=function(t){for(s.D[t]=null;0<s.D.length&&null==s.D[s.D.length-1];)s.D.pop()},s.Oc=function(t){for(var i=0;i<s.D.length;++i)if(s.D[i]==t)return s.zb(i)},s.pa=function(t){return s.D[t]},s.Ra=["touchend","click"],s.unlock=function(){for(var t=0;t<s.D.length;++t){var i=s.D[t];null!=i&&null!=i.K&&i.state===s.fa.vb&&i.K.resume().then((()=>{Ee(i.ob)}),(t=>{console.error("Failed to resume audiocontext",t)}))}s.Ra.map((function(t){document.removeEventListener(t,s.unlock,!0)}))},s.Ra.map((function(t){document.addEventListener(t,s.unlock,!0)}))}return window.h.ya+=1,1},466434:()=>{void 0!==window.h&&(window.h.Ra.map((function(t){document.removeEventListener(t,window.h.unlock,!0)})),--window.h.ya,0===window.h.ya&&delete window.h)},466738:()=>void 0!==navigator.mediaDevices&&void 0!==navigator.mediaDevices.getUserMedia,466842:()=>{try{var t=new(window.AudioContext||window.webkitAudioContext),i=t.sampleRate;return t.close(),i}catch(t){return 0}},467013:(t,i,e,n,r,s)=>{if(void 0===window.h)return-1;var o={},a={};return t==window.h.I.wa&&0!=e&&(a.sampleRate=e),o.K=new(window.AudioContext||window.webkitAudioContext)(a),o.K.suspend(),o.state=window.h.fa.stopped,e=0,t!=window.h.I.wa&&(e=i),o.Y=o.K.createScriptProcessor(n,e,i),o.Y.onaudioprocess=function(e){if(null!=o.qa&&0!=o.qa.length||(o.qa=new Float32Array(C.buffer,r,n*i)),t==window.h.I.capture||t==window.h.I.Ja){for(var a=0;a<i;a+=1)for(var h=e.inputBuffer.getChannelData(a),u=o.qa,c=0;c<n;c+=1)u[c*i+a]=h[c];Ce(s,n,r)}if(t==window.h.I.wa||t==window.h.I.Ja)for($e(s,n,r),a=0;a<e.outputBuffer.numberOfChannels;++a)for(h=e.outputBuffer.getChannelData(a),u=o.qa,c=0;c<n;c+=1)h[c]=u[c*i+a];else for(a=0;a<e.outputBuffer.numberOfChannels;++a)e.outputBuffer.getChannelData(a).fill(0)},t!=window.h.I.capture&&t!=window.h.I.Ja||navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then((function(t){o.Ba=o.K.createMediaStreamSource(t),o.Ba.connect(o.Y),o.Y.connect(o.K.destination)})).catch((function(t){console.log("Failed to get user media: "+t)})),t==window.h.I.wa&&o.Y.connect(o.K.destination),o.ob=s,window.h.rc(o)},469890:t=>window.h.pa(t).K.sampleRate,469963:t=>{void 0!==(t=window.h.pa(t)).Y&&(t.Y.onaudioprocess=function(){},t.Y.disconnect(),t.Y=void 0),void 0!==t.Ba&&(t.Ba.disconnect(),t.Ba=void 0),t.K.close(),t.K=void 0,t.ob=void 0},470363:t=>{window.h.zb(t)},470413:t=>{(t=window.h.pa(t)).K.resume(),t.state=window.h.fa.vb},470552:t=>{(t=window.h.pa(t)).K.suspend(),t.state=window.h.fa.stopped}},G=t=>{for(;0<t.length;)t.shift()(r)};function Y(){var t=E[+ti>>2];return ti+=4,t}var Z=(t,i)=>{for(var e=0,n=t.length-1;0<=n;n--){var r=t[n];"."===r?t.splice(n,1):".."===r?(t.splice(n,1),e++):e&&(t.splice(n,1),e--)}if(i)for(;e;e--)t.unshift("..");return t},K=t=>{var i="/"===t.charAt(0),e="/"===t.substr(-1);return(t=Z(t.split("/").filter((t=>!!t)),!i).join("/"))||i||(t="."),t&&e&&(t+="/"),(i?"/":"")+t},J=t=>{var i=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(t).slice(1);return t=i[0],i=i[1],t||i?(i&&=i.substr(0,i.length-1),t+i):"."},Q=t=>{if("/"===t)return"/";var i=(t=(t=K(t)).replace(/\/$/,"")).lastIndexOf("/");return-1===i?t:t.substr(i+1)},tt=t=>(tt=(()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return t=>crypto.getRandomValues(t);F("initRandomDevice")})())(t),it=(...t)=>{for(var i="",e=!1,n=t.length-1;-1<=n&&!e;n--){if("string"!=typeof(e=0<=n?t[n]:"/"))throw new TypeError("Arguments to path.resolve must be strings");if(!e)return"";i=e+"/"+i,e="/"===e.charAt(0)}return(e?"/":"")+(i=Z(i.split("/").filter((t=>!!t)),!e).join("/"))||"."},et="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0,nt=(t,i,e)=>{var n=i+e;for(e=i;t[e]&&!(e>=n);)++e;if(16<e-i&&t.buffer&&et)return et.decode(t.subarray(i,e));for(n="";i<e;){var r=t[i++];if(128&r){var s=63&t[i++];if(192==(224&r))n+=String.fromCharCode((31&r)<<6|s);else{var o=63&t[i++];65536>(r=224==(240&r)?(15&r)<<12|s<<6|o:(7&r)<<18|s<<12|o<<6|63&t[i++])?n+=String.fromCharCode(r):(r-=65536,n+=String.fromCharCode(55296|r>>10,56320|1023&r))}}else n+=String.fromCharCode(r)}return n},rt=[],st=t=>{for(var i=0,e=0;e<t.length;++e){var n=t.charCodeAt(e);127>=n?i++:2047>=n?i+=2:55296<=n&&57343>=n?(i+=4,++e):i+=3}return i},ot=(t,i,e,n)=>{if(!(0<n))return 0;var r=e;n=e+n-1;for(var s=0;s<t.length;++s){var o=t.charCodeAt(s);if(55296<=o&&57343>=o&&(o=65536+((1023&o)<<10)|1023&t.charCodeAt(++s)),127>=o){if(e>=n)break;i[e++]=o}else{if(2047>=o){if(e+1>=n)break;i[e++]=192|o>>6}else{if(65535>=o){if(e+2>=n)break;i[e++]=224|o>>12}else{if(e+3>=n)break;i[e++]=240|o>>18,i[e++]=128|o>>12&63}i[e++]=128|o>>6&63}i[e++]=128|63&o}}return i[e]=0,e-r};function at(t,i){var e=Array(st(t)+1);return t=ot(t,e,0,e.length),i&&(e.length=t),e}var ht=[];function ut(t,i){ht[t]={input:[],G:[],V:i},Dt(t,ct)}var ct={open(t){var i=ht[t.node.xa];if(!i)throw new xt(43);t.s=i,t.seekable=!1},close(t){t.s.V.oa(t.s)},oa(t){t.s.V.oa(t.s)},read(t,i,e,n){if(!t.s||!t.s.V.hb)throw new xt(60);for(var r=0,s=0;s<n;s++){try{var o=t.s.V.hb(t.s)}catch(t){throw new xt(29)}if(void 0===o&&0===r)throw new xt(6);if(null==o)break;r++,i[e+s]=o}return r&&(t.node.timestamp=Date.now()),r},write(t,i,e,n){if(!t.s||!t.s.V.Ma)throw new xt(60);try{for(var r=0;r<n;r++)t.s.V.Ma(t.s,i[e+r])}catch(t){throw new xt(29)}return n&&(t.node.timestamp=Date.now()),r}},lt={hb(){t:{if(!rt.length){var t=null;if("undefined"!=typeof window&&"function"==typeof window.prompt&&null!==(t=window.prompt("Input: "))&&(t+="\n"),!t){t=null;break t}rt=at(t,!0)}t=rt.shift()}return t},Ma(t,i){null===i||10===i?(y(nt(t.G,0)),t.G=[]):0!=i&&t.G.push(i)},oa(t){t.G&&0<t.G.length&&(y(nt(t.G,0)),t.G=[])},Xb:()=>({zc:25856,Bc:5,yc:191,Ac:35387,xc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}),Yb:()=>0,Zb:()=>[24,80]},dt={Ma(t,i){null===i||10===i?(x(nt(t.G,0)),t.G=[]):0!=i&&t.G.push(i)},oa(t){t.G&&0<t.G.length&&(x(nt(t.G,0)),t.G=[])}};function ft(t,i){var e=t.l?t.l.length:0;e>=i||(i=Math.max(i,e*(1048576>e?2:1.125)>>>0),0!=e&&(i=Math.max(i,256)),e=t.l,t.l=new Uint8Array(i),0<t.v&&t.l.set(e.subarray(0,t.v),0))}var pt={N:null,U:()=>pt.createNode(null,"/",16895,0),createNode(t,i,e,n){if(24576==(61440&e)||4096==(61440&e))throw new xt(63);return pt.N||(pt.N={dir:{node:{X:pt.j.X,P:pt.j.P,ja:pt.j.ja,ta:pt.j.ta,sb:pt.j.sb,yb:pt.j.yb,tb:pt.j.tb,rb:pt.j.rb,Ca:pt.j.Ca},stream:{aa:pt.m.aa}},file:{node:{X:pt.j.X,P:pt.j.P},stream:{aa:pt.m.aa,read:pt.m.read,write:pt.m.write,Xa:pt.m.Xa,kb:pt.m.kb,mb:pt.m.mb}},link:{node:{X:pt.j.X,P:pt.j.P,la:pt.j.la},stream:{}},$a:{node:{X:pt.j.X,P:pt.j.P},stream:Wt}}),16384==(61440&(e=Ct(t,i,e,n)).mode)?(e.j=pt.N.dir.node,e.m=pt.N.dir.stream,e.l={}):32768==(61440&e.mode)?(e.j=pt.N.file.node,e.m=pt.N.file.stream,e.v=0,e.l=null):40960==(61440&e.mode)?(e.j=pt.N.link.node,e.m=pt.N.link.stream):8192==(61440&e.mode)&&(e.j=pt.N.$a.node,e.m=pt.N.$a.stream),e.timestamp=Date.now(),t&&(t.l[i]=e,t.timestamp=e.timestamp),e},Fc:t=>t.l?t.l.subarray?t.l.subarray(0,t.v):new Uint8Array(t.l):new Uint8Array(0),j:{X(t){var i={};return i.Dc=8192==(61440&t.mode)?t.id:1,i.Hc=t.id,i.mode=t.mode,i.Kc=1,i.uid=0,i.Gc=0,i.xa=t.xa,i.size=16384==(61440&t.mode)?4096:32768==(61440&t.mode)?t.v:40960==(61440&t.mode)?t.link.length:0,i.vc=new Date(t.timestamp),i.Jc=new Date(t.timestamp),i.Cc=new Date(t.timestamp),i.Gb=4096,i.wc=Math.ceil(i.size/i.Gb),i},P(t,i){if(void 0!==i.mode&&(t.mode=i.mode),void 0!==i.timestamp&&(t.timestamp=i.timestamp),void 0!==i.size&&t.v!=(i=i.size))if(0==i)t.l=null,t.v=0;else{var e=t.l;t.l=new Uint8Array(i),e&&t.l.set(e.subarray(0,Math.min(i,t.v))),t.v=i}},ja(){throw kt[44]},ta:(t,i,e,n)=>pt.createNode(t,i,e,n),sb(t,i,e){if(16384==(61440&t.mode)){try{var n=Ot(i,e)}catch(t){}if(n)for(var r in n.l)throw new xt(55)}delete t.parent.l[t.name],t.parent.timestamp=Date.now(),t.name=e,i.l[e]=t,i.timestamp=t.parent.timestamp},yb(t,i){delete t.l[i],t.timestamp=Date.now()},tb(t,i){var e,n=Ot(t,i);for(e in n.l)throw new xt(55);delete t.l[i],t.timestamp=Date.now()},rb(t){var i,e=[".",".."];for(i of Object.keys(t.l))e.push(i);return e},Ca:(t,i,e)=>((t=pt.createNode(t,i,41471,0)).link=e,t),la(t){if(40960!=(61440&t.mode))throw new xt(28);return t.link}},m:{read(t,i,e,n,r){var s=t.node.l;if(r>=t.node.v)return 0;if(8<(t=Math.min(t.node.v-r,n))&&s.subarray)i.set(s.subarray(r,r+t),e);else for(n=0;n<t;n++)i[e+n]=s[r+n];return t},write(t,i,e,n,r,s){if(i.buffer===A.buffer&&(s=!1),!n)return 0;if((t=t.node).timestamp=Date.now(),i.subarray&&(!t.l||t.l.subarray)){if(s)return t.l=i.subarray(e,e+n),t.v=n;if(0===t.v&&0===r)return t.l=i.slice(e,e+n),t.v=n;if(r+n<=t.v)return t.l.set(i.subarray(e,e+n),r),n}if(ft(t,r+n),t.l.subarray&&i.subarray)t.l.set(i.subarray(e,e+n),r);else for(s=0;s<n;s++)t.l[r+s]=i[e+s];return t.v=Math.max(t.v,r+n),n},aa(t,i,e){if(1===e?i+=t.position:2===e&&32768==(61440&t.node.mode)&&(i+=t.node.v),0>i)throw new xt(28);return i},Xa(t,i,e){ft(t.node,i+e),t.node.v=Math.max(t.node.v,i+e)},kb(t,i,e,n,r){if(32768!=(61440&t.node.mode))throw new xt(43);if(t=t.node.l,2&r||t.buffer!==A.buffer){if((0<e||e+i<t.length)&&(t=t.subarray?t.subarray(e,e+i):Array.prototype.slice.call(t,e,e+i)),e=!0,F(),!(i=void 0))throw new xt(48);A.set(t,i)}else e=!1,i=t.byteOffset;return{o:i,uc:e}},mb:(t,i,e,n)=>(pt.m.write(t,i,0,n,e,!1),0)}},gt=null,mt={},bt=[],vt=1,wt=null,yt=!0,xt=class{constructor(t){this.name="ErrnoError",this.$=t}},kt={},At=class{constructor(){this.h={},this.node=null}get flags(){return this.h.flags}set flags(t){this.h.flags=t}get position(){return this.h.position}set position(t){this.h.position=t}},St=class{constructor(t,i,e,n){t||=this,this.parent=t,this.U=t.U,this.ua=null,this.id=vt++,this.name=i,this.mode=e,this.j={},this.m={},this.xa=n}get read(){return!(365&~this.mode)}set read(t){t?this.mode|=365:this.mode&=-366}get write(){return!(146&~this.mode)}set write(t){t?this.mode|=146:this.mode&=-147}};function jt(t,i={}){if(!(t=it(t)))return{path:"",node:null};if(8<(i=Object.assign({gb:!0,Oa:0},i)).Oa)throw new xt(32);t=t.split("/").filter((t=>!!t));for(var e=gt,n="/",r=0;r<t.length;r++){var s=r===t.length-1;if(s&&i.parent)break;if(e=Ot(e,t[r]),n=K(n+"/"+t[r]),e.ua&&(!s||s&&i.gb)&&(e=e.ua.root),!s||i.fb)for(s=0;40960==(61440&e.mode);)if(e=Ut(n),e=jt(n=it(J(n),e),{Oa:i.Oa+1}).node,40<s++)throw new xt(32)}return{path:n,node:e}}function Mt(t){for(var i;;){if(t===t.parent)return t=t.U.lb,i?"/"!==t[t.length-1]?`${t}/${i}`:t+i:t;i=i?`${t.name}/${i}`:t.name,t=t.parent}}function Et(t,i){for(var e=0,n=0;n<i.length;n++)e=(e<<5)-e+i.charCodeAt(n)|0;return(t+e>>>0)%wt.length}function Ot(t,i){var e=16384==(61440&t.mode)?(e=It(t,"x"))?e:t.j.ja?0:2:54;if(e)throw new xt(e);for(e=wt[Et(t.id,i)];e;e=e.ec)if(e.parent.id===t.id&&e.name===i)return e;return t.j.ja(t,i)}function Ct(t,i,e,n){return i=Et((t=new St(t,i,e,n)).parent.id,t.name),t.ec=wt[i],wt[i]=t}function $t(t){var i=["r","w","rw"][3&t];return 512&t&&(i+="w"),i}function It(t,i){return yt?0:!i.includes("r")||292&t.mode?i.includes("w")&&!(146&t.mode)||i.includes("x")&&!(73&t.mode)?2:0:2}function _t(t,i){try{return Ot(t,i),20}catch(t){}return It(t,"wx")}function Tt(t){if(!(t=bt[t]))throw new xt(8);return t}function Pt(t,i=-1){if(t=Object.assign(new At,t),-1==i)t:{for(i=0;4096>=i;i++)if(!bt[i])break t;throw new xt(33)}return t.W=i,bt[i]=t}var zt,Wt={open(t){t.m=mt[t.node.xa].m,t.m.open?.(t)},aa(){throw new xt(70)}};function Dt(t,i){mt[t]={m:i}}function Lt(t,i){var e="/"===i;if(e&&gt)throw new xt(10);if(!e&&i){var n=jt(i,{gb:!1});if(i=n.path,(n=n.node).ua)throw new xt(10);if(16384!=(61440&n.mode))throw new xt(54)}(t=t.U(i={type:t,Mc:{},lb:i,dc:[]})).U=i,i.root=t,e?gt=t:n&&(n.ua=i,n.U&&n.U.dc.push(i))}function Ft(t,i,e){var n=jt(t,{parent:!0}).node;if(!(t=Q(t))||"."===t||".."===t)throw new xt(28);var r=_t(n,t);if(r)throw new xt(r);if(!n.j.ta)throw new xt(63);return n.j.ta(n,t,i,e)}function Rt(t){return Ft(t,16895,0)}function Bt(t,i,e){void 0===e&&(e=i,i=438),Ft(t,8192|i,e)}function Nt(t,i){if(!it(t))throw new xt(44);var e=jt(i,{parent:!0}).node;if(!e)throw new xt(44);var n=_t(e,i=Q(i));if(n)throw new xt(n);if(!e.j.Ca)throw new xt(63);e.j.Ca(e,i,t)}function Ut(t){if(!(t=jt(t).node))throw new xt(44);if(!t.j.la)throw new xt(28);return it(Mt(t.parent),t.j.la(t))}function Ht(t,i,e){if(""===t)throw new xt(44);if("string"==typeof i){var n={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[i];if(void 0===n)throw Error(`Unknown file open mode: ${i}`);i=n}if(e=64&i?4095&(void 0===e?438:e)|32768:0,"object"==typeof t)var s=t;else{t=K(t);try{s=jt(t,{fb:!(131072&i)}).node}catch(t){}}if(n=!1,64&i)if(s){if(128&i)throw new xt(20)}else s=Ft(t,e,0),n=!0;if(!s)throw new xt(44);if(8192==(61440&s.mode)&&(i&=-513),65536&i&&16384!=(61440&s.mode))throw new xt(54);if(!n&&(e=s?40960==(61440&s.mode)?32:16384==(61440&s.mode)&&("r"!==$t(i)||512&i)?31:It(s,$t(i)):44))throw new xt(e);if(512&i&&!n){if(!(e="string"==typeof(e=s)?jt(e,{fb:!0}).node:e).j.P)throw new xt(63);if(16384==(61440&e.mode))throw new xt(31);if(32768!=(61440&e.mode))throw new xt(28);if(n=It(e,"w"))throw new xt(n);e.j.P(e,{size:0,timestamp:Date.now()})}return i&=-131713,(s=Pt({node:s,path:Mt(s),flags:i,seekable:!0,position:0,m:s.m,sc:[],error:!1})).m.open&&s.m.open(s),!r.logReadFiles||1&i||(Gt||={},t in Gt||(Gt[t]=1)),s}function qt(t,i,e){if(null===t.W)throw new xt(8);if(!t.seekable||!t.m.aa)throw new xt(70);if(0!=e&&1!=e&&2!=e)throw new xt(28);t.position=t.m.aa(t,i,e),t.sc=[]}function Xt(t,i,e){t=K("/dev/"+t);var n=((t,i)=>{var e=0;return t&&(e|=365),i&&(e|=146),e})(!!i,!!e);Vt||=64;var r=Vt++<<8;Dt(r,{open(t){t.seekable=!1},close(){e?.buffer?.length&&e(10)},read(t,e,n,r){for(var s=0,o=0;o<r;o++){try{var a=i()}catch(t){throw new xt(29)}if(void 0===a&&0===s)throw new xt(6);if(null==a)break;s++,e[n+o]=a}return s&&(t.node.timestamp=Date.now()),s},write(t,i,n,r){for(var s=0;s<r;s++)try{e(i[n+s])}catch(t){throw new xt(29)}return r&&(t.node.timestamp=Date.now()),s}}),Bt(t,n,r)}var Vt,Gt,Yt,Zt,Kt,Jt,Qt,ti=void 0,ii=(t,i)=>Object.defineProperty(i,"name",{value:t}),ei=[],ni=[],ri=t=>{if(!t)throw new Yt("Cannot use deleted val. handle = "+t);return ni[t]},si=t=>{switch(t){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:const i=ei.pop()||ni.length;return ni[i]=t,ni[i+1]=1,i}},oi=t=>{var i=Error,e=ii(t,(function(i){this.name=t,this.message=i,void 0!==(i=Error(i).stack)&&(this.stack=this.toString()+"\n"+i.replace(/^Error(:[^\n]*)?\n/,""))}));return e.prototype=Object.create(i.prototype),e.prototype.constructor=e,e.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},e},ai=t=>{for(var i="";S[t];)i+=Kt[S[t++]];return i},hi=[],ui=()=>{for(;hi.length;){var t=hi.pop();t.g.ea=!1,t.delete()}},ci={},li=(t,i)=>{if(void 0===i)throw new Yt("ptr should not be undefined");for(;t.C;)i=t.ma(i),t=t.C;return i},di={},fi=t=>{t=Me(t);var i=ai(t);return Se(t),i},pi=(t,i)=>{var e=di[t];if(void 0===e)throw t=`${i} has unknown type ${fi(t)}`,new Yt(t);return e},gi=()=>{},mi=!1,bi=(t,i,e)=>i===e?t:void 0===e.C||null===(t=bi(t,i,e.C))?null:e.Lb(t),vi={},wi=(t,i)=>{if(!i.u||!i.o)throw new Qt("makeClassHandle requires ptr and ptrType");if(!!i.J!=!!i.F)throw new Qt("Both smartPtrType and smartPtr must be specified");return i.count={value:1},yi(Object.create(t,{g:{value:i,writable:!0}}))},yi=t=>"undefined"==typeof FinalizationRegistry?(yi=t=>t,t):(mi=new FinalizationRegistry((t=>{--(t=t.g).count.value,0===t.count.value&&(t.F?t.J.O(t.F):t.u.i.O(t.o))})),gi=t=>{mi.unregister(t)},(yi=t=>{var i=t.g;return i.F&&mi.register(t,{g:i},t),t})(t)),xi={},ki=t=>{for(;t.length;){var i=t.pop();t.pop()(i)}};function Ai(t){return this.fromWireType(O[t>>2])}var Si={},ji={},Mi=(t,i,e)=>{function n(i){if((i=e(i)).length!==t.length)throw new Qt("Mismatched type converter count");for(var n=0;n<t.length;++n)Ei(t[n],i[n])}t.forEach((function(t){ji[t]=i}));var r=Array(i.length),s=[],o=0;i.forEach(((t,i)=>{di.hasOwnProperty(t)?r[i]=di[t]:(s.push(t),Si.hasOwnProperty(t)||(Si[t]=[]),Si[t].push((()=>{r[i]=di[t],++o===s.length&&n(r)})))})),0===s.length&&n(r)};function Ei(t,i,e={}){if(!("argPackAdvance"in i))throw new TypeError("registerType registeredInstance requires argPackAdvance");return function(t,i,e={}){var n=i.name;if(!t)throw new Yt(`type "${n}" must have a positive integer typeid pointer`);if(di.hasOwnProperty(t)){if(e.Vb)return;throw new Yt(`Cannot register type '${n}' twice`)}di[t]=i,delete ji[t],Si.hasOwnProperty(t)&&(i=Si[t],delete Si[t],i.forEach((t=>t())))}(t,i,e)}var Oi=t=>{throw new Yt(t.g.u.i.name+" instance already deleted")};function Ci(){}var $i=(t,i,e)=>{if(void 0===t[i].A){var n=t[i];t[i]=function(...n){if(!t[i].A.hasOwnProperty(n.length))throw new Yt(`Function '${e}' called with an invalid number of arguments (${n.length}) - expects one of (${t[i].A})!`);return t[i].A[n.length].apply(this,n)},t[i].A=[],t[i].A[n.da]=n}},Ii=(t,i,e)=>{if(r.hasOwnProperty(t)){if(void 0===e||void 0!==r[t].A&&void 0!==r[t].A[e])throw new Yt(`Cannot register public name '${t}' twice`);if($i(r,t,t),r.hasOwnProperty(e))throw new Yt(`Cannot register multiple overloads of a function with the same number of arguments (${e})!`);r[t].A[e]=i}else r[t]=i,void 0!==e&&(r[t].Lc=e)};function _i(t,i,e,n,r,s,o,a){this.name=t,this.constructor=i,this.M=e,this.O=n,this.C=r,this.Qb=s,this.ma=o,this.Lb=a,this.pb=[]}var Ti=(t,i,e)=>{for(;i!==e;){if(!i.ma)throw new Yt(`Expected null or instance of ${e.name}, got an instance of ${i.name}`);t=i.ma(t),i=i.C}return t};function Pi(t,i){if(null===i){if(this.La)throw new Yt(`null is not a valid ${this.name}`);return 0}if(!i.g)throw new Yt(`Cannot pass "${Qi(i)}" as a ${this.name}`);if(!i.g.o)throw new Yt(`Cannot pass deleted object as a pointer of type ${this.name}`);return Ti(i.g.o,i.g.u.i,this.i)}function zi(t,i){if(null===i){if(this.La)throw new Yt(`null is not a valid ${this.name}`);if(this.sa){var e=this.Na();return null!==t&&t.push(this.O,e),e}return 0}if(!i||!i.g)throw new Yt(`Cannot pass "${Qi(i)}" as a ${this.name}`);if(!i.g.o)throw new Yt(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.ra&&i.g.u.ra)throw new Yt(`Cannot convert argument of type ${i.g.J?i.g.J.name:i.g.u.name} to parameter type ${this.name}`);if(e=Ti(i.g.o,i.g.u.i,this.i),this.sa){if(void 0===i.g.F)throw new Yt("Passing raw pointer to smart pointer is illegal");switch(this.mc){case 0:if(i.g.J!==this)throw new Yt(`Cannot convert argument of type ${i.g.J?i.g.J.name:i.g.u.name} to parameter type ${this.name}`);e=i.g.F;break;case 1:e=i.g.F;break;case 2:if(i.g.J===this)e=i.g.F;else{var n=i.clone();e=this.ic(e,si((()=>n.delete()))),null!==t&&t.push(this.O,e)}break;default:throw new Yt("Unsupporting sharing policy")}}return e}function Wi(t,i){if(null===i){if(this.La)throw new Yt(`null is not a valid ${this.name}`);return 0}if(!i.g)throw new Yt(`Cannot pass "${Qi(i)}" as a ${this.name}`);if(!i.g.o)throw new Yt(`Cannot pass deleted object as a pointer of type ${this.name}`);if(i.g.u.ra)throw new Yt(`Cannot convert argument of type ${i.g.u.name} to parameter type ${this.name}`);return Ti(i.g.o,i.g.u.i,this.i)}function Di(t,i,e,n,r,s,o,a,h,u,c){this.name=t,this.i=i,this.La=e,this.ra=n,this.sa=r,this.hc=s,this.mc=o,this.qb=a,this.Na=h,this.ic=u,this.O=c,r||void 0!==i.C?this.toWireType=zi:(this.toWireType=n?Pi:Wi,this.L=null)}var Li,Fi,Ri=(t,i,e)=>{if(!r.hasOwnProperty(t))throw new Qt("Replacing nonexistent public symbol");void 0!==r[t].A&&void 0!==e?r[t].A[e]=i:(r[t]=i,r[t].da=e)},Bi=[],Ni=t=>{var i=Bi[t];return i||(t>=Bi.length&&(Bi.length=t+1),Bi[t]=i=Li.get(t)),i},Ui=(t,i)=>{var e=(t=ai(t)).includes("j")?((t,i)=>(...e)=>((t,i,e=[])=>(t.includes("j")?(t=t.replace(/p/g,"i"),i=(0,r["dynCall_"+t])(i,...e)):i=Ni(i)(...e),i))(t,i,e))(t,i):Ni(i);if("function"!=typeof e)throw new Yt(`unknown function pointer with signature ${t}: ${i}`);return e},Hi=(t,i)=>{var e=[],n={};throw i.forEach((function t(i){n[i]||di[i]||(ji[i]?ji[i].forEach(t):(e.push(i),n[i]=!0))})),new Fi(`${t}: `+e.map(fi).join([", "]))};function qi(t,i,e,n,r){var s=i.length;if(2>s)throw new Yt("argTypes array size mismatch! Must at least get return value and 'this' types!");var o=null!==i[1]&&null!==e,a=function(t){for(var i=1;i<t.length;++i)if(null!==t[i]&&void 0===t[i].L)return!0;return!1}(i),h="void"!==i[0].name,u=s-2,c=Array(u),l=[],d=[];return ii(t,(function(...e){if(e.length!==u)throw new Yt(`function ${t} called with ${e.length} arguments, expected ${u}`);if(d.length=0,l.length=o?2:1,l[0]=r,o){var s=i[1].toWireType(d,this);l[1]=s}for(var f=0;f<u;++f)c[f]=i[f+2].toWireType(d,e[f]),l.push(c[f]);if(e=n(...l),a)ki(d);else for(f=o?1:2;f<i.length;f++)null!==i[f].L&&i[f].L(1===f?s:c[f-2]);return h?i[0].fromWireType(e):void 0}))}var Xi,Vi=(t,i)=>{for(var e=[],n=0;n<t;n++)e.push(O[i+4*n>>2]);return e},Gi=t=>{const i=(t=t.trim()).indexOf("(");return-1!==i?t.substr(0,i):t},Yi=(t,i,e)=>{if(!(t instanceof Object))throw new Yt(`${e} with invalid "this": ${t}`);if(!(t instanceof i.i.constructor))throw new Yt(`${e} incompatible with "this" of type ${t.constructor.name}`);if(!t.g.o)throw new Yt(`cannot call emscripten binding method ${e} on deleted object`);return Ti(t.g.o,t.g.u.i,i.i)},Zi=t=>{9<t&&0==--ni[t+1]&&(ni[t]=void 0,ei.push(t))},Ki={name:"emscripten::val",fromWireType:t=>{var i=ri(t);return Zi(t),i},toWireType:(t,i)=>si(i),argPackAdvance:8,readValueFromPointer:Ai,L:null},Ji=(t,i,e)=>{switch(i){case 1:return e?function(t){return this.fromWireType(A[t])}:function(t){return this.fromWireType(S[t])};case 2:return e?function(t){return this.fromWireType(j[t>>1])}:function(t){return this.fromWireType(M[t>>1])};case 4:return e?function(t){return this.fromWireType(E[t>>2])}:function(t){return this.fromWireType(O[t>>2])};default:throw new TypeError(`invalid integer width (${i}): ${t}`)}},Qi=t=>{if(null===t)return"null";var i=typeof t;return"object"===i||"array"===i||"function"===i?t.toString():""+t},te=(t,i)=>{switch(i){case 4:return function(t){return this.fromWireType(C[t>>2])};case 8:return function(t){return this.fromWireType($[t>>3])};default:throw new TypeError(`invalid float width (${i}): ${t}`)}},ie=(t,i,e)=>{switch(i){case 1:return e?t=>A[t]:t=>S[t];case 2:return e?t=>j[t>>1]:t=>M[t>>1];case 4:return e?t=>E[t>>2]:t=>O[t>>2];default:throw new TypeError(`invalid integer width (${i}): ${t}`)}},ee="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,ne=(t,i)=>{for(var e=t>>1,n=e+i/2;!(e>=n)&&M[e];)++e;if(32<(e<<=1)-t&&ee)return ee.decode(S.subarray(t,e));for(e="",n=0;!(n>=i/2);++n){var r=j[t+2*n>>1];if(0==r)break;e+=String.fromCharCode(r)}return e},re=(t,i,e)=>{if(e??=2147483647,2>e)return 0;var n=i;e=(e-=2)<2*t.length?e/2:t.length;for(var r=0;r<e;++r)j[i>>1]=t.charCodeAt(r),i+=2;return j[i>>1]=0,i-n},se=t=>2*t.length,oe=(t,i)=>{for(var e=0,n="";!(e>=i/4);){var r=E[t+4*e>>2];if(0==r)break;++e,65536<=r?(r-=65536,n+=String.fromCharCode(55296|r>>10,56320|1023&r)):n+=String.fromCharCode(r)}return n},ae=(t,i,e)=>{if(e??=2147483647,4>e)return 0;var n=i;e=n+e-4;for(var r=0;r<t.length;++r){var s=t.charCodeAt(r);if(55296<=s&&57343>=s&&(s=65536+((1023&s)<<10)|1023&t.charCodeAt(++r)),E[i>>2]=s,(i+=4)+4>e)break}return E[i>>2]=0,i-n},he=t=>{for(var i=0,e=0;e<t.length;++e){var n=t.charCodeAt(e);55296<=n&&57343>=n&&++e,i+=4}return i},ue=(t,i,e)=>{var n=[];return t=t.toWireType(n,e),n.length&&(O[i>>2]=si(n)),t},ce={},le=t=>{var i=ce[t];return void 0===i?ai(t):i},de=[],fe=Reflect.construct,pe=[],ge={},me=()=>{if(!Xi){var t,i={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:b||"./this.program"};for(t in ge)void 0===ge[t]?delete i[t]:i[t]=ge[t];var e=[];for(t in i)e.push(`${t}=${i[t]}`);Xi=e}return Xi},be=t=>0==t%4&&(0!=t%100||0==t%400),ve=[31,29,31,30,31,30,31,31,30,31,30,31],we=[31,28,31,30,31,30,31,31,30,31,30,31];[44].forEach((t=>{kt[t]=new xt(t),kt[t].stack="<generic error, no stack>"})),wt=Array(4096),Lt(pt,"/"),Rt("/tmp"),Rt("/home"),Rt("/home/web_user"),function(){Rt("/dev"),Dt(259,{read:()=>0,write:(t,i,e,n)=>n}),Bt("/dev/null",259),ut(1280,lt),ut(1536,dt),Bt("/dev/tty",1280),Bt("/dev/tty1",1536);var t=new Uint8Array(1024),i=0,e=()=>(0===i&&(i=tt(t).byteLength),t[--i]);Xt("random",e),Xt("urandom",e),Rt("/dev/shm"),Rt("/dev/shm/tmp")}(),function(){Rt("/proc");var t=Rt("/proc/self");Rt("/proc/self/fd"),Lt({U(){var i=Ct(t,"fd",16895,73);return i.j={ja(t,i){var e=Tt(+i);return(t={parent:null,U:{lb:"fake"},j:{la:()=>e.path}}).parent=t}},i}},"/proc/self/fd")}(),Yt=r.BindingError=class extends Error{constructor(t){super(t),this.name="BindingError"}},ni.push(0,1,void 0,1,null,1,!0,1,!1,1),r.count_emval_handles=()=>ni.length/2-5-ei.length,Zt=r.PureVirtualError=oi("PureVirtualError");for(var ye=Array(256),xe=0;256>xe;++xe)ye[xe]=String.fromCharCode(xe);Kt=ye,r.getInheritedInstanceCount=()=>Object.keys(ci).length,r.getLiveInheritedInstances=()=>{var t,i=[];for(t in ci)ci.hasOwnProperty(t)&&i.push(ci[t]);return i},r.flushPendingDeletes=ui,r.setDelayFunction=t=>{Jt=t,hi.length&&Jt&&Jt(ui)},Qt=r.InternalError=class extends Error{constructor(t){super(t),this.name="InternalError"}},Object.assign(Ci.prototype,{isAliasOf:function(t){if(!(this instanceof Ci&&t instanceof Ci))return!1;var i=this.g.u.i,e=this.g.o;t.g=t.g;var n=t.g.u.i;for(t=t.g.o;i.C;)e=i.ma(e),i=i.C;for(;n.C;)t=n.ma(t),n=n.C;return i===n&&e===t},clone:function(){if(this.g.o||Oi(this),this.g.ha)return this.g.count.value+=1,this;var t=yi,i=Object,e=i.create,n=Object.getPrototypeOf(this),r=this.g;return(t=t(e.call(i,n,{g:{value:{count:r.count,ea:r.ea,ha:r.ha,o:r.o,u:r.u,F:r.F,J:r.J}}}))).g.count.value+=1,t.g.ea=!1,t},delete(){if(this.g.o||Oi(this),this.g.ea&&!this.g.ha)throw new Yt("Object already scheduled for deletion");gi(this);var t=this.g;--t.count.value,0===t.count.value&&(t.F?t.J.O(t.F):t.u.i.O(t.o)),this.g.ha||(this.g.F=void 0,this.g.o=void 0)},isDeleted:function(){return!this.g.o},deleteLater:function(){if(this.g.o||Oi(this),this.g.ea&&!this.g.ha)throw new Yt("Object already scheduled for deletion");return hi.push(this),1===hi.length&&Jt&&Jt(ui),this.g.ea=!0,this}}),Object.assign(Di.prototype,{Rb(t){return this.qb&&(t=this.qb(t)),t},ab(t){this.O?.(t)},argPackAdvance:8,readValueFromPointer:Ai,fromWireType:function(t){function i(){return wi(this.i.M,this.sa?{u:this.hc,o:e,J:this,F:t}:{u:this,o:t})}var e=this.Rb(t);if(!e)return this.ab(t),null;var n=((t,i)=>(i=li(this.i,i),ci[i]))(0,e);if(void 0!==n)return 0===n.g.count.value?(n.g.o=e,n.g.F=t,n.clone()):(n=n.clone(),this.ab(t),n);if(n=this.i.Qb(e),!(n=vi[n]))return i.call(this);var r=bi(e,this.i,(n=this.ra?n.Hb:n.pointerType).i);return null===r?i.call(this):wi(n.i.M,this.sa?{u:n,o:r,J:this,F:t}:{u:n,o:r})}}),Fi=r.UnboundTypeError=oi("UnboundTypeError");var ke={__syscall_fcntl64:function(t,i,e){ti=e;try{var n=Tt(t);switch(i){case 0:var r=Y();if(0>r)break;for(;bt[r];)r++;return function(t,i=-1){return t=Pt(t,i),t.m?.Ec?.(t),t}(n,r).W;case 1:case 2:case 13:case 14:return 0;case 3:return n.flags;case 4:return r=Y(),n.flags|=r,0;case 12:return r=Y(),j[r+0>>1]=2,0}return-28}catch(t){if("ErrnoError"!==t.name)throw t;return-t.$}},__syscall_ioctl:function(t,i,e){ti=e;try{var n=Tt(t);switch(i){case 21509:case 21510:case 21511:case 21512:case 21524:case 21515:return n.s?0:-59;case 21505:if(!n.s)return-59;if(n.s.V.Xb){t=[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];var r=Y();E[r>>2]=25856,E[r+4>>2]=5,E[r+8>>2]=191,E[r+12>>2]=35387;for(var s=0;32>s;s++)A[r+s+17]=t[s]||0}return 0;case 21506:case 21507:case 21508:if(!n.s)return-59;if(n.s.V.Yb)for(r=Y(),t=[],s=0;32>s;s++)t.push(A[r+s+17]);return 0;case 21519:return n.s?(r=Y(),E[r>>2]=0):-59;case 21520:return n.s?-28:-59;case 21531:if(r=Y(),!n.m.Wb)throw new xt(59);return n.m.Wb(n,i,r);case 21523:return n.s?(n.s.V.Zb&&(s=[24,80],r=Y(),j[r>>1]=s[0],j[r+2>>1]=s[1]),0):-59;default:return-28}}catch(t){if("ErrnoError"!==t.name)throw t;return-t.$}},__syscall_openat:function(t,i,e,n){ti=n;try{var r=i=i?nt(S,i):"";if("/"===r.charAt(0))i=r;else{var s=-100===t?"/":Tt(t).path;if(0==r.length)throw new xt(44);i=K(s+"/"+r)}return Ht(i,e,n?Y():0).W}catch(t){if("ErrnoError"!==t.name)throw t;return-t.$}},_abort_js:()=>{F("")},_embind_create_inheriting_constructor:(t,i,e)=>{t=ai(t),i=pi(i,"wrapper"),e=ri(e);var n=i.i,r=n.M,s=n.C.M,o=n.C.constructor;return t=ii(t,(function(...t){n.C.pb.forEach(function(t){if(this[t]===s[t])throw new Zt(`Pure virtual function ${t} must be implemented in JavaScript`)}.bind(this)),Object.defineProperty(this,"__parent",{value:r}),this.__construct(...t)})),r.__construct=function(...t){if(this===r)throw new Yt("Pass correct 'this' to __construct");t=o.implement(this,...t),gi(t);var i=t.g;if(t.notifyOnDestruction(),i.ha=!0,Object.defineProperties(this,{g:{value:i}}),yi(this),t=li(n,t=i.o),ci.hasOwnProperty(t))throw new Yt(`Tried to register registered instance: ${t}`);ci[t]=this},r.__destruct=function(){if(this===r)throw new Yt("Pass correct 'this' to __destruct");gi(this);var t=this.g.o;if(t=li(n,t),!ci.hasOwnProperty(t))throw new Yt(`Tried to unregister unregistered instance: ${t}`);delete ci[t]},t.prototype=Object.create(r),Object.assign(t.prototype,e),si(t)},_embind_finalize_value_object:t=>{var i=xi[t];delete xi[t];var e=i.Na,n=i.O,r=i.eb,s=r.map((t=>t.Ub)).concat(r.map((t=>t.kc)));Mi([t],s,(t=>{var s={};return r.forEach(((i,e)=>{var n=t[e],o=i.Sb,a=i.Tb,h=t[e+r.length],u=i.jc,c=i.lc;s[i.Ob]={read:t=>n.fromWireType(o(a,t)),write:(t,i)=>{var e=[];u(c,t,h.toWireType(e,i)),ki(e)}}})),[{name:i.name,fromWireType:t=>{var i,e={};for(i in s)e[i]=s[i].read(t);return n(t),e},toWireType:(t,i)=>{for(var r in s)if(!(r in i))throw new TypeError(`Missing field: "${r}"`);var o=e();for(r in s)s[r].write(o,i[r]);return null!==t&&t.push(n,o),o},argPackAdvance:8,readValueFromPointer:Ai,L:n}]}))},_embind_register_bigint:()=>{},_embind_register_bool:(t,i,e,n)=>{Ei(t,{name:i=ai(i),fromWireType:function(t){return!!t},toWireType:function(t,i){return i?e:n},argPackAdvance:8,readValueFromPointer:function(t){return this.fromWireType(S[t])},L:null})},_embind_register_class:(t,i,e,n,r,s,o,a,h,u,c,l,d)=>{c=ai(c),s=Ui(r,s),a&&=Ui(o,a),u&&=Ui(h,u),d=Ui(l,d);var f=(t=>{if(void 0===t)return"_unknown";var i=(t=t.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return 48<=i&&57>=i?`_${t}`:t})(c);Ii(f,(function(){Hi(`Cannot construct ${c} due to unbound types`,[n])})),Mi([t,i,e],n?[n]:[],(i=>{if(i=i[0],n)var e=i.i,r=e.M;else r=Ci.prototype;i=ii(c,(function(...t){if(Object.getPrototypeOf(this)!==o)throw new Yt("Use 'new' to construct "+c);if(void 0===l.Z)throw new Yt(c+" has no accessible constructor");var i=l.Z[t.length];if(void 0===i)throw new Yt(`Tried to invoke ctor of ${c} with invalid number of parameters (${t.length}) - expected (${Object.keys(l.Z).toString()}) parameters instead!`);return i.apply(this,t)}));var o=Object.create(r,{constructor:{value:i}});i.prototype=o;var h,l=new _i(c,i,o,d,e,s,a,u);return l.C&&((h=l.C).na??(h.na=[]),l.C.na.push(l)),e=new Di(c,l,!0,!1,!1),h=new Di(c+"*",l,!1,!1,!1),r=new Di(c+" const*",l,!1,!0,!1),vi[t]={pointerType:h,Hb:r},Ri(f,i),[e,h,r]}))},_embind_register_class_class_function:(t,i,e,n,r,s,o)=>{var a=Vi(e,n);i=ai(i),i=Gi(i),s=Ui(r,s),Mi([],[t],(t=>{function n(){Hi(`Cannot call ${r} due to unbound types`,a)}var r=`${(t=t[0]).name}.${i}`;i.startsWith("@@")&&(i=Symbol[i.substring(2)]);var h=t.i.constructor;return void 0===h[i]?(n.da=e-1,h[i]=n):($i(h,i,r),h[i].A[e-1]=n),Mi([],a,(n=>{if(n=qi(r,[n[0],null].concat(n.slice(1)),null,s,o),void 0===h[i].A?(n.da=e-1,h[i]=n):h[i].A[e-1]=n,t.i.na)for(const e of t.i.na)e.constructor.hasOwnProperty(i)||(e.constructor[i]=n);return[]})),[]}))},_embind_register_class_class_property:(t,i,e,n,r,s,o,a)=>{i=ai(i),s=Ui(r,s),Mi([],[t],(t=>{var r=`${(t=t[0]).name}.${i}`,h={get(){Hi(`Cannot access ${r} due to unbound types`,[e])},enumerable:!0,configurable:!0};return h.set=a?()=>{Hi(`Cannot access ${r} due to unbound types`,[e])}:()=>{throw new Yt(`${r} is a read-only property`)},Object.defineProperty(t.i.constructor,i,h),Mi([],[e],(e=>{e=e[0];var r={get:()=>e.fromWireType(s(n)),enumerable:!0};return a&&(a=Ui(o,a),r.set=t=>{var i=[];a(n,e.toWireType(i,t)),ki(i)}),Object.defineProperty(t.i.constructor,i,r),[]})),[]}))},_embind_register_class_constructor:(t,i,e,n,r,s)=>{var o=Vi(i,e);r=Ui(n,r),Mi([],[t],(t=>{var e=`constructor ${(t=t[0]).name}`;if(void 0===t.i.Z&&(t.i.Z=[]),void 0!==t.i.Z[i-1])throw new Yt(`Cannot register multiple constructors with identical number of parameters (${i-1}) for class '${t.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return t.i.Z[i-1]=()=>{Hi(`Cannot construct ${t.name} due to unbound types`,o)},Mi([],o,(n=>(n.splice(1,0,null),t.i.Z[i-1]=qi(e,n,null,r,s),[]))),[]}))},_embind_register_class_function:(t,i,e,n,r,s,o,a)=>{var h=Vi(e,n);i=ai(i),i=Gi(i),s=Ui(r,s),Mi([],[t],(t=>{function n(){Hi(`Cannot call ${r} due to unbound types`,h)}var r=`${(t=t[0]).name}.${i}`;i.startsWith("@@")&&(i=Symbol[i.substring(2)]),a&&t.i.pb.push(i);var u=t.i.M,c=u[i];return void 0===c||void 0===c.A&&c.className!==t.name&&c.da===e-2?(n.da=e-2,n.className=t.name,u[i]=n):($i(u,i,r),u[i].A[e-2]=n),Mi([],h,(n=>(n=qi(r,n,t,s,o),void 0===u[i].A?(n.da=e-2,u[i]=n):u[i].A[e-2]=n,[]))),[]}))},_embind_register_class_property:(t,i,e,n,r,s,o,a,h,u)=>{i=ai(i),r=Ui(n,r),Mi([],[t],(t=>{var n=`${(t=t[0]).name}.${i}`,c={get(){Hi(`Cannot access ${n} due to unbound types`,[e,o])},enumerable:!0,configurable:!0};return c.set=h?()=>Hi(`Cannot access ${n} due to unbound types`,[e,o]):()=>{throw new Yt(n+" is a read-only property")},Object.defineProperty(t.i.M,i,c),Mi([],h?[e,o]:[e],(e=>{var o=e[0],c={get(){var i=Yi(this,t,n+" getter");return o.fromWireType(r(s,i))},enumerable:!0};if(h){h=Ui(a,h);var l=e[1];c.set=function(i){var e=Yi(this,t,n+" setter"),r=[];h(u,e,l.toWireType(r,i)),ki(r)}}return Object.defineProperty(t.i.M,i,c),[]})),[]}))},_embind_register_emval:t=>Ei(t,Ki),_embind_register_enum:(t,i,e,n)=>{function r(){}i=ai(i),r.values={},Ei(t,{name:i,constructor:r,fromWireType:function(t){return this.constructor.values[t]},toWireType:(t,i)=>i.value,argPackAdvance:8,readValueFromPointer:Ji(i,e,n),L:null}),Ii(i,r)},_embind_register_enum_value:(t,i,e)=>{var n=pi(t,"enum");i=ai(i),t=n.constructor,n=Object.create(n.constructor.prototype,{value:{value:e},constructor:{value:ii(`${n.name}_${i}`,(function(){}))}}),t.values[e]=n,t[i]=n},_embind_register_float:(t,i,e)=>{Ei(t,{name:i=ai(i),fromWireType:t=>t,toWireType:(t,i)=>i,argPackAdvance:8,readValueFromPointer:te(i,e),L:null})},_embind_register_function:(t,i,e,n,r,s)=>{var o=Vi(i,e);t=ai(t),t=Gi(t),r=Ui(n,r),Ii(t,(function(){Hi(`Cannot call ${t} due to unbound types`,o)}),i-1),Mi([],o,(e=>(Ri(t,qi(t,[e[0],null].concat(e.slice(1)),null,r,s),i-1),[])))},_embind_register_integer:(t,i,e,n,r)=>{if(i=ai(i),-1===r&&(r=4294967295),r=t=>t,0===n){var s=32-8*e;r=t=>t<<s>>>s}var o=i.includes("unsigned")?function(t,i){return i>>>0}:function(t,i){return i};Ei(t,{name:i,fromWireType:r,toWireType:o,argPackAdvance:8,readValueFromPointer:ie(i,e,0!==n),L:null})},_embind_register_memory_view:(t,i,e)=>{function n(t){return new r(A.buffer,O[t+4>>2],O[t>>2])}var r=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][i];Ei(t,{name:e=ai(e),fromWireType:n,argPackAdvance:8,readValueFromPointer:n},{Vb:!0})},_embind_register_std_string:(t,i)=>{var e="std::string"===(i=ai(i));Ei(t,{name:i,fromWireType:function(t){var i=O[t>>2],n=t+4;if(e)for(var r=n,s=0;s<=i;++s){var o=n+s;if(s==i||0==S[o]){if(r=r?nt(S,r,o-r):"",void 0===a)var a=r;else a+=String.fromCharCode(0),a+=r;r=o+1}}else{for(a=Array(i),s=0;s<i;++s)a[s]=String.fromCharCode(S[n+s]);a=a.join("")}return Se(t),a},toWireType:function(t,i){i instanceof ArrayBuffer&&(i=new Uint8Array(i));var n="string"==typeof i;if(!(n||i instanceof Uint8Array||i instanceof Uint8ClampedArray||i instanceof Int8Array))throw new Yt("Cannot pass non-string to std::string");var r=e&&n?st(i):i.length,s=je(4+r+1),o=s+4;if(O[s>>2]=r,e&&n)ot(i,S,o,r+1);else if(n)for(n=0;n<r;++n){var a=i.charCodeAt(n);if(255<a)throw Se(o),new Yt("String has UTF-16 code units that do not fit in 8 bits");S[o+n]=a}else for(n=0;n<r;++n)S[o+n]=i[n];return null!==t&&t.push(Se,s),s},argPackAdvance:8,readValueFromPointer:Ai,L(t){Se(t)}})},_embind_register_std_wstring:(t,i,e)=>{if(e=ai(e),2===i)var n=ne,r=re,s=se,o=t=>M[t>>1];else 4===i&&(n=oe,r=ae,s=he,o=t=>O[t>>2]);Ei(t,{name:e,fromWireType:t=>{for(var e,r=O[t>>2],s=t+4,a=0;a<=r;++a){var h=t+4+a*i;a!=r&&0!=o(h)||(s=n(s,h-s),void 0===e?e=s:(e+=String.fromCharCode(0),e+=s),s=h+i)}return Se(t),e},toWireType:(t,n)=>{if("string"!=typeof n)throw new Yt(`Cannot pass non-string to C++ string type ${e}`);var o=s(n),a=je(4+o+i);return O[a>>2]=o/i,r(n,a+4,o+i),null!==t&&t.push(Se,a),a},argPackAdvance:8,readValueFromPointer:Ai,L(t){Se(t)}})},_embind_register_value_object:(t,i,e,n,r,s)=>{xi[t]={name:ai(i),Na:Ui(e,n),O:Ui(r,s),eb:[]}},_embind_register_value_object_field:(t,i,e,n,r,s,o,a,h,u)=>{xi[t].eb.push({Ob:ai(i),Ub:e,Sb:Ui(n,r),Tb:s,kc:o,jc:Ui(a,h),lc:u})},_embind_register_void:(t,i)=>{Ei(t,{Ic:!0,name:i=ai(i),argPackAdvance:0,fromWireType:()=>{},toWireType:()=>{}})},_emscripten_get_now_is_monotonic:()=>1,_emscripten_memcpy_js:(t,i,e)=>S.copyWithin(t,i,i+e),_emval_as:(t,i,e)=>(t=ri(t),i=pi(i,"emval::as"),ue(i,e,t)),_emval_call_method:(t,i,e,n,r)=>(t=de[t])(i=ri(i),i[e=le(e)],n,r),_emval_decref:Zi,_emval_get_method_caller:(t,i,e)=>{var n=((t,i)=>{for(var e=Array(t),n=0;n<t;++n)e[n]=pi(O[i+4*n>>2],"parameter "+n);return e})(t,i),r=n.shift();t--;var s=Array(t);return i=`methodCaller<(${n.map((t=>t.name)).join(", ")}) => ${r.name}>`,(t=>{var i=de.length;return de.push(t),i})(ii(i,((i,o,a,h)=>{for(var u=0,c=0;c<t;++c)s[c]=n[c].readValueFromPointer(h+u),u+=n[c].argPackAdvance;return i=1===e?fe(o,s):o.apply(i,s),ue(r,a,i)})))},_emval_get_module_property:t=>(t=le(t),si(r[t])),_emval_get_property:(t,i)=>(t=ri(t),i=ri(i),si(t[i])),_emval_incref:t=>{9<t&&(ni[t+1]+=1)},_emval_new_array:()=>si([]),_emval_new_cstring:t=>si(le(t)),_emval_new_object:()=>si({}),_emval_run_destructors:t=>{var i=ri(t);ki(i),Zi(t)},_emval_set_property:(t,i,e)=>{t=ri(t),i=ri(i),e=ri(e),t[i]=e},_emval_take_value:(t,i)=>(t=(t=pi(t,"_emval_take_value")).readValueFromPointer(i),si(t)),emscripten_asm_const_int:(t,i,e)=>{pe.length=0;for(var n;n=S[i++];){var r=105!=n;e+=(r&=112!=n)&&e%8?4:0,pe.push(112==n?O[e>>2]:105==n?E[e>>2]:$[e>>3]),e+=r?8:4}return V[t](...pe)},emscripten_date_now:()=>Date.now(),emscripten_get_now:()=>performance.now(),emscripten_resize_heap:t=>{var i=S.length;if(2147483648<(t>>>=0))return!1;for(var e=1;4>=e;e*=2){var n=i*(1+.2/e);n=Math.min(n,t+100663296);var r=Math;n=Math.max(t,n);t:{r=(r.min.call(r,2147483648,n+(65536-n%65536)%65536)-k.buffer.byteLength+65535)/65536;try{k.grow(r),_();var s=1;break t}catch(t){}s=void 0}if(s)return!0}return!1},environ_get:(t,i)=>{var e=0;return me().forEach(((n,r)=>{var s=i+e;for(r=O[t+4*r>>2]=s,s=0;s<n.length;++s)A[r++]=n.charCodeAt(s);A[r]=0,e+=n.length+1})),0},environ_sizes_get:(t,i)=>{var e=me();O[t>>2]=e.length;var n=0;return e.forEach((t=>n+=t.length+1)),O[i>>2]=n,0},fd_close:function(t){try{var i=Tt(t);if(null===i.W)throw new xt(8);i.Ka&&(i.Ka=null);try{i.m.close&&i.m.close(i)}catch(t){throw t}finally{bt[i.W]=null}return i.W=null,0}catch(t){if("ErrnoError"!==t.name)throw t;return t.$}},fd_read:function(t,i,e,n){try{t:{var r=Tt(t);t=i;for(var s,o=i=0;o<e;o++){var a=O[t>>2],h=O[t+4>>2];t+=8;var u=r,c=s,l=A;if(0>h||0>c)throw new xt(28);if(null===u.W)throw new xt(8);if(1==(2097155&u.flags))throw new xt(8);if(16384==(61440&u.node.mode))throw new xt(31);if(!u.m.read)throw new xt(28);var d=void 0!==c;if(d){if(!u.seekable)throw new xt(70)}else c=u.position;var f=u.m.read(u,l,a,h,c);d||(u.position+=f);var p=f;if(0>p){var g=-1;break t}if(i+=p,p<h)break;void 0!==s&&(s+=p)}g=i}return O[n>>2]=g,0}catch(t){if("ErrnoError"!==t.name)throw t;return t.$}},fd_seek:function(t,i,e,n,r){i=e+2097152>>>0<4194305-!!i?(i>>>0)+4294967296*e:NaN;try{if(isNaN(i))return 61;var s=Tt(t);return qt(s,i,n),X=[s.position>>>0,(q=s.position,1<=+Math.abs(q)?0<q?+Math.floor(q/4294967296)>>>0:~~+Math.ceil((q-+(~~q>>>0))/4294967296)>>>0:0)],E[r>>2]=X[0],E[r+4>>2]=X[1],s.Ka&&0===i&&0===n&&(s.Ka=null),0}catch(t){if("ErrnoError"!==t.name)throw t;return t.$}},fd_write:function(t,i,e,n){try{t:{var r=Tt(t);t=i;for(var s,o=i=0;o<e;o++){var a=O[t>>2],h=O[t+4>>2];t+=8;var u=r,c=a,l=h,d=s,f=A;if(0>l||0>d)throw new xt(28);if(null===u.W)throw new xt(8);if(!(2097155&u.flags))throw new xt(8);if(16384==(61440&u.node.mode))throw new xt(31);if(!u.m.write)throw new xt(28);u.seekable&&1024&u.flags&&qt(u,0,2);var p=void 0!==d;if(p){if(!u.seekable)throw new xt(70)}else d=u.position;var g=u.m.write(u,f,c,l,d,void 0);p||(u.position+=g);var m=g;if(0>m){var b=-1;break t}i+=m,void 0!==s&&(s+=m)}b=i}return O[n>>2]=b,0}catch(t){if("ErrnoError"!==t.name)throw t;return t.$}},strftime_l:(t,i,e,n)=>((t,i,e,n)=>{function r(t,i,e){for(t="number"==typeof t?t.toString():t||"";t.length<i;)t=e[0]+t;return t}function s(t,i){return r(t,i,"0")}function o(t,i){function e(t){return 0>t?-1:0<t?1:0}var n;return 0===(n=e(t.getFullYear()-i.getFullYear()))&&0===(n=e(t.getMonth()-i.getMonth()))&&(n=e(t.getDate()-i.getDate())),n}function a(t){switch(t.getDay()){case 0:return new Date(t.getFullYear()-1,11,29);case 1:return t;case 2:return new Date(t.getFullYear(),0,3);case 3:return new Date(t.getFullYear(),0,2);case 4:return new Date(t.getFullYear(),0,1);case 5:return new Date(t.getFullYear()-1,11,31);case 6:return new Date(t.getFullYear()-1,11,30)}}function h(t){var i=t.ba;for(t=new Date(new Date(t.ca+1900,0,1).getTime());0<i;){var e=t.getMonth(),n=(be(t.getFullYear())?ve:we)[e];if(!(i>n-t.getDate())){t.setDate(t.getDate()+i);break}i-=n-t.getDate()+1,t.setDate(1),11>e?t.setMonth(e+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return e=new Date(t.getFullYear()+1,0,4),i=a(new Date(t.getFullYear(),0,4)),e=a(e),0>=o(i,t)?0>=o(e,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var u=O[n+40>>2];for(var c in n={pc:E[n>>2],oc:E[n+4>>2],Da:E[n+8>>2],Qa:E[n+12>>2],Ea:E[n+16>>2],ca:E[n+20>>2],R:E[n+24>>2],ba:E[n+28>>2],Nc:E[n+32>>2],nc:E[n+36>>2],qc:u&&u?nt(S,u):""},e=e?nt(S,e):"",u={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})e=e.replace(new RegExp(c,"g"),u[c]);var l="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),d="January February March April May June July August September October November December".split(" ");for(c in u={"%a":t=>l[t.R].substring(0,3),"%A":t=>l[t.R],"%b":t=>d[t.Ea].substring(0,3),"%B":t=>d[t.Ea],"%C":t=>s((t.ca+1900)/100|0,2),"%d":t=>s(t.Qa,2),"%e":t=>r(t.Qa,2," "),"%g":t=>h(t).toString().substring(2),"%G":h,"%H":t=>s(t.Da,2),"%I":t=>(0==(t=t.Da)?t=12:12<t&&(t-=12),s(t,2)),"%j":t=>{for(var i=0,e=0;e<=t.Ea-1;i+=(be(t.ca+1900)?ve:we)[e++]);return s(t.Qa+i,3)},"%m":t=>s(t.Ea+1,2),"%M":t=>s(t.oc,2),"%n":()=>"\n","%p":t=>0<=t.Da&&12>t.Da?"AM":"PM","%S":t=>s(t.pc,2),"%t":()=>"\t","%u":t=>t.R||7,"%U":t=>s(Math.floor((t.ba+7-t.R)/7),2),"%V":t=>{var i=Math.floor((t.ba+7-(t.R+6)%7)/7);if(2>=(t.R+371-t.ba-2)%7&&i++,i)53==i&&(4==(e=(t.R+371-t.ba)%7)||3==e&&be(t.ca)||(i=1));else{i=52;var e=(t.R+7-t.ba-1)%7;(4==e||5==e&&be(t.ca%400-1))&&i++}return s(i,2)},"%w":t=>t.R,"%W":t=>s(Math.floor((t.ba+7-(t.R+6)%7)/7),2),"%y":t=>(t.ca+1900).toString().substring(2),"%Y":t=>t.ca+1900,"%z":t=>{var i=0<=(t=t.nc);return t=Math.abs(t)/60,(i?"+":"-")+String("0000"+(t/60*100+t%60)).slice(-4)},"%Z":t=>t.qc,"%%":()=>"%"},e=e.replace(/%%/g,"\0\0"),u)e.includes(c)&&(e=e.replace(new RegExp(c,"g"),u[c](n)));return(c=at(e=e.replace(/\0\0/g,"%"),!1)).length>i?0:(A.set(c,t),c.length-1)})(t,i,e,n)},Ae=function(){function t(t){return k=(Ae=t.exports).memory,_(),Li=Ae.__indirect_function_table,P.unshift(Ae.__wasm_call_ctors),D--,r.monitorRunDependencies?.(D),0==D&&L&&(t=L,L=null,t()),Ae}var i={env:ke,wasi_snapshot_preview1:ke};if(D++,r.monitorRunDependencies?.(D),r.instantiateWasm)try{return r.instantiateWasm(i,t)}catch(t){x(`Module.instantiateWasm callback failed with error: ${t}`),e(t)}return R||=B("canvas_advanced.wasm")?"canvas_advanced.wasm":r.locateFile?r.locateFile("canvas_advanced.wasm",v):v+"canvas_advanced.wasm",function(t,i){var e=R;return w||"function"!=typeof WebAssembly.instantiateStreaming||B(e)||N(e)||"function"!=typeof fetch?H(e,t,i):fetch(e,{credentials:"same-origin"}).then((n=>WebAssembly.instantiateStreaming(n,t).then(i,(function(n){return x(`wasm streaming compile failed: ${n}`),x("falling back to ArrayBuffer instantiation"),H(e,t,i)}))))}(i,(function(i){t(i.instance)})).catch(e),{}}(),Se=t=>(Se=Ae.free)(t),je=t=>(je=Ae.malloc)(t),Me=t=>(Me=Ae.__getTypeName)(t),Ee=r._ma_device__on_notification_unlocked=t=>(Ee=r._ma_device__on_notification_unlocked=Ae.ma_device__on_notification_unlocked)(t);r._ma_malloc_emscripten=(t,i)=>(r._ma_malloc_emscripten=Ae.ma_malloc_emscripten)(t,i),r._ma_free_emscripten=(t,i)=>(r._ma_free_emscripten=Ae.ma_free_emscripten)(t,i);var Oe,Ce=r._ma_device_process_pcm_frames_capture__webaudio=(t,i,e)=>(Ce=r._ma_device_process_pcm_frames_capture__webaudio=Ae.ma_device_process_pcm_frames_capture__webaudio)(t,i,e),$e=r._ma_device_process_pcm_frames_playback__webaudio=(t,i,e)=>($e=r._ma_device_process_pcm_frames_playback__webaudio=Ae.ma_device_process_pcm_frames_playback__webaudio)(t,i,e);function Ie(){function t(){if(!Oe&&(Oe=!0,r.calledRun=!0,!I)){if(r.noFSInit||zt||(zt=!0,r.stdin=r.stdin,r.stdout=r.stdout,r.stderr=r.stderr,r.stdin?Xt("stdin",r.stdin):Nt("/dev/tty","/dev/stdin"),r.stdout?Xt("stdout",null,r.stdout):Nt("/dev/tty","/dev/stdout"),r.stderr?Xt("stderr",null,r.stderr):Nt("/dev/tty1","/dev/stderr"),Ht("/dev/stdin",0),Ht("/dev/stdout",1),Ht("/dev/stderr",1)),yt=!1,G(P),i(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),r.postRun)for("function"==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;){var t=r.postRun.shift();z.unshift(t)}G(z)}}if(!(0<D)){if(r.preRun)for("function"==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;)W();G(T),0<D||(r.setStatus?(r.setStatus("Running..."),setTimeout((function(){setTimeout((function(){r.setStatus("")}),1),t()}),1)):t())}}if(r.dynCall_iiji=(t,i,e,n,s)=>(r.dynCall_iiji=Ae.dynCall_iiji)(t,i,e,n,s),r.dynCall_jiji=(t,i,e,n,s)=>(r.dynCall_jiji=Ae.dynCall_jiji)(t,i,e,n,s),r.dynCall_iiiji=(t,i,e,n,s,o)=>(r.dynCall_iiiji=Ae.dynCall_iiiji)(t,i,e,n,s,o),r.dynCall_iij=(t,i,e,n)=>(r.dynCall_iij=Ae.dynCall_iij)(t,i,e,n),r.dynCall_jii=(t,i,e)=>(r.dynCall_jii=Ae.dynCall_jii)(t,i,e),r.dynCall_viijii=(t,i,e,n,s,o,a)=>(r.dynCall_viijii=Ae.dynCall_viijii)(t,i,e,n,s,o,a),r.dynCall_iiiiij=(t,i,e,n,s,o,a)=>(r.dynCall_iiiiij=Ae.dynCall_iiiiij)(t,i,e,n,s,o,a),r.dynCall_iiiiijj=(t,i,e,n,s,o,a,h,u)=>(r.dynCall_iiiiijj=Ae.dynCall_iiiiijj)(t,i,e,n,s,o,a,h,u),r.dynCall_iiiiiijj=(t,i,e,n,s,o,a,h,u,c)=>(r.dynCall_iiiiiijj=Ae.dynCall_iiiiiijj)(t,i,e,n,s,o,a,h,u,c),L=function t(){Oe||Ie(),Oe||(L=t)},r.preInit)for("function"==typeof r.preInit&&(r.preInit=[r.preInit]);0<r.preInit.length;)r.preInit.pop()();return Ie(),s})},t=>{t.exports=JSON.parse('{"name":"@rive-app/canvas","version":"2.32.0","description":"Rive\'s canvas based web api.","main":"rive.js","homepage":"https://rive.app","repository":{"type":"git","url":"https://github.com/rive-app/rive-wasm/tree/master/js"},"keywords":["rive","animation"],"author":"Rive","contributors":["Luigi Rosso <luigi@rive.app> (https://rive.app)","Maxwell Talbot <max@rive.app> (https://rive.app)","Arthur Vivian <arthur@rive.app> (https://rive.app)","Umberto Sonnino <umberto@rive.app> (https://rive.app)","Matthew Sullivan <matt.j.sullivan@gmail.com> (mailto:matt.j.sullivan@gmail.com)"],"license":"MIT","files":["rive.js","rive.js.map","rive.wasm","rive_fallback.wasm","rive.d.ts","rive_advanced.mjs.d.ts"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}')},(t,i,e)=>{e.r(i),e.d(i,{Animation:()=>n.Animation});var n=e(4)},(t,i,e)=>{e.r(i),e.d(i,{Animation:()=>n});var n=function(){function t(t,i,e,n){this.animation=t,this.artboard=i,this.playing=n,this.loopCount=0,this.scrubTo=null,this.instance=new e.LinearAnimationInstance(t,i)}return Object.defineProperty(t.prototype,"name",{get:function(){return this.animation.name},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time",{get:function(){return this.instance.time},set:function(t){this.instance.time=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"loopValue",{get:function(){return this.animation.loopValue},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"needsScrub",{get:function(){return null!==this.scrubTo},enumerable:!1,configurable:!0}),t.prototype.advance=function(t){null===this.scrubTo?this.instance.advance(t):(this.instance.time=0,this.instance.advance(this.scrubTo),this.scrubTo=null)},t.prototype.apply=function(t){this.instance.apply(t)},t.prototype.cleanup=function(){this.instance.delete()},t}()},(t,i,e)=>{e.r(i),e.d(i,{AudioAssetWrapper:()=>s.AudioAssetWrapper,AudioWrapper:()=>s.AudioWrapper,BLANK_URL:()=>r.BLANK_URL,CustomFileAssetLoaderWrapper:()=>s.CustomFileAssetLoaderWrapper,FileAssetWrapper:()=>s.FileAssetWrapper,FileFinalizer:()=>s.FileFinalizer,FontAssetWrapper:()=>s.FontAssetWrapper,FontWrapper:()=>s.FontWrapper,ImageAssetWrapper:()=>s.ImageAssetWrapper,ImageWrapper:()=>s.ImageWrapper,createFinalization:()=>s.createFinalization,finalizationRegistry:()=>s.finalizationRegistry,registerTouchInteractions:()=>n.registerTouchInteractions,sanitizeUrl:()=>r.sanitizeUrl});var n=e(6),r=e(7),s=e(8)},(t,i,e)=>{e.r(i),e.d(i,{registerTouchInteractions:()=>n});var n=function(t){var i=t.canvas,e=t.artboard,n=t.stateMachines,r=void 0===n?[]:n,s=t.rive,o=t.fit,a=t.alignment,h=t.isTouchScrollEnabled,u=void 0!==h&&h,c=t.dispatchPointerExit,l=void 0===c||c,d=t.enableMultiTouch,f=void 0!==d&&d,p=t.layoutScaleFactor,g=void 0===p?1:p;if(!(i&&r.length&&t.renderer&&s&&e&&"undefined"!=typeof window))return null;var m=null,b=!1,v=function(t){if(b&&t instanceof MouseEvent)"mouseup"==t.type&&(b=!1);else{b=u&&"touchend"===t.type&&"touchstart"===m,m=t.type;var i=t.currentTarget.getBoundingClientRect(),n=function(t,i,e){var n,r,s=[];if(["touchstart","touchmove"].indexOf(t.type)>-1&&(null===(n=t.changedTouches)||void 0===n?void 0:n.length)){i||t.preventDefault();for(var o=0,a=e?t.changedTouches.length:1;o<a;)s.push({clientX:(h=t.changedTouches[o]).clientX,clientY:h.clientY,identifier:h.identifier}),o++}else if("touchend"===t.type&&(null===(r=t.changedTouches)||void 0===r?void 0:r.length))for(o=0,a=e?t.changedTouches.length:1;o<a;){var h;s.push({clientX:(h=t.changedTouches[o]).clientX,clientY:h.clientY,identifier:h.identifier}),o++}else s.push({clientX:t.clientX,clientY:t.clientY,identifier:0});return s}(t,u,f),h=s.computeAlignment(o,a,{minX:0,minY:0,maxX:i.width,maxY:i.height},e.bounds,g),c=new s.Mat2D;switch(h.invert(c),n.forEach((function(t){var e=t.clientX,n=t.clientY;if(e||n){var r=new s.Vec2D(e-i.left,n-i.top),o=s.mapXY(c,r),a=o.x(),h=o.y();t.transformedX=a,t.transformedY=h,o.delete(),r.delete()}})),c.delete(),h.delete(),t.type){case"mouseout":for(var d=function(t){n.forEach(l?function(i){t.pointerExit(i.transformedX,i.transformedY,i.identifier)}:function(i){t.pointerMove(i.transformedX,i.transformedY,i.identifier)})},p=0,v=r;p<v.length;p++)d(v[p]);break;case"touchmove":case"mouseover":case"mousemove":for(var w=function(t){n.forEach((function(i){t.pointerMove(i.transformedX,i.transformedY,i.identifier)}))},y=0,x=r;y<x.length;y++)w(x[y]);break;case"touchstart":case"mousedown":for(var k=function(t){n.forEach((function(i){t.pointerDown(i.transformedX,i.transformedY,i.identifier)}))},A=0,S=r;A<S.length;A++)k(S[A]);break;case"touchend":for(var j=function(t){n.forEach((function(i){t.pointerUp(i.transformedX,i.transformedY,i.identifier),t.pointerExit(i.transformedX,i.transformedY,i.identifier)}))},M=0,E=r;M<E.length;M++)j(E[M]);break;case"mouseup":for(var O=function(t){n.forEach((function(i){t.pointerUp(i.transformedX,i.transformedY,i.identifier)}))},C=0,$=r;C<$.length;C++)O($[C])}}}.bind(void 0);return i.addEventListener("mouseover",v),i.addEventListener("mouseout",v),i.addEventListener("mousemove",v),i.addEventListener("mousedown",v),i.addEventListener("mouseup",v),i.addEventListener("touchmove",v,{passive:u}),i.addEventListener("touchstart",v,{passive:u}),i.addEventListener("touchend",v),function(){i.removeEventListener("mouseover",v),i.removeEventListener("mouseout",v),i.removeEventListener("mousemove",v),i.removeEventListener("mousedown",v),i.removeEventListener("mouseup",v),i.removeEventListener("touchmove",v),i.removeEventListener("touchstart",v),i.removeEventListener("touchend",v)}}},(t,i,e)=>{e.r(i),e.d(i,{BLANK_URL:()=>u,sanitizeUrl:()=>c});var n=/^([^\w]*)(javascript|data|vbscript)/im,r=/&#(\w+)(^\w|;)?/g,s=/&(newline|tab);/gi,o=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,a=/^.+(:|&colon;)/gim,h=[".","/"],u="about:blank";function c(t){if(!t)return u;var i,e=(i=t,i.replace(o,"").replace(r,(function(t,i){return String.fromCharCode(i)}))).replace(s,"").replace(o,"").trim();if(!e)return u;if(function(t){return h.indexOf(t[0])>-1}(e))return e;var c=e.match(a);return c&&n.test(c[0])?u:e}},(t,i,e)=>{e.r(i),e.d(i,{AudioAssetWrapper:()=>p,AudioWrapper:()=>u,CustomFileAssetLoaderWrapper:()=>l,FileAssetWrapper:()=>d,FileFinalizer:()=>s,FontAssetWrapper:()=>g,FontWrapper:()=>c,ImageAssetWrapper:()=>f,ImageWrapper:()=>h,createFinalization:()=>v,finalizationRegistry:()=>b});var n,r=(n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var e in i)Object.prototype.hasOwnProperty.call(i,e)&&(t[e]=i[e])},n(t,i)},function(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function e(){this.constructor=t}n(t,i),t.prototype=null===i?Object.create(i):(e.prototype=i.prototype,new e)}),s=function(){function t(t){this.selfUnref=!1,this._file=t}return t.prototype.unref=function(){this._file&&this._file.unref()},t}(),o=function(){function t(t){this._finalizableObject=t}return t.prototype.unref=function(){this._finalizableObject.unref()},t}(),a=function(){function t(){this.selfUnref=!1}return t.prototype.unref=function(){},t}(),h=function(t){function i(i){var e=t.call(this)||this;return e._nativeImage=i,e}return r(i,t),Object.defineProperty(i.prototype,"nativeImage",{get:function(){return this._nativeImage},enumerable:!1,configurable:!0}),i.prototype.unref=function(){this.selfUnref&&this._nativeImage.unref()},i}(a),u=function(t){function i(i){var e=t.call(this)||this;return e._nativeAudio=i,e}return r(i,t),Object.defineProperty(i.prototype,"nativeAudio",{get:function(){return this._nativeAudio},enumerable:!1,configurable:!0}),i.prototype.unref=function(){this.selfUnref&&this._nativeAudio.unref()},i}(a),c=function(t){function i(i){var e=t.call(this)||this;return e._nativeFont=i,e}return r(i,t),Object.defineProperty(i.prototype,"nativeFont",{get:function(){return this._nativeFont},enumerable:!1,configurable:!0}),i.prototype.unref=function(){this.selfUnref&&this._nativeFont.unref()},i}(a),l=function(){function t(t,i){this._assetLoaderCallback=i,this.assetLoader=new t.CustomFileAssetLoader({loadContents:this.loadContents.bind(this)})}return t.prototype.loadContents=function(t,i){var e;return t.isImage?e=new f(t):t.isAudio?e=new p(t):t.isFont&&(e=new g(t)),this._assetLoaderCallback(e,i)},t}(),d=function(){function t(t){this._nativeFileAsset=t}return t.prototype.decode=function(t){this._nativeFileAsset.decode(t)},Object.defineProperty(t.prototype,"name",{get:function(){return this._nativeFileAsset.name},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fileExtension",{get:function(){return this._nativeFileAsset.fileExtension},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"uniqueFilename",{get:function(){return this._nativeFileAsset.uniqueFilename},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isAudio",{get:function(){return this._nativeFileAsset.isAudio},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isImage",{get:function(){return this._nativeFileAsset.isImage},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFont",{get:function(){return this._nativeFileAsset.isFont},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cdnUuid",{get:function(){return this._nativeFileAsset.cdnUuid},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nativeFileAsset",{get:function(){return this._nativeFileAsset},enumerable:!1,configurable:!0}),t}(),f=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return r(i,t),i.prototype.setRenderImage=function(t){this._nativeFileAsset.setRenderImage(t.nativeImage)},i}(d),p=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return r(i,t),i.prototype.setAudioSource=function(t){this._nativeFileAsset.setAudioSource(t.nativeAudio)},i}(d),g=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return r(i,t),i.prototype.setFont=function(t){this._nativeFileAsset.setFont(t.nativeFont)},i}(d),m=function(){function t(){}return t.prototype.register=function(t){t.selfUnref=!0},t.prototype.unregister=function(){},t}(),b=new("undefined"!=typeof FinalizationRegistry?FinalizationRegistry:m)((function(t){null==t||t.unref()})),v=function(t,i){var e=new o(i);b.register(t,e)}}],i={};function e(n){var r=i[n];if(void 0!==r)return r.exports;var s=i[n]={exports:{}};return t[n](s,s.exports,e),s.exports}e.d=(t,i)=>{for(var n in i)e.o(i,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:i[n]})},e.o=(t,i)=>Object.prototype.hasOwnProperty.call(t,i),e.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{e.r(n),e.d(n,{Alignment:()=>r,DataEnum:()=>L,EventType:()=>y,Fit:()=>i,Layout:()=>m,LoopType:()=>x,Rive:()=>W,RiveEventType:()=>v,RiveFile:()=>z,RuntimeLoader:()=>b,StateMachineInput:()=>w,StateMachineInputType:()=>g,Testing:()=>J,ViewModel:()=>D,ViewModelInstance:()=>F,ViewModelInstanceArtboard:()=>Y,ViewModelInstanceAssetImage:()=>G,ViewModelInstanceBoolean:()=>U,ViewModelInstanceColor:()=>V,ViewModelInstanceEnum:()=>q,ViewModelInstanceList:()=>X,ViewModelInstanceNumber:()=>N,ViewModelInstanceString:()=>B,ViewModelInstanceTrigger:()=>H,ViewModelInstanceValue:()=>R,decodeAudio:()=>Q,decodeFont:()=>it,decodeImage:()=>tt});var t,i,r,s=e(1),o=e(2),a=e(3),h=e(5),u=(t=function(i,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var e in i)Object.prototype.hasOwnProperty.call(i,e)&&(t[e]=i[e])},t(i,e)},function(i,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=i}t(i,e),i.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),c=function(){return c=Object.assign||function(t){for(var i,e=1,n=arguments.length;e<n;e++)for(var r in i=arguments[e])Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r]);return t},c.apply(this,arguments)},l=function(t,i,e,n){return new(e||(e=Promise))((function(r,s){function o(t){try{h(n.next(t))}catch(t){s(t)}}function a(t){try{h(n.throw(t))}catch(t){s(t)}}function h(t){var i;t.done?r(t.value):(i=t.value,i instanceof e?i:new e((function(t){t(i)}))).then(o,a)}h((n=n.apply(t,i||[])).next())}))},d=function(t,i){var e,n,r,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(h){return function(a){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(e=1,n&&(r=2&a[0]?n.return:a[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,a[1])).done)return r;switch(n=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((r=(r=s.trys).length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){s.label=a[1];break}if(6===a[0]&&s.label<r[1]){s.label=r[1],r=a;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(a);break}r[2]&&s.ops.pop(),s.trys.pop();continue}a=i.call(t,s)}catch(t){a=[6,t],n=0}finally{e=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,h])}}},f=function(t,i,e){if(e||2===arguments.length)for(var n,r=0,s=i.length;r<s;r++)!n&&r in i||(n||(n=Array.prototype.slice.call(i,0,r)),n[r]=i[r]);return t.concat(n||Array.prototype.slice.call(i))},p=function(t){function i(){var i=null!==t&&t.apply(this,arguments)||this;return i.isHandledError=!0,i}return u(i,t),i}(Error);!function(t){t.Cover="cover",t.Contain="contain",t.Fill="fill",t.FitWidth="fitWidth",t.FitHeight="fitHeight",t.None="none",t.ScaleDown="scaleDown",t.Layout="layout"}(i||(i={})),function(t){t.Center="center",t.TopLeft="topLeft",t.TopCenter="topCenter",t.TopRight="topRight",t.CenterLeft="centerLeft",t.CenterRight="centerRight",t.BottomLeft="bottomLeft",t.BottomCenter="bottomCenter",t.BottomRight="bottomRight"}(r||(r={}));var g,m=function(){function t(t){var e,n,s,o,a,h,u;this.fit=null!==(e=null==t?void 0:t.fit)&&void 0!==e?e:i.Contain,this.alignment=null!==(n=null==t?void 0:t.alignment)&&void 0!==n?n:r.Center,this.layoutScaleFactor=null!==(s=null==t?void 0:t.layoutScaleFactor)&&void 0!==s?s:1,this.minX=null!==(o=null==t?void 0:t.minX)&&void 0!==o?o:0,this.minY=null!==(a=null==t?void 0:t.minY)&&void 0!==a?a:0,this.maxX=null!==(h=null==t?void 0:t.maxX)&&void 0!==h?h:0,this.maxY=null!==(u=null==t?void 0:t.maxY)&&void 0!==u?u:0}return t.new=function(i){var e=i.fit,n=i.alignment,r=i.minX,s=i.minY,o=i.maxX,a=i.maxY;return console.warn("This function is deprecated: please use `new Layout({})` instead"),new t({fit:e,alignment:n,minX:r,minY:s,maxX:o,maxY:a})},t.prototype.copyWith=function(i){var e=i.fit,n=i.alignment,r=i.layoutScaleFactor,s=i.minX,o=i.minY,a=i.maxX,h=i.maxY;return new t({fit:null!=e?e:this.fit,alignment:null!=n?n:this.alignment,layoutScaleFactor:null!=r?r:this.layoutScaleFactor,minX:null!=s?s:this.minX,minY:null!=o?o:this.minY,maxX:null!=a?a:this.maxX,maxY:null!=h?h:this.maxY})},t.prototype.runtimeFit=function(t){return this.cachedRuntimeFit?this.cachedRuntimeFit:(this.cachedRuntimeFit=e=this.fit===i.Cover?t.Fit.cover:this.fit===i.Contain?t.Fit.contain:this.fit===i.Fill?t.Fit.fill:this.fit===i.FitWidth?t.Fit.fitWidth:this.fit===i.FitHeight?t.Fit.fitHeight:this.fit===i.ScaleDown?t.Fit.scaleDown:this.fit===i.Layout?t.Fit.layout:t.Fit.none,e);var e},t.prototype.runtimeAlignment=function(t){return this.cachedRuntimeAlignment?this.cachedRuntimeAlignment:(this.cachedRuntimeAlignment=i=this.alignment===r.TopLeft?t.Alignment.topLeft:this.alignment===r.TopCenter?t.Alignment.topCenter:this.alignment===r.TopRight?t.Alignment.topRight:this.alignment===r.CenterLeft?t.Alignment.centerLeft:this.alignment===r.CenterRight?t.Alignment.centerRight:this.alignment===r.BottomLeft?t.Alignment.bottomLeft:this.alignment===r.BottomCenter?t.Alignment.bottomCenter:this.alignment===r.BottomRight?t.Alignment.bottomRight:t.Alignment.center,i);var i},t}(),b=function(){function t(){}return t.loadRuntime=function(){s.default({locateFile:function(){return t.wasmURL}}).then((function(i){var e;for(t.runtime=i;t.callBackQueue.length>0;)null===(e=t.callBackQueue.shift())||void 0===e||e(t.runtime)})).catch((function(i){var e={message:(null==i?void 0:i.message)||"Unknown error",type:(null==i?void 0:i.name)||"Error",wasmError:i instanceof WebAssembly.CompileError||i instanceof WebAssembly.RuntimeError,originalError:i};console.debug("Rive WASM load error details:",e);var n="https://cdn.jsdelivr.net/npm/".concat(o.name,"@").concat(o.version,"/rive_fallback.wasm");if(t.wasmURL.toLowerCase()!==n)console.warn("Failed to load WASM from ".concat(t.wasmURL," (").concat(e.message,"), trying jsdelivr as a backup")),t.setWasmUrl(n),t.loadRuntime();else{var r=["Could not load Rive WASM file from ".concat(t.wasmURL," or ").concat(n,"."),"Possible reasons:","- Network connection is down","- WebAssembly is not supported in this environment","- The WASM file is corrupted or incompatible","\nError details:","- Type: ".concat(e.type),"- Message: ".concat(e.message),"- WebAssembly-specific error: ".concat(e.wasmError),"\nTo resolve, you may need to:","1. Check your network connection","2. Set a new WASM source via RuntimeLoader.setWasmUrl()","3. Call RuntimeLoader.loadRuntime() again"].join("\n");console.error(r)}}))},t.getInstance=function(i){t.isLoading||(t.isLoading=!0,t.loadRuntime()),t.runtime?i(t.runtime):t.callBackQueue.push(i)},t.awaitInstance=function(){return new Promise((function(i){return t.getInstance((function(t){return i(t)}))}))},t.setWasmUrl=function(i){t.wasmURL=i},t.getWasmUrl=function(){return t.wasmURL},t.isLoading=!1,t.callBackQueue=[],t.wasmURL="https://unpkg.com/".concat(o.name,"@").concat(o.version,"/rive.wasm"),t}();!function(t){t[t.Number=56]="Number",t[t.Trigger=58]="Trigger",t[t.Boolean=59]="Boolean"}(g||(g={}));var v,w=function(){function t(t,i){this.type=t,this.runtimeInput=i}return Object.defineProperty(t.prototype,"name",{get:function(){return this.runtimeInput.name},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.runtimeInput.value},set:function(t){this.runtimeInput.value=t},enumerable:!1,configurable:!0}),t.prototype.fire=function(){this.type===g.Trigger&&this.runtimeInput.fire()},t.prototype.delete=function(){this.runtimeInput=null},t}();!function(t){t[t.General=128]="General",t[t.OpenUrl=131]="OpenUrl"}(v||(v={}));var y,x,k=function(t){this.isBindableArtboard=!1,this.isBindableArtboard=t},A=function(t){function i(i,e){var n=t.call(this,!1)||this;return n.nativeArtboard=i,n.file=e,n}return u(i,t),i}(k),S=function(t){function i(i){var e=t.call(this,!0)||this;return e.selfUnref=!1,e.nativeArtboard=i,e}return u(i,t),i.prototype.destroy=function(){this.selfUnref&&this.nativeArtboard.unref()},i}(k),j=function(){function t(t,i,e,n){this.stateMachine=t,this.playing=e,this.artboard=n,this.inputs=[],this.instance=new i.StateMachineInstance(t,n),this.initInputs(i)}return Object.defineProperty(t.prototype,"name",{get:function(){return this.stateMachine.name},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"statesChanged",{get:function(){for(var t=[],i=0;i<this.instance.stateChangedCount();i++)t.push(this.instance.stateChangedNameByIndex(i));return t},enumerable:!1,configurable:!0}),t.prototype.advance=function(t){this.instance.advance(t)},t.prototype.advanceAndApply=function(t){this.instance.advanceAndApply(t)},t.prototype.reportedEventCount=function(){return this.instance.reportedEventCount()},t.prototype.reportedEventAt=function(t){return this.instance.reportedEventAt(t)},t.prototype.initInputs=function(t){for(var i=0;i<this.instance.inputCount();i++){var e=this.instance.input(i);this.inputs.push(this.mapRuntimeInput(e,t))}},t.prototype.mapRuntimeInput=function(t,i){return t.type===i.SMIInput.bool?new w(g.Boolean,t.asBool()):t.type===i.SMIInput.number?new w(g.Number,t.asNumber()):t.type===i.SMIInput.trigger?new w(g.Trigger,t.asTrigger()):void 0},t.prototype.cleanup=function(){this.inputs.forEach((function(t){t.delete()})),this.inputs.length=0,this.instance.delete()},t.prototype.bindViewModelInstance=function(t){null!=t.runtimeInstance&&this.instance.bindViewModelInstance(t.runtimeInstance)},t}(),M=function(){function t(t,i,e,n,r){void 0===n&&(n=[]),void 0===r&&(r=[]),this.runtime=t,this.artboard=i,this.eventManager=e,this.animations=n,this.stateMachines=r}return t.prototype.add=function(t,i,e){if(void 0===e&&(e=!0),0===(t=K(t)).length)this.animations.forEach((function(t){return t.playing=i})),this.stateMachines.forEach((function(t){return t.playing=i}));else for(var n=this.animations.map((function(t){return t.name})),r=this.stateMachines.map((function(t){return t.name})),s=0;s<t.length;s++){var o=n.indexOf(t[s]),h=r.indexOf(t[s]);if(o>=0||h>=0)o>=0?this.animations[o].playing=i:this.stateMachines[h].playing=i;else{var u=this.artboard.animationByName(t[s]);if(u){var c=new a.Animation(u,this.artboard,this.runtime,i);c.advance(0),c.apply(1),this.animations.push(c)}else{var l=this.artboard.stateMachineByName(t[s]);if(l){var d=new j(l,this.runtime,i,this.artboard);this.stateMachines.push(d)}}}}return e&&this.eventManager.fire(i?{type:y.Play,data:this.playing}:{type:y.Pause,data:this.paused}),i?this.playing:this.paused},t.prototype.initLinearAnimations=function(t,i){for(var e=this.animations.map((function(t){return t.name})),n=0;n<t.length;n++){var r=e.indexOf(t[n]);if(r>=0)this.animations[r].playing=i;else{var s=this.artboard.animationByName(t[n]);if(s){var o=new a.Animation(s,this.artboard,this.runtime,i);o.advance(0),o.apply(1),this.animations.push(o)}else console.error("Animation with name ".concat(t[n]," not found."))}}},t.prototype.initStateMachines=function(t,i){for(var e=this.stateMachines.map((function(t){return t.name})),n=0;n<t.length;n++){var r=e.indexOf(t[n]);if(r>=0)this.stateMachines[r].playing=i;else{var s=this.artboard.stateMachineByName(t[n]);if(s){var o=new j(s,this.runtime,i,this.artboard);this.stateMachines.push(o)}else console.warn("State Machine with name ".concat(t[n]," not found.")),this.initLinearAnimations([t[n]],i)}}},t.prototype.play=function(t){return this.add(t,!0)},t.prototype.advanceIfPaused=function(){this.stateMachines.forEach((function(t){t.playing||t.advanceAndApply(0)}))},t.prototype.pause=function(t){return this.add(t,!1)},t.prototype.scrub=function(t,i){var e=this.animations.filter((function(i){return t.includes(i.name)}));return e.forEach((function(t){return t.scrubTo=i})),e.map((function(t){return t.name}))},Object.defineProperty(t.prototype,"playing",{get:function(){return this.animations.filter((function(t){return t.playing})).map((function(t){return t.name})).concat(this.stateMachines.filter((function(t){return t.playing})).map((function(t){return t.name})))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"paused",{get:function(){return this.animations.filter((function(t){return!t.playing})).map((function(t){return t.name})).concat(this.stateMachines.filter((function(t){return!t.playing})).map((function(t){return t.name})))},enumerable:!1,configurable:!0}),t.prototype.stop=function(t){var i=this,e=[];if(0===(t=K(t)).length)e=this.animations.map((function(t){return t.name})).concat(this.stateMachines.map((function(t){return t.name}))),this.animations.forEach((function(t){return t.cleanup()})),this.stateMachines.forEach((function(t){return t.cleanup()})),this.animations.splice(0,this.animations.length),this.stateMachines.splice(0,this.stateMachines.length);else{var n=this.animations.filter((function(i){return t.includes(i.name)}));n.forEach((function(t){t.cleanup(),i.animations.splice(i.animations.indexOf(t),1)}));var r=this.stateMachines.filter((function(i){return t.includes(i.name)}));r.forEach((function(t){t.cleanup(),i.stateMachines.splice(i.stateMachines.indexOf(t),1)})),e=n.map((function(t){return t.name})).concat(r.map((function(t){return t.name})))}return this.eventManager.fire({type:y.Stop,data:e}),e},Object.defineProperty(t.prototype,"isPlaying",{get:function(){return this.animations.reduce((function(t,i){return t||i.playing}),!1)||this.stateMachines.reduce((function(t,i){return t||i.playing}),!1)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isPaused",{get:function(){return!this.isPlaying&&(this.animations.length>0||this.stateMachines.length>0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isStopped",{get:function(){return 0===this.animations.length&&0===this.stateMachines.length},enumerable:!1,configurable:!0}),t.prototype.atLeastOne=function(t,i){var e;return void 0===i&&(i=!0),0===this.animations.length&&0===this.stateMachines.length&&(this.artboard.animationCount()>0?this.add([e=this.artboard.animationByIndex(0).name],t,i):this.artboard.stateMachineCount()>0&&this.add([e=this.artboard.stateMachineByIndex(0).name],t,i)),e},t.prototype.handleLooping=function(){for(var t=0,i=this.animations.filter((function(t){return t.playing}));t<i.length;t++){var e=i[t];0===e.loopValue&&e.loopCount?(e.loopCount=0,this.stop(e.name)):1===e.loopValue&&e.loopCount?(this.eventManager.fire({type:y.Loop,data:{animation:e.name,type:x.Loop}}),e.loopCount=0):2===e.loopValue&&e.loopCount>1&&(this.eventManager.fire({type:y.Loop,data:{animation:e.name,type:x.PingPong}}),e.loopCount=0)}},t.prototype.handleStateChanges=function(){for(var t=[],i=0,e=this.stateMachines.filter((function(t){return t.playing}));i<e.length;i++)t.push.apply(t,e[i].statesChanged);t.length>0&&this.eventManager.fire({type:y.StateChange,data:t})},t.prototype.handleAdvancing=function(t){this.eventManager.fire({type:y.Advance,data:t})},t}();!function(t){t.Load="load",t.LoadError="loaderror",t.Play="play",t.Pause="pause",t.Stop="stop",t.Loop="loop",t.Draw="draw",t.Advance="advance",t.StateChange="statechange",t.RiveEvent="riveevent",t.AudioStatusChange="audiostatuschange"}(y||(y={})),function(t){t.OneShot="oneshot",t.Loop="loop",t.PingPong="pingpong"}(x||(x={}));var E,O=function(){function t(t){void 0===t&&(t=[]),this.listeners=t}return t.prototype.getListeners=function(t){return this.listeners.filter((function(i){return i.type===t}))},t.prototype.add=function(t){this.listeners.includes(t)||this.listeners.push(t)},t.prototype.remove=function(t){for(var i=0;i<this.listeners.length;i++){var e=this.listeners[i];if(e.type===t.type&&e.callback===t.callback){this.listeners.splice(i,1);break}}},t.prototype.removeAll=function(t){var i=this;t?this.listeners.filter((function(i){return i.type===t})).forEach((function(t){return i.remove(t)})):this.listeners.splice(0,this.listeners.length)},t.prototype.fire=function(t){this.getListeners(t.type).forEach((function(i){return i.callback(t)}))},t}(),C=function(){function t(t){this.eventManager=t,this.queue=[]}return t.prototype.add=function(t){this.queue.push(t)},t.prototype.process=function(){for(;this.queue.length>0;){var t=this.queue.shift();(null==t?void 0:t.action)&&t.action(),(null==t?void 0:t.event)&&this.eventManager.fire(t.event)}},t}();!function(t){t[t.AVAILABLE=0]="AVAILABLE",t[t.UNAVAILABLE=1]="UNAVAILABLE"}(E||(E={}));var $,I=new(function(t){function i(){var i=null!==t&&t.apply(this,arguments)||this;return i._started=!1,i._enabled=!1,i._status=E.UNAVAILABLE,i}return u(i,t),i.prototype.delay=function(t){return l(this,void 0,void 0,(function(){return d(this,(function(){return[2,new Promise((function(i){return setTimeout(i,t)}))]}))}))},i.prototype.timeout=function(){return l(this,void 0,void 0,(function(){return d(this,(function(){return[2,new Promise((function(t,i){return setTimeout(i,50)}))]}))}))},i.prototype.reportToListeners=function(){this.fire({type:y.AudioStatusChange}),this.removeAll()},i.prototype.enableAudio=function(){return l(this,void 0,void 0,(function(){return d(this,(function(){return this._enabled||(this._enabled=!0,this._status=E.AVAILABLE,this.reportToListeners()),[2]}))}))},i.prototype.testAudio=function(){return l(this,void 0,void 0,(function(){return d(this,(function(t){switch(t.label){case 0:if(this._status!==E.UNAVAILABLE||null===this._audioContext)return[3,4];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,Promise.race([this._audioContext.resume(),this.timeout()])];case 2:return t.sent(),this.enableAudio(),[3,4];case 3:return t.sent(),[3,4];case 4:return[2]}}))}))},i.prototype._establishAudio=function(){return l(this,void 0,void 0,(function(){return d(this,(function(t){switch(t.label){case 0:return this._started?[3,5]:(this._started=!0,"undefined"!=typeof window?[3,1]:(this.enableAudio(),[3,5]));case 1:this._audioContext=new AudioContext,this.listenForUserAction(),t.label=2;case 2:return this._status!==E.UNAVAILABLE?[3,5]:[4,this.testAudio()];case 3:return t.sent(),[4,this.delay(1e3)];case 4:return t.sent(),[3,2];case 5:return[2]}}))}))},i.prototype.listenForUserAction=function(){var t=this;document.addEventListener("pointerdown",(function(){return l(t,void 0,void 0,(function(){return d(this,(function(){return this.enableAudio(),[2]}))}))}),{once:!0})},i.prototype.establishAudio=function(){return l(this,void 0,void 0,(function(){return d(this,(function(){return this._establishAudio(),[2]}))}))},Object.defineProperty(i.prototype,"systemVolume",{get:function(){return this._status===E.UNAVAILABLE?(this.testAudio(),0):1},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"status",{get:function(){return this._status},enumerable:!1,configurable:!0}),i}(O)),_=function(){function t(){}return t.prototype.observe=function(){},t.prototype.unobserve=function(){},t.prototype.disconnect=function(){},t}(),T=globalThis.ResizeObserver||_,P=new(function(){function t(){var t=this;this._elementsMap=new Map,this._onObservedEntry=function(i){var e=t._elementsMap.get(i.target);null!==e?e.onResize(0==i.target.clientWidth||0==i.target.clientHeight):t._resizeObserver.unobserve(i.target)},this._onObserved=function(i){i.forEach(t._onObservedEntry)},this._resizeObserver=new T(this._onObserved)}return t.prototype.add=function(t,i){var e={onResize:i,element:t};return this._elementsMap.set(t,e),this._resizeObserver.observe(t),e},t.prototype.remove=function(t){this._resizeObserver.unobserve(t.element),this._elementsMap.delete(t.element)},t}()),z=function(){function t(t){this.enableRiveAssetCDN=!0,this.referenceCount=0,this.destroyed=!1,this.selfUnref=!1,this.bindableArtboards=[],this.src=t.src,this.buffer=t.buffer,t.assetLoader&&(this.assetLoader=t.assetLoader),this.enableRiveAssetCDN="boolean"!=typeof t.enableRiveAssetCDN||t.enableRiveAssetCDN,this.eventManager=new O,t.onLoad&&this.on(y.Load,t.onLoad),t.onLoadError&&this.on(y.LoadError,t.onLoadError)}return t.prototype.releaseFile=function(){var t;this.selfUnref&&(null===(t=this.file)||void 0===t||t.unref()),this.file=null},t.prototype.releaseBindableArtboards=function(){this.bindableArtboards.forEach((function(t){return t.destroy()}))},t.prototype.initData=function(){return l(this,void 0,void 0,(function(){var i,e,n,r,s;return d(this,(function(o){switch(o.label){case 0:return this.src?(i=this,[4,Z(this.src)]):[3,2];case 1:i.buffer=o.sent(),o.label=2;case 2:return this.destroyed?[2]:(this.assetLoader&&(n=new h.CustomFileAssetLoaderWrapper(this.runtime,this.assetLoader),e=n.assetLoader),r=this,[4,this.runtime.load(new Uint8Array(this.buffer),e,this.enableRiveAssetCDN)]);case 3:return r.file=o.sent(),s=new h.FileFinalizer(this.file),h.finalizationRegistry.register(this,s),this.destroyed?(this.releaseFile(),[2]):(null!==this.file?this.eventManager.fire({type:y.Load,data:this}):this.fireLoadError(t.fileLoadErrorMessage),[2])}}))}))},t.prototype.init=function(){return l(this,void 0,void 0,(function(){var i,e;return d(this,(function(n){switch(n.label){case 0:if(!this.src&&!this.buffer)return this.fireLoadError(t.missingErrorMessage),[2];n.label=1;case 1:return n.trys.push([1,4,,5]),i=this,[4,b.awaitInstance()];case 2:return i.runtime=n.sent(),this.destroyed?[2]:[4,this.initData()];case 3:return n.sent(),[3,5];case 4:return e=n.sent(),this.fireLoadError(e instanceof Error?e.message:t.fileLoadErrorMessage),[3,5];case 5:return[2]}}))}))},t.prototype.fireLoadError=function(t){throw this.eventManager.fire({type:y.LoadError,data:t}),new Error(t)},t.prototype.on=function(t,i){this.eventManager.add({type:t,callback:i})},t.prototype.off=function(t,i){this.eventManager.remove({type:t,callback:i})},t.prototype.cleanup=function(){this.referenceCount-=1,this.referenceCount<=0&&(this.removeAllRiveEventListeners(),this.releaseFile(),this.releaseBindableArtboards(),this.destroyed=!0)},t.prototype.removeAllRiveEventListeners=function(t){this.eventManager.removeAll(t)},t.prototype.getInstance=function(){if(null!==this.file)return this.referenceCount+=1,this.file},t.prototype.destroyIfUnused=function(){this.referenceCount<=0&&this.cleanup()},t.prototype.createBindableArtboard=function(t){if(null!=t){var i=new S(t);return(0,h.createFinalization)(i,i.nativeArtboard),this.bindableArtboards.push(i),i}return null},t.prototype.getArtboard=function(t){var i=this.file.artboardByName(t);if(null!=i)return new A(i,this)},t.prototype.getBindableArtboard=function(t){var i=this.file.bindableArtboardByName(t);return this.createBindableArtboard(i)},t.prototype.getDefaultBindableArtboard=function(){var t=this.file.bindableArtboardDefault();return this.createBindableArtboard(t)},t.prototype.internalBindableArtboardFromArtboard=function(t){var i=this.file.internalBindableArtboardFromArtboard(t);return this.createBindableArtboard(i)},t.missingErrorMessage="Rive source file or data buffer required",t.fileLoadErrorMessage="The file failed to load",t}(),W=function(){function t(t){var i,e=this;this.loaded=!1,this.destroyed=!1,this._observed=null,this.readyForPlaying=!1,this.artboard=null,this.eventCleanup=null,this.shouldDisableRiveListeners=!1,this.automaticallyHandleEvents=!1,this.dispatchPointerExit=!0,this.enableMultiTouch=!1,this.enableRiveAssetCDN=!0,this._volume=1,this._artboardWidth=void 0,this._artboardHeight=void 0,this._devicePixelRatioUsed=1,this._hasZeroSize=!1,this._audioEventListener=null,this._boundDraw=null,this._viewModelInstance=null,this._dataEnums=null,this.durations=[],this.frameTimes=[],this.frameCount=0,this.isTouchScrollEnabled=!1,this.onCanvasResize=function(t){var i=e._hasZeroSize!==t;e._hasZeroSize=t,t?e._layout.maxX&&e._layout.maxY||e.resizeToCanvas():i&&e.resizeDrawingSurfaceToCanvas()},this.renderSecondTimer=0,this._boundDraw=this.draw.bind(this),this.canvas=t.canvas,t.canvas.constructor===HTMLCanvasElement&&(this._observed=P.add(this.canvas,this.onCanvasResize)),this.src=t.src,this.buffer=t.buffer,this.riveFile=t.riveFile,this.layout=null!==(i=t.layout)&&void 0!==i?i:new m,this.shouldDisableRiveListeners=!!t.shouldDisableRiveListeners,this.isTouchScrollEnabled=!!t.isTouchScrollEnabled,this.automaticallyHandleEvents=!!t.automaticallyHandleEvents,this.dispatchPointerExit=!1===t.dispatchPointerExit?t.dispatchPointerExit:this.dispatchPointerExit,this.enableMultiTouch=!!t.enableMultiTouch,this.enableRiveAssetCDN=void 0===t.enableRiveAssetCDN||t.enableRiveAssetCDN,this.eventManager=new O,t.onLoad&&this.on(y.Load,t.onLoad),t.onLoadError&&this.on(y.LoadError,t.onLoadError),t.onPlay&&this.on(y.Play,t.onPlay),t.onPause&&this.on(y.Pause,t.onPause),t.onStop&&this.on(y.Stop,t.onStop),t.onLoop&&this.on(y.Loop,t.onLoop),t.onStateChange&&this.on(y.StateChange,t.onStateChange),t.onAdvance&&this.on(y.Advance,t.onAdvance),t.onload&&!t.onLoad&&this.on(y.Load,t.onload),t.onloaderror&&!t.onLoadError&&this.on(y.LoadError,t.onloaderror),t.onplay&&!t.onPlay&&this.on(y.Play,t.onplay),t.onpause&&!t.onPause&&this.on(y.Pause,t.onpause),t.onstop&&!t.onStop&&this.on(y.Stop,t.onstop),t.onloop&&!t.onLoop&&this.on(y.Loop,t.onloop),t.onstatechange&&!t.onStateChange&&this.on(y.StateChange,t.onstatechange),t.assetLoader&&(this.assetLoader=t.assetLoader),this.taskQueue=new C(this.eventManager),this.init({src:this.src,buffer:this.buffer,riveFile:this.riveFile,autoplay:t.autoplay,autoBind:t.autoBind,animations:t.animations,stateMachines:t.stateMachines,artboard:t.artboard,useOffscreenRenderer:t.useOffscreenRenderer})}return Object.defineProperty(t.prototype,"viewModelCount",{get:function(){return this.file.viewModelCount()},enumerable:!1,configurable:!0}),t.new=function(i){return console.warn("This function is deprecated: please use `new Rive({})` instead"),new t(i)},t.prototype.onSystemAudioChanged=function(){this.volume=this._volume},t.prototype.init=function(i){var e=this,n=i.buffer,r=i.riveFile,s=i.animations,o=i.stateMachines,a=i.artboard,h=i.autoplay,u=void 0!==h&&h,c=i.useOffscreenRenderer,l=void 0!==c&&c,d=i.autoBind,f=void 0!==d&&d;if(!this.destroyed){if(this.src=i.src,this.buffer=n,this.riveFile=r,!this.src&&!this.buffer&&!this.riveFile)throw new p(t.missingErrorMessage);var g=K(s),m=K(o);this.loaded=!1,this.readyForPlaying=!1,b.awaitInstance().then((function(t){e.destroyed||(e.runtime=t,e.removeRiveListeners(),e.deleteRiveRenderer(),e.renderer=e.runtime.makeRenderer(e.canvas,l),e.canvas.width||e.canvas.height||e.resizeDrawingSurfaceToCanvas(),e.initData(a,g,m,u,f).then((function(t){if(t)return e.setupRiveListeners()})).catch((function(t){console.error(t)})))})).catch((function(t){console.error(t)}))}},t.prototype.setupRiveListeners=function(t){var i=this;if(this.eventCleanup&&this.eventCleanup(),!this.shouldDisableRiveListeners){var e=(this.animator.stateMachines||[]).filter((function(t){return t.playing&&i.runtime.hasListeners(t.instance)})).map((function(t){return t.instance})),n=this.isTouchScrollEnabled,r=this.dispatchPointerExit,s=this.enableMultiTouch;t&&"isTouchScrollEnabled"in t&&(n=t.isTouchScrollEnabled),this.eventCleanup=(0,h.registerTouchInteractions)({canvas:this.canvas,artboard:this.artboard,stateMachines:e,renderer:this.renderer,rive:this.runtime,fit:this._layout.runtimeFit(this.runtime),alignment:this._layout.runtimeAlignment(this.runtime),isTouchScrollEnabled:n,dispatchPointerExit:r,enableMultiTouch:s,layoutScaleFactor:this._layout.layoutScaleFactor})}},t.prototype.removeRiveListeners=function(){this.eventCleanup&&(this.eventCleanup(),this.eventCleanup=null)},t.prototype.initializeAudio=function(){var t,i=this;I.status==E.UNAVAILABLE&&(null===(t=this.artboard)||void 0===t?void 0:t.hasAudio)&&null===this._audioEventListener&&(this._audioEventListener={type:y.AudioStatusChange,callback:function(){return i.onSystemAudioChanged()}},I.add(this._audioEventListener),I.establishAudio())},t.prototype.initArtboardSize=function(){this.artboard&&(this._artboardWidth=this.artboard.width=this._artboardWidth||this.artboard.width,this._artboardHeight=this.artboard.height=this._artboardHeight||this.artboard.height)},t.prototype.initData=function(t,i,e,n,r){return l(this,void 0,void 0,(function(){var s,o,a,h;return d(this,(function(u){switch(u.label){case 0:return u.trys.push([0,3,,4]),null!=this.riveFile?[3,2]:(s=new z({src:this.src,buffer:this.buffer,enableRiveAssetCDN:this.enableRiveAssetCDN,assetLoader:this.assetLoader}),this.riveFile=s,[4,s.init()]);case 1:if(u.sent(),this.destroyed)return s.destroyIfUnused(),[2,!1];u.label=2;case 2:return this.file=this.riveFile.getInstance(),this.initArtboard(t,i,e,n,r),this.initArtboardSize(),this.initializeAudio(),this.loaded=!0,this.eventManager.fire({type:y.Load,data:null!==(h=this.src)&&void 0!==h?h:"buffer"}),this.animator.advanceIfPaused(),this.readyForPlaying=!0,this.taskQueue.process(),this.drawFrame(),[2,!0];case 3:return o=u.sent(),a=(c=o)&&c.isHandledError?c.message:"Problem loading file; may be corrupt!",console.warn(a),this.eventManager.fire({type:y.LoadError,data:a}),[2,Promise.reject(a)];case 4:return[2]}var c}))}))},t.prototype.initArtboard=function(t,i,e,n,r){if(this.file){var s,o=t?this.file.artboardByName(t):this.file.defaultArtboard();if(!o){var a="Invalid artboard name or no default artboard";return console.warn(a),void this.eventManager.fire({type:y.LoadError,data:a})}if(this.artboard=o,o.volume=this._volume*I.systemVolume,this.animator=new M(this.runtime,this.artboard,this.eventManager),i.length>0||e.length>0?(s=i.concat(e),this.animator.initLinearAnimations(i,n),this.animator.initStateMachines(e,n)):s=[this.animator.atLeastOne(n,!1)],this.taskQueue.add({event:{type:n?y.Play:y.Pause,data:s}}),r){var u=this.file.defaultArtboardViewModel(o);if(null!==u){var c=u.defaultInstance();if(null!==c){var l=new F(c,null);(0,h.createFinalization)(l,l.runtimeInstance),this.bindViewModelInstance(l)}}}}},t.prototype.drawFrame=function(){var t,i;(null===(t=null===document||void 0===document?void 0:document.timeline)||void 0===t?void 0:t.currentTime)?this.loaded&&this.artboard&&!this.frameRequestId&&(this._boundDraw(document.timeline.currentTime),null===(i=this.runtime)||void 0===i||i.resolveAnimationFrame()):this.startRendering()},t.prototype.draw=function(t,i){var e;this.frameRequestId=null;var n=performance.now();this.lastRenderTime||(this.lastRenderTime=t),this.renderSecondTimer+=t-this.lastRenderTime,this.renderSecondTimer>5e3&&(this.renderSecondTimer=0,null==i||i());var r=(t-this.lastRenderTime)/1e3;this.lastRenderTime=t;for(var s=0,o=this.animator.animations.filter((function(t){return t.playing||t.needsScrub})).sort((function(t){return t.needsScrub?-1:1}));s<o.length;s++){var a=o[s];a.advance(r),a.instance.didLoop&&(a.loopCount+=1),a.apply(1)}for(var u=0,c=this.animator.stateMachines.filter((function(t){return t.playing}));u<c.length;u++){var l=c[u],d=l.reportedEventCount();if(d)for(var f=0;f<d;f++){var p=l.reportedEventAt(f);if(p)if(p.type===v.OpenUrl){if(this.eventManager.fire({type:y.RiveEvent,data:p}),this.automaticallyHandleEvents){var g=document.createElement("a"),m=p.url,b=p.target,w=(0,h.sanitizeUrl)(m);m&&g.setAttribute("href",w),b&&g.setAttribute("target",b),w&&w!==h.BLANK_URL&&g.click()}}else this.eventManager.fire({type:y.RiveEvent,data:p})}l.advanceAndApply(r)}0==this.animator.stateMachines.length&&this.artboard.advance(r);var x=this.renderer;x.clear(),x.save(),this.alignRenderer(),this._hasZeroSize||this.artboard.draw(x),x.restore(),x.flush(),this.animator.handleLooping(),this.animator.handleStateChanges(),this.animator.handleAdvancing(r),this.frameCount++;var k=performance.now();for(this.frameTimes.push(k),this.durations.push(k-n);this.frameTimes[0]<=k-1e3;)this.frameTimes.shift(),this.durations.shift();null===(e=this._viewModelInstance)||void 0===e||e.handleCallbacks(),this.animator.isPlaying?this.startRendering():(this.animator.isPaused||this.animator.isStopped)&&(this.lastRenderTime=0)},t.prototype.alignRenderer=function(){var t=this,i=t.runtime,e=t._layout,n=t.artboard;t.renderer.align(e.runtimeFit(i),e.runtimeAlignment(i),{minX:e.minX,minY:e.minY,maxX:e.maxX,maxY:e.maxY},n.bounds,this._devicePixelRatioUsed*e.layoutScaleFactor)},Object.defineProperty(t.prototype,"fps",{get:function(){return this.durations.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"frameTime",{get:function(){return 0===this.durations.length?0:(this.durations.reduce((function(t,i){return t+i}),0)/this.durations.length).toFixed(4)},enumerable:!1,configurable:!0}),t.prototype.cleanup=function(){var t,i;this.destroyed=!0,this.stopRendering(),this.cleanupInstances(),null!==this._observed&&P.remove(this._observed),this.removeRiveListeners(),this.file&&(null===(t=this.riveFile)||void 0===t||t.cleanup(),this.file=null),this.riveFile=null,this.deleteRiveRenderer(),null!==this._audioEventListener&&(I.remove(this._audioEventListener),this._audioEventListener=null),null===(i=this._viewModelInstance)||void 0===i||i.cleanup(),this._viewModelInstance=null,this._dataEnums=null},t.prototype.deleteRiveRenderer=function(){var t;null===(t=this.renderer)||void 0===t||t.delete(),this.renderer=null},t.prototype.cleanupInstances=function(){null!==this.eventCleanup&&this.eventCleanup(),this.stop(),this.artboard&&(this.artboard.delete(),this.artboard=null)},t.prototype.retrieveTextRun=function(t){var i;if(t)if(this.artboard){var e=this.artboard.textRun(t);if(e)return e;console.warn("Could not access a text run with name '".concat(t,"' in the '").concat(null===(i=this.artboard)||void 0===i?void 0:i.name,"' Artboard. Note that you must rename a text run node in the Rive editor to make it queryable at runtime."))}else console.warn("Tried to access text run, but the Artboard is null");else console.warn("No text run name provided")},t.prototype.getTextRunValue=function(t){var i=this.retrieveTextRun(t);return i?i.text:void 0},t.prototype.setTextRunValue=function(t,i){var e=this.retrieveTextRun(t);e&&(e.text=i)},t.prototype.play=function(t,i){var e=this;t=K(t),this.readyForPlaying?(this.animator.play(t),this.eventCleanup&&this.eventCleanup(),this.setupRiveListeners(),this.startRendering()):this.taskQueue.add({action:function(){return e.play(t,i)}})},t.prototype.pause=function(t){var i=this;t=K(t),this.readyForPlaying?(this.eventCleanup&&this.eventCleanup(),this.animator.pause(t)):this.taskQueue.add({action:function(){return i.pause(t)}})},t.prototype.scrub=function(t,i){var e=this;t=K(t),this.readyForPlaying?(this.animator.scrub(t,i||0),this.drawFrame()):this.taskQueue.add({action:function(){return e.scrub(t,i)}})},t.prototype.stop=function(t){var i=this;t=K(t),this.readyForPlaying?(this.animator&&this.animator.stop(t),this.eventCleanup&&this.eventCleanup()):this.taskQueue.add({action:function(){return i.stop(t)}})},t.prototype.reset=function(t){var i,e,n=null==t?void 0:t.artboard,r=K(null==t?void 0:t.animations),s=K(null==t?void 0:t.stateMachines),o=null!==(i=null==t?void 0:t.autoplay)&&void 0!==i&&i,a=null!==(e=null==t?void 0:t.autoBind)&&void 0!==e&&e;this.cleanupInstances(),this.initArtboard(n,r,s,o,a),this.taskQueue.process()},t.prototype.load=function(t){this.file=null,this.stop(),this.init(t)},Object.defineProperty(t.prototype,"layout",{get:function(){return this._layout},set:function(t){this._layout=t,t.maxX&&t.maxY||this.resizeToCanvas(),this.loaded&&!this.animator.isPlaying&&this.drawFrame()},enumerable:!1,configurable:!0}),t.prototype.resizeToCanvas=function(){this._layout=this.layout.copyWith({minX:0,minY:0,maxX:this.canvas.width,maxY:this.canvas.height})},t.prototype.resizeDrawingSurfaceToCanvas=function(t){if(this.canvas instanceof HTMLCanvasElement&&window){var e=this.canvas.getBoundingClientRect(),n=e.width,r=e.height,s=t||window.devicePixelRatio||1;if(this.devicePixelRatioUsed=s,this.canvas.width=s*n,this.canvas.height=s*r,this.resizeToCanvas(),this.drawFrame(),this.layout.fit===i.Layout){var o=this._layout.layoutScaleFactor;this.artboard.width=n/o,this.artboard.height=r/o}}},Object.defineProperty(t.prototype,"source",{get:function(){return this.src},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"activeArtboard",{get:function(){return this.artboard?this.artboard.name:""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"animationNames",{get:function(){if(!this.loaded||!this.artboard)return[];for(var t=[],i=0;i<this.artboard.animationCount();i++)t.push(this.artboard.animationByIndex(i).name);return t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"stateMachineNames",{get:function(){if(!this.loaded||!this.artboard)return[];for(var t=[],i=0;i<this.artboard.stateMachineCount();i++)t.push(this.artboard.stateMachineByIndex(i).name);return t},enumerable:!1,configurable:!0}),t.prototype.stateMachineInputs=function(t){if(this.loaded){var i=this.animator.stateMachines.find((function(i){return i.name===t}));return null==i?void 0:i.inputs}},t.prototype.retrieveInputAtPath=function(t,i){if(t)if(this.artboard){var e=this.artboard.inputByPath(t,i);if(e)return e;console.warn("Could not access an input with name: '".concat(t,"', at path:'").concat(i,"'"))}else console.warn("Tried to access input: '".concat(t,"', at path: '").concat(i,"', but the Artboard is null"));else console.warn("No input name provided for path '".concat(i,"'"))},t.prototype.setBooleanStateAtPath=function(t,i,e){var n=this.retrieveInputAtPath(t,e);n&&(n.type===g.Boolean?n.asBool().value=i:console.warn("Input with name: '".concat(t,"', at path:'").concat(e,"' is not a boolean")))},t.prototype.setNumberStateAtPath=function(t,i,e){var n=this.retrieveInputAtPath(t,e);n&&(n.type===g.Number?n.asNumber().value=i:console.warn("Input with name: '".concat(t,"', at path:'").concat(e,"' is not a number")))},t.prototype.fireStateAtPath=function(t,i){var e=this.retrieveInputAtPath(t,i);e&&(e.type===g.Trigger?e.asTrigger().fire():console.warn("Input with name: '".concat(t,"', at path:'").concat(i,"' is not a trigger")))},t.prototype.retrieveTextAtPath=function(t,i){if(t)if(i)if(this.artboard){var e=this.artboard.textByPath(t,i);if(e)return e;console.warn("Could not access text with name: '".concat(t,"', at path:'").concat(i,"'"))}else console.warn("Tried to access text: '".concat(t,"', at path: '").concat(i,"', but the Artboard is null"));else console.warn("No path provided for text '".concat(t,"'"));else console.warn("No text name provided for path '".concat(i,"'"))},t.prototype.getTextRunValueAtPath=function(t,i){var e=this.retrieveTextAtPath(t,i);if(e)return e.text;console.warn("Could not get text with name: '".concat(t,"', at path:'").concat(i,"'"))},t.prototype.setTextRunValueAtPath=function(t,i,e){var n=this.retrieveTextAtPath(t,e);n?n.text=i:console.warn("Could not set text with name: '".concat(t,"', at path:'").concat(e,"'"))},Object.defineProperty(t.prototype,"playingStateMachineNames",{get:function(){return this.loaded?this.animator.stateMachines.filter((function(t){return t.playing})).map((function(t){return t.name})):[]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"playingAnimationNames",{get:function(){return this.loaded?this.animator.animations.filter((function(t){return t.playing})).map((function(t){return t.name})):[]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pausedAnimationNames",{get:function(){return this.loaded?this.animator.animations.filter((function(t){return!t.playing})).map((function(t){return t.name})):[]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pausedStateMachineNames",{get:function(){return this.loaded?this.animator.stateMachines.filter((function(t){return!t.playing})).map((function(t){return t.name})):[]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isPlaying",{get:function(){return this.animator.isPlaying},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isPaused",{get:function(){return this.animator.isPaused},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isStopped",{get:function(){return this.animator.isStopped},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bounds",{get:function(){return this.artboard?this.artboard.bounds:void 0},enumerable:!1,configurable:!0}),t.prototype.on=function(t,i){this.eventManager.add({type:t,callback:i})},t.prototype.off=function(t,i){this.eventManager.remove({type:t,callback:i})},t.prototype.unsubscribe=function(t,i){console.warn("This function is deprecated: please use `off()` instead."),this.off(t,i)},t.prototype.removeAllRiveEventListeners=function(t){this.eventManager.removeAll(t)},t.prototype.unsubscribeAll=function(t){console.warn("This function is deprecated: please use `removeAllRiveEventListeners()` instead."),this.removeAllRiveEventListeners(t)},t.prototype.stopRendering=function(){this.loaded&&this.frameRequestId&&(this.runtime.cancelAnimationFrame?this.runtime.cancelAnimationFrame(this.frameRequestId):cancelAnimationFrame(this.frameRequestId),this.frameRequestId=null)},t.prototype.startRendering=function(){this.loaded&&this.artboard&&!this.frameRequestId&&(this.frameRequestId=this.runtime.requestAnimationFrame?this.runtime.requestAnimationFrame(this._boundDraw):requestAnimationFrame(this._boundDraw))},t.prototype.enableFPSCounter=function(t){this.runtime.enableFPSCounter(t)},t.prototype.disableFPSCounter=function(){this.runtime.disableFPSCounter()},Object.defineProperty(t.prototype,"contents",{get:function(){if(this.loaded){for(var t={artboards:[]},i=0;i<this.file.artboardCount();i++){for(var e=this.file.artboardByIndex(i),n={name:e.name,animations:[],stateMachines:[]},r=0;r<e.animationCount();r++){var s=e.animationByIndex(r);n.animations.push(s.name)}for(var o=0;o<e.stateMachineCount();o++){for(var a=e.stateMachineByIndex(o),h=a.name,u=new this.runtime.StateMachineInstance(a,e),c=[],l=0;l<u.inputCount();l++){var d=u.input(l);c.push({name:d.name,type:d.type})}n.stateMachines.push({name:h,inputs:c})}t.artboards.push(n)}return t}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"volume",{get:function(){return this.artboard&&this.artboard.volume!==this._volume&&(this._volume=this.artboard.volume),this._volume},set:function(t){this._volume=t,this.artboard&&(this.artboard.volume=t*I.systemVolume)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"artboardWidth",{get:function(){var t;return this.artboard?this.artboard.width:null!==(t=this._artboardWidth)&&void 0!==t?t:0},set:function(t){this._artboardWidth=t,this.artboard&&(this.artboard.width=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"artboardHeight",{get:function(){var t;return this.artboard?this.artboard.height:null!==(t=this._artboardHeight)&&void 0!==t?t:0},set:function(t){this._artboardHeight=t,this.artboard&&(this.artboard.height=t)},enumerable:!1,configurable:!0}),t.prototype.resetArtboardSize=function(){this.artboard?(this.artboard.resetArtboardSize(),this._artboardWidth=this.artboard.width,this._artboardHeight=this.artboard.height):(this._artboardWidth=void 0,this._artboardHeight=void 0)},Object.defineProperty(t.prototype,"devicePixelRatioUsed",{get:function(){return this._devicePixelRatioUsed},set:function(t){this._devicePixelRatioUsed=t},enumerable:!1,configurable:!0}),t.prototype.bindViewModelInstance=function(t){var i;this.artboard&&!this.destroyed&&t&&t.runtimeInstance&&(t.internalIncrementReferenceCount(),null===(i=this._viewModelInstance)||void 0===i||i.cleanup(),this._viewModelInstance=t,this.animator.stateMachines.length>0?this.animator.stateMachines.forEach((function(i){return i.bindViewModelInstance(t)})):this.artboard.bindViewModelInstance(t.runtimeInstance))},Object.defineProperty(t.prototype,"viewModelInstance",{get:function(){return this._viewModelInstance},enumerable:!1,configurable:!0}),t.prototype.viewModelByIndex=function(t){var i=this.file.viewModelByIndex(t);return null!==i?new D(i):null},t.prototype.viewModelByName=function(t){var i=this.file.viewModelByName(t);return null!==i?new D(i):null},t.prototype.enums=function(){if(null===this._dataEnums){var t=this.file.enums();this._dataEnums=t.map((function(t){return new L(t)}))}return this._dataEnums},t.prototype.defaultViewModel=function(){if(this.artboard){var t=this.file.defaultArtboardViewModel(this.artboard);if(t)return new D(t)}return null},t.prototype.getArtboard=function(t){var i,e;return null!==(e=null===(i=this.riveFile)||void 0===i?void 0:i.getArtboard(t))&&void 0!==e?e:null},t.prototype.getBindableArtboard=function(t){var i,e;return null!==(e=null===(i=this.riveFile)||void 0===i?void 0:i.getBindableArtboard(t))&&void 0!==e?e:null},t.prototype.getDefaultBindableArtboard=function(){var t,i;return null!==(i=null===(t=this.riveFile)||void 0===t?void 0:t.getDefaultBindableArtboard())&&void 0!==i?i:null},t.missingErrorMessage="Rive source file or data buffer required",t.cleanupErrorMessage="Attempt to use file after calling cleanup.",t}(),D=function(){function t(t){this._viewModel=t}return Object.defineProperty(t.prototype,"instanceCount",{get:function(){return this._viewModel.instanceCount},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this._viewModel.name},enumerable:!1,configurable:!0}),t.prototype.instanceByIndex=function(t){var i=this._viewModel.instanceByIndex(t);if(null!==i){var e=new F(i,null);return(0,h.createFinalization)(e,i),e}return null},t.prototype.instanceByName=function(t){var i=this._viewModel.instanceByName(t);if(null!==i){var e=new F(i,null);return(0,h.createFinalization)(e,i),e}return null},t.prototype.defaultInstance=function(){var t=this._viewModel.defaultInstance();if(null!==t){var i=new F(t,null);return(0,h.createFinalization)(i,t),i}return null},t.prototype.instance=function(){var t=this._viewModel.instance();if(null!==t){var i=new F(t,null);return(0,h.createFinalization)(i,t),i}return null},Object.defineProperty(t.prototype,"properties",{get:function(){return this._viewModel.getProperties()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"instanceNames",{get:function(){return this._viewModel.getInstanceNames()},enumerable:!1,configurable:!0}),t}(),L=function(){function t(t){this._dataEnum=t}return Object.defineProperty(t.prototype,"name",{get:function(){return this._dataEnum.name},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"values",{get:function(){return this._dataEnum.values},enumerable:!1,configurable:!0}),t}();!function(t){t.Number="number",t.String="string",t.Boolean="boolean",t.Color="color",t.Trigger="trigger",t.Enum="enum",t.List="list",t.Image="image",t.Artboard="artboard"}($||($={}));var F=function(){function t(t,i){this._parents=[],this._children=[],this._viewModelInstances=new Map,this._propertiesWithCallbacks=[],this._referenceCount=0,this.selfUnref=!1,this._runtimeInstance=t,null!==i&&this._parents.push(i)}return Object.defineProperty(t.prototype,"runtimeInstance",{get:function(){return this._runtimeInstance},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nativeInstance",{get:function(){return this._runtimeInstance},enumerable:!1,configurable:!0}),t.prototype.handleCallbacks=function(){0!==this._propertiesWithCallbacks.length&&(this._propertiesWithCallbacks.forEach((function(t){t.handleCallbacks()})),this._propertiesWithCallbacks.forEach((function(t){t.clearChanges()}))),this._children.forEach((function(t){return t.handleCallbacks()}))},t.prototype.addParent=function(t){this._parents.includes(t)||(this._parents.push(t),(this._propertiesWithCallbacks.length>0||this._children.length>0)&&t.addToViewModelCallbacks(this))},t.prototype.removeParent=function(t){var i=this._parents.indexOf(t);-1!==i&&(this._parents[i].removeFromViewModelCallbacks(this),this._parents.splice(i,1))},t.prototype.addToPropertyCallbacks=function(t){var i=this;this._propertiesWithCallbacks.includes(t)||(this._propertiesWithCallbacks.push(t),this._propertiesWithCallbacks.length>0&&this._parents.forEach((function(t){t.addToViewModelCallbacks(i)})))},t.prototype.removeFromPropertyCallbacks=function(t){var i=this;this._propertiesWithCallbacks.includes(t)&&(this._propertiesWithCallbacks=this._propertiesWithCallbacks.filter((function(i){return i!==t})),0===this._children.length&&0===this._propertiesWithCallbacks.length&&this._parents.forEach((function(t){t.removeFromViewModelCallbacks(i)})))},t.prototype.addToViewModelCallbacks=function(t){var i=this;this._children.includes(t)||(this._children.push(t),this._parents.forEach((function(t){t.addToViewModelCallbacks(i)})))},t.prototype.removeFromViewModelCallbacks=function(t){var i=this;this._children.includes(t)&&(this._children=this._children.filter((function(i){return i!==t})),0===this._children.length&&0===this._propertiesWithCallbacks.length&&this._parents.forEach((function(t){t.removeFromViewModelCallbacks(i)})))},t.prototype.clearCallbacks=function(){this._propertiesWithCallbacks.forEach((function(t){t.clearCallbacks()}))},t.prototype.propertyFromPath=function(t,i){var e=t.split("/");return this.propertyFromPathSegments(e,0,i)},t.prototype.viewModelFromPathSegments=function(t,i){var e=this.internalViewModelInstance(t[i]);return null!==e?i==t.length-1?e:e.viewModelFromPathSegments(t,i++):null},t.prototype.propertyFromPathSegments=function(t,i,e){var n,r,s,o,a,h,u,c,l,d,f,p,g,m,b,v,w,y;if(i<t.length-1){var x=this.internalViewModelInstance(t[i]);return null!==x?x.propertyFromPathSegments(t,i+1,e):null}var k=null;switch(e){case $.Number:if(null!==(k=null!==(r=null===(n=this._runtimeInstance)||void 0===n?void 0:n.number(t[i]))&&void 0!==r?r:null))return new N(k,this);break;case $.String:if(null!==(k=null!==(o=null===(s=this._runtimeInstance)||void 0===s?void 0:s.string(t[i]))&&void 0!==o?o:null))return new B(k,this);break;case $.Boolean:if(null!==(k=null!==(h=null===(a=this._runtimeInstance)||void 0===a?void 0:a.boolean(t[i]))&&void 0!==h?h:null))return new U(k,this);break;case $.Color:if(null!==(k=null!==(c=null===(u=this._runtimeInstance)||void 0===u?void 0:u.color(t[i]))&&void 0!==c?c:null))return new V(k,this);break;case $.Trigger:if(null!==(k=null!==(d=null===(l=this._runtimeInstance)||void 0===l?void 0:l.trigger(t[i]))&&void 0!==d?d:null))return new H(k,this);break;case $.Enum:if(null!==(k=null!==(p=null===(f=this._runtimeInstance)||void 0===f?void 0:f.enum(t[i]))&&void 0!==p?p:null))return new q(k,this);break;case $.List:if(null!==(k=null!==(m=null===(g=this._runtimeInstance)||void 0===g?void 0:g.list(t[i]))&&void 0!==m?m:null))return new X(k,this);break;case $.Image:if(null!==(k=null!==(v=null===(b=this._runtimeInstance)||void 0===b?void 0:b.image(t[i]))&&void 0!==v?v:null))return new G(k,this);break;case $.Artboard:if(null!==(k=null!==(y=null===(w=this._runtimeInstance)||void 0===w?void 0:w.artboard(t[i]))&&void 0!==y?y:null))return new Y(k,this)}return null},t.prototype.internalViewModelInstance=function(i){var e;if(this._viewModelInstances.has(i))return this._viewModelInstances.get(i);var n=null===(e=this._runtimeInstance)||void 0===e?void 0:e.viewModel(i);if(null!==n){var r=new t(n,this);return(0,h.createFinalization)(r,n),r.internalIncrementReferenceCount(),this._viewModelInstances.set(i,r),r}return null},t.prototype.number=function(t){return this.propertyFromPath(t,$.Number)},t.prototype.string=function(t){return this.propertyFromPath(t,$.String)},t.prototype.boolean=function(t){return this.propertyFromPath(t,$.Boolean)},t.prototype.color=function(t){return this.propertyFromPath(t,$.Color)},t.prototype.trigger=function(t){return this.propertyFromPath(t,$.Trigger)},t.prototype.enum=function(t){return this.propertyFromPath(t,$.Enum)},t.prototype.list=function(t){return this.propertyFromPath(t,$.List)},t.prototype.image=function(t){return this.propertyFromPath(t,$.Image)},t.prototype.artboard=function(t){return this.propertyFromPath(t,$.Artboard)},t.prototype.viewModel=function(t){var i=t.split("/"),e=i.length>1?this.viewModelFromPathSegments(i.slice(0,i.length-1),0):this;return null!=e?e.internalViewModelInstance(i[i.length-1]):null},t.prototype.internalReplaceViewModel=function(t,i){var e;if(null!==i.runtimeInstance){var n=(null===(e=this._runtimeInstance)||void 0===e?void 0:e.replaceViewModel(t,i.runtimeInstance))||!1;if(n){i.internalIncrementReferenceCount();var r=this.internalViewModelInstance(t);null!==r&&(r.removeParent(this),this._children.includes(r)&&(this._children=this._children.filter((function(t){return t!==r}))),r.cleanup()),this._viewModelInstances.set(t,i),i.addParent(this)}return n}return!1},t.prototype.replaceViewModel=function(t,i){var e,n=t.split("/"),r=n.length>1?this.viewModelFromPathSegments(n.slice(0,n.length-1),0):this;return null!==(e=null==r?void 0:r.internalReplaceViewModel(n[n.length-1],i))&&void 0!==e&&e},t.prototype.incrementReferenceCount=function(){var t;this._referenceCount++,null===(t=this._runtimeInstance)||void 0===t||t.incrementReferenceCount()},t.prototype.decrementReferenceCount=function(){var t;this._referenceCount--,null===(t=this._runtimeInstance)||void 0===t||t.decrementReferenceCount()},Object.defineProperty(t.prototype,"properties",{get:function(){var t;return(null===(t=this._runtimeInstance)||void 0===t?void 0:t.getProperties().map((function(t){return c({},t)})))||[]},enumerable:!1,configurable:!0}),t.prototype.internalIncrementReferenceCount=function(){this._referenceCount++},t.prototype.cleanup=function(){var t,i=this;if(this._referenceCount--,this._referenceCount<=0){this.selfUnref&&(null===(t=this._runtimeInstance)||void 0===t||t.unref()),this._runtimeInstance=null,this.clearCallbacks(),this._propertiesWithCallbacks=[],this._viewModelInstances.forEach((function(t){t.cleanup()})),this._viewModelInstances.clear();var e=f([],this._children,!0);this._children.length=0;var n=f([],this._parents,!0);this._parents.length=0,e.forEach((function(t){t.removeParent(i)})),n.forEach((function(t){t.removeFromViewModelCallbacks(i)}))}},t}(),R=function(){function t(t,i){this.callbacks=[],this._viewModelInstanceValue=t,this._parentViewModel=i}return t.prototype.on=function(t){0===this.callbacks.length&&this._viewModelInstanceValue.clearChanges(),this.callbacks.includes(t)||(this.callbacks.push(t),this._parentViewModel.addToPropertyCallbacks(this))},t.prototype.off=function(t){t?this.callbacks=this.callbacks.filter((function(i){return i!==t})):this.callbacks.length=0,0===this.callbacks.length&&this._parentViewModel.removeFromPropertyCallbacks(this)},t.prototype.internalHandleCallback=function(){},t.prototype.handleCallbacks=function(){var t=this;this._viewModelInstanceValue.hasChanged&&this.callbacks.forEach((function(i){t.internalHandleCallback(i)}))},t.prototype.clearChanges=function(){this._viewModelInstanceValue.clearChanges()},t.prototype.clearCallbacks=function(){this.callbacks.length=0},Object.defineProperty(t.prototype,"name",{get:function(){return this._viewModelInstanceValue.name},enumerable:!1,configurable:!0}),t}(),B=function(t){function i(i,e){return t.call(this,i,e)||this}return u(i,t),Object.defineProperty(i.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(t){this._viewModelInstanceValue.value=t},enumerable:!1,configurable:!0}),i.prototype.internalHandleCallback=function(t){t(this.value)},i}(R),N=function(t){function i(i,e){return t.call(this,i,e)||this}return u(i,t),Object.defineProperty(i.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(t){this._viewModelInstanceValue.value=t},enumerable:!1,configurable:!0}),i.prototype.internalHandleCallback=function(t){t(this.value)},i}(R),U=function(t){function i(i,e){return t.call(this,i,e)||this}return u(i,t),Object.defineProperty(i.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(t){this._viewModelInstanceValue.value=t},enumerable:!1,configurable:!0}),i.prototype.internalHandleCallback=function(t){t(this.value)},i}(R),H=function(t){function i(i,e){return t.call(this,i,e)||this}return u(i,t),i.prototype.trigger=function(){return this._viewModelInstanceValue.trigger()},i.prototype.internalHandleCallback=function(t){t()},i}(R),q=function(t){function i(i,e){return t.call(this,i,e)||this}return u(i,t),Object.defineProperty(i.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(t){this._viewModelInstanceValue.value=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"valueIndex",{get:function(){return this._viewModelInstanceValue.valueIndex},set:function(t){this._viewModelInstanceValue.valueIndex=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"values",{get:function(){return this._viewModelInstanceValue.values},enumerable:!1,configurable:!0}),i.prototype.internalHandleCallback=function(t){t(this.value)},i}(R),X=function(t){function i(i,e){return t.call(this,i,e)||this}return u(i,t),Object.defineProperty(i.prototype,"length",{get:function(){return this._viewModelInstanceValue.size},enumerable:!1,configurable:!0}),i.prototype.addInstance=function(t){null!=t.runtimeInstance&&(this._viewModelInstanceValue.addInstance(t.runtimeInstance),t.addParent(this._parentViewModel))},i.prototype.addInstanceAt=function(t,i){return!(null==t.runtimeInstance||!this._viewModelInstanceValue.addInstanceAt(t.runtimeInstance,i)||(t.addParent(this._parentViewModel),0))},i.prototype.removeInstance=function(t){null!=t.runtimeInstance&&(this._viewModelInstanceValue.removeInstance(t.runtimeInstance),t.removeParent(this._parentViewModel))},i.prototype.removeInstanceAt=function(t){this._viewModelInstanceValue.removeInstanceAt(t)},i.prototype.instanceAt=function(t){var i=this._viewModelInstanceValue.instanceAt(t);if(null!=i){var e=new F(i,this._parentViewModel);return(0,h.createFinalization)(e,i),e}return null},i.prototype.swap=function(t,i){this._viewModelInstanceValue.swap(t,i)},i.prototype.internalHandleCallback=function(t){t()},i}(R),V=function(t){function i(i,e){return t.call(this,i,e)||this}return u(i,t),Object.defineProperty(i.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(t){this._viewModelInstanceValue.value=t},enumerable:!1,configurable:!0}),i.prototype.rgb=function(t,i,e){this._viewModelInstanceValue.rgb(t,i,e)},i.prototype.rgba=function(t,i,e,n){this._viewModelInstanceValue.argb(n,t,i,e)},i.prototype.argb=function(t,i,e,n){this._viewModelInstanceValue.argb(t,i,e,n)},i.prototype.alpha=function(t){this._viewModelInstanceValue.alpha(t)},i.prototype.opacity=function(t){this._viewModelInstanceValue.alpha(Math.round(255*Math.max(0,Math.min(1,t))))},i.prototype.internalHandleCallback=function(t){t(this.value)},i}(R),G=function(t){function i(i,e){return t.call(this,i,e)||this}return u(i,t),Object.defineProperty(i.prototype,"value",{set:function(t){var i;this._viewModelInstanceValue.value(null!==(i=null==t?void 0:t.nativeImage)&&void 0!==i?i:null)},enumerable:!1,configurable:!0}),i.prototype.internalHandleCallback=function(t){t()},i}(R),Y=function(t){function i(i,e){return t.call(this,i,e)||this}return u(i,t),Object.defineProperty(i.prototype,"value",{set:function(t){var i,e;e=t.isBindableArtboard?t:t.file.internalBindableArtboardFromArtboard(t.nativeArtboard),this._viewModelInstanceValue.value(null!==(i=null==e?void 0:e.nativeArtboard)&&void 0!==i?i:null)},enumerable:!1,configurable:!0}),i.prototype.internalHandleCallback=function(t){t()},i}(R),Z=function(t){return l(void 0,void 0,void 0,(function(){var i;return d(this,(function(e){switch(e.label){case 0:return i=new Request(t),[4,fetch(i)];case 1:return[4,e.sent().arrayBuffer()];case 2:return[2,e.sent()]}}))}))},K=function(t){return"string"==typeof t?[t]:t instanceof Array?t:[]},J={EventManager:O,TaskQueueManager:C},Q=function(t){return l(void 0,void 0,void 0,(function(){var i,e;return d(this,(function(n){switch(n.label){case 0:return[4,new Promise((function(i){return b.getInstance((function(e){e.decodeAudio(t,i)}))}))];case 1:return i=n.sent(),e=new h.AudioWrapper(i),h.finalizationRegistry.register(e,i),[2,e]}}))}))},tt=function(t){return l(void 0,void 0,void 0,(function(){var i,e;return d(this,(function(n){switch(n.label){case 0:return[4,new Promise((function(i){return b.getInstance((function(e){e.decodeImage(t,i)}))}))];case 1:return i=n.sent(),e=new h.ImageWrapper(i),h.finalizationRegistry.register(e,i),[2,e]}}))}))},it=function(t){return l(void 0,void 0,void 0,(function(){var i,e;return d(this,(function(n){switch(n.label){case 0:return[4,new Promise((function(i){return b.getInstance((function(e){e.decodeFont(t,i)}))}))];case 1:return i=n.sent(),e=new h.FontWrapper(i),h.finalizationRegistry.register(e,i),[2,e]}}))}))}})(),n})(),at.exports=ot());const ut=class{constructor(i){t(this,i),this.id="",this.value="",this.height="",this.width="auto",this.ariaLabel="",this.ariaHidden="",this.x="0px",this.y="0px",this.z="0",this.bgColor="",this.type="",this.tabIndex=0,this.visible=!1,this.audio="",this.src="",this.onTouch="",this.onInCorrect="",this.onCorrect="",this.onEntry="",this.delayVisible="",this.initializeRive=t=>{const i=o.getInstance(),e=this.el.querySelector("canvas");this.riveInstance=new ht.Rive({src:t,canvas:e,stateMachines:"Idle",autoplay:!0,onLoad:()=>{this.riveInstance.resizeDrawingSurfaceToCanvas(),i.setRiveInstance(this.riveInstance)}})}}async componentDidLoad(){ht.RuntimeLoader.setWasmUrl(ut.RIVE_WASM_URL),a(this.el,this.delayVisible),h(this.el,this.type),this.initializeRive(u(this.src))}render(){return i(e,{key:"14599bbd626e766d35b9611f80dd401ee76717b4",id:this.id,type:this.type,"tab-index":this.tabIndex,value:this.value,style:{height:this.height,width:this.width,backgroundColor:this.bgColor,top:this.y,left:this.x,display:this.visible?"flex":"none",zIndex:this.z},"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,audio:this.audio,onTouch:this.onTouch,onCorrect:this.onCorrect,onInCorrect:this.onInCorrect,onEntry:this.onEntry,src:this.src},i("canvas",{key:"6f128e61bee6797c0cf83c15b3fd3ba4d1d7b1ea",class:"lido-canvas"}))}static get assetsDirs(){return["."]}get el(){return n(this)}};ut.RIVE_WASM_URL="https://unpkg.com/@rive-app/canvas@2.32.0/rive.wasm",ut.style=".lido-canvas{height:100%;width:100%}";const ct=class{constructor(i){t(this,i),this.pivotimage="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/balancing/Display%20stand.svg",this.scaleimage="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/balancing/Bar.svg",this.handlerimage="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/balancing/Stands.svg",this.fill="brown",this.tilt=0,this.maxTilt=9.5,this.onEntry="",this.height="auto",this.width="auto",this.x="0px",this.y="0px",this.z="0",this.visible=!1,this.margin="",this.padding="",this.balanceSymbol="=",this.showSymbol=!1,this.operation="count",this.pivotSvg="",this.scaleSvg="",this.handlerSvg="",this.style={},this.tiltf=0,this.leftVal=0,this.rightVal=0,this.currentAngle=0}async revealSymbol(){this.showSymbol=!0}async hideSymbol(){this.showSymbol=!1}async componentWillLoad(){this.updateStyles(),this.pivotSvg=await this.fetchAndApplyFill(u(this.pivotimage)),this.scaleSvg=await this.fetchAndApplyFill(u(this.scaleimage)),this.handlerSvg=await this.fetchAndApplyFill(u(this.handlerimage))}componentDidLoad(){this.animateBalance(),this.leftParentEl=document.getElementById("leftparent"),this.rightParentEl=document.getElementById("rightparent"),h(this.el)}disconnectedCallback(){null!=this.animationFrameId&&cancelAnimationFrame(this.animationFrameId)}async fetchAndApplyFill(t){try{const i=await fetch(t);if(!i.ok)return"";let e=await i.text();return e=e.replace(/fill="[^"]*"/g,""),e=e.replace(/stroke="[^"]*"/g,""),e=e.replace(/<svg([^>]*)>/,`<svg$1 fill="${this.fill}" stroke="${this.fill}">`),e}catch(t){return console.error("SVG fetch failed:",t),""}}tiltChanged(t){this.tiltf=t}async updateTilt(t,i){const e=Math.max(-5,Math.min(5,i-t));await new Promise((t=>setTimeout(t,350))),this.tiltf=e}animateBalance(){const t=()=>{let i=this.tiltf/5*this.maxTilt;if(i>this.maxTilt&&(i=this.maxTilt),i<-this.maxTilt&&(i=-this.maxTilt),this.currentAngle+=.1*(i-this.currentAngle),this.currentAngle>this.maxTilt&&(this.currentAngle=this.maxTilt),this.currentAngle<-this.maxTilt&&(this.currentAngle=-this.maxTilt),this.scaleEl&&(this.scaleEl.style.transform=`rotate(${this.currentAngle}deg)`,this.scaleEl.style.transformOrigin="50% 80%"),this.leftParentEl&&this.rightParentEl){const t=window.innerHeight>window.innerWidth,i=this.currentAngle/this.maxTilt*(t?40:60);this.leftParentEl.style.transform=`translateY(${-i}px)`,this.rightParentEl.style.transform=`translateY(${i}px)`}if(this.leftHandleEl&&this.rightHandleEl){const t=window.innerHeight>window.innerWidth,i=this.currentAngle/this.maxTilt*(t?40:60);this.leftHandleEl.style.transform=`translateY(${-i}px)`,this.rightHandleEl.style.transform=`translateY(${i}px)`}this.animationFrameId=requestAnimationFrame(t)};t()}updateStyles(){const t=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:c(this.height,t),width:c(this.width,t),top:c(this.y,t),left:c(this.x,t),zIndex:this.z,display:"true"===c(`${this.visible}`,t)?"flex":"none",margin:c(this.margin,t),padding:c(this.padding,t)}}render(){return i(e,{key:"2d7a59cde91392b0e19efb592a81e6aa9466654d",id:"lido-balance","bg-color":"red",onEntry:this.onEntry,class:"lido-balance",tilt:this.tilt.toString(),style:this.style,operation:this.operation.toString(),"pivot-image":this.pivotSvg,"scale-image":this.scaleSvg,"handler-image":this.handlerSvg},i("div",{key:"7048f924b6f45de2023f28e19c486810e109d94e",innerHTML:this.pivotSvg,id:"pivotimg",class:"pivot"}),i("div",{key:"05c1ab110c0c4ca918fa452b5d0cfbe57d3e6a1a",innerHTML:this.scaleSvg,id:"scaleimg",class:"scale",ref:t=>this.scaleEl=t}),i("div",{key:"5db42befb11d6505a6167d93e8e9015d65dc0f8a",innerHTML:this.handlerSvg,id:"handlerimg",class:"handler",ref:t=>this.leftHandleEl=t}),i("div",{key:"bce64e72aeaf1a99d6ef381da369d393f300e025",innerHTML:this.handlerSvg,id:"handimg",class:"hand",ref:t=>this.rightHandleEl=t}),i("div",{key:"ee8b45ff347a6421169c9c7fce66b9079e930424",id:"balanceSymbol",class:"lido-balance-symbol","aria-hidden":!this.showSymbol},this.showSymbol?this.balanceSymbol:""))}get el(){return n(this)}static get watchers(){return{tilt:[{tiltChanged:0}]}}};ct.style='#lido-balance{position:relative;height:500px;width:1205px;top:20%;left:-91px;z-index:0}.lido-balance-symbol{position:absolute;top:64%;left:50%;transform:translate(-50%, -50%);font-size:5vw;font-weight:bold;color:black;pointer-events:none;z-index:999}@media (orientation: portrait){.lido-balance-shadow{height:100px;position:absolute;top:80%;left:28%}}@media (orientation: landscape){.lido-balance-shadow{height:100px;position:absolute;top:90%;left:33%}}@media (orientation: portrait){#pivotimg{position:absolute;height:auto;width:23%;bottom:18%;left:38%;z-index:100}}#pivotimg::after{content:"";position:absolute;bottom:-30px;left:50%;transform:translateX(-50%);width:120%;height:60px;background-image:url("https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/balancing/Shadow.svg");background-size:contain;background-repeat:no-repeat;background-position:center;pointer-events:none;z-index:10}@media (orientation: landscape){#pivotimg{position:absolute;height:auto;width:23%;bottom:8%;left:38%;z-index:100}}.lido-balance .pivot svg{width:100%;height:auto}#scaleimg{position:absolute;width:73%;height:auto;top:61%;left:14%;z-index:90}.lido-balance .scale svg{width:100%;height:auto}@media (orientation: landscape){#handlerimg{position:absolute;width:35%;height:auto;top:49%;left:2%}}@media (orientation:portrait ){#handlerimg{position:absolute;width:35%;height:auto;top:53%;left:2%}}.lido-balance .handler svg{width:100%;height:auto;fill:brown}@media (orientation: landscape){#handimg{position:absolute;width:35%;height:auto;top:49%;right:2%}}@media (orientation:portrait){#handimg{position:absolute;width:35%;height:auto;top:53%;right:2%}}.lido-balance .hand svg{width:100%;height:auto;fill:brown}.pivot svg path:nth-of-type(1){fill:brown}.pivot svg path[d^="M78.9414"]{fill:white}';const lt=class{constructor(i){t(this,i),this.onOk=r(this,"onOk"),this.width="479px",this.visible=!1,this.height="711px",this.objective="",this.onEntry="",this.x="0px",this.y="0px",this.bgColor="#60DADA",this.penIcon="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/calculator/penIcon.png",this.displayValue="",this.style={},this.userAnswers=[],this.tempInputs=[]}updateValueAttr(){this.el.setAttribute("value",this.displayValue)}componentWillLoad(){if(!this.objective){const t=this.el.closest("lido-container");t&&(this.objective=(t.getAttribute("objective")||"").replace("=","").trim())}this.updateValueAttr()}handleClick(t){"OK"===t?this.verifyAnswer():"←"===t?this.displayValue=this.displayValue.slice(0,-1):this.displayValue.length<8&&(this.displayValue+=t),this.updateValueAttr()}async verifyAnswer(){var t;const i=this.displayValue.trim();if(!i)return;let e=!1;const n=this.el.closest("lido-container");if(!n)return;if(this.objective&&""!=this.objective&&!this.objective.includes(","))e=Number(i)===Number(this.objective);else if(this.objective&&this.objective.includes(",")){const t="true"===n.getAttribute("is-continue-on-correct"),r=this.objective.split(",").map((t=>t.trim())),s=this.userAnswers.length;s<r.length&&Number(i)===Number(r[s])&&(e=!0),t?e&&this.userAnswers.push(Number(i)):this.userAnswers.push(Number(i))}else if(""===this.objective){const t=n.getAttribute("equationCheck")||"";if(!t)return;try{const n=l(t);e=Number(n)===Number(i.trim())}catch(t){console.error("Error evaluating equation:",t),e=!1}}this.onOk.emit(e);const r=document.getElementById("btn-11");if(e){const s="nimbleTable"===n.getAttribute("template-id"),o=this.objective.includes(",");s&&o||n.setAttribute("game-completed","true"),this.tempInputs.push(i);const a=JSON.parse(null!==(t=n.getAttribute(d))&&void 0!==t?t:"[]"),h=Array.isArray(a)?a.filter((t=>""!==String(t).trim())):[],u=this.tempInputs[this.tempInputs.length-1];if(""!==String(u).trim()&&h.push(u),n.setAttribute(d,JSON.stringify(h)),r.style.pointerEvents="none",this.displayValue="",f(e,v),s&&o){const t=n.querySelector("[type='calculate']");t&&(t.getAttribute("audio")||"").trim()&&(t.style.boxShadow="none !important",t.setAttribute("onCorrect","this.speak='true'"),p.getI().play(t))}const c=(null==n?void 0:n.getAttribute("onCorrect"))||"";if(await g(c,n),!c.includes("scrollCellAfterEquationSolved"))if(o){const t=this.objective.split(",").map((t=>t.trim()));this.userAnswers.length>=t.length&&(n.setAttribute("game-completed","true"),m(),b())}else m(),b()}else{r.style.pointerEvents="none",this.displayValue="",f(e,v);const t=(null==n?void 0:n.getAttribute("onInCorrect"))||"",i=(null==n?void 0:n.getAttribute("onCorrect"))||"",s="true"===n.getAttribute("is-continue-on-correct");s?await g(t,n):await g(i,n),s||(n.setAttribute("game-completed","true"),m(),b())}r.style.pointerEvents="auto"}render(){return i(e,{key:"63cfc3e353a89b76ad809a921cc7b51ce6d06e93",onEntry:this.onEntry,id:"lidoCalculator",style:{width:this.width,height:this.height,backgroundColor:this.bgColor,left:this.x,top:this.y}},i("lido-cell",{key:"66cc572079209533f8fd4f6c4ca76fdb9435b3b8",visible:"true",height:"94px",width:"60px"},i("lido-text",{key:"aca3392da8c74ab136268296f2ff584bf5cacd61",visible:"true",id:"lido-calculator-penIcon",type:"click",height:"80px",x:"204%",width:"89px",onEntry:"this.position='relative';",class:"top-icon"},i("img",{key:"46275d788f7bb3132e657d4902d4471cc7928b39",src:u(this.penIcon),alt:"pen",style:{width:"100%",height:"100%"}}))),i("div",{key:"5adb6fbdefa7d9d8c4bd2ada68f580c8c1af298e",class:"lido-calculator-displayParent"},i("div",{key:"cca5a9c232f9d4dfa31e193e8d9eaddcd83a5052",class:"lido-calculator-display"},this.displayValue)),i("div",{key:"64b70b100e8165dfe6d0dd9522b0362f12856a9e",class:"lido-calculator-buttons"},["1","2","3","4","5","6","7","8","9","←","0","OK"].map(((t,e)=>i("lido-text",{id:`btn-${e}`,string:t,visible:"true",type:"click",class:{"lido-calculator-btn-special":"←"===t||"OK"===t,"lido-calculator-btn-default":"←"!==t&&"OK"!==t},onClick:()=>this.handleClick(t)})))))}get el(){return n(this)}};lt.style="#lidoCalculator{border-radius:19px;border:5px solid #029A9A;position:relative;display:flex;flex-direction:column;padding:2%;box-sizing:border-box}.lido-calculator-btn-special{--btn-bg-color:#014D4D !important;background-color:#014D4D !important;--btn-shadow-color:#0a2f2f !important}.lido-calculator-btn-default{--btn-bg-color:#029A9A !important;background-color:#029A9A !important;color:#000;--btn-shadow-color:#0f4242 !important}#lido-calculator-penIcon{--btn-bg-color:#FB7038 !important;--btn-shadow-px:0 8px 0 !important;--btn-shadow-color:#D74B12 !important;border-radius:5px !important}.lido-calculator-displayParent{width:89%;height:107px;background-color:rgb(68, 186, 186);border-radius:5px;margin:14px auto 17px auto;overflow:hidden;display:flex;align-items:end}.lido-calculator-display{width:97%;height:94px;background:#029A9A;color:#fff;text-align:right;display:flex;justify-content:flex-end;align-items:center;font-size:72px;font-weight:700;font-family:'Baloo Bhai 2', serif;border-radius:5px 0px 0px 5px;box-sizing:border-box;margin:0 0px -6px auto}.lido-calculator-buttons{flex:1;display:grid;grid-template-columns:repeat(3, 1fr);grid-auto-rows:1fr;gap:0%;width:100%;justify-items:center;align-items:center;position:relative;top:-1%}.lido-calculator-buttons lido-text{display:flex !important;justify-content:center;align-items:center;width:100px !important;height:88px !important;font-size:80px !important;font-weight:700 !important;color:#fff;border-radius:5px !important;cursor:pointer;text-align:center;line-height:1;box-sizing:border-box;transition:transform 0.1s}.lido-calculator-buttons lido-text:active{transform:scale(0.95)}";const dt=class{constructor(i){t(this,i),this.width="800px",this.height="700px",this.visible=!1,this.z="0",this.x="0px",this.y="0px",this.onEntry="",this.drawing=!1,this.style={},this.handleWindowPointerUp=()=>this.stop(),this.handleWindowResize=()=>this.updateStyles()}updateStyles(){const t=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={width:c(this.width,t),height:c(this.height,t),left:c(this.x,t),top:c(this.y,t),zIndex:this.z,display:"true"===c(`${this.visible}`,t)?"block":"none",position:"absolute"},this.canvas&&(this.canvas.width=parseInt(c(this.width,t)),this.canvas.height=parseInt(c(this.height,t)),this.ctx.strokeStyle="#000",this.ctx.lineWidth=10,this.ctx.lineCap="round",this.ctx.lineJoin="round")}componentDidLoad(){this.canvas=this.el.shadowRoot.querySelector("#lido-canvas"),this.ctx=this.canvas.getContext("2d"),this.ctx.strokeStyle="#000",this.ctx.lineWidth=10,this.ctx.lineCap="round",this.ctx.lineJoin="round",this.updateStyles(),this.canvas.addEventListener("pointerdown",(t=>this.start(t))),this.canvas.addEventListener("pointermove",(t=>this.move(t))),window.addEventListener("pointerup",this.handleWindowPointerUp),window.addEventListener("resize",this.handleWindowResize)}disconnectedCallback(){window.removeEventListener("pointerup",this.handleWindowPointerUp),window.removeEventListener("resize",this.handleWindowResize)}loadBackground(){if(!this.bgImage)return this.ctx.fillStyle="#fff",void this.ctx.fillRect(0,0,this.canvas.width,this.canvas.height);const t=new Image;t.crossOrigin="anonymous",t.src=this.bgImage,t.onload=()=>{this.ctx.drawImage(t,0,0,this.canvas.width,this.canvas.height)}}getPos(t){const i=this.canvas.getBoundingClientRect();return{x:this.canvas.width/i.width*(t.clientX-i.left),y:this.canvas.height/i.height*(t.clientY-i.top)}}start(t){this.drawing=!0;const i=this.getPos(t);this.ctx.beginPath(),this.ctx.moveTo(i.x,i.y)}move(t){if(!this.drawing)return;const i=this.getPos(t);this.ctx.lineTo(i.x,i.y),this.ctx.stroke()}stop(){this.drawing=!1,this.ctx.closePath()}clearCanvas(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height)}render(){return i(e,{key:"6bb47f06656ce667d23236e9f3c3a8f383885a43",id:"lido-canvas",class:"lido-canvas",style:this.style},i("button",{key:"fd0d1217bda63071fbf6496c2538c2a944b14181",id:"lido-exit-button",onClick:()=>this.clearCanvas()}),i("canvas",{key:"ed0333972bb7ce0fc4e14c81bb466ea895ce65e0",id:"lido-canvas"}))}get el(){return n(this)}};dt.style=":host{box-sizing:border-box}.lido-canvas{background:transparent;border:none;border-radius:0;overflow:hidden;box-sizing:border-box}#lido-exit-button{padding:6px 14px;border:none;background:transparent;color:#fff;border-radius:6px;cursor:pointer;font-size:14px;position:absolute;top:0;right:0;z-index:15}canvas{touch-action:none;display:block;width:100%;height:100%;z-index:10}";const ft=class{constructor(i){t(this,i),this.showSpeakIcon=!1,this.scrollbarWidth="",this.id="",this.value="",this.height="auto",this.width="auto",this.ariaLabel="",this.ariaHidden="",this.x="0px",this.y="0px",this.z="0",this.gap="0",this.bgColor="",this.type="",this.tabIndex=0,this.visible="false",this.audio="",this.onTouch="",this.onInCorrect="",this.onCorrect="",this.onEntry="",this.childElementsLength=9999,this.minLength=0,this.maxLength=9999,this.layout="wrap",this.minDrops=1,this.maxDrops=1,this.margin="",this.padding="",this.alignItems="",this.borderRadius="0px",this.flexDirection="",this.style={},this.handleWindowResize=()=>this.updateStyles(),this.handleWindowLoad=()=>this.updateStyles(),this.delayVisible="",this.disableSpeak=!1}componentDidLoad(){a(this.el,this.delayVisible),h(this.el,this.type),w(this.el,this.minLength,this.maxLength,this.childElementsLength),setTimeout((()=>{const t=this.el.className.includes("lido-random")?this.el:null;if(t){const i=t.parentElement;if(!i)return;const e=i.offsetWidth,n=i.offsetHeight;Array.from(t.children).forEach((t=>{const i=e-t.offsetWidth,r=n-t.offsetHeight,s=Math.random()*i,o=Math.random()*r;t.style.position="absolute",t.style.left=`${s}px`,t.style.top=`${o}px`}))}}),50),this.showSpeakIcon&&y(this.el)}componentWillLoad(){this.updateStyles(),window.addEventListener("resize",this.handleWindowResize),window.addEventListener("load",this.handleWindowLoad)}disconnectedCallback(){window.removeEventListener("resize",this.handleWindowResize),window.removeEventListener("load",this.handleWindowLoad)}updateStyles(){const t=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:c(this.height,t),width:c(this.width,t),backgroundColor:c(this.bgColor,t),top:c(this.y,t),left:c(this.x,t),zIndex:this.z,margin:c(this.margin,t),padding:c(this.padding,t),borderRadius:c(this.borderRadius,t),gap:c(this.gap,t),"--scrollbar-width":c(this.scrollbarWidth||"0px",t),display:JSON.parse(c(`${this.visible}`,t))?"wrap"===c(this.layout,t)?"grid":"pos"===c(this.layout,t)||"random"===c(this.layout,t)?"block":"flex":"none",flexDirection:this.flexDirection?c(this.flexDirection,t):"",alignItems:this.alignItems?c(this.alignItems,t):""},this.el.className=`lido-${c(this.layout,t)}`}render(){return i(e,{key:"73bdf9dd33fdd8322c35465de011697da112193a",id:this.id,class:"lido-cell",value:this.value,type:this.type,"tab-index":this.tabIndex,style:this.style,minDrops:this.minDrops,maxDrops:this.maxDrops,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,audio:this.audio,onTouch:this.onTouch,onCorrect:this.onCorrect,onInCorrect:this.onInCorrect,onEntry:this.onEntry,"flex-direction":this.flexDirection,"disable-speak":this.disableSpeak},i("slot",{key:"6e9d4507b36716f04853d39ef66015441782aa88"}))}get el(){return n(this)}};ft.style=".lido-col{top:var(--y, 0);left:var(--x, 0);height:var(--height, 100%);width:var(--width, 100%);background-color:var(--bgColor, #eeeeee);padding:15px;border-radius:10px;display:flex;justify-content:space-around;flex-direction:column;align-items:center}.lido-col>*{}.lido-row{display:flex;justify-content:space-around;align-items:center;}.lido-row>*{}.lido-wrap{display:grid;grid-gap:10px;grid-template-columns:repeat(auto-fill, minmax(186px, auto))}.lido-wrap>*{padding:10px;box-sizing:border-box}.lido-flex{display:flex;flex-wrap:wrap;align-content:flex-start;gap:10px}.lido-pos{top:var(--y, 0);left:var(--x, 0);height:var(--height, 100%);width:var(--width, 100%);background-color:var(--bgColor, #eeeeee);display:flex;justify-content:space-around;flex-direction:column;position:fixed}.lido-pos>*{position:absolute}.lido-random{position:relative;width:100%;height:100%}.lido-random>*{position:absolute}.lido-col::-webkit-scrollbar,.lido-wrap::-webkit-scrollbar,.lido-flex::-webkit-scrollbar{width:var(--scrollbar-width);height:var(--scrollbar-width)}.lido-col::-webkit-scrollbar-thumb,.lido-wrap::-webkit-scrollbar-thumb,.lido-flex::-webkit-scrollbar-thumb{background-color:#888;border-radius:10px;border:3px solid transparent;background-clip:content-box}.lido-col::-webkit-scrollbar-track,.lido-wrap::-webkit-scrollbar-track,.lido-flex::-webkit-scrollbar-track{background:#f1f1f1}";const pt=class{constructor(i){t(this,i),this.showSpeakIcon=!1,this.minDrops=1,this.maxDrops=1,this.margin="",this.style={},this.handleWindowResize=()=>this.updateStyles(),this.handleWindowLoad=()=>this.updateStyles()}componentDidLoad(){h(this.el,this.type),w(this.el,this.minLength,this.maxLength,this.childElementsLength),this.showSpeakIcon&&y(this.el)}componentWillLoad(){this.updateStyles(),window.addEventListener("resize",this.handleWindowResize),window.addEventListener("load",this.handleWindowLoad)}disconnectedCallback(){window.removeEventListener("resize",this.handleWindowResize),window.removeEventListener("load",this.handleWindowLoad)}updateStyles(){const t=this.borderImage?u(this.borderImage):"",i=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:c(this.height,i),width:c(this.width,i),backgroundColor:c(this.bgColor,i),top:c(this.y,i),left:c(this.x,i),zIndex:this.z,display:this.visible?"flex":"none",flexDirection:this.direction?c(this.direction,i):"column",borderImage:`url(${t})`,borderImageSlice:t?"0 fill":"",boxShadow:this.boxShadow?this.boxShadow:"unset",margin:c(this.margin,i)}}render(){return i(e,{key:"334206d6054442fec787cfb479a68ae164404730",id:this.id,class:"lido-col",type:this.type,"tab-index":this.tabIndex,value:this.value,style:this.style,minDrops:this.minDrops,maxDrops:this.maxDrops,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,audio:this.audio,onTouch:this.onTouch,onCorrect:this.onCorrect,onInCorrect:this.onInCorrect,onEntry:this.onEntry},i("slot",{key:"590cd219bc5a02e6b96eafe108fb8b310daf941d"}))}get el(){return n(this)}};pt.style=".lido-col{top:var(--y, 0);left:var(--x, 0);height:var(--height, 100%);width:var(--width, 100%);background-color:var(--bgColor, #eeeeee);padding:15px;border-radius:10px;display:flex;justify-content:space-around;flex-direction:column;align-items:center}.lido-col>*{}";const gt=t=>"string"==typeof t,mt=()=>{let t,i;const e=new Promise(((e,n)=>{t=e,i=n}));return e.resolve=t,e.reject=i,e},bt=t=>null==t?"":""+t,vt=/###/g,wt=t=>t&&t.indexOf("###")>-1?t.replace(vt,"."):t,yt=t=>!t||gt(t),xt=(t,i,e)=>{const n=gt(i)?i.split("."):i;let r=0;for(;r<n.length-1;){if(yt(t))return{};const i=wt(n[r]);!t[i]&&e&&(t[i]=new e),t=Object.prototype.hasOwnProperty.call(t,i)?t[i]:{},++r}return yt(t)?{}:{obj:t,k:wt(n[r])}},kt=(t,i,e)=>{const{obj:n,k:r}=xt(t,i,Object);if(void 0!==n||1===i.length)return void(n[r]=e);let s=i[i.length-1],o=i.slice(0,i.length-1),a=xt(t,o,Object);for(;void 0===a.obj&&o.length;)s=`${o[o.length-1]}.${s}`,o=o.slice(0,o.length-1),a=xt(t,o,Object),a?.obj&&void 0!==a.obj[`${a.k}.${s}`]&&(a.obj=void 0);a.obj[`${a.k}.${s}`]=e},At=(t,i)=>{const{obj:e,k:n}=xt(t,i);if(e&&Object.prototype.hasOwnProperty.call(e,n))return e[n]},St=(t,i,e)=>{for(const n in i)"__proto__"!==n&&"constructor"!==n&&(n in t?gt(t[n])||t[n]instanceof String||gt(i[n])||i[n]instanceof String?e&&(t[n]=i[n]):St(t[n],i[n],e):t[n]=i[n]);return t},jt=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Mt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const Et=t=>gt(t)?t.replace(/[&<>"'\/]/g,(t=>Mt[t])):t,Ot=[" ",",","?","!",";"],Ct=new class{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const i=this.regExpMap.get(t);if(void 0!==i)return i;const e=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,e),this.regExpQueue.push(t),e}}(20),$t=(t,i,e=".")=>{if(!t)return;if(t[i]){if(!Object.prototype.hasOwnProperty.call(t,i))return;return t[i]}const n=i.split(e);let r=t;for(let t=0;t<n.length;){if(!r||"object"!=typeof r)return;let i,s="";for(let o=t;o<n.length;++o)if(o!==t&&(s+=e),s+=n[o],i=r[s],void 0!==i){if(["string","number","boolean"].indexOf(typeof i)>-1&&o<n.length-1)continue;t+=o-t+1;break}r=i}return r},It=t=>t?.replace(/_/g,"-"),_t={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,i){console?.[t]?.apply?.(console,i)}};class Tt{constructor(t,i={}){this.init(t,i)}init(t,i={}){this.prefix=i.prefix||"i18next:",this.logger=t||_t,this.options=i,this.debug=i.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,i,e,n){return n&&!this.debug?null:(gt(t[0])&&(t[0]=`${e}${this.prefix} ${t[0]}`),this.logger[i](t))}create(t){return new Tt(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return(t=t||this.options).prefix=t.prefix||this.prefix,new Tt(this.logger,t)}}var Pt=new Tt;class zt{constructor(){this.observers={}}on(t,i){return t.split(" ").forEach((t=>{this.observers[t]||(this.observers[t]=new Map);const e=this.observers[t].get(i)||0;this.observers[t].set(i,e+1)})),this}off(t,i){this.observers[t]&&(i?this.observers[t].delete(i):delete this.observers[t])}emit(t,...i){this.observers[t]&&Array.from(this.observers[t].entries()).forEach((([t,e])=>{for(let n=0;n<e;n++)t(...i)})),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach((([e,n])=>{for(let r=0;r<n;r++)e.apply(e,[t,...i])}))}}class Wt extends zt{constructor(t,i={ns:["translation"],defaultNS:"translation"}){super(),this.data=t||{},this.options=i,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const i=this.options.ns.indexOf(t);i>-1&&this.options.ns.splice(i,1)}getResource(t,i,e,n={}){const r=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,s=void 0!==n.ignoreJSONStructure?n.ignoreJSONStructure:this.options.ignoreJSONStructure;let o;t.indexOf(".")>-1?o=t.split("."):(o=[t,i],e&&(Array.isArray(e)?o.push(...e):gt(e)&&r?o.push(...e.split(r)):o.push(e)));const a=At(this.data,o);return!a&&!i&&!e&&t.indexOf(".")>-1&&(t=o[0],i=o[1],e=o.slice(2).join(".")),!a&&s&&gt(e)?$t(this.data?.[t]?.[i],e,r):a}addResource(t,i,e,n,r={silent:!1}){const s=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator;let o=[t,i];e&&(o=o.concat(s?e.split(s):e)),t.indexOf(".")>-1&&(o=t.split("."),n=i,i=o[1]),this.addNamespaces(i),kt(this.data,o,n),r.silent||this.emit("added",t,i,e,n)}addResources(t,i,e,n={silent:!1}){for(const n in e)(gt(e[n])||Array.isArray(e[n]))&&this.addResource(t,i,n,e[n],{silent:!0});n.silent||this.emit("added",t,i,e)}addResourceBundle(t,i,e,n,r,s={silent:!1,skipCopy:!1}){let o=[t,i];t.indexOf(".")>-1&&(o=t.split("."),n=e,e=i,i=o[1]),this.addNamespaces(i);let a=At(this.data,o)||{};s.skipCopy||(e=JSON.parse(JSON.stringify(e))),n?St(a,e,r):a={...a,...e},kt(this.data,o,a),s.silent||this.emit("added",t,i,e)}removeResourceBundle(t,i){this.hasResourceBundle(t,i)&&delete this.data[t][i],this.removeNamespaces(i),this.emit("removed",t,i)}hasResourceBundle(t,i){return void 0!==this.getResource(t,i)}getResourceBundle(t,i){return i||(i=this.options.defaultNS),this.getResource(t,i)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const i=this.getDataByLanguage(t);return!!(i&&Object.keys(i)||[]).find((t=>i[t]&&Object.keys(i[t]).length>0))}toJSON(){return this.data}}var Dt={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,i,e,n,r){return t.forEach((t=>{i=this.processors[t]?.process(i,e,n,r)??i})),i}};const Lt=Symbol("i18next/PATH_KEY");function Ft(t,i){const{[Lt]:e}=t(function(){const t=[],i=Object.create(null);let e;return i.get=(n,r)=>(e?.revoke?.(),r===Lt?t:(t.push(r),e=Proxy.revocable(n,i),e.proxy)),Proxy.revocable(Object.create(null),i).proxy}()),n=i?.keySeparator??".",r=i?.nsSeparator??":";if(e.length>1&&r){const t=i?.ns,s=Array.isArray(t)?t:null;if(s&&s.length>1&&s.slice(1).includes(e[0]))return`${e[0]}${r}${e.slice(1).join(n)}`}return e.join(n)}const Rt={},Bt=t=>!gt(t)&&"boolean"!=typeof t&&"number"!=typeof t;class Nt extends zt{constructor(t,i={}){var e,n;super(),e=t,n=this,["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"].forEach((t=>{e[t]&&(n[t]=e[t])})),this.options=i,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=Pt.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t,i={interpolation:{}}){const e={...i};if(null==t)return!1;const n=this.resolve(t,e);if(void 0===n?.res)return!1;const r=Bt(n.res);return!1!==e.returnObjects||!r}extractFromKey(t,i){let e=void 0!==i.nsSeparator?i.nsSeparator:this.options.nsSeparator;void 0===e&&(e=":");const n=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator;let r=i.ns||this.options.defaultNS||[];const s=e&&t.indexOf(e)>-1,o=!(this.options.userDefinedKeySeparator||i.keySeparator||this.options.userDefinedNsSeparator||i.nsSeparator||((t,i,e)=>{i=i||"",e=e||"";const n=Ot.filter((t=>i.indexOf(t)<0&&e.indexOf(t)<0));if(0===n.length)return!0;const r=Ct.getRegExp(`(${n.map((t=>"?"===t?"\\?":t)).join("|")})`);let s=!r.test(t);if(!s){const i=t.indexOf(e);i>0&&!r.test(t.substring(0,i))&&(s=!0)}return s})(t,e,n));if(s&&!o){const i=t.match(this.interpolator.nestingRegexp);if(i&&i.length>0)return{key:t,namespaces:gt(r)?[r]:r};const s=t.split(e);(e!==n||e===n&&this.options.ns.indexOf(s[0])>-1)&&(r=s.shift()),t=s.join(n)}return{key:t,namespaces:gt(r)?[r]:r}}translate(t,i,e){let n="object"==typeof i?{...i}:i;if("object"!=typeof n&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof n&&(n={...n}),n||(n={}),null==t)return"";"function"==typeof t&&(t=Ft(t,{...this.options,...n})),Array.isArray(t)||(t=[String(t)]),t=t.map((t=>"function"==typeof t?Ft(t,{...this.options,...n}):String(t)));const r=void 0!==n.returnDetails?n.returnDetails:this.options.returnDetails,s=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,{key:o,namespaces:a}=this.extractFromKey(t[t.length-1],n),h=a[a.length-1];let u=void 0!==n.nsSeparator?n.nsSeparator:this.options.nsSeparator;void 0===u&&(u=":");const c=n.lng||this.language,l=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if("cimode"===c?.toLowerCase())return l?r?{res:`${h}${u}${o}`,usedKey:o,exactUsedKey:o,usedLng:c,usedNS:h,usedParams:this.getUsedParamsDetails(n)}:`${h}${u}${o}`:r?{res:o,usedKey:o,exactUsedKey:o,usedLng:c,usedNS:h,usedParams:this.getUsedParamsDetails(n)}:o;const d=this.resolve(t,n);let f=d?.res;const p=d?.usedKey||o,g=d?.exactUsedKey||o,m=void 0!==n.joinArrays?n.joinArrays:this.options.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject,v=void 0!==n.count&&!gt(n.count),w=Nt.hasDefaultValue(n),y=v?this.pluralResolver.getSuffix(c,n.count,n):"",x=n.ordinal&&v?this.pluralResolver.getSuffix(c,n.count,{ordinal:!1}):"",k=v&&!n.ordinal&&0===n.count,A=k&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${y}`]||n[`defaultValue${x}`]||n.defaultValue;let S=f;b&&!f&&w&&(S=A);const j=Bt(S),M=Object.prototype.toString.apply(S);if(!(b&&S&&j&&["[object Number]","[object Function]","[object RegExp]"].indexOf(M)<0)||gt(m)&&Array.isArray(S))if(b&&gt(m)&&Array.isArray(f))f=f.join(m),f&&(f=this.extendTranslation(f,t,n,e));else{let i=!1,r=!1;!this.isValidLookup(f)&&w&&(i=!0,f=A),this.isValidLookup(f)||(r=!0,f=o);const a=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&r?void 0:f,l=w&&A!==f&&this.options.updateMissing;if(r||i||l){if(this.logger.log(l?"updateKey":"missingKey",c,h,o,l?A:f),s){const t=this.resolve(o,{...n,keySeparator:!1});t&&t.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let t=[];const i=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if("fallback"===this.options.saveMissingTo&&i&&i[0])for(let e=0;e<i.length;e++)t.push(i[e]);else"all"===this.options.saveMissingTo?t=this.languageUtils.toResolveHierarchy(n.lng||this.language):t.push(n.lng||this.language);const e=(t,i,e)=>{const r=w&&e!==f?e:a;this.options.missingKeyHandler?this.options.missingKeyHandler(t,h,i,r,l,n):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(t,h,i,r,l,n),this.emit("missingKey",t,h,i,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&v?t.forEach((t=>{const i=this.pluralResolver.getSuffixes(t,n);k&&n[`defaultValue${this.options.pluralSeparator}zero`]&&i.indexOf(`${this.options.pluralSeparator}zero`)<0&&i.push(`${this.options.pluralSeparator}zero`),i.forEach((i=>{e([t],o+i,n[`defaultValue${i}`]||A)}))})):e(t,o,A))}f=this.extendTranslation(f,t,n,d,e),r&&f===o&&this.options.appendNamespaceToMissingKey&&(f=`${h}${u}${o}`),(r||i)&&this.options.parseMissingKeyHandler&&(f=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${h}${u}${o}`:o,i?f:void 0,n))}else{if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const t=this.options.returnedObjectHandler?this.options.returnedObjectHandler(p,S,{...n,ns:a}):`key '${o} (${this.language})' returned an object instead of string.`;return r?(d.res=t,d.usedParams=this.getUsedParamsDetails(n),d):t}if(s){const t=Array.isArray(S),i=t?[]:{},e=t?g:p;for(const t in S)if(Object.prototype.hasOwnProperty.call(S,t)){const r=`${e}${s}${t}`;i[t]=this.translate(r,w&&!f?{...n,defaultValue:Bt(A)?A[t]:void 0,joinArrays:!1,ns:a}:{...n,joinArrays:!1,ns:a}),i[t]===r&&(i[t]=S[t])}f=i}}return r?(d.res=f,d.usedParams=this.getUsedParamsDetails(n),d):f}extendTranslation(t,i,e,n,r){if(this.i18nFormat?.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...e},e.lng||this.language||n.usedLng,n.usedNS,n.usedKey,{resolved:n});else if(!e.skipInterpolation){e.interpolation&&this.interpolator.init({...e,interpolation:{...this.options.interpolation,...e.interpolation}});const s=gt(t)&&(void 0!==e?.interpolation?.skipOnVariables?e.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let o;if(s){const i=t.match(this.interpolator.nestingRegexp);o=i&&i.length}let a=e.replace&&!gt(e.replace)?e.replace:e;if(this.options.interpolation.defaultVariables&&(a={...this.options.interpolation.defaultVariables,...a}),t=this.interpolator.interpolate(t,a,e.lng||this.language||n.usedLng,e),s){const i=t.match(this.interpolator.nestingRegexp);o<(i&&i.length)&&(e.nest=!1)}!e.lng&&n&&n.res&&(e.lng=this.language||n.usedLng),!1!==e.nest&&(t=this.interpolator.nest(t,((...t)=>r?.[0]!==t[0]||e.context?this.translate(...t,i):(this.logger.warn(`It seems you are nesting recursively key: ${t[0]} in key: ${i[0]}`),null)),e)),e.interpolation&&this.interpolator.reset()}const s=e.postProcess||this.options.postProcess,o=gt(s)?[s]:s;return null!=t&&o?.length&&!1!==e.applyPostProcessor&&(t=Dt.handle(o,t,i,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...n,usedParams:this.getUsedParamsDetails(e)},...e}:e,this)),t}resolve(t,i={}){let e,n,r,s,o;return gt(t)&&(t=[t]),Array.isArray(t)&&(t=t.map((t=>"function"==typeof t?Ft(t,{...this.options,...i}):t))),t.forEach((t=>{if(this.isValidLookup(e))return;const a=this.extractFromKey(t,i),h=a.key;n=h;let u=a.namespaces;this.options.fallbackNS&&(u=u.concat(this.options.fallbackNS));const c=void 0!==i.count&&!gt(i.count),l=c&&!i.ordinal&&0===i.count,d=void 0!==i.context&&(gt(i.context)||"number"==typeof i.context)&&""!==i.context,f=i.lngs?i.lngs:this.languageUtils.toResolveHierarchy(i.lng||this.language,i.fallbackLng);u.forEach((t=>{this.isValidLookup(e)||(o=t,Rt[`${f[0]}-${t}`]||!this.utils?.hasLoadedNamespace||this.utils?.hasLoadedNamespace(o)||(Rt[`${f[0]}-${t}`]=!0,this.logger.warn(`key "${n}" for languages "${f.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),f.forEach((n=>{if(this.isValidLookup(e))return;s=n;const o=[h];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(o,h,n,t,i);else{let t;c&&(t=this.pluralResolver.getSuffix(n,i.count,i));const e=`${this.options.pluralSeparator}zero`,r=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(c&&(i.ordinal&&0===t.indexOf(r)&&o.push(h+t.replace(r,this.options.pluralSeparator)),o.push(h+t),l&&o.push(h+e)),d){const n=`${h}${this.options.contextSeparator||"_"}${i.context}`;o.push(n),c&&(i.ordinal&&0===t.indexOf(r)&&o.push(n+t.replace(r,this.options.pluralSeparator)),o.push(n+t),l&&o.push(n+e))}}let a;for(;a=o.pop();)this.isValidLookup(e)||(r=a,e=this.getResource(n,t,a,i))})))}))})),{res:e,usedKey:n,exactUsedKey:r,usedLng:s,usedNS:o}}isValidLookup(t){return!(void 0===t||!this.options.returnNull&&null===t||!this.options.returnEmptyString&&""===t)}getResource(t,i,e,n={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(t,i,e,n):this.resourceStore.getResource(t,i,e,n)}getUsedParamsDetails(t={}){const i=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],e=t.replace&&!gt(t.replace);let n=e?t.replace:t;if(e&&void 0!==t.count&&(n.count=t.count),this.options.interpolation.defaultVariables&&(n={...this.options.interpolation.defaultVariables,...n}),!e){n={...n};for(const t of i)delete n[t]}return n}static hasDefaultValue(t){for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&"defaultValue"===i.substring(0,12)&&void 0!==t[i])return!0;return!1}}class Ut{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Pt.create("languageUtils")}getScriptPartFromCode(t){if(!(t=It(t))||t.indexOf("-")<0)return null;const i=t.split("-");return 2===i.length?null:(i.pop(),"x"===i[i.length-1].toLowerCase()?null:this.formatLanguageCode(i.join("-")))}getLanguagePartFromCode(t){if(!(t=It(t))||t.indexOf("-")<0)return t;const i=t.split("-");return this.formatLanguageCode(i[0])}formatLanguageCode(t){if(gt(t)&&t.indexOf("-")>-1){let i;try{i=Intl.getCanonicalLocales(t)[0]}catch(t){}return i&&this.options.lowerCaseLng&&(i=i.toLowerCase()),i||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let i;return t.forEach((t=>{if(i)return;const e=this.formatLanguageCode(t);this.options.supportedLngs&&!this.isSupportedCode(e)||(i=e)})),!i&&this.options.supportedLngs&&t.forEach((t=>{if(i)return;const e=this.getScriptPartFromCode(t);if(this.isSupportedCode(e))return i=e;const n=this.getLanguagePartFromCode(t);if(this.isSupportedCode(n))return i=n;i=this.options.supportedLngs.find((t=>t===n?t:t.indexOf("-")<0&&n.indexOf("-")<0?void 0:t.indexOf("-")>0&&n.indexOf("-")<0&&t.substring(0,t.indexOf("-"))===n||0===t.indexOf(n)&&n.length>1?t:void 0))})),i||(i=this.getFallbackCodes(this.options.fallbackLng)[0]),i}getFallbackCodes(t,i){if(!t)return[];if("function"==typeof t&&(t=t(i)),gt(t)&&(t=[t]),Array.isArray(t))return t;if(!i)return t.default||[];let e=t[i];return e||(e=t[this.getScriptPartFromCode(i)]),e||(e=t[this.formatLanguageCode(i)]),e||(e=t[this.getLanguagePartFromCode(i)]),e||(e=t.default),e||[]}toResolveHierarchy(t,i){const e=this.getFallbackCodes((!1===i?[]:i)||this.options.fallbackLng||[],t),n=[],r=t=>{t&&(this.isSupportedCode(t)?n.push(t):this.logger.warn(`rejecting language code not found in supportedLngs: ${t}`))};return gt(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?("languageOnly"!==this.options.load&&r(this.formatLanguageCode(t)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&r(this.getScriptPartFromCode(t)),"currentOnly"!==this.options.load&&r(this.getLanguagePartFromCode(t))):gt(t)&&r(this.formatLanguageCode(t)),e.forEach((t=>{n.indexOf(t)<0&&r(this.formatLanguageCode(t))})),n}}const Ht={zero:0,one:1,two:2,few:3,many:4,other:5},qt={select:t=>1===t?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Xt{constructor(t,i={}){this.languageUtils=t,this.options=i,this.logger=Pt.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,i={}){const e=It("dev"===t?"en":t),n=i.ordinal?"ordinal":"cardinal",r=JSON.stringify({cleanedCode:e,type:n});if(r in this.pluralRulesCache)return this.pluralRulesCache[r];let s;try{s=new Intl.PluralRules(e,{type:n})}catch(e){if("undefined"==typeof Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),qt;if(!t.match(/-|_/))return qt;const n=this.languageUtils.getLanguagePartFromCode(t);s=this.getRule(n,i)}return this.pluralRulesCache[r]=s,s}needsPlural(t,i={}){let e=this.getRule(t,i);return e||(e=this.getRule("dev",i)),e?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(t,i,e={}){return this.getSuffixes(t,e).map((t=>`${i}${t}`))}getSuffixes(t,i={}){let e=this.getRule(t,i);return e||(e=this.getRule("dev",i)),e?e.resolvedOptions().pluralCategories.sort(((t,i)=>Ht[t]-Ht[i])).map((t=>`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${t}`)):[]}getSuffix(t,i,e={}){const n=this.getRule(t,e);return n?`${this.options.prepend}${e.ordinal?`ordinal${this.options.prepend}`:""}${n.select(i)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",i,e))}}const Vt=(t,i,e,n=".",r=!0)=>{let s=((t,i,e)=>{const n=At(t,e);return void 0!==n?n:At(i,e)})(t,i,e);return!s&&r&&gt(e)&&(s=$t(t,e,n),void 0===s&&(s=$t(i,e,n))),s},Gt=t=>t.replace(/\$/g,"$$$$");class Yt{constructor(t={}){this.logger=Pt.create("interpolator"),this.options=t,this.format=t?.interpolation?.format||(t=>t),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:i,escapeValue:e,useRawValueToEscape:n,prefix:r,prefixEscaped:s,suffix:o,suffixEscaped:a,formatSeparator:h,unescapeSuffix:u,unescapePrefix:c,nestingPrefix:l,nestingPrefixEscaped:d,nestingSuffix:f,nestingSuffixEscaped:p,nestingOptionsSeparator:g,maxReplaces:m,alwaysFormat:b}=t.interpolation;this.escape=void 0!==i?i:Et,this.escapeValue=void 0===e||e,this.useRawValueToEscape=void 0!==n&&n,this.prefix=r?jt(r):s||"{{",this.suffix=o?jt(o):a||"}}",this.formatSeparator=h||",",this.unescapePrefix=u?"":c||"-",this.unescapeSuffix=this.unescapePrefix?"":u||"",this.nestingPrefix=l?jt(l):d||jt("$t("),this.nestingSuffix=f?jt(f):p||jt(")"),this.nestingOptionsSeparator=g||",",this.maxReplaces=m||1e3,this.alwaysFormat=void 0!==b&&b,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(t,i)=>t?.source===i?(t.lastIndex=0,t):new RegExp(i,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,i,e,n){let r,s,o;const a=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},h=t=>{if(t.indexOf(this.formatSeparator)<0){const r=Vt(i,a,t,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(r,void 0,e,{...n,...i,interpolationkey:t}):r}const r=t.split(this.formatSeparator),s=r.shift().trim(),o=r.join(this.formatSeparator).trim();return this.format(Vt(i,a,s,this.options.keySeparator,this.options.ignoreJSONStructure),o,e,{...n,...i,interpolationkey:s})};this.resetRegExp();const u=n?.missingInterpolationHandler||this.options.missingInterpolationHandler,c=void 0!==n?.interpolation?.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:t=>Gt(t)},{regex:this.regexp,safeValue:t=>Gt(this.escapeValue?this.escape(t):t)}].forEach((i=>{for(o=0;r=i.regex.exec(t);){const e=r[1].trim();if(s=h(e),void 0===s)if("function"==typeof u){const i=u(t,r,n);s=gt(i)?i:""}else if(n&&Object.prototype.hasOwnProperty.call(n,e))s="";else{if(c){s=r[0];continue}this.logger.warn(`missed to pass in variable ${e} for interpolating ${t}`),s=""}else gt(s)||this.useRawValueToEscape||(s=bt(s));const a=i.safeValue(s);if(t=t.replace(r[0],a),c?(i.regex.lastIndex+=s.length,i.regex.lastIndex-=r[0].length):i.regex.lastIndex=0,o++,o>=this.maxReplaces)break}})),t}nest(t,i,e={}){let n,r,s;const o=(t,i)=>{const e=this.nestingOptionsSeparator;if(t.indexOf(e)<0)return t;const n=t.split(new RegExp(`${jt(e)}[ ]*{`));let r=`{${n[1]}`;t=n[0],r=this.interpolate(r,s);const o=r.match(/'/g),a=r.match(/"/g);((o?.length??0)%2==0&&!a||(a?.length??0)%2!=0)&&(r=r.replace(/'/g,'"'));try{s=JSON.parse(r),i&&(s={...i,...s})}catch(i){return this.logger.warn(`failed parsing options string in nesting for key ${t}`,i),`${t}${e}${r}`}return s.defaultValue&&s.defaultValue.indexOf(this.prefix)>-1&&delete s.defaultValue,t};for(;n=this.nestingRegexp.exec(t);){let a=[];s={...e},s=s.replace&&!gt(s.replace)?s.replace:s,s.applyPostProcessor=!1,delete s.defaultValue;const h=/{.*}/.test(n[1])?n[1].lastIndexOf("}")+1:n[1].indexOf(this.formatSeparator);if(-1!==h&&(a=n[1].slice(h).split(this.formatSeparator).map((t=>t.trim())).filter(Boolean),n[1]=n[1].slice(0,h)),r=i(o.call(this,n[1].trim(),s),s),r&&n[0]===t&&!gt(r))return r;gt(r)||(r=bt(r)),r||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${t}`),r=""),a.length&&(r=a.reduce(((t,i)=>this.format(t,i,e.lng,{...e,interpolationkey:n[1].trim()})),r.trim())),t=t.replace(n[0],r),this.regexp.lastIndex=0}return t}}const Zt=t=>{const i={};return(e,n,r)=>{let s=r;r&&r.interpolationkey&&r.formatParams&&r.formatParams[r.interpolationkey]&&r[r.interpolationkey]&&(s={...s,[r.interpolationkey]:void 0});const o=n+JSON.stringify(s);let a=i[o];return a||(a=t(It(n),r),i[o]=a),a(e)}},Kt=t=>(i,e,n)=>t(It(e),n)(i);class Jt{constructor(t={}){this.logger=Pt.create("formatter"),this.options=t,this.init(t)}init(t,i={interpolation:{}}){this.formatSeparator=i.interpolation.formatSeparator||",";const e=i.cacheInBuiltFormats?Zt:Kt;this.formats={number:e(((t,i)=>{const e=new Intl.NumberFormat(t,{...i});return t=>e.format(t)})),currency:e(((t,i)=>{const e=new Intl.NumberFormat(t,{...i,style:"currency"});return t=>e.format(t)})),datetime:e(((t,i)=>{const e=new Intl.DateTimeFormat(t,{...i});return t=>e.format(t)})),relativetime:e(((t,i)=>{const e=new Intl.RelativeTimeFormat(t,{...i});return t=>e.format(t,i.range||"day")})),list:e(((t,i)=>{const e=new Intl.ListFormat(t,{...i});return t=>e.format(t)}))}}add(t,i){this.formats[t.toLowerCase().trim()]=i}addCached(t,i){this.formats[t.toLowerCase().trim()]=Zt(i)}format(t,i,e,n={}){const r=i.split(this.formatSeparator);if(r.length>1&&r[0].indexOf("(")>1&&r[0].indexOf(")")<0&&r.find((t=>t.indexOf(")")>-1))){const t=r.findIndex((t=>t.indexOf(")")>-1));r[0]=[r[0],...r.splice(1,t)].join(this.formatSeparator)}return r.reduce(((t,i)=>{const{formatName:r,formatOptions:s}=(t=>{let i=t.toLowerCase().trim();const e={};if(t.indexOf("(")>-1){const n=t.split("(");i=n[0].toLowerCase().trim();const r=n[1].substring(0,n[1].length-1);"currency"===i&&r.indexOf(":")<0?e.currency||(e.currency=r.trim()):"relativetime"===i&&r.indexOf(":")<0?e.range||(e.range=r.trim()):r.split(";").forEach((t=>{if(t){const[i,...n]=t.split(":"),r=n.join(":").trim().replace(/^'+|'+$/g,""),s=i.trim();e[s]||(e[s]=r),"false"===r&&(e[s]=!1),"true"===r&&(e[s]=!0),isNaN(r)||(e[s]=parseInt(r,10))}}))}return{formatName:i,formatOptions:e}})(i);if(this.formats[r]){let i=t;try{const o=n?.formatParams?.[n.interpolationkey]||{};i=this.formats[r](t,o.locale||o.lng||n.locale||n.lng||e,{...s,...n,...o})}catch(t){this.logger.warn(t)}return i}return this.logger.warn(`there was no format function for ${r}`),t}),t)}}class Qt extends zt{constructor(t,i,e,n={}){super(),this.backend=t,this.store=i,this.services=e,this.languageUtils=e.languageUtils,this.options=n,this.logger=Pt.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=n.maxParallelReads||10,this.readingCalls=0,this.maxRetries=n.maxRetries>=0?n.maxRetries:5,this.retryTimeout=n.retryTimeout>=1?n.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(e,n.backend,n)}queueLoad(t,i,e,n){const r={},s={},o={},a={};return t.forEach((t=>{let n=!0;i.forEach((i=>{const o=`${t}|${i}`;!e.reload&&this.store.hasResourceBundle(t,i)?this.state[o]=2:this.state[o]<0||(1===this.state[o]?void 0===s[o]&&(s[o]=!0):(this.state[o]=1,n=!1,void 0===s[o]&&(s[o]=!0),void 0===r[o]&&(r[o]=!0),void 0===a[i]&&(a[i]=!0)))})),n||(o[t]=!0)})),(Object.keys(r).length||Object.keys(s).length)&&this.queue.push({pending:s,pendingCount:Object.keys(s).length,loaded:{},errors:[],callback:n}),{toLoad:Object.keys(r),pending:Object.keys(s),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(a)}}loaded(t,i,e){const n=t.split("|"),r=n[0],s=n[1];i&&this.emit("failedLoading",r,s,i),!i&&e&&this.store.addResourceBundle(r,s,e,void 0,void 0,{skipCopy:!0}),this.state[t]=i?-1:2,i&&e&&(this.state[t]=0);const o={};this.queue.forEach((e=>{((t,i,e)=>{const{obj:n,k:r}=xt(t,i,Object);n[r]=n[r]||[],n[r].push(e)})(e.loaded,[r],s),((t,i)=>{void 0!==t.pending[i]&&(delete t.pending[i],t.pendingCount--)})(e,t),i&&e.errors.push(i),0!==e.pendingCount||e.done||(Object.keys(e.loaded).forEach((t=>{o[t]||(o[t]={});const i=e.loaded[t];i.length&&i.forEach((i=>{void 0===o[t][i]&&(o[t][i]=!0)}))})),e.done=!0,e.errors.length?e.callback(e.errors):e.callback())})),this.emit("loaded",o),this.queue=this.queue.filter((t=>!t.done))}read(t,i,e,n=0,r=this.retryTimeout,s){if(!t.length)return s(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:t,ns:i,fcName:e,tried:n,wait:r,callback:s});this.readingCalls++;const o=(o,a)=>{if(this.readingCalls--,this.waitingReads.length>0){const t=this.waitingReads.shift();this.read(t.lng,t.ns,t.fcName,t.tried,t.wait,t.callback)}o&&a&&n<this.maxRetries?setTimeout((()=>{this.read.call(this,t,i,e,n+1,2*r,s)}),r):s(o,a)},a=this.backend[e].bind(this.backend);if(2!==a.length)return a(t,i,o);try{const e=a(t,i);e&&"function"==typeof e.then?e.then((t=>o(null,t))).catch(o):o(null,e)}catch(t){o(t)}}prepareLoading(t,i,e={},n){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),n&&n();gt(t)&&(t=this.languageUtils.toResolveHierarchy(t)),gt(i)&&(i=[i]);const r=this.queueLoad(t,i,e,n);if(!r.toLoad.length)return r.pending.length||n(),null;r.toLoad.forEach((t=>{this.loadOne(t)}))}load(t,i,e){this.prepareLoading(t,i,{},e)}reload(t,i,e){this.prepareLoading(t,i,{reload:!0},e)}loadOne(t,i=""){const e=t.split("|"),n=e[0],r=e[1];this.read(n,r,"read",void 0,void 0,((e,s)=>{e&&this.logger.warn(`${i}loading namespace ${r} for language ${n} failed`,e),!e&&s&&this.logger.log(`${i}loaded namespace ${r} for language ${n}`,s),this.loaded(t,e,s)}))}saveMissing(t,i,e,n,r,s={},o=()=>{}){if(!this.services?.utils?.hasLoadedNamespace||this.services?.utils?.hasLoadedNamespace(i)){if(null!=e&&""!==e){if(this.backend?.create){const a={...s,isUpdate:r},h=this.backend.create.bind(this.backend);if(h.length<6)try{let r;r=5===h.length?h(t,i,e,n,a):h(t,i,e,n),r&&"function"==typeof r.then?r.then((t=>o(null,t))).catch(o):o(null,r)}catch(t){o(t)}else h(t,i,e,n,o,a)}t&&t[0]&&this.store.addResource(t[0],i,e,n)}}else this.logger.warn(`did not save key "${e}" as the namespace "${i}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")}}const ti=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let i={};if("object"==typeof t[1]&&(i=t[1]),gt(t[1])&&(i.defaultValue=t[1]),gt(t[2])&&(i.tDescription=t[2]),"object"==typeof t[2]||"object"==typeof t[3]){const e=t[3]||t[2];Object.keys(e).forEach((t=>{i[t]=e[t]}))}return i},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),ii=t=>(gt(t.ns)&&(t.ns=[t.ns]),gt(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),gt(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs?.indexOf?.("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),"boolean"==typeof t.initImmediate&&(t.initAsync=t.initImmediate),t),ei=()=>{},ni="__i18next_supportNoticeShown";class ri extends zt{constructor(t={},i){var e;if(super(),this.options=ii(t),this.services={},this.logger=Pt,this.modules={external:[]},e=this,Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((t=>{"function"==typeof e[t]&&(e[t]=e[t].bind(e))})),i&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,i),this;setTimeout((()=>{this.init(t,i)}),0)}}init(t={},i){this.isInitializing=!0,"function"==typeof t&&(i=t,t={}),null==t.defaultNS&&t.ns&&(gt(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const e=ti();var n;this.options={...e,...this.options,...ii(t)},this.options.interpolation={...e.interpolation,...this.options.interpolation},void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator),"function"!=typeof this.options.overloadTranslationOptionHandler&&(this.options.overloadTranslationOptionHandler=e.overloadTranslationOptionHandler),!1===this.options.showSupportNotice||(n=this,n?.modules?.backend?.name?.indexOf("Locize")>0||n?.modules?.backend?.constructor?.name?.indexOf("Locize")>0||n?.options?.backend?.backends&&n.options.backend.backends.some((t=>t?.name?.indexOf("Locize")>0||t?.constructor?.name?.indexOf("Locize")>0))||n?.options?.backend?.projectId||n?.options?.backend?.backendOptions&&n.options.backend.backendOptions.some((t=>t?.projectId)))||"undefined"!=typeof globalThis&&globalThis[ni]||"undefined"!=typeof process&&process.env&&process.env.I18NEXT_NO_SUPPORT_NOTICE||"undefined"!=typeof process&&process.env||("undefined"!=typeof console&&void 0!==console.info&&console.info("🌐 i18next is made possible by our own product, Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙"),"undefined"!=typeof globalThis&&(globalThis[ni]=!0));const r=t=>t?"function"==typeof t?new t:t:null;if(!this.options.isClone){let t;Pt.init(this.modules.logger?r(this.modules.logger):null,this.options),t=this.modules.formatter?this.modules.formatter:Jt;const i=new Ut(this.options);this.store=new Wt(this.options.resources,this.options);const n=this.services;n.logger=Pt,n.resourceStore=this.store,n.languageUtils=i,n.pluralResolver=new Xt(i,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==e.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),!t||this.options.interpolation.format&&this.options.interpolation.format!==e.interpolation.format||(n.formatter=r(t),n.formatter.init&&n.formatter.init(n,this.options),this.options.interpolation.format=n.formatter.format.bind(n.formatter)),n.interpolator=new Yt(this.options),n.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},n.backendConnector=new Qt(r(this.modules.backend),n.resourceStore,n,this.options),n.backendConnector.on("*",((t,...i)=>{this.emit(t,...i)})),this.modules.languageDetector&&(n.languageDetector=r(this.modules.languageDetector),n.languageDetector.init&&n.languageDetector.init(n,this.options.detection,this.options)),this.modules.i18nFormat&&(n.i18nFormat=r(this.modules.i18nFormat),n.i18nFormat.init&&n.i18nFormat.init(this)),this.translator=new Nt(this.services,this.options),this.translator.on("*",((t,...i)=>{this.emit(t,...i)})),this.modules.external.forEach((t=>{t.init&&t.init(this)}))}if(this.format=this.options.interpolation.format,i||(i=ei),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const t=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);t.length>0&&"dev"!==t[0]&&(this.options.lng=t[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((t=>{this[t]=(...i)=>this.store[t](...i)})),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((t=>{this[t]=(...i)=>(this.store[t](...i),this)}));const s=mt(),o=()=>{const t=(t,e)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),s.resolve(e),i(t,e)};if(this.languages&&!this.isInitialized)return t(null,this.t.bind(this));this.changeLanguage(this.options.lng,t)};return this.options.resources||!this.options.initAsync?o():setTimeout(o,0),s}loadResources(t,i=ei){let e=i;const n=gt(t)?t:this.language;if("function"==typeof t&&(e=t),!this.options.resources||this.options.partialBundledLanguages){if("cimode"===n?.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return e();const t=[],i=i=>{i&&"cimode"!==i&&this.services.languageUtils.toResolveHierarchy(i).forEach((i=>{"cimode"!==i&&t.indexOf(i)<0&&t.push(i)}))};n?i(n):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((t=>i(t))),this.options.preload?.forEach?.((t=>i(t))),this.services.backendConnector.load(t,this.options.ns,(t=>{t||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),e(t)}))}else e(null)}reloadResources(t,i,e){const n=mt();return"function"==typeof t&&(e=t,t=void 0),"function"==typeof i&&(e=i,i=void 0),t||(t=this.languages),i||(i=this.options.ns),e||(e=ei),this.services.backendConnector.reload(t,i,(t=>{n.resolve(),e(t)})),n}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===t.type&&(this.modules.backend=t),("logger"===t.type||t.log&&t.warn&&t.error)&&(this.modules.logger=t),"languageDetector"===t.type&&(this.modules.languageDetector=t),"i18nFormat"===t.type&&(this.modules.i18nFormat=t),"postProcessor"===t.type&&Dt.addPostProcessor(t),"formatter"===t.type&&(this.modules.formatter=t),"3rdParty"===t.type&&this.modules.external.push(t),this}setResolvedLanguage(t){if(t&&this.languages&&!(["cimode","dev"].indexOf(t)>-1)){for(let t=0;t<this.languages.length;t++){const i=this.languages[t];if(!(["cimode","dev"].indexOf(i)>-1)&&this.store.hasLanguageSomeTranslations(i)){this.resolvedLanguage=i;break}}!this.resolvedLanguage&&this.languages.indexOf(t)<0&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,i){this.isLanguageChangingTo=t;const e=mt();this.emit("languageChanging",t);const n=t=>{this.language=t,this.languages=this.services.languageUtils.toResolveHierarchy(t),this.resolvedLanguage=void 0,this.setResolvedLanguage(t)},r=(r,s)=>{s?this.isLanguageChangingTo===t&&(n(s),this.translator.changeLanguage(s),this.isLanguageChangingTo=void 0,this.emit("languageChanged",s),this.logger.log("languageChanged",s)):this.isLanguageChangingTo=void 0,e.resolve(((...t)=>this.t(...t))),i&&i(r,((...t)=>this.t(...t)))},s=i=>{t||i||!this.services.languageDetector||(i=[]);const e=gt(i)?i:i&&i[0],s=this.store.hasLanguageSomeTranslations(e)?e:this.services.languageUtils.getBestMatchFromCodes(gt(i)?[i]:i);s&&(this.language||n(s),this.translator.language||this.translator.changeLanguage(s),this.services.languageDetector?.cacheUserLanguage?.(s)),this.loadResources(s,(t=>{r(t,s)}))};return t||!this.services.languageDetector||this.services.languageDetector.async?!t&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(s):this.services.languageDetector.detect(s):s(t):s(this.services.languageDetector.detect()),e}getFixedT(t,i,e){const n=(t,i,...r)=>{let s;s="object"!=typeof i?this.options.overloadTranslationOptionHandler([t,i].concat(r)):{...i},s.lng=s.lng||n.lng,s.lngs=s.lngs||n.lngs,s.ns=s.ns||n.ns,""!==s.keyPrefix&&(s.keyPrefix=s.keyPrefix||e||n.keyPrefix);const o={...this.options,...s};"function"==typeof s.keyPrefix&&(s.keyPrefix=Ft(s.keyPrefix,o));const a=this.options.keySeparator||".";let h;return s.keyPrefix&&Array.isArray(t)?h=t.map((t=>("function"==typeof t&&(t=Ft(t,o)),`${s.keyPrefix}${a}${t}`))):("function"==typeof t&&(t=Ft(t,o)),h=s.keyPrefix?`${s.keyPrefix}${a}${t}`:t),this.t(h,s)};return gt(t)?n.lng=t:n.lngs=t,n.ns=i,n.keyPrefix=e,n}t(...t){return this.translator?.translate(...t)}exists(...t){return this.translator?.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,i={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const e=i.lng||this.resolvedLanguage||this.languages[0],n=!!this.options&&this.options.fallbackLng,r=this.languages[this.languages.length-1];if("cimode"===e.toLowerCase())return!0;const s=(t,i)=>{const e=this.services.backendConnector.state[`${t}|${i}`];return-1===e||0===e||2===e};if(i.precheck){const t=i.precheck(this,s);if(void 0!==t)return t}return!(!this.hasResourceBundle(e,t)&&this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages)&&(!s(e,t)||n&&!s(r,t)))}loadNamespaces(t,i){const e=mt();return this.options.ns?(gt(t)&&(t=[t]),t.forEach((t=>{this.options.ns.indexOf(t)<0&&this.options.ns.push(t)})),this.loadResources((t=>{e.resolve(),i&&i(t)})),e):(i&&i(),Promise.resolve())}loadLanguages(t,i){const e=mt();gt(t)&&(t=[t]);const n=this.options.preload||[],r=t.filter((t=>n.indexOf(t)<0&&this.services.languageUtils.isSupportedCode(t)));return r.length?(this.options.preload=n.concat(r),this.loadResources((t=>{e.resolve(),i&&i(t)})),e):(i&&i(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!t)return"rtl";try{const i=new Intl.Locale(t);if(i&&i.getTextInfo){const t=i.getTextInfo();if(t&&t.direction)return t.direction}}catch(t){}const i=this.services?.languageUtils||new Ut(ti());return t.toLowerCase().indexOf("-latn")>1?"ltr":["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(i.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},i){const e=new ri(t,i);return e.createInstance=ri.createInstance,e}cloneInstance(t={},i=ei){const e=t.forkResourceStore;e&&delete t.forkResourceStore;const n={...this.options,...t,isClone:!0},r=new ri(n);if(void 0===t.debug&&void 0===t.prefix||(r.logger=r.logger.clone(t)),["store","services","language"].forEach((t=>{r[t]=this[t]})),r.services={...this.services},r.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},e){const t=Object.keys(this.store.data).reduce(((t,i)=>(t[i]={...this.store.data[i]},t[i]=Object.keys(t[i]).reduce(((e,n)=>(e[n]={...t[i][n]},e)),t[i]),t)),{});r.store=new Wt(t,n),r.services.resourceStore=r.store}if(t.interpolation){const i={...ti().interpolation,...this.options.interpolation,...t.interpolation},e={...n,interpolation:i};r.services.interpolator=new Yt(e)}return r.translator=new Nt(r.services,n),r.translator.on("*",((t,...i)=>{r.emit(t,...i)})),r.init(n,i),r.translator.options=n,r.translator.backendConnector.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},r}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const si=ri.createInstance(),{slice:oi,forEach:ai}=[],hi=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,ui={create(t,i,e,n){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{path:"/",sameSite:"strict"};e&&(r.expires=new Date,r.expires.setTime(r.expires.getTime()+60*e*1e3)),n&&(r.domain=n),document.cookie=function(t,i){const e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{path:"/"};let n=`${t}=${encodeURIComponent(i)}`;if(e.maxAge>0){const t=e.maxAge-0;if(Number.isNaN(t))throw new Error("maxAge should be a Number");n+=`; Max-Age=${Math.floor(t)}`}if(e.domain){if(!hi.test(e.domain))throw new TypeError("option domain is invalid");n+=`; Domain=${e.domain}`}if(e.path){if(!hi.test(e.path))throw new TypeError("option path is invalid");n+=`; Path=${e.path}`}if(e.expires){if("function"!=typeof e.expires.toUTCString)throw new TypeError("option expires is invalid");n+=`; Expires=${e.expires.toUTCString()}`}if(e.httpOnly&&(n+="; HttpOnly"),e.secure&&(n+="; Secure"),e.sameSite)switch("string"==typeof e.sameSite?e.sameSite.toLowerCase():e.sameSite){case!0:n+="; SameSite=Strict";break;case"lax":n+="; SameSite=Lax";break;case"strict":n+="; SameSite=Strict";break;case"none":n+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return e.partitioned&&(n+="; Partitioned"),n}(t,i,r)},read(t){const i=`${t}=`,e=document.cookie.split(";");for(let t=0;t<e.length;t++){let n=e[t];for(;" "===n.charAt(0);)n=n.substring(1,n.length);if(0===n.indexOf(i))return n.substring(i.length,n.length)}return null},remove(t,i){this.create(t,"",-1,i)}};var ci={name:"cookie",lookup(t){let{lookupCookie:i}=t;if(i&&"undefined"!=typeof document)return ui.read(i)||void 0},cacheUserLanguage(t,i){let{lookupCookie:e,cookieMinutes:n,cookieDomain:r,cookieOptions:s}=i;e&&"undefined"!=typeof document&&ui.create(e,t,n,r,s)}},li={name:"querystring",lookup(t){let i,{lookupQuerystring:e}=t;if("undefined"!=typeof window){let{search:t}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(t=window.location.hash.substring(window.location.hash.indexOf("?")));const n=t.substring(1).split("&");for(let t=0;t<n.length;t++){const r=n[t].indexOf("=");r>0&&n[t].substring(0,r)===e&&(i=n[t].substring(r+1))}}return i}},di={name:"hash",lookup(t){let i,{lookupHash:e,lookupFromHashIndex:n}=t;if("undefined"!=typeof window){const{hash:t}=window.location;if(t&&t.length>2){const r=t.substring(1);if(e){const t=r.split("&");for(let n=0;n<t.length;n++){const r=t[n].indexOf("=");r>0&&t[n].substring(0,r)===e&&(i=t[n].substring(r+1))}}if(i)return i;if(!i&&n>-1){const i=t.match(/\/([a-zA-Z-]*)/g);if(!Array.isArray(i))return;const e="number"==typeof n?n:0;return i[e]?.replace("/","")}}}return i}};let fi=null;const pi=()=>{if(null!==fi)return fi;try{if(fi="undefined"!=typeof window&&null!==window.localStorage,!fi)return!1;const t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch(t){fi=!1}return fi};var gi={name:"localStorage",lookup(t){let{lookupLocalStorage:i}=t;if(i&&pi())return window.localStorage.getItem(i)||void 0},cacheUserLanguage(t,i){let{lookupLocalStorage:e}=i;e&&pi()&&window.localStorage.setItem(e,t)}};let mi=null;const bi=()=>{if(null!==mi)return mi;try{if(mi="undefined"!=typeof window&&null!==window.sessionStorage,!mi)return!1;const t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch(t){mi=!1}return mi};var vi={name:"sessionStorage",lookup(t){let{lookupSessionStorage:i}=t;if(i&&bi())return window.sessionStorage.getItem(i)||void 0},cacheUserLanguage(t,i){let{lookupSessionStorage:e}=i;e&&bi()&&window.sessionStorage.setItem(e,t)}},wi={name:"navigator",lookup(t){const i=[];if("undefined"!=typeof navigator){const{languages:t,userLanguage:e,language:n}=navigator;if(t)for(let e=0;e<t.length;e++)i.push(t[e]);e&&i.push(e),n&&i.push(n)}return i.length>0?i:void 0}},yi={name:"htmlTag",lookup(t){let i,{htmlTag:e}=t;const n=e||("undefined"!=typeof document?document.documentElement:null);return n&&"function"==typeof n.getAttribute&&(i=n.getAttribute("lang")),i}},xi={name:"path",lookup(t){let{lookupFromPathIndex:i}=t;if("undefined"==typeof window)return;const e=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(!Array.isArray(e))return;const n="number"==typeof i?i:0;return e[n]?.replace("/","")}},ki={name:"subdomain",lookup(t){let{lookupFromSubdomainIndex:i}=t;const e="number"==typeof i?i+1:1,n="undefined"!=typeof window&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(n)return n[e]}};let Ai=!1;try{Ai=!0}catch(t){}const Si=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];Ai||Si.splice(1,1);class ji{constructor(t){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(t,i)}init(){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{languageUtils:{}},this.options=function(t){return ai.call(oi.call(arguments,1),(i=>{if(i)for(const e in i)void 0===t[e]&&(t[e]=i[e])})),t}(t,this.options||{},{order:Si,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:t=>t}),"string"==typeof this.options.convertDetectedLanguage&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=t=>t.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=i,this.addDetector(ci),this.addDetector(li),this.addDetector(gi),this.addDetector(vi),this.addDetector(wi),this.addDetector(yi),this.addDetector(xi),this.addDetector(ki),this.addDetector(di)}addDetector(t){return this.detectors[t.name]=t,this}detect(){let t=[];return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.order).forEach((i=>{if(this.detectors[i]){let e=this.detectors[i].lookup(this.options);e&&"string"==typeof e&&(e=[e]),e&&(t=t.concat(e))}})),t=t.filter((t=>{return null!=t&&!("string"==typeof(i=t)&&[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some((t=>t.test(i))));var i})).map((t=>this.options.convertDetectedLanguage(t))),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?t:t.length>0?t[0]:null}cacheUserLanguage(t){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.caches;i&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(t)>-1||i.forEach((i=>{this.detectors[i]&&this.detectors[i].cacheUserLanguage(t,this.options)})))}}ji.type="languageDetector";si.use(ji).init({resources:{en:{translation:{"Do you want to exit? button":"Do you want to exit?","Exit button":"Exit","Continue playing button":"Continue playing","Drop the elements to match the given symbol order":"Drop the elements to match the given symbol order","Fill in the blanks":"Fill in the blanks",instruction:{dragAndDrop:"Match the items by dragging and dropping them into the correct places.",mcq:"Select the correct answer from the options provided.",tracing:"Trace the shape by following the outline carefully.",flashcards:"Review the flashcards to reinforce your learning.",substractionWithImage:"substractionWithImageEngAudio",substractionWithoutImage:"substractionWithoutImageEngAudio",numberIdentificationWithImage:"numberIdentificationWithImageEngAudio",numberIdentificationWithoutImage:"numberIdentificationWithoutImageEngAudio",wordBuildingWithImage:"wordBuildingWithImageEngAudio",wordBuildingWithoutImage:"wordBuildingWithoutImageEngAudio",pictureClues:"pictureCluesEngAudio",pictureWordMatchMultipleImages:"pictureWordMatchMultipleImagesEngAudio",pictureWordMatchSingleImage:"pictureWordMatchSingleImageEngAudio",sentenceMatch:"sentenceMatchEngAudio",imageMatch:"imageMatchEngAudio",palStoryTale:"palStoryTaleEngAudio",palEgmaPatternMatching:"palEgmaPatternMatchingEngAudio",palEgmaWordProblemDragnDrop:"palEgmaWordProblemDragnDropEngAudio",palEgmaWordProblemClick:"palEgmaWordProblemClickEngAudio",palEgraOddOneOut:"palEgraOddOneOutEngAudio",palEgraArrangePictures:"palEgraArrangePicturesEngAudio",palEgraBuildWord:"palEgraBuildWordEngAudio",palEgraWordFormation:"palEgraWordFormationEngAudio",palInventedSpelling:"palInventedSpellingEngAudio",palLetterIdentification:"palLetterIdentificationEngAudio",palStoryMaking:"palStoryMakingEngAudio",palegmasumtogether:"palegmasumtogetherEngAudio",palegmamultioption:"palegmamultioptionEngAudio",palegraoptionaudio:"palegraoptionaudioEngAudio",palegrawordmatch:"palegrawordmatchEngAudio",palegramcqimages:"palegramcqimagesEngAudio"}}},fr:{translation:{"Do you want to exit? button":"Voulez-vous quitter?","Exit button":"Quitter","Continue playing button":"Continuer à jouer","Drop the elements to match the given symbol order":"Déposez les éléments pour correspondre au symbole donné","Fill in the blanks":"Remplissez les blancs",instruction:{dragAndDrop:"Faites glisser les objets vers le bon emplacement.",mcq:"Choisissez la bonne réponse parmi les options proposées.",tracing:"Tracez soigneusement la forme en suivant la ligne.",flashcards:"Regardez les cartes mémoire pour renforcer l’apprentissage."}}},hi:{translation:{"Do you want to exit? button":"क्या आप बाहर निकलना चाहते हैं?","Exit button":"बाहर निकलें","Continue playing button":"खेलना जारी रखें","Drop the elements to match the given symbol order":"दिए गए चिन्ह से मिलाने के लिए तत्वों को ड्रॉप करें","Fill in the blanks":"रिक्त स्थान भरें",instruction:{dragAndDrop:"Match the items by dragging and dropping them into the correct places.",mcq:"Select the correct answer from the options provided.",tracing:"Trace the shape by following the outline carefully.",flashcards:"Review the flashcards to reinforce your learning.",substractionWithImage:"substractionWithImageHiAudio",substractionWithoutImage:"substractionWithoutImageHiAudio",numberIdentificationWithImage:"numberIdentificationWithImageHiAudio",numberIdentificationWithoutImage:"numberIdentificationWithoutImageHiAudio",wordBuildingWithImage:"wordBuildingWithImageHiAudio",wordBuildingWithoutImage:"wordBuildingWithoutImageHiAudio",pictureClues:"pictureCluesHiAudio",pictureWordMatchMultipleImages:"pictureWordMatchMultipleImagesHiAudio",pictureWordMatchSingleImage:"pictureWordMatchSingleImageHiAudio",sentenceMatch:"sentenceMatchHiAudio",imageMatch:"imageMatchHiAudio",palStoryTale:"palStoryTaleHiAudio",palEgmaPatternMatching:"palEgmaPatternMatchingHiAudio",palEgmaWordProblemDragnDrop:"palEgmaWordProblemDragnDropHiAudio",palEgmaWordProblemClick:"palEgmaWordProblemClickHiAudio",palEgraOddOneOut:"palEgraOddOneOutHiAudio",palEgraArrangePictures:"palEgraArrangePicturesHiAudio",palEgraBuildWord:"palEgraBuildWordHiAudio",palEgraWordFormation:"palEgraWordFormationHiAudio",palInventedSpelling:"palInventedSpellingHiAudio",palLetterIdentification:"palLetterIdentificationHiAudio",palStoryMaking:"palStoryMakingHiAudio",palegmasumtogether:"palegmasumtogetherHiAudio",palegmamultioption:"palegmamultioptionHiAudio",palegraoptionaudio:"palegraoptionaudioHiAudio",palegrawordmatch:"palegrawordmatchHiAudio",palegramcqimages:"palegramcqimagesHiAudio"}}},kn:{translation:{"Do you want to exit? button":"ನೀವು ನಿರ್ಗಮಿಸಲು ಬಯಸುವಿರಾ?","Exit button":"ನಿರ್ಗಮಿಸು","Continue playing button":"ಆಟವನ್ನು ಮುಂದುವರಿಸಿ","Drop the elements to match the given symbol order":"ನೀಡಿರುವ ಸಂಕೇತಕ್ಕೆ ಹೊಂದುವಂತೆ ಅಂಶಗಳನ್ನು ಬಿಡಿ","Fill in the blanks":"ಖಾಲಿ ಸ್ಥಳಗಳನ್ನು ಭರ್ತಿ ಮಾಡಿ",instruction:{dragAndDrop:"Match the items by dragging and dropping them into the correct places.",mcq:"Select the correct answer from the options provided.",tracing:"Trace the shape by following the outline carefully.",flashcards:"Review the flashcards to reinforce your learning.",substractionWithImage:"substractionWithImageKaAudio",substractionWithoutImage:"substractionWithoutImageKaAudio",numberIdentificationWithImage:"numberIdentificationWithImageKaAudio",numberIdentificationWithoutImage:"numberIdentificationWithoutImageKaAudio",wordBuildingWithImage:"wordBuildingWithImageKaAudio",wordBuildingWithoutImage:"wordBuildingWithoutImageKaAudio",pictureClues:"pictureCluesKaAudio",pictureWordMatchMultipleImages:"pictureWordMatchMultipleImagesKaAudio",pictureWordMatchSingleImage:"pictureWordMatchSingleImageKaAudio",sentenceMatch:"sentenceMatchKaAudio",imageMatch:"imageMatchKaAudio",palStoryTale:"palStoryTaleKaAudio",palEgmaPatternMatching:"palEgmaPatternMatchingKaAudio",palEgmaWordProblemDragnDrop:"palEgmaWordProblemDragnDropKaAudio",palEgmaWordProblemClick:"palEgmaWordProblemClickKaAudio",palEgraOddOneOut:"palEgraOddOneOutKaAudio",palEgraArrangePictures:"palEgraArrangePicturesKaAudio",palEgraBuildWord:"palEgraBuildWordKaAudio",palEgraWordFormation:"palEgraWordFormationKaAudio",palInventedSpelling:"palInventedSpellingKaAudio",palLetterIdentification:"palLetterIdentificationKaAudio",palStoryMaking:"palStoryMakingKaAudio",palegmasumtogether:"palegmasumtogetherKaAudio",palegmamultioption:"palegmamultioptionKaAudio",palegraoptionaudio:"palegraoptionaudioKaAudio",palegrawordmatch:"palegrawordmatchKaAudio",palegramcqimages:"palegramcqimagesKaAudio"}}},te:{translation:{"Do you want to exit? button":"మీరు బయటకు వెళ్లాలనుకుంటున్నారా?","Exit button":"బయటకు వెళ్ళు","Continue playing button":"ఆటను కొనసాగించు","Drop the elements to match the given symbol order":"ఇచ్చిన చిహ్నానికి సరిపడేలా అంశాలను డ్రాప్ చేయಂడಿ","Fill in the blanks":"ಖಾಲಿ ಸ್ಥಳಗಳನ್ನು ಭರ್ತಿ ಮಾಡಿ"}},pt:{translation:{"Do you want to exit? button":"Você deseja sair?","Exit button":"Sair","Continue playing button":"Continuar jogando","Drop the elements to match the given symbol order":"Solte os elementos para corresponder à ordem dos símbolos fornecida","Fill in the blanks":"Preencha os espaços em branco"}},mr:{translation:{"Do you want to exit? button":"तुम्हाला बाहेर पडायचे आहे का?","Exit button":"बाहेर पडा","Continue playing button":"खेळ सुरू ठेवा",instruction:{dragAndDrop:"वस्तू योग्य ठिकाणी ओढून आणि सोडून जुळवा.",mcq:"दिलेल्या पर्यायांमधून योग्य उत्तर निवडा.",tracing:"रेषेचा काळजीपूर्वक मागोवा घेत आकृती काढा.",flashcards:"तुमचे शिक्षण मजबूत करण्यासाठी फ्लॅशकार्ड्स पाहा."}}}},fallbackLng:"en",debug:!1,interpolation:{escapeValue:!1},detection:{order:["querystring","localStorage","navigator","htmlTag"],caches:["localStorage"]}});const Mi=class{constructor(i){t(this,i),this.Lang="",this.showDropBorder=!0,this.appendToDropOnCompletion=!1,this.id="",this.objective="",this.customStyle="",this.value="",this.height="auto",this.width="auto",this.ariaLabel="auto",this.ariaHidden="",this.x="0px",this.y="0px",this.z="0",this.bgColor="",this.bgImage="",this.type="",this.tabIndex=0,this.visible=!1,this.audio="",this.onTouch="",this.onInCorrect="",this.onCorrect="",this.onEntry="",this.canplay=!0,this.showCheck=!1,this.isContinueOnCorrect=!1,this.isAllowOnlyCorrect=!1,this.baseUrl="",this.margin="",this.showPrevButton="false",this.showNextButton="false",this.delayVisible="",this.disableSpeak=!1,this.templateId="",this.highlightWordByWord=!1,this.instructName="",this.speakFlag=!1,this.handleWindowResize=()=>this.scaleContainer(this.el),this.handleWindowLoad=()=>this.scaleContainer(this.el)}cleanupInteractionHandlers(){this.el.querySelectorAll('[type="drag"], [type="slide"], [move="true"]').forEach((t=>{t.dispatchEvent(new Event(x))}))}languageChanged(t){const i=t||this.resolveLanguage();this.updateChildTextLanguage(i)}componentWillLoad(){const t=this.resolveLanguage();this.updateChildTextLanguage(t),this.resolveInstructionAudio()}resolveInstructionAudio(){var t;this.instructName=null!==(t={flashcard:"instruction.flashcards",mcq:"instruction.mcq",tracing:"instruction.tracing",dragAndDrop:"instruction.dragAndDrop",arrangeLetters:"arrangeLetters",balancing:"balancing",balloonPop:"balloonPop",blender:"blender",bubbleType:"bubbleType",calculator:"calculator",categorize:"categorize",checkerBlocks:"checkerBlocks",createSentence:"createSentence",fillAnswer:"fillAnswer",fillBlank:"fillBlank",fillUp:"fillUp",flashcardtemplate:"flashcard",foodJar:"foodJar",grid:"grid",imageMatchWithQuestionImageAndMultiOption:"imageMatchWithQuestionImageAndMultiOption",inventedSpelling:"inventedSpelling",jumpSentence:"jumpSentence",letterBoard:"letterBoard",letterIdentification:"letterIdentification",letterPairing:"letterPairing",makeSentence:"makeSentence",matchingCard:"matchingCard",multiplyBeeds:"multiplyBeeds",nimbleTable:"nimbleTable",numberBoardOneTwo:"numberBoardOneTwo",numberPair:"numberPair",openWindow:"openWindow",orderTractor:"orderTractor",phonicTractor:"phonicTractor",pictureMeaningCocos:"pictureMeaningCocos",pictureWordMatch1:"pictureWordMatch1",pictureWordMatch2:"pictureWordMatch2",puzzleGame:"puzzleGame",questionBoard:"questionBoard",quizLiteracySentenceSentence:"quizLiteracySentenceSentence",quizLiteracySoundOnlyImage:"quizLiteracySoundOnlyImage",quizLiteracySoundOnlySentence:"quizLiteracySoundOnlySentence",quizLiteracySoundOnlyWord:"quizLiteracySoundonlyWord",quizLiteracyAndShapes1:"quizLiteracyAndShapes1",quizLiteracyImageWithText:"quizLiteracyImageWithText",quizliteracyImageWord:"quizliteracyImageWord",quizMathBiggerAndSmaller:"quizMathBiggerAndSmaller",quizMathBiggestAndSmallest:"quizMathBiggestAndSmallest",quizmathCustomNumberMagnitude:"quizmathCustomNumberMagnitude",quizMathHowMany:"quizMathHowMany",quizmathMissingnumberDrag:"quizmathMissingnumberDrag",quizMathNumberIdentification:"quizMathNumberIdentification",quizMathOperationWithobjects:"quizMathOperationWithobjects",quizMathoperationWithoutObjects:"quizMathoperationWithoutObjects",quizMathRecognizeNumber:"quizMathRecognizeNumber",quizMathShapes:"quizMathShapes",reorder:"reorder",rocketGame:"rocketGame",rowBlock:"rowBlock",sequenceBox1:"sequenceBox1",shapeTractor:"shapeTractor",spellDoor:"spellDoor",storyMaking:"storyMaking",storyTale:"storyTale",sumTogether:"sumTogether",tag:"tag",total:"total",writeCard:"writeCard",writeLetter:"writeLetter",writeNumber:"writeNumber",writeSet:"writeSet",writeWord:"writeWord",numberIdentification:"numberIdentification",wordBuildingWithAndWithoutImage:"wordBuildingWithAndWithoutImage",subsWithAndWithoutImage:"subsWithAndWithoutImage",sentenceMatchTemplate:"sentenceMatch",pictureClues:"pictureClues",palEgmaCalculateSumAndSumTogether:"palEgmaCalculateSumAndSumTogether",palEgmaPatternMatching:"palEgmaPatternMatchingAudio",palEgmaWordProblem:"palEgmaWordProblem",palEgraArrangePictures:"palEgraArrangePicturesAudio",palEgraBuildWord:"palEgraBuildWordAudio",palEgraMCQWithImage:"palEgraMCQWithImage",palEgraOddOneOut:"palEgraOddOneOutAudio",palEgraOptionWithAudio:"palEgraOptionWithAudio",palEgraWordFormation:"palEgraWordFormationAudio",palEgraWordMatch:"palEgraWordMatch",substractionWithImage:"substractionWithImageAudio",substractionWithoutImage:"substractionWithoutImageAudio",numberIdentificationWithImage:"numberIdentificationWithImageAudio",numberIdentificationWithoutImage:"numberIdentificationWithoutImageAudio",wordBuildingWithImage:"wordBuildingWithImageAudio",wordBuildingWithoutImage:"wordBuildingWithoutImageAudio",pictureWordMatchMultipleImages:"pictureWordMatchMultipleImagesAudio",pictureWordMatchSingleImage:"pictureWordMatchSingleImageAudio",sentenceMatch:"sentenceMatchAudio",imageMatch:"imageMatchAudio",palStoryTale:"palStoryTaleAudio",palEgmaWordProblemDragnDrop:"palEgmaWordProblemDragnDropAudio",palEgmaWordProblemClick:"palEgmaWordProblemClickAudio",palInventedSpelling:"palInventedSpellingAudio",palLetterIdentification:"palLetterIdentificationAudio",palStoryMaking:"palStoryMakingAudio",palegmasumtogether:"palegmasumtogetherAudio",palegmamultioption:"palegmamultioptionAudio",palegraoptionaudio:"palegraoptionAudio",palegrawordmatch:"palegrawordmatchAudio",palegramcqimages:"palegramcqimagesAudio",drawShape:"drawshape",drawshape:"drawshape"}[this.templateId])&&void 0!==t?t:"";const i=document.querySelector("lido-home");if(!i)return;const e=i.getAttribute(k)||"";this.speakFlag=e.includes(this.templateId),this.speakFlag||i.setAttribute(k,[e,this.templateId].filter(Boolean).join(","))}resolveLanguage(){var t,i;const e=this.el.closest("lido-root"),n=(null==e?void 0:e.Lang)||"";if(null==n?void 0:n.trim())return n;if(null===(t=this.Lang)||void 0===t?void 0:t.trim())return this.Lang;const r=this.el.getAttribute("Lang");return(null==r?void 0:r.trim())?r:null===(i=this.el.textContent)||void 0===i?void 0:i.trim()}convertToPixels(t,i=document.body){if(!t)return 0;if(t.endsWith("px"))return parseFloat(t);const e=document.createElement("div");e.style.position="absolute",e.style.visibility="hidden",e.style.height=t,i.appendChild(e);const n=e.offsetHeight;return i.removeChild(e),n}scaleContainer(t){const i=this.getClosestParentWithWidth();let e=0;i&&(e=Math.min(i.clientWidth/1600,i.clientHeight/900)),t.style.transform=`translate(-50%, -50%) scale(${0!=e?e:A()})`,t.style.left="50%",t.style.top="50%",t.style.position="absolute",this.screenOrientation()}getClosestParentWithWidth(){let t=this.el.parentElement;for(;t;){if(t.offsetWidth>0)return t;t=t.parentElement}return null}screenOrientation(){window.innerHeight>window.innerWidth?(this.el.style.height="1600px",this.el.style.width="900px"):(this.el.style.height="900px",this.el.style.width="1600px")}updateChildTextLanguage(t){const i=t||si.language||"en";si.changeLanguage(i),this.el.querySelectorAll("lido-text").forEach((t=>{t.Lang=i,t.dispatchEvent(new CustomEvent("languageChanged",{bubbles:!0}))}))}componentDidLoad(){this.scaleContainer(this.el);const t=this.bgImage?u(this.bgImage):"",i=this.el.closest("lido-standalone"),e="true"===(null==i?void 0:i.getAttribute("bg-image"))?i:document.body;if(e.style.backgroundColor=this.bgColor,e.style.backgroundImage=t?`url(${t})`:"none",e.style.backgroundPosition=t?"bottom":"none",document.body.style.pointerEvents="auto",window.addEventListener("resize",this.handleWindowResize),window.addEventListener("load",this.handleWindowLoad),this.templateId?setTimeout((()=>{this.el.setAttribute("onEntry",`${this.templateId}.speak='${!this.speakFlag}'; `+this.el.getAttribute("onEntry")),h(this.el,this.type)}),100):h(this.el,this.type),this.customStyle){const t=document.createElement("style");t.innerHTML=this.customStyle,document.head.appendChild(t)}const n=this.resolveLanguage();this.updateChildTextLanguage(n),setTimeout((()=>{S()}),100),M(),j.getI().start()}disconnectedCallback(){this.cleanupInteractionHandlers(),window.removeEventListener("resize",this.handleWindowResize),window.removeEventListener("load",this.handleWindowLoad),document.body.style.backgroundColor="",document.body.style.backgroundImage="",M(),j.getI().stop()}render(){return i(e,{key:"1862e30fedda58726edc107f81fae1f63e96d009",id:"lido-container",Lang:this.Lang,"tab-index":0,class:"lido-container",objective:this.objective,baseUrl:this.baseUrl,style:{backgroundColor:this.bgColor,position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",margin:this.margin,userSelect:"none"},"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,onTouch:this.onTouch,onInCorrect:this.onInCorrect,onCorrect:this.onCorrect,onEntry:this.onEntry,"show-check":`${this.showCheck}`,"is-continue-on-correct":`${this.isContinueOnCorrect}`,"is-allow-only-correct":`${this.isAllowOnlyCorrect}`,canplay:`${this.canplay}`,appendToDropOnCompletion:`${this.appendToDropOnCompletion}`,"show-prev-button":`${this.showPrevButton}`,"show-next-button":`${this.showNextButton}`,"show-drop-border":`${this.showDropBorder}`,"bg-image":this.bgImage,"exit-button-url":this.exitButtonUrl,"prev-button-url":this.prevButtonUrl,"next-button-url":this.nextButtonUrl,"speaker-button-url":this.speakerButtonUrl,"disable-speak":`${this.disableSpeak}`,"template-id":this.templateId,audio:this.audio,"highlight-word-by-word":`${this.highlightWordByWord}`},i("lido-text",{key:"86fd014a61ba9cba6d67e2d921b2d8a8a289dbc7",visible:"false",id:this.templateId,audio:"",string:this.instructName}),i("slot",{key:"c3128ea2164892757b32cb076d717436947f9a4c"}))}get el(){return n(this)}static get watchers(){return{Lang:[{languageChanged:0}]}}};Mi.style=".lido-container{position:relative;height:100%;width:100%;background-color:var(--bgColor, transparent);display:flex;flex-direction:column;justify-content:center;align-items:center}";const Ei=class{constructor(i){t(this,i),this.value="",this.height="auto",this.width="auto",this.ariaLabel="",this.ariaHidden="",this.x="0px",this.y="0px",this.z="0",this.bgColor="",this.type="",this.tabIndex=0,this.visible=!0,this.audio="",this.onTouch="",this.onInCorrect="",this.onCorrect="",this.onEntry="",this.flipped=!1,this.margin="",this.disableSpeak=!1,this.style={},this.delayVisible="",this.updateStyles=()=>{const t=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:c(this.height,t)||"200px",width:c(this.width,t)||"200px",backgroundColor:c(this.bgColor,t),top:c(this.y,t),left:c(this.x,t),zIndex:this.z,display:this.visible?this.display?c(this.display,t):"inline-block":"none",flexDirection:this.direction?c(this.direction,t):void 0,margin:c(this.margin,t)}},this.handleFlip=()=>{this.flipped=!this.flipped}}handleFlippedChange(){}componentWillLoad(){this.updateStyles(),window.addEventListener("resize",this.updateStyles),window.addEventListener("load",this.updateStyles)}componentDidLoad(){a(this.el,this.delayVisible);const t=this.el.querySelector(".card");t&&setTimeout((()=>{t.classList.add("flipped"),setTimeout((()=>{t.classList.remove("flipped")}),500)}),500),h(this.el,this.type)}disconnectedCallback(){window.removeEventListener("resize",this.updateStyles),window.removeEventListener("load",this.updateStyles)}render(){return i(e,{key:"db8de4cdb5466700ca29fba17e2a5ffb01907559",value:this.value,"tab-index":this.tabIndex,style:this.style,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,audio:this.audio,onTouch:this.onTouch,onCorrect:this.onCorrect,onInCorrect:this.onInCorrect,onEntry:this.onEntry,type:this.type,onClick:this.handleFlip,"disable-speak":this.disableSpeak},i("div",{key:"ec3aeff247e581f4aef061b7fea5b752a64804b3",class:"card "+(this.flipped?"flipped":"")},i("div",{key:"cb7ffa64077c89157a0d75720964605eed639363",class:"card-face card-front"},null!=this.front?this.front:i("slot",{name:"front"})),i("div",{key:"537e1b60c82be542b2a8a8426abc4b801865688e",class:"card-face card-back"},null!=this.back?this.back:i("slot",{name:"back"}))))}get el(){return n(this)}static get watchers(){return{flipped:[{handleFlippedChange:0}]}}};Ei.style=".card{position:relative;width:100%;height:100%;transform-style:preserve-3d;transition:transform 0.6s ease;cursor:pointer}.card.flipped{transform:rotateY(180deg)}.card-face{position:absolute;width:100%;height:100%;backface-visibility:hidden;display:flex;align-items:center;justify-content:center}.card-back{transform:rotateY(180deg)}";const Oi=class{constructor(i){t(this,i),this.id="",this.value="",this.z="0",this.tabIndex=0,this.visible=!1,this.onEntry="",this.delayVisible="",this.floatDirection="bottomToTop",this.handleWindowResize=()=>this.updateStyles(),this.handleWindowLoad=()=>this.updateStyles()}componentDidLoad(){a(this.el,this.delayVisible),h(this.el,this.type),this.initializeFloatElement()}componentWillLoad(){this.updateStyles(),window.addEventListener("resize",this.handleWindowResize),window.addEventListener("load",this.handleWindowLoad)}disconnectedCallback(){window.removeEventListener("resize",this.handleWindowResize),window.removeEventListener("load",this.handleWindowLoad)}initializeFloatElement(){let t=0;Array.from(this.el.children).forEach((i=>{const e=i;e.style.visibility="hidden",setTimeout((()=>{e.style.visibility="visible",E(e)}),t),t+=1e3,i.addEventListener("click",(()=>{O(e)}))}))}updateStyles(){const t=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:"leftToRight"!==this.floatDirection?"100%":c(this.height,t),width:"leftToRight"===this.floatDirection?"100%":c(this.width,t),backgroundColor:c(this.bgColor,t),zIndex:this.z,display:this.visible?"flex":"none"}}render(){return i(e,{key:"c461f1142dd6addd9ceb41ade183b044b875681f",class:"lido-float","float-direction":this.floatDirection,id:this.id,"tab-index":this.tabIndex,style:this.style,onEntry:this.onEntry},i("slot",{key:"240439bfda6a9e4e2d67e6ae2b5c878d99e632b3"}))}get el(){return n(this)}};function Ci(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}Oi.style=".lido-float{position:relative}.lido-float>*{position:absolute;cursor:pointer}@keyframes float-up{from{top:var(--el-top)}to{top:-500px}}#removeShadow{box-shadow:unset !important}@keyframes float-lr{from{right:var(--el-left)}to{right:-500px}}";var $i,Ii={exports:{}},_i=($i||($i=1,Ii.exports=function t(i,e,n){function r(o,a){if(!e[o]){if(!i[o]){if(!a&&Ci)return Ci(o);if(s)return s(o,!0);var h=new Error("Cannot find module '"+o+"'");throw h.code="MODULE_NOT_FOUND",h}var u=e[o]={exports:{}};i[o][0].call(u.exports,(function(t){return r(i[o][1][t]||t)}),u,u.exports,t,i,e,n)}return e[o].exports}for(var s=Ci,o=0;o<n.length;o++)r(n[o]);return r}({1:[function(t,i,e){var n=t("./utils"),r=t("./support"),s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";e.encode=function(t){for(var i,e,r,o,a,h,u=[],c=0,l=t.length,d=l,f="string"!==n.getTypeOf(t);c<t.length;)d=l-c,r=f?(i=t[c++],e=c<l?t[c++]:0,c<l?t[c++]:0):(i=t.charCodeAt(c++),e=c<l?t.charCodeAt(c++):0,c<l?t.charCodeAt(c++):0),o=(3&i)<<4|e>>4,a=1<d?(15&e)<<2|r>>6:64,h=2<d?63&r:64,u.push(s.charAt(i>>2)+s.charAt(o)+s.charAt(a)+s.charAt(h));return u.join("")},e.decode=function(t){var i,e,n,o,a,h,u=0,c=0,l="data:";if(t.substr(0,5)===l)throw new Error("Invalid base64 input, it looks like a data url.");var d,f=3*(t=t.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(t.charAt(t.length-1)===s.charAt(64)&&f--,t.charAt(t.length-2)===s.charAt(64)&&f--,f%1!=0)throw new Error("Invalid base64 input, bad content length.");for(d=r.uint8array?new Uint8Array(0|f):new Array(0|f);u<t.length;)i=s.indexOf(t.charAt(u++))<<2|(o=s.indexOf(t.charAt(u++)))>>4,e=(15&o)<<4|(a=s.indexOf(t.charAt(u++)))>>2,n=(3&a)<<6|(h=s.indexOf(t.charAt(u++))),d[c++]=i,64!==a&&(d[c++]=e),64!==h&&(d[c++]=n);return d}},{"./support":30,"./utils":32}],2:[function(t,i){var e=t("./external"),n=t("./stream/DataWorker"),r=t("./stream/Crc32Probe"),s=t("./stream/DataLengthProbe");function o(t,i,e,n,r){this.compressedSize=t,this.uncompressedSize=i,this.crc32=e,this.compression=n,this.compressedContent=r}o.prototype={getContentWorker:function(){var t=new n(e.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new s("data_length")),i=this;return t.on("end",(function(){if(this.streamInfo.data_length!==i.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")})),t},getCompressedWorker:function(){return new n(e.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},o.createWorkerFrom=function(t,i,e){return t.pipe(new r).pipe(new s("uncompressedSize")).pipe(i.compressWorker(e)).pipe(new s("compressedSize")).withStreamInfo("compression",i)},i.exports=o},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(t,i,e){var n=t("./stream/GenericWorker");e.STORE={magic:"\0\0",compressWorker:function(){return new n("STORE compression")},uncompressWorker:function(){return new n("STORE decompression")}},e.DEFLATE=t("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(t,i){var e=t("./utils"),n=function(){for(var t,i=[],e=0;e<256;e++){t=e;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;i[e]=t}return i}();i.exports=function(t,i){return void 0!==t&&t.length?"string"!==e.getTypeOf(t)?function(t,i,e){var r=n,s=0+e;t^=-1;for(var o=0;o<s;o++)t=t>>>8^r[255&(t^i[o])];return~t}(0|i,t,t.length):function(t,i,e){var r=n,s=0+e;t^=-1;for(var o=0;o<s;o++)t=t>>>8^r[255&(t^i.charCodeAt(o))];return~t}(0|i,t,t.length):0}},{"./utils":32}],5:[function(t,i,e){e.base64=!1,e.binary=!1,e.dir=!1,e.createFolders=!0,e.date=null,e.compression=null,e.compressionOptions=null,e.comment=null,e.unixPermissions=null,e.dosPermissions=null},{}],6:[function(t,i){var e;e="undefined"!=typeof Promise?Promise:t("lie"),i.exports={Promise:e}},{lie:37}],7:[function(t,i,e){var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,r=t("pako"),s=t("./utils"),o=t("./stream/GenericWorker"),a=n?"uint8array":"array";function h(t,i){o.call(this,"FlateWorker/"+t),this._pako=null,this._pakoAction=t,this._pakoOptions=i,this.meta={}}e.magic="\b\0",s.inherits(h,o),h.prototype.processChunk=function(t){this.meta=t.meta,null===this._pako&&this._createPako(),this._pako.push(s.transformTo(a,t.data),!1)},h.prototype.flush=function(){o.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},h.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this._pako=null},h.prototype._createPako=function(){this._pako=new r[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var t=this;this._pako.onData=function(i){t.push({data:i,meta:t.meta})}},e.compressWorker=function(t){return new h("Deflate",t)},e.uncompressWorker=function(){return new h("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(t,i){function e(t,i){var e,n="";for(e=0;e<i;e++)n+=String.fromCharCode(255&t),t>>>=8;return n}function n(t,i,n,s,u,c){var l,d,f=t.file,p=t.compression,g=c!==o.utf8encode,m=r.transformTo("string",c(f.name)),b=r.transformTo("string",o.utf8encode(f.name)),v=f.comment,w=r.transformTo("string",c(v)),y=r.transformTo("string",o.utf8encode(v)),x=b.length!==f.name.length,k=y.length!==v.length,A="",S="",j="",M=f.dir,E=f.date,O={crc32:0,compressedSize:0,uncompressedSize:0};i&&!n||(O.crc32=t.crc32,O.compressedSize=t.compressedSize,O.uncompressedSize=t.uncompressedSize);var C=0;i&&(C|=8),g||!x&&!k||(C|=2048);var $=0,I=0;M&&($|=16),"UNIX"===u?(I=798,$|=function(t,i){var e=t;return t||(e=i?16893:33204),(65535&e)<<16}(f.unixPermissions,M)):(I=20,$|=function(t){return 63&(t||0)}(f.dosPermissions)),l=E.getUTCHours(),l<<=6,l|=E.getUTCMinutes(),l<<=5,l|=E.getUTCSeconds()/2,d=E.getUTCFullYear()-1980,d<<=4,d|=E.getUTCMonth()+1,d<<=5,d|=E.getUTCDate(),x&&(S=e(1,1)+e(a(m),4)+b,A+="up"+e(S.length,2)+S),k&&(j=e(1,1)+e(a(w),4)+y,A+="uc"+e(j.length,2)+j);var _="";return _+="\n\0",_+=e(C,2),_+=p.magic,_+=e(l,2),_+=e(d,2),_+=e(O.crc32,4),_+=e(O.compressedSize,4),_+=e(O.uncompressedSize,4),_+=e(m.length,2),_+=e(A.length,2),{fileRecord:h.LOCAL_FILE_HEADER+_+m+A,dirRecord:h.CENTRAL_FILE_HEADER+e(I,2)+_+e(w.length,2)+"\0\0\0\0"+e($,4)+e(s,4)+m+A+w}}var r=t("../utils"),s=t("../stream/GenericWorker"),o=t("../utf8"),a=t("../crc32"),h=t("../signature");function u(t,i,e,n){s.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=i,this.zipPlatform=e,this.encodeFileName=n,this.streamFiles=t,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}r.inherits(u,s),u.prototype.push=function(t){var i=t.meta.percent||0,e=this.entriesCount,n=this._sources.length;this.accumulate?this.contentBuffer.push(t):(this.bytesWritten+=t.data.length,s.prototype.push.call(this,{data:t.data,meta:{currentFile:this.currentFile,percent:e?(i+100*(e-n-1))/e:100}}))},u.prototype.openedSource=function(t){this.currentSourceOffset=this.bytesWritten,this.currentFile=t.file.name;var i=this.streamFiles&&!t.file.dir;if(i){var e=n(t,i,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:e.fileRecord,meta:{percent:0}})}else this.accumulate=!0},u.prototype.closedSource=function(t){this.accumulate=!1;var i=this.streamFiles&&!t.file.dir,r=n(t,i,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),i)this.push({data:function(t){return h.DATA_DESCRIPTOR+e(t.crc32,4)+e(t.compressedSize,4)+e(t.uncompressedSize,4)}(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},u.prototype.flush=function(){for(var t=this.bytesWritten,i=0;i<this.dirRecords.length;i++)this.push({data:this.dirRecords[i],meta:{percent:100}});var n=function(t,i,n,s,o){var a=r.transformTo("string",o(s));return h.CENTRAL_DIRECTORY_END+"\0\0\0\0"+e(t,2)+e(t,2)+e(i,4)+e(n,4)+e(a.length,2)+a}(this.dirRecords.length,this.bytesWritten-t,t,this.zipComment,this.encodeFileName);this.push({data:n,meta:{percent:100}})},u.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},u.prototype.registerPrevious=function(t){this._sources.push(t);var i=this;return t.on("data",(function(t){i.processChunk(t)})),t.on("end",(function(){i.closedSource(i.previous.streamInfo),i._sources.length?i.prepareNextSource():i.end()})),t.on("error",(function(t){i.error(t)})),this},u.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},u.prototype.error=function(t){var i=this._sources;if(!s.prototype.error.call(this,t))return!1;for(var e=0;e<i.length;e++)try{i[e].error(t)}catch(t){}return!0},u.prototype.lock=function(){s.prototype.lock.call(this);for(var t=this._sources,i=0;i<t.length;i++)t[i].lock()},i.exports=u},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(t,i,e){var n=t("../compressions"),r=t("./ZipFileWorker");e.generateWorker=function(t,i,e){var s=new r(i.streamFiles,e,i.platform,i.encodeFileName),o=0;try{t.forEach((function(t,e){o++;var r=function(t,i){var e=t||i,r=n[e];if(!r)throw new Error(e+" is not a valid compression method !");return r}(e.options.compression,i.compression),a=e.dir,h=e.date;e._compressWorker(r,e.options.compressionOptions||i.compressionOptions||{}).withStreamInfo("file",{name:t,dir:a,date:h,comment:e.comment||"",unixPermissions:e.unixPermissions,dosPermissions:e.dosPermissions}).pipe(s)})),s.entriesCount=o}catch(t){s.error(t)}return s}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(t,i){function e(){if(!(this instanceof e))return new e;if(arguments.length)throw new 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 e;for(var i in this)"function"!=typeof this[i]&&(t[i]=this[i]);return t}}(e.prototype=t("./object")).loadAsync=t("./load"),e.support=t("./support"),e.defaults=t("./defaults"),e.version="3.10.1",e.loadAsync=function(t,i){return(new e).loadAsync(t,i)},e.external=t("./external"),i.exports=e},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(t,i){var e=t("./utils"),n=t("./external"),r=t("./utf8"),s=t("./zipEntries"),o=t("./stream/Crc32Probe"),a=t("./nodejsUtils");function h(t){return new n.Promise((function(i,e){var n=t.decompressed.getContentWorker().pipe(new o);n.on("error",(function(t){e(t)})).on("end",(function(){n.streamInfo.crc32!==t.decompressed.crc32?e(new Error("Corrupted zip : CRC32 mismatch")):i()})).resume()}))}i.exports=function(t,i){var o=this;return i=e.extend(i||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:r.utf8decode}),a.isNode&&a.isStream(t)?n.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):e.prepareContent("the loaded zip file",t,!0,i.optimizedBinaryString,i.base64).then((function(t){var e=new s(i);return e.load(t),e})).then((function(t){var e=[n.Promise.resolve(t)],r=t.files;if(i.checkCRC32)for(var s=0;s<r.length;s++)e.push(h(r[s]));return n.Promise.all(e)})).then((function(t){for(var n=t.shift(),r=n.files,s=0;s<r.length;s++){var a=r[s],h=a.fileNameStr,u=e.resolve(a.fileNameStr);o.file(u,a.decompressed,{binary:!0,optimizedBinaryString:!0,date:a.date,dir:a.dir,comment:a.fileCommentStr.length?a.fileCommentStr:null,unixPermissions:a.unixPermissions,dosPermissions:a.dosPermissions,createFolders:i.createFolders}),a.dir||(o.file(u).unsafeOriginalName=h)}return n.zipComment.length&&(o.comment=n.zipComment),o}))}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(t,i){var e=t("../utils"),n=t("../stream/GenericWorker");function r(t,i){n.call(this,"Nodejs stream input adapter for "+t),this._upstreamEnded=!1,this._bindStream(i)}e.inherits(r,n),r.prototype._bindStream=function(t){var i=this;(this._stream=t).pause(),t.on("data",(function(t){i.push({data:t,meta:{percent:0}})})).on("error",(function(t){i.isPaused?this.generatedError=t:i.error(t)})).on("end",(function(){i.isPaused?i._upstreamEnded=!0:i.end()}))},r.prototype.pause=function(){return!!n.prototype.pause.call(this)&&(this._stream.pause(),!0)},r.prototype.resume=function(){return!!n.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},i.exports=r},{"../stream/GenericWorker":28,"../utils":32}],13:[function(t,i){var e=t("readable-stream").Readable;function n(t,i,n){e.call(this,i),this._helper=t;var r=this;t.on("data",(function(t,i){r.push(t)||r._helper.pause(),n&&n(i)})).on("error",(function(t){r.emit("error",t)})).on("end",(function(){r.push(null)}))}t("../utils").inherits(n,e),n.prototype._read=function(){this._helper.resume()},i.exports=n},{"../utils":32,"readable-stream":16}],14:[function(t,i){i.exports={isNode:"undefined"!=typeof Buffer,newBufferFrom:function(t,i){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(t,i);if("number"==typeof t)throw new Error('The "data" argument must not be a number');return new Buffer(t,i)},allocBuffer:function(t){if(Buffer.alloc)return Buffer.alloc(t);var i=new Buffer(t);return i.fill(0),i},isBuffer:function(t){return Buffer.isBuffer(t)},isStream:function(t){return t&&"function"==typeof t.on&&"function"==typeof t.pause&&"function"==typeof t.resume}}},{}],15:[function(t,i){function e(t,i,e){var n,o=r.getTypeOf(i),c=r.extend(e||{},a);c.date=c.date||new Date,null!==c.compression&&(c.compression=c.compression.toUpperCase()),"string"==typeof c.unixPermissions&&(c.unixPermissions=parseInt(c.unixPermissions,8)),c.unixPermissions&&16384&c.unixPermissions&&(c.dir=!0),c.dosPermissions&&16&c.dosPermissions&&(c.dir=!0),c.dir&&(t=p(t)),c.createFolders&&(n=f(t))&&g.call(this,n,!0),e&&void 0!==e.binary||(c.binary=!("string"===o&&!1===c.binary&&!1===c.base64)),(i instanceof h&&0===i.uncompressedSize||c.dir||!i||0===i.length)&&(c.base64=!1,c.binary=!0,i="",c.compression="STORE",o="string");var m;m=i instanceof h||i instanceof s?i:l.isNode&&l.isStream(i)?new d(t,i):r.prepareContent(t,i,c.binary,c.optimizedBinaryString,c.base64);var b=new u(t,m,c);this.files[t]=b}var n=t("./utf8"),r=t("./utils"),s=t("./stream/GenericWorker"),o=t("./stream/StreamHelper"),a=t("./defaults"),h=t("./compressedObject"),u=t("./zipObject"),c=t("./generate"),l=t("./nodejsUtils"),d=t("./nodejs/NodejsStreamInputAdapter"),f=function(t){"/"===t.slice(-1)&&(t=t.substring(0,t.length-1));var i=t.lastIndexOf("/");return 0<i?t.substring(0,i):""},p=function(t){return"/"!==t.slice(-1)&&(t+="/"),t},g=function(t,i){return i=void 0!==i?i:a.createFolders,t=p(t),this.files[t]||e.call(this,t,null,{dir:!0,createFolders:i}),this.files[t]};function m(t){return"[object RegExp]"===Object.prototype.toString.call(t)}var b={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(t){var i,e,n;for(i in this.files)n=this.files[i],(e=i.slice(this.root.length,i.length))&&i.slice(0,this.root.length)===this.root&&t(e,n)},filter:function(t){var i=[];return this.forEach((function(e,n){t(e,n)&&i.push(n)})),i},file:function(t,i,n){if(1!==arguments.length)return e.call(this,t=this.root+t,i,n),this;if(m(t)){var r=t;return this.filter((function(t,i){return!i.dir&&r.test(t)}))}var s=this.files[this.root+t];return s&&!s.dir?s:null},folder:function(t){if(!t)return this;if(m(t))return this.filter((function(i,e){return e.dir&&t.test(i)}));var i=g.call(this,this.root+t),e=this.clone();return e.root=i.name,e},remove:function(t){var i=this.files[t=this.root+t];if(i||("/"!==t.slice(-1)&&(t+="/"),i=this.files[t]),i&&!i.dir)delete this.files[t];else for(var e=this.filter((function(i,e){return e.name.slice(0,t.length)===t})),n=0;n<e.length;n++)delete this.files[e[n].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(t){var i,e={};try{if((e=r.extend(t||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:n.utf8encode})).type=e.type.toLowerCase(),e.compression=e.compression.toUpperCase(),"binarystring"===e.type&&(e.type="string"),!e.type)throw new Error("No output type specified.");r.checkSupport(e.type),"darwin"!==e.platform&&"freebsd"!==e.platform&&"linux"!==e.platform&&"sunos"!==e.platform||(e.platform="UNIX"),"win32"===e.platform&&(e.platform="DOS"),i=c.generateWorker(this,e,e.comment||this.comment||"")}catch(t){(i=new s("error")).error(t)}return new o(i,e.type||"string",e.mimeType)},generateAsync:function(t,i){return this.generateInternalStream(t).accumulate(i)},generateNodeStream:function(t,i){return(t=t||{}).type||(t.type="nodebuffer"),this.generateInternalStream(t).toNodejsStream(i)}};i.exports=b},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(t,i){i.exports=t("stream")},{stream:void 0}],17:[function(t,i){var e=t("./DataReader");function n(t){e.call(this,t);for(var i=0;i<this.data.length;i++)t[i]=255&t[i]}t("../utils").inherits(n,e),n.prototype.byteAt=function(t){return this.data[this.zero+t]},n.prototype.lastIndexOfSignature=function(t){for(var i=t.charCodeAt(0),e=t.charCodeAt(1),n=t.charCodeAt(2),r=t.charCodeAt(3),s=this.length-4;0<=s;--s)if(this.data[s]===i&&this.data[s+1]===e&&this.data[s+2]===n&&this.data[s+3]===r)return s-this.zero;return-1},n.prototype.readAndCheckSignature=function(t){var i=t.charCodeAt(0),e=t.charCodeAt(1),n=t.charCodeAt(2),r=t.charCodeAt(3),s=this.readData(4);return i===s[0]&&e===s[1]&&n===s[2]&&r===s[3]},n.prototype.readData=function(t){if(this.checkOffset(t),0===t)return[];var i=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,i},i.exports=n},{"../utils":32,"./DataReader":18}],18:[function(t,i){var e=t("../utils");function n(t){this.data=t,this.length=t.length,this.index=0,this.zero=0}n.prototype={checkOffset:function(t){this.checkIndex(this.index+t)},checkIndex:function(t){if(this.length<this.zero+t||t<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+t+"). Corrupted zip ?")},setIndex:function(t){this.checkIndex(t),this.index=t},skip:function(t){this.setIndex(this.index+t)},byteAt:function(){},readInt:function(t){var i,e=0;for(this.checkOffset(t),i=this.index+t-1;i>=this.index;i--)e=(e<<8)+this.byteAt(i);return this.index+=t,e},readString:function(t){return e.transformTo("string",this.readData(t))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var t=this.readInt(4);return new Date(Date.UTC(1980+(t>>25&127),(t>>21&15)-1,t>>16&31,t>>11&31,t>>5&63,(31&t)<<1))}},i.exports=n},{"../utils":32}],19:[function(t,i){var e=t("./Uint8ArrayReader");function n(t){e.call(this,t)}t("../utils").inherits(n,e),n.prototype.readData=function(t){this.checkOffset(t);var i=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,i},i.exports=n},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(t,i){var e=t("./DataReader");function n(t){e.call(this,t)}t("../utils").inherits(n,e),n.prototype.byteAt=function(t){return this.data.charCodeAt(this.zero+t)},n.prototype.lastIndexOfSignature=function(t){return this.data.lastIndexOf(t)-this.zero},n.prototype.readAndCheckSignature=function(t){return t===this.readData(4)},n.prototype.readData=function(t){this.checkOffset(t);var i=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,i},i.exports=n},{"../utils":32,"./DataReader":18}],21:[function(t,i){var e=t("./ArrayReader");function n(t){e.call(this,t)}t("../utils").inherits(n,e),n.prototype.readData=function(t){if(this.checkOffset(t),0===t)return new Uint8Array(0);var i=this.data.subarray(this.zero+this.index,this.zero+this.index+t);return this.index+=t,i},i.exports=n},{"../utils":32,"./ArrayReader":17}],22:[function(t,i){var e=t("../utils"),n=t("../support"),r=t("./ArrayReader"),s=t("./StringReader"),o=t("./NodeBufferReader"),a=t("./Uint8ArrayReader");i.exports=function(t){var i=e.getTypeOf(t);return e.checkSupport(i),"string"!==i||n.uint8array?"nodebuffer"===i?new o(t):n.uint8array?new a(e.transformTo("uint8array",t)):new r(e.transformTo("array",t)):new s(t)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(t,i,e){e.LOCAL_FILE_HEADER="PK",e.CENTRAL_FILE_HEADER="PK",e.CENTRAL_DIRECTORY_END="PK",e.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",e.ZIP64_CENTRAL_DIRECTORY_END="PK",e.DATA_DESCRIPTOR="PK\b"},{}],24:[function(t,i){var e=t("./GenericWorker"),n=t("../utils");function r(t){e.call(this,"ConvertWorker to "+t),this.destType=t}n.inherits(r,e),r.prototype.processChunk=function(t){this.push({data:n.transformTo(this.destType,t.data),meta:t.meta})},i.exports=r},{"../utils":32,"./GenericWorker":28}],25:[function(t,i){var e=t("./GenericWorker"),n=t("../crc32");function r(){e.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t("../utils").inherits(r,e),r.prototype.processChunk=function(t){this.streamInfo.crc32=n(t.data,this.streamInfo.crc32||0),this.push(t)},i.exports=r},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(t,i){var e=t("../utils"),n=t("./GenericWorker");function r(t){n.call(this,"DataLengthProbe for "+t),this.propName=t,this.withStreamInfo(t,0)}e.inherits(r,n),r.prototype.processChunk=function(t){t&&(this.streamInfo[this.propName]=(this.streamInfo[this.propName]||0)+t.data.length),n.prototype.processChunk.call(this,t)},i.exports=r},{"../utils":32,"./GenericWorker":28}],27:[function(t,i){var e=t("../utils"),n=t("./GenericWorker");function r(t){n.call(this,"DataWorker");var i=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,t.then((function(t){i.dataIsReady=!0,i.data=t,i.max=t&&t.length||0,i.type=e.getTypeOf(t),i.isPaused||i._tickAndRepeat()}),(function(t){i.error(t)}))}e.inherits(r,n),r.prototype.cleanUp=function(){n.prototype.cleanUp.call(this),this.data=null},r.prototype.resume=function(){return!!n.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,e.delay(this._tickAndRepeat,[],this)),!0)},r.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(e.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},r.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var t=null,i=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,i);break;case"uint8array":t=this.data.subarray(this.index,i);break;case"array":case"nodebuffer":t=this.data.slice(this.index,i)}return this.index=i,this.push({data:t,meta:{percent:this.max?this.index/this.max*100:0}})},i.exports=r},{"../utils":32,"./GenericWorker":28}],28:[function(t,i){function e(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}e.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,i){return this._listeners[t].push(i),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(t,i){if(this._listeners[t])for(var e=0;e<this._listeners[t].length;e++)this._listeners[t][e].call(this,i)},pipe:function(t){return t.registerPrevious(this)},registerPrevious:function(t){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=t.streamInfo,this.mergeStreamInfo(),this.previous=t;var i=this;return t.on("data",(function(t){i.processChunk(t)})),t.on("end",(function(){i.end()})),t.on("error",(function(t){i.error(t)})),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var t=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),t=!0),this.previous&&this.previous.resume(),!t},flush:function(){},processChunk:function(t){this.push(t)},withStreamInfo:function(t,i){return this.extraStreamInfo[t]=i,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var t in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,t)&&(this.streamInfo[t]=this.extraStreamInfo[t])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var t="Worker "+this.name;return this.previous?this.previous+" -> "+t:t}},i.exports=e},{}],29:[function(t,i){var e=t("../utils"),n=t("./ConvertWorker"),r=t("./GenericWorker"),s=t("../base64"),o=t("../support"),a=t("../external"),h=null;if(o.nodestream)try{h=t("../nodejs/NodejsStreamOutputAdapter")}catch(t){}function u(t,i,s){var o=i;switch(i){case"blob":case"arraybuffer":o="uint8array";break;case"base64":o="string"}try{this._internalType=o,this._outputType=i,this._mimeType=s,e.checkSupport(o),this._worker=t.pipe(new n(o)),t.lock()}catch(t){this._worker=new r("error"),this._worker.error(t)}}u.prototype={accumulate:function(t){return function(t,i){return new a.Promise((function(n,r){var o=[],a=t._internalType,h=t._outputType,u=t._mimeType;t.on("data",(function(t,e){o.push(t),i&&i(e)})).on("error",(function(t){o=[],r(t)})).on("end",(function(){try{var t=function(t,i,n){switch(t){case"blob":return e.newBlob(e.transformTo("arraybuffer",i),n);case"base64":return s.encode(i);default:return e.transformTo(t,i)}}(h,function(t,i){var e,n=0,r=null,s=0;for(e=0;e<i.length;e++)s+=i[e].length;switch(t){case"string":return i.join("");case"array":return Array.prototype.concat.apply([],i);case"uint8array":for(r=new Uint8Array(s),e=0;e<i.length;e++)r.set(i[e],n),n+=i[e].length;return r;case"nodebuffer":return Buffer.concat(i);default:throw new Error("concat : unsupported type '"+t+"'")}}(a,o),u);n(t)}catch(t){r(t)}o=[]})).resume()}))}(this,t)},on:function(t,i){var n=this;return this._worker.on(t,"data"===t?function(t){i.call(n,t.data,t.meta)}:function(){e.delay(i,arguments,n)}),this},resume:function(){return e.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(t){if(e.checkSupport("nodestream"),"nodebuffer"!==this._outputType)throw new Error(this._outputType+" is not supported by this method");return new h(this,{objectMode:"nodebuffer"!==this._outputType},t)}},i.exports=u},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(t,i,e){if(e.base64=!0,e.array=!0,e.string=!0,e.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,e.nodebuffer="undefined"!=typeof Buffer,e.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)e.blob=!1;else{var n=new ArrayBuffer(0);try{e.blob=0===new Blob([n],{type:"application/zip"}).size}catch(t){try{var r=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);r.append(n),e.blob=0===r.getBlob("application/zip").size}catch(t){e.blob=!1}}}try{e.nodestream=!!t("readable-stream").Readable}catch(t){e.nodestream=!1}},{"readable-stream":16}],31:[function(t,i,e){for(var n=t("./utils"),r=t("./support"),s=t("./nodejsUtils"),o=t("./stream/GenericWorker"),a=new Array(256),h=0;h<256;h++)a[h]=252<=h?6:248<=h?5:240<=h?4:224<=h?3:192<=h?2:1;function u(){o.call(this,"utf-8 decode"),this.leftOver=null}function c(){o.call(this,"utf-8 encode")}a[254]=a[254]=1,e.utf8encode=function(t){return r.nodebuffer?s.newBufferFrom(t,"utf-8"):function(t){var i,e,n,s,o,a=t.length,h=0;for(s=0;s<a;s++)55296==(64512&(e=t.charCodeAt(s)))&&s+1<a&&56320==(64512&(n=t.charCodeAt(s+1)))&&(e=65536+(e-55296<<10)+(n-56320),s++),h+=e<128?1:e<2048?2:e<65536?3:4;for(i=r.uint8array?new Uint8Array(h):new Array(h),s=o=0;o<h;s++)55296==(64512&(e=t.charCodeAt(s)))&&s+1<a&&56320==(64512&(n=t.charCodeAt(s+1)))&&(e=65536+(e-55296<<10)+(n-56320),s++),e<128?i[o++]=e:(e<2048?i[o++]=192|e>>>6:(e<65536?i[o++]=224|e>>>12:(i[o++]=240|e>>>18,i[o++]=128|e>>>12&63),i[o++]=128|e>>>6&63),i[o++]=128|63&e);return i}(t)},e.utf8decode=function(t){return r.nodebuffer?n.transformTo("nodebuffer",t).toString("utf-8"):function(t){var i,e,r,s,o=t.length,h=new Array(2*o);for(i=e=0;i<o;)if((r=t[i++])<128)h[e++]=r;else if(4<(s=a[r]))h[e++]=65533,i+=s-1;else{for(r&=2===s?31:3===s?15:7;1<s&&i<o;)r=r<<6|63&t[i++],s--;1<s?h[e++]=65533:r<65536?h[e++]=r:(h[e++]=55296|(r-=65536)>>10&1023,h[e++]=56320|1023&r)}return h.length!==e&&(h.subarray?h=h.subarray(0,e):h.length=e),n.applyFromCharCode(h)}(t=n.transformTo(r.uint8array?"uint8array":"array",t))},n.inherits(u,o),u.prototype.processChunk=function(t){var i=n.transformTo(r.uint8array?"uint8array":"array",t.data);if(this.leftOver&&this.leftOver.length){if(r.uint8array){var s=i;(i=new Uint8Array(s.length+this.leftOver.length)).set(this.leftOver,0),i.set(s,this.leftOver.length)}else i=this.leftOver.concat(i);this.leftOver=null}var o=function(t,i){var e;for((i=i||t.length)>t.length&&(i=t.length),e=i-1;0<=e&&128==(192&t[e]);)e--;return e<0||0===e?i:e+a[t[e]]>i?e:i}(i),h=i;o!==i.length&&(r.uint8array?(h=i.subarray(0,o),this.leftOver=i.subarray(o,i.length)):(h=i.slice(0,o),this.leftOver=i.slice(o,i.length))),this.push({data:e.utf8decode(h),meta:t.meta})},u.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:e.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},e.Utf8DecodeWorker=u,n.inherits(c,o),c.prototype.processChunk=function(t){this.push({data:e.utf8encode(t.data),meta:t.meta})},e.Utf8EncodeWorker=c},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,i,e){var n=t("./support"),r=t("./base64"),s=t("./nodejsUtils"),o=t("./external");function a(t){return t}function h(t,i){for(var e=0;e<t.length;++e)i[e]=255&t.charCodeAt(e);return i}t("setimmediate"),e.newBlob=function(t,i){e.checkSupport("blob");try{return new Blob([t],{type:i})}catch(e){try{var n=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return n.append(t),n.getBlob(i)}catch(t){throw new Error("Bug : can't construct the Blob.")}}};var u={stringifyByChunk:function(t,i,e){var n=[],r=0,s=t.length;if(s<=e)return String.fromCharCode.apply(null,t);for(;r<s;)n.push(String.fromCharCode.apply(null,"array"===i||"nodebuffer"===i?t.slice(r,Math.min(r+e,s)):t.subarray(r,Math.min(r+e,s)))),r+=e;return n.join("")},stringifyByChar:function(t){for(var i="",e=0;e<t.length;e++)i+=String.fromCharCode(t[e]);return i},applyCanBeUsed:{uint8array:function(){try{return n.uint8array&&1===String.fromCharCode.apply(null,new Uint8Array(1)).length}catch(t){return!1}}(),nodebuffer:function(){try{return n.nodebuffer&&1===String.fromCharCode.apply(null,s.allocBuffer(1)).length}catch(t){return!1}}()}};function c(t){var i=65536,n=e.getTypeOf(t),r=!0;if("uint8array"===n?r=u.applyCanBeUsed.uint8array:"nodebuffer"===n&&(r=u.applyCanBeUsed.nodebuffer),r)for(;1<i;)try{return u.stringifyByChunk(t,n,i)}catch(t){i=Math.floor(i/2)}return u.stringifyByChar(t)}function l(t,i){for(var e=0;e<t.length;e++)i[e]=t[e];return i}e.applyFromCharCode=c;var d={};d.string={string:a,array:function(t){return h(t,new Array(t.length))},arraybuffer:function(t){return d.string.uint8array(t).buffer},uint8array:function(t){return h(t,new Uint8Array(t.length))},nodebuffer:function(t){return h(t,s.allocBuffer(t.length))}},d.array={string:c,array:a,arraybuffer:function(t){return new Uint8Array(t).buffer},uint8array:function(t){return new Uint8Array(t)},nodebuffer:function(t){return s.newBufferFrom(t)}},d.arraybuffer={string:function(t){return c(new Uint8Array(t))},array:function(t){return l(new Uint8Array(t),new Array(t.byteLength))},arraybuffer:a,uint8array:function(t){return new Uint8Array(t)},nodebuffer:function(t){return s.newBufferFrom(new Uint8Array(t))}},d.uint8array={string:c,array:function(t){return l(t,new Array(t.length))},arraybuffer:function(t){return t.buffer},uint8array:a,nodebuffer:function(t){return s.newBufferFrom(t)}},d.nodebuffer={string:c,array:function(t){return l(t,new Array(t.length))},arraybuffer:function(t){return d.nodebuffer.uint8array(t).buffer},uint8array:function(t){return l(t,new Uint8Array(t.length))},nodebuffer:a},e.transformTo=function(t,i){if(i=i||"",!t)return i;e.checkSupport(t);var n=e.getTypeOf(i);return d[n][t](i)},e.resolve=function(t){for(var i=t.split("/"),e=[],n=0;n<i.length;n++){var r=i[n];"."===r||""===r&&0!==n&&n!==i.length-1||(".."===r?e.pop():e.push(r))}return e.join("/")},e.getTypeOf=function(t){return"string"==typeof t?"string":"[object Array]"===Object.prototype.toString.call(t)?"array":n.nodebuffer&&s.isBuffer(t)?"nodebuffer":n.uint8array&&t instanceof Uint8Array?"uint8array":n.arraybuffer&&t instanceof ArrayBuffer?"arraybuffer":void 0},e.checkSupport=function(t){if(!n[t.toLowerCase()])throw new Error(t+" is not supported by this platform")},e.MAX_VALUE_16BITS=65535,e.MAX_VALUE_32BITS=-1,e.pretty=function(t){var i,e,n="";for(e=0;e<(t||"").length;e++)n+="\\x"+((i=t.charCodeAt(e))<16?"0":"")+i.toString(16).toUpperCase();return n},e.delay=function(t,i,e){setImmediate((function(){t.apply(e||null,i||[])}))},e.inherits=function(t,i){function e(){}e.prototype=i.prototype,t.prototype=new e},e.extend=function(){var t,i,e={};for(t=0;t<arguments.length;t++)for(i in arguments[t])Object.prototype.hasOwnProperty.call(arguments[t],i)&&void 0===e[i]&&(e[i]=arguments[t][i]);return e},e.prepareContent=function(t,i,s,a,u){return o.Promise.resolve(i).then((function(t){return n.blob&&(t instanceof Blob||-1!==["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(t)))&&"undefined"!=typeof FileReader?new o.Promise((function(i,e){var n=new FileReader;n.onload=function(t){i(t.target.result)},n.onerror=function(t){e(t.target.error)},n.readAsArrayBuffer(t)})):t})).then((function(i){var c=e.getTypeOf(i);return c?("arraybuffer"===c?i=e.transformTo("uint8array",i):"string"===c&&(u?i=r.decode(i):s&&!0!==a&&(i=function(t){return h(t,n.uint8array?new Uint8Array(t.length):new Array(t.length))}(i))),i):o.Promise.reject(new Error("Can't read the data of '"+t+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))}))}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(t,i){var e=t("./reader/readerFor"),n=t("./utils"),r=t("./signature"),s=t("./zipEntry"),o=t("./support");function a(t){this.files=[],this.loadOptions=t}a.prototype={checkSignature:function(t){if(!this.reader.readAndCheckSignature(t)){this.reader.index-=4;var i=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+n.pretty(i)+", expected "+n.pretty(t)+")")}},isSignature:function(t,i){var e=this.reader.index;this.reader.setIndex(t);var n=this.reader.readString(4)===i;return this.reader.setIndex(e),n},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),i=n.transformTo(o.uint8array?"uint8array":"array",t);this.zipComment=this.loadOptions.decodeFileName(i)},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,i,e,n=this.zip64EndOfCentralSize-44;0<n;)t=this.reader.readInt(2),i=this.reader.readInt(4),e=this.reader.readData(i),this.zip64ExtensibleData[t]={id:t,length:i,value:e}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var t,i;for(t=0;t<this.files.length;t++)this.reader.setIndex((i=this.files[t]).localHeaderOffset),this.checkSignature(r.LOCAL_FILE_HEADER),i.readLocalPart(this.reader),i.handleUTF8(),i.processAttributes()},readCentralDir:function(){var t;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(r.CENTRAL_FILE_HEADER);)(t=new s({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(t);if(this.centralDirRecords!==this.files.length&&0!==this.centralDirRecords&&0===this.files.length)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var t=this.reader.lastIndexOfSignature(r.CENTRAL_DIRECTORY_END);if(t<0)throw this.isSignature(0,r.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(t);var i=t;if(this.checkSignature(r.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===n.MAX_VALUE_16BITS||this.diskWithCentralDirStart===n.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===n.MAX_VALUE_16BITS||this.centralDirRecords===n.MAX_VALUE_16BITS||this.centralDirSize===n.MAX_VALUE_32BITS||this.centralDirOffset===n.MAX_VALUE_32BITS){if(this.zip64=!0,(t=this.reader.lastIndexOfSignature(r.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(t),this.checkSignature(r.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,r.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(r.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(r.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var e=this.centralDirOffset+this.centralDirSize;this.zip64&&(e+=20,e+=12+this.zip64EndOfCentralSize);var s=i-e;if(0<s)this.isSignature(i,r.CENTRAL_FILE_HEADER)||(this.reader.zero=s);else if(s<0)throw new Error("Corrupted zip: missing "+Math.abs(s)+" bytes.")},prepareReader:function(t){this.reader=e(t)},load:function(t){this.prepareReader(t),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},i.exports=a},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(t,i){var e=t("./reader/readerFor"),n=t("./utils"),r=t("./compressedObject"),s=t("./crc32"),o=t("./utf8"),a=t("./compressions"),h=t("./support");function u(t,i){this.options=t,this.loadOptions=i}u.prototype={isEncrypted:function(){return!(1&~this.bitFlag)},useUTF8:function(){return!(2048&~this.bitFlag)},readLocalPart:function(t){var i,e;if(t.skip(22),this.fileNameLength=t.readInt(2),e=t.readInt(2),this.fileName=t.readData(this.fileNameLength),t.skip(e),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(i=function(t){for(var i in a)if(Object.prototype.hasOwnProperty.call(a,i)&&a[i].magic===t)return a[i];return null}(this.compressionMethod)))throw new Error("Corrupted zip : compression "+n.pretty(this.compressionMethod)+" unknown (inner file : "+n.transformTo("string",this.fileName)+")");this.decompressed=new r(this.compressedSize,this.uncompressedSize,this.crc32,i,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 i=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 new Error("Encrypted zip are not supported");t.skip(i),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=e(this.extraFields[1].value);this.uncompressedSize===n.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===n.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===n.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===n.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4))}},readExtraFields:function(t){var i,e,n,r=t.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});t.index+4<r;)i=t.readInt(2),e=t.readInt(2),n=t.readData(e),this.extraFields[i]={id:i,length:e,value:n};t.setIndex(r)},handleUTF8:function(){var t=h.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=o.utf8decode(this.fileName),this.fileCommentStr=o.utf8decode(this.fileComment);else{var i=this.findExtraFieldUnicodePath();if(null!==i)this.fileNameStr=i;else{var e=n.transformTo(t,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(e)}var r=this.findExtraFieldUnicodeComment();if(null!==r)this.fileCommentStr=r;else{var s=n.transformTo(t,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(s)}}},findExtraFieldUnicodePath:function(){var t=this.extraFields[28789];if(t){var i=e(t.value);return 1!==i.readInt(1)||s(this.fileName)!==i.readInt(4)?null:o.utf8decode(i.readData(t.length-5))}return null},findExtraFieldUnicodeComment:function(){var t=this.extraFields[25461];if(t){var i=e(t.value);return 1!==i.readInt(1)||s(this.fileComment)!==i.readInt(4)?null:o.utf8decode(i.readData(t.length-5))}return null}},i.exports=u},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(t,i){function e(t,i,e){this.name=t,this.dir=e.dir,this.date=e.date,this.comment=e.comment,this.unixPermissions=e.unixPermissions,this.dosPermissions=e.dosPermissions,this._data=i,this._dataBinary=e.binary,this.options={compression:e.compression,compressionOptions:e.compressionOptions}}var n=t("./stream/StreamHelper"),r=t("./stream/DataWorker"),s=t("./utf8"),o=t("./compressedObject"),a=t("./stream/GenericWorker");e.prototype={internalStream:function(t){var i=null,e="string";try{if(!t)throw new Error("No output type specified.");var r="string"===(e=t.toLowerCase())||"text"===e;"binarystring"!==e&&"text"!==e||(e="string"),i=this._decompressWorker();var o=!this._dataBinary;o&&!r&&(i=i.pipe(new s.Utf8EncodeWorker)),!o&&r&&(i=i.pipe(new s.Utf8DecodeWorker))}catch(t){(i=new a("error")).error(t)}return new n(i,e,"")},async:function(t,i){return this.internalStream(t).accumulate(i)},nodeStream:function(t,i){return this.internalStream(t||"nodebuffer").toNodejsStream(i)},_compressWorker:function(t,i){if(this._data instanceof o&&this._data.compression.magic===t.magic)return this._data.getCompressedWorker();var e=this._decompressWorker();return this._dataBinary||(e=e.pipe(new s.Utf8EncodeWorker)),o.createWorkerFrom(e,t,i)},_decompressWorker:function(){return this._data instanceof o?this._data.getContentWorker():this._data instanceof a?this._data:new r(this._data)}};for(var h=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],u=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},c=0;c<h.length;c++)e.prototype[h[c]]=u;i.exports=e},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(t,i){(function(t){var e,n,r=t.MutationObserver||t.WebKitMutationObserver;if(r){var s=0,o=new r(c),a=t.document.createTextNode("");o.observe(a,{characterData:!0}),e=function(){a.data=s=++s%2}}else if(t.setImmediate||void 0===t.MessageChannel)e="document"in t&&"onreadystatechange"in t.document.createElement("script")?function(){var i=t.document.createElement("script");i.onreadystatechange=function(){c(),i.onreadystatechange=null,i.parentNode.removeChild(i),i=null},t.document.documentElement.appendChild(i)}:function(){setTimeout(c,0)};else{var h=new t.MessageChannel;h.port1.onmessage=c,e=function(){h.port2.postMessage(0)}}var u=[];function c(){var t,i;n=!0;for(var e=u.length;e;){for(i=u,u=[],t=-1;++t<e;)i[t]();e=u.length}n=!1}i.exports=function(t){1!==u.push(t)||n||e()}}).call(this,void 0!==C?C:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],37:[function(t,i){var e=t("immediate");function n(){}var r={},s=["REJECTED"],o=["FULFILLED"],a=["PENDING"];function h(t){if("function"!=typeof t)throw new TypeError("resolver must be a function");this.state=a,this.queue=[],this.outcome=void 0,t!==n&&d(this,t)}function u(t,i,e){this.promise=t,"function"==typeof i&&(this.onFulfilled=i,this.callFulfilled=this.otherCallFulfilled),"function"==typeof e&&(this.onRejected=e,this.callRejected=this.otherCallRejected)}function c(t,i,n){e((function(){var e;try{e=i(n)}catch(e){return r.reject(t,e)}e===t?r.reject(t,new TypeError("Cannot resolve promise with itself")):r.resolve(t,e)}))}function l(t){var i=t&&t.then;if(t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof i)return function(){i.apply(t,arguments)}}function d(t,i){var e=!1;function n(i){e||(e=!0,r.reject(t,i))}function s(i){e||(e=!0,r.resolve(t,i))}var o=f((function(){i(s,n)}));"error"===o.status&&n(o.value)}function f(t,i){var e={};try{e.value=t(i),e.status="success"}catch(t){e.status="error",e.value=t}return e}(i.exports=h).prototype.finally=function(t){if("function"!=typeof t)return this;var i=this.constructor;return this.then((function(e){return i.resolve(t()).then((function(){return e}))}),(function(e){return i.resolve(t()).then((function(){throw e}))}))},h.prototype.catch=function(t){return this.then(null,t)},h.prototype.then=function(t,i){if("function"!=typeof t&&this.state===o||"function"!=typeof i&&this.state===s)return this;var e=new this.constructor(n);return this.state!==a?c(e,this.state===o?t:i,this.outcome):this.queue.push(new u(e,t,i)),e},u.prototype.callFulfilled=function(t){r.resolve(this.promise,t)},u.prototype.otherCallFulfilled=function(t){c(this.promise,this.onFulfilled,t)},u.prototype.callRejected=function(t){r.reject(this.promise,t)},u.prototype.otherCallRejected=function(t){c(this.promise,this.onRejected,t)},r.resolve=function(t,i){var e=f(l,i);if("error"===e.status)return r.reject(t,e.value);var n=e.value;if(n)d(t,n);else{t.state=o,t.outcome=i;for(var s=-1,a=t.queue.length;++s<a;)t.queue[s].callFulfilled(i)}return t},r.reject=function(t,i){t.state=s,t.outcome=i;for(var e=-1,n=t.queue.length;++e<n;)t.queue[e].callRejected(i);return t},h.resolve=function(t){return t instanceof this?t:r.resolve(new this(n),t)},h.reject=function(t){var i=new this(n);return r.reject(i,t)},h.all=function(t){var i=this;if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var e=t.length,s=!1;if(!e)return this.resolve([]);for(var o=new Array(e),a=0,h=-1,u=new this(n);++h<e;)c(t[h],h);return u;function c(t,n){i.resolve(t).then((function(t){o[n]=t,++a!==e||s||(s=!0,r.resolve(u,o))}),(function(t){s||(s=!0,r.reject(u,t))}))}},h.race=function(t){if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var i=t.length,e=!1;if(!i)return this.resolve([]);for(var s=-1,o=new this(n);++s<i;)this.resolve(t[s]).then((function(t){e||(e=!0,r.resolve(o,t))}),(function(t){e||(e=!0,r.reject(o,t))}));return o}},{immediate:36}],38:[function(t,i){var e={};(0,t("./lib/utils/common").assign)(e,t("./lib/deflate"),t("./lib/inflate"),t("./lib/zlib/constants")),i.exports=e},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(t,i,e){var n=t("./zlib/deflate"),r=t("./utils/common"),s=t("./utils/strings"),o=t("./zlib/messages"),a=t("./zlib/zstream"),h=Object.prototype.toString;function u(t){if(!(this instanceof u))return new u(t);this.options=r.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},t||{});var i=this.options;i.raw&&0<i.windowBits?i.windowBits=-i.windowBits:i.gzip&&0<i.windowBits&&i.windowBits<16&&(i.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new a,this.strm.avail_out=0;var e=n.deflateInit2(this.strm,i.level,i.method,i.windowBits,i.memLevel,i.strategy);if(0!==e)throw new Error(o[e]);if(i.header&&n.deflateSetHeader(this.strm,i.header),i.dictionary){var c;if(c="string"==typeof i.dictionary?s.string2buf(i.dictionary):"[object ArrayBuffer]"===h.call(i.dictionary)?new Uint8Array(i.dictionary):i.dictionary,0!==(e=n.deflateSetDictionary(this.strm,c)))throw new Error(o[e]);this._dict_set=!0}}function c(t,i){var e=new u(i);if(e.push(t,!0),e.err)throw e.msg||o[e.err];return e.result}u.prototype.push=function(t,i){var e,o,a=this.strm,u=this.options.chunkSize;if(this.ended)return!1;o=i===~~i?i:!0===i?4:0,a.input="string"==typeof t?s.string2buf(t):"[object ArrayBuffer]"===h.call(t)?new Uint8Array(t):t,a.next_in=0,a.avail_in=a.input.length;do{if(0===a.avail_out&&(a.output=new r.Buf8(u),a.next_out=0,a.avail_out=u),1!==(e=n.deflate(a,o))&&0!==e)return this.onEnd(e),!(this.ended=!0);0!==a.avail_out&&(0!==a.avail_in||4!==o&&2!==o)||this.onData("string"===this.options.to?s.buf2binstring(r.shrinkBuf(a.output,a.next_out)):r.shrinkBuf(a.output,a.next_out))}while((0<a.avail_in||0===a.avail_out)&&1!==e);return 4===o?(e=n.deflateEnd(this.strm),this.onEnd(e),this.ended=!0,0===e):2!==o||(this.onEnd(0),!(a.avail_out=0))},u.prototype.onData=function(t){this.chunks.push(t)},u.prototype.onEnd=function(t){0===t&&(this.result="string"===this.options.to?this.chunks.join(""):r.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},e.Deflate=u,e.deflate=c,e.deflateRaw=function(t,i){return(i=i||{}).raw=!0,c(t,i)},e.gzip=function(t,i){return(i=i||{}).gzip=!0,c(t,i)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(t,i,e){var n=t("./zlib/inflate"),r=t("./utils/common"),s=t("./utils/strings"),o=t("./zlib/constants"),a=t("./zlib/messages"),h=t("./zlib/zstream"),u=t("./zlib/gzheader"),c=Object.prototype.toString;function l(t){if(!(this instanceof l))return new l(t);this.options=r.assign({chunkSize:16384,windowBits:0,to:""},t||{});var i=this.options;i.raw&&0<=i.windowBits&&i.windowBits<16&&(i.windowBits=-i.windowBits,0===i.windowBits&&(i.windowBits=-15)),!(0<=i.windowBits&&i.windowBits<16)||t&&t.windowBits||(i.windowBits+=32),15<i.windowBits&&i.windowBits<48&&!(15&i.windowBits)&&(i.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new h,this.strm.avail_out=0;var e=n.inflateInit2(this.strm,i.windowBits);if(e!==o.Z_OK)throw new Error(a[e]);this.header=new u,n.inflateGetHeader(this.strm,this.header)}function d(t,i){var e=new l(i);if(e.push(t,!0),e.err)throw e.msg||a[e.err];return e.result}l.prototype.push=function(t,i){var e,a,h,u,l,d,f=this.strm,p=this.options.chunkSize,g=this.options.dictionary,m=!1;if(this.ended)return!1;a=i===~~i?i:!0===i?o.Z_FINISH:o.Z_NO_FLUSH,f.input="string"==typeof t?s.binstring2buf(t):"[object ArrayBuffer]"===c.call(t)?new Uint8Array(t):t,f.next_in=0,f.avail_in=f.input.length;do{if(0===f.avail_out&&(f.output=new r.Buf8(p),f.next_out=0,f.avail_out=p),(e=n.inflate(f,o.Z_NO_FLUSH))===o.Z_NEED_DICT&&g&&(d="string"==typeof g?s.string2buf(g):"[object ArrayBuffer]"===c.call(g)?new Uint8Array(g):g,e=n.inflateSetDictionary(this.strm,d)),e===o.Z_BUF_ERROR&&!0===m&&(e=o.Z_OK,m=!1),e!==o.Z_STREAM_END&&e!==o.Z_OK)return this.onEnd(e),!(this.ended=!0);f.next_out&&(0!==f.avail_out&&e!==o.Z_STREAM_END&&(0!==f.avail_in||a!==o.Z_FINISH&&a!==o.Z_SYNC_FLUSH)||("string"===this.options.to?(h=s.utf8border(f.output,f.next_out),u=f.next_out-h,l=s.buf2string(f.output,h),f.next_out=u,f.avail_out=p-u,u&&r.arraySet(f.output,f.output,h,u,0),this.onData(l)):this.onData(r.shrinkBuf(f.output,f.next_out)))),0===f.avail_in&&0===f.avail_out&&(m=!0)}while((0<f.avail_in||0===f.avail_out)&&e!==o.Z_STREAM_END);return e===o.Z_STREAM_END&&(a=o.Z_FINISH),a===o.Z_FINISH?(e=n.inflateEnd(this.strm),this.onEnd(e),this.ended=!0,e===o.Z_OK):a!==o.Z_SYNC_FLUSH||(this.onEnd(o.Z_OK),!(f.avail_out=0))},l.prototype.onData=function(t){this.chunks.push(t)},l.prototype.onEnd=function(t){t===o.Z_OK&&(this.result="string"===this.options.to?this.chunks.join(""):r.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},e.Inflate=l,e.inflate=d,e.inflateRaw=function(t,i){return(i=i||{}).raw=!0,d(t,i)},e.ungzip=d},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(t,i,e){var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;e.assign=function(t){for(var i=Array.prototype.slice.call(arguments,1);i.length;){var e=i.shift();if(e){if("object"!=typeof e)throw new TypeError(e+"must be non-object");for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])}}return t},e.shrinkBuf=function(t,i){return t.length===i?t:t.subarray?t.subarray(0,i):(t.length=i,t)};var r={arraySet:function(t,i,e,n,r){if(i.subarray&&t.subarray)t.set(i.subarray(e,e+n),r);else for(var s=0;s<n;s++)t[r+s]=i[e+s]},flattenChunks:function(t){var i,e,n,r,s,o;for(i=n=0,e=t.length;i<e;i++)n+=t[i].length;for(o=new Uint8Array(n),i=r=0,e=t.length;i<e;i++)o.set(s=t[i],r),r+=s.length;return o}},s={arraySet:function(t,i,e,n,r){for(var s=0;s<n;s++)t[r+s]=i[e+s]},flattenChunks:function(t){return[].concat.apply([],t)}};e.setTyped=function(t){t?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,r)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,s))},e.setTyped(n)},{}],42:[function(t,i,e){var n=t("./common"),r=!0,s=!0;try{String.fromCharCode.apply(null,[0])}catch(t){r=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){s=!1}for(var o=new n.Buf8(256),a=0;a<256;a++)o[a]=252<=a?6:248<=a?5:240<=a?4:224<=a?3:192<=a?2:1;function h(t,i){if(i<65537&&(t.subarray&&s||!t.subarray&&r))return String.fromCharCode.apply(null,n.shrinkBuf(t,i));for(var e="",o=0;o<i;o++)e+=String.fromCharCode(t[o]);return e}o[254]=o[254]=1,e.string2buf=function(t){var i,e,r,s,o,a=t.length,h=0;for(s=0;s<a;s++)55296==(64512&(e=t.charCodeAt(s)))&&s+1<a&&56320==(64512&(r=t.charCodeAt(s+1)))&&(e=65536+(e-55296<<10)+(r-56320),s++),h+=e<128?1:e<2048?2:e<65536?3:4;for(i=new n.Buf8(h),s=o=0;o<h;s++)55296==(64512&(e=t.charCodeAt(s)))&&s+1<a&&56320==(64512&(r=t.charCodeAt(s+1)))&&(e=65536+(e-55296<<10)+(r-56320),s++),e<128?i[o++]=e:(e<2048?i[o++]=192|e>>>6:(e<65536?i[o++]=224|e>>>12:(i[o++]=240|e>>>18,i[o++]=128|e>>>12&63),i[o++]=128|e>>>6&63),i[o++]=128|63&e);return i},e.buf2binstring=function(t){return h(t,t.length)},e.binstring2buf=function(t){for(var i=new n.Buf8(t.length),e=0,r=i.length;e<r;e++)i[e]=t.charCodeAt(e);return i},e.buf2string=function(t,i){var e,n,r,s,a=i||t.length,u=new Array(2*a);for(e=n=0;e<a;)if((r=t[e++])<128)u[n++]=r;else if(4<(s=o[r]))u[n++]=65533,e+=s-1;else{for(r&=2===s?31:3===s?15:7;1<s&&e<a;)r=r<<6|63&t[e++],s--;1<s?u[n++]=65533:r<65536?u[n++]=r:(u[n++]=55296|(r-=65536)>>10&1023,u[n++]=56320|1023&r)}return h(u,n)},e.utf8border=function(t,i){var e;for((i=i||t.length)>t.length&&(i=t.length),e=i-1;0<=e&&128==(192&t[e]);)e--;return e<0||0===e?i:e+o[t[e]]>i?e:i}},{"./common":41}],43:[function(t,i){i.exports=function(t,i,e,n){for(var r=65535&t,s=t>>>16&65535,o=0;0!==e;){for(e-=o=2e3<e?2e3:e;s=s+(r=r+i[n++]|0)|0,--o;);r%=65521,s%=65521}return r|s<<16}},{}],44:[function(t,i){i.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}},{}],45:[function(t,i){var e=function(){for(var t,i=[],e=0;e<256;e++){t=e;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;i[e]=t}return i}();i.exports=function(t,i,n,r){var s=e,o=r+n;t^=-1;for(var a=r;a<o;a++)t=t>>>8^s[255&(t^i[a])];return~t}},{}],46:[function(t,i,e){var n,r=t("../utils/common"),s=t("./trees"),o=t("./adler32"),a=t("./crc32"),h=t("./messages"),u=-2,c=258,l=262,d=113;function f(t,i){return t.msg=h[i],i}function p(t){return(t<<1)-(4<t?9:0)}function g(t){for(var i=t.length;0<=--i;)t[i]=0}function m(t){var i=t.state,e=i.pending;e>t.avail_out&&(e=t.avail_out),0!==e&&(r.arraySet(t.output,i.pending_buf,i.pending_out,e,t.next_out),t.next_out+=e,i.pending_out+=e,t.total_out+=e,t.avail_out-=e,i.pending-=e,0===i.pending&&(i.pending_out=0))}function b(t,i){s._tr_flush_block(t,0<=t.block_start?t.block_start:-1,t.strstart-t.block_start,i),t.block_start=t.strstart,m(t.strm)}function v(t,i){t.pending_buf[t.pending++]=i}function w(t,i){t.pending_buf[t.pending++]=i>>>8&255,t.pending_buf[t.pending++]=255&i}function y(t,i){var e,n,r=t.max_chain_length,s=t.strstart,o=t.prev_length,a=t.nice_match,h=t.strstart>t.w_size-l?t.strstart-(t.w_size-l):0,u=t.window,d=t.w_mask,f=t.prev,p=t.strstart+c,g=u[s+o-1],m=u[s+o];t.prev_length>=t.good_match&&(r>>=2),a>t.lookahead&&(a=t.lookahead);do{if(u[(e=i)+o]===m&&u[e+o-1]===g&&u[e]===u[s]&&u[++e]===u[s+1]){s+=2,e++;do{}while(u[++s]===u[++e]&&u[++s]===u[++e]&&u[++s]===u[++e]&&u[++s]===u[++e]&&u[++s]===u[++e]&&u[++s]===u[++e]&&u[++s]===u[++e]&&u[++s]===u[++e]&&s<p);if(n=c-(p-s),s=p-c,o<n){if(t.match_start=i,a<=(o=n))break;g=u[s+o-1],m=u[s+o]}}}while((i=f[i&d])>h&&0!=--r);return o<=t.lookahead?o:t.lookahead}function x(t){var i,e,n,s,h,u,c,d,f,p,g=t.w_size;do{if(s=t.window_size-t.lookahead-t.strstart,t.strstart>=g+(g-l)){for(r.arraySet(t.window,t.window,g,g,0),t.match_start-=g,t.strstart-=g,t.block_start-=g,i=e=t.hash_size;n=t.head[--i],t.head[i]=g<=n?n-g:0,--e;);for(i=e=g;n=t.prev[--i],t.prev[i]=g<=n?n-g:0,--e;);s+=g}if(0===t.strm.avail_in)break;if(c=t.window,d=t.strstart+t.lookahead,p=void 0,(f=s)<(p=(u=t.strm).avail_in)&&(p=f),e=0===p?0:(u.avail_in-=p,r.arraySet(c,u.input,u.next_in,p,d),1===u.state.wrap?u.adler=o(u.adler,c,p,d):2===u.state.wrap&&(u.adler=a(u.adler,c,p,d)),u.next_in+=p,u.total_in+=p,p),t.lookahead+=e,t.lookahead+t.insert>=3)for(t.ins_h=t.window[h=t.strstart-t.insert],t.ins_h=(t.ins_h<<t.hash_shift^t.window[h+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[h+3-1])&t.hash_mask,t.prev[h&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=h,h++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<l&&0!==t.strm.avail_in)}function k(t,i){for(var e,n;;){if(t.lookahead<l){if(x(t),t.lookahead<l&&0===i)return 1;if(0===t.lookahead)break}if(e=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,e=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==e&&t.strstart-e<=t.w_size-l&&(t.match_length=y(t,e)),t.match_length>=3)if(n=s._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){for(t.match_length--;t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,e=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart,0!=--t.match_length;);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else n=s._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(b(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===i?(b(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(b(t,!1),0===t.strm.avail_out)?1:2}function A(t,i){for(var e,n,r;;){if(t.lookahead<l){if(x(t),t.lookahead<l&&0===i)return 1;if(0===t.lookahead)break}if(e=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,e=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==e&&t.prev_length<t.max_lazy_match&&t.strstart-e<=t.w_size-l&&(t.match_length=y(t,e),t.match_length<=5&&(1===t.strategy||3===t.match_length&&4096<t.strstart-t.match_start)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){for(r=t.strstart+t.lookahead-3,n=s._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;++t.strstart<=r&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,e=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!=--t.prev_length;);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(b(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((n=s._tr_tally(t,0,t.window[t.strstart-1]))&&b(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=s._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===i?(b(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(b(t,!1),0===t.strm.avail_out)?1:2}function S(t,i,e,n,r){this.good_length=t,this.max_lazy=i,this.nice_length=e,this.max_chain=n,this.func=r}function j(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new r.Buf16(1146),this.dyn_dtree=new r.Buf16(122),this.bl_tree=new r.Buf16(78),g(this.dyn_ltree),g(this.dyn_dtree),g(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new r.Buf16(16),this.heap=new r.Buf16(573),g(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new r.Buf16(573),g(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function M(t){var i;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=2,(i=t.state).pending=0,i.pending_out=0,i.wrap<0&&(i.wrap=-i.wrap),i.status=i.wrap?42:d,t.adler=2===i.wrap?0:1,i.last_flush=0,s._tr_init(i),0):f(t,u)}function E(t){var i=M(t);return 0===i&&function(t){t.window_size=2*t.w_size,g(t.head),t.max_lazy_match=n[t.level].max_lazy,t.good_match=n[t.level].good_length,t.nice_match=n[t.level].nice_length,t.max_chain_length=n[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=2,t.match_available=0,t.ins_h=0}(t.state),i}function O(t,i,e,n,s,o){if(!t)return u;var a=1;if(-1===i&&(i=6),n<0?(a=0,n=-n):15<n&&(a=2,n-=16),s<1||9<s||8!==e||n<8||15<n||i<0||9<i||o<0||4<o)return f(t,u);8===n&&(n=9);var h=new j;return(t.state=h).strm=t,h.wrap=a,h.gzhead=null,h.w_bits=n,h.w_size=1<<h.w_bits,h.w_mask=h.w_size-1,h.hash_bits=s+7,h.hash_size=1<<h.hash_bits,h.hash_mask=h.hash_size-1,h.hash_shift=~~((h.hash_bits+3-1)/3),h.window=new r.Buf8(2*h.w_size),h.head=new r.Buf16(h.hash_size),h.prev=new r.Buf16(h.w_size),h.lit_bufsize=1<<s+6,h.pending_buf_size=4*h.lit_bufsize,h.pending_buf=new r.Buf8(h.pending_buf_size),h.d_buf=1*h.lit_bufsize,h.l_buf=3*h.lit_bufsize,h.level=i,h.strategy=o,h.method=e,E(t)}n=[new S(0,0,0,0,(function(t,i){var e=65535;for(e>t.pending_buf_size-5&&(e=t.pending_buf_size-5);;){if(t.lookahead<=1){if(x(t),0===t.lookahead&&0===i)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+e;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,b(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-l&&(b(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===i?(b(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&b(t,!1),1)})),new S(4,4,8,4,k),new S(4,5,16,8,k),new S(4,6,32,32,k),new S(4,4,16,16,A),new S(8,16,32,32,A),new S(8,16,128,128,A),new S(8,32,128,256,A),new S(32,128,258,1024,A),new S(32,258,258,4096,A)],e.deflateInit=function(t,i){return O(t,i,8,15,8,0)},e.deflateInit2=O,e.deflateReset=E,e.deflateResetKeep=M,e.deflateSetHeader=function(t,i){return t&&t.state?2!==t.state.wrap?u:(t.state.gzhead=i,0):u},e.deflate=function(t,i){var e,r,o,h;if(!t||!t.state||5<i||i<0)return t?f(t,u):u;if(r=t.state,!t.output||!t.input&&0!==t.avail_in||666===r.status&&4!==i)return f(t,0===t.avail_out?-5:u);if(r.strm=t,e=r.last_flush,r.last_flush=i,42===r.status)if(2===r.wrap)t.adler=0,v(r,31),v(r,139),v(r,8),r.gzhead?(v(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),v(r,255&r.gzhead.time),v(r,r.gzhead.time>>8&255),v(r,r.gzhead.time>>16&255),v(r,r.gzhead.time>>24&255),v(r,9===r.level?2:2<=r.strategy||r.level<2?4:0),v(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(v(r,255&r.gzhead.extra.length),v(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=a(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(v(r,0),v(r,0),v(r,0),v(r,0),v(r,0),v(r,9===r.level?2:2<=r.strategy||r.level<2?4:0),v(r,3),r.status=d);else{var l=8+(r.w_bits-8<<4)<<8;l|=(2<=r.strategy||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(l|=32),l+=31-l%31,r.status=d,w(r,l),0!==r.strstart&&(w(r,t.adler>>>16),w(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(o=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>o&&(t.adler=a(t.adler,r.pending_buf,r.pending-o,o)),m(t),o=r.pending,r.pending!==r.pending_buf_size));)v(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>o&&(t.adler=a(t.adler,r.pending_buf,r.pending-o,o)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){o=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>o&&(t.adler=a(t.adler,r.pending_buf,r.pending-o,o)),m(t),o=r.pending,r.pending===r.pending_buf_size)){h=1;break}h=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,v(r,h)}while(0!==h);r.gzhead.hcrc&&r.pending>o&&(t.adler=a(t.adler,r.pending_buf,r.pending-o,o)),0===h&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){o=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>o&&(t.adler=a(t.adler,r.pending_buf,r.pending-o,o)),m(t),o=r.pending,r.pending===r.pending_buf_size)){h=1;break}h=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,v(r,h)}while(0!==h);r.gzhead.hcrc&&r.pending>o&&(t.adler=a(t.adler,r.pending_buf,r.pending-o,o)),0===h&&(r.status=103)}else r.status=103;if(103===r.status&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&m(t),r.pending+2<=r.pending_buf_size&&(v(r,255&t.adler),v(r,t.adler>>8&255),t.adler=0,r.status=d)):r.status=d),0!==r.pending){if(m(t),0===t.avail_out)return r.last_flush=-1,0}else if(0===t.avail_in&&p(i)<=p(e)&&4!==i)return f(t,-5);if(666===r.status&&0!==t.avail_in)return f(t,-5);if(0!==t.avail_in||0!==r.lookahead||0!==i&&666!==r.status){var y=2===r.strategy?function(t,i){for(var e;;){if(0===t.lookahead&&(x(t),0===t.lookahead)){if(0===i)return 1;break}if(t.match_length=0,e=s._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,e&&(b(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===i?(b(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(b(t,!1),0===t.strm.avail_out)?1:2}(r,i):3===r.strategy?function(t,i){for(var e,n,r,o,a=t.window;;){if(t.lookahead<=c){if(x(t),t.lookahead<=c&&0===i)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&0<t.strstart&&(n=a[r=t.strstart-1])===a[++r]&&n===a[++r]&&n===a[++r]){o=t.strstart+c;do{}while(n===a[++r]&&n===a[++r]&&n===a[++r]&&n===a[++r]&&n===a[++r]&&n===a[++r]&&n===a[++r]&&n===a[++r]&&r<o);t.match_length=c-(o-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(e=s._tr_tally(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(e=s._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),e&&(b(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===i?(b(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(b(t,!1),0===t.strm.avail_out)?1:2}(r,i):n[r.level].func(r,i);if(3!==y&&4!==y||(r.status=666),1===y||3===y)return 0===t.avail_out&&(r.last_flush=-1),0;if(2===y&&(1===i?s._tr_align(r):5!==i&&(s._tr_stored_block(r,0,0,!1),3===i&&(g(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),m(t),0===t.avail_out))return r.last_flush=-1,0}return 4!==i?0:r.wrap<=0?1:(2===r.wrap?(v(r,255&t.adler),v(r,t.adler>>8&255),v(r,t.adler>>16&255),v(r,t.adler>>24&255),v(r,255&t.total_in),v(r,t.total_in>>8&255),v(r,t.total_in>>16&255),v(r,t.total_in>>24&255)):(w(r,t.adler>>>16),w(r,65535&t.adler)),m(t),0<r.wrap&&(r.wrap=-r.wrap),0!==r.pending?0:1)},e.deflateEnd=function(t){var i;return t&&t.state?42!==(i=t.state.status)&&69!==i&&73!==i&&91!==i&&103!==i&&i!==d&&666!==i?f(t,u):(t.state=null,i===d?f(t,-3):0):u},e.deflateSetDictionary=function(t,i){var e,n,s,a,h,c,l,d,f=i.length;if(!t||!t.state)return u;if(2===(a=(e=t.state).wrap)||1===a&&42!==e.status||e.lookahead)return u;for(1===a&&(t.adler=o(t.adler,i,f,0)),e.wrap=0,f>=e.w_size&&(0===a&&(g(e.head),e.strstart=0,e.block_start=0,e.insert=0),d=new r.Buf8(e.w_size),r.arraySet(d,i,f-e.w_size,e.w_size,0),i=d,f=e.w_size),h=t.avail_in,c=t.next_in,l=t.input,t.avail_in=f,t.next_in=0,t.input=i,x(e);e.lookahead>=3;){for(n=e.strstart,s=e.lookahead-2;e.ins_h=(e.ins_h<<e.hash_shift^e.window[n+3-1])&e.hash_mask,e.prev[n&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=n,n++,--s;);e.strstart=n,e.lookahead=2,x(e)}return e.strstart+=e.lookahead,e.block_start=e.strstart,e.insert=e.lookahead,e.lookahead=0,e.match_length=e.prev_length=2,e.match_available=0,t.next_in=c,t.input=l,t.avail_in=h,e.wrap=a,0},e.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(t,i){i.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}},{}],48:[function(t,i){i.exports=function(t,i){var e,n,r,s,o,a,h,u,c,l,d,f,p,g,m,b,v,w,y,x,k,A,S,j,M;j=t.input,r=(n=t.next_in)+(t.avail_in-5),M=t.output,o=(s=t.next_out)-(i-t.avail_out),a=s+(t.avail_out-257),h=(e=t.state).dmax,u=e.wsize,c=e.whave,l=e.wnext,d=e.window,f=e.hold,p=e.bits,g=e.lencode,m=e.distcode,b=(1<<e.lenbits)-1,v=(1<<e.distbits)-1;t:do{p<15&&(f+=j[n++]<<p,f+=j[n++]<<(p+=8),p+=8),w=g[f&b];i:for(;;){if(f>>>=y=w>>>24,p-=y,0==(y=w>>>16&255))M[s++]=65535&w;else{if(!(16&y)){if(!(64&y)){w=g[(65535&w)+(f&(1<<y)-1)];continue i}if(32&y){e.mode=12;break t}t.msg="invalid literal/length code",e.mode=30;break t}x=65535&w,(y&=15)&&(p<y&&(f+=j[n++]<<p,p+=8),x+=f&(1<<y)-1,f>>>=y,p-=y),p<15&&(f+=j[n++]<<p,f+=j[n++]<<(p+=8),p+=8),w=m[f&v];e:for(;;){if(f>>>=y=w>>>24,p-=y,!(16&(y=w>>>16&255))){if(!(64&y)){w=m[(65535&w)+(f&(1<<y)-1)];continue e}t.msg="invalid distance code",e.mode=30;break t}if(k=65535&w,p<(y&=15)&&(f+=j[n++]<<p,(p+=8)<y&&(f+=j[n++]<<p,p+=8)),h<(k+=f&(1<<y)-1)){t.msg="invalid distance too far back",e.mode=30;break t}if(f>>>=y,p-=y,(y=s-o)<k){if(c<(y=k-y)&&e.sane){t.msg="invalid distance too far back",e.mode=30;break t}if(S=d,(A=0)===l){if(A+=u-y,y<x){for(x-=y;M[s++]=d[A++],--y;);A=s-k,S=M}}else if(l<y){if(A+=u+l-y,(y-=l)<x){for(x-=y;M[s++]=d[A++],--y;);if(A=0,l<x){for(x-=y=l;M[s++]=d[A++],--y;);A=s-k,S=M}}}else if(A+=l-y,y<x){for(x-=y;M[s++]=d[A++],--y;);A=s-k,S=M}for(;2<x;)M[s++]=S[A++],M[s++]=S[A++],M[s++]=S[A++],x-=3;x&&(M[s++]=S[A++],1<x&&(M[s++]=S[A++]))}else{for(A=s-k;M[s++]=M[A++],M[s++]=M[A++],M[s++]=M[A++],2<(x-=3););x&&(M[s++]=M[A++],1<x&&(M[s++]=M[A++]))}break}}break}}while(n<r&&s<a);n-=x=p>>3,f&=(1<<(p-=x<<3))-1,t.next_in=n,t.next_out=s,t.avail_in=n<r?r-n+5:5-(n-r),t.avail_out=s<a?a-s+257:257-(s-a),e.hold=f,e.bits=p}},{}],49:[function(t,i,e){var n=t("../utils/common"),r=t("./adler32"),s=t("./crc32"),o=t("./inffast"),a=t("./inftrees"),h=-2;function u(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 n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function l(t){var i;return t&&t.state?(t.total_in=t.total_out=(i=t.state).total=0,t.msg="",i.wrap&&(t.adler=1&i.wrap),i.mode=1,i.last=0,i.havedict=0,i.dmax=32768,i.head=null,i.hold=0,i.bits=0,i.lencode=i.lendyn=new n.Buf32(852),i.distcode=i.distdyn=new n.Buf32(592),i.sane=1,i.back=-1,0):h}function d(t){var i;return t&&t.state?((i=t.state).wsize=0,i.whave=0,i.wnext=0,l(t)):h}function f(t,i){var e,n;return t&&t.state?(n=t.state,i<0?(e=0,i=-i):(e=1+(i>>4),i<48&&(i&=15)),i&&(i<8||15<i)?h:(null!==n.window&&n.wbits!==i&&(n.window=null),n.wrap=e,n.wbits=i,d(t))):h}function p(t,i){var e,n;return t?(n=new c,(t.state=n).window=null,0!==(e=f(t,i))&&(t.state=null),e):h}var g,m,b=!0;function v(t){if(b){var i;for(g=new n.Buf32(512),m=new n.Buf32(32),i=0;i<144;)t.lens[i++]=8;for(;i<256;)t.lens[i++]=9;for(;i<280;)t.lens[i++]=7;for(;i<288;)t.lens[i++]=8;for(a(1,t.lens,0,288,g,0,t.work,{bits:9}),i=0;i<32;)t.lens[i++]=5;a(2,t.lens,0,32,m,0,t.work,{bits:5}),b=!1}t.lencode=g,t.lenbits=9,t.distcode=m,t.distbits=5}function w(t,i,e,r){var s,o=t.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new n.Buf8(o.wsize)),r>=o.wsize?(n.arraySet(o.window,i,e-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(r<(s=o.wsize-o.wnext)&&(s=r),n.arraySet(o.window,i,e-r,s,o.wnext),(r-=s)?(n.arraySet(o.window,i,e-r,r,0),o.wnext=r,o.whave=o.wsize):(o.wnext+=s,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=s))),0}e.inflateReset=d,e.inflateReset2=f,e.inflateResetKeep=l,e.inflateInit=function(t){return p(t,15)},e.inflateInit2=p,e.inflate=function(t,i){var e,c,l,d,f,p,g,m,b,y,x,k,A,S,j,M,E,O,C,$,I,_,T,P,z=0,W=new n.Buf8(4),D=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return h;12===(e=t.state).mode&&(e.mode=13),f=t.next_out,l=t.output,d=t.next_in,c=t.input,m=e.hold,b=e.bits,y=p=t.avail_in,x=g=t.avail_out,_=0;t:for(;;)switch(e.mode){case 1:if(0===e.wrap){e.mode=13;break}for(;b<16;){if(0===p)break t;p--,m+=c[d++]<<b,b+=8}if(2&e.wrap&&35615===m){W[e.check=0]=255&m,W[1]=m>>>8&255,e.check=s(e.check,W,2,0),b=m=0,e.mode=2;break}if(e.flags=0,e.head&&(e.head.done=!1),!(1&e.wrap)||(((255&m)<<8)+(m>>8))%31){t.msg="incorrect header check",e.mode=30;break}if(8!=(15&m)){t.msg="unknown compression method",e.mode=30;break}if(b-=4,I=8+(15&(m>>>=4)),0===e.wbits)e.wbits=I;else if(I>e.wbits){t.msg="invalid window size",e.mode=30;break}e.dmax=1<<I,t.adler=e.check=1,e.mode=512&m?10:12,b=m=0;break;case 2:for(;b<16;){if(0===p)break t;p--,m+=c[d++]<<b,b+=8}if(e.flags=m,8!=(255&e.flags)){t.msg="unknown compression method",e.mode=30;break}if(57344&e.flags){t.msg="unknown header flags set",e.mode=30;break}e.head&&(e.head.text=m>>8&1),512&e.flags&&(W[0]=255&m,W[1]=m>>>8&255,e.check=s(e.check,W,2,0)),b=m=0,e.mode=3;case 3:for(;b<32;){if(0===p)break t;p--,m+=c[d++]<<b,b+=8}e.head&&(e.head.time=m),512&e.flags&&(W[0]=255&m,W[1]=m>>>8&255,W[2]=m>>>16&255,W[3]=m>>>24&255,e.check=s(e.check,W,4,0)),b=m=0,e.mode=4;case 4:for(;b<16;){if(0===p)break t;p--,m+=c[d++]<<b,b+=8}e.head&&(e.head.xflags=255&m,e.head.os=m>>8),512&e.flags&&(W[0]=255&m,W[1]=m>>>8&255,e.check=s(e.check,W,2,0)),b=m=0,e.mode=5;case 5:if(1024&e.flags){for(;b<16;){if(0===p)break t;p--,m+=c[d++]<<b,b+=8}e.length=m,e.head&&(e.head.extra_len=m),512&e.flags&&(W[0]=255&m,W[1]=m>>>8&255,e.check=s(e.check,W,2,0)),b=m=0}else e.head&&(e.head.extra=null);e.mode=6;case 6:if(1024&e.flags&&(p<(k=e.length)&&(k=p),k&&(e.head&&(I=e.head.extra_len-e.length,e.head.extra||(e.head.extra=new Array(e.head.extra_len)),n.arraySet(e.head.extra,c,d,k,I)),512&e.flags&&(e.check=s(e.check,c,k,d)),p-=k,d+=k,e.length-=k),e.length))break t;e.length=0,e.mode=7;case 7:if(2048&e.flags){if(0===p)break t;for(k=0;I=c[d+k++],e.head&&I&&e.length<65536&&(e.head.name+=String.fromCharCode(I)),I&&k<p;);if(512&e.flags&&(e.check=s(e.check,c,k,d)),p-=k,d+=k,I)break t}else e.head&&(e.head.name=null);e.length=0,e.mode=8;case 8:if(4096&e.flags){if(0===p)break t;for(k=0;I=c[d+k++],e.head&&I&&e.length<65536&&(e.head.comment+=String.fromCharCode(I)),I&&k<p;);if(512&e.flags&&(e.check=s(e.check,c,k,d)),p-=k,d+=k,I)break t}else e.head&&(e.head.comment=null);e.mode=9;case 9:if(512&e.flags){for(;b<16;){if(0===p)break t;p--,m+=c[d++]<<b,b+=8}if(m!==(65535&e.check)){t.msg="header crc mismatch",e.mode=30;break}b=m=0}e.head&&(e.head.hcrc=e.flags>>9&1,e.head.done=!0),t.adler=e.check=0,e.mode=12;break;case 10:for(;b<32;){if(0===p)break t;p--,m+=c[d++]<<b,b+=8}t.adler=e.check=u(m),b=m=0,e.mode=11;case 11:if(0===e.havedict)return t.next_out=f,t.avail_out=g,t.next_in=d,t.avail_in=p,e.hold=m,e.bits=b,2;t.adler=e.check=1,e.mode=12;case 12:if(5===i||6===i)break t;case 13:if(e.last){m>>>=7&b,b-=7&b,e.mode=27;break}for(;b<3;){if(0===p)break t;p--,m+=c[d++]<<b,b+=8}switch(e.last=1&m,b-=1,3&(m>>>=1)){case 0:e.mode=14;break;case 1:if(v(e),e.mode=20,6!==i)break;m>>>=2,b-=2;break t;case 2:e.mode=17;break;case 3:t.msg="invalid block type",e.mode=30}m>>>=2,b-=2;break;case 14:for(m>>>=7&b,b-=7&b;b<32;){if(0===p)break t;p--,m+=c[d++]<<b,b+=8}if((65535&m)!=(m>>>16^65535)){t.msg="invalid stored block lengths",e.mode=30;break}if(e.length=65535&m,b=m=0,e.mode=15,6===i)break t;case 15:e.mode=16;case 16:if(k=e.length){if(p<k&&(k=p),g<k&&(k=g),0===k)break t;n.arraySet(l,c,d,k,f),p-=k,d+=k,g-=k,f+=k,e.length-=k;break}e.mode=12;break;case 17:for(;b<14;){if(0===p)break t;p--,m+=c[d++]<<b,b+=8}if(e.nlen=257+(31&m),b-=5,e.ndist=1+(31&(m>>>=5)),b-=5,e.ncode=4+(15&(m>>>=5)),m>>>=4,b-=4,286<e.nlen||30<e.ndist){t.msg="too many length or distance symbols",e.mode=30;break}e.have=0,e.mode=18;case 18:for(;e.have<e.ncode;){for(;b<3;){if(0===p)break t;p--,m+=c[d++]<<b,b+=8}e.lens[D[e.have++]]=7&m,m>>>=3,b-=3}for(;e.have<19;)e.lens[D[e.have++]]=0;if(e.lencode=e.lendyn,e.lenbits=7,_=a(0,e.lens,0,19,e.lencode,0,e.work,T={bits:e.lenbits}),e.lenbits=T.bits,_){t.msg="invalid code lengths set",e.mode=30;break}e.have=0,e.mode=19;case 19:for(;e.have<e.nlen+e.ndist;){for(;M=(z=e.lencode[m&(1<<e.lenbits)-1])>>>16&255,E=65535&z,!((j=z>>>24)<=b);){if(0===p)break t;p--,m+=c[d++]<<b,b+=8}if(E<16)m>>>=j,b-=j,e.lens[e.have++]=E;else{if(16===E){for(P=j+2;b<P;){if(0===p)break t;p--,m+=c[d++]<<b,b+=8}if(m>>>=j,b-=j,0===e.have){t.msg="invalid bit length repeat",e.mode=30;break}I=e.lens[e.have-1],k=3+(3&m),m>>>=2,b-=2}else if(17===E){for(P=j+3;b<P;){if(0===p)break t;p--,m+=c[d++]<<b,b+=8}b-=j,I=0,k=3+(7&(m>>>=j)),m>>>=3,b-=3}else{for(P=j+7;b<P;){if(0===p)break t;p--,m+=c[d++]<<b,b+=8}b-=j,I=0,k=11+(127&(m>>>=j)),m>>>=7,b-=7}if(e.have+k>e.nlen+e.ndist){t.msg="invalid bit length repeat",e.mode=30;break}for(;k--;)e.lens[e.have++]=I}}if(30===e.mode)break;if(0===e.lens[256]){t.msg="invalid code -- missing end-of-block",e.mode=30;break}if(e.lenbits=9,_=a(1,e.lens,0,e.nlen,e.lencode,0,e.work,T={bits:e.lenbits}),e.lenbits=T.bits,_){t.msg="invalid literal/lengths set",e.mode=30;break}if(e.distbits=6,e.distcode=e.distdyn,_=a(2,e.lens,e.nlen,e.ndist,e.distcode,0,e.work,T={bits:e.distbits}),e.distbits=T.bits,_){t.msg="invalid distances set",e.mode=30;break}if(e.mode=20,6===i)break t;case 20:e.mode=21;case 21:if(6<=p&&258<=g){t.next_out=f,t.avail_out=g,t.next_in=d,t.avail_in=p,e.hold=m,e.bits=b,o(t,x),f=t.next_out,l=t.output,g=t.avail_out,d=t.next_in,c=t.input,p=t.avail_in,m=e.hold,b=e.bits,12===e.mode&&(e.back=-1);break}for(e.back=0;M=(z=e.lencode[m&(1<<e.lenbits)-1])>>>16&255,E=65535&z,!((j=z>>>24)<=b);){if(0===p)break t;p--,m+=c[d++]<<b,b+=8}if(M&&!(240&M)){for(O=j,C=M,$=E;M=(z=e.lencode[$+((m&(1<<O+C)-1)>>O)])>>>16&255,E=65535&z,!(O+(j=z>>>24)<=b);){if(0===p)break t;p--,m+=c[d++]<<b,b+=8}m>>>=O,b-=O,e.back+=O}if(m>>>=j,b-=j,e.back+=j,e.length=E,0===M){e.mode=26;break}if(32&M){e.back=-1,e.mode=12;break}if(64&M){t.msg="invalid literal/length code",e.mode=30;break}e.extra=15&M,e.mode=22;case 22:if(e.extra){for(P=e.extra;b<P;){if(0===p)break t;p--,m+=c[d++]<<b,b+=8}e.length+=m&(1<<e.extra)-1,m>>>=e.extra,b-=e.extra,e.back+=e.extra}e.was=e.length,e.mode=23;case 23:for(;M=(z=e.distcode[m&(1<<e.distbits)-1])>>>16&255,E=65535&z,!((j=z>>>24)<=b);){if(0===p)break t;p--,m+=c[d++]<<b,b+=8}if(!(240&M)){for(O=j,C=M,$=E;M=(z=e.distcode[$+((m&(1<<O+C)-1)>>O)])>>>16&255,E=65535&z,!(O+(j=z>>>24)<=b);){if(0===p)break t;p--,m+=c[d++]<<b,b+=8}m>>>=O,b-=O,e.back+=O}if(m>>>=j,b-=j,e.back+=j,64&M){t.msg="invalid distance code",e.mode=30;break}e.offset=E,e.extra=15&M,e.mode=24;case 24:if(e.extra){for(P=e.extra;b<P;){if(0===p)break t;p--,m+=c[d++]<<b,b+=8}e.offset+=m&(1<<e.extra)-1,m>>>=e.extra,b-=e.extra,e.back+=e.extra}if(e.offset>e.dmax){t.msg="invalid distance too far back",e.mode=30;break}e.mode=25;case 25:if(0===g)break t;if(e.offset>(k=x-g)){if((k=e.offset-k)>e.whave&&e.sane){t.msg="invalid distance too far back",e.mode=30;break}A=k>e.wnext?e.wsize-(k-=e.wnext):e.wnext-k,k>e.length&&(k=e.length),S=e.window}else S=l,A=f-e.offset,k=e.length;for(g<k&&(k=g),g-=k,e.length-=k;l[f++]=S[A++],--k;);0===e.length&&(e.mode=21);break;case 26:if(0===g)break t;l[f++]=e.length,g--,e.mode=21;break;case 27:if(e.wrap){for(;b<32;){if(0===p)break t;p--,m|=c[d++]<<b,b+=8}if(t.total_out+=x-=g,e.total+=x,x&&(t.adler=e.check=e.flags?s(e.check,l,x,f-x):r(e.check,l,x,f-x)),x=g,(e.flags?m:u(m))!==e.check){t.msg="incorrect data check",e.mode=30;break}b=m=0}e.mode=28;case 28:if(e.wrap&&e.flags){for(;b<32;){if(0===p)break t;p--,m+=c[d++]<<b,b+=8}if(m!==(4294967295&e.total)){t.msg="incorrect length check",e.mode=30;break}b=m=0}e.mode=29;case 29:_=1;break t;case 30:_=-3;break t;case 31:return-4;default:return h}return t.next_out=f,t.avail_out=g,t.next_in=d,t.avail_in=p,e.hold=m,e.bits=b,(e.wsize||x!==t.avail_out&&e.mode<30&&(e.mode<27||4!==i))&&w(t,t.output,t.next_out,x-t.avail_out)?(e.mode=31,-4):(x-=t.avail_out,t.total_in+=y-=t.avail_in,t.total_out+=x,e.total+=x,e.wrap&&x&&(t.adler=e.check=e.flags?s(e.check,l,x,t.next_out-x):r(e.check,l,x,t.next_out-x)),t.data_type=e.bits+(e.last?64:0)+(12===e.mode?128:0)+(20===e.mode||15===e.mode?256:0),(0==y&&0===x||4===i)&&0===_&&(_=-5),_)},e.inflateEnd=function(t){if(!t||!t.state)return h;var i=t.state;return i.window&&(i.window=null),t.state=null,0},e.inflateGetHeader=function(t,i){var e;return t&&t.state&&2&(e=t.state).wrap?((e.head=i).done=!1,0):h},e.inflateSetDictionary=function(t,i){var e,n=i.length;return t&&t.state?0!==(e=t.state).wrap&&11!==e.mode?h:11===e.mode&&r(1,i,n,0)!==e.check?-3:w(t,i,n,n)?(e.mode=31,-4):(e.havedict=1,0):h},e.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(t,i){var e=t("../utils/common"),n=[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],r=[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],s=[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],o=[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];i.exports=function(t,i,a,h,u,c,l,d){var f,p,g,m,b,v,w,y,x,k=d.bits,A=0,S=0,j=0,M=0,E=0,O=0,C=0,$=0,I=0,_=0,T=null,P=0,z=new e.Buf16(16),W=new e.Buf16(16),D=null,L=0;for(A=0;A<=15;A++)z[A]=0;for(S=0;S<h;S++)z[i[a+S]]++;for(E=k,M=15;1<=M&&0===z[M];M--);if(M<E&&(E=M),0===M)return u[c++]=20971520,u[c++]=20971520,d.bits=1,0;for(j=1;j<M&&0===z[j];j++);for(E<j&&(E=j),A=$=1;A<=15;A++)if($<<=1,($-=z[A])<0)return-1;if(0<$&&(0===t||1!==M))return-1;for(W[1]=0,A=1;A<15;A++)W[A+1]=W[A]+z[A];for(S=0;S<h;S++)0!==i[a+S]&&(l[W[i[a+S]]++]=S);if(v=0===t?(T=D=l,19):1===t?(T=n,P-=257,D=r,L-=257,256):(T=s,D=o,-1),A=j,b=c,C=S=_=0,g=-1,m=(I=1<<(O=E))-1,1===t&&852<I||2===t&&592<I)return 1;for(;;){for(w=A-C,x=l[S]<v?(y=0,l[S]):l[S]>v?(y=D[L+l[S]],T[P+l[S]]):(y=96,0),f=1<<A-C,j=p=1<<O;u[b+(_>>C)+(p-=f)]=w<<24|y<<16|x,0!==p;);for(f=1<<A-1;_&f;)f>>=1;if(0!==f?(_&=f-1,_+=f):_=0,S++,0==--z[A]){if(A===M)break;A=i[a+l[S]]}if(E<A&&(_&m)!==g){for(0===C&&(C=E),b+=j,$=1<<(O=A-C);O+C<M&&!(($-=z[O+C])<=0);)O++,$<<=1;if(I+=1<<O,1===t&&852<I||2===t&&592<I)return 1;u[g=_&m]=E<<24|O<<16|b-c}}return 0!==_&&(u[b+_]=A-C<<24|64<<16),d.bits=E,0}},{"../utils/common":41}],51:[function(t,i){i.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"}},{}],52:[function(t,i,e){var n=t("../utils/common");function r(t){for(var i=t.length;0<=--i;)t[i]=0}var s=256,o=286,a=30,h=15,u=[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],c=[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],l=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],d=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],f=new Array(576);r(f);var p=new Array(60);r(p);var g=new Array(512);r(g);var m=new Array(256);r(m);var b=new Array(29);r(b);var v,w,y,x=new Array(a);function k(t,i,e,n,r){this.static_tree=t,this.extra_bits=i,this.extra_base=e,this.elems=n,this.max_length=r,this.has_stree=t&&t.length}function A(t,i){this.dyn_tree=t,this.max_code=0,this.stat_desc=i}function S(t){return t<256?g[t]:g[256+(t>>>7)]}function j(t,i){t.pending_buf[t.pending++]=255&i,t.pending_buf[t.pending++]=i>>>8&255}function M(t,i,e){t.bi_valid>16-e?(t.bi_buf|=i<<t.bi_valid&65535,j(t,t.bi_buf),t.bi_buf=i>>16-t.bi_valid,t.bi_valid+=e-16):(t.bi_buf|=i<<t.bi_valid&65535,t.bi_valid+=e)}function E(t,i,e){M(t,e[2*i],e[2*i+1])}function O(t,i){for(var e=0;e|=1&t,t>>>=1,e<<=1,0<--i;);return e>>>1}function C(t,i,e){var n,r,s=new Array(16),o=0;for(n=1;n<=h;n++)s[n]=o=o+e[n-1]<<1;for(r=0;r<=i;r++){var a=t[2*r+1];0!==a&&(t[2*r]=O(s[a]++,a))}}function $(t){var i;for(i=0;i<o;i++)t.dyn_ltree[2*i]=0;for(i=0;i<a;i++)t.dyn_dtree[2*i]=0;for(i=0;i<19;i++)t.bl_tree[2*i]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function I(t){8<t.bi_valid?j(t,t.bi_buf):0<t.bi_valid&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function _(t,i,e,n){var r=2*i,s=2*e;return t[r]<t[s]||t[r]===t[s]&&n[i]<=n[e]}function T(t,i,e){for(var n=t.heap[e],r=e<<1;r<=t.heap_len&&(r<t.heap_len&&_(i,t.heap[r+1],t.heap[r],t.depth)&&r++,!_(i,n,t.heap[r],t.depth));)t.heap[e]=t.heap[r],e=r,r<<=1;t.heap[e]=n}function P(t,i,e){var n,r,o,a,h=0;if(0!==t.last_lit)for(;n=t.pending_buf[t.d_buf+2*h]<<8|t.pending_buf[t.d_buf+2*h+1],r=t.pending_buf[t.l_buf+h],h++,0===n?E(t,r,i):(E(t,(o=m[r])+s+1,i),0!==(a=u[o])&&M(t,r-=b[o],a),E(t,o=S(--n),e),0!==(a=c[o])&&M(t,n-=x[o],a)),h<t.last_lit;);E(t,256,i)}function z(t,i){var e,n,r,s=i.dyn_tree,o=i.stat_desc.static_tree,a=i.stat_desc.has_stree,u=i.stat_desc.elems,c=-1;for(t.heap_len=0,t.heap_max=573,e=0;e<u;e++)0!==s[2*e]?(t.heap[++t.heap_len]=c=e,t.depth[e]=0):s[2*e+1]=0;for(;t.heap_len<2;)s[2*(r=t.heap[++t.heap_len]=c<2?++c:0)]=1,t.depth[r]=0,t.opt_len--,a&&(t.static_len-=o[2*r+1]);for(i.max_code=c,e=t.heap_len>>1;1<=e;e--)T(t,s,e);for(r=u;e=t.heap[1],t.heap[1]=t.heap[t.heap_len--],T(t,s,1),n=t.heap[1],t.heap[--t.heap_max]=e,t.heap[--t.heap_max]=n,s[2*r]=s[2*e]+s[2*n],t.depth[r]=(t.depth[e]>=t.depth[n]?t.depth[e]:t.depth[n])+1,s[2*e+1]=s[2*n+1]=r,t.heap[1]=r++,T(t,s,1),2<=t.heap_len;);t.heap[--t.heap_max]=t.heap[1],function(t,i){var e,n,r,s,o,a,u=i.dyn_tree,c=i.max_code,l=i.stat_desc.static_tree,d=i.stat_desc.has_stree,f=i.stat_desc.extra_bits,p=i.stat_desc.extra_base,g=i.stat_desc.max_length,m=0;for(s=0;s<=h;s++)t.bl_count[s]=0;for(u[2*t.heap[t.heap_max]+1]=0,e=t.heap_max+1;e<573;e++)g<(s=u[2*u[2*(n=t.heap[e])+1]+1]+1)&&(s=g,m++),u[2*n+1]=s,c<n||(t.bl_count[s]++,o=0,p<=n&&(o=f[n-p]),t.opt_len+=(a=u[2*n])*(s+o),d&&(t.static_len+=a*(l[2*n+1]+o)));if(0!==m){do{for(s=g-1;0===t.bl_count[s];)s--;t.bl_count[s]--,t.bl_count[s+1]+=2,t.bl_count[g]--,m-=2}while(0<m);for(s=g;0!==s;s--)for(n=t.bl_count[s];0!==n;)c<(r=t.heap[--e])||(u[2*r+1]!==s&&(t.opt_len+=(s-u[2*r+1])*u[2*r],u[2*r+1]=s),n--)}}(t,i),C(s,c,t.bl_count)}function W(t,i,e){var n,r,s=-1,o=i[1],a=0,h=7,u=4;for(0===o&&(h=138,u=3),i[2*(e+1)+1]=65535,n=0;n<=e;n++)r=o,o=i[2*(n+1)+1],++a<h&&r===o||(a<u?t.bl_tree[2*r]+=a:0!==r?(r!==s&&t.bl_tree[2*r]++,t.bl_tree[32]++):a<=10?t.bl_tree[34]++:t.bl_tree[36]++,s=r,u=(a=0)===o?(h=138,3):r===o?(h=6,3):(h=7,4))}function D(t,i,e){var n,r,s=-1,o=i[1],a=0,h=7,u=4;for(0===o&&(h=138,u=3),n=0;n<=e;n++)if(r=o,o=i[2*(n+1)+1],!(++a<h&&r===o)){if(a<u)for(;E(t,r,t.bl_tree),0!=--a;);else 0!==r?(r!==s&&(E(t,r,t.bl_tree),a--),E(t,16,t.bl_tree),M(t,a-3,2)):a<=10?(E(t,17,t.bl_tree),M(t,a-3,3)):(E(t,18,t.bl_tree),M(t,a-11,7));s=r,u=(a=0)===o?(h=138,3):r===o?(h=6,3):(h=7,4)}}r(x);var L=!1;function F(t,i,e,r){M(t,0+(r?1:0),3),function(t,i,e){I(t),j(t,e),j(t,~e),n.arraySet(t.pending_buf,t.window,i,e,t.pending),t.pending+=e}(t,i,e)}e._tr_init=function(t){L||(function(){var t,i,e,n,r,s=new Array(16);for(n=e=0;n<28;n++)for(b[n]=e,t=0;t<1<<u[n];t++)m[e++]=n;for(m[e-1]=n,n=r=0;n<16;n++)for(x[n]=r,t=0;t<1<<c[n];t++)g[r++]=n;for(r>>=7;n<a;n++)for(x[n]=r<<7,t=0;t<1<<c[n]-7;t++)g[256+r++]=n;for(i=0;i<=h;i++)s[i]=0;for(t=0;t<=143;)f[2*t+1]=8,t++,s[8]++;for(;t<=255;)f[2*t+1]=9,t++,s[9]++;for(;t<=279;)f[2*t+1]=7,t++,s[7]++;for(;t<=287;)f[2*t+1]=8,t++,s[8]++;for(C(f,287,s),t=0;t<a;t++)p[2*t+1]=5,p[2*t]=O(t,5);v=new k(f,u,257,o,h),w=new k(p,c,0,a,h),y=new k(new Array(0),l,0,19,7)}(),L=!0),t.l_desc=new A(t.dyn_ltree,v),t.d_desc=new A(t.dyn_dtree,w),t.bl_desc=new A(t.bl_tree,y),t.bi_buf=0,t.bi_valid=0,$(t)},e._tr_stored_block=F,e._tr_flush_block=function(t,i,e,n){var r,o,a=0;0<t.level?(2===t.strm.data_type&&(t.strm.data_type=function(t){var i,e=4093624447;for(i=0;i<=31;i++,e>>>=1)if(1&e&&0!==t.dyn_ltree[2*i])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(i=32;i<s;i++)if(0!==t.dyn_ltree[2*i])return 1;return 0}(t)),z(t,t.l_desc),z(t,t.d_desc),a=function(t){var i;for(W(t,t.dyn_ltree,t.l_desc.max_code),W(t,t.dyn_dtree,t.d_desc.max_code),z(t,t.bl_desc),i=18;3<=i&&0===t.bl_tree[2*d[i]+1];i--);return t.opt_len+=3*(i+1)+5+5+4,i}(t),(o=t.static_len+3+7>>>3)<=(r=t.opt_len+3+7>>>3)&&(r=o)):r=o=e+5,e+4<=r&&-1!==i?F(t,i,e,n):4===t.strategy||o===r?(M(t,2+(n?1:0),3),P(t,f,p)):(M(t,4+(n?1:0),3),function(t,i,e,n){var r;for(M(t,i-257,5),M(t,e-1,5),M(t,n-4,4),r=0;r<n;r++)M(t,t.bl_tree[2*d[r]+1],3);D(t,t.dyn_ltree,i-1),D(t,t.dyn_dtree,e-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,a+1),P(t,t.dyn_ltree,t.dyn_dtree)),$(t),n&&I(t)},e._tr_tally=function(t,i,e){return t.pending_buf[t.d_buf+2*t.last_lit]=i>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&i,t.pending_buf[t.l_buf+t.last_lit]=255&e,t.last_lit++,0===i?t.dyn_ltree[2*e]++:(t.matches++,i--,t.dyn_ltree[2*(m[e]+s+1)]++,t.dyn_dtree[2*S(i)]++),t.last_lit===t.lit_bufsize-1},e._tr_align=function(t){M(t,2,3),E(t,256,f),function(t){16===t.bi_valid?(j(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):8<=t.bi_valid&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},{"../utils/common":41}],53:[function(t,i){i.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}},{}],54:[function(){(function(t){!function(t){if(!t.setImmediate){var i,e,n,r,s=1,o={},a=!1,h=t.document,u=Object.getPrototypeOf&&Object.getPrototypeOf(t);u=u&&u.setTimeout?u:t,i="[object process]"==={}.toString.call(t.process)?function(t){process.nextTick((function(){l(t)}))}:function(){if(t.postMessage&&!t.importScripts){var i=!0,e=t.onmessage;return t.onmessage=function(){i=!1},t.postMessage("","*"),t.onmessage=e,i}}()?(r="setImmediate$"+Math.random()+"$",t.addEventListener?t.addEventListener("message",d,!1):t.attachEvent("onmessage",d),function(i){t.postMessage(r+i,"*")}):t.MessageChannel?((n=new MessageChannel).port1.onmessage=function(t){l(t.data)},function(t){n.port2.postMessage(t)}):h&&"onreadystatechange"in h.createElement("script")?(e=h.documentElement,function(t){var i=h.createElement("script");i.onreadystatechange=function(){l(t),i.onreadystatechange=null,e.removeChild(i),i=null},e.appendChild(i)}):function(t){setTimeout(l,0,t)},u.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n<e.length;n++)e[n]=arguments[n+1];return o[s]={callback:t,args:e},i(s),s++},u.clearImmediate=c}function c(t){delete o[t]}function l(t){if(a)setTimeout(l,0,t);else{var i=o[t];if(i){a=!0;try{!function(t){var i=t.callback,e=t.args;switch(e.length){case 0:i();break;case 1:i(e[0]);break;case 2:i(e[0],e[1]);break;case 3:i(e[0],e[1],e[2]);break;default:i.apply(undefined,e)}}(i)}finally{c(t),a=!1}}}}function d(i){i.source===t&&"string"==typeof i.data&&0===i.data.indexOf(r)&&l(+i.data.slice(r.length))}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,void 0!==C?C:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[10])(10)),Ii.exports),Ti=$(_i);
2
2
  /*!
3
3
 
4
4
  JSZip v3.10.1 - A JavaScript class for generating and reading zip files
@@ -9,4 +9,4 @@ Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/js
9
9
 
10
10
  JSZip uses the library pako released under the MIT license :
11
11
  https://github.com/nodeca/pako/blob/main/LICENSE
12
- */const Pi=new P,zi=class{constructor(i){t(this,i),this.commonAudioPath="",this.showNav=!0,this.activeContainerIndexes=[],this.Lang="en",this.xmlData="",this.initialIndex=0,this.canplay=!0,this.baseUrl="",this.height="",this.uuid=I(),this.zipUrl="",this.currentContainerIndex=this.initialIndex,this.resizeTrigger=0,this.exitFlag=!1,this.containers=[],this.templateData=[],this.placeholderRegex=/\{([a-zA-Z0-9_]+)\}/g,this.extractedAssets={},this.handleNextContainerEvent=()=>{this.NextContainerKey()},this.handlePrevContainerEvent=()=>{this.PrevContainerKey()},this.handleChangeContainerEvent=t=>{this.NextContainerKey(t.detail.index)},this.handleBeforeUnload=()=>{p.getI().stop(),localStorage.removeItem(_)},this.handleWindowResize=()=>{this.scaleNavbarContainer(),this.resizeTrigger++,this.containers=[...this.containers]},this.NextContainerKey=t=>{var i;this.uuid===(null===(i=document.querySelector("lido-home"))||void 0===i?void 0:i.getAttribute("uuid"))&&(null!=t&&t==this.currentContainerIndex||(null!=t&&t<this.containers.length?(this.currentContainerIndex=t,T(this.currentContainerIndex)):this.currentContainerIndex<this.containers.length-1?(this.currentContainerIndex++,T(this.currentContainerIndex)):this.currentContainerIndex>=this.containers.length-1&&(localStorage.removeItem(_),this.currentContainerIndex=null),this.containers=[...this.containers],this.updateArrowVisibility()))},this.PrevContainerKey=()=>{this.currentContainerIndex<=0||(this.currentContainerIndex--,T(this.currentContainerIndex),this.containers=[...this.containers],this.updateArrowVisibility())},this.showDotsandbtn=!1,this.updateArrowVisibility=()=>{this.showNav&&setTimeout((()=>{const t=this.el.querySelector("lido-container");if(!t)return;const i=t.getAttribute("show-prev-button"),e=t.getAttribute("show-next-button"),n=this.el.querySelector("#lido-arrow-right");this.el.querySelector("#lido-arrow-left").style.visibility="true"!==i?"hidden":"visible",n.style.visibility="true"!==e?"hidden":"visible"}),100)},this.btnpopupRunId=0,this.activeBtnpopupRunId=null,this.shouldStopActiveBtnpopupAudio=!0,this.handleWindowTouch=t=>{null!==this.activeBtnpopupRunId&&this.cancelBtnpopupRun(this.hasAudioOnInteractionTarget(t.target))},this.handleWindowPointer=t=>{"touch"===t.pointerType&&null!==this.activeBtnpopupRunId&&this.cancelBtnpopupRun(this.hasAudioOnInteractionTarget(t.target))},this.popUpClick=t=>{const i=this.el.querySelector(".lido-alert-popup");this.exitFlag=!1,i&&("exit"===t?(p.getI().stop(),j.getI().stop(),Pi.rightMoves=0,Pi.wrongMoves=0,Pi.totalRightMovesCount=0,Pi.totalWrongMovesCount=0,localStorage.removeItem(_),i.remove(),this.currentContainerIndex=0,z()):i.remove())}}translateHomeText(t){var i;const e=null===(i=this.Lang)||void 0===i?void 0:i.trim();return e?si.getFixedT(e)(t):si.t(t)}onCommonAudioPathChange(t){this.publishCommonAudioPath(t)}async componentWillLoad(){if(this.navBarIcons={exit:this.exitButtonUrl||F,prev:this.prevButtonUrl||L,next:this.nextButtonUrl||D,speak:this.speakerButtonUrl||W},0===this.currentContainerIndex&&localStorage.removeItem(_),window.addEventListener(R,this.handleNextContainerEvent),window.addEventListener(B,this.handlePrevContainerEvent),window.addEventListener("changeContainer",this.handleChangeContainerEvent),this.zipUrl&&(this.xmlData="",await this.extractZipAndSetBase(),await this.loadXmlFromZip()),await this.loadTemplateData(),(this.xmlData||"").trim().includes("lido-container"))this.parseXMLData(this.xmlData);else{const t=await this.decompressBrotliBase64(this.xmlData);this.parseXMLData(t)}window.addEventListener("beforeunload",this.handleBeforeUnload)}async loadTemplateData(){if(!this.baseUrl&&!this.zipUrl)return;const t=[this.resolveAsset("data.json")].filter(Boolean);for(const i of t)try{const t=i.startsWith("http")||i.startsWith("blob")?i:s(i),e=await fetch(t);if(!e.ok)continue;const n=await e.json();if(Array.isArray(n)&&(this.templateData=n.filter((t=>t&&"object"==typeof t)),this.templateData.length))return}catch(t){console.warn(`[LidoHome] Failed to load template data from ${i}`,t)}}async decompressBrotliBase64(t){var i;for(t=(t||"").trim().replace(/^data:.*;base64,/,"").replace(/^['"]|['"]$/g,"").replace(/\\n/g,"").replace(/\s+/g,"").replace(/-/g,"+").replace(/_/g,"/");t.length%4;)t+="=";const e=atob(t),n=new Uint8Array(e.length);for(let t=0;t<e.length;t++)n[t]=e.charCodeAt(t);if("DecompressionStream"in window)try{const t=new window.DecompressionStream("br"),i=new Blob([n]).stream().pipeThrough(t),e=await new Response(i).arrayBuffer();return(new TextDecoder).decode(e)}catch(t){console.warn("[LidoRoot] Native Brotli unavailable, trying WASM fallback.",t)}try{const t=await import("./p-CYMdg2_E.js").then((function(t){return t.d})),e=t.BrotliDecompressBuffer||(null===(i=t.default)||void 0===i?void 0:i.BrotliDecompressBuffer);if("function"!=typeof e)throw new Error("BrotliDecompressBuffer function not found in brotli/dec/decode");const r=e(n);return(new TextDecoder).decode(r)}catch(t){throw new Error(`Brotli decompression failed (native + fallback): ${t instanceof Error?t.message:String(t)}`)}}async extractZipAndSetBase(){this.revokeExtractedAssets();const t=this.zipUrl.replace(/\\/g,"/"),i=t.startsWith("http")||t.startsWith("blob")||t.startsWith("data")?t:s(t),e=await fetch(i);if(!e.ok)throw new Error("Unable to fetch ZIP");const n=await e.blob(),r=await Ti.loadAsync(n);for(const t of Object.keys(r.files)){const i=r.files[t];if(!i.dir){const e=await i.async("blob");this.extractedAssets[t]=URL.createObjectURL(e)}}V(this.extractedAssets)}revokeExtractedAssets(){for(const t of Object.values(this.extractedAssets))URL.revokeObjectURL(t);this.extractedAssets={},G()}async loadXmlFromZip(){const t="index.xml",i=this.resolveAsset(t);if(!i)throw console.warn("[LidoHome] ZIP extraction keys:",Object.keys(this.extractedAssets)),new Error(`Unable to find XML file '${t}' inside ZIP`);const e=await fetch(i);if(!e.ok)throw new Error(`Unable to fetch XML from ZIP: ${e.statusText}`);this.xmlData=await e.text()}resolveAsset(t){if(this.zipUrl){const i=t.replace(/^\/+/,""),e=this.extractedAssets[t]||this.extractedAssets[i];if(e)return e;const n=i.replace(/^.*\//,""),r=Object.keys(this.extractedAssets).find((t=>t===i||t===n||t.endsWith(`/${i}`)||t.endsWith(`/${n}`)));return r?this.extractedAssets[r]:void 0}return`${this.baseUrl.replace(/\/+$/,"")}/${t}`}componentDidLoad(){this.publishCommonAudioPath(this.commonAudioPath),setTimeout((()=>{this.showDotsandbtn=!0}),10),this.updateArrowVisibility(),this.scaleNavbarContainer(),this.handleIcons(),window.addEventListener("resize",this.handleWindowResize),window.addEventListener("touchstart",this.handleWindowTouch,{passive:!0}),window.addEventListener("pointerdown",this.handleWindowPointer,{passive:!0})}publishCommonAudioPath(t){if(!t)return;const i=t.replace(/\/+$/,"");window[N]=i,window.dispatchEvent(new Event("lidoCommonAudioPathReady"))}async handleIcons(){var t;const i=async(t,i,e)=>t?u(t):i?u(i):null!=e&&e,e=document.getElementById(U),n=e.getAttribute("exit-button-url"),r=e.getAttribute("prev-button-url"),s=e.getAttribute("next-button-url"),o=null!==(t=e.getAttribute("speak-button-url"))&&void 0!==t?t:e.getAttribute("speaker-button-url");this.navBarIcons={exit:`${await i(this.exitButtonUrl,n,F)}`,prev:`${await i(this.prevButtonUrl,r,L)}`,next:`${await i(this.nextButtonUrl,s,D)}`,speak:`${await i(this.speakerButtonUrl,o,W)}`}}updateBackgroundImage(){const t=document.querySelector(U),i=t.getAttribute("bg-image");document.body.style.background="none",t.style.backgroundImage=i?`url(${i})`:"none",t.style.backgroundPosition=i?"bottom":"none",setTimeout((()=>{const i=document.querySelector(".lido-dot-container");i.classList.add("nav-for-lanai"),t.append(i)}),50)}disconnectedCallback(){p.destroyI(),this.revokeExtractedAssets(),window.removeEventListener(R,this.handleNextContainerEvent),window.removeEventListener("changeContainer",this.handleChangeContainerEvent),window.removeEventListener(B,this.handlePrevContainerEvent),window.removeEventListener("beforeunload",this.handleBeforeUnload),window.removeEventListener("resize",this.handleWindowResize),window.removeEventListener("touchstart",this.handleWindowTouch),window.removeEventListener("pointerdown",this.handleWindowPointer)}parseXMLData(t){if(t){const i=(new DOMParser).parseFromString(t,"text/xml");this.parseContainers(i.documentElement)}}resolveContainerData(t){var i;return(null===(i=this.templateData)||void 0===i?void 0:i.length)?this.templateData[t]?this.templateData[t]:1===this.templateData.length?this.templateData[0]:null:null}replacePlaceholders(t,i){return i&&t?t.replace(this.placeholderRegex,((t,e)=>{const n=i[e];return null==n?`{${e}}`:String(n)})):t}applyDataToElement(t,i){return i?([t,...Array.from(t.querySelectorAll("*"))].forEach((t=>{Array.from(t.attributes).forEach((e=>{const n=e.value.replace(this.placeholderRegex,((t,e)=>{const n=i[e];return null==n?`{${e}}`:String(n)}));n!==e.value&&t.setAttribute(e.name,n)}))})),t):t}onXmlDataChange(t){this.parseXMLData(t)}parseElement(t){const e=t.nodeName.toLowerCase(),n={};Array.from(t.attributes).forEach((t=>{n[t.name]=t.value}));const r=Array.from(t.childNodes).map((t=>1===t.nodeType?this.parseElement(t):3===t.nodeType&&""!==t.textContent.trim()?t.textContent:null)).filter(Boolean);"lido-text"===e&&n.string&&(n.string=si.t(n.string)),"lido-text"===e&&n.string&&(n.string=si.t(n.string));const s={"lido-container":i("lido-container",Object.assign({key:this.resizeTrigger},n,{canplay:this.canplay},this.zipUrl?{}:{baseUrl:this.baseUrl},{height:this.height}),r),"lido-flash-card":i("lido-flash-card",Object.assign({},n),r),"lido-col":i("lido-col",Object.assign({},n),r),"lido-trace":i("lido-trace",Object.assign({},n),r),"lido-image":i("lido-image",Object.assign({},n),r),"lido-row":i("lido-row",Object.assign({},n),r),"lido-text":i("lido-text",Object.assign({},n),r),"lido-pos":i("lido-pos",Object.assign({},n),r),"lido-shape":i("lido-shape",Object.assign({},n),r),"lido-wrap":i("lido-wrap",Object.assign({},n),r),"lido-random":i("lido-random",Object.assign({},n),r),"lido-avatar":i("lido-avatar",Object.assign({},n),r),"lido-cell":i("lido-cell",Object.assign({},n),r),"lido-slide-fill":i("lido-slide-fill",Object.assign({},n),r),"lido-float":i("lido-float",Object.assign({},n),r),"lido-keyboard":i("lido-keyboard",Object.assign({},n),r),"lido-math-matrix":i("lido-math-matrix",Object.assign({},n),r),"lido-balance":i("lido-balance",Object.assign({},n),r),"lido-calculator":i("lido-calculator",Object.assign({},n),r),"lido-canvas":i("lido-canvas",Object.assign({},n),r)};return s[e]?s[e]:(console.warn(`Unknown tag: ${e}`),null)}parseContainers(t){const i=t.querySelectorAll("lido-container"),e=Array.from(i).map(((t,i)=>{if(this.activeContainerIndexes.length&&!this.activeContainerIndexes.includes(i))return;const e=this.resolveContainerData(i),n=this.applyDataToElement(t,e);return()=>this.parseElement(n)})).filter(Boolean);this.containers=e}areAllDropsFilled(){const t=Array.from(document.querySelectorAll('[type="drop"]')),i=Array.from(document.querySelectorAll('[type="drag"]')).filter((t=>t.getAttribute("drop-to")));return t.every((t=>{const e=t.id;return i.some((t=>t.getAttribute("drop-to")===e))}))}async btnpopup(t){var i,e;const n=()=>t!==this.btnpopupRunId,r=document.getElementById(U);if(n())return;if(!r||"true"===r.getAttribute("game-completed"))return;if(Y(!1),await p.getI().stop(),n())return;const s=r.querySelectorAll("*"),o=r.getAttribute(k);if(o){const t=this.el.querySelector(`#${o}`);if(t&&(await g("this.speak='true';",t),n()))return}for(const t of Array.from(s)){if(H()||n())break;const i=t.getAttribute("tab-index"),e=t;if(i&&Number(i)>0){const t=t=>{const i=t.getBoundingClientRect();return i.width>0&&i.height>0&&i.bottom>0&&i.right>0&&i.top<window.innerHeight&&i.left<window.innerWidth},i=null==e?void 0:e.getAttribute("type");if(e&&"true"!==e.getAttribute("disable-speak")&&((null==i?void 0:i.trim())&&t(e)||!i||!i.trim())&&await p.getI().play(e),H()||n()){this.shouldStopActiveBtnpopupAudio&&await p.getI().stop();break}if(await new Promise((t=>setTimeout(t,300))),n())break}}if(!n())if(this.areAllDropsFilled()){const t=r.objective,n=null!==(e=JSON.parse(null!==(i=r.getAttribute(d))&&void 0!==i?i:"[]"))&&void 0!==e?e:[];q(t,n)&&b()}else"true"===r.getAttribute("game-completed")&&b()}hasAudioOnInteractionTarget(t){const i=t;if(!i)return!1;const e=t=>{if(!(t instanceof HTMLElement))return!1;const i=t.getAttribute("audio");return!!i&&i.trim().length>0};return!!e(i)||!!e(i.closest("[audio]"))||!!e(i.querySelector("[audio]"))}async cancelBtnpopupRun(t=!0){this.btnpopupRunId++,this.shouldStopActiveBtnpopupAudio=t,Y(!0),t&&await p.getI().stop()}async handleBtnpopupClick(){await this.cancelBtnpopupRun();const t=this.btnpopupRunId;Y(!1),this.activeBtnpopupRunId=t,this.shouldStopActiveBtnpopupAudio=!0;try{await this.btnpopup(t)}finally{this.activeBtnpopupRunId===t&&(this.activeBtnpopupRunId=null),this.shouldStopActiveBtnpopupAudio=!0}}scaleNavbarContainer(){setTimeout((()=>{const t=document.querySelector(".lido-dot-container");t&&((1600===window.innerWidth&&900===window.innerHeight||900===window.innerWidth&&1600===window.innerHeight)&&document.querySelectorAll(".lido-exit-button, #main-audio").forEach((t=>{t.style.marginLeft="10px",t.style.marginRight="10px"})),t.style.top=window.innerWidth>window.innerHeight?"6%":"3.5%",t.style.transform="translate(-50%, -50%)",t.style.visibility="visible",Array.from(t.children).forEach((t=>{t.style.transform=`scale(${A()})`})),t.style.width=window.outerWidth+"px")}),500)}renderDots(){const t={pointerEvents:this.canplay?"none":""};return i("div",{id:"lido-dot-indicator",class:"lido-dot-container",style:{visibility:"hidden"}},i("div",{class:"lido-exit-button popup-button",onClick:()=>{this.exitFlag=!0,p.getI().stop()}},i("lido-image",{src:this.navBarIcons.exit,width:"stretch"})),i("div",{class:"lido-btn-dot-container"},i("div",{id:"lido-arrow-left",onClick:()=>{X()}},i("lido-image",{src:this.navBarIcons.prev,width:"stretch"})),this.containers.map(((e,n)=>i("div",{class:"parent_dots"},i("span",{class:"lido-dot "+(n<this.currentContainerIndex?"completed":n===this.currentContainerIndex?"current":""),onClick:()=>this.jumpToContainer(n),style:t})))),i("div",{id:"lido-arrow-right",onClick:t=>{g("this.nextBtn='true'",t.currentTarget)}},i("lido-image",{src:this.navBarIcons.next,width:"stretch"}))),i("div",{id:"main-audio",class:"popup-button",onClick:()=>this.handleBtnpopupClick()},i("lido-image",{visible:"true",src:this.navBarIcons.speak,width:"stretch"})))}jumpToContainer(t){this.NextContainerKey(t)}render(){var t,n;return this.xmlData?i(e,{class:"lido-home",uuid:this.uuid,"template-id":"",index:this.currentContainerIndex,totalIndex:this.containers.length,style:{userSelect:"none"}},i("div",{key:this.currentContainerIndex},null===(n=(t=this.containers)[this.currentContainerIndex])||void 0===n?void 0:n.call(t)),this.renderDots(),this.exitFlag&&i("div",{class:"lido-alert-parent"},i("div",{class:"lido-alert-popup"},i("lido-cell",{class:"lido-alert-content",visible:"true",layout:"col",width:"340px",height:"210px","bg-color":"#fff","border-radius":"16px",onEntry:"this.box-shadow= '0 4px 8px 0 rgba(0, 0, 0, 0.25)';"},i("lido-text",{visible:"true",string:this.translateHomeText("Do you want to exit? button"),width:"294px",height:"38px",class:"popup-exit-text","font-size":"22px",onEntry:"this.margin-bottom =' -36px';"}),i("lido-cell",{visible:"true",layout:"row",width:"294px",class:"btn-cell"},i("lido-text",{visible:"true",string:this.translateHomeText("Exit button"),width:"92px",height:"53px","font-size":"16px",margin:"0px 50px 0px 0px",class:"popup-button",onClick:()=>this.popUpClick("exit"),borderRadius:"16px",onEntry:'this.color="#F34D08"; this.font-weight="700"; this.box-shadow="0 2px 0 #F34D08";',fontFamily:"Baloo Bhai 2","font-weight":"700",bgColor:"white","border-radius":"16px"}),i("lido-text",{visible:"true",string:this.translateHomeText("Continue playing button"),width:"155px",height:"53px","font-size":"16px",class:"popup-button",onClick:()=>this.popUpClick("cancel"),borderRadius:"16px",onEntry:'this.color=white; this.font-weight="700"; this.box-shadow="0 2px 0 #F34D08";',"font-family":"Baloo Bhai 2","font-weight":"700",bgColor:"#F34D08","border-radius":"16px"})))))):i("div",null,"Please provide XML data.")}get el(){return n(this)}static get watchers(){return{commonAudioPath:[{onCommonAudioPathChange:0}],xmlData:[{onXmlDataChange:0}]}}};zi.style="@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap'); @import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@400..800&display=swap'); @import url('https://fonts.googleapis.com/css2?family=Baloo+Bhai+2:wght@400..800&display=swap'); body{overflow:hidden;background-position:center;background-size:cover;background-repeat:no-repeat;height:100vh}*{user-select:none}.lido-disable-check-button{pointer-events:none;background-color:#9393935c !important;color:white}.lido-element-selected{border:2px solid;background-color:#ffdf7d !important}.diagonal-target,.diagonal-drop *{transform:scale(0.8) !important;opacity:1 !important}.cloned-element{display:flex !important;position:absolute !important;filter:grayscale(100%);pointer-events:none}.removeShadow{box-shadow:0px 0px 0px 0px #ff8900 !important}.highlight-element{border:2px solid white;box-shadow:rgb(243, 77, 8) 0px 0px 40px !important}.drop-element.empty{border:4px dashed #f34d08 !important}.drop-element.filled{border:'none' !important}.drag-element{box-shadow:0px 15px 11px rgba(43, 0, 0, 0.3) !important}.drag-element.dropped{box-shadow:none !important}.click-element{background-color:var(--btn-bg-color, rgba(255, 172, 76, 1)) !important;box-shadow:var(--btn-shadow-px) var(--btn-shadow-color, rgba(225, 121, 76, 1)) !important;cursor:pointer;transition:box-shadow 0.1s ease-out, transform 0.2s ease-out;}.click-element:active{box-shadow:0px 0px 0px var(--btn-shadow-color, rgba(225, 121, 76, 1)) !important;transform:translateY(var(--btn-active));}.click-element:focus{outline:2px solid dodgerblue;outline-offset:3px}.after-drop-popup-container{width:200%;height:200%;background-color:rgba(0, 0, 0, 0.8);position:absolute;display:flex;flex-direction:row-reverse;align-items:center;justify-content:center !important;gap:80px}.after-drop-popup-drag-element{scale:1.5;border-radius:8px;transform:none !important;position:unset !important}.after-drop-popup-drop-element{scale:1.5;border:unset;border-radius:8px;transform:none !important;position:unset !important}@keyframes zoomFadeIn{0%{transform:scale(0.6);opacity:0}100%{transform:scale(1);opacity:1}}.zoom-fade-in{animation:zoomFadeIn 0.8s ease-out forwards}@keyframes zoomFadeOut{0%{transform:scale(1);opacity:1}100%{transform:scale(0.6);opacity:0}}.zoom-fade-out{animation:zoomFadeOut 0.8s ease-in forwards}.slide-numbers{width:70px;height:70px;border:1px solid #f57139;background-color:white;font-weight:500;color:#f57139;font-size:44px;border-radius:40px;display:flex;align-items:center;justify-content:center;font-family:'Baloo Bhai 2', serif}.slide-numbers-bottom{position:absolute;display:flex;justify-content:space-around;align-items:center;bottom:-25px;width:100%;height:50px}.slide-numbers-left{position:absolute;display:flex;flex-direction:column;justify-content:space-around;height:100%;width:50px;left:-25px;bottom:0px}.lido-speak-icon{width:56px;height:56px;position:absolute;top:-25px;right:-25px;z-index:10;background-image:url(\"https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/template/audioIcon.png\");background-color:white;border:4px solid #F34D08;border-radius:16px;box-shadow:0px 4px 0px 0px #F34D08;background-size:contain;background-repeat:no-repeat;cursor:pointer}.lido-speak-icon:active{transform:translateY(8px);box-shadow:0px 0px 0px 0px !important}.lido-strong-shake{animation:strongShake 0.3s ease}.lido-scaled-shake{animation:scaledShake 0.6s ease-in-out}.lido-horizontal-shake{animation:horizontalShake 0.6s ease-in-out;border-radius:20px}.lido-vertical-shake{animation:verticalShake 0.6s ease-in-out;border-radius:20px}.lido-diagonal-shake{animation:diagonalShake 0.5s ease-in-out;border-radius:20px;will-change:transform}.lido-glow{animation:glowPulse 1s infinite alternate;transition:opacity 0.5s ease-in-out}.lido-box-highlight{animation:topToPlace 0.3s linear}.lido-display-hiddenvalue{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;font-size:80px;font-weight:1000;color:brown;-webkit-text-stroke:2px white;font-family:'Baloo Bhai 2', sans-serif;pointer-events:none}.lido-image-colorize{position:relative;display:inline-block}.lido-image-colorize::after{content:'';position:absolute;inset:0;background:var(--tint-color);mix-blend-mode:multiply;opacity:0.8;pointer-events:none;mask-image:var(--mask-url);mask-size:cover;mask-repeat:no-repeat;mask-position:center}.lido-tts-highlight-overlay{position:fixed;left:0;top:0;pointer-events:none;z-index:9999;background:linear-gradient( 180deg, rgba(255, 235, 59, 0.95), rgba(255, 214, 0, 0.95) );border-radius:6px;box-shadow:0 2px 6px rgba(0, 0, 0, 0.18), inset 0 -1px 0 rgba(255, 255, 255, 0.25);transition:width 25ms ease-out, height 25ms ease-out, opacity 80ms ease-out;opacity:0.95;will-change:transform, width, height;contain:layout paint style}@keyframes rightToPlace{from{transform:translateX(2000px)}to{transform:translateX(0)}}@keyframes topToPlace{from{transform:translateY(-1000px)}to{transform:translateY(0)}}@keyframes bottomToPlace{from{transform:translateY(1000px)}to{transform:translateY(0)}}@keyframes placeToLeft{from{}to{transform:translateX(-2000px)}}@keyframes placeToRight{from{}to{transform:translateX(2000px)}}@keyframes leftToPlace{from{transform:translateX(-2000px)}to{transform:translateX(0)}}@keyframes shake{0%{transform:translateX(0)}10%{transform:translateX(-5px)}20%{transform:translateX(5px)}30%{transform:translateX(-5px)}40%{transform:translateX(5px)}50%{transform:translateX(-5px)}60%{transform:translateX(5px)}70%{transform:translateX(-5px)}80%{transform:translateX(5px)}90%{transform:translateX(-5px)}100%{transform:translateX(0)}}@keyframes fallAndBounce{0%{transform:translateY(-1000px)}25%{transform:translateY(0px)}50%{transform:translateY(-200px)}75%{transform:translateY(0)}90%{transform:translateY(-100px)}100%{transform:translateY(0)}}@keyframes placeToDown{0%{transform:translateY(0)}100%{transform:translateY(1000px)}}@keyframes strongShake{0%{transform:translateX(0)}20%{transform:translateX(-8px)}40%{transform:translateX(8px)}60%{transform:translateX(-6px)}80%{transform:translateX(6px)}100%{transform:translateX(0)}}@keyframes scaledShake{0%{transform:scale(1) translateX(0);box-shadow:0 0 0 transparent}20%{transform:scale(1.10) translateX(-12px);box-shadow:0 0 10px red}40%{transform:scale(1.10) translateX(12px);box-shadow:0 0 12px red}60%{transform:scale(1.10) translateX(-8px);box-shadow:0 0 10px red}80%{transform:scale(1.10) translateX(8px);box-shadow:0 0 12px red}100%{transform:scale(1) translateX(0);box-shadow:none}}@keyframes horizontalShake{0%{transform:scale(1) translateX(0);background-color:transparent}20%{transform:translateX(-20px);background-color:rgba(255, 0, 0, 0.2)}40%{transform:translateX(20px);background-color:rgba(255, 0, 0, 0.4)}60%{transform:translateX(-10px);background-color:rgba(255, 0, 0, 0.3)}80%{transform:translateX(10px);background-color:rgba(255, 0, 0, 0.2)}100%{transform:translateX(0);background-color:transparent}}@keyframes verticalShake{0%{transform:translateY(0);background-color:transparent}20%{transform:translateY(-20px);background-color:rgba(255, 0, 0, 0.2)}40%{transform:translateY(0);background-color:rgba(255, 0, 0, 0.4)}60%{transform:translateY(20px);background-color:rgba(255, 0, 0, 0.2)}80%{transform:translateY(0);background-color:rgba(255, 0, 0, 0.1)}100%{transform:translateY(0);background-color:transparent}}@keyframes diagonalShake{0%{transform:translate(0, 0);background-color:transparent}25%{transform:translate(20px, -20px);background-color:rgba(255, 0, 0, 0.2)}50%{transform:translate(-20px, 20px);background-color:rgba(255, 0, 0, 0.3)}75%{transform:translate(10px, -10px);background-color:rgba(255, 0, 0, 0.2)}100%{transform:translate(0, 0);background-color:transparent}}@keyframes glowPulse{0%{filter:drop-shadow(0 0 5px yellow) drop-shadow(0 0 10px yellow) drop-shadow(0 0 20px yellow) drop-shadow(0 0 30px orange)}50%{filter:drop-shadow(0 0 10px yellow) drop-shadow(0 0 20px yellow) drop-shadow(0 0 40px yellow) drop-shadow(0 0 50px orange)}100%{filter:drop-shadow(0 0 5px yellow) drop-shadow(0 0 10px yellow) drop-shadow(0 0 20px yellow) drop-shadow(0 0 30px orange)}}@keyframes trace-animation{0%{}100%{width:var(--trace-width, 100px);height:var(--trace-height, 100px)}}.lido-snackbar{visibility:visible;min-width:250px;background-color:#333;color:#fff;text-align:center;border-radius:2px;padding:16px;position:fixed;z-index:1;bottom:30px;left:50%;transform:translateX(-50%);font-size:17px}.lido-dot-container{display:flex;justify-content:space-between;align-items:center;visibility:hidden;position:absolute;left:50%;padding:0 5px;z-index:1;width:100vw;max-width:100vw;box-sizing:border-box;height:0px}.lido-dot{height:18px;width:18px;margin:0 4px;background-color:#bbb;border-radius:50%;display:inline-block;transition:background-color 0.3s;cursor:pointer;z-index:1}.lido-btn-dot-container{flex-shrink:1;flex-grow:1;display:flex;justify-content:center;align-items:center;text-align:center;z-index:1;min-width:0;height:0px}.lido-dot.completed{background-color:grey}.lido-dot.current{background-color:green}.lido-dot:not(.completed):not(.current){background-color:#bbb}#lido-arrow-left,#lido-arrow-right{width:88px;height:88px;display:flex;align-items:center;justify-content:center;border-radius:12px;z-index:1000;box-shadow:0px 8px 0px 0px #8b310f;background-color:#f34d08;cursor:pointer;visibility:hidden;flex-shrink:0}#lido-arrow-left:active,#lido-arrow-right:active{transform:translateY(8px);box-shadow:0px 0px 0px 0px}.navbar{display:flex;justify-content:center}.lido-exit-button,#main-audio{width:80px;height:80px;z-index:1000;cursor:pointer;background-color:white;display:flex;align-items:center;justify-content:center;border:4px solid #f34d08;border-radius:16px;box-shadow:0px 8px #f34d08;flex-shrink:0;}#main-audio:active,.popup-button:active,.lido-exit-button:active{margin-bottom:-8px;box-shadow:0px 0px 0px 0px !important}.lido-alert-popup{position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0, 0, 0, 0.5);display:flex;align-items:center;justify-content:center;z-index:1000}@media (max-width: 768px){#lido-arrow-left,#lido-arrow-right{width:70px;height:70px;margin:0 8px}.lido-exit-button,#main-audio{width:65px;height:65px;margin:0 8px}.lido-dot{height:16px;width:16px;margin:0 2.5px}}@media (max-width: 480px){#lido-arrow-left,#lido-arrow-right{width:74px;height:74px;margin:0px 5px}.lido-exit-button,#main-audio{width:65px;height:65px;margin:0px 5px}.lido-dot{height:15px;width:15px;margin:0 1.5px}.lido-dot-container{padding:0 3px}}@media (max-width: 375px){#lido-arrow-left,#lido-arrow-right{width:70px;height:70px;margin:0px 3px}.lido-exit-button,#main-audio{width:70px;height:70px;margin:0px 3px}.lido-dot{height:14px;width:14px;margin:0 1px}.lido-dot-container{padding:0 2px}}@media (max-width: 320px){#lido-arrow-left,#lido-arrow-right,.lido-exit-button,#main-audio{width:70px;height:70px;margin:0px 2px}.lido-dot{height:12px;width:12px;margin:0 0.5px}.lido-dot-container{padding:0 2px}}@media (max-width: 900px) and (orientation: landscape){#lido-arrow-left,#lido-arrow-right{width:70px;height:70px;margin:0px 5px}.lido-exit-button,#main-audio{width:70px;height:70px;margin:0px 5px}.lido-dot{height:14px;width:14px;margin:0 1px}.lido-dot-container{padding:0 5px}}.popup-exit-text{white-space:nowrap;font-size:22px;font-weight:600;margin-top:-8%}.lido-alert-parent{z-index:10000 !important;position:absolute;top:0;left:0}.popup-button{width:80px;height:80px;z-index:1000;cursor:pointer;display:flex;align-items:center;justify-content:center;border:4px solid #F34D08;border-radius:16px;box-shadow:0 8px 0 #F34D08}.nav-for-lanai{position:absolute;top:0%;left:0%;max-width:none;width:100%;height:auto;visibility:visible}";var Wi,Di,Li={exports:{}},Fi={},Ri={},Bi={};function Ni(){return Wi||(Wi=1,t=Bi,Object.defineProperty(t,"__esModule",{value:!0}),t.MUST_INSTALL_PUPPETEER=t.DEFAULT_CONVERSION_ERROR_MESSAGE=t.UNEXPECTED_ERROR_MESSAGE_INTRODUCTION=t.UNEXPECTED_ERROR_MESSAGE_LINK=t.UNEXPECTED_ERROR_MESSAGE_PREFIX=void 0,t.UNEXPECTED_ERROR_MESSAGE_PREFIX="Unexpected error has occurred, please report this by using the following link: ",t.UNEXPECTED_ERROR_MESSAGE_LINK="https://github.com/OvidijusParsiunas/css-filter-converter/issues/new",t.UNEXPECTED_ERROR_MESSAGE_INTRODUCTION=t.UNEXPECTED_ERROR_MESSAGE_PREFIX+t.UNEXPECTED_ERROR_MESSAGE_LINK,t.DEFAULT_CONVERSION_ERROR_MESSAGE="Input value is invalid",t.MUST_INSTALL_PUPPETEER="To convert filter values to color in Node - you will first need to install 'puppeteer' by running: \n npm install puppeteer"),Bi;var t}function Ui(){if(Di)return Ri;Di=1,Object.defineProperty(Ri,"__esModule",{value:!0}),Ri.ErrorHandling=void 0;const t=Ni();class i{static generateErrorResult(t){return{color:null,error:{message:t}}}static generateInputErrorMessage(t,i,e){const n=[`Input ${t} color string could not be parsed.`,`String received: ${i}.`];return e&&n.splice(1,0,`Expected format: ${e}.`),n.join(" ")}static generateUnexpectedError(e){return i.generateErrorResult(`${t.UNEXPECTED_ERROR_MESSAGE_INTRODUCTION}: \n${e.message}`)}static hasError(t){return!!t.errorMessage}}return Ri.ErrorHandling=i,Ri}var Hi,qi={};function Xi(){if(Hi)return qi;Hi=1,Object.defineProperty(qi,"__esModule",{value:!0}),qi.SheenUtil=void 0;class t{static parseSheenFromOptions(t){return!t||"boolean"!=typeof t.sheen||t.sheen}}return qi.SheenUtil=t,t.SHEEN_FILTER_PREFIX="brightness(0) saturate(100%)",qi}var Vi,Gi={};function Yi(){return Vi||(Vi=1,t=Gi,Object.defineProperty(t,"__esModule",{value:!0}),t.ColorTypes=void 0,(i=t.ColorTypes||(t.ColorTypes={})).HEX="hex",i.RGB="rgb",i.HSL="hsl",i.KEYWORD="keyword",i.FILTER="filter"),Gi;var t,i}var Zi,Ki,Ji,Qi={},te={},ie={};function ee(){return Zi||(Zi=1,Object.defineProperty(ie,"__esModule",{value:!0}),ie.RgbColor=void 0,ie.RgbColor=class{constructor(t=[0,0,0],i=!1){this.roundChannels=i,this.r=this.clamp(t[0]),this.g=this.clamp(t[1]),this.b=this.clamp(t[2])}clamp(t){return t>255?t=255:t<0&&(t=0),this.roundChannels?Math.round(t):t}setRgb(t,i,e){this.r=this.clamp(t),this.g=this.clamp(i),this.b=this.clamp(e)}multiply(t){const i=this.clamp(this.r*t[0]+this.g*t[1]+this.b*t[2]),e=this.clamp(this.r*t[3]+this.g*t[4]+this.b*t[5]),n=this.clamp(this.r*t[6]+this.g*t[7]+this.b*t[8]);this.r=i,this.g=e,this.b=n}hueRotate(t=0){t=t/180*Math.PI;const i=Math.sin(t),e=Math.cos(t);this.multiply([.213+.787*e-.213*i,.715-.715*e-.715*i,.072-.072*e+.928*i,.213-.213*e+.143*i,.715+.285*e+.14*i,.072-.072*e-.283*i,.213-.213*e-.787*i,.715-.715*e+.715*i,.072+.928*e+.072*i])}sepia(t=1){this.multiply([.393+.607*(1-t),.769-.769*(1-t),.189-.189*(1-t),.349-.349*(1-t),.686+.314*(1-t),.168-.168*(1-t),.272-.272*(1-t),.534-.534*(1-t),.131+.869*(1-t)])}saturate(t=1){this.multiply([.213+.787*t,.715-.715*t,.072-.072*t,.213-.213*t,.715+.285*t,.072-.072*t,.213-.213*t,.715-.715*t,.072+.928*t])}linear(t=1,i=0){this.r=this.clamp(this.r*t+255*i),this.g=this.clamp(this.g*t+255*i),this.b=this.clamp(this.b*t+255*i)}brightness(t=1){this.linear(t)}contrast(t=1){this.linear(t,-.5*t+.5)}invert(t=1){this.r=this.clamp(255*(t+this.r/255*(1-2*t))),this.g=this.clamp(255*(t+this.g/255*(1-2*t))),this.b=this.clamp(255*(t+this.b/255*(1-2*t)))}}),ie}var ne,re,se,oe,ae,he,ue,ce,le,de,fe,pe,ge,me={},be={},ve={},we={};function ye(){return se||(se=1,t=we,Object.defineProperty(t,"__esModule",{value:!0}),t.ColorFormats=void 0,(i=t.ColorFormats||(t.ColorFormats={})).HEX="#ffffff or #fff",i.RGB="rgb([0-255], [0-255], [0-255]) or rgb([0-255], [0-255], [0-255], [0-1]) or rgb([0-100%], [0-100%], [0-100%]) or rgb([0-100%], [0-100%], [0-100%], [0-100%]) or [0-255], [0-255], [0-255] or [0-255] [0-255] [0-255]",i.HSL="hsl([0-360], [0-100], [0-100]) or hsl([0-360], [0-100%], [0-100%]) or [0-360], [0-100], [0-100] or [0-360] [0-100] [0-100]",i.FILTER="blur(), brightness(), contrast(), drop-shadow(), grayscale(), hue-rotate(), invert(), saturate(), sepia() with each parameter populated with %, px or deg where approriate e.g. contrast(101%)",i.KEYWORD="Generic color string. See the following link for all available colors: https://github.com/colorjs/color-name/blob/master/index.js"),we;var t,i}function xe(){return ae?oe:(ae=1,oe={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]})}function ke(){if(ce)return ue;ce=1;const t=xe(),i={};for(const e of Object.keys(t))i[t[e]]=e;const e={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};ue=e;for(const t of Object.keys(e)){if(!("channels"in e[t]))throw new Error("missing channels property: "+t);if(!("labels"in e[t]))throw new Error("missing channel labels property: "+t);if(e[t].labels.length!==e[t].channels)throw new Error("channel and label counts mismatch: "+t);const{channels:i,labels:n}=e[t];delete e[t].channels,delete e[t].labels,Object.defineProperty(e[t],"channels",{value:i}),Object.defineProperty(e[t],"labels",{value:n})}return e.rgb.hsl=function(t){const i=t[0]/255,e=t[1]/255,n=t[2]/255,r=Math.min(i,e,n),s=Math.max(i,e,n),o=s-r;let a,h;s===r?a=0:i===s?a=(e-n)/o:e===s?a=2+(n-i)/o:n===s&&(a=4+(i-e)/o),a=Math.min(60*a,360),a<0&&(a+=360);const u=(r+s)/2;return h=s===r?0:u<=.5?o/(s+r):o/(2-s-r),[a,100*h,100*u]},e.rgb.hsv=function(t){let i,e,n,r,s;const o=t[0]/255,a=t[1]/255,h=t[2]/255,u=Math.max(o,a,h),c=u-Math.min(o,a,h),l=function(t){return(u-t)/6/c+.5};return 0===c?(r=0,s=0):(s=c/u,i=l(o),e=l(a),n=l(h),o===u?r=n-e:a===u?r=1/3+i-n:h===u&&(r=2/3+e-i),r<0?r+=1:r>1&&(r-=1)),[360*r,100*s,100*u]},e.rgb.hwb=function(t){const i=t[0],n=t[1];let r=t[2];const s=e.rgb.hsl(t)[0],o=1/255*Math.min(i,Math.min(n,r));return r=1-1/255*Math.max(i,Math.max(n,r)),[s,100*o,100*r]},e.rgb.cmyk=function(t){const i=t[0]/255,e=t[1]/255,n=t[2]/255,r=Math.min(1-i,1-e,1-n);return[100*((1-i-r)/(1-r)||0),100*((1-e-r)/(1-r)||0),100*((1-n-r)/(1-r)||0),100*r]},e.rgb.keyword=function(e){const n=i[e];if(n)return n;let r,s=1/0;for(const i of Object.keys(t)){const n=((o=e)[0]-(a=t[i])[0])**2+(o[1]-a[1])**2+(o[2]-a[2])**2;n<s&&(s=n,r=i)}var o,a;return r},e.keyword.rgb=function(i){return t[i]},e.rgb.xyz=function(t){let i=t[0]/255,e=t[1]/255,n=t[2]/255;return i=i>.04045?((i+.055)/1.055)**2.4:i/12.92,e=e>.04045?((e+.055)/1.055)**2.4:e/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,[100*(.4124*i+.3576*e+.1805*n),100*(.2126*i+.7152*e+.0722*n),100*(.0193*i+.1192*e+.9505*n)]},e.rgb.lab=function(t){const i=e.rgb.xyz(t);let n=i[0],r=i[1],s=i[2];return n/=95.047,r/=100,s/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,s=s>.008856?s**(1/3):7.787*s+16/116,[116*r-16,500*(n-r),200*(r-s)]},e.hsl.rgb=function(t){const i=t[0]/360,e=t[1]/100,n=t[2]/100;let r,s,o;if(0===e)return o=255*n,[o,o,o];r=n<.5?n*(1+e):n+e-n*e;const a=2*n-r,h=[0,0,0];for(let t=0;t<3;t++)s=i+1/3*-(t-1),s<0&&s++,s>1&&s--,o=6*s<1?a+6*(r-a)*s:2*s<1?r:3*s<2?a+(r-a)*(2/3-s)*6:a,h[t]=255*o;return h},e.hsl.hsv=function(t){const i=t[0];let e=t[1]/100,n=t[2]/100,r=e;const s=Math.max(n,.01);return n*=2,e*=n<=1?n:2-n,r*=s<=1?s:2-s,[i,100*(0===n?2*r/(s+r):2*e/(n+e)),(n+e)/2*100]},e.hsv.rgb=function(t){const i=t[0]/60,e=t[1]/100;let n=t[2]/100;const r=Math.floor(i)%6,s=i-Math.floor(i),o=255*n*(1-e),a=255*n*(1-e*s),h=255*n*(1-e*(1-s));switch(n*=255,r){case 0:return[n,h,o];case 1:return[a,n,o];case 2:return[o,n,h];case 3:return[o,a,n];case 4:return[h,o,n];case 5:return[n,o,a]}},e.hsv.hsl=function(t){const i=t[0],e=t[1]/100,n=t[2]/100,r=Math.max(n,.01);let s,o;o=(2-e)*n;const a=(2-e)*r;return s=e*r,s/=a<=1?a:2-a,s=s||0,o/=2,[i,100*s,100*o]},e.hwb.rgb=function(t){const i=t[0]/360;let e=t[1]/100,n=t[2]/100;const r=e+n;let s;r>1&&(e/=r,n/=r);const o=Math.floor(6*i),a=1-n;s=6*i-o,1&o&&(s=1-s);const h=e+s*(a-e);let u,c,l;switch(o){default:case 6:case 0:u=a,c=h,l=e;break;case 1:u=h,c=a,l=e;break;case 2:u=e,c=a,l=h;break;case 3:u=e,c=h,l=a;break;case 4:u=h,c=e,l=a;break;case 5:u=a,c=e,l=h}return[255*u,255*c,255*l]},e.cmyk.rgb=function(t){const i=t[1]/100,e=t[2]/100,n=t[3]/100;return[255*(1-Math.min(1,t[0]/100*(1-n)+n)),255*(1-Math.min(1,i*(1-n)+n)),255*(1-Math.min(1,e*(1-n)+n))]},e.xyz.rgb=function(t){const i=t[0]/100,e=t[1]/100,n=t[2]/100;let r,s,o;return r=3.2406*i+-1.5372*e+-.4986*n,s=-.9689*i+1.8758*e+.0415*n,o=.0557*i+-.204*e+1.057*n,r=r>.0031308?1.055*r**(1/2.4)-.055:12.92*r,s=s>.0031308?1.055*s**(1/2.4)-.055:12.92*s,o=o>.0031308?1.055*o**(1/2.4)-.055:12.92*o,r=Math.min(Math.max(0,r),1),s=Math.min(Math.max(0,s),1),o=Math.min(Math.max(0,o),1),[255*r,255*s,255*o]},e.xyz.lab=function(t){let i=t[0],e=t[1],n=t[2];return i/=95.047,e/=100,n/=108.883,i=i>.008856?i**(1/3):7.787*i+16/116,e=e>.008856?e**(1/3):7.787*e+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,[116*e-16,500*(i-e),200*(e-n)]},e.lab.xyz=function(t){let i,e,n;e=(t[0]+16)/116,i=t[1]/500+e,n=e-t[2]/200;const r=e**3,s=i**3,o=n**3;return e=r>.008856?r:(e-16/116)/7.787,i=s>.008856?s:(i-16/116)/7.787,n=o>.008856?o:(n-16/116)/7.787,i*=95.047,e*=100,n*=108.883,[i,e,n]},e.lab.lch=function(t){const i=t[0],e=t[1],n=t[2];let r;return r=360*Math.atan2(n,e)/2/Math.PI,r<0&&(r+=360),[i,Math.sqrt(e*e+n*n),r]},e.lch.lab=function(t){const i=t[1],e=t[2]/360*2*Math.PI;return[t[0],i*Math.cos(e),i*Math.sin(e)]},e.rgb.ansi16=function(t,i=null){const[n,r,s]=t;let o=null===i?e.rgb.hsv(t)[2]:i;if(o=Math.round(o/50),0===o)return 30;let a=30+(Math.round(s/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return 2===o&&(a+=60),a},e.hsv.ansi16=function(t){return e.rgb.ansi16(e.hsv.rgb(t),t[2])},e.rgb.ansi256=function(t){const i=t[0],e=t[1],n=t[2];return i===e&&e===n?i<8?16:i>248?231:Math.round((i-8)/247*24)+232:16+36*Math.round(i/255*5)+6*Math.round(e/255*5)+Math.round(n/255*5)},e.ansi16.rgb=function(t){let i=t%10;if(0===i||7===i)return t>50&&(i+=3.5),i=i/10.5*255,[i,i,i];const e=.5*(1+~~(t>50));return[(1&i)*e*255,(i>>1&1)*e*255,(i>>2&1)*e*255]},e.ansi256.rgb=function(t){if(t>=232){const i=10*(t-232)+8;return[i,i,i]}let i;return t-=16,[Math.floor(t/36)/5*255,Math.floor((i=t%36)/6)/5*255,i%6/5*255]},e.rgb.hex=function(t){const i=(((255&Math.round(t[0]))<<16)+((255&Math.round(t[1]))<<8)+(255&Math.round(t[2]))).toString(16).toUpperCase();return"000000".substring(i.length)+i},e.hex.rgb=function(t){const i=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!i)return[0,0,0];let e=i[0];3===i[0].length&&(e=e.split("").map((t=>t+t)).join(""));const n=parseInt(e,16);return[n>>16&255,n>>8&255,255&n]},e.rgb.hcg=function(t){const i=t[0]/255,e=t[1]/255,n=t[2]/255,r=Math.max(Math.max(i,e),n),s=Math.min(Math.min(i,e),n),o=r-s;let a,h;return a=o<1?s/(1-o):0,h=o<=0?0:r===i?(e-n)/o%6:r===e?2+(n-i)/o:4+(i-e)/o,h/=6,h%=1,[360*h,100*o,100*a]},e.hsl.hcg=function(t){const i=t[1]/100,e=t[2]/100,n=e<.5?2*i*e:2*i*(1-e);let r=0;return n<1&&(r=(e-.5*n)/(1-n)),[t[0],100*n,100*r]},e.hsv.hcg=function(t){const i=t[2]/100,e=t[1]/100*i;let n=0;return e<1&&(n=(i-e)/(1-e)),[t[0],100*e,100*n]},e.hcg.rgb=function(t){const i=t[1]/100,e=t[2]/100;if(0===i)return[255*e,255*e,255*e];const n=[0,0,0],r=t[0]/360%1*6,s=r%1,o=1-s;let a=0;switch(Math.floor(r)){case 0:n[0]=1,n[1]=s,n[2]=0;break;case 1:n[0]=o,n[1]=1,n[2]=0;break;case 2:n[0]=0,n[1]=1,n[2]=s;break;case 3:n[0]=0,n[1]=o,n[2]=1;break;case 4:n[0]=s,n[1]=0,n[2]=1;break;default:n[0]=1,n[1]=0,n[2]=o}return a=(1-i)*e,[255*(i*n[0]+a),255*(i*n[1]+a),255*(i*n[2]+a)]},e.hcg.hsv=function(t){const i=t[1]/100,e=i+t[2]/100*(1-i);let n=0;return e>0&&(n=i/e),[t[0],100*n,100*e]},e.hcg.hsl=function(t){const i=t[1]/100,e=t[2]/100*(1-i)+.5*i;let n=0;return e>0&&e<.5?n=i/(2*e):e>=.5&&e<1&&(n=i/(2*(1-e))),[t[0],100*n,100*e]},e.hcg.hwb=function(t){const i=t[1]/100,e=i+t[2]/100*(1-i);return[t[0],100*(e-i),100*(1-e)]},e.hwb.hcg=function(t){const i=1-t[2]/100,e=i-t[1]/100;let n=0;return e<1&&(n=(i-e)/(1-e)),[t[0],100*e,100*n]},e.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},e.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},e.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},e.gray.hsl=function(t){return[0,0,t[0]]},e.gray.hsv=e.gray.hsl,e.gray.hwb=function(t){return[0,100,t[0]]},e.gray.cmyk=function(t){return[0,0,0,t[0]]},e.gray.lab=function(t){return[t[0],0,0]},e.gray.hex=function(t){const i=255&Math.round(t[0]/100*255),e=((i<<16)+(i<<8)+i).toString(16).toUpperCase();return"000000".substring(e.length)+e},e.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]},ue}function Ae(){if(de)return le;de=1;const t=ke();function i(t,i){return function(e){return i(t(e))}}function e(e,n){const r=[n[e].parent,e];let s=t[n[e].parent][e],o=n[e].parent;for(;n[o].parent;)r.unshift(n[o].parent),s=i(t[n[o].parent][o],s),o=n[o].parent;return s.conversion=r,s}return le=function(i){const n=function(i){const e=function(){const i={},e=Object.keys(t);for(let t=e.length,n=0;n<t;n++)i[e[n]]={distance:-1,parent:null};return i}(),n=[i];for(e[i].distance=0;n.length;){const i=n.pop(),r=Object.keys(t[i]);for(let t=r.length,s=0;s<t;s++){const t=r[s],o=e[t];-1===o.distance&&(o.distance=e[i].distance+1,o.parent=i,n.unshift(t))}}return e}(i),r={},s=Object.keys(n);for(let t=s.length,i=0;i<t;i++){const t=s[i];null!==n[t].parent&&(r[t]=e(t,n))}return r}}function Se(){if(pe)return fe;pe=1;const t=ke(),i=Ae(),e={};return Object.keys(t).forEach((n=>{e[n]={},Object.defineProperty(e[n],"channels",{value:t[n].channels}),Object.defineProperty(e[n],"labels",{value:t[n].labels});const r=i(n);Object.keys(r).forEach((t=>{const i=r[t];e[n][t]=function(t){const i=function(...i){const e=i[0];if(null==e)return e;e.length>1&&(i=e);const n=t(i);if("object"==typeof n)for(let t=n.length,i=0;i<t;i++)n[i]=Math.round(n[i]);return n};return"conversion"in t&&(i.conversion=t.conversion),i}(i),e[n][t].raw=function(t){const i=function(...i){const e=i[0];return null==e?e:(e.length>1&&(i=e),t(i))};return"conversion"in t&&(i.conversion=t.conversion),i}(i)}))})),fe=e}var je,Me={},Ee={},Oe={},Ce={};function $e(){if(je)return Ce;je=1,Object.defineProperty(Ce,"__esModule",{value:!0}),Ce.FilterToHexShared=void 0;const t=Ui(),i=ye(),e=Yi();return Ce.FilterToHexShared=class{static generateInputErrorMessage(n){return t.ErrorHandling.generateInputErrorMessage(e.ColorTypes.FILTER,n,i.ColorFormats.FILTER)}static addSVGElementsToDOMAndValidateFilter(t,i=1){const e=function(){const t=document.createElement("div");return t.style.height=`${i}px`,t.style.width=`${i}px`,t.style.position="absolute",t.style.top="0px",t.style.left="0px",t}(),n=function(){const e="http://www.w3.org/2000/svg",n=document.createElementNS(e,"svg");n.style.height="inherit",n.style.width="inherit",n.style.float="left",n.style.filter=t;const r=document.createElementNS(e,"rect");return r.setAttributeNS(null,"width",i.toString()),r.setAttributeNS(null,"height",i.toString()),n.appendChild(r),n}();return""===n.style.filter?{errorMessage:"error indicator",svgContainerElement:e}:(e.appendChild(n),document.body.appendChild(e),{svgContainerElement:e})}static async getColorViaImageDataURL(t){return function(t){const i=function(t){const i=t.width;return t.getContext("2d").getImageData(0,0,i,i).data}(t);return`#${`000000${function(t,i,e){if(t>255||i>255||e>255)throw new Error("Invalid color component");return(t<<16|i<<8|e).toString(16)}(i[0],i[1],i[2])}`.slice(-6)}`}(function(t){const i=document.createElement("canvas");return i.width=t.width,i.height=t.height,i.getContext("2d").drawImage(t,0,0,t.width,t.height),i}(await async function(){const i=new Image;return new Promise(((e,n)=>{i.onload=()=>e(i),i.onerror=()=>n(new Error("Failed to load the SVG image data URL")),i.src=t}))}()))}},Ce}var Ie,_e,Te={exports:{}};function Pe(){return Ie||(Ie=1,t=Te,function(){var i=function(){return{escape:function(t){return t.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1")},parseExtension:i,mimeType:function(t){var e,n;return(e="application/font-woff",n="image/jpeg",{woff:e,woff2:e,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:n,jpeg:n,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml"})[i(t).toLowerCase()]||""},dataAsUrl:function(t,i){return"data:"+i+";base64,"+t},isDataUrl:function(t){return-1!==t.search(/^(data:)/)},canvasToBlob:function(t){return t.toBlob?new Promise((function(i){t.toBlob(i)})):function(t){return new Promise((function(i){for(var e=window.atob(t.toDataURL().split(",")[1]),n=e.length,r=new Uint8Array(n),s=0;s<n;s++)r[s]=e.charCodeAt(s);i(new Blob([r],{type:"image/png"}))}))}(t)},resolveUrl:function(t,i){var e=document.implementation.createHTMLDocument(),n=e.createElement("base");e.head.appendChild(n);var r=e.createElement("a");return e.body.appendChild(r),n.href=i,r.href=t,r.href},getAndEncode:function(t){return a.impl.options.cacheBust&&(t+=(/\?/.test(t)?"&":"?")+(new Date).getTime()),new Promise((function(i){var e,n=new XMLHttpRequest;if(n.onreadystatechange=function(){if(4===n.readyState)if(200===n.status){var r=new FileReader;r.onloadend=function(){var t=r.result.split(/,/)[1];i(t)},r.readAsDataURL(n.response)}else e?i(e):s("cannot fetch resource: "+t+", status: "+n.status)},n.ontimeout=function(){e?i(e):s("timeout of 30000ms occured while fetching resource: "+t)},n.responseType="blob",n.timeout=3e4,n.open("GET",t,!0),n.send(),a.impl.options.imagePlaceholder){var r=a.impl.options.imagePlaceholder.split(/,/);r&&r[1]&&(e=r[1])}function s(t){console.error(t),i("")}}))},uid:(t=0,function(){return"u"+("0000"+(Math.random()*Math.pow(36,4)|0).toString(36)).slice(-4)+t++}),delay:function(t){return function(i){return new Promise((function(e){setTimeout((function(){e(i)}),t)}))}},asArray:function(t){for(var i=[],e=t.length,n=0;n<e;n++)i.push(t[n]);return i},escapeXhtml:function(t){return t.replace(/#/g,"%23").replace(/\n/g,"%0A")},makeImage:function(t){return new Promise((function(i,e){var n=new Image;n.onload=function(){i(n)},n.onerror=e,n.src=t}))},width:function(t){var i=e(t,"border-left-width"),n=e(t,"border-right-width");return t.scrollWidth+i+n},height:function(t){var i=e(t,"border-top-width"),n=e(t,"border-bottom-width");return t.scrollHeight+i+n}};var t;function i(t){var i=/\.([^\.\/]*?)$/g.exec(t);return i?i[1]:""}function e(t,i){var e=window.getComputedStyle(t).getPropertyValue(i);return parseFloat(e.replace("px",""))}}(),e=function(){var t=/url\(['"]?([^'"]+?)['"]?\)/g;return{inlineAll:function(t,i,s){return e(t)?Promise.resolve(t).then(n).then((function(e){var n=Promise.resolve(t);return e.forEach((function(t){n=n.then((function(e){return r(e,t,i,s)}))})),n})):Promise.resolve(t)},shouldProcess:e,impl:{readUrls:n,inline:r}};function e(i){return-1!==i.search(t)}function n(e){for(var n,r=[];null!==(n=t.exec(e));)r.push(n[1]);return r.filter((function(t){return!i.isDataUrl(t)}))}function r(t,e,n,r){return Promise.resolve(e).then((function(t){return n?i.resolveUrl(t,n):t})).then(r||i.getAndEncode).then((function(t){return i.dataAsUrl(t,i.mimeType(e))})).then((function(n){return t.replace(function(t){return new RegExp("(url\\(['\"]?)("+i.escape(t)+")(['\"]?\\))","g")}(e),"$1"+n+"$3")}))}}(),n=function(){return{resolveAll:function(){return t().then((function(t){return Promise.all(t.map((function(t){return t.resolve()})))})).then((function(t){return t.join("\n")}))},impl:{readAll:t}};function t(){return Promise.resolve(i.asArray(document.styleSheets)).then((function(t){var e=[];return t.forEach((function(t){try{i.asArray(t.cssRules||[]).forEach(e.push.bind(e))}catch(i){console.log("Error while reading CSS rules from "+t.href,i.toString())}})),e})).then((function(t){return t.filter((function(t){return t.type===CSSRule.FONT_FACE_RULE})).filter((function(t){return e.shouldProcess(t.style.getPropertyValue("src"))}))})).then((function(i){return i.map(t)}));function t(t){return{resolve:function(){return e.inlineAll(t.cssText,(t.parentStyleSheet||{}).href)},src:function(){return t.style.getPropertyValue("src")}}}}}(),r=function(){return{inlineAll:function n(r){return r instanceof Element?function(t){var i=t.style.getPropertyValue("background");return i?e.inlineAll(i).then((function(i){t.style.setProperty("background",i,t.style.getPropertyPriority("background"))})).then((function(){return t})):Promise.resolve(t)}(r).then((function(){return r instanceof HTMLImageElement?t(r).inline():Promise.all(i.asArray(r.childNodes).map((function(t){return n(t)})))})):Promise.resolve(r)},impl:{newImage:t}};function t(t){return{inline:function(e){return i.isDataUrl(t.src)?Promise.resolve():Promise.resolve(t.src).then(e||i.getAndEncode).then((function(e){return i.dataAsUrl(e,i.mimeType(t.src))})).then((function(i){return new Promise((function(e,n){t.onload=e,t.onerror=n,t.src=i}))}))}}}}(),s=void 0,o=!1,a={toSvg:h,toPng:function(t,i){return u(t,i||{}).then((function(t){return t.toDataURL()}))},toJpeg:function(t,i){return u(t,i=i||{}).then((function(t){return t.toDataURL("image/jpeg",i.quality||1)}))},toBlob:function(t,e){return u(t,e||{}).then(i.canvasToBlob)},toPixelData:function(t,e){return u(t,e||{}).then((function(e){return e.getContext("2d").getImageData(0,0,i.width(t),i.height(t)).data}))},impl:{fontFaces:n,images:r,util:i,inliner:e,options:{}}};function h(t,e){return function(t){a.impl.options.imagePlaceholder=void 0===t.imagePlaceholder?s:t.imagePlaceholder,a.impl.options.cacheBust=void 0===t.cacheBust?o:t.cacheBust}(e=e||{}),Promise.resolve(t).then((function(t){return c(t,e.filter,!0)})).then(l).then(d).then((function(t){return e.bgcolor&&(t.style.backgroundColor=e.bgcolor),e.width&&(t.style.width=e.width+"px"),e.height&&(t.style.height=e.height+"px"),e.style&&Object.keys(e.style).forEach((function(i){t.style[i]=e.style[i]})),t})).then((function(n){return function(t,e,n){return Promise.resolve(t).then((function(t){return t.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),(new XMLSerializer).serializeToString(t)})).then(i.escapeXhtml).then((function(t){return'<foreignObject x="0" y="0" width="100%" height="100%">'+t+"</foreignObject>"})).then((function(t){return'<svg xmlns="http://www.w3.org/2000/svg" width="'+e+'" height="'+n+'">'+t+"</svg>"})).then((function(t){return"data:image/svg+xml;charset=utf-8,"+t}))}(n,e.width||i.width(t),e.height||i.height(t))}))}function u(t,e){return h(t,e).then(i.makeImage).then(i.delay(100)).then((function(n){var r=function(t){var n=document.createElement("canvas");if(n.width=e.width||i.width(t),n.height=e.height||i.height(t),e.bgcolor){var r=n.getContext("2d");r.fillStyle=e.bgcolor,r.fillRect(0,0,n.width,n.height)}return n}(t);return r.getContext("2d").drawImage(n,0,0),r}))}function c(t,e,n){return n||!e||e(t)?Promise.resolve(t).then((function(t){return t instanceof HTMLCanvasElement?i.makeImage(t.toDataURL()):t.cloneNode(!1)})).then((function(n){return function(t,e,n){var r=t.childNodes;return 0===r.length?Promise.resolve(e):function(t,i,e){var n=Promise.resolve();return i.forEach((function(i){n=n.then((function(){return c(i,e)})).then((function(i){i&&t.appendChild(i)}))})),n}(e,i.asArray(r),n).then((function(){return e}))}(t,n,e)})).then((function(e){return function(t,e){return e instanceof Element?Promise.resolve().then((function(){n=window.getComputedStyle(t),r=e.style,n.cssText?r.cssText=n.cssText:function(t,e){i.asArray(t).forEach((function(i){e.setProperty(i,t.getPropertyValue(i),t.getPropertyPriority(i))}))}(n,r);var n,r})).then((function(){[":before",":after"].forEach((function(n){!function(n){var r=window.getComputedStyle(t,n),s=r.getPropertyValue("content");if(""!==s&&"none"!==s){var o=i.uid();e.className=e.className+" "+o;var a=document.createElement("style");a.appendChild(function(t,e,n){var r="."+t+":"+e,s=n.cssText?o(n):a(n);return document.createTextNode(r+"{"+s+"}");function o(t){var i=t.getPropertyValue("content");return t.cssText+" content: "+i+";"}function a(t){return i.asArray(t).map(e).join("; ")+";";function e(i){return i+": "+t.getPropertyValue(i)+(t.getPropertyPriority(i)?" !important":"")}}}(o,n,r)),e.appendChild(a)}}(n)}))})).then((function(){t instanceof HTMLTextAreaElement&&(e.innerHTML=t.value),t instanceof HTMLInputElement&&e.setAttribute("value",t.value)})).then((function(){e instanceof SVGElement&&(e.setAttribute("xmlns","http://www.w3.org/2000/svg"),e instanceof SVGRectElement&&["width","height"].forEach((function(t){var i=e.getAttribute(t);i&&e.style.setProperty(t,i)})))})).then((function(){return e})):e}(t,e)})):Promise.resolve()}function l(t){return n.resolveAll().then((function(i){var e=document.createElement("style");return t.appendChild(e),e.appendChild(document.createTextNode(i)),t}))}function d(t){return r.inlineAll(t).then((function(){return t}))}t.exports=a}()),Te.exports;var t}var ze,We,De={};var Le,Fe,Re,Be,Ne={},Ue={};var He=$((Be||(Be=1,function(t,i){Object.defineProperty(i,"__esModule",{value:!0});const e=function(){if(ge)return Fi;ge=1;var t=Fi&&Fi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Fi,"__esModule",{value:!0}),Fi.ColorToFilter=void 0;const i=Ui(),e=Xi(),n=Yi(),r=function(){if(Ji)return Qi;Ji=1,Object.defineProperty(Qi,"__esModule",{value:!0}),Qi.RgbToFilter=void 0;const t=Ui(),i=Ni(),e=function(){if(Ki)return te;Ki=1,Object.defineProperty(te,"__esModule",{value:!0}),te.RgbToFilterWorker=void 0;const t=Xi(),i=ee();class e{constructor(t,e){this.targetRgbColor=t,this.reusedRgbColor=new i.RgbColor,this.reusedRoundedRgbColor=new i.RgbColor([0,0,0],!0),this.addSheen=e}static fmt(t,i,e=1){return Math.round(t[i]*e)}generateCss(i){return`${this.addSheen?`${t.SheenUtil.SHEEN_FILTER_PREFIX} `:""}invert(${e.fmt(i,0)}%) sepia(${e.fmt(i,1)}%) saturate(${e.fmt(i,2)}%) hue-rotate(${e.fmt(i,3,3.6)}deg) brightness(${e.fmt(i,4)}%) contrast(${e.fmt(i,5)}%)`}applyFilters(t,i,e){return t.setRgb(0,0,0),t.invert(i[0]/100),t.sepia(i[1]/100),t.saturate(i[2]/100),t.hueRotate(e),t.brightness(i[4]/100),t.contrast(i[5]/100),Math.abs(t.r-this.targetRgbColor.r)+Math.abs(t.g-this.targetRgbColor.g)+Math.abs(t.b-this.targetRgbColor.b)}loss(t){return this.applyFilters(this.reusedRgbColor,t,3.6*t[3])}serializedLoss(t){const i=t.map(((i,n)=>e.fmt(t,n))),n=e.fmt(t,3,3.6),r=this.applyFilters(this.reusedRgbColor,i,n),s=this.applyFilters(this.reusedRoundedRgbColor,i,n);return Math.max(r,s)}static fixSpsa(t,i){let e=100;return 2===i?e=7500:4!==i&&5!==i||(e=200),3===i?t>e?t%=e:t<0&&(t=e+t%e):t<0?t=0:t>e&&(t=e),t}spsa(t,i,n,r,s){let o=[],a=1/0;const h=new Array(6),u=new Array(6),c=new Array(6);for(let l=0;l<s;l+=1){const s=n/Math.pow(l+1,.16666666666666666);for(let t=0;t<6;t+=1)h[t]=Math.random()>.5?1:-1,u[t]=r[t]+s*h[t],c[t]=r[t]-s*h[t];const d=this.loss(u)-this.loss(c);for(let n=0;n<6;n+=1){const o=d/(2*s)*h[n],a=i[n]/Math.pow(t+l+1,1);r[n]=e.fixSpsa(r[n]-a*o,n)}const f=this.serializedLoss(r);f<a&&(o=r.slice(0),a=f)}return{values:o,loss:a}}solveNarrow(t){const i=t.loss,e=i+1;return this.spsa(i,[.25*e,.25*e,e,.25*e,.2*e,.2*e],2,t.values,500)}solveWide(){const t=[60,180,18e3,600,1.2,1.2];let i={values:[],loss:1/0};for(let e=0;i.loss>25&&e<3;e+=1){const e=this.spsa(5,t,15,[50,20,3750,50,100,100],1e3);e.loss<i.loss&&(i=e)}return i}convert(){const t=this.solveNarrow(this.solveWide());return{loss:t.loss,color:this.generateCss(t.values)}}}return te.RgbToFilterWorker=e,te}(),n=ee();class r{static generateConversionError(e){return t.ErrorHandling.generateErrorResult(e||i.DEFAULT_CONVERSION_ERROR_MESSAGE)}static generateValidateAndParseError(i){return t.ErrorHandling.generateErrorResult(i)}static execute(t,i){const r=new n.RgbColor(t);return new e.RgbToFilterWorker(r,i).convert()}static convertToRGB(t,i){return t&&i?i(t):null}static convert(i){try{const{colorString:e,validateAndParse:n,convertToRgb:s,conversionErrorMessage:o,addSheen:a}=i,h=e.trim().toLocaleLowerCase(),u=(null==n?void 0:n(h))||{color:h};if(t.ErrorHandling.hasError(u))return r.generateValidateAndParseError(u.errorMessage);const c=r.convertToRGB(u.color,s)||u.color;return c?r.execute(c,a):r.generateConversionError(o)}catch(i){return t.ErrorHandling.generateUnexpectedError(i)}}}return Qi.RgbToFilter=r,Qi}(),s=function(){if(he)return me;he=1;var t=me&&me.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(me,"__esModule",{value:!0}),me.ColorParser=void 0;const i=(ne||(ne=1,Object.defineProperty(be,"__esModule",{value:!0}),be.MATCH_HEXADECIMAL=be.MATCH_INTEGER_AND_FLOAT_NUMBERS=void 0,be.MATCH_INTEGER_AND_FLOAT_NUMBERS=/(-?\d+(?:\.\d+)?)/g,be.MATCH_HEXADECIMAL=/^#[0-9a-f]{3}([0-9a-f]{3})?$/i),be),e=Ui(),n=(re||(re=1,Object.defineProperty(ve,"__esModule",{value:!0}),ve.MAX_COLOR_INPUT_STRING_LENGTH=void 0,ve.MAX_COLOR_INPUT_STRING_LENGTH=25),ve),r=ye(),s=Yi(),o=t(xe());class a{static validateAndParseHex(t){return t.length<n.MAX_COLOR_INPUT_STRING_LENGTH&&t.match(i.MATCH_HEXADECIMAL)?{color:t}:{errorMessage:e.ErrorHandling.generateInputErrorMessage(s.ColorTypes.HEX,t,r.ColorFormats.HEX)}}static parseFirstThreeIntegersFromString(t){if(t.length<n.MAX_COLOR_INPUT_STRING_LENGTH){const e=t.match(i.MATCH_INTEGER_AND_FLOAT_NUMBERS);if(i.MATCH_INTEGER_AND_FLOAT_NUMBERS.lastIndex=0,e&&e.length>=3)return e.slice(0,3).map((t=>Number.parseInt(t)))}return null}static validateAndParseRgb(t){const i=a.parseFirstThreeIntegersFromString(t);return i&&i[0]>=0&&i[0]<=255&&i[1]>=0&&i[1]<=255&&i[2]>=0&&i[2]<=255?{color:i}:{errorMessage:e.ErrorHandling.generateInputErrorMessage(s.ColorTypes.RGB,t,r.ColorFormats.RGB)}}static validateAndParseHsl(t){const i=a.parseFirstThreeIntegersFromString(t);return i&&i[0]>=0&&i[0]<=360&&i[1]>=0&&i[1]<=100&&i[2]>=0&&i[2]<=100?{color:i}:{errorMessage:e.ErrorHandling.generateInputErrorMessage(s.ColorTypes.HSL,t,r.ColorFormats.HSL)}}static validateAndParseKeyword(t){return t.length<n.MAX_COLOR_INPUT_STRING_LENGTH&&o.default[t]?{color:t}:{errorMessage:e.ErrorHandling.generateInputErrorMessage(s.ColorTypes.KEYWORD,t,r.ColorFormats.KEYWORD)}}}return me.ColorParser=a,me}(),o=t(Se());return Fi.ColorToFilter=class{static rgbToFilter(t,i){return r.RgbToFilter.convert({colorString:t,validateAndParse:s.ColorParser.validateAndParseRgb,addSheen:e.SheenUtil.parseSheenFromOptions(i)})}static hexToFilter(t,i){return r.RgbToFilter.convert({colorString:t,validateAndParse:s.ColorParser.validateAndParseHex,convertToRgb:o.default.hex.rgb,addSheen:e.SheenUtil.parseSheenFromOptions(i)})}static hslToFilter(t,i){return r.RgbToFilter.convert({colorString:t,validateAndParse:s.ColorParser.validateAndParseHsl,convertToRgb:o.default.hsl.rgb,addSheen:e.SheenUtil.parseSheenFromOptions(i)})}static keywordToFilter(t,a){return r.RgbToFilter.convert({colorString:t,validateAndParse:s.ColorParser.validateAndParseKeyword,convertToRgb:o.default.keyword.rgb,conversionErrorMessage:i.ErrorHandling.generateInputErrorMessage(n.ColorTypes.KEYWORD,t),addSheen:e.SheenUtil.parseSheenFromOptions(a)})}},Fi}(),n=function(){if(Re)return Me;Re=1,Object.defineProperty(Me,"__esModule",{value:!0}),Me.FilterToColor=void 0;const t=function(){if(We)return Ee;We=1;var t=Ee&&Ee.__createBinding||(Object.create?function(t,i,e,n){void 0===n&&(n=e);var r=Object.getOwnPropertyDescriptor(i,e);r&&!("get"in r?!i.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return i[e]}}),Object.defineProperty(t,n,r)}:function(t,i,e,n){void 0===n&&(n=e),t[n]=i[e]}),i=Ee&&Ee.__setModuleDefault||(Object.create?function(t,i){Object.defineProperty(t,"default",{enumerable:!0,value:i})}:function(t,i){t.default=i}),e=Ee&&Ee.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&t(n,e,r);return i(n,e),n};Object.defineProperty(Ee,"__esModule",{value:!0}),Ee.FilterToHex=void 0;const n=Ui(),r=function(){if(_e)return Oe;_e=1;var t=Oe&&Oe.__createBinding||(Object.create?function(t,i,e,n){void 0===n&&(n=e);var r=Object.getOwnPropertyDescriptor(i,e);r&&!("get"in r?!i.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return i[e]}}),Object.defineProperty(t,n,r)}:function(t,i,e,n){void 0===n&&(n=e),t[n]=i[e]}),i=Oe&&Oe.__setModuleDefault||(Object.create?function(t,i){Object.defineProperty(t,"default",{enumerable:!0,value:i})}:function(t,i){t.default=i}),e=Oe&&Oe.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&t(n,e,r);return i(n,e),n};Object.defineProperty(Oe,"__esModule",{value:!0}),Oe.FilterToHexBrowser=void 0;const n=Ui(),r=$e();class s extends r.FilterToHexShared{static cleanup(t){t.remove()}static returnInputError(t,i){const e=r.FilterToHexShared.generateInputErrorMessage(t),o=n.ErrorHandling.generateErrorResult(e);return s.cleanup(i),o}static async getImageBase64ViaSVG(t){return(await Promise.resolve().then((()=>e(Pe())))).toPng(t)}static async convert(t){const{errorMessage:i,svgContainerElement:e}=r.FilterToHexShared.addSVGElementsToDOMAndValidateFilter(t);if(i)return s.returnInputError(t,e);const n=await s.getImageBase64ViaSVG(e),o=await r.FilterToHexShared.getColorViaImageDataURL(n);return s.cleanup(e),{color:o}}}return Oe.FilterToHexBrowser=s,Oe}();return Ee.FilterToHex=class{static async convert(t,i,s){try{let n;if("undefined"==typeof window){const{FilterToHexNode:i}=await Promise.resolve().then((()=>e(function(){if(ze)return De;ze=1,Object.defineProperty(De,"__esModule",{value:!0}),De.FilterToHexNode=void 0;const t=Ui(),i=Ni(),e=ye(),n=Yi(),r=$e();class s extends r.FilterToHexShared{static cleanup(t){s.IS_HEADLESS&&(null==t||t.close())}static returnError(i,e){const n=t.ErrorHandling.generateErrorResult(i);return s.cleanup(e),n}static async getImageBase64ViaSVG(t){const i=await t.screenshot({encoding:s.BASE_64_ENCODING});return`${s.ENCODED_DATA_URL_PREFIX}${i}`}static async openBrowserPage(t){const i=await t.newPage();return await i.setViewport({width:s.SVG_SIDE_LENGTH_PX,height:s.SVG_SIDE_LENGTH_PX}),i}static async addSVGAndValidateFilter(i,o){const a=await i.evaluate(r.FilterToHexShared.addSVGElementsToDOMAndValidateFilter,o,s.SVG_SIDE_LENGTH_PX);return a.errorMessage?{errorMessage:t.ErrorHandling.generateInputErrorMessage(n.ColorTypes.FILTER,o,e.ColorFormats.FILTER)}:a}static async getPuppeteerDependency(){try{return Ci("puppeteer")}catch(t){return{errorMessage:i.MUST_INSTALL_PUPPETEER}}}static async preparePuppeteerBrowser(){const i=await s.getPuppeteerDependency();return t.ErrorHandling.hasError(i)?i:i.launch({headless:s.IS_HEADLESS})}static async convert(i){const e=await s.preparePuppeteerBrowser();if(t.ErrorHandling.hasError(e))return s.returnError(e.errorMessage);const n=await s.openBrowserPage(e),o=await s.addSVGAndValidateFilter(n,i);if(t.ErrorHandling.hasError(o))return s.returnError(o.errorMessage,e);const a=await s.getImageBase64ViaSVG(n),h=await n.evaluate(r.FilterToHexShared.getColorViaImageDataURL,a);return s.cleanup(e),{color:h}}}return De.FilterToHexNode=s,s.BASE_64_ENCODING="base64",s.ENCODED_DATA_URL_PREFIX=`data:image/png;${s.BASE_64_ENCODING},`,s.IS_HEADLESS=!0,s.SVG_SIDE_LENGTH_PX=2,De}())));n=await i.convert(t)}else n=await r.FilterToHexBrowser.convert(t);return n.color&&i&&"string"==typeof n.color&&(n.color=i(n.color,s)),n}catch(t){return n.ErrorHandling.generateUnexpectedError(t)}}},Ee}(),i=function(){if(Fe)return Ne;Fe=1;var t=Ne&&Ne.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.HexToColor=void 0;const i=(Le||(Le=1,Object.defineProperty(Ue,"__esModule",{value:!0}),Ue.ColorFormatter=void 0,Ue.ColorFormatter=class{static arrayToRgbString(t){return`rgb(${t[0]}, ${t[1]}, ${t[2]})`}static arrayToHslString(t){return`hsl(${t[0]}deg, ${t[1]}%, ${t[2]}%)`}}),Ue),e=t(Se());return Ne.HexToColor=class{static convertToRgb(t,n){const r=e.default.hex.rgb(t);return"string"===(null==n?void 0:n.resultType)?i.ColorFormatter.arrayToRgbString(r):r}static convertToHsl(t,n){const r=e.default.hex.hsl(t);return"string"===(null==n?void 0:n.resultType)?i.ColorFormatter.arrayToHslString(r):r}},Ne}();return Me.FilterToColor=class{static async filterToHex(i){const e=await t.FilterToHex.convert(i);return e.color&&(e.color=e.color.toUpperCase()),e}static async filterToRgb(e,n){return t.FilterToHex.convert(e,i.HexToColor.convertToRgb,n)}static async filterToHsl(e,n){return t.FilterToHex.convert(e,i.HexToColor.convertToHsl,n)}},Me}();class r{static rgbToFilter(t,i){return e.ColorToFilter.rgbToFilter(t,i)}static hexToFilter(t,i){return e.ColorToFilter.hexToFilter(t,i)}static hslToFilter(t,i){return e.ColorToFilter.hslToFilter(t,i)}static keywordToFilter(t,i){return e.ColorToFilter.keywordToFilter(t,i)}static async filterToHex(t){return n.FilterToColor.filterToHex(t)}static async filterToRgb(t,i){return n.FilterToColor.filterToRgb(t,i)}static async filterToHsl(t,i){return n.FilterToColor.filterToHsl(t,i)}}i.default=r,t.exports=r}(Li,Li.exports)),Li.exports));const qe=class{constructor(i){t(this,i),this.showSpeakIcon=!1,this.sliceWidth="30px",this.minDrops=1,this.maxDrops=1,this.margin="",this.padding="",this.filter="",this.borderRadius="0px",this.transform="",this.handleWindowResize=()=>this.updateStyles(),this.handleWindowLoad=()=>this.updateStyles(),this.delayVisible="",this.disableSpeak=!1}componentDidLoad(){if(a(this.el,this.delayVisible),h(this.el,this.type),""!==this.filter){const t=this.el.getElementsByTagName("img")[0];t&&(t.style.filter=`${He.hexToFilter(Z(this.filter).toHexString()).color}`)}this.showSpeakIcon&&y(this.el)}componentWillLoad(){this.updateStyles(),window.addEventListener("resize",this.handleWindowResize),window.addEventListener("load",this.handleWindowLoad)}disconnectedCallback(){window.removeEventListener("resize",this.handleWindowResize),window.removeEventListener("load",this.handleWindowLoad)}updateStyles(){const t=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:c(this.height,t),width:c(this.width,t),backgroundColor:c(this.bgColor,t),top:c(this.y,t),left:c(this.x,t),zIndex:this.z,display:c(`${this.visible}`,t)?"flex":"none",alignItems:"center",justifyContent:"center",margin:c(this.margin,t),padding:c(this.padding,t),transform:c(this.transform,t),borderRadius:this.borderRadius,borderImageSource:"true"===this.isSlice?`url(${u(this.src)})`:"none",borderImageSlice:"true"===this.isSlice?`${parseInt(this.sliceWidth)} fill`:"unset",borderImageRepeat:"true"===this.isSlice?"round":"unset",borderImageWidth:"true"===this.isSlice?`${this.sliceWidth}`:"unset",backgroundImage:"true"===this.isSlice?`url(${u(this.src)})`:"none"}}render(){return"true"===this.isSlice?i(e,{class:"slice",id:this.id,type:this.type,"tab-index":this.tabIndex,style:this.style,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,value:this.value,minDrops:this.minDrops,maxDrops:this.maxDrops,audio:this.audio,onTouch:this.onTouch,onCorrect:this.onCorrect,onInCorrect:this.onInCorrect,onEntry:this.onEntry}):i(e,{id:this.id,type:this.type,"tab-index":this.tabIndex,style:this.style,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,value:this.value,minDrops:this.minDrops,maxDrops:this.maxDrops,audio:this.audio,onTouch:this.onTouch,onCorrect:this.onCorrect,onInCorrect:this.onInCorrect,onEntry:this.onEntry,"disable-speak":this.disableSpeak},i("img",{class:"lido-image",src:u(this.src),alt:"",style:this.style}))}get el(){return n(this)}};qe.style=".lido-image{user-select:none;-webkit-user-drag:none;object-fit:contain;width:100% !important;height:100% !important;aspect-ratio:1 / 1;transform:rotate(0) !important;margin:0 !important}.slice{background-repeat:no-repeat;background-position:center;background-size:100% 100%}";const Xe=class{constructor(i){t(this,i),this.keys="",this.gap="10px",this.bgColor="",this.borderRadius="",this.keyboardInput=!1,this.columns="10",this.disableSpeak=!1,this.numberOfClick=0,this.inputString="",this.style={},this.handleWindowResize=()=>this.updateStyles(),this.handleWindowLoad=()=>this.updateStyles()}async inputValidation(t){if("click"!==this.type)return;const i=document.getElementById(U);if(!t.target.getAttribute("value"))return;let e=JSON.parse(localStorage.getItem(d))||"";localStorage.setItem(d,JSON.stringify(e));const n=document.body.getBoundingClientRect(),r=Array.from(i.querySelectorAll(".bubble-element")).filter((t=>{const i=t.getBoundingClientRect();return i.left<n.right&&i.right>n.left&&i.top<n.bottom&&i.bottom>n.top})).find((t=>{const i=t.getAttribute("value");return(null==i?void 0:i.startsWith(this.inputString.toLowerCase()))?t:null}));if(r){if(this.inputString.toLowerCase()===r.getAttribute("value").toLowerCase()){f(!0),p.getI().play(r),K(r),setTimeout((()=>{this.inputString=""}),1e3);const t=r.getAttribute("onCorrect");if(await g(t,r),r.style.animation="none",r.style.pointerEvents="none",this.numberOfClick++,localStorage.removeItem(d),this.numberOfClick===this.letterLength){const t=i.getAttribute("onCorrect");i.style.pointerEvents="none",await g(t,this.el),m(),b()}else E(r)}}else{f(!1),setTimeout((()=>{this.inputString=""}),1e3),localStorage.removeItem(d);const t=i.getAttribute("onInCorrect");await g(t,this.el)}}componentDidLoad(){if(document.getElementById(U).getAttribute("drop-action")===J.InfiniteDrop){const t=this.el.querySelectorAll(".key-button"),i=t[0];t.forEach((t=>{t.style.width=i.offsetWidth+"px",t.style.height=i.offsetHeight+"px"}))}}componentWillLoad(){this.updateStyles(),window.addEventListener("resize",this.handleWindowResize),window.addEventListener("load",this.handleWindowLoad)}disconnectedCallback(){window.removeEventListener("resize",this.handleWindowResize),window.removeEventListener("load",this.handleWindowLoad)}updateStyles(){const t=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:c(this.height,t),width:c(this.width,t),backgroundColor:c(this.bgColor,t),top:c(this.y,t),left:c(this.x,t),zIndex:this.z,fontSize:c(this.fontSize,t),fontFamily:this.fontFamily,color:c(this.fontColor,t),display:"true"===c(`${this.visible}`,t)?"flex":"none",margin:c(this.margin,t),padding:c(this.padding,t),borderRadius:c(this.borderRadius,t),columns:c(`${this.columns}`,t),gap:c(this.gap,t)}}render(){const t=this.keys.split(",").map((t=>t.trim())),n="true"===document.getElementById(U).getAttribute("show-check");return i(e,{key:"4de3b75fa2905744ad610d147d9b4fe9912dd732",class:"lido-keyboard",style:{width:this.style.width,height:this.style.height,position:"relative",margin:this.style.margin,zIndex:this.z}},this.keyboardInput&&i("div",{key:"7b5d293c52747700cde9c1069cfbbdae065e64f9",class:"input-area"},i("input",{key:"03a91cd87e6bb4f09bf698087258426dd9232f67",type:"text",value:this.inputString,class:"input-area",readonly:!0}),i("lido-text",{key:"d30e033a055df52b30b2f2775c2b3410ee37df63",visible:n?"true":"false",string:"<<","bg-color":"black","font-color":"white","border-radius":"20px","font-size":"30px",width:"100px",height:"70px",type:"click",onClick:()=>{this.inputString=this.inputString.slice(0,-1),this.inputValidation(event)}}),i("lido-text",{key:"70d78aed7dedbe7d03a05c13c4c320029280bb03",visible:n?"true":"false",id:"lido-checkButton",string:"Enter","bg-color":"green","font-color":"white","border-radius":"20px","font-size":"30px",width:"150px",height:"70px",type:"click"})),this.letterLength&&i("lido-text",{key:"19306cd12bd98dc8dc7b54b20bad3f2f0318116f",visible:"true",string:`${this.numberOfClick}/${this.letterLength}`,"font-size":"60px","font-color":"white",onEntry:"this.position='absolute'; this.right='0'; this.fontWeight='800';",x:"unset"}),i("div",{key:"826900d6ba26175eb45d2e7e4c02fccce2004db3",class:"keyboard-wrapper",style:{display:"flex",flexWrap:"wrap",justifyContent:"center",alignContent:"stretch",gap:this.gap,width:"100%",height:"100%"}},t.map(((t,e)=>{const[n,r]=t.split("-"),s="disable"===r;let o="Space"===n?" ":n;return i("lido-text",{id:"key-button-"+e,style:{flex:`0 0 calc(${100/parseInt(this.style.columns)}% - ${this.style.gap})`},visible:"true","font-size":this.style.fontSize,"font-color":this.fontColor,"font-family":this.fontFamily,"bg-color":this.bgColor,string:n,onEntry:this.onEntry,"border-radius":this.style.borderRadius,value:n.toLowerCase(),type:this.type,class:"key-button"+(s?" disabled":""),onClick:()=>{this.inputString+=o,this.inputValidation(event)},"disable-speak":this.disableSpeak})}))))}get el(){return n(this)}};Xe.style='.lido-keyboard{display:flex;flex-direction:column;align-items:center;gap:30px}.input-area{display:flex;gap:15px}input[type="text"]{font-size:30px;font-weight:600;padding-left:20px;width:300px;height:70px;border:2px solid;background:whitesmoke;border-radius:20px;text-align:center}.keyboard-wrapper{justify-content:center;width:700px}.disabled{opacity:0.5;pointer-events:none}.key-button{background:aquamarine;font-weight:600}';const Ve=class{constructor(i){t(this,i),this.rows="10",this.cols="10",this.defualtFill=0,this.leftIndex=!1,this.topIndex=!1,this.bottomIndex=!1,this.clickable=!0,this.activeOnlyVisible=!1,this.activeBgColor="transparent",this.deactiveBgColor="transparent",this.border="2px solid green",this.height="100%",this.width="100%",this.borderRadius="5px",this.visible="false",this.previousFilledSlot=-1,this.previousFilledSlotElement=null,this.style={},this.handleWindowResize=()=>this.updateStyles(),this.handleWindowLoad=()=>this.updateStyles()}updateValue(t){this.el.setAttribute("value",t)}componentDidLoad(){const t=this.el.querySelectorAll(".slot");h(this.el,this.type),t.forEach((t=>{const i=t;i.style.setProperty("--active-bg-color",this.activeBgColor),i.style.setProperty("--deactive-bg-color",this.deactiveBgColor),i.style.pointerEvents=this.clickable?"":"none",i.style.border=this.border,i.style.color=this.fontColor,i.className.includes("slot-active")?(i.style.visibility="",this.matrixImage&&i.style.setProperty("--bg-image",`url(${u(this.matrixImage)})`)):this.activeOnlyVisible&&(i.style.visibility="hidden")})),this.updateSlots(),this.updateStyles()}componentWillLoad(){this.updateStyles(),this.updateSlots(),window.addEventListener("resize",this.handleWindowResize),window.addEventListener("load",this.handleWindowLoad)}disconnectedCallback(){window.removeEventListener("resize",this.handleWindowResize),window.removeEventListener("load",this.handleWindowLoad)}updateSlots(){const t=this.el.querySelectorAll(".slot"),i=this.el.querySelector(".slot");if(!t.length||!i)return;const e=document.getElementById(U);let n=this.rows,r=this.cols;e&&"multiplyBeeds"===e.getAttribute("template-id")&&(r="9",n="1");const s=Number(n)<Number(r)?this.el.offsetHeight:this.el.offsetWidth,o=Number(n)>Number(r)?Number(n):Number(r),a=this.el.querySelectorAll(".slot-parent"),h=s/o;a.forEach((t=>{t.style.width=`${h}px`,Array.from(t.children).forEach((t=>{const i=t;i.style.width=`${h}px`,i.style.height=`${h}px`,"drop"!==this.type&&"drag"!==this.type&&"checkerBlock"!==this.type||(this.el.style.width="auto",this.el.style.height="auto"),(!this.topIndex&&i.classList.contains("topIndex")||!this.leftIndex&&i.classList.contains("leftIndex")||!this.bottomIndex&&i.classList.contains("bottomIndex"))&&(i.classList.contains("leftIndex")&&i.parentElement.remove(),i.remove())}))}))}updateStyles(){const t=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:c(this.height,t),width:c(this.width,t),zIndex:this.z,display:"true"===c(`${this.visible}`,t)?"flex":"none",borderRadius:c(this.borderRadius,t),left:c(this.x,t),top:c(this.y,t),cols:c(`${this.cols}`,t),rows:c(`${this.rows}`,t)}}handleClickSlot(t){const i=parseInt(t.className.split(" ")[1].split("-")[1]),e=this.el.querySelectorAll(".slot");if(e.forEach(((t,e)=>{const n=t;e<i?(n.classList.add("slot-active"),n.classList.remove("slot-inactive"),this.matrixImage&&n.style.setProperty("--bg-image",`url(${u(this.matrixImage)})`)):(n.classList.remove("slot-active"),n.classList.add("slot-inactive"))})),-1!==this.previousFilledSlot&&null!==this.previousFilledSlotElement&&(this.previousFilledSlotElement.textContent=""),t.textContent=i.toString(),this.previousFilledSlot=i,this.previousFilledSlotElement=t,i===e.length)try{const t=new CustomEvent("math-matrix-bottom-click",{detail:{matrix:this.el,cols:this.style.cols,rows:this.style.rows},bubbles:!0,composed:!0});this.el.dispatchEvent(t)}catch(t){console.warn("Error dispatching math-matrix-bottom-click from handleClickSlot",t)}this.updateValue(i.toString()),Q()}getSlotData(){const t={};return this.text?(this.text.split(",").forEach(((i,e)=>{const[n,r]=i.split("-"),s=parseInt(n.trim());isNaN(s)||(t[e]={text:n.trim(),color:null==r?void 0:r.trim()})})),t):t}render(){let t=1;const n=this.getSlotData();return i(e,{key:"4628494c0109ae927e379a442d3921b40e01f1e3",class:"math-matrix",style:{height:this.style.height,width:this.style.width,z:this.style.z,display:this.style.display,top:this.style.top,left:this.style.left},type:this.type,value:this.value,"tab-index":this.tabIndex,rows:this.style.rows,cols:this.style.cols,text:this.text,onCorrect:this.onCorrect,onInCorrect:this.onInCorrect,onEntry:this.onEntry},Array.from({length:parseInt(this.style.rows)+1},((e,r)=>i("div",{class:"slot-parent",key:`row-${r}`},i("div",{style:0===r&&{visibility:"hidden"},class:"topIndex"},r),Array.from({length:parseInt(this.style.cols)},((e,s)=>{var o,a;return 0===r?i("div",{class:"leftIndex"},++s):i("div",{class:`slot slot-${t} ${this.defualtFill>=t?"slot-active":"slot-inactive"}`,onClick:t=>this.handleClickSlot(t.currentTarget),key:`slot-${r}-${s}`,style:{borderRadius:this.style.borderRadius,backgroundColor:(null===(o=n[t-1])||void 0===o?void 0:o.color)||""}},null===(a=n[t-1])||void 0===a?void 0:a.text,t++&&null)})),i("div",{style:0===r&&{visibility:"hidden"},class:"bottomIndex"},parseInt(this.style.cols)*r)))))}get el(){return n(this)}};Ve.style=".math-matrix{width:100%;height:100%;display:flex;justify-content:center}.slot{width:100%;height:100%;text-align:center;align-content:center;font-size:42px;font-weight:800;font-family:'Baloo Bhai 2';box-sizing:content-box}.slot:hover{opacity:0.7}.slot-parent{width:100%;height:100%;display:flex;justify-content:center;align-items:center;flex-direction:column}.slot-active{background-color:var(--active-bg-color);background-image:var(--bg-image);background-size:contain;background-position:center;background-repeat:no-repeat}.slot-inactive{background-color:var(--deactive-bg-color);background-size:cover;background-position:center;background-repeat:no-repeat}.topIndex,.leftIndex,.bottomIndex{height:100%;width:100%;text-align:center;align-content:center;font-size:30px;font-weight:600;font-family:'Baloo Bhai 2'}";const Ge=class{constructor(i){t(this,i),this.id="",this.value="",this.height="auto",this.width="auto",this.ariaLabel="",this.ariaHidden="",this.x="0px",this.y="0px",this.z="0",this.bgColor="",this.type="",this.tabIndex=0,this.visible=!1,this.audio="",this.onTouch="",this.onInCorrect="",this.onCorrect="",this.onEntry="",this.minDrops=1,this.maxDrops=1,this.margin="",this.handleWindowResize=()=>this.updateStyles(),this.handleWindowLoad=()=>this.updateStyles()}componentDidLoad(){h(this.el,this.type)}componentWillLoad(){this.updateStyles(),window.addEventListener("resize",this.handleWindowResize),window.addEventListener("load",this.handleWindowLoad)}disconnectedCallback(){window.removeEventListener("resize",this.handleWindowResize),window.removeEventListener("load",this.handleWindowLoad)}updateStyles(){const t=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:c(this.height,t),width:c(this.width,t),backgroundColor:c(this.bgColor,t),top:c(this.y,t),left:c(this.x,t),zIndex:this.z,display:JSON.parse(c(`${this.visible}`,t))?"block":"none",margin:c(this.margin,t)}}render(){return i(e,{key:"cfd38900b31991e89c21a099fc4f91f77663ae94",id:this.id,class:"lido-pos",type:this.type,"tab-index":this.tabIndex,style:this.style,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,minDrops:this.minDrops,maxDrops:this.maxDrops,value:this.value,audio:this.audio,onTouch:this.onTouch,onCorrect:this.onCorrect,onInCorrect:this.onInCorrect,onEntry:this.onEntry},i("slot",{key:"73f7bfe2d8214693d6f40a4dab6d735906ad4eaa"}))}get el(){return n(this)}};Ge.style=".lido-pos{top:var(--y, 0);left:var(--x, 0);height:var(--height, 100%);width:var(--width, 100%);background-color:var(--bgColor, #eeeeee);display:flex;justify-content:space-around;flex-direction:column;position:fixed}.lido-pos>*{position:absolute}";const Ye=class{constructor(i){t(this,i),this.showSpeakIcon=!1,this.id="",this.value="",this.height="auto",this.width="auto",this.ariaLabel="",this.ariaHidden="",this.x="0px",this.y="0px",this.z="0",this.bgColor="",this.type="",this.tabIndex=0,this.visible=!1,this.audio="",this.onTouch="",this.onInCorrect="",this.onCorrect="",this.onEntry="",this.minDrops=1,this.maxDrops=1,this.margin=""}componentDidLoad(){setTimeout((()=>{const t=this.el.parentElement;if(!t)return;const i=t.offsetWidth,e=t.offsetHeight;Array.from(this.el.children).forEach((t=>{const n=i-t.offsetWidth,r=e-t.offsetHeight,s=Math.random()*n,o=Math.random()*r;t.style.position="absolute",t.style.left=`${s}px`,t.style.top=`${o}px`}))}),50),this.showSpeakIcon&&y(this.el)}render(){return i(e,{key:"a4cec45d407b57833a4296a20230717534adf39b",class:"lido-random",type:this.type,"tab-index":this.tabIndex,value:this.value,style:{height:this.height,width:this.width,top:this.y,left:this.x,display:this.visible?"block":"none",zIndex:this.z,backgroundColor:this.bgColor,margin:this.margin},"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,audio:this.audio,onTouch:this.onTouch,onCorrect:this.onCorrect,minDrops:this.minDrops,maxDrops:this.maxDrops,onInCorrect:this.onInCorrect,onEntry:this.onEntry},i("slot",{key:"b80726b68b7f1c009f35352b9d05cd573159f87b"}))}get el(){return n(this)}};Ye.style=".lido-random{position:relative;width:100%;height:100%}.lido-random>*{position:absolute}";const Ze=class{constructor(i){t(this,i),this.Lang="",this.xmlPath="",this.initialIndex=0,this.margin="",this.canplay=!0,this.baseUrl="",this.zipUrl=""}connectedCallback(){this.setLanguage(this.Lang)}onLangChange(t){this.setLanguage(t)}setLanguage(t){si.changeLanguage(t||si.language)}async componentWillLoad(){var t,i;if(this.zipUrl)return void(this.xmlData="");const e=null!==(t=this.xmlPath)&&void 0!==t?t:this.baseUrl+((null===(i=this.baseUrl)||void 0===i?void 0:i.endsWith("/"))?"index.xml":"/index.xml");try{const t=e.startsWith("http")?e:s(e),i=await fetch(t);if(!i.ok)throw new Error(`Failed to fetch XML data: ${i.statusText}`);const n=await i.text();this.xmlData=n}catch(t){console.error("Error fetching XML data:",t),this.xmlData=null}}render(){return void 0===this.xmlData?i("div",null,"Loading..."):null===this.xmlData?i("div",null,"Error loading XML data. Please check the path or URL."):i("lido-home",Object.assign({showNav:!0,activeContainerIndexes:[],initialIndex:this.initialIndex,canplay:this.canplay,xmlData:this.xmlData,baseUrl:this.baseUrl},this.zipUrl?{zipUrl:this.zipUrl}:{},{exitButtonUrl:this.exitButtonUrl,prevButtonUrl:this.prevButtonUrl,nextButtonUrl:this.nextButtonUrl,speakerButtonUrl:this.speakerButtonUrl}))}static get assetsDirs(){return["assets"]}static get watchers(){return{Lang:[{onLangChange:0}]}}},Ke=class{constructor(i){t(this,i),this.showSpeakIcon=!1,this.minDrops=1,this.maxDrops=1,this.style={},this.handleWindowResize=()=>this.updateStyles(),this.handleWindowLoad=()=>this.updateStyles(),this.margin="",this.disableSpeak=!1}componentDidLoad(){h(this.el,this.type),w(this.el,this.minLength,this.maxLength,this.childElementsLength),this.showSpeakIcon&&y(this.el)}componentWillLoad(){this.updateStyles(),window.addEventListener("resize",this.handleWindowResize),window.addEventListener("load",this.handleWindowLoad)}disconnectedCallback(){window.removeEventListener("resize",this.handleWindowResize),window.removeEventListener("load",this.handleWindowLoad)}updateStyles(){const t=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:c(this.height,t),width:c(this.width,t),backgroundColor:c(this.bgColor,t),top:c(this.y,t),left:c(this.x,t),zIndex:this.z,display:this.visible?this.display?c(this.display,t):"flex":"none",flexDirection:this.direction?c(this.direction,t):"row",gridTemplateColumns:this.display&&"grid"===c(this.display,t)?"repeat(auto-fill, minmax(186px, auto))":void 0,gap:this.display&&"grid"===c(this.display,t)?"20px":void 0,margin:c(this.margin,t)}}render(){return i(e,{key:"c69aea0b1b11d9aec167d1a4376f68073f91ca81",class:"lido-row",type:this.type,"tab-index":this.tabIndex,value:this.value,style:this.style,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,minDrops:this.minDrops,maxDrops:this.maxDrops,audio:this.audio,onTouch:this.onTouch,onCorrect:this.onCorrect,onInCorrect:this.onInCorrect,onEntry:this.onEntry,"disable-speak":this.disableSpeak},i("slot",{key:"8756ee0447057cddb949e23decbde5fe4d1d25c8"}))}get el(){return n(this)}};Ke.style=".lido-row{display:flex;justify-content:space-around;align-items:center;}.lido-row>*{}";const Je=class{constructor(i){t(this,i),this.id="",this.value="",this.height="auto",this.width="auto",this.ariaLabel="",this.ariaHidden="",this.x="0px",this.y="0px",this.z="0",this.bgColor="",this.type="",this.tabIndex=0,this.shapeType="circle",this.visible=!1,this.audio="",this.onTouch="",this.onInCorrect="",this.onCorrect="",this.onEntry="",this.minDrops=1,this.maxDrops=1,this.margin="",this.delayVisible="",this.disableSpeak=!1,this.style={}}componentDidLoad(){a(this.el,this.delayVisible),h(this.el,this.type),this.updateStyles(),this.lido3DShapes()}updateStyles(){const t=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={x:c(`${this.x}`,t),y:c(`${this.y}`,t),height:c(`${this.height}`,t),width:c(`${this.width}`,t)}}lido3DShapes(){const t=window.innerHeight>window.innerWidth?"portrait":"landscape";"lido-cube"===this.shapeType&&this.el.querySelectorAll(".face").forEach((i=>{const e=i;e.style.setProperty("--face-width",c(`${this.width}`,t));const n=parseInt(c(`${this.width}`,t))/2;e.style.setProperty("--face-translate",`${n}px`),e.style.setProperty("--face-bg-color",this.bgColor)}))}render(){return i(e,{key:"b252b5dbf4624939ef2917a385fc95061695bc64",class:`lido-shape ${this.shapeType}`,value:this.value,type:this.type,"tab-index":this.tabIndex,style:{height:"polygon"!==this.shapeType?this.style.height:void 0,width:"polygon"!==this.shapeType?this.style.width:void 0,top:this.style.y,left:this.style.x,display:this.visible?"block":"none",zIndex:this.z,backgroundColor:"polygon"!==this.shapeType?this.bgColor:"transparent",margin:this.margin},"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,audio:this.audio,minDrops:this.minDrops,maxDrops:this.maxDrops,onTouch:this.onTouch,onCorrect:this.onCorrect,onInCorrect:this.onInCorrect,onEntry:this.onEntry,"disable-speak":this.disableSpeak},"lido-cube"===this.shapeType&&i("div",{key:"573e3aaee8ada8da25b434058962f034ee7bcd2a",class:"cube"},i("div",{key:"4d5bb38b531a0a4cc6ffa9df25312b41718c81d2",class:"face top"}),i("div",{key:"01f93868cbc55844969e50256f505391323c4cbe",class:"face bottom"}),i("div",{key:"44ab31e212d6dd0e321a30154e0bd6cba61f5367",class:"face left"}),i("div",{key:"28b970d25d8ce54c4f96d418b05c559964a1e882",class:"face right"}),i("div",{key:"6da6d820eaa308e2401e3063de298be165428ff4",class:"face front"}),i("div",{key:"caaee0b7580ad10f925a610650098cbe7abc31a4",class:"face back"})))}get el(){return n(this)}};Je.style=".lido-shape{position:absolute;top:var(--y);left:var(--x);display:var(--display);z-index:var(--z);justify-content:center;align-items:center}.lido-rectangle{border-radius:0}.lido-circle{width:var(--width);height:var(--width);border-radius:50%;background-color:var(--bgColor)}.lido-ellipse{width:var(--width);height:var(--height);border-radius:50%;background-color:var(--bgColor)}.lido-triangle{width:var(--triangleWidth);height:var(--triangleHeight);background-color:var(--bgColor);clip-path:polygon(50% 0%, 100% 100%, 0% 100%)}.lido-rightTriangle{width:var(--triangleWidth);height:var(--triangleHeight);background-color:var(--bgColor);clip-path:polygon(100% 0%, 100% 100%, 0% 100%)}.lido-leftTriangle{width:var(--triangleWidth);height:var(--triangleHeight);background-color:var(--triangleBgColor);clip-path:polygon(0% 0%, 100% 100%, 0% 100%)}.lido-parallelogram{width:var(--paralleWidth);height:var(--paralleHeight);transform:skew(20deg)}.lido-trapezium{width:var(--trapeziumWidth);height:var(--trapeziumHeight);background-color:var(--bgColor);clip-path:polygon( 20% 0%, 80% 0%, 100% 100%, 0% 100% )}.lido-hexagon{width:var(--hexagonWidth);height:var(--hexagonHeight);background-color:var(--bgColor);clip-path:polygon( 25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50% )}.lido-cone{width:var(--coneWidth);height:var(--coneHeight);background-color:var(--bgColor);clip-path:polygon( 15% 10%, 25% 4%, 35% 1%, 50% 0%, 65% 1%, 75% 4%, 85% 10%, 50% 100% )}.lido-star{width:var(--starWidth);height:var(--starHeight);background-color:var(--starBgColor);clip-path:polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%)}.lido-pentagon{width:var(--pentagonWidth);height:var(--pentagonHeight);background-color:var(--pentagonBgColor);clip-path:polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%)}.lido-heptagon{width:var(--heptagonWidth);height:var(--heptagonHeight);background-color:var(--heptagonBgColor);clip-path:polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%)}.lido-octagon{width:var(--octagonWidth);height:var(--octagonHeight);background-color:var(--octagonBgColor);clip-path:polygon(25% 0%, 75% 0%, 100% 25%, 100% 75%, 75% 100%, 25% 100%, 0% 75%, 0% 25%)}.lido-rhombus{width:var(--rhombusWidth);height:var(--rhombusHeight);background-color:var(--rhombusBgColor);clip-path:polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%)}.lido-heart{height:var(--heartHeight);width:var(--heartWidth);border-image:radial-gradient(var(--heartBgColor) 69%, #0000 70%) 84.5%/50%;clip-path:polygon(-41% 0, 50% 91%, 141% 0)}.cube{width:100%;height:100%;position:relative;transform-style:preserve-3d;transform:rotateX(-20deg) rotateY(45deg)}.face{position:absolute;width:var(--face-width,150px);height:var(--face-width,150px);background:var(--face-bg-color,150px);box-shadow:inset -20px -20px 40px rgba(0,0,0,0.3)}.front{transform:rotateY( 0deg) translateZ(var(--face-translate, 75px))}.back{transform:rotateY(180deg) translateZ(var(--face-translate, 75px))}.right{transform:rotateY( 90deg) translateZ(var(--face-translate, 75px))}.left{transform:rotateY(-90deg) translateZ(var(--face-translate, 75px))}.top{transform:rotateX( 90deg) translateZ(var(--face-translate, 75px))}.bottom{transform:rotateX(-90deg) translateZ(var(--face-translate, 75px))}.lido-cylinder{width:var(--width);height:var(--height);border-radius:100% / 80px;background:radial-gradient(50% 40px at 50% 40px, #0003 99.99%, #0000 0), radial-gradient(50% 40px at 50% calc(100% - 40px), #fff3 99.99%, #0000 0), red}.lido-sphere{position:relative;width:var(--width);height:var(--width);border-radius:50%;background:radial-gradient(circle at 30% 18%, #22d4ff 0%, #18c2f4 9%, rgba(24, 194, 244, 0.2) 18%, transparent 30%), radial-gradient(circle at 36% 26%, #0f8fff 0%, #0b67e6 30%, #083fbe 62%, #120084 100%);box-shadow:inset -22px -26px 40px rgba(5, 0, 70, 0.38), inset 14px 14px 24px rgba(255, 255, 255, 0.05), 0 4px 2px rgba(0, 0, 0, 0.78);overflow:visible}.lido-sphere::after{content:'';position:absolute;top:50%;left:50%;width:100%;height:16%;border-radius:50%;border-top:2px dashed rgba(0, 0, 0, 0.65);border-bottom:3px solid rgba(0, 0, 0, 0.85);box-sizing:border-box;transform:translate(-50%, -50%);pointer-events:none}";const Qe=class{constructor(i){t(this,i),this.id="lido-slide-fill",this.padding="",this.borderRadius="0px",this.numberType="integer",this.min=0,this.division=5,this.max=10,this.type="",this.onEntry="",this.svgContent="",this.handleWindowResize=()=>this.updateStyles(),this.handleWindowLoad=()=>this.updateStyles(),this.delayVisible="",this.disableSpeak=!1,this.originalHeight=null,this.originalY=null}async componentWillLoad(){await this.renderSVG(),this.updateStyles(),window.addEventListener("resize",this.handleWindowResize),window.addEventListener("load",this.handleWindowLoad)}disconnectedCallback(){window.removeEventListener("resize",this.handleWindowResize),window.removeEventListener("load",this.handleWindowLoad)}async onSrcChange(){await this.renderSVG(),this.onPropChange()}async renderSVG(){const t=await fetch(u(this.src));if(t.ok){let i=await t.text(),e=0;i=i.replace(/<path([^>]*)>/g,((t,i)=>(e++,`<path id="${1===e?"glassPath":2===e?"rulerPath":`path${e}`}"${i}>`))),i=i.replace(/<svg([^>]*)>/,'<svg class="lido-slide-svg"$1>\n \n <clipPath id="clipGlass">\n <use xlink:href="#glassPath" />\n </clipPath>\n \n '),i=i.replace(/<rect([^>]*)\/?>/,'<rect id="fillArea" $1 clip-path="url(#clipGlass)" />'),this.svgContent=i}}componentDidLoad(){a(this.el,this.delayVisible),h(this.el,this.type),this.updateFill(),this.addRulerNumbers()}updateStyles(){const t=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:c(this.height,t),width:c(this.width,t),backgroundColor:c(this.bgColor,t),top:c(this.y,t),left:c(this.x,t),zIndex:this.z,display:c(`${this.visible}`,t)?"flex":"none",alignItems:"center",justifyContent:"center",margin:c(this.margin,t),padding:c(this.padding,t),borderRadius:this.borderRadius}}onPropChange(){this.updateFill(),this.addRulerNumbers()}updateFill(){var t;const i=null===(t=this.el.querySelector(".lido-svg-element"))||void 0===t?void 0:t.querySelector("svg");if(!i)return;const e=i.querySelector("#fillArea");if(!e)return;const n=this.fillDirection;let r,s;"vertical"===this.fillDirection?(null!==this.originalHeight&&null!==this.originalY||(this.originalHeight=+e.getAttribute("height")||100,this.originalY=+e.getAttribute("y")||0),r=this.originalHeight,s=this.originalY):(null!==this.originalHeight&&null!==this.originalY||(this.originalHeight=+e.getAttribute("width")||100,this.originalY=+e.getAttribute("x")||0),r=this.originalHeight,s=this.originalY);const o=r,a=s;let h=0;if("string"==typeof this.fill){const t=this.fill.match(/^(\d+(?:\.\d+)?)%$/);if(t)h=Math.min(Math.max(parseFloat(t[1])/100,0),1);else{const t=this.fill.match(/^(\d+(?:\.\d+)?)$/);t&&(h=Math.min(Math.max(parseFloat(t[1])/100,0),1))}}const u=o*h,c="vertical"===n?a+(o-u):a;"vertical"===n?(e.setAttribute("height",u.toString()),e.setAttribute("y",c.toString())):(e.setAttribute("width",u.toString()),e.setAttribute("x","0"))}addRulerNumbers(){var t;const i=null===(t=this.el.querySelector(".lido-svg-element"))||void 0===t?void 0:t.querySelector("svg");if(!i)return;const e=i.querySelector("#rulerPath");if(!e)return;i.querySelectorAll(".ruler-number").forEach((t=>t.remove()));const n=this.division,r=n+1,s=e.getTotalLength(),o=(this.max-this.min)/n;for(let t=0;t<r;t++){let r=0;"vertical"===this.fillDirection?r=this.max-t*o:"horizontal"===this.fillDirection&&(r=this.min+t*o);const a=e.getPointAtLength(s/n*t),h=document.createElementNS("http://www.w3.org/2000/svg","text"),u=tt(r/this.max);r="integer"===this.numberType?Math.round(r):"decimal"===this.numberType?parseFloat(r.toFixed(1)):u.toFraction(!0),h.classList.add("ruler-number"),h.setAttribute("x",a.x.toString()),h.setAttribute("y",(a.y+15).toString()),h.setAttribute("text-anchor","end"),h.setAttribute("font-size","40"),h.setAttribute("fill","#333"),h.textContent=r.toString(),i.appendChild(h)}}render(){return i(e,{key:"a19d35ba055a5ed9ab38adb02f37c9cb634c272d",id:this.id,class:"lido-slide-fill",src:this.src,fill:this.fill,fillDirection:this.fillDirection,slider:this.slider,style:this.style,min:this.min,max:this.max,division:this.division,numberType:this.numberType,onEntry:this.onEntry,type:this.type,"disable-speak":this.disableSpeak},i("div",{key:"987f42b3c213f570714b2ddf600243e83c3b12ad",innerHTML:this.svgContent,class:"lido-svg-element"}))}get el(){return n(this)}static get watchers(){return{src:[{onSrcChange:0}],fill:[{onPropChange:0}],division:[{onPropChange:0}],fillDirection:[{onPropChange:0}],numberType:[{onPropChange:0}],min:[{onPropChange:0}],max:[{onPropChange:0}]}}};Qe.style=".lido-svg-element,.lido-slide-svg{width:100%;height:100%}";const tn=class{constructor(i){t(this,i),this.showSpeakIcon=!1,this.id="",this.value="",this.string="",this.fontFamily="",this.fontSize="20px",this.fontColor="",this.highlightWhileSpeaking=!1,this.height="auto",this.width="auto",this.ariaLabel="",this.ariaHidden="",this.move="false",this.x="0px",this.y="0px",this.z="0",this.bgColor="",this.borderImage="",this.type="",this.tabIndex=0,this.visible=!1,this.audio="",this.onTouch="",this.onInCorrect="",this.onCorrect="",this.minDrops=1,this.maxDrops=1,this.onEntry="",this.margin="",this.padding="",this.borderRadius="0px",this.spanType="",this.style={},this.handleWindowResize=()=>this.updateStyles(),this.handleWindowLoad=()=>this.updateStyles(),this.delayVisible="",this.disableSpeak=!1}componentDidLoad(){if(a(this.el,this.delayVisible),h(this.el,this.type),"words"!==this.spanType&&"letters"!==this.spanType||this.addSpanToText(),this.showSpeakIcon&&y(this.el),!this.audio||""===this.audio.trim()){const t=()=>{const t=this.resolveAutoAudio();t&&(this.audio=t)};window.__LIDO_COMMON_AUDIO_PATH__?t():window.addEventListener(it,t,{once:!0})}}resolveAutoAudio(){const t=window[N];return t&&this.string?`${t}/${this.string}.mp3`:null}componentWillLoad(){this.updateStyles(),window.addEventListener("resize",this.handleWindowResize),window.addEventListener("load",this.handleWindowLoad)}disconnectedCallback(){window.removeEventListener("resize",this.handleWindowResize),window.removeEventListener("load",this.handleWindowLoad)}updateStyles(){const t=this.borderImage?u(this.borderImage):"",i=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:c(this.height,i),width:c(this.width,i),backgroundColor:c(this.bgColor,i),top:c(this.y,i),left:c(this.x,i),zIndex:this.z,fontSize:c(this.fontSize,i),fontFamily:this.fontFamily,color:c(this.fontColor,i),display:"true"===c(`${this.visible}`,i)?"flex":"none",borderImage:`url(${t})`,borderImageSlice:t?"0 fill":"",margin:c(this.margin,i),padding:c(this.padding,i),borderRadius:c(this.borderRadius,i)}}async addSpanToText(){const t=this.el.querySelector(".lido-text-content");if(!t)return;const i=t.textContent||"";t.innerHTML="","letters"===this.spanType&&i.split("").forEach((i=>{if(""===i.trim())return;const e=document.createElement("span");e.textContent=i,e.className="text-letters",t.appendChild(e)})),"words"===this.spanType&&i.split(" ").forEach((i=>{const e=document.createElement("span");e.textContent=i,e.className="text-words",t.appendChild(e)}))}render(){return i(e,{key:"30e77a008aba08f90f88541574f70588bb8a2cd6",class:"lido-text",value:this.value,type:this.type,"tab-index":this.tabIndex,audio:this.audio,onTouch:this.onTouch,onCorrect:this.onCorrect,onInCorrect:this.onInCorrect,onEntry:this.onEntry,minDrops:this.minDrops,maxDrops:this.maxDrops,id:this.id,style:this.style,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,move:this.move,"span-type":this.spanType,"disable-speak":`${this.disableSpeak}`},""!==this.spanType?i("div",{class:"lido-text-content"}," ",si.t(this.string)):si.t(this.string))}get el(){return n(this)}};tn.style=".lido-text{transition:background-color 0.3s ease;user-select:none;align-items:center;justify-content:center;text-align:center;border-radius:24px;color:#333;cursor:pointer;font-family:'Baloo Bhai 2', serif}.text-letters{transition:color 0.3s, text-shadow 0.3s;display:inline-block;padding:0 2px}.text-letters.letter-highlight{color:#8e24aa;background:none;border-radius:0;text-shadow:0 2px 8px #8e24aa88;animation:text-letter-bounce 0.4s}.text-words{transition:color 0.3s, text-shadow 0.3s;display:inline-block;padding:0 2px}.text-words.word-highlight{color:#8e24aa;background:none;border-radius:0;text-shadow:0 2px 8px #8e24aa88;animation:text-word-bounce 0.4s}@keyframes text-letter-bounce{0%{transform:scale(1)}60%{transform:scale(1.4)}100%{transform:scale(1)}}@keyframes text-word-bounce{0%{transform:scale(1)}60%{transform:scale(1.3)}100%{transform:scale(1)}}";const en=class{constructor(i){t(this,i),this.showSpeakIcon=!1,this.id="",this.svgSource="",this.svgUrls=[],this.audioUrls=[],this.currentSvgIndex=0,this.moving=!1,this.value="",this.height="auto",this.width="auto",this.audio="",this.x="0px",this.y="0px",this.z="0",this.ariaLabel="",this.ariaHidden="",this.tabIndex=0,this.mode=et.ShowFlow,this.fingerHintUrl="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/trace/Tracing-hand.svg",this.highlightTextId="",this.animationTrace=!1,this.delayVisible="",this.disableSpeak=!1,this.style={},this.handleWindowResize=()=>this.updateStyles(),this.handleWindowLoad=()=>this.updateStyles(),this.fileIndex=-1,this.isDragging=!1,this.activePointerId=null,this.freeTraceUpdateCounter=0,this.idleTimer=null,this.fingerImg=null}async initializeSVG(){let t={fileIndex:-1,currentPathIndex:0,lastLength:0,totalPathLength:0,isDragging:!1,circle:null,paths:[],svg:null,proximityThreshold:60,freeTraceProximityThreshold:350,rafId:null,pointerMoveEvent:null,activePointerId:null,mode:this.mode,flowMarkers:[],freeTraceLines:[],currentFreePath:[],lastPointerPos:null,dragOffset:null,isCompletingPath:!1};const i=this.svgUrls[this.currentSvgIndex];i&&""!==i.trim()?(await this.fetchSVG(u(i)),await this.loadAnotherSVG(t,!0)):console.error("No SVG URL provided or index out of bounds.")}componentDidLoad(){a(this.el,this.delayVisible)}componentWillLoad(){this.updateStyles(),window.addEventListener("resize",this.handleWindowResize),window.addEventListener("load",this.handleWindowLoad),this.svgUrls=this.svgSource.split(";").map((t=>t.trim())),this.currentSvgIndex=0,this.showSpeakIcon&&(nt(this.el),this.el.append(nt(this.el))),this.initializeSVG()}disconnectedCallback(){window.removeEventListener("resize",this.handleWindowResize),window.removeEventListener("load",this.handleWindowLoad)}resetIdleTimer(t){null!==this.idleTimer&&(clearTimeout(this.idleTimer),this.idleTimer=null),this.idleTimer=window.setTimeout((()=>{this.showFingerHint(t)}),3e3)}showFingerHint(t){var i;if(this.fingerImg)return;const e=t.paths[t.currentPathIndex];if(!e)return;const n=document.createElementNS("http://www.w3.org/2000/svg","image"),r=new Image;r.onload=()=>{n.setAttributeNS("http://www.w3.org/1999/xlink","href",u(this.fingerHintUrl))},r.onerror=()=>{n.setAttributeNS("http://www.w3.org/1999/xlink","href",u(rt))},r.src=u(this.fingerHintUrl||rt),n.setAttribute("width","40"),n.setAttribute("height","40"),n.setAttribute("id","lido-finger-hint"),n.style.pointerEvents="none",n.style.opacity="0.8",n.setAttribute("x","0"),n.setAttribute("y","0");const s=document.createElementNS("http://www.w3.org/2000/svg","animateMotion");s.setAttribute("dur","2s"),s.setAttribute("repeatCount","indefinite");const o=document.createElementNS("http://www.w3.org/2000/svg","mpath");o.setAttributeNS("http://www.w3.org/1999/xlink","href",`#${e.id}`),s.appendChild(o),n.appendChild(s),null===(i=t.svg)||void 0===i||i.appendChild(n),this.fingerImg=n}hideFingerHint(){this.fingerImg&&this.fingerImg.parentNode&&this.fingerImg.parentNode.removeChild(this.fingerImg),this.fingerImg=null}async fetchSVG(t){const i=await fetch(t);if(!i.ok)throw new Error(`Failed to fetch SVG (${t}): ${i.statusText}`);return await i.text()}calculateBoundingBox(t,i=22){let e=1/0,n=1/0,r=-1/0,s=-1/0;return t.forEach((t=>{const i=t.getTotalLength();for(let o=0;o<=100;o++){const a=t.getPointAtLength(o/100*i);a.x<e&&(e=a.x),a.y<n&&(n=a.y),a.x>r&&(r=a.x),a.y>s&&(s=a.y)}})),e-=i,n-=i,r+=i,s+=i,{minX:e,minY:n,maxX:r,maxY:s}}insertSVG(t){const i=document.getElementById("lido-svgContainer");if(!i)return;i.innerHTML=t;const e=i.querySelector("svg");e.classList.add("lido-trace-svg"),e.removeAttribute("width"),e.removeAttribute("height");const n=e.querySelectorAll("path, line"),r=this.calculateBoundingBox(Array.from(n));e.setAttribute("viewBox",`${r.minX} ${r.minY} ${r.maxX-r.minX} ${r.maxY-r.minY}`)}getSVGElement(){return document.getElementById("lido-svgContainer").querySelector("svg")}getPaths(t){return Array.from(t.querySelectorAll("path, line"))}createFlowMarkersForPath(t){var i;if(!t)return;const e=t.ownerSVGElement;if(!e)return;const n=document.createElementNS("http://www.w3.org/2000/svg","path");n.setAttribute("d",t.getAttribute("d")||""),n.setAttribute("stroke","blue"),n.setAttribute("stroke-width","2"),n.setAttribute("stroke-dasharray","6,6"),n.setAttribute("fill","none"),n.setAttribute("class","lido-flow-indicator"),null===(i=t.parentNode)||void 0===i||i.appendChild(n);let r=e.querySelector("defs#lido-flow-defs");r||(r=document.createElementNS("http://www.w3.org/2000/svg","defs"),r.setAttribute("id","lido-flow-defs"),e.insertBefore(r,e.firstChild));const s=`arrow-${Math.random().toString(36)}`,o=document.createElementNS("http://www.w3.org/2000/svg","marker");o.setAttribute("id",s),o.setAttribute("markerWidth","10"),o.setAttribute("markerHeight","10"),o.setAttribute("refX","5"),o.setAttribute("refY","5"),o.setAttribute("orient","auto"),o.setAttribute("markerUnits","strokeWidth");const a=document.createElementNS("http://www.w3.org/2000/svg","path");return a.setAttribute("d","M0,0 L10,5 L0,10 L2,5 Z"),a.setAttribute("fill","blue"),o.appendChild(a),r.appendChild(o),n.setAttribute("marker-end",`url(#${s})`),n}updateFlowIndicators(t){t.svg.querySelectorAll(".lido-flow-indicator").forEach((i=>{t.mode===et.NoFlow?i.style.display="none":t.mode===et.ShowFlow&&(i.style.display="block")}))}setupDrawingPath(t){t.paths.forEach(((i,e)=>{const n=i.getTotalLength();i.setAttribute("id","lido-path-"+e);const r=i.cloneNode();r.style.opacity="100",r.style["stroke-opacity"]="100";const s=i.style["stroke-width"]||i.getAttribute("stroke-width");r.setAttribute("stroke-width",s),r.setAttribute("stroke-dasharray",n.toString()),r.setAttribute("stroke-dashoffset",n.toString()),i.parentNode.appendChild(r,i),i.setAttribute("class","lido-trace-path"),r.setAttribute("class","lido-trace-path-green"),i.greenPath=r,i.classList.add(t.mode),t.mode===et.BlindTracing||t.mode===et.BlindFreeTrace?i.setAttribute("stroke","none"):(i.setAttribute("stroke","#000"),i.setAttribute("stroke-width",s),i.setAttribute("fill","none"),i.setAttribute("stroke-dasharray",n.toString()),i.setAttribute("stroke-dashoffset","0")),e===t.currentPathIndex&&t.mode===et.ShowFlow&&(t.flowMarkers=this.createFlowMarkersForPath(i))})),t.totalPathLength=t.paths[t.currentPathIndex].getTotalLength()}setupDraggableCircle(t){var i;const e=t.paths[0].getPointAtLength(0),n=document.createElementNS("http://www.w3.org/2000/svg","circle");t.paths[t.currentPathIndex].style["stroke-width"]||t.paths[t.currentPathIndex].getAttribute("stroke-width"),n.setAttribute("id","lido-draggableCircle"),n.setAttribute("cx",e.x.toString()),n.setAttribute("cy",e.y.toString()),n.setAttribute("r","20"),n.setAttribute("fill","#CF1565"),null===(i=t.svg)||void 0===i||i.appendChild(n),t.circle=n,this.resetIdleTimer(t)}addEventListeners(t){var i,e,n,r;if(!t.circle||!t.paths||0===t.paths.length)return;t.svg.style.touchAction="none",t.circle.style.touchAction="none",t.circle.addEventListener("pointerdown",(i=>{i.preventDefault();const e=this.getPointerPosition(i,t.svg),n={x:parseFloat(t.circle.getAttribute("cx")),y:parseFloat(t.circle.getAttribute("cy"))},r=this.getDistanceSquared(e,n),s=this.getProximityThresholdForEvent(t,i);if(r<=s*s||"touch"===i.pointerType){t.isDragging=!0,t.activePointerId=i.pointerId,t.dragOffset={x:e.x-n.x,y:e.y-n.y};try{t.circle.setPointerCapture(i.pointerId)}catch(t){}t.lastPointerPos=n}this.hideFingerHint(),this.resetIdleTimer(t)}),{passive:!1}),null===(i=t.svg)||void 0===i||i.addEventListener("pointermove",(i=>{t.isDragging&&i.pointerId===t.activePointerId&&(i.preventDefault(),t.pointerMoveEvent=i,t.rafId||(t.rafId=requestAnimationFrame((()=>{this.handlePointerMove(t),t.rafId=null}))))}));const s=i=>{i.pointerId===t.activePointerId&&(t.isDragging=!1,t.activePointerId=null,t.lastPointerPos=null,t.dragOffset=null,this.hideFingerHint(),this.resetIdleTimer(t))};null===(e=t.svg)||void 0===e||e.addEventListener("pointerup",s),null===(n=t.svg)||void 0===n||n.addEventListener("pointercancel",s),null===(r=t.svg)||void 0===r||r.addEventListener("contextmenu",(t=>{t.preventDefault()}))}async handlePointerMove(t){var i,e,n,r,s,o;if(!t.isDragging)return;if(!t.circle||!t.paths||0===t.paths.length)return;if(t.isCompletingPath)return;this.hideFingerHint();const a=t.pointerMoveEvent,h=this.getPointerPosition(a,t.svg),u=t.dragOffset?{x:h.x-t.dragOffset.x,y:h.y-t.dragOffset.y}:h,c={x:parseFloat(t.circle.getAttribute("cx")),y:parseFloat(t.circle.getAttribute("cy"))};let l=1/0;if(t.lastPointerPos){const i=u.x-t.lastPointerPos.x,e=u.y-t.lastPointerPos.y;if(l=i*i+e*e,l<1)return}const d=t.paths[t.currentPathIndex];if(!d)return void console.error("No valid path found at the current index");const f=this.getProximityThresholdForEvent(t,a),p=f*f;if(this.getDistanceSquared(u,c)>p)return;const g=t.mode===et.FreeTrace||t.mode===et.BlindFreeTrace,m=this.getClosestPointOnPath(d,u,g?void 0:t.lastLength);if(this.getDistanceSquared(u,m)>p)return;if(g){if(this.freeTraceUpdateCounter=(this.freeTraceUpdateCounter||0)+1,this.freeTraceUpdateCounter%2!=0)return;if(t.currentFreePath||(t.currentFreePath=[]),!t.currentFreePath[t.currentPathIndex]){const e=document.createElementNS("http://www.w3.org/2000/svg","polyline"),n=t.paths[t.currentPathIndex].style["stroke-width"]||t.paths[t.currentPathIndex].getAttribute("stroke-width");e.setAttribute("stroke-width",n),e.setAttribute("fill","none"),e.setAttribute("stroke-linecap","round"),e.setAttribute("stroke","lightgreen"),e.setAttribute("points",`${u.x},${u.y}`),null===(i=t.svg)||void 0===i||i.appendChild(e),t.currentFreePath[t.currentPathIndex]=e,t.currentFreePolylinePoints=t.currentFreePolylinePoints||[],t.currentFreePolylinePoints[t.currentPathIndex]=[{x:u.x,y:u.y}],t.lastPointerPos=u,t.freeTracePointsCount=1}const r=10;if(t.freeTracePointsCount=(t.freeTracePointsCount||1)+1,t.freeTracePointsCount>r)return;t.currentFreePolylinePoints=t.currentFreePolylinePoints||[];let s=t.currentFreePolylinePoints[t.currentPathIndex]||[];s.push({x:u.x,y:u.y}),t.currentFreePolylinePoints[t.currentPathIndex]=s;const o=s.map((t=>`${t.x},${t.y}`)).join(" ");t.currentFreePath[t.currentPathIndex].setAttribute("points",o),t.circle.setAttribute("cx",u.x.toString()),t.circle.setAttribute("cy",u.y.toString());const a=null===(e=t.svg)||void 0===e?void 0:e.childNodes;let h=!1;for(let t=0;t<((null==a?void 0:a.length)||0);t++){const i=null==a?void 0:a.item(t);if(i&&"circle"===i.tagName){h=!0;break}}return!h&&t.circle&&(null===(n=t.svg)||void 0===n||n.appendChild(t.circle)),t.lastPointerPos=u,void(s.length>=r&&(this.moveToNextPath(t),t.currentFreePath[t.currentPathIndex]=null,t.currentFreePolylinePoints[t.currentPathIndex]=[],t.freeTracePointsCount=0))}const b=Math.min(320,Math.max(160,.45*t.totalPathLength)),v=Math.min(60,Math.max(24,.12*t.totalPathLength));let w=m,y=w.length>=t.lastLength-20&&w.length-t.lastLength<=80;if(!y){const i=this.getClosestPointOnPath(d,u),e=this.getDistanceSquared(u,i);l>=64&&e<=p&&i.length>=t.lastLength-20&&i.length-t.lastLength<=b&&i.length<t.totalPathLength-v&&(w=i,y=!0)}if(t.isDragging&&y){t.lastLength=Math.max(t.lastLength,w.length),t.lastPointerPos=u,(Math.abs(w.x-c.x)>1||Math.abs(w.y-c.y)>1)&&(t.circle.setAttribute("cx",w.x.toString()),t.circle.setAttribute("cy",w.y.toString()));const i=null===(r=t.svg)||void 0===r?void 0:r.childNodes;let e=!1;for(let t=0;t<((null==i?void 0:i.length)||0);t++){const n=null==i?void 0:i.item(t);if(n&&"circle"===n.tagName){e=!0;break}}!e&&t.circle&&(null===(s=t.svg)||void 0===s||s.appendChild(t.circle)),null===(o=d.greenPath)||void 0===o||o.setAttribute("stroke-dashoffset",(t.totalPathLength-t.lastLength).toString());const n=.95;let a=t.lastLength/t.totalPathLength,h=d.getPointAtLength(0),l=d.getPointAtLength(d.getTotalLength());if(this.getDistanceSquared(h,l)<200&&t.totalPathLength>50){if(a>=n){if(t.isCompletingPath)return;t.isCompletingPath=!0,await this.animatePathToEnd(t,d),t.currentPathIndex<t.paths.length-1?this.moveToNextPath(t):t.currentPathIndex===t.paths.length-1&&this.moveToNextContainer()}}else if(t.totalPathLength-1-t.lastLength<5&&t.currentPathIndex<t.paths.length-1){if(t.isCompletingPath)return;t.isCompletingPath=!0,this.moveToNextPath(t)}else if(t.totalPathLength-1-t.lastLength<5&&t.currentPathIndex===t.paths.length-1){if(t.isCompletingPath)return;t.isCompletingPath=!0,this.moveToNextContainer()}}}animatePathToEnd(t,i,e=300){if(!i||!t.svg)return Promise.resolve();if(t._animatingToEnd)return Promise.resolve();t._animatingToEnd=!0;const n=t.lastLength||0,r=i.getTotalLength(),s=performance.now(),o=i.greenPath||i.parentNode&&i.parentNode.querySelector(".lido-trace-path-green");return new Promise((a=>{const h=u=>{const c=Math.min(1,(u-s)/e),l=n+(r-n)*c;t.lastLength=l;const d=i.getPointAtLength(l);if(t.circle&&(t.circle.setAttribute("cx",d.x.toString()),t.circle.setAttribute("cy",d.y.toString())),o&&o.setAttribute("stroke-dashoffset",(t.totalPathLength-l).toString()),c<1)requestAnimationFrame(h);else{if(t.lastLength=r,t.circle){const e=i.getPointAtLength(r);t.circle.setAttribute("cx",e.x.toString()),t.circle.setAttribute("cy",e.y.toString())}o&&o.setAttribute("stroke-dashoffset","0"),t._animatingToEnd=!1,a()}};requestAnimationFrame(h)}))}async moveToNextContainer(){if(this.isDragging=!1,this.moving)return;if(this.moving=!0,this.highlightTextId&&this.highlightLetter(this.currentSvgIndex),this.animationTrace&&await this.playTraceAnimation(),f(!0),this.currentSvgIndex<this.svgUrls.length-1)return await new Promise((t=>setTimeout(t,1e3))),this.currentSvgIndex++,await this.initializeSVG(),document.getElementById("lido-svgContainer").style.visibility="visible",this.moving=!1,void(this.el&&this.onCorrect&&await g(this.onCorrect,this.el));const t=document.querySelector(U),i=t.getAttribute("onCorrect");t&&i&&(await new Promise((t=>setTimeout(t,1e3))),await g(i,this.el)),m(),b()}getPointerPosition(t,i){var e;const n=this.getPointerPositionFromViewBox(t,i);if(n)return n;const r=i.createSVGPoint();r.x=t.clientX,r.y=t.clientY;const s=null===(e=i.getScreenCTM())||void 0===e?void 0:e.inverse();return s?r.matrixTransform(s):{x:t.clientX,y:t.clientY}}getPointerPositionFromViewBox(t,i){const e=i.getBoundingClientRect(),n=i.viewBox.baseVal;if(!(e.width&&e.height&&n.width&&n.height))return null;const{offsetX:r,offsetY:s,scaleX:o,scaleY:a}=this.getSvgViewBoxTransform(i,e);return{x:n.x+(t.clientX-e.left-r)/o,y:n.y+(t.clientY-e.top-s)/a}}getSvgViewBoxTransform(t,i=t.getBoundingClientRect()){const e=t.viewBox.baseVal,n=t.preserveAspectRatio.baseVal,r=i.width/e.width,s=i.height/e.height;if(1===n.align)return{offsetX:0,offsetY:0,scaleX:r,scaleY:s};const o=2===n.meetOrSlice?Math.max(r,s):Math.min(r,s),a=e.width*o,h=e.height*o;let u=0,c=0;const l=n.align;return 3===l||6===l||9===l?u=(i.width-a)/2:4!==l&&7!==l&&10!==l||(u=i.width-a),5===l||6===l||7===l?c=(i.height-h)/2:8!==l&&9!==l&&10!==l||(c=i.height-h),{offsetX:u,offsetY:c,scaleX:o,scaleY:o}}getProximityThresholdForEvent(t,i){const e=t.mode===et.FreeTrace||t.mode===et.BlindFreeTrace?t.freeTraceProximityThreshold:t.proximityThreshold;if("touch"!==(null==i?void 0:i.pointerType)||!t.svg)return e;const n=t.svg.getBoundingClientRect(),r=t.svg.viewBox.baseVal;if(!(n.width&&n.height&&r.width&&r.height))return e;const{scaleX:s,scaleY:o}=this.getSvgViewBoxTransform(t.svg,n),a=44*Math.max(1/s,1/o);return Math.max(e,a)}getDistanceSquared(t,i){const e=t.x-i.x,n=t.y-i.y;return e*e+n*n}getClosestPointOnPath(t,i,e){const n=t.getTotalLength();let r={x:0,y:0,length:0},s=1/0,o=0,a=n;void 0!==e&&(o=Math.max(0,e-150),a=Math.min(n,e+150));let h={length:o};for(let e=o;e<=a;e+=40){const n=t.getPointAtLength(e),r=this.getDistanceSquared(i,n);r<s&&(s=r,h={x:n.x,y:n.y,length:e})}const u=Math.max(0,h.length-40),c=Math.min(n,h.length+40);s=1/0;for(let e=u;e<=c;e+=6){const n=t.getPointAtLength(e),o=this.getDistanceSquared(i,n);o<s&&(s=o,r={x:n.x,y:n.y,length:e})}return r}async loadAnotherSVG(t,i){t.isDragging=!1;try{t.svg&&this.cleanupPreviousSVG(t);const i=await this.fetchSVG(u(this.svgSource.split(";").map((t=>t.trim()))[this.currentSvgIndex]));this.insertSVG(i),t.svg=this.getSVGElement(),this.mode!==et.BlindTracing&&this.mode!==et.BlindFreeTrace||t.svg.querySelectorAll("image").forEach((t=>{t.style.display="none"})),t.paths=this.getPaths(t.svg),this.setupDrawingPath(t),this.setupDraggableCircle(t),this.addEventListeners(t)}catch(t){console.error(`Error loading SVG (${this.svgSource}):`,t)}}cleanupPreviousSVG(t){var i,e;t.circle&&(null===(i=t.svg)||void 0===i||i.removeChild(t.circle),t.circle=null),(null===(e=t.svg)||void 0===e?void 0:e.querySelectorAll(".lido-flow-indicator")).forEach((t=>{t.remove()})),t.currentPathIndex=0,t.lastLength=0,t.totalPathLength=t.paths[0].getTotalLength(),this.hideFingerHint(),this.resetIdleTimer(t)}async moveToNextPath(t){var i,e;if(t.isDragging=!1,t.currentPathIndex++,t.lastLength=0,t.isCompletingPath=!1,this.hideFingerHint(),t.currentPathIndex>=t.paths.length)return void this.moveToNextContainer();const n=t.paths[t.currentPathIndex];if(!n)return void console.error("No valid path found at the next index");t.totalPathLength=n.getTotalLength();const r=n.getPointAtLength(0);null===(i=t.circle)||void 0===i||i.setAttribute("cx",r.x.toString()),null===(e=t.circle)||void 0===e||e.setAttribute("cy",r.y.toString()),t.mode===et.ShowFlow&&(t.flowMarkers=this.createFlowMarkersForPath(n)),this.resetIdleTimer(t)}async playTraceAnimation(){const t=document.getElementById(this.id);t&&(t.classList.add("trace-animate"),await new Promise((t=>setTimeout(t,500))),t.classList.remove("trace-animate"))}async highlightLetter(t){if(!document.getElementById(U))return;const i=this.el;if(!i)return;const e=this.highlightTextId;if(!e)return;const n=document.getElementById(e);if(!n)return;const r=this.audio;if(!r)return;this.audioUrls=r.split(";").map((t=>t.trim()));const s=n.getAttribute("span-type");if(!s)return;const o=n.querySelector(".lido-text-content");if(o){if("letters"===s){const e=o.querySelectorAll(".text-letters");if(t<0||t>=e.length)return;const r=e[t];if(r){const t=i.querySelector("#lido-svgContainer");if(await g("this.alignMatch='true';",n,t),t.style.animation="trace-animation 0.4s forwards",t.style.setProperty("--trace-width",r.offsetWidth-5+"px"),t.style.setProperty("--trace-height",r.offsetHeight-5+"px"),await g("this.alignMatch='true';",r,t),setTimeout((()=>{r.classList.add("letter-highlight"),t.style.transform="",t.style.animation="",t.style.visibility="hidden"}),500),this.audioUrls[this.currentSvgIndex]){const t=new Audio(u(this.audioUrls[this.currentSvgIndex]));await t.play()}}}if("words"===s){const i=o.querySelectorAll(".text-words");if(t<0||t>=i.length)return;const e=i[t];if(e&&(e.classList.add("word-highlight"),this.audioUrls[this.currentSvgIndex])){const t=new Audio(u(this.audioUrls[this.currentSvgIndex]));await t.play()}}}}updateStyles(){const t=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:c(this.height,t),width:c(this.width,t),top:c(this.y,t),left:c(this.x,t),zIndex:this.z}}render(){return i(e,{key:"31f7f62d73ed98ce0a3b224435e7b64574cf506c",class:"lido-trace",id:this.id,audio:this.audio,onCorrect:this.onCorrect,onInCorrect:this.onInCorrect,style:this.style,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,tabindex:this.tabIndex,"disable-speak":this.disableSpeak},i("div",{key:"6cf11b7d5f9aeb3c58cbb462e63d3f340384a403",style:this.style,id:"lido-svgContainer"}))}static get assetsDirs(){return["svg","images"]}get el(){return n(this)}static get watchers(){return{svgSource:[{initializeSVG:0}],mode:[{initializeSVG:0}]}}};en.style=":host{display:block;position:relative}#lido-svgContainer{display:flex;justify-content:center;align-items:center;overflow:hidden}.lido-trace-svg{width:100%;height:100%;touch-action:none}#lido-draggableCircle{cursor:pointer;fill:#CF1565;transition:fill 0.2s, r 0.2s}.lido-blindTracing{stroke:none !important}.lido-blindFreeTrace{stroke:none !important}.lido-hovered{cursor:grab;fill:darkred}#lido-controls{position:fixed;bottom:0;left:0;right:0;display:flex;justify-content:space-between;padding:10px;background-color:#f0f0f0;border-top:1px solid #ccc}button{padding:10px;font-size:16px}@media (max-width: 600px){button{padding:8px;font-size:14px}}.lido-trace-path-green{}.lido-flow-indicator{stroke:blue;stroke-width:2;stroke-dasharray:6, 6;fill:none}.lido-trace{height:700px;width:700px;z-index:1;justify-items:center;align-content:center}.trace-animate{animation:trace-bounce 0.5s}@keyframes trace-bounce{0%{transform:scale(1)}30%{transform:scale(1.05)}60%{transform:scale(0.95)}100%{transform:scale(1)}}";const nn=class{constructor(i){t(this,i),this.showSpeakIcon=!1,this.minDrops=1,this.maxDrops=1,this.margin="",this.disableSpeak=!1,this.handleWindowResize=()=>this.updateStyles(),this.handleWindowLoad=()=>this.updateStyles()}componentDidLoad(){h(this.el,this.type),w(this.el,this.minLength,this.maxLength,this.childElementsLength),"true"===this.flex&&(this.el.classList.remove("lido-wrap"),this.el.classList.add("lido-flex")),this.showSpeakIcon&&y(this.el)}componentWillLoad(){this.updateStyles(),window.addEventListener("resize",this.handleWindowResize),window.addEventListener("load",this.handleWindowLoad)}disconnectedCallback(){window.removeEventListener("resize",this.handleWindowResize),window.removeEventListener("load",this.handleWindowLoad)}updateStyles(){const t=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:c(this.height,t),width:c(this.width,t),backgroundColor:c(this.bgColor,t),top:c(this.y,t),left:c(this.x,t),zIndex:this.z,display:JSON.parse(c(`${this.visible}`,t))?"true"===this.flex?"flex":"grid":"none",margin:c(this.margin,t)}}render(){return i(e,{key:"58b1e37a1787349d3ccd2bc6952d94a7d945e234",class:"lido-wrap",value:this.value,type:this.type,"tab-index":this.tabIndex,style:this.style,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,audio:this.audio,minDrops:this.minDrops,maxDrops:this.maxDrops,onTouch:this.onTouch,onCorrect:this.onCorrect,onInCorrect:this.onInCorrect,onEntry:this.onEntry,disableSpeak:this.disableSpeak},i("slot",{key:"44389fcc3d2e86faf291b74bfe50b55d467a7278"}))}get el(){return n(this)}};nn.style=".lido-wrap{display:grid;grid-gap:10px;grid-template-columns:repeat(auto-fill, minmax(186px, auto))}.lido-wrap>*{padding:10px;background-color:var(--child-bg-color, #f0f0f0);box-sizing:border-box}.lido-flex{display:flex;flex-wrap:wrap;align-content:flex-start;gap:10px}";export{ut as lido_avatar,ct as lido_balance,lt as lido_calculator,dt as lido_canvas,ft as lido_cell,pt as lido_col,Mi as lido_container,Ei as lido_flash_card,Oi as lido_float,zi as lido_home,qe as lido_image,Xe as lido_keyboard,Ve as lido_math_matrix,Ge as lido_pos,Ye as lido_random,Ze as lido_root,Ke as lido_row,Je as lido_shape,Qe as lido_slide_fill,tn as lido_text,en as lido_trace,nn as lido_wrap}
12
+ */const Pi=new P,zi=class{constructor(i){t(this,i),this.commonAudioPath="",this.showNav=!0,this.activeContainerIndexes=[],this.Lang="en",this.xmlData="",this.initialIndex=0,this.canplay=!0,this.baseUrl="",this.height="",this.uuid=I(),this.zipUrl="",this.currentContainerIndex=this.initialIndex,this.resizeTrigger=0,this.exitFlag=!1,this.containers=[],this.templateData=[],this.placeholderRegex=/\{([a-zA-Z0-9_]+)\}/g,this.extractedAssets={},this.handleNextContainerEvent=()=>{this.NextContainerKey()},this.handlePrevContainerEvent=()=>{this.PrevContainerKey()},this.handleChangeContainerEvent=t=>{this.NextContainerKey(t.detail.index)},this.handleBeforeUnload=()=>{p.getI().stop(),localStorage.removeItem(_)},this.handleWindowResize=()=>{this.scaleNavbarContainer(),this.resizeTrigger++,this.containers=[...this.containers]},this.NextContainerKey=t=>{var i;this.uuid===(null===(i=document.querySelector("lido-home"))||void 0===i?void 0:i.getAttribute("uuid"))&&(null!=t&&t==this.currentContainerIndex||(null!=t&&t<this.containers.length?(this.currentContainerIndex=t,T(this.currentContainerIndex)):this.currentContainerIndex<this.containers.length-1?(this.currentContainerIndex++,T(this.currentContainerIndex)):this.currentContainerIndex>=this.containers.length-1&&(localStorage.removeItem(_),this.currentContainerIndex=null),this.containers=[...this.containers],this.updateArrowVisibility()))},this.PrevContainerKey=()=>{this.currentContainerIndex<=0||(this.currentContainerIndex--,T(this.currentContainerIndex),this.containers=[...this.containers],this.updateArrowVisibility())},this.showDotsandbtn=!1,this.updateArrowVisibility=()=>{this.showNav&&setTimeout((()=>{const t=this.el.querySelector("lido-container");if(!t)return;const i=t.getAttribute("show-prev-button"),e=t.getAttribute("show-next-button"),n=this.el.querySelector("#lido-arrow-right");this.el.querySelector("#lido-arrow-left").style.visibility="true"!==i?"hidden":"visible",n.style.visibility="true"!==e?"hidden":"visible"}),100)},this.btnpopupRunId=0,this.activeBtnpopupRunId=null,this.shouldStopActiveBtnpopupAudio=!0,this.handleWindowTouch=t=>{null!==this.activeBtnpopupRunId&&this.cancelBtnpopupRun(this.hasAudioOnInteractionTarget(t.target))},this.handleWindowPointer=t=>{"touch"===t.pointerType&&null!==this.activeBtnpopupRunId&&this.cancelBtnpopupRun(this.hasAudioOnInteractionTarget(t.target))},this.popUpClick=t=>{const i=this.el.querySelector(".lido-alert-popup");this.exitFlag=!1,i&&("exit"===t?(p.getI().stop(),j.getI().stop(),Pi.rightMoves=0,Pi.wrongMoves=0,Pi.totalRightMovesCount=0,Pi.totalWrongMovesCount=0,localStorage.removeItem(_),i.remove(),this.currentContainerIndex=0,z()):i.remove())}}translateHomeText(t){var i;const e=null===(i=this.Lang)||void 0===i?void 0:i.trim();return e?si.getFixedT(e)(t):si.t(t)}onCommonAudioPathChange(t){this.publishCommonAudioPath(t)}async componentWillLoad(){if(this.navBarIcons={exit:this.exitButtonUrl||F,prev:this.prevButtonUrl||L,next:this.nextButtonUrl||D,speak:this.speakerButtonUrl||W},0===this.currentContainerIndex&&localStorage.removeItem(_),window.addEventListener(R,this.handleNextContainerEvent),window.addEventListener(B,this.handlePrevContainerEvent),window.addEventListener("changeContainer",this.handleChangeContainerEvent),this.zipUrl&&(this.xmlData="",await this.extractZipAndSetBase(),await this.loadXmlFromZip()),await this.loadTemplateData(),(this.xmlData||"").trim().includes("lido-container"))this.parseXMLData(this.xmlData);else{const t=await this.decompressBrotliBase64(this.xmlData);this.parseXMLData(t)}window.addEventListener("beforeunload",this.handleBeforeUnload)}async loadTemplateData(){if(!this.baseUrl&&!this.zipUrl)return;const t=[this.resolveAsset("data.json")].filter(Boolean);for(const i of t)try{const t=i.startsWith("http")||i.startsWith("blob")?i:s(i),e=await fetch(t);if(!e.ok)continue;const n=await e.json();if(Array.isArray(n)&&(this.templateData=n.filter((t=>t&&"object"==typeof t)),this.templateData.length))return}catch(t){console.warn(`[LidoHome] Failed to load template data from ${i}`,t)}}async decompressBrotliBase64(t){var i;for(t=(t||"").trim().replace(/^data:.*;base64,/,"").replace(/^['"]|['"]$/g,"").replace(/\\n/g,"").replace(/\s+/g,"").replace(/-/g,"+").replace(/_/g,"/");t.length%4;)t+="=";const e=atob(t),n=new Uint8Array(e.length);for(let t=0;t<e.length;t++)n[t]=e.charCodeAt(t);if("DecompressionStream"in window)try{const t=new window.DecompressionStream("br"),i=new Blob([n]).stream().pipeThrough(t),e=await new Response(i).arrayBuffer();return(new TextDecoder).decode(e)}catch(t){console.warn("[LidoRoot] Native Brotli unavailable, trying WASM fallback.",t)}try{const t=await import("./p-Bg5mBsd9.js").then((function(t){return t.d})),e=t.BrotliDecompressBuffer||(null===(i=t.default)||void 0===i?void 0:i.BrotliDecompressBuffer);if("function"!=typeof e)throw new Error("BrotliDecompressBuffer function not found in brotli/dec/decode");const r=e(n);return(new TextDecoder).decode(r)}catch(t){throw new Error(`Brotli decompression failed (native + fallback): ${t instanceof Error?t.message:String(t)}`)}}async extractZipAndSetBase(){this.revokeExtractedAssets();const t=this.zipUrl.replace(/\\/g,"/"),i=t.startsWith("http")||t.startsWith("blob")||t.startsWith("data")?t:s(t),e=await fetch(i);if(!e.ok)throw new Error("Unable to fetch ZIP");const n=await e.blob(),r=await Ti.loadAsync(n);for(const t of Object.keys(r.files)){const i=r.files[t];if(!i.dir){const e=await i.async("blob");this.extractedAssets[t]=URL.createObjectURL(e)}}V(this.extractedAssets)}revokeExtractedAssets(){for(const t of Object.values(this.extractedAssets))URL.revokeObjectURL(t);this.extractedAssets={},G()}async loadXmlFromZip(){const t="index.xml",i=this.resolveAsset(t);if(!i)throw console.warn("[LidoHome] ZIP extraction keys:",Object.keys(this.extractedAssets)),new Error(`Unable to find XML file '${t}' inside ZIP`);const e=await fetch(i);if(!e.ok)throw new Error(`Unable to fetch XML from ZIP: ${e.statusText}`);this.xmlData=await e.text()}resolveAsset(t){if(this.zipUrl){const i=t.replace(/^\/+/,""),e=this.extractedAssets[t]||this.extractedAssets[i];if(e)return e;const n=i.replace(/^.*\//,""),r=Object.keys(this.extractedAssets).find((t=>t===i||t===n||t.endsWith(`/${i}`)||t.endsWith(`/${n}`)));return r?this.extractedAssets[r]:void 0}return`${this.baseUrl.replace(/\/+$/,"")}/${t}`}componentDidLoad(){this.publishCommonAudioPath(this.commonAudioPath),setTimeout((()=>{this.showDotsandbtn=!0}),10),this.updateArrowVisibility(),this.scaleNavbarContainer(),this.handleIcons(),window.addEventListener("resize",this.handleWindowResize),window.addEventListener("touchstart",this.handleWindowTouch,{passive:!0}),window.addEventListener("pointerdown",this.handleWindowPointer,{passive:!0})}publishCommonAudioPath(t){if(!t)return;const i=t.replace(/\/+$/,"");window[N]=i,window.dispatchEvent(new Event("lidoCommonAudioPathReady"))}async handleIcons(){var t;const i=async(t,i,e)=>t?u(t):i?u(i):null!=e&&e,e=document.getElementById(U),n=e.getAttribute("exit-button-url"),r=e.getAttribute("prev-button-url"),s=e.getAttribute("next-button-url"),o=null!==(t=e.getAttribute("speak-button-url"))&&void 0!==t?t:e.getAttribute("speaker-button-url");this.navBarIcons={exit:`${await i(this.exitButtonUrl,n,F)}`,prev:`${await i(this.prevButtonUrl,r,L)}`,next:`${await i(this.nextButtonUrl,s,D)}`,speak:`${await i(this.speakerButtonUrl,o,W)}`}}updateBackgroundImage(){const t=document.querySelector(U),i=t.getAttribute("bg-image");document.body.style.background="none",t.style.backgroundImage=i?`url(${i})`:"none",t.style.backgroundPosition=i?"bottom":"none",setTimeout((()=>{const i=document.querySelector(".lido-dot-container");i.classList.add("nav-for-lanai"),t.append(i)}),50)}disconnectedCallback(){p.destroyI(),this.revokeExtractedAssets(),window.removeEventListener(R,this.handleNextContainerEvent),window.removeEventListener("changeContainer",this.handleChangeContainerEvent),window.removeEventListener(B,this.handlePrevContainerEvent),window.removeEventListener("beforeunload",this.handleBeforeUnload),window.removeEventListener("resize",this.handleWindowResize),window.removeEventListener("touchstart",this.handleWindowTouch),window.removeEventListener("pointerdown",this.handleWindowPointer)}parseXMLData(t){if(t){const i=(new DOMParser).parseFromString(t,"text/xml");this.parseContainers(i.documentElement)}}resolveContainerData(t){var i;return(null===(i=this.templateData)||void 0===i?void 0:i.length)?this.templateData[t]?this.templateData[t]:1===this.templateData.length?this.templateData[0]:null:null}replacePlaceholders(t,i){return i&&t?t.replace(this.placeholderRegex,((t,e)=>{const n=i[e];return null==n?`{${e}}`:String(n)})):t}applyDataToElement(t,i){return i?([t,...Array.from(t.querySelectorAll("*"))].forEach((t=>{Array.from(t.attributes).forEach((e=>{const n=e.value.replace(this.placeholderRegex,((t,e)=>{const n=i[e];return null==n?`{${e}}`:String(n)}));n!==e.value&&t.setAttribute(e.name,n)}))})),t):t}onXmlDataChange(t){this.parseXMLData(t)}parseElement(t){const e=t.nodeName.toLowerCase(),n={};Array.from(t.attributes).forEach((t=>{n[t.name]=t.value}));const r=Array.from(t.childNodes).map((t=>1===t.nodeType?this.parseElement(t):3===t.nodeType&&""!==t.textContent.trim()?t.textContent:null)).filter(Boolean);"lido-text"===e&&n.string&&(n.string=si.t(n.string)),"lido-text"===e&&n.string&&(n.string=si.t(n.string));const s={"lido-container":i("lido-container",Object.assign({key:this.resizeTrigger},n,{canplay:this.canplay},this.zipUrl?{}:{baseUrl:this.baseUrl},{height:this.height}),r),"lido-flash-card":i("lido-flash-card",Object.assign({},n),r),"lido-col":i("lido-col",Object.assign({},n),r),"lido-trace":i("lido-trace",Object.assign({},n),r),"lido-image":i("lido-image",Object.assign({},n),r),"lido-row":i("lido-row",Object.assign({},n),r),"lido-text":i("lido-text",Object.assign({},n),r),"lido-pos":i("lido-pos",Object.assign({},n),r),"lido-shape":i("lido-shape",Object.assign({},n),r),"lido-wrap":i("lido-wrap",Object.assign({},n),r),"lido-random":i("lido-random",Object.assign({},n),r),"lido-avatar":i("lido-avatar",Object.assign({},n),r),"lido-cell":i("lido-cell",Object.assign({},n),r),"lido-slide-fill":i("lido-slide-fill",Object.assign({},n),r),"lido-float":i("lido-float",Object.assign({},n),r),"lido-keyboard":i("lido-keyboard",Object.assign({},n),r),"lido-math-matrix":i("lido-math-matrix",Object.assign({},n),r),"lido-balance":i("lido-balance",Object.assign({},n),r),"lido-calculator":i("lido-calculator",Object.assign({},n),r),"lido-canvas":i("lido-canvas",Object.assign({},n),r)};return s[e]?s[e]:(console.warn(`Unknown tag: ${e}`),null)}parseContainers(t){const i=t.querySelectorAll("lido-container"),e=Array.from(i).map(((t,i)=>{if(this.activeContainerIndexes.length&&!this.activeContainerIndexes.includes(i))return;const e=this.resolveContainerData(i),n=this.applyDataToElement(t,e);return()=>this.parseElement(n)})).filter(Boolean);this.containers=e}areAllDropsFilled(){const t=Array.from(document.querySelectorAll('[type="drop"]')),i=Array.from(document.querySelectorAll('[type="drag"]')).filter((t=>t.getAttribute("drop-to")));return t.every((t=>{const e=t.id;return i.some((t=>t.getAttribute("drop-to")===e))}))}async btnpopup(t){var i,e;const n=()=>t!==this.btnpopupRunId,r=document.getElementById(U);if(n())return;if(!r||"true"===r.getAttribute("game-completed"))return;if(Y(!1),await p.getI().stop(),n())return;const s=r.querySelectorAll("*"),o=r.getAttribute(k);if(o){const t=this.el.querySelector(`#${o}`);if(t&&(await g("this.speak='true';",t),n()))return}for(const t of Array.from(s)){if(H()||n())break;const i=t.getAttribute("tab-index"),e=t;if(i&&Number(i)>0){const t=t=>{const i=t.getBoundingClientRect();return i.width>0&&i.height>0&&i.bottom>0&&i.right>0&&i.top<window.innerHeight&&i.left<window.innerWidth},i=null==e?void 0:e.getAttribute("type");if(e&&"true"!==e.getAttribute("disable-speak")&&((null==i?void 0:i.trim())&&t(e)||!i||!i.trim())&&await p.getI().play(e),H()||n()){this.shouldStopActiveBtnpopupAudio&&await p.getI().stop();break}if(await new Promise((t=>setTimeout(t,300))),n())break}}if(!n())if(this.areAllDropsFilled()){const t=r.objective,n=null!==(e=JSON.parse(null!==(i=r.getAttribute(d))&&void 0!==i?i:"[]"))&&void 0!==e?e:[];q(t,n)&&b()}else"true"===r.getAttribute("game-completed")&&b()}hasAudioOnInteractionTarget(t){const i=t;if(!i)return!1;const e=t=>{if(!(t instanceof HTMLElement))return!1;const i=t.getAttribute("audio");return!!i&&i.trim().length>0};return!!e(i)||!!e(i.closest("[audio]"))||!!e(i.querySelector("[audio]"))}async cancelBtnpopupRun(t=!0){this.btnpopupRunId++,this.shouldStopActiveBtnpopupAudio=t,Y(!0),t&&await p.getI().stop()}async handleBtnpopupClick(){await this.cancelBtnpopupRun();const t=this.btnpopupRunId;Y(!1),this.activeBtnpopupRunId=t,this.shouldStopActiveBtnpopupAudio=!0;try{await this.btnpopup(t)}finally{this.activeBtnpopupRunId===t&&(this.activeBtnpopupRunId=null),this.shouldStopActiveBtnpopupAudio=!0}}scaleNavbarContainer(){setTimeout((()=>{const t=document.querySelector(".lido-dot-container");t&&((1600===window.innerWidth&&900===window.innerHeight||900===window.innerWidth&&1600===window.innerHeight)&&document.querySelectorAll(".lido-exit-button, #main-audio").forEach((t=>{t.style.marginLeft="10px",t.style.marginRight="10px"})),t.style.top=window.innerWidth>window.innerHeight?"6%":"3.5%",t.style.transform="translate(-50%, -50%)",t.style.visibility="visible",Array.from(t.children).forEach((t=>{t.style.transform=`scale(${A()})`})),t.style.width=window.outerWidth+"px")}),500)}renderDots(){const t={pointerEvents:this.canplay?"none":""};return i("div",{id:"lido-dot-indicator",class:"lido-dot-container",style:{visibility:"hidden"}},i("div",{class:"lido-exit-button popup-button",onClick:()=>{this.exitFlag=!0,p.getI().stop()}},i("lido-image",{src:this.navBarIcons.exit,width:"stretch"})),i("div",{class:"lido-btn-dot-container"},i("div",{id:"lido-arrow-left",onClick:()=>{X()}},i("lido-image",{src:this.navBarIcons.prev,width:"stretch"})),this.containers.map(((e,n)=>i("div",{class:"parent_dots"},i("span",{class:"lido-dot "+(n<this.currentContainerIndex?"completed":n===this.currentContainerIndex?"current":""),onClick:()=>this.jumpToContainer(n),style:t})))),i("div",{id:"lido-arrow-right",onClick:t=>{g("this.nextBtn='true'",t.currentTarget)}},i("lido-image",{src:this.navBarIcons.next,width:"stretch"}))),i("div",{id:"main-audio",class:"popup-button",onClick:()=>this.handleBtnpopupClick()},i("lido-image",{visible:"true",src:this.navBarIcons.speak,width:"stretch"})))}jumpToContainer(t){this.NextContainerKey(t)}render(){var t,n;return this.xmlData?i(e,{class:"lido-home",uuid:this.uuid,"template-id":"",index:this.currentContainerIndex,totalIndex:this.containers.length,style:{userSelect:"none"}},i("div",{key:this.currentContainerIndex},null===(n=(t=this.containers)[this.currentContainerIndex])||void 0===n?void 0:n.call(t)),this.renderDots(),this.exitFlag&&i("div",{class:"lido-alert-parent"},i("div",{class:"lido-alert-popup"},i("lido-cell",{class:"lido-alert-content",visible:"true",layout:"col",width:"340px",height:"210px","bg-color":"#fff","border-radius":"16px",onEntry:"this.box-shadow= '0 4px 8px 0 rgba(0, 0, 0, 0.25)';"},i("lido-text",{visible:"true",string:this.translateHomeText("Do you want to exit? button"),width:"294px",height:"38px",class:"popup-exit-text","font-size":"22px",onEntry:"this.margin-bottom =' -36px';"}),i("lido-cell",{visible:"true",layout:"row",width:"294px",class:"btn-cell"},i("lido-text",{visible:"true",string:this.translateHomeText("Exit button"),width:"92px",height:"53px","font-size":"16px",margin:"0px 50px 0px 0px",class:"popup-button",onClick:()=>this.popUpClick("exit"),borderRadius:"16px",onEntry:'this.color="#F34D08"; this.font-weight="700"; this.box-shadow="0 2px 0 #F34D08";',fontFamily:"Baloo Bhai 2","font-weight":"700",bgColor:"white","border-radius":"16px"}),i("lido-text",{visible:"true",string:this.translateHomeText("Continue playing button"),width:"155px",height:"53px","font-size":"16px",class:"popup-button",onClick:()=>this.popUpClick("cancel"),borderRadius:"16px",onEntry:'this.color=white; this.font-weight="700"; this.box-shadow="0 2px 0 #F34D08";',"font-family":"Baloo Bhai 2","font-weight":"700",bgColor:"#F34D08","border-radius":"16px"})))))):i("div",null,"Please provide XML data.")}get el(){return n(this)}static get watchers(){return{commonAudioPath:[{onCommonAudioPathChange:0}],xmlData:[{onXmlDataChange:0}]}}};zi.style="@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap'); @import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@400..800&display=swap'); @import url('https://fonts.googleapis.com/css2?family=Baloo+Bhai+2:wght@400..800&display=swap'); body{overflow:hidden;background-position:center;background-size:cover;background-repeat:no-repeat;height:100vh}*{user-select:none}.lido-disable-check-button{pointer-events:none;background-color:#9393935c !important;color:white}.lido-element-selected{border:2px solid;background-color:#ffdf7d !important}.diagonal-target,.diagonal-drop *{transform:scale(0.8) !important;opacity:1 !important}.cloned-element{display:flex !important;position:absolute !important;filter:grayscale(100%);pointer-events:none}.removeShadow{box-shadow:0px 0px 0px 0px #ff8900 !important}.highlight-element{border:2px solid white;box-shadow:rgb(243, 77, 8) 0px 0px 40px !important}.drop-element.empty{border:4px dashed #f34d08 !important}.drop-element.filled{border:'none' !important}.drag-element{box-shadow:0px 15px 11px rgba(43, 0, 0, 0.3) !important}.drag-element.dropped{box-shadow:none !important}.click-element{background-color:var(--btn-bg-color, rgba(255, 172, 76, 1)) !important;box-shadow:var(--btn-shadow-px) var(--btn-shadow-color, rgba(225, 121, 76, 1)) !important;cursor:pointer;transition:box-shadow 0.1s ease-out, transform 0.2s ease-out;}.click-element:active{box-shadow:0px 0px 0px var(--btn-shadow-color, rgba(225, 121, 76, 1)) !important;transform:translateY(var(--btn-active));}.click-element:focus{outline:2px solid dodgerblue;outline-offset:3px}.after-drop-popup-container{width:200%;height:200%;background-color:rgba(0, 0, 0, 0.8);position:absolute;display:flex;flex-direction:row-reverse;align-items:center;justify-content:center !important;gap:80px}.after-drop-popup-drag-element{scale:1.5;border-radius:8px;transform:none !important;position:unset !important}.after-drop-popup-drop-element{scale:1.5;border:unset;border-radius:8px;transform:none !important;position:unset !important}@keyframes zoomFadeIn{0%{transform:scale(0.6);opacity:0}100%{transform:scale(1);opacity:1}}.zoom-fade-in{animation:zoomFadeIn 0.8s ease-out forwards}@keyframes zoomFadeOut{0%{transform:scale(1);opacity:1}100%{transform:scale(0.6);opacity:0}}.zoom-fade-out{animation:zoomFadeOut 0.8s ease-in forwards}.slide-numbers{width:70px;height:70px;border:1px solid #f57139;background-color:white;font-weight:500;color:#f57139;font-size:44px;border-radius:40px;display:flex;align-items:center;justify-content:center;font-family:'Baloo Bhai 2', serif}.slide-numbers-bottom{position:absolute;display:flex;justify-content:space-around;align-items:center;bottom:-25px;width:100%;height:50px}.slide-numbers-left{position:absolute;display:flex;flex-direction:column;justify-content:space-around;height:100%;width:50px;left:-25px;bottom:0px}.lido-speak-icon{width:56px;height:56px;position:absolute;top:-25px;right:-25px;z-index:10;background-image:url(\"https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/template/audioIcon.png\");background-color:white;border:4px solid #F34D08;border-radius:16px;box-shadow:0px 4px 0px 0px #F34D08;background-size:contain;background-repeat:no-repeat;cursor:pointer}.lido-speak-icon:active{transform:translateY(8px);box-shadow:0px 0px 0px 0px !important}.lido-strong-shake{animation:strongShake 0.3s ease}.lido-scaled-shake{animation:scaledShake 0.6s ease-in-out}.lido-horizontal-shake{animation:horizontalShake 0.6s ease-in-out;border-radius:20px}.lido-vertical-shake{animation:verticalShake 0.6s ease-in-out;border-radius:20px}.lido-diagonal-shake{animation:diagonalShake 0.5s ease-in-out;border-radius:20px;will-change:transform}.lido-glow{animation:glowPulse 1s infinite alternate;transition:opacity 0.5s ease-in-out}.lido-box-highlight{animation:topToPlace 0.3s linear}.lido-display-hiddenvalue{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;font-size:80px;font-weight:1000;color:brown;-webkit-text-stroke:2px white;font-family:'Baloo Bhai 2', sans-serif;pointer-events:none}.lido-image-colorize{position:relative;display:inline-block}.lido-image-colorize::after{content:'';position:absolute;inset:0;background:var(--tint-color);mix-blend-mode:multiply;opacity:0.8;pointer-events:none;mask-image:var(--mask-url);mask-size:cover;mask-repeat:no-repeat;mask-position:center}.lido-tts-highlight-overlay{position:fixed;left:0;top:0;pointer-events:none;z-index:9999;background:linear-gradient( 180deg, rgba(255, 235, 59, 0.95), rgba(255, 214, 0, 0.95) );border-radius:6px;box-shadow:0 2px 6px rgba(0, 0, 0, 0.18), inset 0 -1px 0 rgba(255, 255, 255, 0.25);transition:width 25ms ease-out, height 25ms ease-out, opacity 80ms ease-out;opacity:0.95;will-change:transform, width, height;contain:layout paint style}@keyframes rightToPlace{from{transform:translateX(2000px)}to{transform:translateX(0)}}@keyframes topToPlace{from{transform:translateY(-1000px)}to{transform:translateY(0)}}@keyframes bottomToPlace{from{transform:translateY(1000px)}to{transform:translateY(0)}}@keyframes placeToLeft{from{}to{transform:translateX(-2000px)}}@keyframes placeToRight{from{}to{transform:translateX(2000px)}}@keyframes leftToPlace{from{transform:translateX(-2000px)}to{transform:translateX(0)}}@keyframes shake{0%{transform:translateX(0)}10%{transform:translateX(-5px)}20%{transform:translateX(5px)}30%{transform:translateX(-5px)}40%{transform:translateX(5px)}50%{transform:translateX(-5px)}60%{transform:translateX(5px)}70%{transform:translateX(-5px)}80%{transform:translateX(5px)}90%{transform:translateX(-5px)}100%{transform:translateX(0)}}@keyframes fallAndBounce{0%{transform:translateY(-1000px)}25%{transform:translateY(0px)}50%{transform:translateY(-200px)}75%{transform:translateY(0)}90%{transform:translateY(-100px)}100%{transform:translateY(0)}}@keyframes placeToDown{0%{transform:translateY(0)}100%{transform:translateY(1000px)}}@keyframes strongShake{0%{transform:translateX(0)}20%{transform:translateX(-8px)}40%{transform:translateX(8px)}60%{transform:translateX(-6px)}80%{transform:translateX(6px)}100%{transform:translateX(0)}}@keyframes scaledShake{0%{transform:scale(1) translateX(0);box-shadow:0 0 0 transparent}20%{transform:scale(1.10) translateX(-12px);box-shadow:0 0 10px red}40%{transform:scale(1.10) translateX(12px);box-shadow:0 0 12px red}60%{transform:scale(1.10) translateX(-8px);box-shadow:0 0 10px red}80%{transform:scale(1.10) translateX(8px);box-shadow:0 0 12px red}100%{transform:scale(1) translateX(0);box-shadow:none}}@keyframes horizontalShake{0%{transform:scale(1) translateX(0);background-color:transparent}20%{transform:translateX(-20px);background-color:rgba(255, 0, 0, 0.2)}40%{transform:translateX(20px);background-color:rgba(255, 0, 0, 0.4)}60%{transform:translateX(-10px);background-color:rgba(255, 0, 0, 0.3)}80%{transform:translateX(10px);background-color:rgba(255, 0, 0, 0.2)}100%{transform:translateX(0);background-color:transparent}}@keyframes verticalShake{0%{transform:translateY(0);background-color:transparent}20%{transform:translateY(-20px);background-color:rgba(255, 0, 0, 0.2)}40%{transform:translateY(0);background-color:rgba(255, 0, 0, 0.4)}60%{transform:translateY(20px);background-color:rgba(255, 0, 0, 0.2)}80%{transform:translateY(0);background-color:rgba(255, 0, 0, 0.1)}100%{transform:translateY(0);background-color:transparent}}@keyframes diagonalShake{0%{transform:translate(0, 0);background-color:transparent}25%{transform:translate(20px, -20px);background-color:rgba(255, 0, 0, 0.2)}50%{transform:translate(-20px, 20px);background-color:rgba(255, 0, 0, 0.3)}75%{transform:translate(10px, -10px);background-color:rgba(255, 0, 0, 0.2)}100%{transform:translate(0, 0);background-color:transparent}}@keyframes glowPulse{0%{filter:drop-shadow(0 0 5px yellow) drop-shadow(0 0 10px yellow) drop-shadow(0 0 20px yellow) drop-shadow(0 0 30px orange)}50%{filter:drop-shadow(0 0 10px yellow) drop-shadow(0 0 20px yellow) drop-shadow(0 0 40px yellow) drop-shadow(0 0 50px orange)}100%{filter:drop-shadow(0 0 5px yellow) drop-shadow(0 0 10px yellow) drop-shadow(0 0 20px yellow) drop-shadow(0 0 30px orange)}}@keyframes trace-animation{0%{}100%{width:var(--trace-width, 100px);height:var(--trace-height, 100px)}}.lido-snackbar{visibility:visible;min-width:250px;background-color:#333;color:#fff;text-align:center;border-radius:2px;padding:16px;position:fixed;z-index:1;bottom:30px;left:50%;transform:translateX(-50%);font-size:17px}.lido-dot-container{display:flex;justify-content:space-between;align-items:center;visibility:hidden;position:absolute;left:50%;padding:0 5px;z-index:1;width:100vw;max-width:100vw;box-sizing:border-box;height:0px}.lido-dot{height:18px;width:18px;margin:0 4px;background-color:#bbb;border-radius:50%;display:inline-block;transition:background-color 0.3s;cursor:pointer;z-index:1}.lido-btn-dot-container{flex-shrink:1;flex-grow:1;display:flex;justify-content:center;align-items:center;text-align:center;z-index:1;min-width:0;height:0px}.lido-dot.completed{background-color:grey}.lido-dot.current{background-color:green}.lido-dot:not(.completed):not(.current){background-color:#bbb}#lido-arrow-left,#lido-arrow-right{width:88px;height:88px;display:flex;align-items:center;justify-content:center;border-radius:12px;z-index:1000;box-shadow:0px 8px 0px 0px #8b310f;background-color:#f34d08;cursor:pointer;visibility:hidden;flex-shrink:0}#lido-arrow-left:active,#lido-arrow-right:active{transform:translateY(8px);box-shadow:0px 0px 0px 0px}.navbar{display:flex;justify-content:center}.lido-exit-button,#main-audio{width:80px;height:80px;z-index:1000;cursor:pointer;background-color:white;display:flex;align-items:center;justify-content:center;border:4px solid #f34d08;border-radius:16px;box-shadow:0px 8px #f34d08;flex-shrink:0;}#main-audio:active,.popup-button:active,.lido-exit-button:active{margin-bottom:-8px;box-shadow:0px 0px 0px 0px !important}.lido-alert-popup{position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0, 0, 0, 0.5);display:flex;align-items:center;justify-content:center;z-index:1000}@media (max-width: 768px){#lido-arrow-left,#lido-arrow-right{width:70px;height:70px;margin:0 8px}.lido-exit-button,#main-audio{width:65px;height:65px;margin:0 8px}.lido-dot{height:16px;width:16px;margin:0 2.5px}}@media (max-width: 480px){#lido-arrow-left,#lido-arrow-right{width:74px;height:74px;margin:0px 5px}.lido-exit-button,#main-audio{width:65px;height:65px;margin:0px 5px}.lido-dot{height:15px;width:15px;margin:0 1.5px}.lido-dot-container{padding:0 3px}}@media (max-width: 375px){#lido-arrow-left,#lido-arrow-right{width:70px;height:70px;margin:0px 3px}.lido-exit-button,#main-audio{width:70px;height:70px;margin:0px 3px}.lido-dot{height:14px;width:14px;margin:0 1px}.lido-dot-container{padding:0 2px}}@media (max-width: 320px){#lido-arrow-left,#lido-arrow-right,.lido-exit-button,#main-audio{width:70px;height:70px;margin:0px 2px}.lido-dot{height:12px;width:12px;margin:0 0.5px}.lido-dot-container{padding:0 2px}}@media (max-width: 900px) and (orientation: landscape){#lido-arrow-left,#lido-arrow-right{width:70px;height:70px;margin:0px 5px}.lido-exit-button,#main-audio{width:70px;height:70px;margin:0px 5px}.lido-dot{height:14px;width:14px;margin:0 1px}.lido-dot-container{padding:0 5px}}.popup-exit-text{white-space:nowrap;font-size:22px;font-weight:600;margin-top:-8%}.lido-alert-parent{z-index:10000 !important;position:absolute;top:0;left:0}.popup-button{width:80px;height:80px;z-index:1000;cursor:pointer;display:flex;align-items:center;justify-content:center;border:4px solid #F34D08;border-radius:16px;box-shadow:0 8px 0 #F34D08}.nav-for-lanai{position:absolute;top:0%;left:0%;max-width:none;width:100%;height:auto;visibility:visible}";var Wi,Di,Li={exports:{}},Fi={},Ri={},Bi={};function Ni(){return Wi||(Wi=1,t=Bi,Object.defineProperty(t,"__esModule",{value:!0}),t.MUST_INSTALL_PUPPETEER=t.DEFAULT_CONVERSION_ERROR_MESSAGE=t.UNEXPECTED_ERROR_MESSAGE_INTRODUCTION=t.UNEXPECTED_ERROR_MESSAGE_LINK=t.UNEXPECTED_ERROR_MESSAGE_PREFIX=void 0,t.UNEXPECTED_ERROR_MESSAGE_PREFIX="Unexpected error has occurred, please report this by using the following link: ",t.UNEXPECTED_ERROR_MESSAGE_LINK="https://github.com/OvidijusParsiunas/css-filter-converter/issues/new",t.UNEXPECTED_ERROR_MESSAGE_INTRODUCTION=t.UNEXPECTED_ERROR_MESSAGE_PREFIX+t.UNEXPECTED_ERROR_MESSAGE_LINK,t.DEFAULT_CONVERSION_ERROR_MESSAGE="Input value is invalid",t.MUST_INSTALL_PUPPETEER="To convert filter values to color in Node - you will first need to install 'puppeteer' by running: \n npm install puppeteer"),Bi;var t}function Ui(){if(Di)return Ri;Di=1,Object.defineProperty(Ri,"__esModule",{value:!0}),Ri.ErrorHandling=void 0;const t=Ni();class i{static generateErrorResult(t){return{color:null,error:{message:t}}}static generateInputErrorMessage(t,i,e){const n=[`Input ${t} color string could not be parsed.`,`String received: ${i}.`];return e&&n.splice(1,0,`Expected format: ${e}.`),n.join(" ")}static generateUnexpectedError(e){return i.generateErrorResult(`${t.UNEXPECTED_ERROR_MESSAGE_INTRODUCTION}: \n${e.message}`)}static hasError(t){return!!t.errorMessage}}return Ri.ErrorHandling=i,Ri}var Hi,qi={};function Xi(){if(Hi)return qi;Hi=1,Object.defineProperty(qi,"__esModule",{value:!0}),qi.SheenUtil=void 0;class t{static parseSheenFromOptions(t){return!t||"boolean"!=typeof t.sheen||t.sheen}}return qi.SheenUtil=t,t.SHEEN_FILTER_PREFIX="brightness(0) saturate(100%)",qi}var Vi,Gi={};function Yi(){return Vi||(Vi=1,t=Gi,Object.defineProperty(t,"__esModule",{value:!0}),t.ColorTypes=void 0,(i=t.ColorTypes||(t.ColorTypes={})).HEX="hex",i.RGB="rgb",i.HSL="hsl",i.KEYWORD="keyword",i.FILTER="filter"),Gi;var t,i}var Zi,Ki,Ji,Qi={},te={},ie={};function ee(){return Zi||(Zi=1,Object.defineProperty(ie,"__esModule",{value:!0}),ie.RgbColor=void 0,ie.RgbColor=class{constructor(t=[0,0,0],i=!1){this.roundChannels=i,this.r=this.clamp(t[0]),this.g=this.clamp(t[1]),this.b=this.clamp(t[2])}clamp(t){return t>255?t=255:t<0&&(t=0),this.roundChannels?Math.round(t):t}setRgb(t,i,e){this.r=this.clamp(t),this.g=this.clamp(i),this.b=this.clamp(e)}multiply(t){const i=this.clamp(this.r*t[0]+this.g*t[1]+this.b*t[2]),e=this.clamp(this.r*t[3]+this.g*t[4]+this.b*t[5]),n=this.clamp(this.r*t[6]+this.g*t[7]+this.b*t[8]);this.r=i,this.g=e,this.b=n}hueRotate(t=0){t=t/180*Math.PI;const i=Math.sin(t),e=Math.cos(t);this.multiply([.213+.787*e-.213*i,.715-.715*e-.715*i,.072-.072*e+.928*i,.213-.213*e+.143*i,.715+.285*e+.14*i,.072-.072*e-.283*i,.213-.213*e-.787*i,.715-.715*e+.715*i,.072+.928*e+.072*i])}sepia(t=1){this.multiply([.393+.607*(1-t),.769-.769*(1-t),.189-.189*(1-t),.349-.349*(1-t),.686+.314*(1-t),.168-.168*(1-t),.272-.272*(1-t),.534-.534*(1-t),.131+.869*(1-t)])}saturate(t=1){this.multiply([.213+.787*t,.715-.715*t,.072-.072*t,.213-.213*t,.715+.285*t,.072-.072*t,.213-.213*t,.715-.715*t,.072+.928*t])}linear(t=1,i=0){this.r=this.clamp(this.r*t+255*i),this.g=this.clamp(this.g*t+255*i),this.b=this.clamp(this.b*t+255*i)}brightness(t=1){this.linear(t)}contrast(t=1){this.linear(t,-.5*t+.5)}invert(t=1){this.r=this.clamp(255*(t+this.r/255*(1-2*t))),this.g=this.clamp(255*(t+this.g/255*(1-2*t))),this.b=this.clamp(255*(t+this.b/255*(1-2*t)))}}),ie}var ne,re,se,oe,ae,he,ue,ce,le,de,fe,pe,ge,me={},be={},ve={},we={};function ye(){return se||(se=1,t=we,Object.defineProperty(t,"__esModule",{value:!0}),t.ColorFormats=void 0,(i=t.ColorFormats||(t.ColorFormats={})).HEX="#ffffff or #fff",i.RGB="rgb([0-255], [0-255], [0-255]) or rgb([0-255], [0-255], [0-255], [0-1]) or rgb([0-100%], [0-100%], [0-100%]) or rgb([0-100%], [0-100%], [0-100%], [0-100%]) or [0-255], [0-255], [0-255] or [0-255] [0-255] [0-255]",i.HSL="hsl([0-360], [0-100], [0-100]) or hsl([0-360], [0-100%], [0-100%]) or [0-360], [0-100], [0-100] or [0-360] [0-100] [0-100]",i.FILTER="blur(), brightness(), contrast(), drop-shadow(), grayscale(), hue-rotate(), invert(), saturate(), sepia() with each parameter populated with %, px or deg where approriate e.g. contrast(101%)",i.KEYWORD="Generic color string. See the following link for all available colors: https://github.com/colorjs/color-name/blob/master/index.js"),we;var t,i}function xe(){return ae?oe:(ae=1,oe={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]})}function ke(){if(ce)return ue;ce=1;const t=xe(),i={};for(const e of Object.keys(t))i[t[e]]=e;const e={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};ue=e;for(const t of Object.keys(e)){if(!("channels"in e[t]))throw new Error("missing channels property: "+t);if(!("labels"in e[t]))throw new Error("missing channel labels property: "+t);if(e[t].labels.length!==e[t].channels)throw new Error("channel and label counts mismatch: "+t);const{channels:i,labels:n}=e[t];delete e[t].channels,delete e[t].labels,Object.defineProperty(e[t],"channels",{value:i}),Object.defineProperty(e[t],"labels",{value:n})}return e.rgb.hsl=function(t){const i=t[0]/255,e=t[1]/255,n=t[2]/255,r=Math.min(i,e,n),s=Math.max(i,e,n),o=s-r;let a,h;s===r?a=0:i===s?a=(e-n)/o:e===s?a=2+(n-i)/o:n===s&&(a=4+(i-e)/o),a=Math.min(60*a,360),a<0&&(a+=360);const u=(r+s)/2;return h=s===r?0:u<=.5?o/(s+r):o/(2-s-r),[a,100*h,100*u]},e.rgb.hsv=function(t){let i,e,n,r,s;const o=t[0]/255,a=t[1]/255,h=t[2]/255,u=Math.max(o,a,h),c=u-Math.min(o,a,h),l=function(t){return(u-t)/6/c+.5};return 0===c?(r=0,s=0):(s=c/u,i=l(o),e=l(a),n=l(h),o===u?r=n-e:a===u?r=1/3+i-n:h===u&&(r=2/3+e-i),r<0?r+=1:r>1&&(r-=1)),[360*r,100*s,100*u]},e.rgb.hwb=function(t){const i=t[0],n=t[1];let r=t[2];const s=e.rgb.hsl(t)[0],o=1/255*Math.min(i,Math.min(n,r));return r=1-1/255*Math.max(i,Math.max(n,r)),[s,100*o,100*r]},e.rgb.cmyk=function(t){const i=t[0]/255,e=t[1]/255,n=t[2]/255,r=Math.min(1-i,1-e,1-n);return[100*((1-i-r)/(1-r)||0),100*((1-e-r)/(1-r)||0),100*((1-n-r)/(1-r)||0),100*r]},e.rgb.keyword=function(e){const n=i[e];if(n)return n;let r,s=1/0;for(const i of Object.keys(t)){const n=((o=e)[0]-(a=t[i])[0])**2+(o[1]-a[1])**2+(o[2]-a[2])**2;n<s&&(s=n,r=i)}var o,a;return r},e.keyword.rgb=function(i){return t[i]},e.rgb.xyz=function(t){let i=t[0]/255,e=t[1]/255,n=t[2]/255;return i=i>.04045?((i+.055)/1.055)**2.4:i/12.92,e=e>.04045?((e+.055)/1.055)**2.4:e/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,[100*(.4124*i+.3576*e+.1805*n),100*(.2126*i+.7152*e+.0722*n),100*(.0193*i+.1192*e+.9505*n)]},e.rgb.lab=function(t){const i=e.rgb.xyz(t);let n=i[0],r=i[1],s=i[2];return n/=95.047,r/=100,s/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,s=s>.008856?s**(1/3):7.787*s+16/116,[116*r-16,500*(n-r),200*(r-s)]},e.hsl.rgb=function(t){const i=t[0]/360,e=t[1]/100,n=t[2]/100;let r,s,o;if(0===e)return o=255*n,[o,o,o];r=n<.5?n*(1+e):n+e-n*e;const a=2*n-r,h=[0,0,0];for(let t=0;t<3;t++)s=i+1/3*-(t-1),s<0&&s++,s>1&&s--,o=6*s<1?a+6*(r-a)*s:2*s<1?r:3*s<2?a+(r-a)*(2/3-s)*6:a,h[t]=255*o;return h},e.hsl.hsv=function(t){const i=t[0];let e=t[1]/100,n=t[2]/100,r=e;const s=Math.max(n,.01);return n*=2,e*=n<=1?n:2-n,r*=s<=1?s:2-s,[i,100*(0===n?2*r/(s+r):2*e/(n+e)),(n+e)/2*100]},e.hsv.rgb=function(t){const i=t[0]/60,e=t[1]/100;let n=t[2]/100;const r=Math.floor(i)%6,s=i-Math.floor(i),o=255*n*(1-e),a=255*n*(1-e*s),h=255*n*(1-e*(1-s));switch(n*=255,r){case 0:return[n,h,o];case 1:return[a,n,o];case 2:return[o,n,h];case 3:return[o,a,n];case 4:return[h,o,n];case 5:return[n,o,a]}},e.hsv.hsl=function(t){const i=t[0],e=t[1]/100,n=t[2]/100,r=Math.max(n,.01);let s,o;o=(2-e)*n;const a=(2-e)*r;return s=e*r,s/=a<=1?a:2-a,s=s||0,o/=2,[i,100*s,100*o]},e.hwb.rgb=function(t){const i=t[0]/360;let e=t[1]/100,n=t[2]/100;const r=e+n;let s;r>1&&(e/=r,n/=r);const o=Math.floor(6*i),a=1-n;s=6*i-o,1&o&&(s=1-s);const h=e+s*(a-e);let u,c,l;switch(o){default:case 6:case 0:u=a,c=h,l=e;break;case 1:u=h,c=a,l=e;break;case 2:u=e,c=a,l=h;break;case 3:u=e,c=h,l=a;break;case 4:u=h,c=e,l=a;break;case 5:u=a,c=e,l=h}return[255*u,255*c,255*l]},e.cmyk.rgb=function(t){const i=t[1]/100,e=t[2]/100,n=t[3]/100;return[255*(1-Math.min(1,t[0]/100*(1-n)+n)),255*(1-Math.min(1,i*(1-n)+n)),255*(1-Math.min(1,e*(1-n)+n))]},e.xyz.rgb=function(t){const i=t[0]/100,e=t[1]/100,n=t[2]/100;let r,s,o;return r=3.2406*i+-1.5372*e+-.4986*n,s=-.9689*i+1.8758*e+.0415*n,o=.0557*i+-.204*e+1.057*n,r=r>.0031308?1.055*r**(1/2.4)-.055:12.92*r,s=s>.0031308?1.055*s**(1/2.4)-.055:12.92*s,o=o>.0031308?1.055*o**(1/2.4)-.055:12.92*o,r=Math.min(Math.max(0,r),1),s=Math.min(Math.max(0,s),1),o=Math.min(Math.max(0,o),1),[255*r,255*s,255*o]},e.xyz.lab=function(t){let i=t[0],e=t[1],n=t[2];return i/=95.047,e/=100,n/=108.883,i=i>.008856?i**(1/3):7.787*i+16/116,e=e>.008856?e**(1/3):7.787*e+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,[116*e-16,500*(i-e),200*(e-n)]},e.lab.xyz=function(t){let i,e,n;e=(t[0]+16)/116,i=t[1]/500+e,n=e-t[2]/200;const r=e**3,s=i**3,o=n**3;return e=r>.008856?r:(e-16/116)/7.787,i=s>.008856?s:(i-16/116)/7.787,n=o>.008856?o:(n-16/116)/7.787,i*=95.047,e*=100,n*=108.883,[i,e,n]},e.lab.lch=function(t){const i=t[0],e=t[1],n=t[2];let r;return r=360*Math.atan2(n,e)/2/Math.PI,r<0&&(r+=360),[i,Math.sqrt(e*e+n*n),r]},e.lch.lab=function(t){const i=t[1],e=t[2]/360*2*Math.PI;return[t[0],i*Math.cos(e),i*Math.sin(e)]},e.rgb.ansi16=function(t,i=null){const[n,r,s]=t;let o=null===i?e.rgb.hsv(t)[2]:i;if(o=Math.round(o/50),0===o)return 30;let a=30+(Math.round(s/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return 2===o&&(a+=60),a},e.hsv.ansi16=function(t){return e.rgb.ansi16(e.hsv.rgb(t),t[2])},e.rgb.ansi256=function(t){const i=t[0],e=t[1],n=t[2];return i===e&&e===n?i<8?16:i>248?231:Math.round((i-8)/247*24)+232:16+36*Math.round(i/255*5)+6*Math.round(e/255*5)+Math.round(n/255*5)},e.ansi16.rgb=function(t){let i=t%10;if(0===i||7===i)return t>50&&(i+=3.5),i=i/10.5*255,[i,i,i];const e=.5*(1+~~(t>50));return[(1&i)*e*255,(i>>1&1)*e*255,(i>>2&1)*e*255]},e.ansi256.rgb=function(t){if(t>=232){const i=10*(t-232)+8;return[i,i,i]}let i;return t-=16,[Math.floor(t/36)/5*255,Math.floor((i=t%36)/6)/5*255,i%6/5*255]},e.rgb.hex=function(t){const i=(((255&Math.round(t[0]))<<16)+((255&Math.round(t[1]))<<8)+(255&Math.round(t[2]))).toString(16).toUpperCase();return"000000".substring(i.length)+i},e.hex.rgb=function(t){const i=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!i)return[0,0,0];let e=i[0];3===i[0].length&&(e=e.split("").map((t=>t+t)).join(""));const n=parseInt(e,16);return[n>>16&255,n>>8&255,255&n]},e.rgb.hcg=function(t){const i=t[0]/255,e=t[1]/255,n=t[2]/255,r=Math.max(Math.max(i,e),n),s=Math.min(Math.min(i,e),n),o=r-s;let a,h;return a=o<1?s/(1-o):0,h=o<=0?0:r===i?(e-n)/o%6:r===e?2+(n-i)/o:4+(i-e)/o,h/=6,h%=1,[360*h,100*o,100*a]},e.hsl.hcg=function(t){const i=t[1]/100,e=t[2]/100,n=e<.5?2*i*e:2*i*(1-e);let r=0;return n<1&&(r=(e-.5*n)/(1-n)),[t[0],100*n,100*r]},e.hsv.hcg=function(t){const i=t[2]/100,e=t[1]/100*i;let n=0;return e<1&&(n=(i-e)/(1-e)),[t[0],100*e,100*n]},e.hcg.rgb=function(t){const i=t[1]/100,e=t[2]/100;if(0===i)return[255*e,255*e,255*e];const n=[0,0,0],r=t[0]/360%1*6,s=r%1,o=1-s;let a=0;switch(Math.floor(r)){case 0:n[0]=1,n[1]=s,n[2]=0;break;case 1:n[0]=o,n[1]=1,n[2]=0;break;case 2:n[0]=0,n[1]=1,n[2]=s;break;case 3:n[0]=0,n[1]=o,n[2]=1;break;case 4:n[0]=s,n[1]=0,n[2]=1;break;default:n[0]=1,n[1]=0,n[2]=o}return a=(1-i)*e,[255*(i*n[0]+a),255*(i*n[1]+a),255*(i*n[2]+a)]},e.hcg.hsv=function(t){const i=t[1]/100,e=i+t[2]/100*(1-i);let n=0;return e>0&&(n=i/e),[t[0],100*n,100*e]},e.hcg.hsl=function(t){const i=t[1]/100,e=t[2]/100*(1-i)+.5*i;let n=0;return e>0&&e<.5?n=i/(2*e):e>=.5&&e<1&&(n=i/(2*(1-e))),[t[0],100*n,100*e]},e.hcg.hwb=function(t){const i=t[1]/100,e=i+t[2]/100*(1-i);return[t[0],100*(e-i),100*(1-e)]},e.hwb.hcg=function(t){const i=1-t[2]/100,e=i-t[1]/100;let n=0;return e<1&&(n=(i-e)/(1-e)),[t[0],100*e,100*n]},e.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},e.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},e.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},e.gray.hsl=function(t){return[0,0,t[0]]},e.gray.hsv=e.gray.hsl,e.gray.hwb=function(t){return[0,100,t[0]]},e.gray.cmyk=function(t){return[0,0,0,t[0]]},e.gray.lab=function(t){return[t[0],0,0]},e.gray.hex=function(t){const i=255&Math.round(t[0]/100*255),e=((i<<16)+(i<<8)+i).toString(16).toUpperCase();return"000000".substring(e.length)+e},e.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]},ue}function Ae(){if(de)return le;de=1;const t=ke();function i(t,i){return function(e){return i(t(e))}}function e(e,n){const r=[n[e].parent,e];let s=t[n[e].parent][e],o=n[e].parent;for(;n[o].parent;)r.unshift(n[o].parent),s=i(t[n[o].parent][o],s),o=n[o].parent;return s.conversion=r,s}return le=function(i){const n=function(i){const e=function(){const i={},e=Object.keys(t);for(let t=e.length,n=0;n<t;n++)i[e[n]]={distance:-1,parent:null};return i}(),n=[i];for(e[i].distance=0;n.length;){const i=n.pop(),r=Object.keys(t[i]);for(let t=r.length,s=0;s<t;s++){const t=r[s],o=e[t];-1===o.distance&&(o.distance=e[i].distance+1,o.parent=i,n.unshift(t))}}return e}(i),r={},s=Object.keys(n);for(let t=s.length,i=0;i<t;i++){const t=s[i];null!==n[t].parent&&(r[t]=e(t,n))}return r}}function Se(){if(pe)return fe;pe=1;const t=ke(),i=Ae(),e={};return Object.keys(t).forEach((n=>{e[n]={},Object.defineProperty(e[n],"channels",{value:t[n].channels}),Object.defineProperty(e[n],"labels",{value:t[n].labels});const r=i(n);Object.keys(r).forEach((t=>{const i=r[t];e[n][t]=function(t){const i=function(...i){const e=i[0];if(null==e)return e;e.length>1&&(i=e);const n=t(i);if("object"==typeof n)for(let t=n.length,i=0;i<t;i++)n[i]=Math.round(n[i]);return n};return"conversion"in t&&(i.conversion=t.conversion),i}(i),e[n][t].raw=function(t){const i=function(...i){const e=i[0];return null==e?e:(e.length>1&&(i=e),t(i))};return"conversion"in t&&(i.conversion=t.conversion),i}(i)}))})),fe=e}var je,Me={},Ee={},Oe={},Ce={};function $e(){if(je)return Ce;je=1,Object.defineProperty(Ce,"__esModule",{value:!0}),Ce.FilterToHexShared=void 0;const t=Ui(),i=ye(),e=Yi();return Ce.FilterToHexShared=class{static generateInputErrorMessage(n){return t.ErrorHandling.generateInputErrorMessage(e.ColorTypes.FILTER,n,i.ColorFormats.FILTER)}static addSVGElementsToDOMAndValidateFilter(t,i=1){const e=function(){const t=document.createElement("div");return t.style.height=`${i}px`,t.style.width=`${i}px`,t.style.position="absolute",t.style.top="0px",t.style.left="0px",t}(),n=function(){const e="http://www.w3.org/2000/svg",n=document.createElementNS(e,"svg");n.style.height="inherit",n.style.width="inherit",n.style.float="left",n.style.filter=t;const r=document.createElementNS(e,"rect");return r.setAttributeNS(null,"width",i.toString()),r.setAttributeNS(null,"height",i.toString()),n.appendChild(r),n}();return""===n.style.filter?{errorMessage:"error indicator",svgContainerElement:e}:(e.appendChild(n),document.body.appendChild(e),{svgContainerElement:e})}static async getColorViaImageDataURL(t){return function(t){const i=function(t){const i=t.width;return t.getContext("2d").getImageData(0,0,i,i).data}(t);return`#${`000000${function(t,i,e){if(t>255||i>255||e>255)throw new Error("Invalid color component");return(t<<16|i<<8|e).toString(16)}(i[0],i[1],i[2])}`.slice(-6)}`}(function(t){const i=document.createElement("canvas");return i.width=t.width,i.height=t.height,i.getContext("2d").drawImage(t,0,0,t.width,t.height),i}(await async function(){const i=new Image;return new Promise(((e,n)=>{i.onload=()=>e(i),i.onerror=()=>n(new Error("Failed to load the SVG image data URL")),i.src=t}))}()))}},Ce}var Ie,_e,Te={exports:{}};function Pe(){return Ie||(Ie=1,t=Te,function(){var i=function(){return{escape:function(t){return t.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1")},parseExtension:i,mimeType:function(t){var e,n;return(e="application/font-woff",n="image/jpeg",{woff:e,woff2:e,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:n,jpeg:n,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml"})[i(t).toLowerCase()]||""},dataAsUrl:function(t,i){return"data:"+i+";base64,"+t},isDataUrl:function(t){return-1!==t.search(/^(data:)/)},canvasToBlob:function(t){return t.toBlob?new Promise((function(i){t.toBlob(i)})):function(t){return new Promise((function(i){for(var e=window.atob(t.toDataURL().split(",")[1]),n=e.length,r=new Uint8Array(n),s=0;s<n;s++)r[s]=e.charCodeAt(s);i(new Blob([r],{type:"image/png"}))}))}(t)},resolveUrl:function(t,i){var e=document.implementation.createHTMLDocument(),n=e.createElement("base");e.head.appendChild(n);var r=e.createElement("a");return e.body.appendChild(r),n.href=i,r.href=t,r.href},getAndEncode:function(t){return a.impl.options.cacheBust&&(t+=(/\?/.test(t)?"&":"?")+(new Date).getTime()),new Promise((function(i){var e,n=new XMLHttpRequest;if(n.onreadystatechange=function(){if(4===n.readyState)if(200===n.status){var r=new FileReader;r.onloadend=function(){var t=r.result.split(/,/)[1];i(t)},r.readAsDataURL(n.response)}else e?i(e):s("cannot fetch resource: "+t+", status: "+n.status)},n.ontimeout=function(){e?i(e):s("timeout of 30000ms occured while fetching resource: "+t)},n.responseType="blob",n.timeout=3e4,n.open("GET",t,!0),n.send(),a.impl.options.imagePlaceholder){var r=a.impl.options.imagePlaceholder.split(/,/);r&&r[1]&&(e=r[1])}function s(t){console.error(t),i("")}}))},uid:(t=0,function(){return"u"+("0000"+(Math.random()*Math.pow(36,4)|0).toString(36)).slice(-4)+t++}),delay:function(t){return function(i){return new Promise((function(e){setTimeout((function(){e(i)}),t)}))}},asArray:function(t){for(var i=[],e=t.length,n=0;n<e;n++)i.push(t[n]);return i},escapeXhtml:function(t){return t.replace(/#/g,"%23").replace(/\n/g,"%0A")},makeImage:function(t){return new Promise((function(i,e){var n=new Image;n.onload=function(){i(n)},n.onerror=e,n.src=t}))},width:function(t){var i=e(t,"border-left-width"),n=e(t,"border-right-width");return t.scrollWidth+i+n},height:function(t){var i=e(t,"border-top-width"),n=e(t,"border-bottom-width");return t.scrollHeight+i+n}};var t;function i(t){var i=/\.([^\.\/]*?)$/g.exec(t);return i?i[1]:""}function e(t,i){var e=window.getComputedStyle(t).getPropertyValue(i);return parseFloat(e.replace("px",""))}}(),e=function(){var t=/url\(['"]?([^'"]+?)['"]?\)/g;return{inlineAll:function(t,i,s){return e(t)?Promise.resolve(t).then(n).then((function(e){var n=Promise.resolve(t);return e.forEach((function(t){n=n.then((function(e){return r(e,t,i,s)}))})),n})):Promise.resolve(t)},shouldProcess:e,impl:{readUrls:n,inline:r}};function e(i){return-1!==i.search(t)}function n(e){for(var n,r=[];null!==(n=t.exec(e));)r.push(n[1]);return r.filter((function(t){return!i.isDataUrl(t)}))}function r(t,e,n,r){return Promise.resolve(e).then((function(t){return n?i.resolveUrl(t,n):t})).then(r||i.getAndEncode).then((function(t){return i.dataAsUrl(t,i.mimeType(e))})).then((function(n){return t.replace(function(t){return new RegExp("(url\\(['\"]?)("+i.escape(t)+")(['\"]?\\))","g")}(e),"$1"+n+"$3")}))}}(),n=function(){return{resolveAll:function(){return t().then((function(t){return Promise.all(t.map((function(t){return t.resolve()})))})).then((function(t){return t.join("\n")}))},impl:{readAll:t}};function t(){return Promise.resolve(i.asArray(document.styleSheets)).then((function(t){var e=[];return t.forEach((function(t){try{i.asArray(t.cssRules||[]).forEach(e.push.bind(e))}catch(i){console.log("Error while reading CSS rules from "+t.href,i.toString())}})),e})).then((function(t){return t.filter((function(t){return t.type===CSSRule.FONT_FACE_RULE})).filter((function(t){return e.shouldProcess(t.style.getPropertyValue("src"))}))})).then((function(i){return i.map(t)}));function t(t){return{resolve:function(){return e.inlineAll(t.cssText,(t.parentStyleSheet||{}).href)},src:function(){return t.style.getPropertyValue("src")}}}}}(),r=function(){return{inlineAll:function n(r){return r instanceof Element?function(t){var i=t.style.getPropertyValue("background");return i?e.inlineAll(i).then((function(i){t.style.setProperty("background",i,t.style.getPropertyPriority("background"))})).then((function(){return t})):Promise.resolve(t)}(r).then((function(){return r instanceof HTMLImageElement?t(r).inline():Promise.all(i.asArray(r.childNodes).map((function(t){return n(t)})))})):Promise.resolve(r)},impl:{newImage:t}};function t(t){return{inline:function(e){return i.isDataUrl(t.src)?Promise.resolve():Promise.resolve(t.src).then(e||i.getAndEncode).then((function(e){return i.dataAsUrl(e,i.mimeType(t.src))})).then((function(i){return new Promise((function(e,n){t.onload=e,t.onerror=n,t.src=i}))}))}}}}(),s=void 0,o=!1,a={toSvg:h,toPng:function(t,i){return u(t,i||{}).then((function(t){return t.toDataURL()}))},toJpeg:function(t,i){return u(t,i=i||{}).then((function(t){return t.toDataURL("image/jpeg",i.quality||1)}))},toBlob:function(t,e){return u(t,e||{}).then(i.canvasToBlob)},toPixelData:function(t,e){return u(t,e||{}).then((function(e){return e.getContext("2d").getImageData(0,0,i.width(t),i.height(t)).data}))},impl:{fontFaces:n,images:r,util:i,inliner:e,options:{}}};function h(t,e){return function(t){a.impl.options.imagePlaceholder=void 0===t.imagePlaceholder?s:t.imagePlaceholder,a.impl.options.cacheBust=void 0===t.cacheBust?o:t.cacheBust}(e=e||{}),Promise.resolve(t).then((function(t){return c(t,e.filter,!0)})).then(l).then(d).then((function(t){return e.bgcolor&&(t.style.backgroundColor=e.bgcolor),e.width&&(t.style.width=e.width+"px"),e.height&&(t.style.height=e.height+"px"),e.style&&Object.keys(e.style).forEach((function(i){t.style[i]=e.style[i]})),t})).then((function(n){return function(t,e,n){return Promise.resolve(t).then((function(t){return t.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),(new XMLSerializer).serializeToString(t)})).then(i.escapeXhtml).then((function(t){return'<foreignObject x="0" y="0" width="100%" height="100%">'+t+"</foreignObject>"})).then((function(t){return'<svg xmlns="http://www.w3.org/2000/svg" width="'+e+'" height="'+n+'">'+t+"</svg>"})).then((function(t){return"data:image/svg+xml;charset=utf-8,"+t}))}(n,e.width||i.width(t),e.height||i.height(t))}))}function u(t,e){return h(t,e).then(i.makeImage).then(i.delay(100)).then((function(n){var r=function(t){var n=document.createElement("canvas");if(n.width=e.width||i.width(t),n.height=e.height||i.height(t),e.bgcolor){var r=n.getContext("2d");r.fillStyle=e.bgcolor,r.fillRect(0,0,n.width,n.height)}return n}(t);return r.getContext("2d").drawImage(n,0,0),r}))}function c(t,e,n){return n||!e||e(t)?Promise.resolve(t).then((function(t){return t instanceof HTMLCanvasElement?i.makeImage(t.toDataURL()):t.cloneNode(!1)})).then((function(n){return function(t,e,n){var r=t.childNodes;return 0===r.length?Promise.resolve(e):function(t,i,e){var n=Promise.resolve();return i.forEach((function(i){n=n.then((function(){return c(i,e)})).then((function(i){i&&t.appendChild(i)}))})),n}(e,i.asArray(r),n).then((function(){return e}))}(t,n,e)})).then((function(e){return function(t,e){return e instanceof Element?Promise.resolve().then((function(){n=window.getComputedStyle(t),r=e.style,n.cssText?r.cssText=n.cssText:function(t,e){i.asArray(t).forEach((function(i){e.setProperty(i,t.getPropertyValue(i),t.getPropertyPriority(i))}))}(n,r);var n,r})).then((function(){[":before",":after"].forEach((function(n){!function(n){var r=window.getComputedStyle(t,n),s=r.getPropertyValue("content");if(""!==s&&"none"!==s){var o=i.uid();e.className=e.className+" "+o;var a=document.createElement("style");a.appendChild(function(t,e,n){var r="."+t+":"+e,s=n.cssText?o(n):a(n);return document.createTextNode(r+"{"+s+"}");function o(t){var i=t.getPropertyValue("content");return t.cssText+" content: "+i+";"}function a(t){return i.asArray(t).map(e).join("; ")+";";function e(i){return i+": "+t.getPropertyValue(i)+(t.getPropertyPriority(i)?" !important":"")}}}(o,n,r)),e.appendChild(a)}}(n)}))})).then((function(){t instanceof HTMLTextAreaElement&&(e.innerHTML=t.value),t instanceof HTMLInputElement&&e.setAttribute("value",t.value)})).then((function(){e instanceof SVGElement&&(e.setAttribute("xmlns","http://www.w3.org/2000/svg"),e instanceof SVGRectElement&&["width","height"].forEach((function(t){var i=e.getAttribute(t);i&&e.style.setProperty(t,i)})))})).then((function(){return e})):e}(t,e)})):Promise.resolve()}function l(t){return n.resolveAll().then((function(i){var e=document.createElement("style");return t.appendChild(e),e.appendChild(document.createTextNode(i)),t}))}function d(t){return r.inlineAll(t).then((function(){return t}))}t.exports=a}()),Te.exports;var t}var ze,We,De={};var Le,Fe,Re,Be,Ne={},Ue={};var He=$((Be||(Be=1,function(t,i){Object.defineProperty(i,"__esModule",{value:!0});const e=function(){if(ge)return Fi;ge=1;var t=Fi&&Fi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Fi,"__esModule",{value:!0}),Fi.ColorToFilter=void 0;const i=Ui(),e=Xi(),n=Yi(),r=function(){if(Ji)return Qi;Ji=1,Object.defineProperty(Qi,"__esModule",{value:!0}),Qi.RgbToFilter=void 0;const t=Ui(),i=Ni(),e=function(){if(Ki)return te;Ki=1,Object.defineProperty(te,"__esModule",{value:!0}),te.RgbToFilterWorker=void 0;const t=Xi(),i=ee();class e{constructor(t,e){this.targetRgbColor=t,this.reusedRgbColor=new i.RgbColor,this.reusedRoundedRgbColor=new i.RgbColor([0,0,0],!0),this.addSheen=e}static fmt(t,i,e=1){return Math.round(t[i]*e)}generateCss(i){return`${this.addSheen?`${t.SheenUtil.SHEEN_FILTER_PREFIX} `:""}invert(${e.fmt(i,0)}%) sepia(${e.fmt(i,1)}%) saturate(${e.fmt(i,2)}%) hue-rotate(${e.fmt(i,3,3.6)}deg) brightness(${e.fmt(i,4)}%) contrast(${e.fmt(i,5)}%)`}applyFilters(t,i,e){return t.setRgb(0,0,0),t.invert(i[0]/100),t.sepia(i[1]/100),t.saturate(i[2]/100),t.hueRotate(e),t.brightness(i[4]/100),t.contrast(i[5]/100),Math.abs(t.r-this.targetRgbColor.r)+Math.abs(t.g-this.targetRgbColor.g)+Math.abs(t.b-this.targetRgbColor.b)}loss(t){return this.applyFilters(this.reusedRgbColor,t,3.6*t[3])}serializedLoss(t){const i=t.map(((i,n)=>e.fmt(t,n))),n=e.fmt(t,3,3.6),r=this.applyFilters(this.reusedRgbColor,i,n),s=this.applyFilters(this.reusedRoundedRgbColor,i,n);return Math.max(r,s)}static fixSpsa(t,i){let e=100;return 2===i?e=7500:4!==i&&5!==i||(e=200),3===i?t>e?t%=e:t<0&&(t=e+t%e):t<0?t=0:t>e&&(t=e),t}spsa(t,i,n,r,s){let o=[],a=1/0;const h=new Array(6),u=new Array(6),c=new Array(6);for(let l=0;l<s;l+=1){const s=n/Math.pow(l+1,.16666666666666666);for(let t=0;t<6;t+=1)h[t]=Math.random()>.5?1:-1,u[t]=r[t]+s*h[t],c[t]=r[t]-s*h[t];const d=this.loss(u)-this.loss(c);for(let n=0;n<6;n+=1){const o=d/(2*s)*h[n],a=i[n]/Math.pow(t+l+1,1);r[n]=e.fixSpsa(r[n]-a*o,n)}const f=this.serializedLoss(r);f<a&&(o=r.slice(0),a=f)}return{values:o,loss:a}}solveNarrow(t){const i=t.loss,e=i+1;return this.spsa(i,[.25*e,.25*e,e,.25*e,.2*e,.2*e],2,t.values,500)}solveWide(){const t=[60,180,18e3,600,1.2,1.2];let i={values:[],loss:1/0};for(let e=0;i.loss>25&&e<3;e+=1){const e=this.spsa(5,t,15,[50,20,3750,50,100,100],1e3);e.loss<i.loss&&(i=e)}return i}convert(){const t=this.solveNarrow(this.solveWide());return{loss:t.loss,color:this.generateCss(t.values)}}}return te.RgbToFilterWorker=e,te}(),n=ee();class r{static generateConversionError(e){return t.ErrorHandling.generateErrorResult(e||i.DEFAULT_CONVERSION_ERROR_MESSAGE)}static generateValidateAndParseError(i){return t.ErrorHandling.generateErrorResult(i)}static execute(t,i){const r=new n.RgbColor(t);return new e.RgbToFilterWorker(r,i).convert()}static convertToRGB(t,i){return t&&i?i(t):null}static convert(i){try{const{colorString:e,validateAndParse:n,convertToRgb:s,conversionErrorMessage:o,addSheen:a}=i,h=e.trim().toLocaleLowerCase(),u=(null==n?void 0:n(h))||{color:h};if(t.ErrorHandling.hasError(u))return r.generateValidateAndParseError(u.errorMessage);const c=r.convertToRGB(u.color,s)||u.color;return c?r.execute(c,a):r.generateConversionError(o)}catch(i){return t.ErrorHandling.generateUnexpectedError(i)}}}return Qi.RgbToFilter=r,Qi}(),s=function(){if(he)return me;he=1;var t=me&&me.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(me,"__esModule",{value:!0}),me.ColorParser=void 0;const i=(ne||(ne=1,Object.defineProperty(be,"__esModule",{value:!0}),be.MATCH_HEXADECIMAL=be.MATCH_INTEGER_AND_FLOAT_NUMBERS=void 0,be.MATCH_INTEGER_AND_FLOAT_NUMBERS=/(-?\d+(?:\.\d+)?)/g,be.MATCH_HEXADECIMAL=/^#[0-9a-f]{3}([0-9a-f]{3})?$/i),be),e=Ui(),n=(re||(re=1,Object.defineProperty(ve,"__esModule",{value:!0}),ve.MAX_COLOR_INPUT_STRING_LENGTH=void 0,ve.MAX_COLOR_INPUT_STRING_LENGTH=25),ve),r=ye(),s=Yi(),o=t(xe());class a{static validateAndParseHex(t){return t.length<n.MAX_COLOR_INPUT_STRING_LENGTH&&t.match(i.MATCH_HEXADECIMAL)?{color:t}:{errorMessage:e.ErrorHandling.generateInputErrorMessage(s.ColorTypes.HEX,t,r.ColorFormats.HEX)}}static parseFirstThreeIntegersFromString(t){if(t.length<n.MAX_COLOR_INPUT_STRING_LENGTH){const e=t.match(i.MATCH_INTEGER_AND_FLOAT_NUMBERS);if(i.MATCH_INTEGER_AND_FLOAT_NUMBERS.lastIndex=0,e&&e.length>=3)return e.slice(0,3).map((t=>Number.parseInt(t)))}return null}static validateAndParseRgb(t){const i=a.parseFirstThreeIntegersFromString(t);return i&&i[0]>=0&&i[0]<=255&&i[1]>=0&&i[1]<=255&&i[2]>=0&&i[2]<=255?{color:i}:{errorMessage:e.ErrorHandling.generateInputErrorMessage(s.ColorTypes.RGB,t,r.ColorFormats.RGB)}}static validateAndParseHsl(t){const i=a.parseFirstThreeIntegersFromString(t);return i&&i[0]>=0&&i[0]<=360&&i[1]>=0&&i[1]<=100&&i[2]>=0&&i[2]<=100?{color:i}:{errorMessage:e.ErrorHandling.generateInputErrorMessage(s.ColorTypes.HSL,t,r.ColorFormats.HSL)}}static validateAndParseKeyword(t){return t.length<n.MAX_COLOR_INPUT_STRING_LENGTH&&o.default[t]?{color:t}:{errorMessage:e.ErrorHandling.generateInputErrorMessage(s.ColorTypes.KEYWORD,t,r.ColorFormats.KEYWORD)}}}return me.ColorParser=a,me}(),o=t(Se());return Fi.ColorToFilter=class{static rgbToFilter(t,i){return r.RgbToFilter.convert({colorString:t,validateAndParse:s.ColorParser.validateAndParseRgb,addSheen:e.SheenUtil.parseSheenFromOptions(i)})}static hexToFilter(t,i){return r.RgbToFilter.convert({colorString:t,validateAndParse:s.ColorParser.validateAndParseHex,convertToRgb:o.default.hex.rgb,addSheen:e.SheenUtil.parseSheenFromOptions(i)})}static hslToFilter(t,i){return r.RgbToFilter.convert({colorString:t,validateAndParse:s.ColorParser.validateAndParseHsl,convertToRgb:o.default.hsl.rgb,addSheen:e.SheenUtil.parseSheenFromOptions(i)})}static keywordToFilter(t,a){return r.RgbToFilter.convert({colorString:t,validateAndParse:s.ColorParser.validateAndParseKeyword,convertToRgb:o.default.keyword.rgb,conversionErrorMessage:i.ErrorHandling.generateInputErrorMessage(n.ColorTypes.KEYWORD,t),addSheen:e.SheenUtil.parseSheenFromOptions(a)})}},Fi}(),n=function(){if(Re)return Me;Re=1,Object.defineProperty(Me,"__esModule",{value:!0}),Me.FilterToColor=void 0;const t=function(){if(We)return Ee;We=1;var t=Ee&&Ee.__createBinding||(Object.create?function(t,i,e,n){void 0===n&&(n=e);var r=Object.getOwnPropertyDescriptor(i,e);r&&!("get"in r?!i.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return i[e]}}),Object.defineProperty(t,n,r)}:function(t,i,e,n){void 0===n&&(n=e),t[n]=i[e]}),i=Ee&&Ee.__setModuleDefault||(Object.create?function(t,i){Object.defineProperty(t,"default",{enumerable:!0,value:i})}:function(t,i){t.default=i}),e=Ee&&Ee.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&t(n,e,r);return i(n,e),n};Object.defineProperty(Ee,"__esModule",{value:!0}),Ee.FilterToHex=void 0;const n=Ui(),r=function(){if(_e)return Oe;_e=1;var t=Oe&&Oe.__createBinding||(Object.create?function(t,i,e,n){void 0===n&&(n=e);var r=Object.getOwnPropertyDescriptor(i,e);r&&!("get"in r?!i.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return i[e]}}),Object.defineProperty(t,n,r)}:function(t,i,e,n){void 0===n&&(n=e),t[n]=i[e]}),i=Oe&&Oe.__setModuleDefault||(Object.create?function(t,i){Object.defineProperty(t,"default",{enumerable:!0,value:i})}:function(t,i){t.default=i}),e=Oe&&Oe.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&t(n,e,r);return i(n,e),n};Object.defineProperty(Oe,"__esModule",{value:!0}),Oe.FilterToHexBrowser=void 0;const n=Ui(),r=$e();class s extends r.FilterToHexShared{static cleanup(t){t.remove()}static returnInputError(t,i){const e=r.FilterToHexShared.generateInputErrorMessage(t),o=n.ErrorHandling.generateErrorResult(e);return s.cleanup(i),o}static async getImageBase64ViaSVG(t){return(await Promise.resolve().then((()=>e(Pe())))).toPng(t)}static async convert(t){const{errorMessage:i,svgContainerElement:e}=r.FilterToHexShared.addSVGElementsToDOMAndValidateFilter(t);if(i)return s.returnInputError(t,e);const n=await s.getImageBase64ViaSVG(e),o=await r.FilterToHexShared.getColorViaImageDataURL(n);return s.cleanup(e),{color:o}}}return Oe.FilterToHexBrowser=s,Oe}();return Ee.FilterToHex=class{static async convert(t,i,s){try{let n;if("undefined"==typeof window){const{FilterToHexNode:i}=await Promise.resolve().then((()=>e(function(){if(ze)return De;ze=1,Object.defineProperty(De,"__esModule",{value:!0}),De.FilterToHexNode=void 0;const t=Ui(),i=Ni(),e=ye(),n=Yi(),r=$e();class s extends r.FilterToHexShared{static cleanup(t){s.IS_HEADLESS&&(null==t||t.close())}static returnError(i,e){const n=t.ErrorHandling.generateErrorResult(i);return s.cleanup(e),n}static async getImageBase64ViaSVG(t){const i=await t.screenshot({encoding:s.BASE_64_ENCODING});return`${s.ENCODED_DATA_URL_PREFIX}${i}`}static async openBrowserPage(t){const i=await t.newPage();return await i.setViewport({width:s.SVG_SIDE_LENGTH_PX,height:s.SVG_SIDE_LENGTH_PX}),i}static async addSVGAndValidateFilter(i,o){const a=await i.evaluate(r.FilterToHexShared.addSVGElementsToDOMAndValidateFilter,o,s.SVG_SIDE_LENGTH_PX);return a.errorMessage?{errorMessage:t.ErrorHandling.generateInputErrorMessage(n.ColorTypes.FILTER,o,e.ColorFormats.FILTER)}:a}static async getPuppeteerDependency(){try{return Ci("puppeteer")}catch(t){return{errorMessage:i.MUST_INSTALL_PUPPETEER}}}static async preparePuppeteerBrowser(){const i=await s.getPuppeteerDependency();return t.ErrorHandling.hasError(i)?i:i.launch({headless:s.IS_HEADLESS})}static async convert(i){const e=await s.preparePuppeteerBrowser();if(t.ErrorHandling.hasError(e))return s.returnError(e.errorMessage);const n=await s.openBrowserPage(e),o=await s.addSVGAndValidateFilter(n,i);if(t.ErrorHandling.hasError(o))return s.returnError(o.errorMessage,e);const a=await s.getImageBase64ViaSVG(n),h=await n.evaluate(r.FilterToHexShared.getColorViaImageDataURL,a);return s.cleanup(e),{color:h}}}return De.FilterToHexNode=s,s.BASE_64_ENCODING="base64",s.ENCODED_DATA_URL_PREFIX=`data:image/png;${s.BASE_64_ENCODING},`,s.IS_HEADLESS=!0,s.SVG_SIDE_LENGTH_PX=2,De}())));n=await i.convert(t)}else n=await r.FilterToHexBrowser.convert(t);return n.color&&i&&"string"==typeof n.color&&(n.color=i(n.color,s)),n}catch(t){return n.ErrorHandling.generateUnexpectedError(t)}}},Ee}(),i=function(){if(Fe)return Ne;Fe=1;var t=Ne&&Ne.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.HexToColor=void 0;const i=(Le||(Le=1,Object.defineProperty(Ue,"__esModule",{value:!0}),Ue.ColorFormatter=void 0,Ue.ColorFormatter=class{static arrayToRgbString(t){return`rgb(${t[0]}, ${t[1]}, ${t[2]})`}static arrayToHslString(t){return`hsl(${t[0]}deg, ${t[1]}%, ${t[2]}%)`}}),Ue),e=t(Se());return Ne.HexToColor=class{static convertToRgb(t,n){const r=e.default.hex.rgb(t);return"string"===(null==n?void 0:n.resultType)?i.ColorFormatter.arrayToRgbString(r):r}static convertToHsl(t,n){const r=e.default.hex.hsl(t);return"string"===(null==n?void 0:n.resultType)?i.ColorFormatter.arrayToHslString(r):r}},Ne}();return Me.FilterToColor=class{static async filterToHex(i){const e=await t.FilterToHex.convert(i);return e.color&&(e.color=e.color.toUpperCase()),e}static async filterToRgb(e,n){return t.FilterToHex.convert(e,i.HexToColor.convertToRgb,n)}static async filterToHsl(e,n){return t.FilterToHex.convert(e,i.HexToColor.convertToHsl,n)}},Me}();class r{static rgbToFilter(t,i){return e.ColorToFilter.rgbToFilter(t,i)}static hexToFilter(t,i){return e.ColorToFilter.hexToFilter(t,i)}static hslToFilter(t,i){return e.ColorToFilter.hslToFilter(t,i)}static keywordToFilter(t,i){return e.ColorToFilter.keywordToFilter(t,i)}static async filterToHex(t){return n.FilterToColor.filterToHex(t)}static async filterToRgb(t,i){return n.FilterToColor.filterToRgb(t,i)}static async filterToHsl(t,i){return n.FilterToColor.filterToHsl(t,i)}}i.default=r,t.exports=r}(Li,Li.exports)),Li.exports));const qe=class{constructor(i){t(this,i),this.showSpeakIcon=!1,this.sliceWidth="30px",this.minDrops=1,this.maxDrops=1,this.margin="",this.padding="",this.filter="",this.borderRadius="0px",this.transform="",this.handleWindowResize=()=>this.updateStyles(),this.handleWindowLoad=()=>this.updateStyles(),this.delayVisible="",this.disableSpeak=!1}componentDidLoad(){if(a(this.el,this.delayVisible),h(this.el,this.type),""!==this.filter){const t=this.el.getElementsByTagName("img")[0];t&&(t.style.filter=`${He.hexToFilter(Z(this.filter).toHexString()).color}`)}this.showSpeakIcon&&y(this.el)}componentWillLoad(){this.updateStyles(),window.addEventListener("resize",this.handleWindowResize),window.addEventListener("load",this.handleWindowLoad)}disconnectedCallback(){window.removeEventListener("resize",this.handleWindowResize),window.removeEventListener("load",this.handleWindowLoad)}updateStyles(){const t=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:c(this.height,t),width:c(this.width,t),backgroundColor:c(this.bgColor,t),top:c(this.y,t),left:c(this.x,t),zIndex:this.z,display:c(`${this.visible}`,t)?"flex":"none",alignItems:"center",justifyContent:"center",margin:c(this.margin,t),padding:c(this.padding,t),transform:c(this.transform,t),borderRadius:this.borderRadius,borderImageSource:"true"===this.isSlice?`url(${u(this.src)})`:"none",borderImageSlice:"true"===this.isSlice?`${parseInt(this.sliceWidth)} fill`:"unset",borderImageRepeat:"true"===this.isSlice?"round":"unset",borderImageWidth:"true"===this.isSlice?`${this.sliceWidth}`:"unset",backgroundImage:"true"===this.isSlice?`url(${u(this.src)})`:"none"}}render(){return"true"===this.isSlice?i(e,{class:"slice",id:this.id,type:this.type,"tab-index":this.tabIndex,style:this.style,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,value:this.value,minDrops:this.minDrops,maxDrops:this.maxDrops,audio:this.audio,onTouch:this.onTouch,onCorrect:this.onCorrect,onInCorrect:this.onInCorrect,onEntry:this.onEntry}):i(e,{id:this.id,type:this.type,"tab-index":this.tabIndex,style:this.style,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,value:this.value,minDrops:this.minDrops,maxDrops:this.maxDrops,audio:this.audio,onTouch:this.onTouch,onCorrect:this.onCorrect,onInCorrect:this.onInCorrect,onEntry:this.onEntry,"disable-speak":this.disableSpeak},i("img",{class:"lido-image",src:u(this.src),alt:"",style:this.style}))}get el(){return n(this)}};qe.style=".lido-image{user-select:none;-webkit-user-drag:none;object-fit:contain;width:100% !important;height:100% !important;aspect-ratio:1 / 1;transform:rotate(0) !important;margin:0 !important}.slice{background-repeat:no-repeat;background-position:center;background-size:100% 100%}";const Xe=class{constructor(i){t(this,i),this.keys="",this.gap="10px",this.bgColor="",this.borderRadius="",this.keyboardInput=!1,this.columns="10",this.disableSpeak=!1,this.numberOfClick=0,this.inputString="",this.style={},this.handleWindowResize=()=>this.updateStyles(),this.handleWindowLoad=()=>this.updateStyles()}async inputValidation(t){if("click"!==this.type)return;const i=document.getElementById(U);if(!t.target.getAttribute("value"))return;let e=JSON.parse(localStorage.getItem(d))||"";localStorage.setItem(d,JSON.stringify(e));const n=document.body.getBoundingClientRect(),r=Array.from(i.querySelectorAll(".bubble-element")).filter((t=>{const i=t.getBoundingClientRect();return i.left<n.right&&i.right>n.left&&i.top<n.bottom&&i.bottom>n.top})).find((t=>{const i=t.getAttribute("value");return(null==i?void 0:i.startsWith(this.inputString.toLowerCase()))?t:null}));if(r){if(this.inputString.toLowerCase()===r.getAttribute("value").toLowerCase()){f(!0),p.getI().play(r),K(r),setTimeout((()=>{this.inputString=""}),1e3);const t=r.getAttribute("onCorrect");if(await g(t,r),r.style.animation="none",r.style.pointerEvents="none",this.numberOfClick++,localStorage.removeItem(d),this.numberOfClick===this.letterLength){const t=i.getAttribute("onCorrect");i.style.pointerEvents="none",await g(t,this.el),m(),b()}else E(r)}}else{f(!1),setTimeout((()=>{this.inputString=""}),1e3),localStorage.removeItem(d);const t=i.getAttribute("onInCorrect");await g(t,this.el)}}componentDidLoad(){if(document.getElementById(U).getAttribute("drop-action")===J.InfiniteDrop){const t=this.el.querySelectorAll(".key-button"),i=t[0];t.forEach((t=>{t.style.width=i.offsetWidth+"px",t.style.height=i.offsetHeight+"px"}))}}componentWillLoad(){this.updateStyles(),window.addEventListener("resize",this.handleWindowResize),window.addEventListener("load",this.handleWindowLoad)}disconnectedCallback(){window.removeEventListener("resize",this.handleWindowResize),window.removeEventListener("load",this.handleWindowLoad)}updateStyles(){const t=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:c(this.height,t),width:c(this.width,t),backgroundColor:c(this.bgColor,t),top:c(this.y,t),left:c(this.x,t),zIndex:this.z,fontSize:c(this.fontSize,t),fontFamily:this.fontFamily,color:c(this.fontColor,t),display:"true"===c(`${this.visible}`,t)?"flex":"none",margin:c(this.margin,t),padding:c(this.padding,t),borderRadius:c(this.borderRadius,t),columns:c(`${this.columns}`,t),gap:c(this.gap,t)}}render(){const t=this.keys.split(",").map((t=>t.trim())),n="true"===document.getElementById(U).getAttribute("show-check");return i(e,{key:"4de3b75fa2905744ad610d147d9b4fe9912dd732",class:"lido-keyboard",style:{width:this.style.width,height:this.style.height,position:"relative",margin:this.style.margin,zIndex:this.z}},this.keyboardInput&&i("div",{key:"7b5d293c52747700cde9c1069cfbbdae065e64f9",class:"input-area"},i("input",{key:"03a91cd87e6bb4f09bf698087258426dd9232f67",type:"text",value:this.inputString,class:"input-area",readonly:!0}),i("lido-text",{key:"d30e033a055df52b30b2f2775c2b3410ee37df63",visible:n?"true":"false",string:"<<","bg-color":"black","font-color":"white","border-radius":"20px","font-size":"30px",width:"100px",height:"70px",type:"click",onClick:()=>{this.inputString=this.inputString.slice(0,-1),this.inputValidation(event)}}),i("lido-text",{key:"70d78aed7dedbe7d03a05c13c4c320029280bb03",visible:n?"true":"false",id:"lido-checkButton",string:"Enter","bg-color":"green","font-color":"white","border-radius":"20px","font-size":"30px",width:"150px",height:"70px",type:"click"})),this.letterLength&&i("lido-text",{key:"19306cd12bd98dc8dc7b54b20bad3f2f0318116f",visible:"true",string:`${this.numberOfClick}/${this.letterLength}`,"font-size":"60px","font-color":"white",onEntry:"this.position='absolute'; this.right='0'; this.fontWeight='800';",x:"unset"}),i("div",{key:"826900d6ba26175eb45d2e7e4c02fccce2004db3",class:"keyboard-wrapper",style:{display:"flex",flexWrap:"wrap",justifyContent:"center",alignContent:"stretch",gap:this.gap,width:"100%",height:"100%"}},t.map(((t,e)=>{const[n,r]=t.split("-"),s="disable"===r;let o="Space"===n?" ":n;return i("lido-text",{id:"key-button-"+e,style:{flex:`0 0 calc(${100/parseInt(this.style.columns)}% - ${this.style.gap})`},visible:"true","font-size":this.style.fontSize,"font-color":this.fontColor,"font-family":this.fontFamily,"bg-color":this.bgColor,string:n,onEntry:this.onEntry,"border-radius":this.style.borderRadius,value:n.toLowerCase(),type:this.type,class:"key-button"+(s?" disabled":""),onClick:()=>{this.inputString+=o,this.inputValidation(event)},"disable-speak":this.disableSpeak})}))))}get el(){return n(this)}};Xe.style='.lido-keyboard{display:flex;flex-direction:column;align-items:center;gap:30px}.input-area{display:flex;gap:15px}input[type="text"]{font-size:30px;font-weight:600;padding-left:20px;width:300px;height:70px;border:2px solid;background:whitesmoke;border-radius:20px;text-align:center}.keyboard-wrapper{justify-content:center;width:700px}.disabled{opacity:0.5;pointer-events:none}.key-button{background:aquamarine;font-weight:600}';const Ve=class{constructor(i){t(this,i),this.rows="10",this.cols="10",this.defualtFill=0,this.leftIndex=!1,this.topIndex=!1,this.bottomIndex=!1,this.clickable=!0,this.activeOnlyVisible=!1,this.activeBgColor="transparent",this.deactiveBgColor="transparent",this.border="2px solid green",this.height="100%",this.width="100%",this.borderRadius="5px",this.visible="false",this.previousFilledSlot=-1,this.previousFilledSlotElement=null,this.style={},this.handleWindowResize=()=>this.updateStyles(),this.handleWindowLoad=()=>this.updateStyles()}updateValue(t){this.el.setAttribute("value",t)}componentDidLoad(){const t=this.el.querySelectorAll(".slot");h(this.el,this.type),t.forEach((t=>{const i=t;i.style.setProperty("--active-bg-color",this.activeBgColor),i.style.setProperty("--deactive-bg-color",this.deactiveBgColor),i.style.pointerEvents=this.clickable?"":"none",i.style.border=this.border,i.style.color=this.fontColor,i.className.includes("slot-active")?(i.style.visibility="",this.matrixImage&&i.style.setProperty("--bg-image",`url(${u(this.matrixImage)})`)):this.activeOnlyVisible&&(i.style.visibility="hidden")})),this.updateSlots(),this.updateStyles()}componentWillLoad(){this.updateStyles(),this.updateSlots(),window.addEventListener("resize",this.handleWindowResize),window.addEventListener("load",this.handleWindowLoad)}disconnectedCallback(){window.removeEventListener("resize",this.handleWindowResize),window.removeEventListener("load",this.handleWindowLoad)}updateSlots(){const t=this.el.querySelectorAll(".slot"),i=this.el.querySelector(".slot");if(!t.length||!i)return;const e=document.getElementById(U);let n=this.rows,r=this.cols;e&&"multiplyBeeds"===e.getAttribute("template-id")&&(r="9",n="1");const s=Number(n)<Number(r)?this.el.offsetHeight:this.el.offsetWidth,o=Number(n)>Number(r)?Number(n):Number(r),a=this.el.querySelectorAll(".slot-parent"),h=s/o;a.forEach((t=>{t.style.width=`${h}px`,Array.from(t.children).forEach((t=>{const i=t;i.style.width=`${h}px`,i.style.height=`${h}px`,"drop"!==this.type&&"drag"!==this.type&&"checkerBlock"!==this.type||(this.el.style.width="auto",this.el.style.height="auto"),(!this.topIndex&&i.classList.contains("topIndex")||!this.leftIndex&&i.classList.contains("leftIndex")||!this.bottomIndex&&i.classList.contains("bottomIndex"))&&(i.classList.contains("leftIndex")&&i.parentElement.remove(),i.remove())}))}))}updateStyles(){const t=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:c(this.height,t),width:c(this.width,t),zIndex:this.z,display:"true"===c(`${this.visible}`,t)?"flex":"none",borderRadius:c(this.borderRadius,t),left:c(this.x,t),top:c(this.y,t),cols:c(`${this.cols}`,t),rows:c(`${this.rows}`,t)}}handleClickSlot(t){const i=parseInt(t.className.split(" ")[1].split("-")[1]),e=this.el.querySelectorAll(".slot");if(e.forEach(((t,e)=>{const n=t;e<i?(n.classList.add("slot-active"),n.classList.remove("slot-inactive"),this.matrixImage&&n.style.setProperty("--bg-image",`url(${u(this.matrixImage)})`)):(n.classList.remove("slot-active"),n.classList.add("slot-inactive"))})),-1!==this.previousFilledSlot&&null!==this.previousFilledSlotElement&&(this.previousFilledSlotElement.textContent=""),t.textContent=i.toString(),this.previousFilledSlot=i,this.previousFilledSlotElement=t,i===e.length)try{const t=new CustomEvent("math-matrix-bottom-click",{detail:{matrix:this.el,cols:this.style.cols,rows:this.style.rows},bubbles:!0,composed:!0});this.el.dispatchEvent(t)}catch(t){console.warn("Error dispatching math-matrix-bottom-click from handleClickSlot",t)}this.updateValue(i.toString()),Q()}getSlotData(){const t={};return this.text?(this.text.split(",").forEach(((i,e)=>{const[n,r]=i.split("-"),s=parseInt(n.trim());isNaN(s)||(t[e]={text:n.trim(),color:null==r?void 0:r.trim()})})),t):t}render(){let t=1;const n=this.getSlotData();return i(e,{key:"4628494c0109ae927e379a442d3921b40e01f1e3",class:"math-matrix",style:{height:this.style.height,width:this.style.width,z:this.style.z,display:this.style.display,top:this.style.top,left:this.style.left},type:this.type,value:this.value,"tab-index":this.tabIndex,rows:this.style.rows,cols:this.style.cols,text:this.text,onCorrect:this.onCorrect,onInCorrect:this.onInCorrect,onEntry:this.onEntry},Array.from({length:parseInt(this.style.rows)+1},((e,r)=>i("div",{class:"slot-parent",key:`row-${r}`},i("div",{style:0===r&&{visibility:"hidden"},class:"topIndex"},r),Array.from({length:parseInt(this.style.cols)},((e,s)=>{var o,a;return 0===r?i("div",{class:"leftIndex"},++s):i("div",{class:`slot slot-${t} ${this.defualtFill>=t?"slot-active":"slot-inactive"}`,onClick:t=>this.handleClickSlot(t.currentTarget),key:`slot-${r}-${s}`,style:{borderRadius:this.style.borderRadius,backgroundColor:(null===(o=n[t-1])||void 0===o?void 0:o.color)||""}},null===(a=n[t-1])||void 0===a?void 0:a.text,t++&&null)})),i("div",{style:0===r&&{visibility:"hidden"},class:"bottomIndex"},parseInt(this.style.cols)*r)))))}get el(){return n(this)}};Ve.style=".math-matrix{width:100%;height:100%;display:flex;justify-content:center}.slot{width:100%;height:100%;text-align:center;align-content:center;font-size:42px;font-weight:800;font-family:'Baloo Bhai 2';box-sizing:content-box}.slot:hover{opacity:0.7}.slot-parent{width:100%;height:100%;display:flex;justify-content:center;align-items:center;flex-direction:column}.slot-active{background-color:var(--active-bg-color);background-image:var(--bg-image);background-size:contain;background-position:center;background-repeat:no-repeat}.slot-inactive{background-color:var(--deactive-bg-color);background-size:cover;background-position:center;background-repeat:no-repeat}.topIndex,.leftIndex,.bottomIndex{height:100%;width:100%;text-align:center;align-content:center;font-size:30px;font-weight:600;font-family:'Baloo Bhai 2'}";const Ge=class{constructor(i){t(this,i),this.id="",this.value="",this.height="auto",this.width="auto",this.ariaLabel="",this.ariaHidden="",this.x="0px",this.y="0px",this.z="0",this.bgColor="",this.type="",this.tabIndex=0,this.visible=!1,this.audio="",this.onTouch="",this.onInCorrect="",this.onCorrect="",this.onEntry="",this.minDrops=1,this.maxDrops=1,this.margin="",this.handleWindowResize=()=>this.updateStyles(),this.handleWindowLoad=()=>this.updateStyles()}componentDidLoad(){h(this.el,this.type)}componentWillLoad(){this.updateStyles(),window.addEventListener("resize",this.handleWindowResize),window.addEventListener("load",this.handleWindowLoad)}disconnectedCallback(){window.removeEventListener("resize",this.handleWindowResize),window.removeEventListener("load",this.handleWindowLoad)}updateStyles(){const t=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:c(this.height,t),width:c(this.width,t),backgroundColor:c(this.bgColor,t),top:c(this.y,t),left:c(this.x,t),zIndex:this.z,display:JSON.parse(c(`${this.visible}`,t))?"block":"none",margin:c(this.margin,t)}}render(){return i(e,{key:"cfd38900b31991e89c21a099fc4f91f77663ae94",id:this.id,class:"lido-pos",type:this.type,"tab-index":this.tabIndex,style:this.style,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,minDrops:this.minDrops,maxDrops:this.maxDrops,value:this.value,audio:this.audio,onTouch:this.onTouch,onCorrect:this.onCorrect,onInCorrect:this.onInCorrect,onEntry:this.onEntry},i("slot",{key:"73f7bfe2d8214693d6f40a4dab6d735906ad4eaa"}))}get el(){return n(this)}};Ge.style=".lido-pos{top:var(--y, 0);left:var(--x, 0);height:var(--height, 100%);width:var(--width, 100%);background-color:var(--bgColor, #eeeeee);display:flex;justify-content:space-around;flex-direction:column;position:fixed}.lido-pos>*{position:absolute}";const Ye=class{constructor(i){t(this,i),this.showSpeakIcon=!1,this.id="",this.value="",this.height="auto",this.width="auto",this.ariaLabel="",this.ariaHidden="",this.x="0px",this.y="0px",this.z="0",this.bgColor="",this.type="",this.tabIndex=0,this.visible=!1,this.audio="",this.onTouch="",this.onInCorrect="",this.onCorrect="",this.onEntry="",this.minDrops=1,this.maxDrops=1,this.margin=""}componentDidLoad(){setTimeout((()=>{const t=this.el.parentElement;if(!t)return;const i=t.offsetWidth,e=t.offsetHeight;Array.from(this.el.children).forEach((t=>{const n=i-t.offsetWidth,r=e-t.offsetHeight,s=Math.random()*n,o=Math.random()*r;t.style.position="absolute",t.style.left=`${s}px`,t.style.top=`${o}px`}))}),50),this.showSpeakIcon&&y(this.el)}render(){return i(e,{key:"a4cec45d407b57833a4296a20230717534adf39b",class:"lido-random",type:this.type,"tab-index":this.tabIndex,value:this.value,style:{height:this.height,width:this.width,top:this.y,left:this.x,display:this.visible?"block":"none",zIndex:this.z,backgroundColor:this.bgColor,margin:this.margin},"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,audio:this.audio,onTouch:this.onTouch,onCorrect:this.onCorrect,minDrops:this.minDrops,maxDrops:this.maxDrops,onInCorrect:this.onInCorrect,onEntry:this.onEntry},i("slot",{key:"b80726b68b7f1c009f35352b9d05cd573159f87b"}))}get el(){return n(this)}};Ye.style=".lido-random{position:relative;width:100%;height:100%}.lido-random>*{position:absolute}";const Ze=class{constructor(i){t(this,i),this.Lang="",this.xmlPath="",this.initialIndex=0,this.margin="",this.canplay=!0,this.baseUrl="",this.zipUrl=""}connectedCallback(){this.setLanguage(this.Lang)}onLangChange(t){this.setLanguage(t)}setLanguage(t){si.changeLanguage(t||si.language)}async componentWillLoad(){var t,i;if(this.zipUrl)return void(this.xmlData="");const e=null!==(t=this.xmlPath)&&void 0!==t?t:this.baseUrl+((null===(i=this.baseUrl)||void 0===i?void 0:i.endsWith("/"))?"index.xml":"/index.xml");try{const t=e.startsWith("http")?e:s(e),i=await fetch(t);if(!i.ok)throw new Error(`Failed to fetch XML data: ${i.statusText}`);const n=await i.text();this.xmlData=n}catch(t){console.error("Error fetching XML data:",t),this.xmlData=null}}render(){return void 0===this.xmlData?i("div",null,"Loading..."):null===this.xmlData?i("div",null,"Error loading XML data. Please check the path or URL."):i("lido-home",Object.assign({showNav:!0,activeContainerIndexes:[],initialIndex:this.initialIndex,canplay:this.canplay,xmlData:this.xmlData,baseUrl:this.baseUrl},this.zipUrl?{zipUrl:this.zipUrl}:{},{exitButtonUrl:this.exitButtonUrl,prevButtonUrl:this.prevButtonUrl,nextButtonUrl:this.nextButtonUrl,speakerButtonUrl:this.speakerButtonUrl}))}static get assetsDirs(){return["assets"]}static get watchers(){return{Lang:[{onLangChange:0}]}}},Ke=class{constructor(i){t(this,i),this.showSpeakIcon=!1,this.minDrops=1,this.maxDrops=1,this.style={},this.handleWindowResize=()=>this.updateStyles(),this.handleWindowLoad=()=>this.updateStyles(),this.margin="",this.disableSpeak=!1}componentDidLoad(){h(this.el,this.type),w(this.el,this.minLength,this.maxLength,this.childElementsLength),this.showSpeakIcon&&y(this.el)}componentWillLoad(){this.updateStyles(),window.addEventListener("resize",this.handleWindowResize),window.addEventListener("load",this.handleWindowLoad)}disconnectedCallback(){window.removeEventListener("resize",this.handleWindowResize),window.removeEventListener("load",this.handleWindowLoad)}updateStyles(){const t=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:c(this.height,t),width:c(this.width,t),backgroundColor:c(this.bgColor,t),top:c(this.y,t),left:c(this.x,t),zIndex:this.z,display:this.visible?this.display?c(this.display,t):"flex":"none",flexDirection:this.direction?c(this.direction,t):"row",gridTemplateColumns:this.display&&"grid"===c(this.display,t)?"repeat(auto-fill, minmax(186px, auto))":void 0,gap:this.display&&"grid"===c(this.display,t)?"20px":void 0,margin:c(this.margin,t)}}render(){return i(e,{key:"c69aea0b1b11d9aec167d1a4376f68073f91ca81",class:"lido-row",type:this.type,"tab-index":this.tabIndex,value:this.value,style:this.style,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,minDrops:this.minDrops,maxDrops:this.maxDrops,audio:this.audio,onTouch:this.onTouch,onCorrect:this.onCorrect,onInCorrect:this.onInCorrect,onEntry:this.onEntry,"disable-speak":this.disableSpeak},i("slot",{key:"8756ee0447057cddb949e23decbde5fe4d1d25c8"}))}get el(){return n(this)}};Ke.style=".lido-row{display:flex;justify-content:space-around;align-items:center;}.lido-row>*{}";const Je=class{constructor(i){t(this,i),this.id="",this.value="",this.height="auto",this.width="auto",this.ariaLabel="",this.ariaHidden="",this.x="0px",this.y="0px",this.z="0",this.bgColor="",this.type="",this.tabIndex=0,this.shapeType="circle",this.visible=!1,this.audio="",this.onTouch="",this.onInCorrect="",this.onCorrect="",this.onEntry="",this.minDrops=1,this.maxDrops=1,this.margin="",this.delayVisible="",this.disableSpeak=!1,this.style={}}componentDidLoad(){a(this.el,this.delayVisible),h(this.el,this.type),this.updateStyles(),this.lido3DShapes()}updateStyles(){const t=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={x:c(`${this.x}`,t),y:c(`${this.y}`,t),height:c(`${this.height}`,t),width:c(`${this.width}`,t)}}lido3DShapes(){const t=window.innerHeight>window.innerWidth?"portrait":"landscape";"lido-cube"===this.shapeType&&this.el.querySelectorAll(".face").forEach((i=>{const e=i;e.style.setProperty("--face-width",c(`${this.width}`,t));const n=parseInt(c(`${this.width}`,t))/2;e.style.setProperty("--face-translate",`${n}px`),e.style.setProperty("--face-bg-color",this.bgColor)}))}render(){return i(e,{key:"b252b5dbf4624939ef2917a385fc95061695bc64",class:`lido-shape ${this.shapeType}`,value:this.value,type:this.type,"tab-index":this.tabIndex,style:{height:"polygon"!==this.shapeType?this.style.height:void 0,width:"polygon"!==this.shapeType?this.style.width:void 0,top:this.style.y,left:this.style.x,display:this.visible?"block":"none",zIndex:this.z,backgroundColor:"polygon"!==this.shapeType?this.bgColor:"transparent",margin:this.margin},"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,audio:this.audio,minDrops:this.minDrops,maxDrops:this.maxDrops,onTouch:this.onTouch,onCorrect:this.onCorrect,onInCorrect:this.onInCorrect,onEntry:this.onEntry,"disable-speak":this.disableSpeak},"lido-cube"===this.shapeType&&i("div",{key:"573e3aaee8ada8da25b434058962f034ee7bcd2a",class:"cube"},i("div",{key:"4d5bb38b531a0a4cc6ffa9df25312b41718c81d2",class:"face top"}),i("div",{key:"01f93868cbc55844969e50256f505391323c4cbe",class:"face bottom"}),i("div",{key:"44ab31e212d6dd0e321a30154e0bd6cba61f5367",class:"face left"}),i("div",{key:"28b970d25d8ce54c4f96d418b05c559964a1e882",class:"face right"}),i("div",{key:"6da6d820eaa308e2401e3063de298be165428ff4",class:"face front"}),i("div",{key:"caaee0b7580ad10f925a610650098cbe7abc31a4",class:"face back"})))}get el(){return n(this)}};Je.style=".lido-shape{position:absolute;top:var(--y);left:var(--x);display:var(--display);z-index:var(--z);justify-content:center;align-items:center}.lido-rectangle{border-radius:0}.lido-circle{width:var(--width);height:var(--width);border-radius:50%;background-color:var(--bgColor)}.lido-ellipse{width:var(--width);height:var(--height);border-radius:50%;background-color:var(--bgColor)}.lido-triangle{width:var(--triangleWidth);height:var(--triangleHeight);background-color:var(--bgColor);clip-path:polygon(50% 0%, 100% 100%, 0% 100%)}.lido-rightTriangle{width:var(--triangleWidth);height:var(--triangleHeight);background-color:var(--bgColor);clip-path:polygon(100% 0%, 100% 100%, 0% 100%)}.lido-leftTriangle{width:var(--triangleWidth);height:var(--triangleHeight);background-color:var(--triangleBgColor);clip-path:polygon(0% 0%, 100% 100%, 0% 100%)}.lido-parallelogram{width:var(--paralleWidth);height:var(--paralleHeight);transform:skew(20deg)}.lido-trapezium{width:var(--trapeziumWidth);height:var(--trapeziumHeight);background-color:var(--bgColor);clip-path:polygon( 20% 0%, 80% 0%, 100% 100%, 0% 100% )}.lido-hexagon{width:var(--hexagonWidth);height:var(--hexagonHeight);background-color:var(--bgColor);clip-path:polygon( 25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50% )}.lido-cone{width:var(--coneWidth);height:var(--coneHeight);background-color:var(--bgColor);clip-path:polygon( 15% 10%, 25% 4%, 35% 1%, 50% 0%, 65% 1%, 75% 4%, 85% 10%, 50% 100% )}.lido-star{width:var(--starWidth);height:var(--starHeight);background-color:var(--starBgColor);clip-path:polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%)}.lido-pentagon{width:var(--pentagonWidth);height:var(--pentagonHeight);background-color:var(--pentagonBgColor);clip-path:polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%)}.lido-heptagon{width:var(--heptagonWidth);height:var(--heptagonHeight);background-color:var(--heptagonBgColor);clip-path:polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%)}.lido-octagon{width:var(--octagonWidth);height:var(--octagonHeight);background-color:var(--octagonBgColor);clip-path:polygon(25% 0%, 75% 0%, 100% 25%, 100% 75%, 75% 100%, 25% 100%, 0% 75%, 0% 25%)}.lido-rhombus{width:var(--rhombusWidth);height:var(--rhombusHeight);background-color:var(--rhombusBgColor);clip-path:polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%)}.lido-heart{height:var(--heartHeight);width:var(--heartWidth);border-image:radial-gradient(var(--heartBgColor) 69%, #0000 70%) 84.5%/50%;clip-path:polygon(-41% 0, 50% 91%, 141% 0)}.cube{width:100%;height:100%;position:relative;transform-style:preserve-3d;transform:rotateX(-20deg) rotateY(45deg)}.face{position:absolute;width:var(--face-width,150px);height:var(--face-width,150px);background:var(--face-bg-color,150px);box-shadow:inset -20px -20px 40px rgba(0,0,0,0.3)}.front{transform:rotateY( 0deg) translateZ(var(--face-translate, 75px))}.back{transform:rotateY(180deg) translateZ(var(--face-translate, 75px))}.right{transform:rotateY( 90deg) translateZ(var(--face-translate, 75px))}.left{transform:rotateY(-90deg) translateZ(var(--face-translate, 75px))}.top{transform:rotateX( 90deg) translateZ(var(--face-translate, 75px))}.bottom{transform:rotateX(-90deg) translateZ(var(--face-translate, 75px))}.lido-cylinder{width:var(--width);height:var(--height);border-radius:100% / 80px;background:radial-gradient(50% 40px at 50% 40px, #0003 99.99%, #0000 0), radial-gradient(50% 40px at 50% calc(100% - 40px), #fff3 99.99%, #0000 0), red}.lido-sphere{position:relative;width:var(--width);height:var(--width);border-radius:50%;background:radial-gradient(circle at 30% 18%, #22d4ff 0%, #18c2f4 9%, rgba(24, 194, 244, 0.2) 18%, transparent 30%), radial-gradient(circle at 36% 26%, #0f8fff 0%, #0b67e6 30%, #083fbe 62%, #120084 100%);box-shadow:inset -22px -26px 40px rgba(5, 0, 70, 0.38), inset 14px 14px 24px rgba(255, 255, 255, 0.05), 0 4px 2px rgba(0, 0, 0, 0.78);overflow:visible}.lido-sphere::after{content:'';position:absolute;top:50%;left:50%;width:100%;height:16%;border-radius:50%;border-top:2px dashed rgba(0, 0, 0, 0.65);border-bottom:3px solid rgba(0, 0, 0, 0.85);box-sizing:border-box;transform:translate(-50%, -50%);pointer-events:none}";const Qe=class{constructor(i){t(this,i),this.id="lido-slide-fill",this.padding="",this.borderRadius="0px",this.numberType="integer",this.min=0,this.division=5,this.max=10,this.type="",this.onEntry="",this.svgContent="",this.handleWindowResize=()=>this.updateStyles(),this.handleWindowLoad=()=>this.updateStyles(),this.delayVisible="",this.disableSpeak=!1,this.originalHeight=null,this.originalY=null}async componentWillLoad(){await this.renderSVG(),this.updateStyles(),window.addEventListener("resize",this.handleWindowResize),window.addEventListener("load",this.handleWindowLoad)}disconnectedCallback(){window.removeEventListener("resize",this.handleWindowResize),window.removeEventListener("load",this.handleWindowLoad)}async onSrcChange(){await this.renderSVG(),this.onPropChange()}async renderSVG(){const t=await fetch(u(this.src));if(t.ok){let i=await t.text(),e=0;i=i.replace(/<path([^>]*)>/g,((t,i)=>(e++,`<path id="${1===e?"glassPath":2===e?"rulerPath":`path${e}`}"${i}>`))),i=i.replace(/<svg([^>]*)>/,'<svg class="lido-slide-svg"$1>\n \n <clipPath id="clipGlass">\n <use xlink:href="#glassPath" />\n </clipPath>\n \n '),i=i.replace(/<rect([^>]*)\/?>/,'<rect id="fillArea" $1 clip-path="url(#clipGlass)" />'),this.svgContent=i}}componentDidLoad(){a(this.el,this.delayVisible),h(this.el,this.type),this.updateFill(),this.addRulerNumbers()}updateStyles(){const t=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:c(this.height,t),width:c(this.width,t),backgroundColor:c(this.bgColor,t),top:c(this.y,t),left:c(this.x,t),zIndex:this.z,display:c(`${this.visible}`,t)?"flex":"none",alignItems:"center",justifyContent:"center",margin:c(this.margin,t),padding:c(this.padding,t),borderRadius:this.borderRadius}}onPropChange(){this.updateFill(),this.addRulerNumbers()}updateFill(){var t;const i=null===(t=this.el.querySelector(".lido-svg-element"))||void 0===t?void 0:t.querySelector("svg");if(!i)return;const e=i.querySelector("#fillArea");if(!e)return;const n=this.fillDirection;let r,s;"vertical"===this.fillDirection?(null!==this.originalHeight&&null!==this.originalY||(this.originalHeight=+e.getAttribute("height")||100,this.originalY=+e.getAttribute("y")||0),r=this.originalHeight,s=this.originalY):(null!==this.originalHeight&&null!==this.originalY||(this.originalHeight=+e.getAttribute("width")||100,this.originalY=+e.getAttribute("x")||0),r=this.originalHeight,s=this.originalY);const o=r,a=s;let h=0;if("string"==typeof this.fill){const t=this.fill.match(/^(\d+(?:\.\d+)?)%$/);if(t)h=Math.min(Math.max(parseFloat(t[1])/100,0),1);else{const t=this.fill.match(/^(\d+(?:\.\d+)?)$/);t&&(h=Math.min(Math.max(parseFloat(t[1])/100,0),1))}}const u=o*h,c="vertical"===n?a+(o-u):a;"vertical"===n?(e.setAttribute("height",u.toString()),e.setAttribute("y",c.toString())):(e.setAttribute("width",u.toString()),e.setAttribute("x","0"))}addRulerNumbers(){var t;const i=null===(t=this.el.querySelector(".lido-svg-element"))||void 0===t?void 0:t.querySelector("svg");if(!i)return;const e=i.querySelector("#rulerPath");if(!e)return;i.querySelectorAll(".ruler-number").forEach((t=>t.remove()));const n=this.division,r=n+1,s=e.getTotalLength(),o=(this.max-this.min)/n;for(let t=0;t<r;t++){let r=0;"vertical"===this.fillDirection?r=this.max-t*o:"horizontal"===this.fillDirection&&(r=this.min+t*o);const a=e.getPointAtLength(s/n*t),h=document.createElementNS("http://www.w3.org/2000/svg","text"),u=tt(r/this.max);r="integer"===this.numberType?Math.round(r):"decimal"===this.numberType?parseFloat(r.toFixed(1)):u.toFraction(!0),h.classList.add("ruler-number"),h.setAttribute("x",a.x.toString()),h.setAttribute("y",(a.y+15).toString()),h.setAttribute("text-anchor","end"),h.setAttribute("font-size","40"),h.setAttribute("fill","#333"),h.textContent=r.toString(),i.appendChild(h)}}render(){return i(e,{key:"a19d35ba055a5ed9ab38adb02f37c9cb634c272d",id:this.id,class:"lido-slide-fill",src:this.src,fill:this.fill,fillDirection:this.fillDirection,slider:this.slider,style:this.style,min:this.min,max:this.max,division:this.division,numberType:this.numberType,onEntry:this.onEntry,type:this.type,"disable-speak":this.disableSpeak},i("div",{key:"987f42b3c213f570714b2ddf600243e83c3b12ad",innerHTML:this.svgContent,class:"lido-svg-element"}))}get el(){return n(this)}static get watchers(){return{src:[{onSrcChange:0}],fill:[{onPropChange:0}],division:[{onPropChange:0}],fillDirection:[{onPropChange:0}],numberType:[{onPropChange:0}],min:[{onPropChange:0}],max:[{onPropChange:0}]}}};Qe.style=".lido-svg-element,.lido-slide-svg{width:100%;height:100%}";const tn=class{constructor(i){t(this,i),this.showSpeakIcon=!1,this.id="",this.value="",this.string="",this.fontFamily="",this.fontSize="20px",this.fontColor="",this.highlightWhileSpeaking=!1,this.height="auto",this.width="auto",this.ariaLabel="",this.ariaHidden="",this.move="false",this.x="0px",this.y="0px",this.z="0",this.bgColor="",this.borderImage="",this.type="",this.tabIndex=0,this.visible=!1,this.audio="",this.onTouch="",this.onInCorrect="",this.onCorrect="",this.minDrops=1,this.maxDrops=1,this.onEntry="",this.margin="",this.padding="",this.borderRadius="0px",this.spanType="",this.style={},this.handleWindowResize=()=>this.updateStyles(),this.handleWindowLoad=()=>this.updateStyles(),this.delayVisible="",this.disableSpeak=!1}componentDidLoad(){if(a(this.el,this.delayVisible),h(this.el,this.type),"words"!==this.spanType&&"letters"!==this.spanType||this.addSpanToText(),this.showSpeakIcon&&y(this.el),!this.audio||""===this.audio.trim()){const t=()=>{const t=this.resolveAutoAudio();t&&(this.audio=t)};window.__LIDO_COMMON_AUDIO_PATH__?t():window.addEventListener(it,t,{once:!0})}}resolveAutoAudio(){const t=window[N];return t&&this.string?`${t}/${this.string}.mp3`:null}componentWillLoad(){this.updateStyles(),window.addEventListener("resize",this.handleWindowResize),window.addEventListener("load",this.handleWindowLoad)}disconnectedCallback(){window.removeEventListener("resize",this.handleWindowResize),window.removeEventListener("load",this.handleWindowLoad)}updateStyles(){const t=this.borderImage?u(this.borderImage):"",i=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:c(this.height,i),width:c(this.width,i),backgroundColor:c(this.bgColor,i),top:c(this.y,i),left:c(this.x,i),zIndex:this.z,fontSize:c(this.fontSize,i),fontFamily:this.fontFamily,color:c(this.fontColor,i),display:"true"===c(`${this.visible}`,i)?"flex":"none",borderImage:`url(${t})`,borderImageSlice:t?"0 fill":"",margin:c(this.margin,i),padding:c(this.padding,i),borderRadius:c(this.borderRadius,i)}}async addSpanToText(){const t=this.el.querySelector(".lido-text-content");if(!t)return;const i=t.textContent||"";t.innerHTML="","letters"===this.spanType&&i.split("").forEach((i=>{if(""===i.trim())return;const e=document.createElement("span");e.textContent=i,e.className="text-letters",t.appendChild(e)})),"words"===this.spanType&&i.split(" ").forEach((i=>{const e=document.createElement("span");e.textContent=i,e.className="text-words",t.appendChild(e)}))}render(){return i(e,{key:"30e77a008aba08f90f88541574f70588bb8a2cd6",class:"lido-text",value:this.value,type:this.type,"tab-index":this.tabIndex,audio:this.audio,onTouch:this.onTouch,onCorrect:this.onCorrect,onInCorrect:this.onInCorrect,onEntry:this.onEntry,minDrops:this.minDrops,maxDrops:this.maxDrops,id:this.id,style:this.style,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,move:this.move,"span-type":this.spanType,"disable-speak":`${this.disableSpeak}`},""!==this.spanType?i("div",{class:"lido-text-content"}," ",si.t(this.string)):si.t(this.string))}get el(){return n(this)}};tn.style=".lido-text{transition:background-color 0.3s ease;user-select:none;align-items:center;justify-content:center;text-align:center;border-radius:24px;color:#333;cursor:pointer;font-family:'Baloo Bhai 2', serif}.text-letters{transition:color 0.3s, text-shadow 0.3s;display:inline-block;padding:0 2px}.text-letters.letter-highlight{color:#8e24aa;background:none;border-radius:0;text-shadow:0 2px 8px #8e24aa88;animation:text-letter-bounce 0.4s}.text-words{transition:color 0.3s, text-shadow 0.3s;display:inline-block;padding:0 2px}.text-words.word-highlight{color:#8e24aa;background:none;border-radius:0;text-shadow:0 2px 8px #8e24aa88;animation:text-word-bounce 0.4s}@keyframes text-letter-bounce{0%{transform:scale(1)}60%{transform:scale(1.4)}100%{transform:scale(1)}}@keyframes text-word-bounce{0%{transform:scale(1)}60%{transform:scale(1.3)}100%{transform:scale(1)}}";const en=class{constructor(i){t(this,i),this.showSpeakIcon=!1,this.id="",this.svgSource="",this.svgUrls=[],this.audioUrls=[],this.currentSvgIndex=0,this.moving=!1,this.value="",this.height="auto",this.width="auto",this.audio="",this.x="0px",this.y="0px",this.z="0",this.ariaLabel="",this.ariaHidden="",this.tabIndex=0,this.mode=et.ShowFlow,this.fingerHintUrl="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/trace/Tracing-hand.svg",this.highlightTextId="",this.animationTrace=!1,this.delayVisible="",this.disableSpeak=!1,this.style={},this.handleWindowResize=()=>this.updateStyles(),this.handleWindowLoad=()=>this.updateStyles(),this.fileIndex=-1,this.isDragging=!1,this.activePointerId=null,this.freeTraceUpdateCounter=0,this.idleTimer=null,this.fingerImg=null}async initializeSVG(){let t={fileIndex:-1,currentPathIndex:0,lastLength:0,totalPathLength:0,isDragging:!1,circle:null,paths:[],svg:null,proximityThreshold:60,freeTraceProximityThreshold:350,rafId:null,pointerMoveEvent:null,activePointerId:null,mode:this.mode,flowMarkers:[],freeTraceLines:[],currentFreePath:[],lastPointerPos:null,dragOffset:null,isCompletingPath:!1};const i=this.svgUrls[this.currentSvgIndex];i&&""!==i.trim()?(await this.fetchSVG(u(i)),await this.loadAnotherSVG(t,!0)):console.error("No SVG URL provided or index out of bounds.")}componentDidLoad(){a(this.el,this.delayVisible)}componentWillLoad(){this.updateStyles(),window.addEventListener("resize",this.handleWindowResize),window.addEventListener("load",this.handleWindowLoad),this.svgUrls=this.svgSource.split(";").map((t=>t.trim())),this.currentSvgIndex=0,this.showSpeakIcon&&(nt(this.el),this.el.append(nt(this.el))),this.initializeSVG()}disconnectedCallback(){window.removeEventListener("resize",this.handleWindowResize),window.removeEventListener("load",this.handleWindowLoad)}resetIdleTimer(t){null!==this.idleTimer&&(clearTimeout(this.idleTimer),this.idleTimer=null),this.idleTimer=window.setTimeout((()=>{this.showFingerHint(t)}),3e3)}showFingerHint(t){var i;if(this.fingerImg)return;const e=t.paths[t.currentPathIndex];if(!e)return;const n=document.createElementNS("http://www.w3.org/2000/svg","image"),r=new Image;r.onload=()=>{n.setAttributeNS("http://www.w3.org/1999/xlink","href",u(this.fingerHintUrl))},r.onerror=()=>{n.setAttributeNS("http://www.w3.org/1999/xlink","href",u(rt))},r.src=u(this.fingerHintUrl||rt),n.setAttribute("width","40"),n.setAttribute("height","40"),n.setAttribute("id","lido-finger-hint"),n.style.pointerEvents="none",n.style.opacity="0.8",n.setAttribute("x","0"),n.setAttribute("y","0");const s=document.createElementNS("http://www.w3.org/2000/svg","animateMotion");s.setAttribute("dur","2s"),s.setAttribute("repeatCount","indefinite");const o=document.createElementNS("http://www.w3.org/2000/svg","mpath");o.setAttributeNS("http://www.w3.org/1999/xlink","href",`#${e.id}`),s.appendChild(o),n.appendChild(s),null===(i=t.svg)||void 0===i||i.appendChild(n),this.fingerImg=n}hideFingerHint(){this.fingerImg&&this.fingerImg.parentNode&&this.fingerImg.parentNode.removeChild(this.fingerImg),this.fingerImg=null}async fetchSVG(t){const i=await fetch(t);if(!i.ok)throw new Error(`Failed to fetch SVG (${t}): ${i.statusText}`);return await i.text()}calculateBoundingBox(t,i=22){let e=1/0,n=1/0,r=-1/0,s=-1/0;return t.forEach((t=>{const i=t.getTotalLength();for(let o=0;o<=100;o++){const a=t.getPointAtLength(o/100*i);a.x<e&&(e=a.x),a.y<n&&(n=a.y),a.x>r&&(r=a.x),a.y>s&&(s=a.y)}})),e-=i,n-=i,r+=i,s+=i,{minX:e,minY:n,maxX:r,maxY:s}}insertSVG(t){const i=document.getElementById("lido-svgContainer");if(!i)return;i.innerHTML=t;const e=i.querySelector("svg");e.classList.add("lido-trace-svg"),e.removeAttribute("width"),e.removeAttribute("height");const n=e.querySelectorAll("path, line"),r=this.calculateBoundingBox(Array.from(n));e.setAttribute("viewBox",`${r.minX} ${r.minY} ${r.maxX-r.minX} ${r.maxY-r.minY}`)}getSVGElement(){return document.getElementById("lido-svgContainer").querySelector("svg")}getPaths(t){return Array.from(t.querySelectorAll("path, line"))}createFlowMarkersForPath(t){var i;if(!t)return;const e=t.ownerSVGElement;if(!e)return;const n=document.createElementNS("http://www.w3.org/2000/svg","path");n.setAttribute("d",t.getAttribute("d")||""),n.setAttribute("stroke","blue"),n.setAttribute("stroke-width","2"),n.setAttribute("stroke-dasharray","6,6"),n.setAttribute("fill","none"),n.setAttribute("class","lido-flow-indicator"),null===(i=t.parentNode)||void 0===i||i.appendChild(n);let r=e.querySelector("defs#lido-flow-defs");r||(r=document.createElementNS("http://www.w3.org/2000/svg","defs"),r.setAttribute("id","lido-flow-defs"),e.insertBefore(r,e.firstChild));const s=`arrow-${Math.random().toString(36)}`,o=document.createElementNS("http://www.w3.org/2000/svg","marker");o.setAttribute("id",s),o.setAttribute("markerWidth","10"),o.setAttribute("markerHeight","10"),o.setAttribute("refX","5"),o.setAttribute("refY","5"),o.setAttribute("orient","auto"),o.setAttribute("markerUnits","strokeWidth");const a=document.createElementNS("http://www.w3.org/2000/svg","path");return a.setAttribute("d","M0,0 L10,5 L0,10 L2,5 Z"),a.setAttribute("fill","blue"),o.appendChild(a),r.appendChild(o),n.setAttribute("marker-end",`url(#${s})`),n}updateFlowIndicators(t){t.svg.querySelectorAll(".lido-flow-indicator").forEach((i=>{t.mode===et.NoFlow?i.style.display="none":t.mode===et.ShowFlow&&(i.style.display="block")}))}setupDrawingPath(t){t.paths.forEach(((i,e)=>{const n=i.getTotalLength();i.setAttribute("id","lido-path-"+e);const r=i.cloneNode();r.style.opacity="100",r.style["stroke-opacity"]="100";const s=i.style["stroke-width"]||i.getAttribute("stroke-width");r.setAttribute("stroke-width",s),r.setAttribute("stroke-dasharray",n.toString()),r.setAttribute("stroke-dashoffset",n.toString()),i.parentNode.appendChild(r,i),i.setAttribute("class","lido-trace-path"),r.setAttribute("class","lido-trace-path-green"),i.greenPath=r,i.classList.add(t.mode),t.mode===et.BlindTracing||t.mode===et.BlindFreeTrace?i.setAttribute("stroke","none"):(i.setAttribute("stroke","#000"),i.setAttribute("stroke-width",s),i.setAttribute("fill","none"),i.setAttribute("stroke-dasharray",n.toString()),i.setAttribute("stroke-dashoffset","0")),e===t.currentPathIndex&&t.mode===et.ShowFlow&&(t.flowMarkers=this.createFlowMarkersForPath(i))})),t.totalPathLength=t.paths[t.currentPathIndex].getTotalLength()}setupDraggableCircle(t){var i;const e=t.paths[0].getPointAtLength(0),n=document.createElementNS("http://www.w3.org/2000/svg","circle");t.paths[t.currentPathIndex].style["stroke-width"]||t.paths[t.currentPathIndex].getAttribute("stroke-width"),n.setAttribute("id","lido-draggableCircle"),n.setAttribute("cx",e.x.toString()),n.setAttribute("cy",e.y.toString()),n.setAttribute("r","20"),n.setAttribute("fill","#CF1565"),null===(i=t.svg)||void 0===i||i.appendChild(n),t.circle=n,this.resetIdleTimer(t)}addEventListeners(t){var i,e,n,r;if(!t.circle||!t.paths||0===t.paths.length)return;t.svg.style.touchAction="none",t.circle.style.touchAction="none",t.circle.addEventListener("pointerdown",(i=>{i.preventDefault();const e=this.getPointerPosition(i,t.svg),n={x:parseFloat(t.circle.getAttribute("cx")),y:parseFloat(t.circle.getAttribute("cy"))},r=this.getDistanceSquared(e,n),s=this.getProximityThresholdForEvent(t,i);if(r<=s*s||"touch"===i.pointerType){t.isDragging=!0,t.activePointerId=i.pointerId,t.dragOffset={x:e.x-n.x,y:e.y-n.y};try{t.circle.setPointerCapture(i.pointerId)}catch(t){}t.lastPointerPos=n}this.hideFingerHint(),this.resetIdleTimer(t)}),{passive:!1}),null===(i=t.svg)||void 0===i||i.addEventListener("pointermove",(i=>{t.isDragging&&i.pointerId===t.activePointerId&&(i.preventDefault(),t.pointerMoveEvent=i,t.rafId||(t.rafId=requestAnimationFrame((()=>{this.handlePointerMove(t),t.rafId=null}))))}));const s=i=>{i.pointerId===t.activePointerId&&(t.isDragging=!1,t.activePointerId=null,t.lastPointerPos=null,t.dragOffset=null,this.hideFingerHint(),this.resetIdleTimer(t))};null===(e=t.svg)||void 0===e||e.addEventListener("pointerup",s),null===(n=t.svg)||void 0===n||n.addEventListener("pointercancel",s),null===(r=t.svg)||void 0===r||r.addEventListener("contextmenu",(t=>{t.preventDefault()}))}async handlePointerMove(t){var i,e,n,r,s,o;if(!t.isDragging)return;if(!t.circle||!t.paths||0===t.paths.length)return;if(t.isCompletingPath)return;this.hideFingerHint();const a=t.pointerMoveEvent,h=this.getPointerPosition(a,t.svg),u=t.dragOffset?{x:h.x-t.dragOffset.x,y:h.y-t.dragOffset.y}:h,c={x:parseFloat(t.circle.getAttribute("cx")),y:parseFloat(t.circle.getAttribute("cy"))};let l=1/0;if(t.lastPointerPos){const i=u.x-t.lastPointerPos.x,e=u.y-t.lastPointerPos.y;if(l=i*i+e*e,l<1)return}const d=t.paths[t.currentPathIndex];if(!d)return void console.error("No valid path found at the current index");const f=this.getProximityThresholdForEvent(t,a),p=f*f;if(this.getDistanceSquared(u,c)>p)return;const g=t.mode===et.FreeTrace||t.mode===et.BlindFreeTrace,m=this.getClosestPointOnPath(d,u,g?void 0:t.lastLength);if(this.getDistanceSquared(u,m)>p)return;if(g){if(this.freeTraceUpdateCounter=(this.freeTraceUpdateCounter||0)+1,this.freeTraceUpdateCounter%2!=0)return;if(t.currentFreePath||(t.currentFreePath=[]),!t.currentFreePath[t.currentPathIndex]){const e=document.createElementNS("http://www.w3.org/2000/svg","polyline"),n=t.paths[t.currentPathIndex].style["stroke-width"]||t.paths[t.currentPathIndex].getAttribute("stroke-width");e.setAttribute("stroke-width",n),e.setAttribute("fill","none"),e.setAttribute("stroke-linecap","round"),e.setAttribute("stroke","lightgreen"),e.setAttribute("points",`${u.x},${u.y}`),null===(i=t.svg)||void 0===i||i.appendChild(e),t.currentFreePath[t.currentPathIndex]=e,t.currentFreePolylinePoints=t.currentFreePolylinePoints||[],t.currentFreePolylinePoints[t.currentPathIndex]=[{x:u.x,y:u.y}],t.lastPointerPos=u,t.freeTracePointsCount=1}const r=10;if(t.freeTracePointsCount=(t.freeTracePointsCount||1)+1,t.freeTracePointsCount>r)return;t.currentFreePolylinePoints=t.currentFreePolylinePoints||[];let s=t.currentFreePolylinePoints[t.currentPathIndex]||[];s.push({x:u.x,y:u.y}),t.currentFreePolylinePoints[t.currentPathIndex]=s;const o=s.map((t=>`${t.x},${t.y}`)).join(" ");t.currentFreePath[t.currentPathIndex].setAttribute("points",o),t.circle.setAttribute("cx",u.x.toString()),t.circle.setAttribute("cy",u.y.toString());const a=null===(e=t.svg)||void 0===e?void 0:e.childNodes;let h=!1;for(let t=0;t<((null==a?void 0:a.length)||0);t++){const i=null==a?void 0:a.item(t);if(i&&"circle"===i.tagName){h=!0;break}}return!h&&t.circle&&(null===(n=t.svg)||void 0===n||n.appendChild(t.circle)),t.lastPointerPos=u,void(s.length>=r&&(this.moveToNextPath(t),t.currentFreePath[t.currentPathIndex]=null,t.currentFreePolylinePoints[t.currentPathIndex]=[],t.freeTracePointsCount=0))}const b=Math.min(320,Math.max(160,.45*t.totalPathLength)),v=Math.min(60,Math.max(24,.12*t.totalPathLength));let w=m,y=w.length>=t.lastLength-20&&w.length-t.lastLength<=80;if(!y){const i=this.getClosestPointOnPath(d,u),e=this.getDistanceSquared(u,i);l>=64&&e<=p&&i.length>=t.lastLength-20&&i.length-t.lastLength<=b&&i.length<t.totalPathLength-v&&(w=i,y=!0)}if(t.isDragging&&y){t.lastLength=Math.max(t.lastLength,w.length),t.lastPointerPos=u,(Math.abs(w.x-c.x)>1||Math.abs(w.y-c.y)>1)&&(t.circle.setAttribute("cx",w.x.toString()),t.circle.setAttribute("cy",w.y.toString()));const i=null===(r=t.svg)||void 0===r?void 0:r.childNodes;let e=!1;for(let t=0;t<((null==i?void 0:i.length)||0);t++){const n=null==i?void 0:i.item(t);if(n&&"circle"===n.tagName){e=!0;break}}!e&&t.circle&&(null===(s=t.svg)||void 0===s||s.appendChild(t.circle)),null===(o=d.greenPath)||void 0===o||o.setAttribute("stroke-dashoffset",(t.totalPathLength-t.lastLength).toString());const n=.95;let a=t.lastLength/t.totalPathLength,h=d.getPointAtLength(0),l=d.getPointAtLength(d.getTotalLength());if(this.getDistanceSquared(h,l)<200&&t.totalPathLength>50){if(a>=n){if(t.isCompletingPath)return;t.isCompletingPath=!0,await this.animatePathToEnd(t,d),t.currentPathIndex<t.paths.length-1?this.moveToNextPath(t):t.currentPathIndex===t.paths.length-1&&this.moveToNextContainer()}}else if(t.totalPathLength-1-t.lastLength<5&&t.currentPathIndex<t.paths.length-1){if(t.isCompletingPath)return;t.isCompletingPath=!0,this.moveToNextPath(t)}else if(t.totalPathLength-1-t.lastLength<5&&t.currentPathIndex===t.paths.length-1){if(t.isCompletingPath)return;t.isCompletingPath=!0,this.moveToNextContainer()}}}animatePathToEnd(t,i,e=300){if(!i||!t.svg)return Promise.resolve();if(t._animatingToEnd)return Promise.resolve();t._animatingToEnd=!0;const n=t.lastLength||0,r=i.getTotalLength(),s=performance.now(),o=i.greenPath||i.parentNode&&i.parentNode.querySelector(".lido-trace-path-green");return new Promise((a=>{const h=u=>{const c=Math.min(1,(u-s)/e),l=n+(r-n)*c;t.lastLength=l;const d=i.getPointAtLength(l);if(t.circle&&(t.circle.setAttribute("cx",d.x.toString()),t.circle.setAttribute("cy",d.y.toString())),o&&o.setAttribute("stroke-dashoffset",(t.totalPathLength-l).toString()),c<1)requestAnimationFrame(h);else{if(t.lastLength=r,t.circle){const e=i.getPointAtLength(r);t.circle.setAttribute("cx",e.x.toString()),t.circle.setAttribute("cy",e.y.toString())}o&&o.setAttribute("stroke-dashoffset","0"),t._animatingToEnd=!1,a()}};requestAnimationFrame(h)}))}async moveToNextContainer(){if(this.isDragging=!1,this.moving)return;if(this.moving=!0,this.highlightTextId&&this.highlightLetter(this.currentSvgIndex),this.animationTrace&&await this.playTraceAnimation(),f(!0),this.currentSvgIndex<this.svgUrls.length-1)return await new Promise((t=>setTimeout(t,1e3))),this.currentSvgIndex++,await this.initializeSVG(),document.getElementById("lido-svgContainer").style.visibility="visible",this.moving=!1,void(this.el&&this.onCorrect&&await g(this.onCorrect,this.el));const t=document.querySelector(U),i=t.getAttribute("onCorrect");t&&i&&(await new Promise((t=>setTimeout(t,1e3))),await g(i,this.el)),m(),b()}getPointerPosition(t,i){var e;const n=this.getPointerPositionFromViewBox(t,i);if(n)return n;const r=i.createSVGPoint();r.x=t.clientX,r.y=t.clientY;const s=null===(e=i.getScreenCTM())||void 0===e?void 0:e.inverse();return s?r.matrixTransform(s):{x:t.clientX,y:t.clientY}}getPointerPositionFromViewBox(t,i){const e=i.getBoundingClientRect(),n=i.viewBox.baseVal;if(!(e.width&&e.height&&n.width&&n.height))return null;const{offsetX:r,offsetY:s,scaleX:o,scaleY:a}=this.getSvgViewBoxTransform(i,e);return{x:n.x+(t.clientX-e.left-r)/o,y:n.y+(t.clientY-e.top-s)/a}}getSvgViewBoxTransform(t,i=t.getBoundingClientRect()){const e=t.viewBox.baseVal,n=t.preserveAspectRatio.baseVal,r=i.width/e.width,s=i.height/e.height;if(1===n.align)return{offsetX:0,offsetY:0,scaleX:r,scaleY:s};const o=2===n.meetOrSlice?Math.max(r,s):Math.min(r,s),a=e.width*o,h=e.height*o;let u=0,c=0;const l=n.align;return 3===l||6===l||9===l?u=(i.width-a)/2:4!==l&&7!==l&&10!==l||(u=i.width-a),5===l||6===l||7===l?c=(i.height-h)/2:8!==l&&9!==l&&10!==l||(c=i.height-h),{offsetX:u,offsetY:c,scaleX:o,scaleY:o}}getProximityThresholdForEvent(t,i){const e=t.mode===et.FreeTrace||t.mode===et.BlindFreeTrace?t.freeTraceProximityThreshold:t.proximityThreshold;if("touch"!==(null==i?void 0:i.pointerType)||!t.svg)return e;const n=t.svg.getBoundingClientRect(),r=t.svg.viewBox.baseVal;if(!(n.width&&n.height&&r.width&&r.height))return e;const{scaleX:s,scaleY:o}=this.getSvgViewBoxTransform(t.svg,n),a=44*Math.max(1/s,1/o);return Math.max(e,a)}getDistanceSquared(t,i){const e=t.x-i.x,n=t.y-i.y;return e*e+n*n}getClosestPointOnPath(t,i,e){const n=t.getTotalLength();let r={x:0,y:0,length:0},s=1/0,o=0,a=n;void 0!==e&&(o=Math.max(0,e-150),a=Math.min(n,e+150));let h={length:o};for(let e=o;e<=a;e+=40){const n=t.getPointAtLength(e),r=this.getDistanceSquared(i,n);r<s&&(s=r,h={x:n.x,y:n.y,length:e})}const u=Math.max(0,h.length-40),c=Math.min(n,h.length+40);s=1/0;for(let e=u;e<=c;e+=6){const n=t.getPointAtLength(e),o=this.getDistanceSquared(i,n);o<s&&(s=o,r={x:n.x,y:n.y,length:e})}return r}async loadAnotherSVG(t,i){t.isDragging=!1;try{t.svg&&this.cleanupPreviousSVG(t);const i=await this.fetchSVG(u(this.svgSource.split(";").map((t=>t.trim()))[this.currentSvgIndex]));this.insertSVG(i),t.svg=this.getSVGElement(),this.mode!==et.BlindTracing&&this.mode!==et.BlindFreeTrace||t.svg.querySelectorAll("image").forEach((t=>{t.style.display="none"})),t.paths=this.getPaths(t.svg),this.setupDrawingPath(t),this.setupDraggableCircle(t),this.addEventListeners(t)}catch(t){console.error(`Error loading SVG (${this.svgSource}):`,t)}}cleanupPreviousSVG(t){var i,e;t.circle&&(null===(i=t.svg)||void 0===i||i.removeChild(t.circle),t.circle=null),(null===(e=t.svg)||void 0===e?void 0:e.querySelectorAll(".lido-flow-indicator")).forEach((t=>{t.remove()})),t.currentPathIndex=0,t.lastLength=0,t.totalPathLength=t.paths[0].getTotalLength(),this.hideFingerHint(),this.resetIdleTimer(t)}async moveToNextPath(t){var i,e;if(t.isDragging=!1,t.currentPathIndex++,t.lastLength=0,t.isCompletingPath=!1,this.hideFingerHint(),t.currentPathIndex>=t.paths.length)return void this.moveToNextContainer();const n=t.paths[t.currentPathIndex];if(!n)return void console.error("No valid path found at the next index");t.totalPathLength=n.getTotalLength();const r=n.getPointAtLength(0);null===(i=t.circle)||void 0===i||i.setAttribute("cx",r.x.toString()),null===(e=t.circle)||void 0===e||e.setAttribute("cy",r.y.toString()),t.mode===et.ShowFlow&&(t.flowMarkers=this.createFlowMarkersForPath(n)),this.resetIdleTimer(t)}async playTraceAnimation(){const t=document.getElementById(this.id);t&&(t.classList.add("trace-animate"),await new Promise((t=>setTimeout(t,500))),t.classList.remove("trace-animate"))}async highlightLetter(t){if(!document.getElementById(U))return;const i=this.el;if(!i)return;const e=this.highlightTextId;if(!e)return;const n=document.getElementById(e);if(!n)return;const r=this.audio;if(!r)return;this.audioUrls=r.split(";").map((t=>t.trim()));const s=n.getAttribute("span-type");if(!s)return;const o=n.querySelector(".lido-text-content");if(o){if("letters"===s){const e=o.querySelectorAll(".text-letters");if(t<0||t>=e.length)return;const r=e[t];if(r){const t=i.querySelector("#lido-svgContainer");if(await g("this.alignMatch='true';",n,t),t.style.animation="trace-animation 0.4s forwards",t.style.setProperty("--trace-width",r.offsetWidth-5+"px"),t.style.setProperty("--trace-height",r.offsetHeight-5+"px"),await g("this.alignMatch='true';",r,t),setTimeout((()=>{r.classList.add("letter-highlight"),t.style.transform="",t.style.animation="",t.style.visibility="hidden"}),500),this.audioUrls[this.currentSvgIndex]){const t=new Audio(u(this.audioUrls[this.currentSvgIndex]));await t.play()}}}if("words"===s){const i=o.querySelectorAll(".text-words");if(t<0||t>=i.length)return;const e=i[t];if(e&&(e.classList.add("word-highlight"),this.audioUrls[this.currentSvgIndex])){const t=new Audio(u(this.audioUrls[this.currentSvgIndex]));await t.play()}}}}updateStyles(){const t=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:c(this.height,t),width:c(this.width,t),top:c(this.y,t),left:c(this.x,t),zIndex:this.z}}render(){return i(e,{key:"31f7f62d73ed98ce0a3b224435e7b64574cf506c",class:"lido-trace",id:this.id,audio:this.audio,onCorrect:this.onCorrect,onInCorrect:this.onInCorrect,style:this.style,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,tabindex:this.tabIndex,"disable-speak":this.disableSpeak},i("div",{key:"6cf11b7d5f9aeb3c58cbb462e63d3f340384a403",style:this.style,id:"lido-svgContainer"}))}static get assetsDirs(){return["svg","images"]}get el(){return n(this)}static get watchers(){return{svgSource:[{initializeSVG:0}],mode:[{initializeSVG:0}]}}};en.style=":host{display:block;position:relative}#lido-svgContainer{display:flex;justify-content:center;align-items:center;overflow:hidden}.lido-trace-svg{width:100%;height:100%;touch-action:none}#lido-draggableCircle{cursor:pointer;fill:#CF1565;transition:fill 0.2s, r 0.2s}.lido-blindTracing{stroke:none !important}.lido-blindFreeTrace{stroke:none !important}.lido-hovered{cursor:grab;fill:darkred}#lido-controls{position:fixed;bottom:0;left:0;right:0;display:flex;justify-content:space-between;padding:10px;background-color:#f0f0f0;border-top:1px solid #ccc}button{padding:10px;font-size:16px}@media (max-width: 600px){button{padding:8px;font-size:14px}}.lido-trace-path-green{}.lido-flow-indicator{stroke:blue;stroke-width:2;stroke-dasharray:6, 6;fill:none}.lido-trace{height:700px;width:700px;z-index:1;justify-items:center;align-content:center}.trace-animate{animation:trace-bounce 0.5s}@keyframes trace-bounce{0%{transform:scale(1)}30%{transform:scale(1.05)}60%{transform:scale(0.95)}100%{transform:scale(1)}}";const nn=class{constructor(i){t(this,i),this.showSpeakIcon=!1,this.minDrops=1,this.maxDrops=1,this.margin="",this.disableSpeak=!1,this.handleWindowResize=()=>this.updateStyles(),this.handleWindowLoad=()=>this.updateStyles()}componentDidLoad(){h(this.el,this.type),w(this.el,this.minLength,this.maxLength,this.childElementsLength),"true"===this.flex&&(this.el.classList.remove("lido-wrap"),this.el.classList.add("lido-flex")),this.showSpeakIcon&&y(this.el)}componentWillLoad(){this.updateStyles(),window.addEventListener("resize",this.handleWindowResize),window.addEventListener("load",this.handleWindowLoad)}disconnectedCallback(){window.removeEventListener("resize",this.handleWindowResize),window.removeEventListener("load",this.handleWindowLoad)}updateStyles(){const t=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:c(this.height,t),width:c(this.width,t),backgroundColor:c(this.bgColor,t),top:c(this.y,t),left:c(this.x,t),zIndex:this.z,display:JSON.parse(c(`${this.visible}`,t))?"true"===this.flex?"flex":"grid":"none",margin:c(this.margin,t)}}render(){return i(e,{key:"58b1e37a1787349d3ccd2bc6952d94a7d945e234",class:"lido-wrap",value:this.value,type:this.type,"tab-index":this.tabIndex,style:this.style,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,audio:this.audio,minDrops:this.minDrops,maxDrops:this.maxDrops,onTouch:this.onTouch,onCorrect:this.onCorrect,onInCorrect:this.onInCorrect,onEntry:this.onEntry,disableSpeak:this.disableSpeak},i("slot",{key:"44389fcc3d2e86faf291b74bfe50b55d467a7278"}))}get el(){return n(this)}};nn.style=".lido-wrap{display:grid;grid-gap:10px;grid-template-columns:repeat(auto-fill, minmax(186px, auto))}.lido-wrap>*{padding:10px;background-color:var(--child-bg-color, #f0f0f0);box-sizing:border-box}.lido-flex{display:flex;flex-wrap:wrap;align-content:flex-start;gap:10px}";export{ut as lido_avatar,ct as lido_balance,lt as lido_calculator,dt as lido_canvas,ft as lido_cell,pt as lido_col,Mi as lido_container,Ei as lido_flash_card,Oi as lido_float,zi as lido_home,qe as lido_image,Xe as lido_keyboard,Ve as lido_math_matrix,Ge as lido_pos,Ye as lido_random,Ze as lido_root,Ke as lido_row,Je as lido_shape,Qe as lido_slide_fill,tn as lido_text,en as lido_trace,nn as lido_wrap}