lecodes-cli 2.8.1 → 2.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "b3916045-2026-11-06",
3
- "commit": "b3916045",
4
- "date": "2026-11-06T11:52:59.585Z"
2
+ "version": "4a7100c2-2026-11-06",
3
+ "commit": "4a7100c2",
4
+ "date": "2026-11-06T17:08:42.684Z"
5
5
  }
@@ -10,7 +10,7 @@ var $n=Object.defineProperty;var Vn=(n,t,e)=>t in n?$n(n,t,{enumerable:!0,config
10
10
  `)){let h=ce(l,o,e);a&&(r>0&&i.length+h.length>r?a=!1:s==="balance"?h=ss(l,o,h,e):h=is(o,h,e));for(const u of h)i.push(u)}let c=0;for(const l of i)c=Math.max(c,e(l));return{lines:i,maxWidth:c}}function vn(n,t,e,s,r){const i=t.textWrap??"wrap",o=Ft(n,e,s,i,t.lineClamp??0),a=i==="nowrap"&&!r?1/0:e,c=os(o.lines,t,a,s);return i!=="nowrap"||!r||t.textOverflow==="clip"||!isFinite(e)?c:c.map(l=>s(l)>e?xn(l,e,s):l)}const jt="…";function os(n,t,e,s){const r=t.lineClamp??0;if(r<=0||n.length<=r)return n;const i=n.slice(0,r);return t.textOverflow==="clip"||(i[r-1]=xn(i[r-1],e,s)),i}function xn(n,t,e){if(!isFinite(t))return n+jt;const s=[...n];let r=s.length;for(;r>0&&e(s.slice(0,r).join("")+jt)>t;)r--;return s.slice(0,r).join("").trimEnd()+jt}function as(n,t,e){const s=ae(n),r=bn(s),i=isNaN(e)?1/0:e,o=l=>t.measureText(l,r),a=vn(n.text??"",n.style,i,o,!1);let c=0;for(const l of a)c=Math.max(c,o(l));return{width:Math.ceil(c),height:Math.ceil(a.length*s.lineHeight)}}function cs(n,t,e){const s=n.style,r={family:s.fontFamily??"Roboto",size:s.fontSize??14,weight:s.fontWeight??400,italic:s.fontStyle==="italic",letterSpacing:s.letterSpacing??0},i=s.lineHeight,o=n.value??"";if(n.type==="input")return{width:Math.ceil(t.measureText(o,r)),height:Math.ceil(i)};const a=isNaN(e)?1/0:e,c=Ft(o,a,l=>t.measureText(l,r));return{width:Math.ceil(c.maxWidth),height:Math.ceil(Math.max(1,c.lines.length)*i)}}function ls(n,t,e,s){const r=n.imageSrcRaw;let i=0,o=0;if(n.sourceRect)i=n.sourceRect[2],o=n.sourceRect[3];else if(un(r)){const l=se(r.svg);if(l)i=l.width,o=l.height;else{const h=t.getImage(t.resolveSrc(r)??"");i=(h==null?void 0:h.naturalWidth)??0,o=(h==null?void 0:h.naturalHeight)??0}}else{const l=t.resolveSrc(r),h=l?t.getImage(l):void 0;i=(h==null?void 0:h.naturalWidth)??0,o=(h==null?void 0:h.naturalHeight)??0}if(i===0||o===0)return{width:0,height:0};const a=Math.min(e/i,s/o),c=isNaN(e)&&isNaN(s)?1:isNaN(e)?s/o:isNaN(s)?e/i:Math.min(a,1);return{width:i*c,height:o*c}}const En=(n,t,e,s)=>t?[n[0],n[1],n[2],n[3],n[4]+e*t[0]+s*t[2],n[5]+e*t[1]+s*t[3]]:n;function hs(n,t,e,s,r,i,o={}){t.beginFrame(s,r);for(const a of n)Sn(a.tree,t,e,o);t.endFrame()}function Sn(n,t,e,s){var h;const{style:r,rect:i}=n;t.save();const o=r.opacity!==void 0&&r.opacity<1?r.opacity:void 0,a=o!==void 0&&n.children.length>0;if(a?t.beginGroup(o):o!==void 0&&t.setAlpha(o),r.transform){const[u,d,f,g,y,x]=En(r.transform,r.transformBox,i.width,i.height),w=r.transformOrigin,p=i.x+(w?w.xPercent?i.width*w.x/100:w.x:i.width/2),m=i.y+(w?w.yPercent?i.height*w.y/100:w.y:i.height/2);t.translate(p,m),t.transform(u,d,f,g,y,x),t.translate(-p,-m)}const c=oe(r.borderRadius,i);if(ie(r.backgroundColor)||t.fillRoundRect(i,c,r.backgroundColor),r.backgroundImage){const u=e.getImage(r.backgroundImage);u&&u.naturalWidth>0&&u.naturalHeight>0&&(t.save(),Ae(c)&&t.clipRoundRect(i,c),t.drawImage(u,null,i,{fit:us(r.backgroundSize),tile:r.backgroundSize==="tile"}),t.restore())}if(r.backgroundGradients)for(let u=r.backgroundGradients.length-1;u>=0;u--){const d=r.backgroundGradients[u];d.stops.length>0&&t.fillGradient(i,c,d)}if(n.image&&n.image.naturalWidth>0&&n.image.naturalHeight>0){const u=n.sourceRect;t.save(),Ae(c)&&t.clipRoundRect(i,c),t.drawImage(n.image,u?{x:u[0],y:u[1],width:u[2],height:u[3]}:null,i,{fit:u?"fill":r.objectFit??"contain",tint:$t(n.image.src)?r.tintColor:void 0,radius:c}),t.restore()}n.type==="text"&&n.lines&&n.lines.length>0&&fs(n,t,e),(n.type==="input"||n.type==="textarea")&&n.id!==s.editing&&bs(n,t,e,c),(n.type==="video"||n.type==="native")&&(s.surfaces?t.clearRoundRect(i,c):n.type==="video"?gs(n,t,e,c):((h=n.view)==null?void 0:h.label)!==void 0&&ws(n,n.view.name,n.view.label,t,e,c)),n.clip&&t.clipRoundRect(i,c);for(const u of n.children)u.overlay!==void 0&&!ie(u.overlay)&&t.fillRoundRect(i,void 0,u.overlay),Sn(u,t,e,s);r.dim!==void 0&&r.dim>0&&t.fillRoundRect(i,c,Math.round(Math.min(1,r.dim)*255)>>>0);const l=ds(r.border);l&&t.strokeBorder(i,c,l),a&&t.endGroup(),t.restore()}function us(n){return n==="contain"||n==="fill"?n:"cover"}function ds(n){if(!n)return null;const t={};let e=!1;for(const s of["top","right","bottom","left"]){const r=n[s];r&&r.width>0&&(r.color>>>0)%256!==0&&(t[s]=r,e=!0)}return e?t:null}const pe=(n,t)=>{var s;const e=t??"Roboto";return((s=n.resolveFontFamily)==null?void 0:s.call(n,e))??e};function fs(n,t,e){var x,w,p;const s=n.style,r={family:pe(e,s.fontFamily),size:s.fontSize??14,weight:s.fontWeight??400,italic:s.fontStyle==="italic",letterSpacing:s.letterSpacing??0},i=s.color??255,o=s.lineHeight,a=s.textAlign??"start",c=e.fontMetrics(r),{rect:l,lines:h}=n,u=((x=n.padding)==null?void 0:x[0])??0,d=((w=n.padding)==null?void 0:w[1])??0,f=((p=n.padding)==null?void 0:p[2])??0,g=l.x+u,y=l.width-u-f;for(let m=0;m<h.length;m++){const E=h[m],L=l.y+d+m*o+(o-(c.ascent+c.descent))/2+c.ascent,O=e.measureText(E,r),C=a==="center"?g+(y-O)/2:a==="end"?g+y-O:g;if(t.fillText(E,C,L,r,i),s.textDecoration==="underline"||s.textDecoration==="line-through"){const F=Math.max(1,r.size/14),W=s.textDecoration==="underline"?L+F:L-r.size*.3;t.fillRoundRect({x:C,y:W,width:O,height:F},void 0,i)}}}function gs(n,t,e,s){const{rect:r}=n;ie(n.style.backgroundColor)&&t.fillRoundRect(r,s,286463999);const i=Math.min(r.width,r.height)*.3;if(i>=6){const o={family:"Roboto",size:i,weight:400,italic:!1,letterSpacing:0},a=e.fontMetrics(o),c=e.measureText("▶",o),l=r.x+(r.width-c)/2,h=r.y+(r.height-(a.ascent+a.descent))/2+a.ascent;t.fillText("▶",l,h,o,4294967244)}}const ps=3722701567,ms=1263887359,ys=2324997119;function ws(n,t,e,s,r,i){const{rect:o}=n;s.fillRoundRect(o,i,ps);const a=pe(r,void 0),c={family:a,size:17,weight:600,italic:!1,letterSpacing:0},l={family:a,size:13,weight:400,italic:!1,letterSpacing:0},h=[];if(e&&h.push([e,c,ms]),t&&t!==e&&h.push([t,l,ys]),h.length===0)return;const u=4,d=h.map(([,g])=>{const y=r.fontMetrics(g);return y.ascent+y.descent});let f=o.y+(o.height-d.reduce((g,y)=>g+y,0)-u*(h.length-1))/2;s.save(),s.clipRoundRect(o,i),h.forEach(([g,y,x],w)=>{const p=o.x+(o.width-r.measureText(g,y))/2;s.fillText(g,p,f+r.fontMetrics(y).ascent,y,x),f+=d[w]+u}),s.restore()}function bs(n,t,e,s){var $,j,q,A,v;const r=n.style,i={family:pe(e,r.fontFamily),size:r.fontSize??14,weight:r.fontWeight??400,italic:r.fontStyle==="italic",letterSpacing:r.letterSpacing??0},o=n.value??"",a=o.length===0,c=r.inputType==="password"&&!a,l=a?r.placeholder??"":c?"•".repeat(o.length):o,h=a?r.placeholderColor??2576980479:r.color??255,{rect:u}=n,d=(($=n.padding)==null?void 0:$[0])??0,f=((j=n.padding)==null?void 0:j[1])??0,g=((q=n.padding)==null?void 0:q[2])??0,y=((A=n.padding)==null?void 0:A[3])??0,x=u.x+d,w=u.width-d-g,p=u.y+f,m=u.height-f-y,E=e.fontMetrics(i),k=r.lineHeight,L=r.textAlign??"start",O=n.type==="textarea",C=O?Ft(l,w,T=>e.measureText(T,i)).lines:[l],F=T=>L==="center"?x+(w-T)/2:L==="end"?x+w-T:x,W=T=>O?p+T*k+(k-(E.ascent+E.descent))/2+E.ascent:p+(m-(E.ascent+E.descent))/2+E.ascent;t.save(),t.clipRoundRect(u,s);for(let T=0;T<C.length;T++){const I=C[T];I.length>0&&t.fillText(I,F(e.measureText(I,i)),W(T),i,h)}if((v=n.state)!=null&&v.focused){const T=a?[""]:O?Ft(c?"•".repeat(o.length):o,w,U=>e.measureText(U,i)).lines:[l],I=T.length-1,z=e.measureText(T[I],i),J=a?F(0):F(z)+z,_=W(I),M=Math.max(1,i.size/14);t.fillRoundRect({x:J,y:_-E.ascent,width:M,height:E.ascent+E.descent},void 0,r.color??255)}t.restore()}const vs=84,xs={display:{word:4},overflow:{word:5},scrollDirection:{word:6},borderTopWidth:{word:8},borderRightWidth:{word:9},borderBottomWidth:{word:10},borderLeftWidth:{word:11},color:{bit:12,word:16},backgroundColor:{word:17},borderTopColor:{word:19},borderRightColor:{word:20},borderBottomColor:{word:21},borderLeftColor:{word:22},placeholderColor:{bit:19,word:23},tintColor:{bit:21,word:25},overlayColor:{bit:23,word:27},backgroundImage:{word:28},backgroundSize:{word:29},backgroundGradient:{word:30},borderTopLeftRadius:{word:32},borderTopRightRadius:{word:33},borderBottomRightRadius:{word:34},borderBottomLeftRadius:{word:35},opacity:{word:36},transform:{word:37},transformOrigin:{word:50},fontSize:{word:55},fontWeight:{word:56},fontStyle:{word:57},fontFamily:{bit:39,word:58},lineHeight:{word:59},letterSpacing:{word:60},textAlign:{word:61},textDecoration:{word:62},lineClamp:{word:63},textOverflow:{word:64},textWrap:{word:65},objectFit:{word:66},placeholder:{word:67},type:{word:68},dim:{word:82}},Es={hidden:1},Ss={horizontal:1},_s={italic:1},ht={display:["flex","none"],backgroundSize:["cover","contain","fill","tile"],textDecoration:["underline","line-through","none"],textOverflow:["ellipsis","clip"],textWrap:["wrap","nowrap","balance","pretty"],objectFit:["cover","contain","fill"],type:["text","password","tel","email","number","decimal","url","search","date","time"]},ks=(n,t,e)=>e<32?(n>>>e&1)===1:(t>>>e-32&1)===1,Ts=["farthest-corner","closest-side","closest-corner","farthest-side"],Rs=52;function As(n,t,e,s){const r=[];for(let i=0;i<s;i++)r.push(Ms(n,t,e+i*Rs));return r}function Ms(n,t,e){const s=e>>2,r=n[s],i=t[s+1],o=t[s+2],a=t[s+4],c=[];for(let l=0;l<o;l++){const h=a+l*8>>2;c.push({color:t[h]>>>0,position:n[h+1]})}if(i===1){const l=t[s+6],h={type:"radial",shape:t[s+5]===1?"circle":"ellipse",cx:n[s+7],cy:n[s+8],stops:c};return l===4?{...h,extent:"explicit",rx:n[s+9],ry:n[s+10],rxUnit:t[s+11]===1?"fraction":"px",ryUnit:t[s+12]===1?"fraction":"px"}:{...h,extent:Ts[l]??"farthest-corner"}}return{type:"linear",angle:r,stops:c}}const R=xs,Ls=["start","center","end","start","end"],Ie=new WeakMap;function _n(n,t,e){const s=n.HEAPU32,r=n.HEAPF32,i=t>>>2,o=s[i],a=s[i+1],c=C=>ks(o,a,C),l=C=>{const F=s[i+C];return F===0?void 0:n.UTF8ToString(n._cuiStringOf(F))};e.backgroundColor=s[i+R.backgroundColor.word]>>>0,e.opacity=r[i+R.opacity.word],e.dim=r[i+R.dim.word],e.display=ht.display[s[i+R.display.word]],e.overflow=s[i+R.overflow.word]===Es.hidden?"hidden":"visible",e.scrollAxis=s[i+R.scrollDirection.word]===Ss.horizontal?"x":"y",e.border={top:{width:r[i+R.borderTopWidth.word],color:s[i+R.borderTopColor.word]>>>0},right:{width:r[i+R.borderRightWidth.word],color:s[i+R.borderRightColor.word]>>>0},bottom:{width:r[i+R.borderBottomWidth.word],color:s[i+R.borderBottomColor.word]>>>0},left:{width:r[i+R.borderLeftWidth.word],color:s[i+R.borderLeftColor.word]>>>0}},e.borderRadius={tl:r[i+R.borderTopLeftRadius.word],tr:r[i+R.borderTopRightRadius.word],br:r[i+R.borderBottomRightRadius.word],bl:r[i+R.borderBottomLeftRadius.word]},e.backgroundImage=l(R.backgroundImage.word),e.backgroundSize=ht.backgroundSize[s[i+R.backgroundSize.word]];const h=s[i+R.backgroundGradient.word];if(h===0)e.backgroundGradients=void 0;else{let C=Ie.get(n);C===void 0&&(C=n._malloc(4),Ie.set(n,C));const F=n._cuiGradientOf(h,C),W=n.HEAPU32[C>>>2];e.backgroundGradients=F!==0&&W>0?As(n.HEAPF32,n.HEAPU32,F,W):void 0}const u=i+R.transform.word,d=r[u],f=r[u+1],g=r[u+3],y=r[u+4],x=r[u+6],w=r[u+7],p=r[u+9],m=r[u+10],E=r[u+11],k=r[u+12],L=p===0&&m===0&&E===0&&k===0;e.transform=d===1&&f===0&&g===0&&y===1&&x===0&&w===0&&L?void 0:[d,f,g,y,x,w],e.transformBox=L?void 0:[p,m,E,k];const O=i+R.transformOrigin.word;e.transformOrigin={x:r[O],y:r[O+1],xPercent:s[O+2]!==0,yPercent:s[O+3]!==0},e.color=c(R.color.bit)?s[i+R.color.word]>>>0:void 0,e.fontFamily=c(R.fontFamily.bit)?l(R.fontFamily.word):void 0,e.fontSize=r[i+R.fontSize.word],e.fontWeight=r[i+R.fontWeight.word],e.fontStyle=s[i+R.fontStyle.word]===_s.italic?"italic":"normal",e.lineHeight=r[i+R.lineHeight.word],e.letterSpacing=r[i+R.letterSpacing.word],e.textAlign=Ls[s[i+R.textAlign.word]]??"start",e.textDecoration=ht.textDecoration[s[i+R.textDecoration.word]],e.lineClamp=r[i+R.lineClamp.word],e.textOverflow=ht.textOverflow[s[i+R.textOverflow.word]],e.textWrap=ht.textWrap[s[i+R.textWrap.word]],e.objectFit=ht.objectFit[s[i+R.objectFit.word]],e.tintColor=c(R.tintColor.bit)?s[i+R.tintColor.word]>>>0:void 0,e.placeholder=l(R.placeholder.word),e.placeholderColor=c(R.placeholderColor.bit)?s[i+R.placeholderColor.word]>>>0:void 0,e.inputType=ht.type[s[i+R.type.word]],e.overlayColor=c(R.overlayColor.bit)?s[i+R.overlayColor.word]>>>0:void 0}function Ps(n,t){const e=n._cuiPaintOf(t);if(e===0)return!1;const s=e>>>2;return n.HEAPU32[s+2]!==0||n.HEAPU32[s+3]!==0}function Os(n,t,e){const s=n._cuiPaintOf(t);return s===0?!1:(_n(n,s,e),!0)}function Cs(n,t){const e=n._paintCollect();if(e===0)return 0;const s=n._paintNodes()>>>2,r=n._paintRecords();for(let i=0;i<e;i++){const o=n.HEAPU32[s+i],a=r+i*vs*4;t(o,c=>_n(n,a,c))}return e}function kn(n,t=[],e={}){const s=e.precision??2,r=e.includeIds??!1,i=n?le(n,s,r):null;if(t.length===0)return i;const o=t.map(a=>le(a,s,r));return i?(i.overlays=o,i):{type:"frame",overlays:o}}function Is(n,t=[],e){return JSON.stringify(kn(n,t,e),null,2)}function yt(n,t){const e=10**t;return Math.round(n*e)/e}function le(n,t,e){var o,a;const s=n.rect,r={type:n.type};n.name&&(r.name=n.name),n.view&&(r.view=n.view.name),r.rect=[yt(s.x,t),yt(s.y,t),yt(s.width,t),yt(s.height,t)],e&&(r.id=n.id);const i=Ns(n.style);return i&&(r.style=i),n.text!==void 0&&(r.text=n.text),n.lines&&(n.lines.length!==1||n.lines[0]!==n.text)&&(r.lines=n.lines),n.value!==void 0&&n.value!==""&&(r.value=n.value),n.style.placeholder!==void 0&&(r.placeholder=n.style.placeholder),n.image&&(r.image={src:n.image.src,natural:[n.image.naturalWidth,n.image.naturalHeight]}),n.sourceRect&&(r.sourceRect=n.sourceRect),n.state&&(n.state.pressed||(o=n.state.classes)!=null&&o.length)&&(r.state={...n.state.pressed?{pressed:!0}:{},...(a=n.state.classes)!=null&&a.length?{classes:n.state.classes}:{}}),n.scroll&&(r.scroll={offset:yt(n.scroll.offset,t),content:yt(n.scroll.content,t)}),n.children.length>0&&(r.children=n.children.map(c=>le(c,t,e))),r}function Fs(n){return n.tl===n.tr&&n.tr===n.br&&n.br===n.bl?n.tl:[n.tl,n.tr,n.br,n.bl]}function Ns(n){const t={};if(n.backgroundColor!==void 0&&(t.backgroundColor=mt(n.backgroundColor)),n.opacity!==void 0&&(t.opacity=n.opacity),n.color!==void 0&&(t.color=mt(n.color)),n.fontSize!==void 0&&(t.fontSize=n.fontSize),n.fontFamily!==void 0&&(t.fontFamily=n.fontFamily),n.fontWeight!==void 0&&(t.fontWeight=n.fontWeight),n.fontStyle!==void 0&&n.fontStyle!=="normal"&&(t.fontStyle=n.fontStyle),n.lineHeight!==void 0&&(t.lineHeight=n.lineHeight),n.letterSpacing&&(t.letterSpacing=n.letterSpacing),n.textAlign!==void 0&&n.textAlign!=="start"&&(t.textAlign=n.textAlign),n.textDecoration!==void 0&&n.textDecoration!=="none"&&(t.textDecoration=n.textDecoration),n.lineClamp&&(t.lineClamp=n.lineClamp,n.textOverflow==="clip"&&(t.textOverflow=n.textOverflow)),n.textWrap!==void 0&&n.textWrap!=="wrap"&&(t.textWrap=n.textWrap),n.objectFit!==void 0&&(t.objectFit=n.objectFit),n.tintColor!==void 0&&(t.tintColor=mt(n.tintColor)),n.overlayColor!==void 0&&(t.overlayColor=mt(n.overlayColor)),n.backgroundImage!==void 0&&(t.backgroundImage=n.backgroundImage),n.backgroundSize!==void 0&&(t.backgroundSize=n.backgroundSize),n.backgroundGradients!==void 0&&n.backgroundGradients.length>0&&(t.backgroundGradients=n.backgroundGradients.map(e=>{const s=e.stops.map(r=>({color:mt(r.color),position:r.position}));if(e.type==="radial"){const r={type:"radial",shape:e.shape,extent:e.extent,cx:e.cx,cy:e.cy,stops:s};return e.extent==="explicit"&&(r.rx=e.rx,r.ry=e.ry,r.rxUnit=e.rxUnit,r.ryUnit=e.ryUnit),r}return{angle:e.angle,stops:s}})),n.borderRadius&&(n.borderRadius.tl||n.borderRadius.tr||n.borderRadius.br||n.borderRadius.bl)&&(t.borderRadius=Fs(n.borderRadius)),n.border){const e={};for(const s of["top","right","bottom","left"]){const r=n.border[s];r&&r.width>0&&(e[s]={width:r.width,color:mt(r.color)})}Object.keys(e).length>0&&(t.border=e)}return Object.keys(t).length>0?t:void 0}const Us=.32,Bs=4,Ds=10,Ws={},Fe=new Map;function he(n){if(!n)return n;if(n.startsWith("canvas:"))return`lecodes-canvas://${n.slice(7)}`;if(n.startsWith("svg:")){let t=Fe.get(n);return t===void 0&&(t=dn(n.slice(4)),Fe.set(n,t)),t}return n}class Hs{constructor(t,e){b(this,"parent",null);b(this,"children",[]);b(this,"style",{lineHeight:14*1.2});b(this,"name");b(this,"text","");b(this,"src");b(this,"value","");b(this,"sourceRect");b(this,"viewName");b(this,"viewParams");b(this,"playerId",0);b(this,"viewId",0);b(this,"flags",0);b(this,"layoutRect",null);b(this,"scrollOffset",0);b(this,"wrapCache");b(this,"jsNode");b(this,"bgRaw");b(this,"bgSrc");this.id=t,this.type=e,this.jsNode={type:e,_id:t}}get measured(){return this.type==="text"||this.type==="image"||this.editable}get editable(){return this.type==="input"||this.type==="textarea"}get scrollable(){return this.type==="scrollable"||this.type==="scrollableScreen"||this.type==="vlist"}get scrollAxis(){return this.style.scrollAxis==="x"?"x":"y"}get interactive(){return(this.flags&jr)!==0}get imageSrcRaw(){return this.type==="image"?he(this.src):void 0}has(t){return(this.flags&t)!==0}}class $s{constructor(t,e,s={}){b(this,"nodes",new Map);b(this,"root",null);b(this,"leaving",null);b(this,"leavingAbove",!1);b(this,"pagerShown",new Map);b(this,"pagerLeaving",new Map);b(this,"destKind",-1);b(this,"layerRoots",[]);b(this,"width",0);b(this,"height",0);b(this,"focused",null);b(this,"safeBottom",0);b(this,"shrunkRoot",0);b(this,"shrunkInset",0);b(this,"pressed",new Set);b(this,"gestures",new Map);b(this,"vlists",new Set);b(this,"frameCache",null);b(this,"painted",null);b(this,"fontsPending",0);b(this,"lastToast",null);b(this,"dirty",!0);b(this,"onDestination",null);b(this,"onDropped",null);b(this,"placeholders");b(this,"viewNames",new Map);b(this,"nativeDest",null);b(this,"layoutPtr",0);b(this,"padPtr",0);b(this,"lastCreated",0);b(this,"hoverX",0);b(this,"hoverY",0);b(this,"hoverInside",!1);b(this,"hoverMoved",!1);this.M=t,this.host=e,this.options=s,this.placeholders=new Map(Object.entries(s.nativeViews??{}))}install(){const t=new DataView(new ArrayBuffer(8)),e=(s,r,i,o,a,c)=>{const l=this.measure(r,i,a);return t.setFloat32(4,l.width,!0),t.setFloat32(0,l.height,!0),t.getBigUint64(0,!0)};this.M._setMeasureFunc(this.M.addFunction(e,"jiififi"))}measure(t,e,s){const r=this.nodes.get(t);if(!r)return{width:0,height:0};const i=this.M;Ps(i,t)&&(Os(i,t,r.style),this.resolveBackground(r));const o=r;return r.type==="text"?as(o,this.host,e):r.type==="image"?ls(o,this.host,e,s):r.editable?cs(o,this.host,e):{width:0,height:0}}resize(t,e){this.width=t,this.height=e,this.M._creatorWebResize(t,e),this.M._setConditionValue(t,e),this.dirty=!0}setSafeArea(t,e=[]){const[s,r,i,o]=t??(this.width>this.height?[0,8,0,20]:[20,0,8,0]),a={top:1,right:2,bottom:4,left:8};this.M._setSafeAreaBars(e.reduce((c,l)=>c|a[l],0)),this.M._setSafePaddings(s,r,i,o,0),this.safeBottom=i,this.shrunkRoot&&this.nodes.has(this.shrunkRoot)&&(this.shrunkInset=Math.max(0,i-this.keyboardHeight()),this.M._overrideRootSafeBottom(this.shrunkRoot,this.shrunkInset)),this.dirty=!0}layoutFrame(){const t=this.M;Cs(t,(r,i)=>{const o=this.nodes.get(r);o&&(i(o.style),this.resolveBackground(o))})>0&&(this.dirty=!0);const s=t._creatorWebLayoutFrame(this.width,this.height);s>0&&this.readLayoutBatch(s);for(const r of this.vlists)if(t._vlistExists(r.id)){t._vlistUpdateLayout(r.id);for(const i of r.children)this.deliverSubtree(i)}}needsPaint(){return this.dirty||this.frameCache===null||this.frameCache!==this.painted}deliverSubtree(t){const e=this.M;if(this.layoutPtr||(this.layoutPtr=e._malloc(16)),e._getLayoutPointer(t.id,this.layoutPtr)){const s=this.layoutPtr>>2,r={x:e.HEAPF32[s],y:e.HEAPF32[s+1],width:e.HEAPF32[s+2],height:e.HEAPF32[s+3]},i=t.layoutRect,o=!i||i.x!==r.x||i.y!==r.y||i.width!==r.width||i.height!==r.height;t.layoutRect=r,o&&(this.dirty=!0),o&&t.has(Le)&&e._creatorWebNodeLayout(t.id,r.x,r.y,r.width,r.height)}for(const s of t.children)this.deliverSubtree(s)}readLayoutBatch(t){const e=this.M,s=e._collectNodes()>>>2,r=e._collectRects()>>>2,i=e.HEAPU32,o=e.HEAPF32;for(let a=0;a<t;a++){const c=i[s+a],l=this.nodes.get(c);if(!l)continue;const h=o[r+a*4],u=o[r+a*4+1],d=o[r+a*4+2],f=o[r+a*4+3],g={x:h,y:u,width:d-h,height:f-u},y=l.layoutRect,x=!y||y.x!==g.x||y.y!==g.y||y.width!==g.width||y.height!==g.height;l.layoutRect=g,x&&(this.dirty=!0),x&&l.has(Le)&&e._creatorWebNodeLayout(c,h,u,g.width,g.height)}}frame(){if(this.frameCache&&!this.dirty)return this.frameCache;const t=[],e={x:0,y:0,width:this.width,height:this.height},s=this.nativeDest;if(s){const i={id:0,type:"native",rect:e,style:Ws,children:[],view:{name:s.view,label:this.placeholders.get(s.view)}};s.name&&(i.name=s.name),t.push(this.destKind===ut?{tree:i}:{tree:i,leaving:!0})}const r=this.leaving?this.build(this.leaving,e):null;if(r&&!this.leavingAbove&&t.push({tree:r,leaving:!0}),this.root){const i=this.build(this.root,e);i&&t.push({tree:i})}r&&this.leavingAbove&&t.push({tree:r,leaving:!0});for(const i of this.layerRoots){const o=this.build(i,e);o&&t.push({tree:o,widget:!0})}return this.frameCache=t,this.dirty=!1,t}renderTree(){var t;return((t=this.frame().find(e=>!e.widget&&!e.leaving))==null?void 0:t.tree)??null}widgetTrees(){return this.frame().filter(t=>t.widget).map(t=>t.tree)}widgets(){return this.widgetTrees()}serialize(){return kn(this.renderTree(),this.widgetTrees())}toText(){return Is(this.renderTree(),this.widgetTrees())}paint(t,e){const s=this.frame();hs(s,t,this.host,this.width,this.height,void 0,e),this.painted=s}build(t,e){const s=this.M,r=(i,o,a,c)=>{var w;if(i.style.display==="none")return null;let l,h,u,d;if(c)l=e.x,h=e.y,u=e.width,d=e.height;else{const p=i.layoutRect;if(!p)return null;l=o+p.x,h=a+p.y,u=p.width,d=p.height}const f={id:i.id,type:i.type,rect:{x:l,y:h,width:u,height:d},style:i.style,children:[]};i.name&&(f.name=i.name);const g=i;if(i.type==="text"){const p=ae(g),m=bn(p);f.text=i.text;const E=this.padding(i.id);(E[0]||E[1]||E[2]||E[3])&&(f.padding=E);const k=u-E[0]-E[2],L=`${k}|${m.size}|${m.weight}|${m.italic?1:0}|${m.letterSpacing}|${m.family}|${i.style.lineClamp??0}|${i.style.textOverflow??""}|${i.style.textWrap??""}|${i.text}`;if(((w=i.wrapCache)==null?void 0:w.key)===L)f.lines=i.wrapCache.lines;else{const O=F=>this.host.measureText(F,m),C=vn(i.text,i.style,k,O,!0);i.wrapCache={key:L,lines:C},f.lines=C}f.style={...i.style,color:p.color,fontSize:p.fontSize,fontFamily:p.fontFamily,fontWeight:p.fontWeight,fontStyle:p.fontStyle,lineHeight:p.lineHeight,letterSpacing:p.letterSpacing,textAlign:p.textAlign,textDecoration:p.textDecoration}}else if(i.type==="image"){const p=this.host.resolveSrc(i.imageSrcRaw),m=p?this.host.getImage(p):void 0;f.image=m??(p?{src:p,naturalWidth:0,naturalHeight:0}:void 0),i.sourceRect&&(f.sourceRect=i.sourceRect)}else if(i.editable){f.value=i.value;const p=this.padding(i.id);(p[0]||p[1]||p[2]||p[3])&&(f.padding=p);const m=ae(g);f.style={...i.style,color:m.color,fontSize:m.fontSize,fontFamily:m.fontFamily,fontWeight:m.fontWeight,fontStyle:m.fontStyle,lineHeight:m.lineHeight,letterSpacing:m.letterSpacing,textAlign:m.textAlign,textDecoration:m.textDecoration}}else if(i.type==="native"){const p=i.viewName??"";f.view={name:p,label:this.placeholders.get(p)}}i.type==="widget"&&i.style.overlayColor!==void 0&&(f.overlay=i.style.overlayColor),i.interactive&&(f.state={pressed:this.pressed.has(i.id)}),i.editable&&this.focused===i&&(f.state={...f.state,focused:!0}),i.style.overflow==="hidden"&&(f.clip=!0);let y=l,x=h;if(i.scrollable){const p=i.scrollAxis,m=p==="x"?s._getContentWidth(i.id):s._getContentHeight(i.id);f.clip=!0,f.scroll={offset:i.scrollOffset,content:m,axis:p},p==="x"?y=l-i.scrollOffset:x=h-i.scrollOffset}if(i.type==="pager"){const p=s._creatorWebPagerSelectedIndex(i.id),m=s._creatorWebPagerStackLen(i.id,p),E=m>0?s._creatorWebPagerPageNode(i.id,p,m-1):0,k=E?this.nodes.get(E):void 0;k?this.pagerShown.set(i.id,k):this.pagerShown.delete(i.id);const L=this.pagerLeaving.get(i.id);for(const O of L&&L.page!==k?L.above?[k,L.page]:[L.page,k]:[k]){const C=O?r(O,l,h,!1):null;C&&f.children.push(C)}return f}if(i.type==="vlist"){for(const p of i.children){const m=s._getParentNode(p.id);if(!m)continue;const E=s._vlistItemOffsetOf(i.id,m);if(Number.isNaN(E))continue;const k=r(p,l,h+E-i.scrollOffset,!1);k&&f.children.push(k)}return f}for(const p of i.children){const m=r(p,y,x,!1);m&&f.children.push(m)}return f};return r(t,0,0,!0)}paddingOf(t){return this.padding(t)}padding(t){const e=this.M;this.padPtr||(this.padPtr=e._malloc(16)),e._getPaddingPointer(t,this.padPtr);const s=this.padPtr>>2;return[e.HEAPF32[s],e.HEAPF32[s+1],e.HEAPF32[s+2],e.HEAPF32[s+3]]}withStr(t,e){const s=this.M.stringToNewUTF8(t);try{return e(s)}finally{this.M._free(s)}}get(t){return this.nodes.get(t)}findAll(t){const e=[],s=r=>{r.name===t&&e.push(r);for(const i of r.children)s(i)};for(const r of this.frame())s(r.tree);return e}findRect(t){const e=s=>{if(s.id===t)return s.rect;for(const r of s.children){const i=e(r);if(i)return i}return null};for(const s of this.frame()){const r=e(s.tree);if(r)return r}return null}toast(){return this.lastToast}pendingFonts(){return this.fontsPending}keyboardHeight(){return this.focused?this.options.keyboardHeight?this.options.keyboardHeight():Math.round(this.height*Us):0}focusedId(){var t;return((t=this.focused)==null?void 0:t.id)??0}nodeFactory(t,e,s,r){this.lastCreated=t;const i=new Hs(t,e);this.nodes.set(t,i),e==="vlist"&&this.vlists.add(i);const o=this.nodes.get(s);o&&this.link(o,i,Math.max(0,r)),this.dirty=!0}link(t,e,s){e.parent&&(e.parent.children=e.parent.children.filter(r=>r!==e)),e.parent=t,t.children.splice(Math.min(s,t.children.length),0,e)}insertNode(t,e,s){const r=this.nodes.get(t),i=this.nodes.get(e);r&&i&&this.link(r,i,s),this.dirty=!0}removeNode(t,e){var i;const s=this.nodes.get(t),r=this.nodes.get(e);!s||!r||(this.forget(r),s.children=s.children.filter(o=>o!==r),r.parent===s&&(r.parent=null),((i=this.pagerLeaving.get(t))==null?void 0:i.page)===r&&this.pagerLeaving.delete(t),this.pagerShown.get(t)===r&&this.pagerShown.delete(t),this.dirty=!0)}releaseNode(t){const e=this.nodes.get(t);if(!e)return;this.nodes.delete(t),this.forget(e),e.parent&&(e.parent.children=e.parent.children.filter(r=>r!==e)),this.root===e&&(this.root=null),this.leaving===e&&(this.leaving=null),this.pagerShown.delete(t),this.pagerLeaving.delete(t);for(const[r,i]of this.pagerLeaving)i.page===e&&this.pagerLeaving.delete(r);this.focused===e&&(this.focused=null,this.shrinkTo(0,0),this.emitKeyboard());const s=this.layerRoots.indexOf(e);s>=0&&this.layerRoots.splice(s,1),this.vlists.delete(e),this.pressed.delete(t),e.type==="native"&&e.viewId&&this.viewNames.delete(e.viewId),this.dirty=!0}forget(t){for(const e of this.gestures.values())e.node===t&&(e.node=null),e.scroll===t&&(e.scroll=null),e.backdrop===t&&(e.backdrop=null),e.edit===t&&(e.edit=null);for(const e of t.children)this.forget(e)}setPropertyString(t,e,s){const r=this.nodes.get(t);if(!r)return;const i=s??"";switch(e){case"text":r.text=i,r.wrapCache=void 0;break;case"value":r.value=i;break;case"name":r.name=i||void 0;break;case"src":{r.src=i||void 0;const o=this.host.resolveSrc(this.srcOf(r));o&&!this.host.getImage(o)&&this.host.loadImage(o).then(()=>{this.nodes.get(t)===r&&this.M._nodeHasMeasure(t)&&this.M._markNodeDirty(t),this.dirty=!0}).catch(()=>{});break}case"sourceRect":{const o=i.split(" ").map(Number);r.sourceRect=o.length===4?[o[0],o[1],o[2],o[3]]:void 0;break}case"focus":i==="1"||i==="true"?this.focusInput(t):this.focused===r&&this.blurInput();break;case"viewName":r.viewName=i;break;case"viewParams":r.viewParams=i;break}this.dirty=!0}srcOf(t){return he(t.src)}resolveBackground(t){const e=t.style.backgroundImage||void 0;if(e!==t.bgRaw){t.bgRaw=e,t.bgSrc=e?this.host.resolveSrc(he(e)):void 0;const s=t.bgSrc;s&&!this.host.getImage(s)&&this.host.loadImage(s).then(()=>{this.dirty=!0}).catch(()=>{})}t.style.backgroundImage=t.bgSrc}setPropertyInt(t,e,s){const r=this.nodes.get(t);r&&(e==="playerId"?r.playerId=s:e==="viewId"&&(r.viewId=s,r.viewName!==void 0&&this.viewNames.set(s,r.viewName))),this.dirty=!0}setFlags(t,e){const s=this.nodes.get(t);s&&(s.flags=e>>>0)}leave(t){this.root&&(this.leaving=this.root,this.leavingAbove=t,this.root=null)}openView(t,e,s,r,i,o){var c;this.destKind=t;const a=t===Pe?this.nodes.get(e)??null:null;if(a!==this.root&&this.leave(!o||a===null),this.leaving===a&&(this.leaving=null),this.root=a,t===ut){this.viewNames.set(s,r);let l;for(const h of this.nodes.values())if(h.type==="native"&&h.viewId===s){l=h.name;break}this.nativeDest=this.placeholders.has(r)?{id:s,view:r,name:l}:null}this.focused&&this.blurInput(),this.dirty=!0,(c=this.onDestination)==null||c.call(this,t,s)}dropView(t,e,s){var r,i;if(t===Pe){const o=this.nodes.get(e)??null;o!==null&&this.leaving===o&&(this.leaving=null),o!==null&&this.root===o&&(this.root=null)}t===ut&&((r=this.nativeDest)==null?void 0:r.id)===s&&this.destKind!==ut&&(this.nativeDest=null),this.dirty=!0,(i=this.onDropped)==null||i.call(this,t,s)}closeView(){var t;this.destKind=-1,this.leave(!0),this.dirty=!0,(t=this.onDestination)==null||t.call(this,-1,0)}isViewSupported(t){return this.placeholders.has(t)}viewVersion(t){return this.placeholders.has(t)?1:0}viewCall(t,e,s,r,i){const o=this.viewNames.get(t);i(o!==void 0&&this.placeholders.has(o)?`headless draws native views only: ${o}.${e}`:"NativeView calls are not supported on this host")}layerOpen(t){const e=this.nodes.get(t);e&&!this.layerRoots.includes(e)&&this.layerRoots.push(e),this.dirty=!0}layerClose(t){const e=this.nodes.get(t);for(const r of this.gestures.values())r.backdrop===e&&(r.backdrop=null);const s=e?this.layerRoots.indexOf(e):-1;s>=0&&this.layerRoots.splice(s,1),this.dirty=!0}registerFont(t,e,s,r,i,o){this.fontsPending++,this.host.loadFont(e,t,{weight:s,style:r===2?"italic":"normal"}).then(()=>{this.invalidateText(),i()},a=>o(String(a))).finally(()=>{this.fontsPending--})}invalidateText(){for(const t of this.nodes.values())t.wrapCache=void 0,t.measured&&t.type!=="image"&&this.M._nodeHasMeasure(t.id)&&this.M._markNodeDirty(t.id);this.dirty=!0}showToast(t,e){var s,r;this.lastToast=t,(r=(s=this.options).onToast)==null||r.call(s,t,e)}getButtonPressed(t){return this.pressed.has(t)}getTextValue(t){var e;return((e=this.nodes.get(t))==null?void 0:e.value)??""}getBoundingRect(t){const e=this.findRect(t);return e?[e.x,e.y,e.width,e.height]:null}longPressHandler(t,e){const s=this.gestures.get(t);s&&(s.swallowClick=!0)}vlistScroll(t,e,s){const r=this.nodes.get(t);r&&(r.scrollOffset=e),this.dirty=!0}pagerCommand(t,e,s){this.pagerLeaving.delete(t),this.dirty=!0}pagerShowPage(t,e,s){const r=this.nodes.get(e),i=this.pagerShown.get(t);r&&this.pagerShown.set(t,r),i&&i!==r&&this.pagerLeaving.set(t,{page:i,above:!s}),this.dirty=!0}pagerDropPage(t,e){var s;((s=this.pagerLeaving.get(t))==null?void 0:s.page.id)===e&&this.pagerLeaving.delete(t),this.dirty=!0}refreshDone(t){}rootOf(t){let e=t;for(;e.parent&&e.type!=="widget";)e=e.parent;return e}emitKeyboard(){var s,r;const t=this.keyboardHeight(),e=this.keyboardDuration();(r=(s=this.options).onKeyboard)==null||r.call(s,t,e),this.M._creatorWebKeyboardEvent(t,e)}shrinkTo(t,e){this.M._creatorWebSetShrunkRoot(t,e);const s=e>0?t:0;s!==this.shrunkRoot&&(this.shrunkRoot&&this.nodes.has(this.shrunkRoot)&&this.M._overrideRootSafeBottom(this.shrunkRoot,this.safeBottom),this.shrunkRoot=s,this.shrunkInset=this.safeBottom);const r=Math.max(0,this.safeBottom-e);s&&r!==this.shrunkInset&&this.nodes.has(s)&&(this.M._overrideRootSafeBottom(s,r),this.shrunkInset=r)}keyboardDuration(){return 0}refreshKeyboard(){this.focused&&(this.shrinkTo(this.rootOf(this.focused).id,this.keyboardHeight()),this.emitKeyboard(),this.dirty=!0)}focusInput(t){const e=this.nodes.get(t);!e||!e.editable||this.focused===e||(this.focused&&this.blurInput(),this.focused=e,this.M._setNodeFocused(t,1),e.has(Qr)&&this.M._creatorWebNodeEvent(t,Hr),this.shrinkTo(this.rootOf(e).id,this.keyboardHeight()),this.emitKeyboard(),this.dirty=!0)}blurInput(){const t=this.focused;t&&(this.focused=null,this.M._setNodeFocused(t.id,0),t.has(Zr)&&this.M._creatorWebNodeEvent(t.id,$r),this.shrinkTo(0,0),this.emitKeyboard(),this.dirty=!0)}setInputValue(t,e){const s=this.nodes.get(t);s&&(s.value=e,s.has(Jr)&&this.withStr(e,r=>this.M._creatorWebNodeEventStr(t,Wr,r)),this.M._nodeHasMeasure(t)&&this.M._markNodeDirty(t),this.dirty=!0)}submitInput(){const t=this.focused;return t?(t.has(ts)&&this.withStr(t.value,e=>this.M._creatorWebNodeEventStr(t.id,Vr,e)),this.focused===t&&this.blurInput(),!0):!1}scrollMax(t){const e=this.findRect(t.id)??t.layoutRect??{width:0,height:0},s=t.scrollAxis==="x"?e.width:e.height,r=t.scrollAxis==="x"?this.M._getContentWidth(t.id):this.M._getContentHeight(t.id);return Math.max(0,r-s)}scrollBy(t,e){const s=this.nodes.get(t);if(!s||!s.scrollable)return!1;const r=this.scrollMax(s),i=s.scrollOffset+e,o=Math.min(r,Math.max(0,i)),a=i<0?i:i>r?i-r:0;return a!==0&&s.has(Yr)&&this.M._creatorWebNodeEventNum(t,Br,a),o===s.scrollOffset?!1:(s.scrollOffset=o,s.type==="vlist"&&this.M._vlistExists(t)&&this.M._vlistOnScroll(t,o),s.has(Xr)&&this.M._creatorWebNodeScroll(t,o),this.dirty=!0,!0)}topInteractive(t,e){const s=this.frame();for(let r=s.length-1;r>=0;r--){const i=bt(s[r].tree,t,e,o=>{var a;return((a=this.nodes.get(o.id))==null?void 0:a.interactive)??!1});if(i.node)return this.nodes.get(i.node.id)??null;if(i.blocker)return null}return null}pressedByOther(t,e){for(const s of this.gestures.values())if(s!==t&&s.node===e&&!s.scrolling)return!0;return!1}setPressed(t,e){e?this.pressed.add(t.id):this.pressed.delete(t.id),this.nodes.get(t.id)===t&&this.M._setNodePressed(t.id,e?1:0),this.dirty=!0}pointerHover(t,e){this.hoverX=t,this.hoverY=e,this.hoverInside=!0,this.hoverMoved=!0}pointerLeave(){this.hoverInside&&(this.hoverInside=!1,this.hoverMoved=!0)}get hasHover(){return typeof this.M._creatorWebHover=="function"}tickHover(){if(!this.hasHover||!this.hoverMoved&&!this.dirty)return;this.hoverMoved=!1;const t=this.hoverInside?this.topInteractive(this.hoverX,this.hoverY):null;this.M._creatorWebHover((t==null?void 0:t.id)??0,this.hoverX,this.hoverY)}pointerDown(t,e,s){const r=this.M;r._creatorWeb2dSceneOpen()&&r._creatorWeb2dEmitPointer(0,t,e,s);const i={node:null,scroll:null,backdrop:null,edit:null,global:!1,dismiss:!0,lastX:e,lastY:s,acc:0,scrolling:!1,swallowClick:!1,secondary:!1,hold:!1};this.gestures.set(t,i);const o=this.frame();for(let a=o.length-1;a>=0;a--){const c=bt(o[a].tree,e,s,l=>{var h;return((h=this.nodes.get(l.id))==null?void 0:h.editable)??!1});if(c.node){const l=this.nodes.get(c.node.id);this.focusInput(l.id),i.edit=l,i.dismiss=!1;return}if(c.blocker)break}for(let a=o.length-1;a>=0;a--){const c=o[a],l=bt(c.tree,e,s,d=>{var f;return((f=this.nodes.get(d.id))==null?void 0:f.interactive)??!1}),h=bt(c.tree,e,s,d=>!!d.scroll&&d.scroll.content>(d.scroll.axis==="x"?d.rect.width:d.rect.height)+.5),u=h.node?this.nodes.get(h.node.id)??null:null;if(l.node){const d=this.nodes.get(l.node.id);if(i.node=d,i.scroll=u,i.dismiss=d.type!=="button",i.secondary=this.pressedByOther(i,d),i.secondary)for(const f of this.gestures.values())f.node===d&&(f.hold=!1);else i.hold=!0;this.setPressed(d,!0),r._creatorWebNodeTouchStart(d.id,t,e,s);return}if(u){i.scroll=u;return}if(l.blocker){i.backdrop=l.outside?this.nodes.get(l.blocker.id)??null:null;return}}i.global=!0,r._creatorWebSceneTouchStart(t,e,s)}pointerMove(t,e,s){const r=this.gestures.get(t);if(!r)return;const i=this.M;i._creatorWeb2dSceneOpen()&&i._creatorWeb2dEmitPointer(1,t,e,s);const o=e-r.lastX,a=s-r.lastY;if(r.lastX=e,r.lastY=s,r.acc+=Math.abs(o)+Math.abs(a),r.acc>Ds&&(r.hold=!1),!r.edit){if(!r.scrolling&&r.scroll&&r.acc>Bs&&(r.scrolling=!0,r.hold=!1,r.node&&!this.pressedByOther(r,r.node)&&this.setPressed(r.node,!1)),r.scrolling&&r.scroll){this.scrollBy(r.scroll.id,r.scroll.scrollAxis==="x"?-o:-a);return}i._creatorWebTouchMove(t,e,s,o,a)}}pointerUp(t,e,s){const r=this.gestures.get(t);if(!r)return;this.gestures.delete(t);const i=this.M;i._creatorWeb2dSceneOpen()&&i._creatorWeb2dEmitPointer(2,t,e,s);const o=e-r.lastX,a=s-r.lastY;i._creatorWebTouchEnd(t,e,s,o,a),!r.edit&&(r.scrolling&&r.scroll&&r.scroll.has(qr)&&i._creatorWebNodeEvent(r.scroll.id,Dr),r.dismiss&&!r.scrolling&&this.focused&&this.blurInput(),r.node?(this.pressedByOther(r,r.node)||this.setPressed(r.node,!1),!r.scrolling&&!r.swallowClick&&!r.secondary&&this.topInteractive(e,s)===r.node&&r.node.has(zr)&&i._creatorWebNodeClick(r.node.id,t,e,s)):r.backdrop?!r.scrolling&&r.backdrop.has(es)&&i._creatorWebNodeEvent(r.backdrop.id,Gr):r.global&&(r.scrolling||i._creatorWebSceneTouchClick(t,e,s)))}pointerCancel(t){const e=this.gestures.get(t);if(!e)return;this.gestures.delete(t);const s=this.M;s._creatorWeb2dSceneOpen()&&s._creatorWeb2dEmitPointer(3,t,e.lastX,e.lastY),e.node&&!this.pressedByOther(e,e.node)&&this.setPressed(e.node,!1),s._creatorWebTouchCancel(t)}wheel(t,e,s,r){const i=this.frame();for(let o=i.length-1;o>=0;o--){const a=bt(i[o].tree,t,e,c=>!!c.scroll&&c.scroll.content>(c.scroll.axis==="x"?c.rect.width:c.rect.height)+.5);if(a.node){const c=this.nodes.get(a.node.id);return c?this.scrollBy(c.id,c.scrollAxis==="x"?s:r):!1}if(a.blocker)return!1}return!1}longPress(t,e,s){const r=this.gestures.get(t);!(r!=null&&r.node)||!r.hold||(r.hold=!1,r.node.has(Kr)&&this.M._creatorWebNodeLongPress(r.node.id,t,e,s))}isVlist(t){return this.vlists.has(t)}}const Vs=`
11
11
  .lc-field { position: absolute; left: 0; top: 0; margin: 0; border: none; outline: none; background: none; resize: none; box-sizing: border-box; transform-origin: 0 0; pointer-events: auto; overflow: hidden; -webkit-appearance: none; appearance: none; }
12
12
  .lc-field::placeholder { color: var(--lc-placeholder, #999); opacity: 1; }
13
- `,Ne=(n,t)=>n===void 0?t:"#"+(n>>>0).toString(16).padStart(8,"0"),Gs=n=>n.type==="native"||n.type==="video",js=[1,0,0,1,0,0],zt=(n,t)=>[n[0]*t[0]+n[2]*t[1],n[1]*t[0]+n[3]*t[1],n[0]*t[2]+n[2]*t[3],n[1]*t[2]+n[3]*t[3],n[0]*t[4]+n[2]*t[5]+n[4],n[1]*t[4]+n[3]*t[5]+n[5]],zs=(n,t)=>{if(!n)return t;const e=Math.max(n.x,t.x),s=Math.max(n.y,t.y);return{x:e,y:s,width:Math.max(0,Math.min(n.x+n.width,t.x+t.width)-e),height:Math.max(0,Math.min(n.y+n.height,t.y+t.height)-s)}};class Nt extends $s{constructor(e,s,r,i,o={}){super(e,s,o);b(this,"doc");b(this,"factories",new Map);b(this,"versions",new Map);b(this,"views",new Map);b(this,"wrappers",new Map);b(this,"shown",new Map);b(this,"destination",null);b(this,"field",null);b(this,"placedFor",null);b(this,"band",{root:0,height:0});b(this,"slide",null);this.under=r,this.over=i,this.doc=r.ownerDocument;const a=this.doc.createElement("style");a.textContent=Vs,i.appendChild(a)}paintOptions(){var e;return{surfaces:!0,editing:(e=this.field)==null?void 0:e.id}}registerView(e,s,r=1){this.factories.set(e,s),this.versions.set(e,r)}unregisterView(e){this.factories.delete(e),this.versions.delete(e)}isViewSupported(e){return this.factories.has(e)}viewVersion(e){return this.versions.get(e)??0}ensureView(e,s,r){const i=this.views.get(e);if(i&&(i.name!==s||i.params!==r))this.destroyView(e);else if(i)return i.handle;const o=this.factories.get(s);if(!o)return null;let a={};try{a=r?JSON.parse(r):{}}catch{}const c=o(a,{emit:(l,h)=>this.M.jsb.viewEvent(e,l,h)},this.doc);return c.el.style.cssText+=";position:absolute;inset:0;width:100%;height:100%;",this.views.set(e,{name:s,params:r,handle:c}),c}destroyView(e){var r,i;const s=this.views.get(e);s&&(this.views.delete(e),(i=(r=s.handle).destroy)==null||i.call(r),s.handle.el.remove())}viewCall(e,s,r,i,o){const a=this.views.get(e);if(!(a!=null&&a.handle.call)){o(`NativeView call "${s}": no live instance or no call handler (viewId ${e})`);return}try{Promise.resolve(a.handle.call(s,Array.isArray(r)?r:[])).then(c=>{c===void 0?i():i(c)},c=>o(c instanceof Error?c.message:String(c)))}catch(c){o(c instanceof Error?c.message:String(c))}}openView(e,s,r,i,o,a){if(super.openView(e,s,r,i,o,a),e!==ut)return;this.dropDestination();const c=this.ensureView(r,i,o);if(!c)return;const l=this.doc.createElement("div");l.style.cssText="position:absolute;inset:0;pointer-events:auto;",l.appendChild(c.el),this.under.prepend(l),this.destination={viewId:r,el:l}}dropView(e,s,r){var i;super.dropView(e,s,r),e===ut&&((i=this.destination)==null?void 0:i.viewId)===r&&this.destKind!==ut&&this.dropDestination()}dropDestination(){var e;(e=this.destination)==null||e.el.remove(),this.destination=null}releaseNode(e){var r,i;const s=this.get(e);((r=this.field)==null?void 0:r.id)===e&&this.unmountField(),super.releaseNode(e),(i=this.shown.get(e))==null||i.remove(),this.shown.delete(e),this.wrappers.delete(e),(s==null?void 0:s.type)==="native"&&s.viewId&&this.destroyView(s.viewId)}keyboardDuration(){return we}shrinkTo(e,s){const r=this.doc.defaultView;if(!r){super.shrinkTo(e,s);return}this.slide&&(r.cancelAnimationFrame(this.slide.raf),this.slide=null);const i=s>0?e:this.band.root,o=this.band.height;if(o===s||i===0||!this.nodes.has(i)){this.setBand(i,s);return}const a=r.performance.now(),c=()=>{const l=Math.min(1,(r.performance.now()-a)/we),h=Gn(l);this.setBand(i,l<1?Math.round(o+(s-o)*h):s),l<1?this.slide={root:i,from:o,to:s,start:a,raf:r.requestAnimationFrame(c)}:this.slide=null};this.slide={root:i,from:o,to:s,start:a,raf:r.requestAnimationFrame(c)}}setBand(e,s){this.band=s>0?{root:e,height:s}:{root:0,height:0},super.shrinkTo(this.band.root,this.band.height),this.dirty=!0}focusInput(e){var i;if(super.focusInput(e),this.focusedId()!==e||((i=this.field)==null?void 0:i.id)===e)return;this.unmountField();const s=this.get(e);if(!s)return;const r=this.doc.createElement(s.type==="textarea"?"textarea":"input");r.className="lc-field",r.setAttribute("autocomplete","off"),r.value=s.value,r.addEventListener("input",()=>{this.focusedId()===e&&this.setInputValue(e,r.value)}),r.addEventListener("keydown",o=>{o.key==="Enter"&&r.tagName==="INPUT"&&(o.preventDefault(),this.submitInput())}),r.addEventListener("blur",()=>{var o;((o=this.field)==null?void 0:o.el)===r&&this.focusedId()===e&&this.blurInput()}),this.over.appendChild(r),this.field={id:e,el:r},this.placedFor=null,this.place(),r.focus({preventScroll:!0})}blurInput(){super.blurInput(),this.unmountField()}unmountField(){const e=this.field;e&&(this.field=null,e.el.remove(),this.placedFor=null)}setPropertyString(e,s,r){var i,o;if(super.setPropertyString(e,s,r),s==="value"&&((i=this.field)==null?void 0:i.id)===e){const a=((o=this.get(e))==null?void 0:o.value)??"";this.field.el.value!==a&&(this.field.el.value=a)}}find(){var i;const e=[],s=(i=this.field)==null?void 0:i.id,r=(o,a,c)=>{let l=a;const h=o.style.transform;if(h){const d=o.style.transformOrigin,f=o.rect.x+(d?d.xPercent?o.rect.width*d.x/100:d.x:o.rect.width/2),g=o.rect.y+(d?d.yPercent?o.rect.height*d.y/100:d.y:o.rect.height/2),y=En(h,o.style.transformBox,o.rect.width,o.rect.height);l=zt(zt(zt(a,[1,0,0,1,f,g]),y),[1,0,0,1,-f,-g])}(Gs(o)||o.id===s)&&e.push({node:o,matrix:l,clip:c});const u=o.clip?zs(c,o.rect):c;for(const d of o.children)r(d,l,u)};for(const o of this.frame())r(o.tree,js,null);return e}static put(e,s){const{rect:r}=s.node,i=e.style;i.position="absolute",i.left="0",i.top="0",i.width=r.width+"px",i.height=r.height+"px",i.transformOrigin="0 0",i.transform=`matrix(${s.matrix.join(",")}) translate(${r.x}px,${r.y}px)`;const o=s.clip;i.clipPath=o?`inset(${Math.max(0,o.y-r.y)}px ${Math.max(0,r.x+r.width-(o.x+o.width))}px ${Math.max(0,r.y+r.height-(o.y+o.height))}px ${Math.max(0,o.x-r.x)}px)`:""}surfaceElement(e){const s=this.get(e.id);if(!s)return null;if(s.type==="video"){const o=ge(s.playerId);return o instanceof HTMLVideoElement?o:null}if(!s.viewId)return null;const r=this.ensureView(s.viewId,s.viewName??"",s.viewParams??"");if(!r)return null;let i=this.wrappers.get(s.id);return i||(i=this.doc.createElement("div"),this.wrappers.set(s.id,i)),r.el.parentElement!==i&&i.replaceChildren(r.el),i}styleField(e,s){var u,d;const r=s.style,i=e.style,[o,a,c,l]=s.padding??[0,0,0,0];i.padding=`${a}px ${c}px ${l}px ${o}px`,i.color=Ne(r.color,"#000000ff"),i.caretColor=i.color;const h=r.fontFamily??"Roboto";if(i.fontFamily=((d=(u=this.host).resolveFontFamily)==null?void 0:d.call(u,h))??h,i.fontSize=(r.fontSize??14)+"px",i.fontWeight=String(r.fontWeight??400),i.fontStyle=r.fontStyle??"normal",i.letterSpacing=(r.letterSpacing??0)+"px",i.lineHeight=e.tagName==="TEXTAREA"&&r.lineHeight!==void 0?r.lineHeight+"px":"normal",i.textAlign=r.textAlign==="center"?"center":r.textAlign==="end"?"right":"left",i.borderRadius="0",e.placeholder=r.placeholder??"",i.setProperty("--lc-placeholder",Ne(r.placeholderColor,"#999999ff")),e instanceof HTMLInputElement){const f=r.inputType??"text";e.type!==f&&(e.type=f)}}place(){var r;const e=this.frame();if(e===this.placedFor)return;this.placedFor=e;const s=new Set;for(const i of this.find()){const{node:o}=i;if(o.id===((r=this.field)==null?void 0:r.id)){this.styleField(this.field.el,o),Nt.put(this.field.el,i);continue}const a=this.surfaceElement(o);a&&(s.add(o.id),a.parentElement!==this.under&&this.under.appendChild(a),a.style.display="block",a.style.opacity="",a.style.pointerEvents="auto",a instanceof HTMLVideoElement&&(a.style.objectFit=o.style.objectFit??"contain"),Nt.put(a,i),this.shown.set(o.id,a))}for(const[i,o]of this.shown)s.has(i)||(o.style.display="none",this.shown.delete(i))}surfaceAt(e,s){const r=this.frame();for(let i=r.length-1;i>=0;i--){const o=r[i];if(o.leaving)continue;const a=bt(o.tree,e,s,c=>{var l,h;return c.type==="native"||(((l=this.get(c.id))==null?void 0:l.interactive)??!1)||(((h=this.get(c.id))==null?void 0:h.editable)??!1)||!!c.scroll});if(a.node)return a.node.type==="native";if(a.blocker)return!1}return this.destination!==null}dispose(){this.unmountField();for(const e of[...this.views.keys()])this.destroyView(e);this.dropDestination();for(const e of this.shown.values())e instanceof HTMLVideoElement||e.remove();this.shown.clear()}}function Ks(n,t,e,s){const r=n.createElement("div");r.textContent=e,r.style.cssText="position:absolute;left:50%;bottom:48px;transform:translateX(-50%);max-width:80%;padding:10px 16px;border-radius:8px;background:rgba(30,30,30,0.92);color:#fff;font:13px/1.4 system-ui,sans-serif;z-index:30;pointer-events:none;",t.appendChild(r),setTimeout(()=>r.remove(),s>0?s:2e3)}const Xs=500,Ue=["mousedown","mouseup","click","dblclick","contextmenu","touchstart","touchmove","touchend"],Ys=(n,t)=>{const e=n.ownerDocument,{canvas:s}=t;s.style.display="block",s.style.pointerEvents="none",n.style.touchAction="none";const r=s.getContext("2d"),i=()=>{const v=e.createElement("div");return v.style.cssText="position:absolute;left:0;top:0;width:100%;height:100%;overflow:hidden;pointer-events:none;",v},o=i(),a=i();n.insertBefore(o,s),s.after(a);const c=new Sr({resolveAssetUrl:v=>hn(v),canvasSurfaces:t.canvasHost}),l=new Nt(t.M,c,o,a,{keyboardHeight:t.keyboardHeight??(()=>0),onKeyboard:t.onKeyboard,onToast:(v,T)=>Ks(e,n,v,T)});let h=1,u=new Me(r,h),d=!0;const f=()=>{(d||l.needsPaint())&&(d=!1,l.paint(u,l.paintOptions())),l.place()};let g=1;const y=(v,T,I,z=1)=>{if(!(v<=0||T<=0)){I!==h&&(h=I,u=new Me(r,h)),g=z;for(const J of[o,a])Object.assign(J.style,{width:`${v}px`,height:`${T}px`,zoom:g===1?"":String(g)});d=!0,l.resize(v,T)}},x=v=>{l.setSafeArea([v.top,v.right,v.bottom,v.left],v.bars??[])},w=v=>{const T=n.getBoundingClientRect(),I=It(n)*g;return[(v.clientX-T.left)/I,(v.clientY-T.top)/I]},p=v=>v.target instanceof Node&&a.contains(v.target),m=v=>v.target instanceof Node&&o.contains(v.target),E=v=>{m(v)&&v.stopPropagation()},k=new Set,L=new Map,O=v=>{const T=L.get(v);T!==void 0&&(clearTimeout(T),L.delete(v))},C=v=>{if(p(v))return;const[T,I]=w(v);if(!l.surfaceAt(T,I)){E(v),k.add(v.pointerId);try{n.setPointerCapture(v.pointerId)}catch{}l.pointerDown(v.pointerId,T,I),O(v.pointerId),L.set(v.pointerId,window.setTimeout(()=>{L.delete(v.pointerId),l.longPress(v.pointerId,T,I)},Xs))}},F=v=>{const[T,I]=w(v);k.has(v.pointerId)&&(E(v),l.pointerMove(v.pointerId,T,I)),v.pointerType==="mouse"&&(p(v)||!k.has(v.pointerId)&&l.surfaceAt(T,I)?l.pointerLeave():l.pointerHover(T,I))},W=v=>{v.pointerType==="mouse"&&l.pointerLeave()},$=v=>{if(!k.delete(v.pointerId))return;E(v),O(v.pointerId);const[T,I]=w(v);l.pointerUp(v.pointerId,T,I)},j=v=>{k.delete(v.pointerId)&&(O(v.pointerId),l.pointerCancel(v.pointerId))},q=v=>{if(p(v))return;const[T,I]=w(v);if(l.surfaceAt(T,I))return;E(v);const z=v.deltaMode===1?16:v.deltaMode===2?l.height:1;l.wheel(T,I,v.deltaX*z,v.deltaY*z)&&v.preventDefault()},A=v=>{var J;if(p(v))return;const T="clientX"in v?v:(J=v.changedTouches)==null?void 0:J[0];if(!T)return;const[I,z]=w(T);l.surfaceAt(I,z)||(E(v),v.type==="mousedown"&&v.preventDefault())};n.addEventListener("pointerdown",C,!0),n.addEventListener("pointermove",F,!0),n.addEventListener("pointerleave",W),n.addEventListener("pointerup",$,!0),n.addEventListener("pointercancel",j,!0),n.addEventListener("wheel",q,{passive:!1,capture:!0});for(const v of Ue)n.addEventListener(v,A,!0);return{ui:l,render:f,resize:y,setSafeArea:x,destroy(){for(const v of L.keys())O(v);n.removeEventListener("pointerdown",C,!0),n.removeEventListener("pointermove",F,!0),n.removeEventListener("pointerleave",W),n.removeEventListener("pointerup",$,!0),n.removeEventListener("pointercancel",j,!0),n.removeEventListener("wheel",q,!0);for(const v of Ue)n.removeEventListener(v,A,!0);l.dispose(),o.remove(),a.remove()}}},qs=["miter","round","bevel"],Js=["butt","round","square"],Qs=["left","center","right","start","end"],Zs=["alphabetic","top","middle","bottom","hanging","ideographic"],Be=["nonzero","evenodd"],ti=["pad","reflect","repeat"],Kt={COLOR:0,RADIAL:2},St={MOVE:0,LINE:1,QUAD:2,CUBIC:3,CLOSE:4},X={SET_TRANSFORM:0,SAVE:1,RESTORE:2,CLIP:3,FILL_PATH:4,STROKE_PATH:5,FILL_TEXT:6,STROKE_TEXT:7,DRAW_IMAGE:8,CLEAR_RECT:9};class ei{constructor(t,e){b(this,"pos",0);this.w=t,this.strings=e}f(){if(this.pos>=this.w.length)throw new Error("draw list: truncated");return this.w[this.pos++]}i(){return this.f()|0}str(){const t=this.i();if(t<0||t>=this.strings.length)throw new Error(`draw list: bad string index ${t}`);return this.strings[t]}color(){return[this.f(),this.f(),this.f(),this.f()]}matrix(){return[this.f(),this.f(),this.f(),this.f(),this.f(),this.f()]}paint(){const t=this.i(),e=this.f();if(t===Kt.COLOR)return{kind:"color",alpha:e,color:this.color()};const s=this.matrix();let r=0,i=0,o=0;t===Kt.RADIAL&&(r=this.f(),i=this.f(),o=this.f());const a=ti[this.i()]??"pad",c=this.i(),l=[];for(let h=0;h<c;h++)l.push({offset:this.f(),color:this.color()});return t===Kt.RADIAL?{kind:"radial",alpha:e,matrix:s,fx:r,fy:i,r0:o,spread:a,stops:l}:{kind:"linear",alpha:e,matrix:s,spread:a,stops:l}}stroke(){const t=this.f(),e=qs[this.i()]??"miter",s=Js[this.i()]??"butt",r=this.f(),i=this.f(),o=this.i(),a=[];for(let c=0;c<o;c++)a.push(this.f());return{width:t,join:e,cap:s,miterLimit:r,dashOffset:i,dash:a}}font(){return{family:this.str(),size:this.f(),weight:this.i(),italic:this.i()!==0}}path(){const t=this.i(),e=this.pos+t;if(e>this.w.length)throw new Error("draw list: truncated path");const s=[];for(;this.pos<e;)switch(this.i()){case St.MOVE:s.push(["M",this.f(),this.f()]);break;case St.LINE:s.push(["L",this.f(),this.f()]);break;case St.QUAD:s.push(["Q",this.f(),this.f(),this.f(),this.f()]);break;case St.CUBIC:s.push(["C",this.f(),this.f(),this.f(),this.f(),this.f(),this.f()]);break;case St.CLOSE:s.push(["Z"]);break;default:throw new Error("draw list: bad path verb")}return s}rect4(){return[this.f(),this.f(),this.f(),this.f()]}}const ni=(n,t)=>{const e=new ei(n,t),s=[];for(;e.pos+2<=n.length;){const r=e.i(),i=e.i(),o=e.pos+i;if(i<0||o>n.length)throw new Error("draw list: truncated command");switch(r){case X.SET_TRANSFORM:s.push({cmd:"setTransform",matrix:e.matrix()});break;case X.SAVE:s.push({cmd:"save"});break;case X.RESTORE:s.push({cmd:"restore"});break;case X.CLIP:{const a=Be[e.i()]??"nonzero";s.push({cmd:"clip",rule:a,path:e.path()});break}case X.FILL_PATH:{const a=Be[e.i()]??"nonzero",c=e.paint();s.push({cmd:"fillPath",rule:a,paint:c,path:e.path()});break}case X.STROKE_PATH:{const a=e.stroke(),c=e.paint();s.push({cmd:"strokePath",stroke:a,paint:c,path:e.path()});break}case X.FILL_TEXT:case X.STROKE_TEXT:{const a=e.str(),c=e.f(),l=e.f(),h=e.f(),u=e.font(),d=Qs[e.i()]??"start",f=Zs[e.i()]??"alphabetic",g=e.f();if(r===X.STROKE_TEXT){const y=e.stroke();s.push({cmd:"strokeText",text:a,x:c,y:l,maxWidth:h,font:u,align:d,baseline:f,letterSpacing:g,stroke:y,paint:e.paint()})}else s.push({cmd:"fillText",text:a,x:c,y:l,maxWidth:h,font:u,align:d,baseline:f,letterSpacing:g,paint:e.paint()});break}case X.DRAW_IMAGE:{const a=e.i(),c=e.rect4(),l=e.rect4();s.push({cmd:"drawImage",surface:a,src:c,dst:l,alpha:e.f()});break}case X.CLEAR_RECT:s.push({cmd:"clearRect",rect:e.rect4()});break}if(e.pos!==o){if(e.pos>o)throw new Error(`draw list: command ${r} overran its length`);e.pos=o}}return s},ri=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","ui-serif","ui-sans-serif","ui-monospace","ui-rounded","emoji","math","fangsong"]),Tn=n=>`rgba(${Math.round(n[0]*255)}, ${Math.round(n[1]*255)}, ${Math.round(n[2]*255)}, ${n[3]})`,Rn=(n,t=n.family)=>{const e=ri.has(t)?t:`"${t.replace(/"/g,"'")}"`;return`${n.italic?"italic ":""}${n.weight} ${n.size}px ${e}`},Lt=(n,t,e)=>[n[0]*t+n[2]*e+n[4],n[1]*t+n[3]*e+n[5]],si=n=>Math.abs(n[0]-n[3])<1e-6&&Math.abs(n[1]+n[2])<1e-6,Xt=(n,t)=>{n.beginPath();for(const e of t)switch(e[0]){case"M":n.moveTo(e[1],e[2]);break;case"L":n.lineTo(e[1],e[2]);break;case"Q":n.quadraticCurveTo(e[1],e[2],e[3],e[4]);break;case"C":n.bezierCurveTo(e[1],e[2],e[3],e[4],e[5],e[6]);break;case"Z":n.closePath();break}},De=(n,t)=>{for(const e of t.stops)n.addColorStop(e.offset,Tn(e.color))},Pt=(n,t,e,s)=>{if(n.globalAlpha=t.alpha,t.kind==="color"){n[e==="fill"?"fillStyle":"strokeStyle"]=Tn(t.color),s();return}const r=t.matrix;if(si(r)){let o;if(t.kind==="linear"){const[a,c]=Lt(r,0,0),[l,h]=Lt(r,1,0);o=n.createLinearGradient(a,c,l,h)}else{const a=Math.hypot(r[0],r[1]),[c,l]=Lt(r,0,0),[h,u]=Lt(r,t.fx,t.fy);o=n.createRadialGradient(h,u,t.r0*a,c,l,a)}De(o,t),n[e==="fill"?"fillStyle":"strokeStyle"]=o,s();return}n.save(),n.transform(r[0],r[1],r[2],r[3],r[4],r[5]);const i=t.kind==="linear"?n.createLinearGradient(0,0,1,0):n.createRadialGradient(t.fx,t.fy,t.r0,0,0,1);De(i,t),n[e==="fill"?"fillStyle":"strokeStyle"]=i,s(),n.restore()},We=(n,t)=>{n.lineWidth=t.width,n.lineJoin=t.join,n.lineCap=t.cap,n.miterLimit=t.miterLimit,n.setLineDash(t.dash),n.lineDashOffset=t.dashOffset},He=(n,t,e)=>{n.font=Rn(t.font,e.fontFamily?e.fontFamily(t.font.family):t.font.family),n.textAlign=t.align,n.textBaseline=t.baseline,"letterSpacing"in n&&(n.letterSpacing=`${t.letterSpacing}px`)},ii=(n,t,e={})=>{var r;n.save();let s=0;try{n.setTransform(1,0,0,1,0,0),n.globalAlpha=1;for(const i of t)switch(i.cmd){case"setTransform":n.setTransform(i.matrix[0],i.matrix[1],i.matrix[2],i.matrix[3],i.matrix[4],i.matrix[5]);break;case"save":n.save(),s++;break;case"restore":s>0&&(n.restore(),s--);break;case"clip":Xt(n,i.path),n.clip(i.rule);break;case"fillPath":Xt(n,i.path),Pt(n,i.paint,"fill",()=>n.fill(i.rule));break;case"strokePath":Xt(n,i.path),We(n,i.stroke),Pt(n,i.paint,"stroke",()=>n.stroke());break;case"fillText":He(n,i,e),Pt(n,i.paint,"fill",()=>i.maxWidth>0?n.fillText(i.text,i.x,i.y,i.maxWidth):n.fillText(i.text,i.x,i.y));break;case"strokeText":He(n,i,e),We(n,i.stroke),Pt(n,i.paint,"stroke",()=>i.maxWidth>0?n.strokeText(i.text,i.x,i.y,i.maxWidth):n.strokeText(i.text,i.x,i.y));break;case"drawImage":{const o=(r=e.image)==null?void 0:r.call(e,i.surface);if(!o)break;n.globalAlpha=i.alpha,n.drawImage(o,i.src[0],i.src[1],i.src[2],i.src[3],i.dst[0],i.dst[1],i.dst[2],i.dst[3]);break}case"clearRect":n.clearRect(i.rect[0],i.rect[1],i.rect[2],i.rect[3]);break;default:{const o=i;throw new Error(`unhandled draw command ${o.cmd}`)}}}finally{for(;s>0;s--)n.restore();n.restore()}},oi=n=>{const t=typeof OffscreenCanvas<"u",e=new Map;let s=null;const r=(l,h,u)=>{if(!t)return null;let d=e.get(l);return d?(d.width!==h||d.height!==u)&&(d.width=h,d.height=u):(d=new OffscreenCanvas(h,u),e.set(l,d)),d},i={paint:(l,h,u,d,f,g)=>{const y=r(l,Math.max(1,h),Math.max(1,u)),x=y==null?void 0:y.getContext("2d");!y||!x||(x.setTransform(1,0,0,1,0,0),x.clearRect(0,0,y.width,y.height),ii(x,ni(f,g),{image:w=>e.get(w)??null,fontFamily:n}))},measureText:(l,h,u,d,f,g)=>{if(g[0]=0,g[1]=0,g[2]=0,!t||(s||(s=new OffscreenCanvas(1,1).getContext("2d")),!s))return;s.font=Rn({family:h,size:u,weight:d,italic:f},h);const y=s.measureText(l);g[0]=y.width,g[1]=y.fontBoundingBoxAscent??y.actualBoundingBoxAscent,g[2]=y.fontBoundingBoxDescent??y.actualBoundingBoxDescent},decodeImage:()=>!1,readPixels:(l,h)=>{const u=o(l);return u?(h[0]=u.width,h[1]=u.height,new Uint8Array(u.data.buffer,u.data.byteOffset,u.data.byteLength)):null},releaseSurface:l=>{e.delete(l)}},o=l=>{const h=e.get(l),u=h==null?void 0:h.getContext("2d");return!h||!u?null:{data:u.getImageData(0,0,h.width,h.height).data,width:h.width,height:h.height}};return{table:i,readSurface:o,getSurface:l=>{const h=e.get(l);return h?{canvas:h,width:h.width,height:h.height}:null},surfaceToDataUrl:l=>{var d;const h=e.get(l);if(!h||typeof document>"u")return null;const u=document.createElement("canvas");return u.width=h.width,u.height=h.height,(d=u.getContext("2d"))==null||d.drawImage(h,0,0),u.toDataURL()}}},ai=""+new URL("assets/Roboto-Variable-DHm9jpd-.woff2",import.meta.url).href,ci=(n,t="woff2")=>{const e=/^\/\/ fonts: (.+)$/m.exec(n);if(!e)return[];const s=[];for(const r of e[1].split(";")){const i=r.indexOf("=");if(i===-1)continue;const o=/^(.+)@(\d+)(i?)$/.exec(r.slice(0,i));o&&s.push({family:o[1],weight:parseInt(o[2],10),italic:o[3]==="i",url:r.slice(i+1).replace("{fmt}",t)})}return s},li=async(n,t,e=2e3)=>{const s=t??(typeof document>"u"?void 0:document);if(!(s!=null&&s.fonts)||n.length===0)return;const r=[];for(const i of n)try{const o=new FontFace(i.family,`url("${i.url}")`,{weight:String(i.weight),style:i.italic?"italic":"normal"});s.fonts.add(o),r.push(o.load().catch(()=>{}))}catch{}await Promise.race([Promise.all(r),new Promise(i=>setTimeout(i,e))])},An="Roboto",hi=[`400 14px ${An}`],$e="data-lecodes-fonts",ui=async(n=hi,t)=>{const e=t??(typeof document>"u"?void 0:document);if(!(!e||!e.fonts)){if(!e.head.querySelector(`style[${$e}]`)){const s=new URL(ai,document.baseURI).href,r=e.createElement("style");r.setAttribute($e,""),r.textContent=`@font-face{font-family:"${An}";src:url("${s}") format("woff2");font-weight:100 900;font-display:swap}`,e.head.appendChild(r)}try{await Promise.all(n.map(s=>e.fonts.load(s)))}catch{}}},Ve="2.8.1",Yt=n=>{const t=n==null?void 0:n.match(/^(\d+)\.\d+\.\d+/);return t?Number(t[1]):null},di=(n,t)=>Yt(n)!==null&&Yt(n)===Yt(t),fi=()=>({setMatrix(){},setVisible(){},setCameraMatrix(){},setProjection(){},clearProjection(){},setBackground(){},createExternalTexture:()=>null,onFrame:()=>()=>{},readPixels:(n,t)=>t(null,0,0),viewport:()=>({width:0,height:0,rotation:0})}),gi=n=>{var s,r;const t=((r=(s=n.screen)==null?void 0:s.orientation)==null?void 0:r.angle)??n.orientation??0;return(Math.round(t/90)%4+4)%4*90},pi=(n,t)=>({width:(n==null?void 0:n.clientWidth)??0,height:(n==null?void 0:n.clientHeight)??0,rotation:gi(t)}),mi=[1,0,0,0,1,0],yi=(n,t,e)=>{const s=t*4,r=new Uint8Array(s);for(let i=0,o=e-1;i<o;i++,o--)r.set(n.subarray(i*s,i*s+s)),n.copyWithin(i*s,o*s,o*s+s),n.set(r,o*s);return n},wi=[171,75,84,88,32,50,48,187,13,10,26,10],bi=n=>n.length>=12&&wi.every((t,e)=>n[e]===t),vi=(n,t)=>{const e={antialias:!1,depth:!0,alpha:!1,stencil:!1,desynchronized:!1,failIfMajorPerformanceCaveat:!1,powerPreference:"high-performance",premultipliedAlpha:!0,preserveDrawingBuffer:t},s=n.newCanvas(),r=s.getContext("webgl2",e);if(!r)throw new Error("WebGL2 is not available");let i=null,o=!1;const a=[],c=()=>{const u=r.createTexture();return r.bindTexture(r.TEXTURE_2D,u),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,r.NONE),u},l=u=>{var g;u._creatorWebSetViewport(s.width,s.height);const{width:d,height:f}=n.size();d>0&&f>0&&((g=u._setDensityGL)==null||g.call(u,s.width/d,s.height/f))},h=(u,d,f,g)=>{const y=u.GL.getNewId(u.GL.textures);return u.GL.textures[y]=d,u._importTexture(y,f,g)>>>0};return{canvas:s,context:r,options:e,table(u){return i=u,{engineCreated(){a.length=0,u._createSwapChainHeadless(s.width,s.height),l(u),o=!0},createGLView(){s.style.display="block"},closeScene(){s.style.display="none"},createTexture(d,f,g,y){const x=et(d);if(!x){y(`createTexture: no buffer behind id ${d}`);return}const w=new Uint8Array(x);if(bi(w)){const p=u._malloc(w.length);u.HEAPU8.set(w,p);const m=u._createTextureFromKtx2(p,w.length)>>>0;if(u._free(p),m===4294967295){y("KTX2 transcode failed");return}g(m,u._getTextureWidth(m),u._getTextureHeight(m));return}createImageBitmap(Ht(d)).then(p=>{const m=c();r.texStorage2D(r.TEXTURE_2D,1,f&1?r.RGBA8:r.SRGB8_ALPHA8,p.width,p.height),r.texSubImage2D(r.TEXTURE_2D,0,0,0,p.width,p.height,r.RGBA,r.UNSIGNED_BYTE,p),g(h(u,m,p.width,p.height),p.width,p.height)},p=>y(p instanceof Error?p.message:String(p)))},createMediaPlayerTexture(d){const f=ge(d);if(!f)return 0;const g=c(),y=h(u,g,0,0);return a.push({video:f,texture:g,id:y,lastTime:0}),y}}},show(){s.style.display="block"},hide(){s.style.display="none"},resize(){i&&o&&l(i)},frame(){for(const u of a)u.video.readyState<2||u.video.currentTime===u.lastTime||(u.lastTime=u.video.currentTime,r.bindTexture(r.TEXTURE_2D,u.texture),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,u.video))},videoTexture(u){const d=a.find(y=>y.video===u);if(d)return d.id;if(!i||!o)return;const f=c(),g=h(i,f,0,0);return a.push({video:u,texture:f,id:g,lastTime:0}),g},readPixels(){const u=r.drawingBufferWidth,d=r.drawingBufferHeight;if(!o||u===0||d===0)return null;const f=new Uint8Array(u*d*4),g=r.getParameter(r.READ_FRAMEBUFFER_BINDING);return r.bindFramebuffer(r.READ_FRAMEBUFFER,null),r.readPixels(0,0,u,d,r.RGBA,r.UNSIGNED_BYTE,f),r.bindFramebuffer(r.READ_FRAMEBUFFER,g),{rgba:yi(f,u,d),width:u,height:d}},destroy(){var u;a.length=0,(u=r.getExtension("WEBGL_lose_context"))==null||u.loseContext()}}},xi=n=>{const t={alpha:!1,depth:!0,stencil:!0,antialias:!1,premultipliedAlpha:!1,desynchronized:!1,powerPreference:"high-performance",failIfMajorPerformanceCaveat:!1},e=n.newCanvas(),s=e.getContext("webgl2",t);if(!s)throw new Error("WebGL2 is not available");let r=null,i=!1;const o=()=>{!r||!i||(r._c2dSetViewport(e.width,e.height),r._c2dSetDensity(n.size().factor))},a=()=>{r&&(r._creatorWeb2dEnsureInited(),i=!0,o(),e.style.display="block")},c=()=>{e.style.display="none"};return{canvas:e,context:s,options:t,table(l){return r=l,{open2DScene:a,close2DScene:c}},show:a,hide:c,resize:o,frame(l){r&&r._creatorWeb2dSceneOpen()&&r._creatorWeb2dRenderFrame(l)},destroy(){var l;(l=s.getExtension("WEBGL_lose_context"))==null||l.loseContext()}}},Ge=n=>{if(typeof n=="number"||typeof n=="bigint"||typeof WebAssembly<"u"&&n instanceof WebAssembly.RuntimeError)return!0;const t=n instanceof Error?n.stack??"":"";return/\bwasm\b|wasm-function|\.wasm/i.test(t)},je="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Mn={};for(let n=0;n<je.length;n++)Mn[je[n]]=n;const Ei=n=>{const t=[];let e=0,s=0;for(const r of n){const i=Mn[r];if(i===void 0)break;const o=i&32;if(s+=(i&31)<<e,o)e+=5;else{const a=s&1;s>>=1,t.push(a?-s:s),s=0,e=0}}return t};class Si{constructor(t){b(this,"sources");b(this,"lines");this.sources=t.sources,this.lines=[];let e=0,s=0,r=0;for(const i of t.mappings.split(";")){const o=[];let a=0;if(i)for(const c of i.split(",")){const l=Ei(c);l.length!==0&&(a+=l[0],l.length>=4&&(e+=l[1],s+=l[2],r+=l[3],o.push([a,e,s,r])))}this.lines.push(o)}}originalPositionFor(t,e){const s=this.lines[t-1];if(!s||s.length===0)return null;let r=null;for(const o of s)if(o[0]<=e)r=o;else break;r??(r=s[0]);const i=this.sources[r[1]];return i===void 0?null:{source:i,line:r[2]+1,column:r[3]}}}const _i=n=>{const t=n.match(/\/\/# lecodesMap=data:application\/json;(?:charset=[^;]+;)?base64,([A-Za-z0-9+/=]+)\s*$/);if(!t)return null;try{const e=typeof atob=="function"?atob(t[1]):Buffer.from(t[1],"base64").toString("utf8");return new Si(JSON.parse(e))}catch{return null}};let wt=null;const ki=()=>{if(wt!==null)return wt;try{new Function("throw new Error('chisel-calibrate')")()}catch(n){const e=(n.stack??"").match(/<anonymous>:(\d+):\d+/);return wt=e?parseInt(e[1],10)-1:2,wt}return wt=2,wt},qt=(n,t)=>{const e=(n instanceof Error?n.stack:"")??"",s=ki(),r=[];for(const i of e.split(`
13
+ `,Ne=(n,t)=>n===void 0?t:"#"+(n>>>0).toString(16).padStart(8,"0"),Gs=n=>n.type==="native"||n.type==="video",js=[1,0,0,1,0,0],zt=(n,t)=>[n[0]*t[0]+n[2]*t[1],n[1]*t[0]+n[3]*t[1],n[0]*t[2]+n[2]*t[3],n[1]*t[2]+n[3]*t[3],n[0]*t[4]+n[2]*t[5]+n[4],n[1]*t[4]+n[3]*t[5]+n[5]],zs=(n,t)=>{if(!n)return t;const e=Math.max(n.x,t.x),s=Math.max(n.y,t.y);return{x:e,y:s,width:Math.max(0,Math.min(n.x+n.width,t.x+t.width)-e),height:Math.max(0,Math.min(n.y+n.height,t.y+t.height)-s)}};class Nt extends $s{constructor(e,s,r,i,o={}){super(e,s,o);b(this,"doc");b(this,"factories",new Map);b(this,"versions",new Map);b(this,"views",new Map);b(this,"wrappers",new Map);b(this,"shown",new Map);b(this,"destination",null);b(this,"field",null);b(this,"placedFor",null);b(this,"band",{root:0,height:0});b(this,"slide",null);this.under=r,this.over=i,this.doc=r.ownerDocument;const a=this.doc.createElement("style");a.textContent=Vs,i.appendChild(a)}paintOptions(){var e;return{surfaces:!0,editing:(e=this.field)==null?void 0:e.id}}registerView(e,s,r=1){this.factories.set(e,s),this.versions.set(e,r)}unregisterView(e){this.factories.delete(e),this.versions.delete(e)}isViewSupported(e){return this.factories.has(e)}viewVersion(e){return this.versions.get(e)??0}ensureView(e,s,r){const i=this.views.get(e);if(i&&(i.name!==s||i.params!==r))this.destroyView(e);else if(i)return i.handle;const o=this.factories.get(s);if(!o)return null;let a={};try{a=r?JSON.parse(r):{}}catch{}const c=o(a,{emit:(l,h)=>this.M.jsb.viewEvent(e,l,h)},this.doc);return c.el.style.cssText+=";position:absolute;inset:0;width:100%;height:100%;",this.views.set(e,{name:s,params:r,handle:c}),c}destroyView(e){var r,i;const s=this.views.get(e);s&&(this.views.delete(e),(i=(r=s.handle).destroy)==null||i.call(r),s.handle.el.remove())}viewCall(e,s,r,i,o){const a=this.views.get(e);if(!(a!=null&&a.handle.call)){o(`NativeView call "${s}": no live instance or no call handler (viewId ${e})`);return}try{Promise.resolve(a.handle.call(s,Array.isArray(r)?r:[])).then(c=>{c===void 0?i():i(c)},c=>o(c instanceof Error?c.message:String(c)))}catch(c){o(c instanceof Error?c.message:String(c))}}openView(e,s,r,i,o,a){if(super.openView(e,s,r,i,o,a),e!==ut)return;this.dropDestination();const c=this.ensureView(r,i,o);if(!c)return;const l=this.doc.createElement("div");l.style.cssText="position:absolute;inset:0;pointer-events:auto;",l.appendChild(c.el),this.under.prepend(l),this.destination={viewId:r,el:l}}dropView(e,s,r){var i;super.dropView(e,s,r),e===ut&&((i=this.destination)==null?void 0:i.viewId)===r&&this.destKind!==ut&&this.dropDestination()}dropDestination(){var e;(e=this.destination)==null||e.el.remove(),this.destination=null}releaseNode(e){var r,i;const s=this.get(e);((r=this.field)==null?void 0:r.id)===e&&this.unmountField(),super.releaseNode(e),(i=this.shown.get(e))==null||i.remove(),this.shown.delete(e),this.wrappers.delete(e),(s==null?void 0:s.type)==="native"&&s.viewId&&this.destroyView(s.viewId)}keyboardDuration(){return we}shrinkTo(e,s){const r=this.doc.defaultView;if(!r){super.shrinkTo(e,s);return}this.slide&&(r.cancelAnimationFrame(this.slide.raf),this.slide=null);const i=s>0?e:this.band.root,o=this.band.height;if(o===s||i===0||!this.nodes.has(i)){this.setBand(i,s);return}const a=r.performance.now(),c=()=>{const l=Math.min(1,(r.performance.now()-a)/we),h=Gn(l);this.setBand(i,l<1?Math.round(o+(s-o)*h):s),l<1?this.slide={root:i,from:o,to:s,start:a,raf:r.requestAnimationFrame(c)}:this.slide=null};this.slide={root:i,from:o,to:s,start:a,raf:r.requestAnimationFrame(c)}}setBand(e,s){this.band=s>0?{root:e,height:s}:{root:0,height:0},super.shrinkTo(this.band.root,this.band.height),this.dirty=!0}focusInput(e){var i;if(super.focusInput(e),this.focusedId()!==e||((i=this.field)==null?void 0:i.id)===e)return;this.unmountField();const s=this.get(e);if(!s)return;const r=this.doc.createElement(s.type==="textarea"?"textarea":"input");r.className="lc-field",r.setAttribute("autocomplete","off"),r.value=s.value,r.addEventListener("input",()=>{this.focusedId()===e&&this.setInputValue(e,r.value)}),r.addEventListener("keydown",o=>{o.key==="Enter"&&r.tagName==="INPUT"&&(o.preventDefault(),this.submitInput())}),r.addEventListener("blur",()=>{var o;((o=this.field)==null?void 0:o.el)===r&&this.focusedId()===e&&this.blurInput()}),this.over.appendChild(r),this.field={id:e,el:r},this.placedFor=null,this.place(),r.focus({preventScroll:!0})}blurInput(){super.blurInput(),this.unmountField()}unmountField(){const e=this.field;e&&(this.field=null,e.el.remove(),this.placedFor=null)}setPropertyString(e,s,r){var i,o;if(super.setPropertyString(e,s,r),s==="value"&&((i=this.field)==null?void 0:i.id)===e){const a=((o=this.get(e))==null?void 0:o.value)??"";this.field.el.value!==a&&(this.field.el.value=a)}}find(){var i;const e=[],s=(i=this.field)==null?void 0:i.id,r=(o,a,c)=>{let l=a;const h=o.style.transform;if(h){const d=o.style.transformOrigin,f=o.rect.x+(d?d.xPercent?o.rect.width*d.x/100:d.x:o.rect.width/2),g=o.rect.y+(d?d.yPercent?o.rect.height*d.y/100:d.y:o.rect.height/2),y=En(h,o.style.transformBox,o.rect.width,o.rect.height);l=zt(zt(zt(a,[1,0,0,1,f,g]),y),[1,0,0,1,-f,-g])}(Gs(o)||o.id===s)&&e.push({node:o,matrix:l,clip:c});const u=o.clip?zs(c,o.rect):c;for(const d of o.children)r(d,l,u)};for(const o of this.frame())r(o.tree,js,null);return e}static put(e,s){const{rect:r}=s.node,i=e.style;i.position="absolute",i.left="0",i.top="0",i.width=r.width+"px",i.height=r.height+"px",i.transformOrigin="0 0",i.transform=`matrix(${s.matrix.join(",")}) translate(${r.x}px,${r.y}px)`;const o=s.clip;i.clipPath=o?`inset(${Math.max(0,o.y-r.y)}px ${Math.max(0,r.x+r.width-(o.x+o.width))}px ${Math.max(0,r.y+r.height-(o.y+o.height))}px ${Math.max(0,o.x-r.x)}px)`:""}surfaceElement(e){const s=this.get(e.id);if(!s)return null;if(s.type==="video"){const o=ge(s.playerId);return o instanceof HTMLVideoElement?o:null}if(!s.viewId)return null;const r=this.ensureView(s.viewId,s.viewName??"",s.viewParams??"");if(!r)return null;let i=this.wrappers.get(s.id);return i||(i=this.doc.createElement("div"),this.wrappers.set(s.id,i)),r.el.parentElement!==i&&i.replaceChildren(r.el),i}styleField(e,s){var u,d;const r=s.style,i=e.style,[o,a,c,l]=s.padding??[0,0,0,0];i.padding=`${a}px ${c}px ${l}px ${o}px`,i.color=Ne(r.color,"#000000ff"),i.caretColor=i.color;const h=r.fontFamily??"Roboto";if(i.fontFamily=((d=(u=this.host).resolveFontFamily)==null?void 0:d.call(u,h))??h,i.fontSize=(r.fontSize??14)+"px",i.fontWeight=String(r.fontWeight??400),i.fontStyle=r.fontStyle??"normal",i.letterSpacing=(r.letterSpacing??0)+"px",i.lineHeight=e.tagName==="TEXTAREA"&&r.lineHeight!==void 0?r.lineHeight+"px":"normal",i.textAlign=r.textAlign==="center"?"center":r.textAlign==="end"?"right":"left",i.borderRadius="0",e.placeholder=r.placeholder??"",i.setProperty("--lc-placeholder",Ne(r.placeholderColor,"#999999ff")),e instanceof HTMLInputElement){const f=r.inputType??"text";e.type!==f&&(e.type=f)}}place(){var r;const e=this.frame();if(e===this.placedFor)return;this.placedFor=e;const s=new Set;for(const i of this.find()){const{node:o}=i;if(o.id===((r=this.field)==null?void 0:r.id)){this.styleField(this.field.el,o),Nt.put(this.field.el,i);continue}const a=this.surfaceElement(o);a&&(s.add(o.id),a.parentElement!==this.under&&this.under.appendChild(a),a.style.display="block",a.style.opacity="",a.style.pointerEvents="auto",a instanceof HTMLVideoElement&&(a.style.objectFit=o.style.objectFit??"contain"),Nt.put(a,i),this.shown.set(o.id,a))}for(const[i,o]of this.shown)s.has(i)||(o.style.display="none",this.shown.delete(i))}surfaceAt(e,s){const r=this.frame();for(let i=r.length-1;i>=0;i--){const o=r[i];if(o.leaving)continue;const a=bt(o.tree,e,s,c=>{var l,h;return c.type==="native"||(((l=this.get(c.id))==null?void 0:l.interactive)??!1)||(((h=this.get(c.id))==null?void 0:h.editable)??!1)||!!c.scroll});if(a.node)return a.node.type==="native";if(a.blocker)return!1}return this.destination!==null}dispose(){this.unmountField();for(const e of[...this.views.keys()])this.destroyView(e);this.dropDestination();for(const e of this.shown.values())e instanceof HTMLVideoElement||e.remove();this.shown.clear()}}function Ks(n,t,e,s){const r=n.createElement("div");r.textContent=e,r.style.cssText="position:absolute;left:50%;bottom:48px;transform:translateX(-50%);max-width:80%;padding:10px 16px;border-radius:8px;background:rgba(30,30,30,0.92);color:#fff;font:13px/1.4 system-ui,sans-serif;z-index:30;pointer-events:none;",t.appendChild(r),setTimeout(()=>r.remove(),s>0?s:2e3)}const Xs=500,Ue=["mousedown","mouseup","click","dblclick","contextmenu","touchstart","touchmove","touchend"],Ys=(n,t)=>{const e=n.ownerDocument,{canvas:s}=t;s.style.display="block",s.style.pointerEvents="none",n.style.touchAction="none";const r=s.getContext("2d"),i=()=>{const v=e.createElement("div");return v.style.cssText="position:absolute;left:0;top:0;width:100%;height:100%;overflow:hidden;pointer-events:none;",v},o=i(),a=i();n.insertBefore(o,s),s.after(a);const c=new Sr({resolveAssetUrl:v=>hn(v),canvasSurfaces:t.canvasHost}),l=new Nt(t.M,c,o,a,{keyboardHeight:t.keyboardHeight??(()=>0),onKeyboard:t.onKeyboard,onToast:(v,T)=>Ks(e,n,v,T)});let h=1,u=new Me(r,h),d=!0;const f=()=>{(d||l.needsPaint())&&(d=!1,l.paint(u,l.paintOptions())),l.place()};let g=1;const y=(v,T,I,z=1)=>{if(!(v<=0||T<=0)){I!==h&&(h=I,u=new Me(r,h)),g=z;for(const J of[o,a])Object.assign(J.style,{width:`${v}px`,height:`${T}px`,zoom:g===1?"":String(g)});d=!0,l.resize(v,T)}},x=v=>{l.setSafeArea([v.top,v.right,v.bottom,v.left],v.bars??[])},w=v=>{const T=n.getBoundingClientRect(),I=It(n)*g;return[(v.clientX-T.left)/I,(v.clientY-T.top)/I]},p=v=>v.target instanceof Node&&a.contains(v.target),m=v=>v.target instanceof Node&&o.contains(v.target),E=v=>{m(v)&&v.stopPropagation()},k=new Set,L=new Map,O=v=>{const T=L.get(v);T!==void 0&&(clearTimeout(T),L.delete(v))},C=v=>{if(p(v))return;const[T,I]=w(v);if(!l.surfaceAt(T,I)){E(v),k.add(v.pointerId);try{n.setPointerCapture(v.pointerId)}catch{}l.pointerDown(v.pointerId,T,I),O(v.pointerId),L.set(v.pointerId,window.setTimeout(()=>{L.delete(v.pointerId),l.longPress(v.pointerId,T,I)},Xs))}},F=v=>{const[T,I]=w(v);k.has(v.pointerId)&&(E(v),l.pointerMove(v.pointerId,T,I)),v.pointerType==="mouse"&&(p(v)||!k.has(v.pointerId)&&l.surfaceAt(T,I)?l.pointerLeave():l.pointerHover(T,I))},W=v=>{v.pointerType==="mouse"&&l.pointerLeave()},$=v=>{if(!k.delete(v.pointerId))return;E(v),O(v.pointerId);const[T,I]=w(v);l.pointerUp(v.pointerId,T,I)},j=v=>{k.delete(v.pointerId)&&(O(v.pointerId),l.pointerCancel(v.pointerId))},q=v=>{if(p(v))return;const[T,I]=w(v);if(l.surfaceAt(T,I))return;E(v);const z=v.deltaMode===1?16:v.deltaMode===2?l.height:1;l.wheel(T,I,v.deltaX*z,v.deltaY*z)&&v.preventDefault()},A=v=>{var J;if(p(v))return;const T="clientX"in v?v:(J=v.changedTouches)==null?void 0:J[0];if(!T)return;const[I,z]=w(T);l.surfaceAt(I,z)||(E(v),v.type==="mousedown"&&v.preventDefault())};n.addEventListener("pointerdown",C,!0),n.addEventListener("pointermove",F,!0),n.addEventListener("pointerleave",W),n.addEventListener("pointerup",$,!0),n.addEventListener("pointercancel",j,!0),n.addEventListener("wheel",q,{passive:!1,capture:!0});for(const v of Ue)n.addEventListener(v,A,!0);return{ui:l,render:f,resize:y,setSafeArea:x,destroy(){for(const v of L.keys())O(v);n.removeEventListener("pointerdown",C,!0),n.removeEventListener("pointermove",F,!0),n.removeEventListener("pointerleave",W),n.removeEventListener("pointerup",$,!0),n.removeEventListener("pointercancel",j,!0),n.removeEventListener("wheel",q,!0);for(const v of Ue)n.removeEventListener(v,A,!0);l.dispose(),o.remove(),a.remove()}}},qs=["miter","round","bevel"],Js=["butt","round","square"],Qs=["left","center","right","start","end"],Zs=["alphabetic","top","middle","bottom","hanging","ideographic"],Be=["nonzero","evenodd"],ti=["pad","reflect","repeat"],Kt={COLOR:0,RADIAL:2},St={MOVE:0,LINE:1,QUAD:2,CUBIC:3,CLOSE:4},X={SET_TRANSFORM:0,SAVE:1,RESTORE:2,CLIP:3,FILL_PATH:4,STROKE_PATH:5,FILL_TEXT:6,STROKE_TEXT:7,DRAW_IMAGE:8,CLEAR_RECT:9};class ei{constructor(t,e){b(this,"pos",0);this.w=t,this.strings=e}f(){if(this.pos>=this.w.length)throw new Error("draw list: truncated");return this.w[this.pos++]}i(){return this.f()|0}str(){const t=this.i();if(t<0||t>=this.strings.length)throw new Error(`draw list: bad string index ${t}`);return this.strings[t]}color(){return[this.f(),this.f(),this.f(),this.f()]}matrix(){return[this.f(),this.f(),this.f(),this.f(),this.f(),this.f()]}paint(){const t=this.i(),e=this.f();if(t===Kt.COLOR)return{kind:"color",alpha:e,color:this.color()};const s=this.matrix();let r=0,i=0,o=0;t===Kt.RADIAL&&(r=this.f(),i=this.f(),o=this.f());const a=ti[this.i()]??"pad",c=this.i(),l=[];for(let h=0;h<c;h++)l.push({offset:this.f(),color:this.color()});return t===Kt.RADIAL?{kind:"radial",alpha:e,matrix:s,fx:r,fy:i,r0:o,spread:a,stops:l}:{kind:"linear",alpha:e,matrix:s,spread:a,stops:l}}stroke(){const t=this.f(),e=qs[this.i()]??"miter",s=Js[this.i()]??"butt",r=this.f(),i=this.f(),o=this.i(),a=[];for(let c=0;c<o;c++)a.push(this.f());return{width:t,join:e,cap:s,miterLimit:r,dashOffset:i,dash:a}}font(){return{family:this.str(),size:this.f(),weight:this.i(),italic:this.i()!==0}}path(){const t=this.i(),e=this.pos+t;if(e>this.w.length)throw new Error("draw list: truncated path");const s=[];for(;this.pos<e;)switch(this.i()){case St.MOVE:s.push(["M",this.f(),this.f()]);break;case St.LINE:s.push(["L",this.f(),this.f()]);break;case St.QUAD:s.push(["Q",this.f(),this.f(),this.f(),this.f()]);break;case St.CUBIC:s.push(["C",this.f(),this.f(),this.f(),this.f(),this.f(),this.f()]);break;case St.CLOSE:s.push(["Z"]);break;default:throw new Error("draw list: bad path verb")}return s}rect4(){return[this.f(),this.f(),this.f(),this.f()]}}const ni=(n,t)=>{const e=new ei(n,t),s=[];for(;e.pos+2<=n.length;){const r=e.i(),i=e.i(),o=e.pos+i;if(i<0||o>n.length)throw new Error("draw list: truncated command");switch(r){case X.SET_TRANSFORM:s.push({cmd:"setTransform",matrix:e.matrix()});break;case X.SAVE:s.push({cmd:"save"});break;case X.RESTORE:s.push({cmd:"restore"});break;case X.CLIP:{const a=Be[e.i()]??"nonzero";s.push({cmd:"clip",rule:a,path:e.path()});break}case X.FILL_PATH:{const a=Be[e.i()]??"nonzero",c=e.paint();s.push({cmd:"fillPath",rule:a,paint:c,path:e.path()});break}case X.STROKE_PATH:{const a=e.stroke(),c=e.paint();s.push({cmd:"strokePath",stroke:a,paint:c,path:e.path()});break}case X.FILL_TEXT:case X.STROKE_TEXT:{const a=e.str(),c=e.f(),l=e.f(),h=e.f(),u=e.font(),d=Qs[e.i()]??"start",f=Zs[e.i()]??"alphabetic",g=e.f();if(r===X.STROKE_TEXT){const y=e.stroke();s.push({cmd:"strokeText",text:a,x:c,y:l,maxWidth:h,font:u,align:d,baseline:f,letterSpacing:g,stroke:y,paint:e.paint()})}else s.push({cmd:"fillText",text:a,x:c,y:l,maxWidth:h,font:u,align:d,baseline:f,letterSpacing:g,paint:e.paint()});break}case X.DRAW_IMAGE:{const a=e.i(),c=e.rect4(),l=e.rect4();s.push({cmd:"drawImage",surface:a,src:c,dst:l,alpha:e.f()});break}case X.CLEAR_RECT:s.push({cmd:"clearRect",rect:e.rect4()});break}if(e.pos!==o){if(e.pos>o)throw new Error(`draw list: command ${r} overran its length`);e.pos=o}}return s},ri=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","ui-serif","ui-sans-serif","ui-monospace","ui-rounded","emoji","math","fangsong"]),Tn=n=>`rgba(${Math.round(n[0]*255)}, ${Math.round(n[1]*255)}, ${Math.round(n[2]*255)}, ${n[3]})`,Rn=(n,t=n.family)=>{const e=ri.has(t)?t:`"${t.replace(/"/g,"'")}"`;return`${n.italic?"italic ":""}${n.weight} ${n.size}px ${e}`},Lt=(n,t,e)=>[n[0]*t+n[2]*e+n[4],n[1]*t+n[3]*e+n[5]],si=n=>Math.abs(n[0]-n[3])<1e-6&&Math.abs(n[1]+n[2])<1e-6,Xt=(n,t)=>{n.beginPath();for(const e of t)switch(e[0]){case"M":n.moveTo(e[1],e[2]);break;case"L":n.lineTo(e[1],e[2]);break;case"Q":n.quadraticCurveTo(e[1],e[2],e[3],e[4]);break;case"C":n.bezierCurveTo(e[1],e[2],e[3],e[4],e[5],e[6]);break;case"Z":n.closePath();break}},De=(n,t)=>{for(const e of t.stops)n.addColorStop(e.offset,Tn(e.color))},Pt=(n,t,e,s)=>{if(n.globalAlpha=t.alpha,t.kind==="color"){n[e==="fill"?"fillStyle":"strokeStyle"]=Tn(t.color),s();return}const r=t.matrix;if(si(r)){let o;if(t.kind==="linear"){const[a,c]=Lt(r,0,0),[l,h]=Lt(r,1,0);o=n.createLinearGradient(a,c,l,h)}else{const a=Math.hypot(r[0],r[1]),[c,l]=Lt(r,0,0),[h,u]=Lt(r,t.fx,t.fy);o=n.createRadialGradient(h,u,t.r0*a,c,l,a)}De(o,t),n[e==="fill"?"fillStyle":"strokeStyle"]=o,s();return}n.save(),n.transform(r[0],r[1],r[2],r[3],r[4],r[5]);const i=t.kind==="linear"?n.createLinearGradient(0,0,1,0):n.createRadialGradient(t.fx,t.fy,t.r0,0,0,1);De(i,t),n[e==="fill"?"fillStyle":"strokeStyle"]=i,s(),n.restore()},We=(n,t)=>{n.lineWidth=t.width,n.lineJoin=t.join,n.lineCap=t.cap,n.miterLimit=t.miterLimit,n.setLineDash(t.dash),n.lineDashOffset=t.dashOffset},He=(n,t,e)=>{n.font=Rn(t.font,e.fontFamily?e.fontFamily(t.font.family):t.font.family),n.textAlign=t.align,n.textBaseline=t.baseline,"letterSpacing"in n&&(n.letterSpacing=`${t.letterSpacing}px`)},ii=(n,t,e={})=>{var r;n.save();let s=0;try{n.setTransform(1,0,0,1,0,0),n.globalAlpha=1;for(const i of t)switch(i.cmd){case"setTransform":n.setTransform(i.matrix[0],i.matrix[1],i.matrix[2],i.matrix[3],i.matrix[4],i.matrix[5]);break;case"save":n.save(),s++;break;case"restore":s>0&&(n.restore(),s--);break;case"clip":Xt(n,i.path),n.clip(i.rule);break;case"fillPath":Xt(n,i.path),Pt(n,i.paint,"fill",()=>n.fill(i.rule));break;case"strokePath":Xt(n,i.path),We(n,i.stroke),Pt(n,i.paint,"stroke",()=>n.stroke());break;case"fillText":He(n,i,e),Pt(n,i.paint,"fill",()=>i.maxWidth>0?n.fillText(i.text,i.x,i.y,i.maxWidth):n.fillText(i.text,i.x,i.y));break;case"strokeText":He(n,i,e),We(n,i.stroke),Pt(n,i.paint,"stroke",()=>i.maxWidth>0?n.strokeText(i.text,i.x,i.y,i.maxWidth):n.strokeText(i.text,i.x,i.y));break;case"drawImage":{const o=(r=e.image)==null?void 0:r.call(e,i.surface);if(!o)break;n.globalAlpha=i.alpha,n.drawImage(o,i.src[0],i.src[1],i.src[2],i.src[3],i.dst[0],i.dst[1],i.dst[2],i.dst[3]);break}case"clearRect":n.clearRect(i.rect[0],i.rect[1],i.rect[2],i.rect[3]);break;default:{const o=i;throw new Error(`unhandled draw command ${o.cmd}`)}}}finally{for(;s>0;s--)n.restore();n.restore()}},oi=n=>{const t=typeof OffscreenCanvas<"u",e=new Map;let s=null;const r=(l,h,u)=>{if(!t)return null;let d=e.get(l);return d?(d.width!==h||d.height!==u)&&(d.width=h,d.height=u):(d=new OffscreenCanvas(h,u),e.set(l,d)),d},i={paint:(l,h,u,d,f,g)=>{const y=r(l,Math.max(1,h),Math.max(1,u)),x=y==null?void 0:y.getContext("2d");!y||!x||(x.setTransform(1,0,0,1,0,0),x.clearRect(0,0,y.width,y.height),ii(x,ni(f,g),{image:w=>e.get(w)??null,fontFamily:n}))},measureText:(l,h,u,d,f,g)=>{if(g[0]=0,g[1]=0,g[2]=0,!t||(s||(s=new OffscreenCanvas(1,1).getContext("2d")),!s))return;s.font=Rn({family:h,size:u,weight:d,italic:f},h);const y=s.measureText(l);g[0]=y.width,g[1]=y.fontBoundingBoxAscent??y.actualBoundingBoxAscent,g[2]=y.fontBoundingBoxDescent??y.actualBoundingBoxDescent},decodeImage:()=>!1,readPixels:(l,h)=>{const u=o(l);return u?(h[0]=u.width,h[1]=u.height,new Uint8Array(u.data.buffer,u.data.byteOffset,u.data.byteLength)):null},releaseSurface:l=>{e.delete(l)}},o=l=>{const h=e.get(l),u=h==null?void 0:h.getContext("2d");return!h||!u?null:{data:u.getImageData(0,0,h.width,h.height).data,width:h.width,height:h.height}};return{table:i,readSurface:o,getSurface:l=>{const h=e.get(l);return h?{canvas:h,width:h.width,height:h.height}:null},surfaceToDataUrl:l=>{var d;const h=e.get(l);if(!h||typeof document>"u")return null;const u=document.createElement("canvas");return u.width=h.width,u.height=h.height,(d=u.getContext("2d"))==null||d.drawImage(h,0,0),u.toDataURL()}}},ai=""+new URL("assets/Roboto-Variable-DHm9jpd-.woff2",import.meta.url).href,ci=(n,t="woff2")=>{const e=/^\/\/ fonts: (.+)$/m.exec(n);if(!e)return[];const s=[];for(const r of e[1].split(";")){const i=r.indexOf("=");if(i===-1)continue;const o=/^(.+)@(\d+)(i?)$/.exec(r.slice(0,i));o&&s.push({family:o[1],weight:parseInt(o[2],10),italic:o[3]==="i",url:r.slice(i+1).replace("{fmt}",t)})}return s},li=async(n,t,e=2e3)=>{const s=t??(typeof document>"u"?void 0:document);if(!(s!=null&&s.fonts)||n.length===0)return;const r=[];for(const i of n)try{const o=new FontFace(i.family,`url("${i.url}")`,{weight:String(i.weight),style:i.italic?"italic":"normal"});s.fonts.add(o),r.push(o.load().catch(()=>{}))}catch{}await Promise.race([Promise.all(r),new Promise(i=>setTimeout(i,e))])},An="Roboto",hi=[`400 14px ${An}`],$e="data-lecodes-fonts",ui=async(n=hi,t)=>{const e=t??(typeof document>"u"?void 0:document);if(!(!e||!e.fonts)){if(!e.head.querySelector(`style[${$e}]`)){const s=new URL(ai,document.baseURI).href,r=e.createElement("style");r.setAttribute($e,""),r.textContent=`@font-face{font-family:"${An}";src:url("${s}") format("woff2");font-weight:100 900;font-display:swap}`,e.head.appendChild(r)}try{await Promise.all(n.map(s=>e.fonts.load(s)))}catch{}}},Ve="2.8.2",Yt=n=>{const t=n==null?void 0:n.match(/^(\d+)\.\d+\.\d+/);return t?Number(t[1]):null},di=(n,t)=>Yt(n)!==null&&Yt(n)===Yt(t),fi=()=>({setMatrix(){},setVisible(){},setCameraMatrix(){},setProjection(){},clearProjection(){},setBackground(){},createExternalTexture:()=>null,onFrame:()=>()=>{},readPixels:(n,t)=>t(null,0,0),viewport:()=>({width:0,height:0,rotation:0})}),gi=n=>{var s,r;const t=((r=(s=n.screen)==null?void 0:s.orientation)==null?void 0:r.angle)??n.orientation??0;return(Math.round(t/90)%4+4)%4*90},pi=(n,t)=>({width:(n==null?void 0:n.clientWidth)??0,height:(n==null?void 0:n.clientHeight)??0,rotation:gi(t)}),mi=[1,0,0,0,1,0],yi=(n,t,e)=>{const s=t*4,r=new Uint8Array(s);for(let i=0,o=e-1;i<o;i++,o--)r.set(n.subarray(i*s,i*s+s)),n.copyWithin(i*s,o*s,o*s+s),n.set(r,o*s);return n},wi=[171,75,84,88,32,50,48,187,13,10,26,10],bi=n=>n.length>=12&&wi.every((t,e)=>n[e]===t),vi=(n,t)=>{const e={antialias:!1,depth:!0,alpha:!1,stencil:!1,desynchronized:!1,failIfMajorPerformanceCaveat:!1,powerPreference:"high-performance",premultipliedAlpha:!0,preserveDrawingBuffer:t},s=n.newCanvas(),r=s.getContext("webgl2",e);if(!r)throw new Error("WebGL2 is not available");let i=null,o=!1;const a=[],c=()=>{const u=r.createTexture();return r.bindTexture(r.TEXTURE_2D,u),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,r.NONE),u},l=u=>{var g;u._creatorWebSetViewport(s.width,s.height);const{width:d,height:f}=n.size();d>0&&f>0&&((g=u._setDensityGL)==null||g.call(u,s.width/d,s.height/f))},h=(u,d,f,g)=>{const y=u.GL.getNewId(u.GL.textures);return u.GL.textures[y]=d,u._importTexture(y,f,g)>>>0};return{canvas:s,context:r,options:e,table(u){return i=u,{engineCreated(){a.length=0,u._createSwapChainHeadless(s.width,s.height),l(u),o=!0},createGLView(){s.style.display="block"},closeScene(){s.style.display="none"},createTexture(d,f,g,y){const x=et(d);if(!x){y(`createTexture: no buffer behind id ${d}`);return}const w=new Uint8Array(x);if(bi(w)){const p=u._malloc(w.length);u.HEAPU8.set(w,p);const m=u._createTextureFromKtx2(p,w.length)>>>0;if(u._free(p),m===4294967295){y("KTX2 transcode failed");return}g(m,u._getTextureWidth(m),u._getTextureHeight(m));return}createImageBitmap(Ht(d)).then(p=>{const m=c();r.texStorage2D(r.TEXTURE_2D,1,f&1?r.RGBA8:r.SRGB8_ALPHA8,p.width,p.height),r.texSubImage2D(r.TEXTURE_2D,0,0,0,p.width,p.height,r.RGBA,r.UNSIGNED_BYTE,p),g(h(u,m,p.width,p.height),p.width,p.height)},p=>y(p instanceof Error?p.message:String(p)))},createMediaPlayerTexture(d){const f=ge(d);if(!f)return 0;const g=c(),y=h(u,g,0,0);return a.push({video:f,texture:g,id:y,lastTime:0}),y}}},show(){s.style.display="block"},hide(){s.style.display="none"},resize(){i&&o&&l(i)},frame(){for(const u of a)u.video.readyState<2||u.video.currentTime===u.lastTime||(u.lastTime=u.video.currentTime,r.bindTexture(r.TEXTURE_2D,u.texture),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,u.video))},videoTexture(u){const d=a.find(y=>y.video===u);if(d)return d.id;if(!i||!o)return;const f=c(),g=h(i,f,0,0);return a.push({video:u,texture:f,id:g,lastTime:0}),g},readPixels(){const u=r.drawingBufferWidth,d=r.drawingBufferHeight;if(!o||u===0||d===0)return null;const f=new Uint8Array(u*d*4),g=r.getParameter(r.READ_FRAMEBUFFER_BINDING);return r.bindFramebuffer(r.READ_FRAMEBUFFER,null),r.readPixels(0,0,u,d,r.RGBA,r.UNSIGNED_BYTE,f),r.bindFramebuffer(r.READ_FRAMEBUFFER,g),{rgba:yi(f,u,d),width:u,height:d}},destroy(){var u;a.length=0,(u=r.getExtension("WEBGL_lose_context"))==null||u.loseContext()}}},xi=n=>{const t={alpha:!1,depth:!0,stencil:!0,antialias:!1,premultipliedAlpha:!1,desynchronized:!1,powerPreference:"high-performance",failIfMajorPerformanceCaveat:!1},e=n.newCanvas(),s=e.getContext("webgl2",t);if(!s)throw new Error("WebGL2 is not available");let r=null,i=!1;const o=()=>{!r||!i||(r._c2dSetViewport(e.width,e.height),r._c2dSetDensity(n.size().factor))},a=()=>{r&&(r._creatorWeb2dEnsureInited(),i=!0,o(),e.style.display="block")},c=()=>{e.style.display="none"};return{canvas:e,context:s,options:t,table(l){return r=l,{open2DScene:a,close2DScene:c}},show:a,hide:c,resize:o,frame(l){r&&r._creatorWeb2dSceneOpen()&&r._creatorWeb2dRenderFrame(l)},destroy(){var l;(l=s.getExtension("WEBGL_lose_context"))==null||l.loseContext()}}},Ge=n=>{if(typeof n=="number"||typeof n=="bigint"||typeof WebAssembly<"u"&&n instanceof WebAssembly.RuntimeError)return!0;const t=n instanceof Error?n.stack??"":"";return/\bwasm\b|wasm-function|\.wasm/i.test(t)},je="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Mn={};for(let n=0;n<je.length;n++)Mn[je[n]]=n;const Ei=n=>{const t=[];let e=0,s=0;for(const r of n){const i=Mn[r];if(i===void 0)break;const o=i&32;if(s+=(i&31)<<e,o)e+=5;else{const a=s&1;s>>=1,t.push(a?-s:s),s=0,e=0}}return t};class Si{constructor(t){b(this,"sources");b(this,"lines");this.sources=t.sources,this.lines=[];let e=0,s=0,r=0;for(const i of t.mappings.split(";")){const o=[];let a=0;if(i)for(const c of i.split(",")){const l=Ei(c);l.length!==0&&(a+=l[0],l.length>=4&&(e+=l[1],s+=l[2],r+=l[3],o.push([a,e,s,r])))}this.lines.push(o)}}originalPositionFor(t,e){const s=this.lines[t-1];if(!s||s.length===0)return null;let r=null;for(const o of s)if(o[0]<=e)r=o;else break;r??(r=s[0]);const i=this.sources[r[1]];return i===void 0?null:{source:i,line:r[2]+1,column:r[3]}}}const _i=n=>{const t=n.match(/\/\/# lecodesMap=data:application\/json;(?:charset=[^;]+;)?base64,([A-Za-z0-9+/=]+)\s*$/);if(!t)return null;try{const e=typeof atob=="function"?atob(t[1]):Buffer.from(t[1],"base64").toString("utf8");return new Si(JSON.parse(e))}catch{return null}};let wt=null;const ki=()=>{if(wt!==null)return wt;try{new Function("throw new Error('chisel-calibrate')")()}catch(n){const e=(n.stack??"").match(/<anonymous>:(\d+):\d+/);return wt=e?parseInt(e[1],10)-1:2,wt}return wt=2,wt},qt=(n,t)=>{const e=(n instanceof Error?n.stack:"")??"",s=ki(),r=[];for(const i of e.split(`
14
14
  `)){const o=i.match(/<anonymous>:(\d+):(\d+)/);if(!o)continue;const a=parseInt(o[1],10)-s,c=parseInt(o[2],10)-1;if(a<1)continue;const l=t.originalPositionFor(a,c<0?0:c);if(!l)continue;const h=i.match(/at\s+([^\s(]+)\s*\(/);r.push({fn:h?h[1]:null,source:l.source,line:l.line,column:l.column})}return r},Ti=/^\[ERROR\] (run|host callback|JsDispatch|timer|setLoop|animate|tween)\b:? ?([\s\S]*)$/,Ri=(n,t)=>{const e=[],s=(l,h,u,d)=>{var y,x;if(u.length===0&&Ge(h)){const w=typeof h=="number"||typeof h=="bigint"?`code ${h}`:h instanceof Error?h.message||h.name:String(h),p=[d,w].filter(E=>!!E).filter((E,k,L)=>L.indexOf(E)===k).join(`
15
15
  `);console.error(`[lecodes] native engine error — ${p||w} (see the console for the engine's message)`);const m={message:"Native engine error",detail:p,frames:[],native:!0,stack:h instanceof Error?h.stack:void 0};(y=l.onError)==null||y.call(l,m),m.stack&&t&&cr(m.stack).then(E=>{var k;E.length>0&&((k=l.onError)==null||k.call(l,{...m,nativeFrames:E}))});return}const f=h instanceof Error?h.message:String(h),g=u[0];console.error(g?`[lecodes] ${f}
16
16
  at ${g.source}:${g.line}:${g.column}${g.fn?` (${g.fn})`:""}`:`[lecodes] ${f}`),(x=l.onError)==null||x.call(l,{message:f,frames:u,stack:h instanceof Error?h.stack:void 0})},r=(l,h)=>{for(let d=e.length-1;d>=0;d--){const f=e[d];if(!f.sourceMap)continue;const g=qt(l,f.sourceMap);if(g.length>0)return s(f,l,g,h)}const u=e[e.length-1];u&&Ge(l)&&s(u,l,[],h)};let i=null;const o=()=>{const l=e[e.length-1],h=i;if(i=null,!h||!l)return;const u=new Error(h.message.replace(/^Error: /,""));u.stack=h.stack.join(`
@@ -18,4 +18,4 @@ var $n=Object.defineProperty;var Vn=(n,t,e)=>t in n?$n(n,t,{enumerable:!0,config
18
18
  `);return i={message:(u??"").replace(/^JsTask /,""),stack:d},n.setTimeout(o,0),!0},dispose(){n.removeEventListener("error",a),n.removeEventListener("unhandledrejection",c),e.length=0}}},Ln=n=>{var c,l,h,u;const t=n.slice(0,2e3),e=new Set,s=t.match(/\/\/ preload: (.+)/);if(s)for(const d of s[1].split(";"))e.add(d);const r=t.includes("// gl: disable")?"off":t.includes("// gl: defer")?"defer":"on",i=((c=t.match(/^\/\/ sdk: (\d+\.\d+\.\d+\S*)/m))==null?void 0:c[1])??null,o=((h=(l=t.match(/^\/\/ name: (.+)$/m))==null?void 0:l[1])==null?void 0:h.trim())??null,a=new Set((((u=t.match(/^\/\/ plugins: (.+)$/m))==null?void 0:u[1])??"").split(";").map(d=>d.trim()).filter(Boolean));return{sdk:i,name:o,preloads:e,gl:r,is2d:t.includes("// 2d: enable"),plugins:a,bootFonts:ci(t)}},Ai=n=>n.gl!=="off"?"full":n.is2d?"2d":"ui",ze=(n,t)=>Math.max(1,Math.round(n/t*1e3)/1e3),Mi=(n,t=1)=>{const e=n.ownerDocument,s=e.defaultView??window;let r=t>0?t:1,i=1/0;const o=(w,p)=>{const m=(s.devicePixelRatio||1)*It(n),E=Math.min(i,m*r),k=ze(w,r),L=ze(p,r);return{width:k,height:L,factor:E,scale:r,pixelWidth:Math.max(1,Math.round(k*E)),pixelHeight:Math.max(1,Math.round(L*E))}};let a=o(Math.max(1,n.clientWidth),Math.max(1,n.clientHeight));const c=[],l=w=>{w.width!==a.pixelWidth&&(w.width=a.pixelWidth),w.height!==a.pixelHeight&&(w.height=a.pixelHeight)},h=()=>{const w=e.createElement("canvas");return w.style.cssText="position:absolute;inset:0;width:100%;height:100%;display:none;",n.appendChild(w),l(w),c.push(w),w},u=new Set,d=w=>{if(!(w.width<=0||w.height<=0)){a=w;for(const p of c)l(p);for(const p of u)p(a)}};let f=null;const g=(w,p,m)=>{const E=o(w,p),k=m&&Math.abs(m.inlineSize-E.width*E.factor)<=1&&Math.abs(m.blockSize-E.height*E.factor)<=1;if(!m||!k){d(E);return}d({...E,pixelWidth:Math.max(1,m.inlineSize),pixelHeight:Math.max(1,m.blockSize)})},y=new ResizeObserver(([w])=>{var k;if(!w)return;const{width:p,height:m}=w.contentRect,E=((k=w.devicePixelContentBoxSize)==null?void 0:k[0])??null;f={width:p,height:m,device:E},g(p,m,E)});try{y.observe(n,{box:"device-pixel-content-box"})}catch{y.observe(n)}const x=w=>{w!==void 0&&(i=w>0?w:1/0);const p=o(Math.max(1,n.clientWidth),Math.max(1,n.clientHeight));(p.pixelWidth!==a.pixelWidth||p.pixelHeight!==a.pixelHeight||p.factor!==a.factor||p.width!==a.width||p.height!==a.height)&&d(p)};return{root:n,doc:e,win:s,size:()=>a,scale:()=>r,newCanvas:h,remeasure:x,setScale(w){!(w>0)||w===r||(r=w,f?g(f.width,f.height,f.device):x())},onResize(w){return u.add(w),()=>{u.delete(w)}},destroy(){y.disconnect(),u.clear();for(const w of c)w.remove();c.length=0}}},Li=n=>{const t=new Map;let e=0,s=[];const r=new Set,i=c=>{r.has(c)||(r.add(c),console.warn(`[web-host] gl.${c}: this host's engine has no such call yet (a runtime module of an older build) — ignored`))},o=c=>Float32Array.from(c);return{facade:n?{setMatrix(c,l){var h;(h=n.creator())==null||h.setWorldMatrix(c,o(l))},setVisible(c,l){var h;(h=n.creator())==null||h.setVisible(c,l)},setCameraMatrix(c,l){var u;const h=n.creator();if(h&&!h.setCameraMatrix)return i("setCameraMatrix");(u=h==null?void 0:h.setCameraMatrix)==null||u.call(h,c,o(l))},setProjection(c,l,h,u){var f;const d=n.creator();if(d&&!d.setCameraProjectionMatrix)return i("setProjection");(f=d==null?void 0:d.setCameraProjectionMatrix)==null||f.call(d,c,o(l),h,u)},clearProjection(c){var l,h;(h=(l=n.creator())==null?void 0:l.clearCameraProjectionMatrix)==null||h.call(l,c)},setBackground(c,l,h=mi){const u=n.creator();if(!u)return;if(!u.setSceneBackground||!n.surface)return i("setBackground");l&&l.nodeName!=="VIDEO"&&!r.has("setBackground(canvas)")&&(r.add("setBackground(canvas)"),console.warn("[web-host] gl.setBackground: the web player shows a video background only — a canvas is not shown (Web Lite shows it)"));const d=(l==null?void 0:l.nodeName)==="VIDEO"?l:null,f=d?n.surface.videoTexture(d):void 0;u.setSceneBackground(c,f??4294967295,Float32Array.from(h))},createExternalTexture:()=>null,onFrame(c){const l=e++;return t.set(l,c),()=>{t.delete(l)}},readPixels(c,l){if(!n.surface||n.presented()!==c){l(null,0,0);return}s.push({scene:c,then:l})},viewport:()=>pi(n.view,n.view.ownerDocument.defaultView??window)}:fi(),before(){if(t.size!==0)for(const c of[...t.values()])c()},after(){if(s.length===0||!(n!=null&&n.surface))return;const c=n.presented(),l=s.filter(u=>u.scene===c);for(const u of s)u.scene!==c&&u.then(null,0,0);if(s=l,l.length===0||!n.frameRendered())return;s=[];const h=n.surface.readPixels();for(const u of l)h?u.then(h.rgba.slice(),h.width,h.height):u.then(null,0,0)},worldChanged(){t.clear();const c=s;s=[];for(const l of c)l.then(null,0,0)}}},Pi=(n,t)=>{const e=[],s=new Set;return{has:r=>s.has(r),register(r,i){s.has(r)||(s.add(r),i({registerView:(o,a,c=1)=>{e.push({id:r,version:c,kind:"view",name:o,factory:a})},registerService:(o,a,c=1)=>{e.push({id:r,version:c,kind:"service",name:o,factory:a})},putBuffer:ft,getBuffer:et,gl:t}))},allow(r){var o,a;const i=new Set(r);for(const c of e){const l=i.has(c.id);c.kind==="view"?l?(o=n.registerView)==null||o.call(n,c.name,c.factory,c.version):(a=n.unregisterView)==null||a.call(n,c.name):l?n.registerService(c.name,c.factory,c.version):n.unregisterService(c.name)}}}},Oi=n=>{const t=n.ownerDocument.createElement("div");t.style.cssText="position:absolute;visibility:hidden;pointer-events:none;width:0;height:0;padding:env(safe-area-inset-top,0px) env(safe-area-inset-right,0px) env(safe-area-inset-bottom,0px) env(safe-area-inset-left,0px);",n.appendChild(t);const e=i=>Math.round(parseFloat(i)||0),s=()=>{const i=getComputedStyle(t);return{top:e(i.paddingTop),right:e(i.paddingRight),bottom:e(i.paddingBottom),left:e(i.paddingLeft)}};let r=null;return{set(i){r=i},current:()=>r??s(),destroy(){t.remove()}}},Ci={lightmap:"world","lightmap-masked":"world","lightmap-lite":"world","lightmap-masked-lite":"world",terrain:"world","terrain-lightmap":"world",foliage:"world","foliage-cards":"world",grass:"world","foliage-impostor":"world"},Ke="material:",Ii=n=>{const t=new Set;for(const e of n)e.startsWith(Ke)&&t.add(Ci[e.slice(Ke.length)]??"base");return[...t].sort((e,s)=>e==="base"?-1:s==="base"?1:e.localeCompare(s))},Fi=""+new URL("assets/materials-DE8QZ7Hn.bin",import.meta.url).href,Ni=""+new URL("assets/materials-world-B9HLXjfb.bin",import.meta.url).href,Ui=""+new URL("assets/neutral_ibl128-D-lzdkLN.ktx",import.meta.url).href,Bi=""+new URL("assets/uberarchive-Ok2HfJvn.bin",import.meta.url).href,Di={base:Fi,world:Ni},Wi=n=>{const t=new Uint8Array(n.reduce((s,r)=>s+r.byteLength,0));let e=0;for(const s of n)t.set(new Uint8Array(s),e),e+=s.byteLength;return t.buffer},Hi=async n=>{const t=async o=>{const a=await fetch(o);if(!a.ok)throw new Error(`${o} → HTTP ${a.status}`);return a.arrayBuffer()},e=Ii(n).map(o=>Di[o]).filter(o=>!!o),[s,r,...i]=await Promise.all([t(Ui),t(Bi),...e.map(t)]);return{1:s,2:r,...i.length>0?{3:Wi(i)}:{}}},$i=n=>{const t=()=>n.push(document.hidden?"pause":"resume"),e=()=>n.push("online"),s=()=>n.push("offline");return document.addEventListener("visibilitychange",t),window.addEventListener("online",e),window.addEventListener("offline",s),{table:{state:()=>document.hidden?"background":"active",isOnline:()=>navigator.onLine,openUrl(i){window.open(i,"_blank","noopener")},worldChange(){var i;(i=n.onWorldChange)==null||i.call(n)},setOrientation(i){var c,l,h,u;const o=i==="landscape"||i==="portrait"?i:"auto";if(n.onOrientation){n.onOrientation(o);return}const a=typeof screen<"u"?screen.orientation:void 0;if(a)try{o==="auto"?(c=a.unlock)==null||c.call(a):(u=(h=(l=a.lock)==null?void 0:l.call(a,o))==null?void 0:h.catch)==null||u.call(h,()=>{})}catch{}}},emit:(i,o)=>n.push(i,o),dispose(){document.removeEventListener("visibilitychange",t),window.removeEventListener("online",e),window.removeEventListener("offline",s)}}},Vi=(n,t,e,s)=>{try{const r=document.createElement("input");r.type="file",r.multiple=e,s&&(r.accept=s),r.onchange=async()=>{const{files:i}=r;if(e){const o=[];if(!i)return n([]);for(let a of i)o.push([ft(await a.arrayBuffer()),a.name,a.size]);n(o)}else{if(!i||i.length===0)return n(null);n([[ft(await i[0].arrayBuffer()),i[0].name,i[0].size]])}},window.addEventListener("focus",()=>{setTimeout(()=>{(!r.files||r.files.length===0)&&n(e?[]:null)},300)},{once:!0}),r.click()}catch(r){t(r)}},Pn=n=>n==="camera"?"camera":n==="microphone"||n==="speech"?"microphone":n==="location"?"geolocation":null,On=(n,t,e)=>{const s=Pn(n);if(!s){e(`${n}: not a permission this host asks for`);return}const r=navigator.permissions;if(!(r!=null&&r.query)){t("prompt");return}r.query({name:s}).then(i=>t(i.state),()=>t("prompt"))},Gi=(n,t,e)=>{if(!Pn(n)){e(`${n}: not a permission this host asks for`);return}const s=()=>On(n,t,e);if(n==="location"){if(!navigator.geolocation){t("denied");return}navigator.geolocation.getCurrentPosition(()=>t("granted"),i=>i.code===i.PERMISSION_DENIED?t("denied"):s(),{timeout:15e3,maximumAge:1/0});return}const r=navigator.mediaDevices;if(!(r!=null&&r.getUserMedia)){t("denied");return}r.getUserMedia(n==="camera"?{video:!0}:{audio:!0}).then(i=>{for(const o of i.getTracks())o.stop();t("granted")},i=>{const o=i instanceof Error?i.name:"";o==="NotAllowedError"||o==="SecurityError"?t("denied"):s()})},ji=(n,t)=>({get platform(){return"web"},get language(){return n()},get pixelRatio(){return(t==null?void 0:t())||window.devicePixelRatio||1},vibrate(){var e;try{(e=navigator.vibrate)==null||e.call(navigator,30)}catch{}},clipboardWrite(e){var s;(s=navigator.clipboard)==null||s.writeText(e).catch(()=>{})},clipboardRead(e,s){const r=navigator.clipboard;if(!(r!=null&&r.readText)){s("Clipboard is not available");return}r.readText().then(e,i=>s(i instanceof Error?i.message:"Clipboard read failed"))},share(e){const s=URL.createObjectURL(Ht(e)),r=document.createElement("a");r.href=s,r.download="image.png",document.body.appendChild(r),r.click(),r.remove(),URL.revokeObjectURL(s)},openFilePicker:(e,s,r,i)=>Vi(e,s,r,i??void 0),queryPermission:On,requestPermission:Gi}),zi=(n={})=>({local:t=>pr(t),dispose:t=>ur(t),request(t,e,s,r,i,o,a,c){if(t.startsWith("id:")){const u=Number(t.slice(3));o(u,et(u)?200:404);return}const l={};for(let u=0;u+1<s.length;u+=2)l[s[u]]=s[u+1];let h;if(i.length>0){const u=new FormData;for(const d of i)d.key!==null&&(d.bufferId>0?u.append(d.key,Ht(d.bufferId),d.filename??void 0):u.append(d.key,d.value??""));h=u}else r!==null&&(h=r);(async()=>{var u;try{const d=await fetch(t,{method:e,headers:l,body:h,mode:"cors",credentials:"omit"}),f=c?(u=d.body)==null?void 0:u.getReader():void 0;if(!f){o(ft(await d.arrayBuffer()),d.status);return}const g=Number(d.headers.get("content-length"))||void 0,y=[];let x=0;for(;;){const{done:m,value:E}=await f.read();if(m)break;E&&(y.push(E),x+=E.length,c({loaded:x,total:g}))}const w=new Uint8Array(x);let p=0;for(const m of y)w.set(m,p),p+=m.length;o(ft(w.buffer),d.status)}catch(d){a(d instanceof Error?d.message:String(d))}})()},buffer:t=>{const e=et(t);return e?new Uint8Array(e):null},putBuffer:t=>ft(t.slice().buffer),bufferSlice(t,e,s){const r=et(t);if(!r)return null;const i=Math.max(0,Math.min(e,r.byteLength)),o=Math.max(i,Math.min(s,r.byteLength));return new Uint8Array(r,i,o-i)},systemBuffer:t=>{const e=n[t];return e?new Uint8Array(e):null}}),Xe=["MouseLeft","MouseMiddle","MouseRight","MouseBack","MouseForward"],Jt=["GamepadSouth","GamepadEast","GamepadWest","GamepadNorth","GamepadL1","GamepadR1","GamepadL2","GamepadR2","GamepadSelect","GamepadStart","GamepadL3","GamepadR3","GamepadUp","GamepadDown","GamepadLeft","GamepadRight"],Ot=4,Qt=16,Ye=16,Ki=.5,Xi=n=>{const t=new Set;let e=null;const s=(_,M,U=-1,P=0)=>{e==null||e(_,M,U,P)},r=_=>{if(!_.code)return;const M=t.has(_.code);t.add(_.code),s(0,_.code,-1,M||_.repeat?1:0)},i=_=>{_.code&&t.delete(_.code)&&s(1,_.code)},o=()=>{for(const _ of[...t])_.startsWith("Gamepad")||(t.delete(_),s(1,_))},{root:a}=n;let c=0,l=0,h=0,u=0,d=0,f=0,g=0,y=0,x=0,w=0;const p=_=>{var P;if(_.pointerType&&_.pointerType!=="mouse")return;const M=a.getBoundingClientRect(),U=((P=n.scale)==null?void 0:P.call(n))||1;c=(_.clientX-M.left)/U,l=(_.clientY-M.top)/U,h+=(_.movementX||0)/U,u+=(_.movementY||0)/U},m=_=>{const M=Xe[_.button];M&&(t.add(M),s(0,M))},E=_=>{const M=Xe[_.button];M&&t.delete(M)&&s(1,M)},k=_=>{const M=_.deltaMode===0?.01:1;d+=_.deltaX*M,f+=_.deltaY*M},L=_=>{document.pointerLockElement===a&&_.preventDefault()},O=[],C=[],F=[],W=()=>{var M,U;const _=typeof navigator<"u"&&navigator.getGamepads?Array.from(navigator.getGamepads()):[];for(let P=0;P<Ot;P++){const rt=_[P]??null,Q=!!rt&&rt.connected;if(Q!==!!O[P]){if(O[P]=Q,!Q){for(const D of Jt)t.delete(D+"@"+P)&&(s(1,D,P),$(D));F[P]=[],C[P]=[0,0,0,0,0,0]}s(Q?2:3,"",P)}if(!rt||!Q)continue;const ct=rt.axes,pt=rt.buttons,Rt=((M=pt[6])==null?void 0:M.value)??0,S=((U=pt[7])==null?void 0:U.value)??0;C[P]=[ct[0]??0,ct[1]??0,ct[2]??0,ct[3]??0,Rt,S];const N=F[P]??(F[P]=[]);for(let D=0;D<Jt.length;D++){const Z=pt[D],st=!!Z&&(Z.pressed||Z.value>Ki);if(st===!!N[D])continue;N[D]=st;const At=Jt[D];st?t.add(At+"@"+P):t.delete(At+"@"+P),$(At),s(st?0:1,At,P)}}},$=_=>{let M=!1;for(let U=0;U<Ot&&!M;U++)t.has(_+"@"+U)&&(M=!0);M?t.add(_):t.delete(_)};let j=0;const q=()=>{g=h,y=u,x=d,w=f,h=u=d=f=0,W(),j=requestAnimationFrame(q)},A=n.windows.filter((_,M,U)=>_&&U.indexOf(_)===M);for(const _ of A)n.keyboard!==!1&&(_.addEventListener("keydown",r),_.addEventListener("keyup",i)),_.addEventListener("blur",o);return a.addEventListener("pointermove",p,!0),a.addEventListener("mousedown",m,!0),window.addEventListener("mouseup",E,!0),a.addEventListener("wheel",k,{passive:!0,capture:!0}),a.addEventListener("contextmenu",L,!0),typeof requestAnimationFrame=="function"&&(j=requestAnimationFrame(q)),{inputKey:(_,M)=>M>=0&&_.startsWith("Gamepad")?t.has(_+"@"+M):t.has(_),inputRead:_=>{var M;switch(_){case 0:return c;case 1:return l;case 2:return g;case 3:return y;case 4:return x;case 5:return w;case 6:return document.pointerLockElement===a?1:0;case 7:{let U=0;for(let P=0;P<Ot;P++)O[P]&&U++;return U}}if(_>=Qt){const U=Math.floor((_-Qt)/Ye),P=(_-Qt)%Ye;return U>=Ot||!O[U]?0:P===0?1:((M=C[U])==null?void 0:M[P-1])??0}return 0},inputSetPointerLock:_=>{if(!_)return document.pointerLockElement===a&&document.exitPointerLock(),!0;if(document.pointerLockElement===a)return!0;if(typeof a.requestPointerLock!="function")return!1;try{const M=a.requestPointerLock({unadjustedMovement:!0});return M&&typeof M.catch=="function"&&M.catch(()=>{try{a.requestPointerLock()}catch{}}),!0}catch{return!1}},registerInputEvent:_=>{e=_},dispose:()=>{for(const _ of A)_.removeEventListener("keydown",r),_.removeEventListener("keyup",i),_.removeEventListener("blur",o);a.removeEventListener("pointermove",p,!0),a.removeEventListener("mousedown",m,!0),window.removeEventListener("mouseup",E,!0),a.removeEventListener("wheel",k,!0),a.removeEventListener("contextmenu",L,!0),j&&cancelAnimationFrame(j),document.pointerLockElement===a&&document.exitPointerLock(),t.clear(),e=null}}},Yi=n=>{const t=Xi(n);return t.registerInputEvent(n.push),{table:{key:t.inputKey,read:t.inputRead,setPointerLock:t.inputSetPointerLock,keyboardHeight:n.keyboardHeight},dispose:t.dispose}},qi={createVideo:Mr,createAudio:Lr,setVolume:Pr,setPlaying:Or,setLoop:Cr,time:Ir,setTime:Fr,duration:Nr,remove:Ur},Ji=()=>{const n=new Map,t=new Map,e=new Map;let s=1;return{registerService:(d,f,g=1)=>{n.set(d,f),t.set(d,g)},unregisterService:d=>{n.delete(d),t.delete(d)},isServiceSupported:d=>n.has(d),serviceVersion:d=>t.get(d)??0,serviceOpen:(d,f,g)=>{const y=n.get(d);if(!y)return-1;const x=s++,w=y(f?JSON.parse(f):{},{emit:(p,m)=>{m===void 0?g(p):g(p,m)}});return e.set(x,w),x},serviceCall:(d,f,g,y,x)=>{const w=e.get(d);if(!(w!=null&&w.call)){x(`Service call "${f}": no live session or no call handler (serviceId ${d})`);return}try{Promise.resolve(w.call(f,Array.isArray(g)?g:[])).then(p=>{p===void 0?y():y(p)},p=>x(p instanceof Error?p.message:String(p)))}catch(p){x(p instanceof Error?p.message:String(p))}},serviceClose:d=>{var f,g;(g=(f=e.get(d))==null?void 0:f.close)==null||g.call(f),e.delete(d)},destroy:()=>{var d;for(const f of e.values())(d=f.close)==null||d.call(f);e.clear()}}},Qi=()=>{const n=Ji();return{table:{supported:n.isServiceSupported,version:n.serviceVersion,open:n.serviceOpen,call:n.serviceCall,close:n.serviceClose},registerService:n.registerService,unregisterService:n.unregisterService,dispose:n.destroy}},Zi=()=>{const n=[];return{table:{open(e,s){const r=new WebSocket(e);return r.addEventListener("open",()=>s("open")),r.addEventListener("message",i=>s("message",i.data)),r.addEventListener("close",i=>s("close",i.code)),r.addEventListener("error",()=>s("error")),n.push(r),n.length-1},send(e,s){var r;(r=n[e])==null||r.send(s)},close(e){var s;(s=n[e])==null||s.close()}},dispose(){for(const e of n)e.readyState===WebSocket.OPEN&&e.close();n.length=0}}},to=n=>{const t=e=>`lecodes:${n}:${e}`;return{load(e){try{return window.localStorage.getItem(t(e))}catch{return null}},save(e,s){try{window.localStorage.setItem(t(e),s)}catch{}}}},qe=()=>{const n={};return{global:n,evaluate:e=>{const s=Object.getOwnPropertyNames(n);return new Function(...s,e)(...s.map(r=>n[r]))}}},eo={fetch:hr,getBuffer:et,getBlob:Ht,putBuffer:ft,putLocalBuffer:dr,hasLocalBuffer:fr,getLocalName:gr,getPlayer:ge,removePlayers:wn},no=(n,t)=>({nodeFactory(){},setPropertyString(){},setPropertyInt(){},setFlags(){},insertNode(){},removeNode(){},releaseNode(){},openView(e,s,r){n(e,r)},dropView(e,s,r){t(e,r)},closeView(){n(-1,0)},layerOpen(){},layerClose(){},registerFont(e,s,r,i,o){o()},showToast(){},getButtonPressed:()=>!1,getTextValue:()=>"",vlistScroll(){}}),ro=async(n,t={})=>{var Rt;const e=t.header,s=t.profile??(e?Ai(e):"full"),r=(e==null?void 0:e.preloads)??new Set,i=t.ui!==!1,o=s==="full",a=s==="2d"||s==="full"&&!!(e!=null&&e.is2d),c=Mi(n,t.scale??1),{doc:l,win:h}=c,u=i?Promise.all([ui(void 0,l),li((e==null?void 0:e.bootFonts)??[],l)]):null,d=o?vi(c,r.has("capture")):null,f=a?xi(c):null,g=i?c.newCanvas():null,y=Ri(h,o);o&&lr();const[x,w]=await Promise.all([Yn(s,{glContext:d==null?void 0:d.context,glOptions:d==null?void 0:d.options,gl2dContext:f==null?void 0:f.context,gl2dOptions:f==null?void 0:f.options,moduleArgs:{print:S=>{y.runtimeLine(S)?console.debug(S):console.log(S)},printErr:S=>{console.error(S)}}}),o?Hi(r):Promise.resolve({})]),p=(S,N)=>{const D=x.stringToNewUTF8(S);try{return N(D)}finally{x._free(D)}};let m=null,E=-1,k=-1,L=-1;const O=(S,N)=>{k=S,L=S===Mt?N:-1,S===Mt&&(d==null||d.show()),S===Oe&&(f==null||f.show()),m&&S===Mt&&N!==E&&(E=N,m.openScene(N))},C=S=>{S!==k&&(S===Mt&&(d==null||d.hide(),m&&E>=0&&(E=-1,m.closeScene())),S===Oe&&(f==null||f.hide()))};let F=null;const W=Li(o||t.engine3d?{creator:()=>F==null?void 0:F._creator,surface:d,presented:()=>L,frameRendered:()=>{var S;return!!((S=x._creatorWebFrameRendered)!=null&&S.call(x))},view:(d==null?void 0:d.canvas)??n}:null),$=oi();let j=t.keyboardBand??0;const A=g?Ys(n,{M:x,canvas:g,canvasHost:$,keyboardHeight:()=>{const S=h.visualViewport,N=S?Math.max(0,Math.round((h.innerHeight-S.height-S.offsetTop)/(It(n)*c.scale()))):0;return N>0?N:j},onKeyboard:t.onKeyboard}):null;A&&(A.ui.onDestination=O,A.ui.onDropped=C);const v=$i({onOrientation:t.onOrientation,onWorldChange:()=>W.worldChanged(),push:(S,N)=>{S==="url"&&N!==void 0&&p(N,D=>x._creatorWebSetLaunchUrl(D)),p(S,D=>{N===void 0?x._creatorWebAppEvent(D,0):p(N,Z=>x._creatorWebAppEvent(D,Z))})}}),T=Zi(),I=Qi(),z=Yi({windows:[...new Set([h,...t.keyboardTargets??[]])],root:n,keyboard:t.keyboard!==!1,scale:()=>It(n)*c.scale(),push:(S,N,D,Z)=>p(N,st=>x._creatorWebInputEvent(S,st,D,Z)),keyboardHeight:()=>(A==null?void 0:A.ui.keyboardHeight())??0}),J={ui:(A==null?void 0:A.ui)??no(O,C),app:v.table,device:ji(t.language??(()=>(h.navigator.language||"en").slice(0,2)),()=>c.size().factor),fetch:zi(w),storage:to(t.project??(e==null?void 0:e.name)??"app"),socket:T.table,service:I.table,input:z.table,media:qi,canvas:$.table,...d?{gl:d.table(x)}:{},...f?{scene2d:f.table(x)}:{}},_=qe(),M=_.global;F=M,sr(x,{host:J,world:_,newWorld:()=>{const S=qe();return F=S.global,S}});const U=Pi({...A?{registerView:(S,N,D)=>A.ui.registerView(S,N,D),unregisterView:S=>A.ui.unregisterView(S)}:{},registerService:I.registerService,unregisterService:I.unregisterService},W.facade);x._creatorWebInit(),t.launchUrl&&p(t.launchUrl,S=>x._creatorWebSetLaunchUrl(S)),A==null||A.ui.install(),!o&&t.engine3d&&(m=await t.engine3d({newCanvas:c.newCanvas,preloads:r,canvasHost:$,stores:eo}),Object.defineProperty(M,"_creator",{value:m,configurable:!0,writable:!0,enumerable:!1})),o&&(e==null?void 0:e.gl)!=="defer"&&((Rt=M._creator)==null||Rt.createEngine());const P=Oi(n);t.safeArea&&P.set(t.safeArea);const rt=S=>{var N;d==null||d.resize(),f==null||f.resize(),(N=m==null?void 0:m._onResize)==null||N.call(m,S.width,S.height,S.factor),A?(A.resize(S.width,S.height,S.factor,S.scale),A.setSafeArea(P.current())):x._creatorWebResize(S.width,S.height)};c.onResize(rt),rt(c.size());let Q=0;const ct=S=>{Q=h.requestAnimationFrame(ct),W.before(),d==null||d.frame(),x._creatorWebTick(S),W.after(),f==null||f.frame(S),A&&(A.ui.layoutFrame(),A.ui.tickHover(),A.render())};Q=h.requestAnimationFrame(ct),await u;let pt=!1;return{profile:s,M:x,world:M,ui:(A==null?void 0:A.ui)??null,engine3d:()=>m,getBuffer:S=>et(S),run(S,N={}){const D=N.header??Ln(S);if(!di(D.sdk,Ve))throw new Error(`This app was built with LeCodes SDK ${D.sdk??"older than 2.0"}; this host runs SDK ${Ve}. It needs a new build.`);const Z=y.track(S,N.onError);return U.allow(D.plugins),p(S,st=>x._creatorWebRun(st)),{dispose:Z.drop}},registerPlugin:(S,N)=>U.register(S,N),hasPlugin:U.has,locate:y.locate,safeArea:()=>P.current(),setSafeArea(S){P.set(S),A==null||A.setSafeArea(P.current())},setKeyboardBand(S){j=S??0,A==null||A.ui.refreshKeyboard()},remeasure:c.remeasure,setScale:c.setScale,size:c.size,emitAppEvent:v.emit,destroy(){var S;pt||(pt=!0,h.cancelAnimationFrame(Q),y.dispose(),A==null||A.destroy(),z.dispose(),T.dispose(),I.dispose(),v.dispose(),wn(),P.destroy(),(S=m==null?void 0:m._dispose)==null||S.call(m),d==null||d.destroy(),f==null||f.destroy(),c.destroy())}}},so=(n,t,e,s)=>new Promise(r=>{const i=n.ownerDocument.defaultView??window;i.requestAnimationFrame(()=>{try{const o=[...n.querySelectorAll("canvas")].filter(h=>h.width>0&&h.height>0&&i.getComputedStyle(h).display!=="none");if(o.length===0||t<=0||e<=0){r(null);return}const a=s??Math.max(...o.map(h=>h.width))/t,c=n.ownerDocument.createElement("canvas");c.width=Math.max(1,Math.round(t*a)),c.height=Math.max(1,Math.round(e*a));const l=c.getContext("2d");if(!l){r(null);return}l.fillStyle="#000000",l.fillRect(0,0,c.width,c.height);for(const h of o)l.drawImage(h,0,0,h.width,h.height,0,0,c.width,c.height);r(c.toDataURL("image/png"))}catch{r(null)}})}),io=n=>{if(typeof n=="string")return n;if(n instanceof Error)return n.stack?`${String(n)}
19
19
  ${n.stack}`:String(n);try{return JSON.stringify(n)}catch{return String(n)}},oo=(n,t)=>{const e=o=>{fetch(`${n}/log`,{method:"POST",body:JSON.stringify(o),headers:{"content-type":"application/json"},keepalive:!0}).catch(()=>{})};let s=-1;const r=async()=>{try{const{v:o}=await(await fetch(`${n}/version`,{cache:"no-store"})).json();typeof o=="number"&&t(o)}catch{}setTimeout(r,2500)};setTimeout(r,2500);const i=()=>{let o;try{o=new WebSocket(n.replace(/^http/,"ws")+"/ws")}catch{return}o.onopen=()=>o.send(JSON.stringify({type:"hello",v:s})),o.onmessage=a=>{let c={};try{c=JSON.parse(String(a.data))}catch{return}c.type==="reload"&&typeof c.v=="number"&&t(c.v)},o.onclose=()=>{setTimeout(i,2e3)}};return i(),{bundleUrl:o=>`${n}/bundle.js?t=web&v=${o}`,versionOf(o,a){const c=Number(o.headers.get("x-lecodes-v"));return o.headers.has("x-lecodes-v")&&Number.isFinite(c)?c:a},ran(o){s=o},log:(o,a)=>e({type:"log",level:o,text:a.map(io).join(" ")}),error:o=>e({type:"error",text:o})}},ao={ar:()=>H(()=>import("./assets/ar-mVXX3kRQ.js"),[],import.meta.url).then(n=>t=>n.register(t,()=>H(()=>import("./assets/ar-D6oDL4pw.js"),[],import.meta.url).then(e=>e.resources))),"audio-recorder":()=>H(()=>import("./assets/audio-recorder-Bt-Caym7.js"),[],import.meta.url).then(n=>t=>n.register(t)),browser:()=>H(()=>import("./assets/browser-BpFb50ko.js"),[],import.meta.url).then(n=>t=>n.register(t)),camera:()=>H(()=>import("./assets/camera-5XOM8eHl.js"),[],import.meta.url).then(n=>t=>n.register(t)),geolocation:()=>H(()=>import("./assets/geolocation-BjTKN9_P.js"),[],import.meta.url).then(n=>t=>n.register(t)),map:()=>H(()=>import("./assets/map-8PhtP3jn.js").then(n=>n.m),[],import.meta.url).then(n=>t=>n.register(t,()=>H(()=>import("./assets/map-CyBxOSV0.js"),[],import.meta.url).then(e=>e.resources))),"qr-scanner":()=>H(()=>import("./assets/qr-scanner-CK_cYoJR.js"),[],import.meta.url).then(n=>t=>n.register(t)),speech:()=>H(()=>import("./assets/speech-DzDPVK_j.js"),[],import.meta.url).then(n=>t=>n.register(t)),webrtc:()=>H(()=>import("./assets/webrtc-CbCltXvl.js"),[],import.meta.url).then(n=>t=>n.register(t))},co=async(n,t)=>{await Promise.all([...t].map(async e=>{const s=ao[e];if(!(!s||n.hasPlugin(e)))try{n.registerPlugin(e,await s())}catch(r){console.warn(`[lecodes] the "${e}" plugin failed to load: ${r instanceof Error?r.message:String(r)}`)}}))},me=n=>typeof n=="object"&&n!==null,at=n=>typeof n=="number"&&Number.isFinite(n),lo=n=>{if(!me(n))return null;switch(n.ask){case"tree":return{ask:"tree"};case"text":return{ask:"text"};case"at":return at(n.x)&&at(n.y)?{ask:"at",x:n.x,y:n.y}:null;case"node":return at(n.node)?{ask:"node",node:n.node}:null;default:return null}},Cn=n=>{if(!me(n))return null;const t=s=>typeof s=="number"&&Number.isFinite(s)&&s>=0?Math.round(s):0,e=Array.isArray(n.bars)?n.bars.filter(s=>s==="top"||s==="right"||s==="bottom"||s==="left"):void 0;return{top:t(n.top),right:t(n.right),bottom:t(n.bottom),left:t(n.left),...e?{bars:e}:{}}},ho=n=>{const t=Number(n.get("keyboard-band"));return Number.isFinite(t)&&t>0?t:null},In=n=>at(n)&&n>0?Math.min(4,n):null,uo=n=>In(Number(n.get("scale"))),fo=n=>{const t=n.get("safe-area");if(!t)return null;const[e,s,r,i]=t.split(",").map(Number);return Cn({top:e,right:s,bottom:r,left:i,bars:(n.get("bars")??"").split(",")})},go=n=>{if(!me(n))return null;switch(n.type){case"lecodes:run":return typeof n.src=="string"?{type:"lecodes:run",src:n.src}:null;case"lecodes:reload":return{type:"lecodes:reload"};case"lecodes:safe-area":return{type:"lecodes:safe-area",insets:Cn(n.insets)};case"lecodes:language":return typeof n.language=="string"&&n.language?{type:"lecodes:language",language:n.language}:null;case"lecodes:keyboard-band":return{type:"lecodes:keyboard-band",height:at(n.height)&&n.height>0?n.height:null};case"lecodes:scale":{const t=In(n.scale);return t===null?null:{type:"lecodes:scale",scale:t}}case"lecodes:inspect":{const t=lo(n.question);return t&&at(n.request)?{type:"lecodes:inspect",request:n.request,question:t}:null}case"lecodes:capture":{if(!at(n.request))return null;const t=at(n.pixelRatio)&&n.pixelRatio>0?Math.min(4,n.pixelRatio):void 0;return{type:"lecodes:capture",request:n.request,...t!==void 0?{pixelRatio:t}:{}}}default:return null}},po=(n,t)=>{try{const e=new URL(n,t);return e.origin===new URL(t).origin&&(e.protocol==="http:"||e.protocol==="https:")?e.href:null}catch{return null}},mo=(n,t)=>{const e=n.parent!==n?n.parent:null,s=r=>{if(!e||r.source!==e)return;const i=go(r.data);i&&t(i)};return n.addEventListener("message",s),{embedded:e!==null,post(r){e==null||e.postMessage(r,"*")},close(){n.removeEventListener("message",s)}}},Tt=window.lecodesPlayerConfig??{},xt=document.getElementById("app"),Zt=document.getElementById("loader"),Je=document.getElementById("error"),nt=new URLSearchParams(location.search),Fn=n=>Zt==null?void 0:Zt.classList.toggle("on",n),Nn=n=>{Je&&(Je.textContent=window.parent===window?n:"")};let ue=Tt.language||nt.get("lang")||(navigator.language||"en").slice(0,2),Ut=Tt.safeArea??fo(nt),Bt=Tt.keyboardBand??ho(nt),tt=Tt.scale??uo(nt)??1,B=null;const Qe=()=>{var n;return(n=B==null?void 0:B.world)==null?void 0:n._creatorTree},Dt=nt.has("test")?{ready:!1,dump:()=>{var n;return((n=Qe())==null?void 0:n.debugDump())??'{"roots":[]}'},rect:n=>{var s;const t=(s=Qe())==null?void 0:s.getBoundingClientRect(n);if(!t)return null;const e=xt.getBoundingClientRect();return[e.left+t[0]*tt,e.top+t[1]*tt,t[2]*tt,t[3]*tt]}}:null;Dt&&(window.lecodesTest=Dt);const yo=nt.has("inspect"),de=yo?H(()=>import("./assets/inspect-FppKjiJX.js"),[],import.meta.url):null;let vt=null;const wo=async(n,t)=>{const{createInspector:e}=await(de??H(()=>import("./assets/inspect-FppKjiJX.js"),[],import.meta.url));B&&vt===null&&(vt=e(B)),Y.post({type:"lecodes:inspected",request:n,answer:(vt==null?void 0:vt.answer(t))??null})},Ze=nt.has("dev")?new URL(nt.get("dev")||"..",location.href).href.replace(/\/$/,""):null,tn=n=>{var s;const t=n.frames[0],e=t?`
20
20
  at ${t.source}:${t.line}:${t.column}${t.fn?` (${t.fn})`:""}`:(s=n.nativeFrames)!=null&&s.length?`
21
- in ${n.nativeFrames[0]}`:"";return`${n.detail?`${n.message}: ${n.detail}`:n.message}${e}`},Un=n=>{Nn(tn(n)),Y.post({type:"lecodes:error",error:n}),K==null||K.error(tn(n))},Bn=n=>Un({message:n,frames:[]});let dt=null,te=!1,ee=null;const bo=async n=>{Fn(!0),Nn(""),B==null||B.destroy(),B=null,vt=null,xt.replaceChildren();const t=await fetch(n.src,{cache:"no-store"});if(!t.ok)throw new Error(t.status===503?"No successful compile yet — check the terminal.":`${n.src} → HTTP ${t.status}`);const e=await t.text(),s=Ln(e);B=await ro(xt,{header:s,language:()=>ue,launchUrl:location.href,...Ut?{safeArea:Ut}:{},...Bt?{keyboardBand:Bt}:{},scale:tt,...Y.embedded?{onKeyboard:(r,i)=>Y.post({type:"lecodes:keyboard",height:r,duration:i})}:{},...Y.embedded?{onOrientation:r=>Y.post({type:"lecodes:orientation",mode:r})}:{}}),await co(B,s.plugins),de&&(await de).recordSites(B),B.run(e,{onError:Un}),Dt&&(Dt.ready=!0),K&&n.version!==void 0&&(Wt=K.versionOf(t,n.version),K.ran(Wt)),Y.post({type:"lecodes:ready",src:n.src})},gt=n=>{if(te){ee=n;return}te=!0,dt=n,bo(n).catch(t=>Bn(t instanceof Error?t.message:String(t))).finally(()=>{Fn(!1),te=!1;const t=ee;ee=null,t&&gt(t)})},ye=n=>{const t=po(n,location.href);t?gt({src:t}):Bn(`The player runs bundles of its own origin only: ${n}`)},Dn=n=>{Ut=n,B==null||B.setSafeArea(Ut)},vo=n=>{Bt=n,B==null||B.setKeyboardBand(Bt)},Wn=n=>{tt=n,B==null||B.setScale(tt)},Hn=async n=>{const t=B==null?void 0:B.size(),[e,s]=t?[t.width,t.height]:[Math.round(xt.clientWidth/tt),Math.round(xt.clientHeight/tt)];return{image:B?await so(xt,e,s,n):null,width:e,height:s}},Y=mo(window,n=>{switch(n.type){case"lecodes:run":ye(n.src);break;case"lecodes:reload":dt&&gt(dt);break;case"lecodes:safe-area":Dn(n.insets);break;case"lecodes:keyboard-band":vo(n.height);break;case"lecodes:scale":Wn(n.scale);break;case"lecodes:inspect":wo(n.request,n.question);break;case"lecodes:capture":Hn(n.pixelRatio).then(t=>Y.post({type:"lecodes:captured",request:n.request,...t}));break;case"lecodes:language":if(n.language===ue)break;ue=n.language,dt&&gt(dt);break}});let Wt=-1;const K=Ze?oo(Ze,n=>{Wt>=0&&n!==Wt&&gt({src:K.bundleUrl(n),version:n})}):null;if(K||Y.embedded){let n=!1;for(const t of["log","warn","error"]){const e=console[t];console[t]=(...s)=>{if(e.apply(console,s),!(n||typeof s[0]=="string"&&s[0].startsWith("[lecodes] "))){n=!0;try{K==null||K.log(t,s),Y.post({type:"lecodes:log",level:t,text:s.map(r=>typeof r=="string"?r:r instanceof Error?String(r):(()=>{try{return JSON.stringify(r)}catch{return String(r)}})()).join(" ")})}finally{n=!1}}}}}window.lecodesPlayer={version:"b3916045-2026-11-06",get host(){return B},run:ye,reload(){dt&&gt(dt)},setSafeArea:Dn,setScale:Wn,capture:async n=>(await Hn(n)).image};const en=Tt.src??nt.get("src");K?gt({src:K.bundleUrl(0),version:0}):en&&ye(en);export{H as _};
21
+ in ${n.nativeFrames[0]}`:"";return`${n.detail?`${n.message}: ${n.detail}`:n.message}${e}`},Un=n=>{Nn(tn(n)),Y.post({type:"lecodes:error",error:n}),K==null||K.error(tn(n))},Bn=n=>Un({message:n,frames:[]});let dt=null,te=!1,ee=null;const bo=async n=>{Fn(!0),Nn(""),B==null||B.destroy(),B=null,vt=null,xt.replaceChildren();const t=await fetch(n.src,{cache:"no-store"});if(!t.ok)throw new Error(t.status===503?"No successful compile yet — check the terminal.":`${n.src} → HTTP ${t.status}`);const e=await t.text(),s=Ln(e);B=await ro(xt,{header:s,language:()=>ue,launchUrl:location.href,...Ut?{safeArea:Ut}:{},...Bt?{keyboardBand:Bt}:{},scale:tt,...Y.embedded?{onKeyboard:(r,i)=>Y.post({type:"lecodes:keyboard",height:r,duration:i})}:{},...Y.embedded?{onOrientation:r=>Y.post({type:"lecodes:orientation",mode:r})}:{}}),await co(B,s.plugins),de&&(await de).recordSites(B),B.run(e,{onError:Un}),Dt&&(Dt.ready=!0),K&&n.version!==void 0&&(Wt=K.versionOf(t,n.version),K.ran(Wt)),Y.post({type:"lecodes:ready",src:n.src})},gt=n=>{if(te){ee=n;return}te=!0,dt=n,bo(n).catch(t=>Bn(t instanceof Error?t.message:String(t))).finally(()=>{Fn(!1),te=!1;const t=ee;ee=null,t&&gt(t)})},ye=n=>{const t=po(n,location.href);t?gt({src:t}):Bn(`The player runs bundles of its own origin only: ${n}`)},Dn=n=>{Ut=n,B==null||B.setSafeArea(Ut)},vo=n=>{Bt=n,B==null||B.setKeyboardBand(Bt)},Wn=n=>{tt=n,B==null||B.setScale(tt)},Hn=async n=>{const t=B==null?void 0:B.size(),[e,s]=t?[t.width,t.height]:[Math.round(xt.clientWidth/tt),Math.round(xt.clientHeight/tt)];return{image:B?await so(xt,e,s,n):null,width:e,height:s}},Y=mo(window,n=>{switch(n.type){case"lecodes:run":ye(n.src);break;case"lecodes:reload":dt&&gt(dt);break;case"lecodes:safe-area":Dn(n.insets);break;case"lecodes:keyboard-band":vo(n.height);break;case"lecodes:scale":Wn(n.scale);break;case"lecodes:inspect":wo(n.request,n.question);break;case"lecodes:capture":Hn(n.pixelRatio).then(t=>Y.post({type:"lecodes:captured",request:n.request,...t}));break;case"lecodes:language":if(n.language===ue)break;ue=n.language,dt&&gt(dt);break}});let Wt=-1;const K=Ze?oo(Ze,n=>{Wt>=0&&n!==Wt&&gt({src:K.bundleUrl(n),version:n})}):null;if(K||Y.embedded){let n=!1;for(const t of["log","warn","error"]){const e=console[t];console[t]=(...s)=>{if(e.apply(console,s),!(n||typeof s[0]=="string"&&s[0].startsWith("[lecodes] "))){n=!0;try{K==null||K.log(t,s),Y.post({type:"lecodes:log",level:t,text:s.map(r=>typeof r=="string"?r:r instanceof Error?String(r):(()=>{try{return JSON.stringify(r)}catch{return String(r)}})()).join(" ")})}finally{n=!1}}}}}window.lecodesPlayer={version:"4a7100c2-2026-11-06",get host(){return B},run:ye,reload(){dt&&gt(dt)},setSafeArea:Dn,setScale:Wn,capture:async n=>(await Hn(n)).image};const en=Tt.src??nt.get("src");K?gt({src:K.bundleUrl(0),version:0}):en&&ye(en);export{H as _};
@@ -1,5 +1,5 @@
1
1
  var Zn=Object.defineProperty;var er=(e,t,n)=>t in e?Zn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var qe=(e,t,n)=>er(e,typeof t!="symbol"?t+"":t,n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();const tr=e=>{if(typeof e=="string")return e;if(e instanceof Error)return e.stack?`${String(e)}
2
- ${e.stack}`:String(e);try{return JSON.stringify(e)}catch{return String(e)}},nr=(e,t)=>{const n=s=>{fetch(`${e}/log`,{method:"POST",body:JSON.stringify(s),headers:{"content-type":"application/json"},keepalive:!0}).catch(()=>{})};let r=-1;const o=async()=>{try{const{v:s}=await(await fetch(`${e}/version`,{cache:"no-store"})).json();typeof s=="number"&&t(s)}catch{}setTimeout(o,2500)};setTimeout(o,2500);const i=()=>{let s;try{s=new WebSocket(e.replace(/^http/,"ws")+"/ws")}catch{return}s.onopen=()=>s.send(JSON.stringify({type:"hello",v:r})),s.onmessage=l=>{let d={};try{d=JSON.parse(String(l.data))}catch{return}d.type==="reload"&&typeof d.v=="number"&&t(d.v)},s.onclose=()=>{setTimeout(i,2e3)}};return i(),{bundleUrl:s=>`${e}/bundle.js?t=web&v=${s}`,versionOf(s,l){const d=Number(s.headers.get("x-lecodes-v"));return s.headers.has("x-lecodes-v")&&Number.isFinite(d)?d:l},ran(s){r=s},log:(s,l)=>n({type:"log",level:s,text:l.map(tr).join(" ")}),error:s=>n({type:"error",text:s})}},rr=(e,t)=>{try{const n=new URL(e,t);return n.origin===new URL(t).origin&&(n.protocol==="http:"||n.protocol==="https:")?n.href:null}catch{return null}},mn=(e,t)=>{const n=[];for(const r of t){const o=r.halves[e];for(const i of typeof o=="string"?[o]:Array.isArray(o)?o:[]){if(typeof i!="string"||!i)continue;const s=new URL(i,r.url).href;n.includes(s)||n.push(s)}}return n},or="modulepreload",sr=function(e,t){return new URL(e,t).href},Tt={},ce=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){let s=function(E){return Promise.all(E.map(_=>Promise.resolve(_).then(A=>({status:"fulfilled",value:A}),A=>({status:"rejected",reason:A}))))};const l=document.getElementsByTagName("link"),d=document.querySelector("meta[property=csp-nonce]"),u=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));o=s(n.map(E=>{if(E=sr(E,r),E in Tt)return;Tt[E]=!0;const _=E.endsWith(".css"),A=_?'[rel="stylesheet"]':"";if(!!r)for(let y=l.length-1;y>=0;y--){const v=l[y];if(v.href===E&&(!_||v.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${E}"]${A}`))return;const p=document.createElement("link");if(p.rel=_?"stylesheet":or,_||(p.as="script"),p.crossOrigin="",p.href=E,u&&p.setAttribute("nonce",u),document.head.appendChild(p),_)return new Promise((y,v)=>{p.addEventListener("load",y),p.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${E}`)))})}))}function i(s){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=s,window.dispatchEvent(l),!l.defaultPrevented)throw s}return o.then(s=>{for(const l of s||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})},Lt="2.8.1",Xe=e=>{const t=e==null?void 0:e.match(/^(\d+)\.\d+\.\d+/);return t?Number(t[1]):null},ir=(e,t)=>Xe(e)!==null&&Xe(e)===Xe(t),ar=(e,t="woff2")=>{const n=/^\/\/ fonts: (.+)$/m.exec(e);if(!n)return[];const r=[];for(const o of n[1].split(";")){const i=o.indexOf("=");if(i===-1)continue;const s=/^(.+)@(\d+)(i?)$/.exec(o.slice(0,i));s&&r.push({family:s[1],weight:parseInt(s[2],10),italic:s[3]==="i",url:o.slice(i+1).replace("{fmt}",t)})}return r},lr=async(e,t,n=2e3)=>{const r=t??(typeof document>"u"?void 0:document);if(!(r!=null&&r.fonts)||e.length===0)return;const o=[];for(const i of e)try{const s=new FontFace(i.family,`url("${i.url}")`,{weight:String(i.weight),style:i.italic?"italic":"normal"});r.fonts.add(s),o.push(s.load().catch(()=>{}))}catch{}await Promise.race([Promise.all(o),new Promise(i=>setTimeout(i,n))])},cr=e=>{var d,u,E,_;const t=e.slice(0,2e3),n=new Set,r=t.match(/\/\/ preload: (.+)/);if(r)for(const A of r[1].split(";"))n.add(A);const o=t.includes("// gl: disable")?"off":t.includes("// gl: defer")?"defer":"on",i=((d=t.match(/^\/\/ sdk: (\d+\.\d+\.\d+\S*)/m))==null?void 0:d[1])??null,s=((E=(u=t.match(/^\/\/ name: (.+)$/m))==null?void 0:u[1])==null?void 0:E.trim())??null,l=new Set((((_=t.match(/^\/\/ plugins: (.+)$/m))==null?void 0:_[1])??"").split(";").map(A=>A.trim()).filter(Boolean));return{sdk:i,name:s,preloads:n,gl:o,is2d:t.includes("// 2d: enable"),plugins:l,bootFonts:ar(t)}},ur=1,fr=2,dr=3,pr=4,hr=5,mr=6,xt=7,gr=8,Rt=9,br=10,yr=11,vr=12,Er=13,wr=14,Sr=15,_r=16,At=17,kr=18,Tr=19,Ue=20,xi=21,Ri=22,Ai=23,Ci=24,$i=25,Lr=26,xr=27,Rr=28,Ar=29,Ct=30,$t=31,Cr=32,$r=33,Ot=34,Ut=35,Mt=36,Ie=1,Or=2,Ur=4,he=8,Mr=16,Je=32,Pr=64,Qe=128,Nr=256,Fr=512,Ir=1024,Dr=2048,Br=4096,Pt=8192,Oi=16384,Vr=32768,Wr=1<<18,zr=255,Nt=256,Ft=512,Gr=1024,te=0,jr=1,Hr=2,Kr=3,We=4,ve=255,gn=e=>{const t=e.clientWidth;if(!t)return 1;const n=e.getBoundingClientRect().width;return n>0?n/t:1},It={text:{type:"text"},password:{type:"password"},search:{type:"search"},tel:{type:"tel"},email:{type:"email"},url:{type:"url"},number:{type:"text",mode:"numeric"},decimal:{type:"text",mode:"decimal"},date:{type:"date"},time:{type:"time"}},Dt=(e,t)=>e==null?t:e===!0||e==="true"||e==="1"||typeof e=="number"&&e>.5,oe=(e,t,n)=>{n===null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)},Yr=(e,t)=>{if(e.type!=="input"&&e.type!=="textarea")return;const n=e.el,r=t("placeholder");if(oe(n,"placeholder",r==null?null:String(r)),e.type==="input"){const l=It[String(t("type")??"text")]??It.text,d=n;d.type!==l.type&&(d.type=l.type),oe(n,"inputmode",l.mode??null);const u=t("enterKey");oe(n,"enterkeyhint",u==null?null:String(u))}const o=t("autocapitalize");oe(n,"autocapitalize",o==null?null:String(o));const i=t("autocorrect");i==null?(oe(n,"autocorrect",null),oe(n,"spellcheck",null)):(oe(n,"autocorrect",Dt(i,!0)?"on":"off"),oe(n,"spellcheck",Dt(i,!0)?"true":"false"));const s=Number(t("maxLength")??0);oe(n,"maxlength",s>0?String(Math.round(s)):null)},ze={width:"layout",height:"layout",minWidth:"layout",minHeight:"layout",maxWidth:"layout",maxHeight:"layout",flexBasis:"layout",flexGrow:"layout",flexShrink:"layout",aspectRatio:"layout",gap:"layout",rowGap:"layout",columnGap:"layout",padding:"layout",paddingTop:"layout",paddingRight:"layout",paddingBottom:"layout",paddingLeft:"layout",paddingHorizontal:"layout",paddingVertical:"layout",paddingStart:"layout",paddingEnd:"layout",margin:"layout",marginTop:"layout",marginRight:"layout",marginBottom:"layout",marginLeft:"layout",marginHorizontal:"layout",marginVertical:"layout",marginStart:"layout",marginEnd:"layout",left:"layout",right:"layout",top:"layout",bottom:"layout",start:"layout",end:"layout",inset:"layout",flexDirection:"enum",justifyContent:"enum",alignItems:"enum",alignSelf:"enum",position:"enum",flexWrap:"enum",boxSizing:"enum",display:"enum",overflow:"enum",scrollDirection:"enum",borderWidth:"len",borderTopWidth:"len",borderRightWidth:"len",borderBottomWidth:"len",borderLeftWidth:"len",borderHorizontalWidth:"len",borderVerticalWidth:"len",borderStartWidth:"len",borderEndWidth:"len",color:"color",backgroundColor:"color",borderColor:"color",borderTopColor:"color",borderRightColor:"color",borderBottomColor:"color",borderLeftColor:"color",placeholderColor:"color",refreshControlColor:"color",tintColor:"color",rippleColor:"color",overlayColor:"color",backgroundImage:"str",backgroundSize:"enum",backgroundGradient:"str",borderRadius:"len",borderTopLeftRadius:"len",borderTopRightRadius:"len",borderBottomRightRadius:"len",borderBottomLeftRadius:"len",opacity:"num",transform:"str",transformOrigin:"str",pointerEvents:"enum",fontSize:"len",fontWeight:"num",fontStyle:"enum",fontFamily:"str",lineHeight:"len",letterSpacing:"len",textAlign:"enum",textDecoration:"enum",lineClamp:"num",textOverflow:"enum",textWrap:"enum",objectFit:"enum",placeholder:"str",type:"enum",enterKey:"enum",autocapitalize:"enum",autocorrect:"num",maxLength:"num",keyboardShrink:"num",keyboardDismiss:"num",showScrollbar:"num",overscrollMode:"enum",keyboardDismissMode:"enum",snap:"enum",sheetDetents:"str",sheetDetent:"num",sheetDismissible:"num",dim:"num"},qr={p:"padding",pt:"paddingTop",pr:"paddingRight",pb:"paddingBottom",pl:"paddingLeft",px:"paddingHorizontal",py:"paddingVertical",m:"margin",mt:"marginTop",mr:"marginRight",mb:"marginBottom",ml:"marginLeft",mx:"marginHorizontal",my:"marginVertical",bgColor:"backgroundColor",bgImage:"backgroundImage",bgSize:"backgroundSize",bgGradient:"backgroundGradient"},Xr=["placeholderColor","refreshControlColor","tintColor","rippleColor","overlayColor","backgroundGradient"],Jr={display:"flex",overflow:"visible",scrollDirection:"vertical",borderWidth:0,borderTopWidth:0,borderRightWidth:0,borderBottomWidth:0,borderLeftWidth:0,borderHorizontalWidth:0,borderVerticalWidth:0,borderStartWidth:0,borderEndWidth:0,backgroundColor:0,borderColor:0,borderTopColor:0,borderRightColor:0,borderBottomColor:0,borderLeftColor:0,backgroundImage:"",backgroundSize:"cover",borderRadius:0,borderTopLeftRadius:0,borderTopRightRadius:0,borderBottomRightRadius:0,borderBottomLeftRadius:0,opacity:1,transform:"identity",transformOrigin:"50% 50%",pointerEvents:"all",fontSize:14,fontWeight:400,fontStyle:"normal",lineHeight:"normal",letterSpacing:0,textAlign:"start",textDecoration:"none",lineClamp:0,textOverflow:"ellipsis",textWrap:"wrap",objectFit:"cover",placeholder:"",type:"text",enterKey:"done",autocapitalize:"sentences",autocorrect:1,maxLength:0,keyboardShrink:1,keyboardDismiss:1,showScrollbar:1,overscrollMode:"default",keyboardDismissMode:"interactive",snap:"none",sheetDetents:"",sheetDetent:0,sheetDismissible:1,dim:0},Qr=["duration","delay","layer","commit","loop","loopMode","name"];function bn(e){let t=e.trim();/\sxmlns\s*=/.test(t)||(t=t.replace(/<svg\b/,'<svg xmlns="http://www.w3.org/2000/svg"'));const n=new TextEncoder().encode(t);let r="";for(const o of n)r+=String.fromCharCode(o);return`data:image/svg+xml;base64,${btoa(r)}`}function Zr(e){const t=e.match(/viewBox\s*=\s*["']([^"']+)["']/);return t?t[1]:null}const eo=/\b(?:calc|min|max|clamp)\(/,to=e=>{if(!eo.test(e))return e;let t="";for(let n=0;n<e.length;n++){if(e.startsWith("var(",n)){let o=0;const i=n;for(;n<e.length;n++)if(e[n]==="(")o++;else if(e[n]===")"&&--o===0)break;t+=e.slice(i,Math.min(n+1,e.length));continue}const r=e[n];if(r==="+"||r==="-"){const o=t[t.length-1]??"";if(!(r==="-"&&(o==="e"&&"btlr".includes(e[n+1]??"")||e.slice(Math.max(0,n-7),n)==="comfort"))&&/[\w%.)]/.test(o)){for(t=t.trimEnd()+" "+r+" ";e[n+1]===" ";)n++;continue}}t+=r}return t.replace(/\d*\.\d+|\d+/g,(n,r,o)=>{const i=o.slice(0,r).trimEnd(),s=o.slice(r+n.length).trimStart();return/[\w.%]$/.test(i)||/^[\w.%]/.test(s)||/[*/]$/.test(i)||/^[*/]/.test(s)?n:n+"px"})},no={top:"12px",bottom:"4px",left:"16px",right:"16px"},yn=e=>`max(var(--safe-${e}, 0px), calc(var(--safe-${e}-bar, 0px) + var(--comfort-${e}, ${no[e]})))`,ro={vw:"cqw",vh:"cqh",vmin:"cqmin",vmax:"cqmax"},Ae=e=>to(e).replace(new RegExp("(?<![-\\w])comfort-(top|bottom|left|right)\\b","g"),(t,n)=>yn(n)).replace(new RegExp("(?<![-\\w])safe-(top|bottom|left|right)\\b","g"),(t,n)=>`var(--safe-${n}, 0px)`).replace(/(\d)(vmin|vmax|vw|vh)\b/g,(t,n,r)=>n+ro[r]),yt=/^-?\d*\.?\d+$/,se=e=>{if(typeof e=="number")return e+"px";const t=String(e).trim();return yt.test(t)?t+"px":Ae(t)},Ce=e=>{if(typeof e=="number")return"#"+(e>>>0).toString(16).padStart(e<=16777215?6:8,"0");const t=String(e);return t==="clear"?"transparent":t},oo=/^(rotate|skew)/,so=/^translate/,io=e=>{const t=String(e).trim();return t===""||t==="identity"?"none":t.replace(/([a-zA-Z0-9]+)\s*\(([^)]*)\)/g,(n,r,o)=>{const i=so.test(r)?"px":oo.test(r)?"deg":null;return i===null?n:`${r}(${o.split(",").map(s=>{const l=s.trim();return yt.test(l)?l+i:Ae(l)}).join(", ")})`})},vn=e=>typeof e=="number"?e+"px":String(e).trim().split(/\s+/).map(t=>yt.test(t)?t+"px":Ae(t)).join(" "),ee=0,re=1,ke=2,De=["top","right","bottom","left"],ao=(e,t)=>e==="safe-all"?`var(--safe-${t}, 0px)`:e==="comfort-all"||e==="comfort-x"||e==="comfort-y"?yn(t):se(e),ft=(e,t)=>{const n=(o,i)=>({rank:i,to:s=>o.map(l=>[t(l),ao(s,l)])}),r=o=>({rank:re,to:i=>[[t(o),se(i)]]});return{[e]:n(De,ee),[`${e}Horizontal`]:n(["left","right"],re),[`${e}Vertical`]:n(["top","bottom"],re),[`${e}Start`]:r("inline-start"),[`${e}End`]:r("inline-end"),[`${e}Top`]:n(["top"],ke),[`${e}Right`]:n(["right"],ke),[`${e}Bottom`]:n(["bottom"],ke),[`${e}Left`]:n(["left"],ke)}},lo=()=>{const e=ft("border",n=>`border-${n}-width`),t={};for(const n of Object.keys(e))t[`${n}Width`]=e[n];return t},vt=e=>{const t=[];let n=0,r="";for(const o of e.trim()){if(o==="("&&n++,o===")"&&n--,/\s/.test(o)&&n===0){r&&t.push(r),r="";continue}r+=o}return r&&t.push(r),t},co=new Set(["none","solid","dashed","dotted","double","hidden"]),uo=/^-?\d*\.?\d+([a-z%]*)$|^(calc|min|max|clamp)\(/,Se=(e,t)=>({rank:t,to:n=>{let r=null,o=null,i=null;if(typeof n=="number")r=n+"px";else for(const l of vt(String(n)))co.has(l)?i=l:uo.test(l)?r=se(l):o=Ce(l);const s=[];for(const l of e)s.push([`border-${l}-width`,r??(o?"1px":"0px")]),s.push([`border-${l}-color`,o??"transparent"]),i&&s.push([`border-${l}-style`,i]);return s}}),fo=e=>{const t=String(e).trim(),n=(i,s,l)=>[["flex-grow",i],["flex-shrink",s],["flex-basis",l]];if(t==="none")return n("0","0","auto");if(t==="auto")return n("1","1","auto");if(t==="initial")return n("0","1","auto");const r=vt(t),o=i=>i!==void 0&&/^-?\d*\.?\d+$/.test(i);return o(r[0])?r.length===1?n(r[0],"1","0%"):o(r[1])?n(r[0],r[1],r[2]!==void 0?se(r[2]):"0%"):n(r[0],"1",se(r[1])):n("1","1",se(r[0]??"auto"))},En=e=>{var t;return typeof e=="object"&&e!==null&&"_h"in e&&typeof((t=e._h)==null?void 0:t.id)=="number"},po=e=>e.replace(/<svg\b[^>]*>/,t=>t.replace(/\spreserveAspectRatio\s*=\s*("[^"]*"|'[^']*')/,"").replace(/^<svg\b/,'<svg preserveAspectRatio="none"')),wn=(e,t)=>{if(En(e))return`url("${t.bufferUrl(e._h.id)}")`;const n=String(e??"");return n===""?"none":n.startsWith("id:")?`url("${t.bufferUrl(Number(n.slice(3)))}")`:n.startsWith("svg:")?`url("${bn(po(n.slice(4)))}")`:`url("${n.replace(/["\\\n]/g,r=>"\\"+r)}")`},ho=/^\s*(repeating-)?(linear|radial|conic)-gradient\(/,Sn=e=>{const t=String(e??"").trim();return t===""?"none":Ae(t)},mo=(e,t)=>{const n=typeof e=="string"&&ho.test(e),r=En(e)||typeof e=="string"&&/^(id:|https?:|data:|blob:|\.{0,2}\/)/.test(e);return[["--lc-bg-grad",n?Sn(e):"none"],["--lc-bg-img",r?wn(e,t):"none"],["background-color",n||r?"transparent":Ce(e)]]},go=e=>{const t=typeof e=="number"?[e+"px"]:vt(String(e)).map(s=>vn(s)),[n,r=n,o=n,i=r]=t;return[["border-top-left-radius",n??"0px"],["border-top-right-radius",r??"0px"],["border-bottom-right-radius",o??"0px"],["border-bottom-left-radius",i??"0px"]]},bo=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","ui-monospace","ui-sans-serif","ui-serif","inherit"]),yo=e=>{const t=String(e).trim();return t==="monospaced"?"monospace":t.startsWith("var(")||t.includes(",")||/^["']/.test(t)||bo.has(t)?t:`"${t.replace(/"/g,'\\"')}"`},vo=e=>e===!0||e==="true"||typeof e=="number"&&e>.5||e==="1",Eo=e=>t=>e[String(t)]??String(t),$e={width:{css:"width",as:"len"},height:{css:"height",as:"len"},minWidth:{css:"min-width",as:"len"},minHeight:{css:"min-height",as:"len"},maxWidth:{css:"max-width",as:"len"},maxHeight:{css:"max-height",as:"len"},flexBasis:{css:"flex-basis",as:"len"},flexGrow:{css:"flex-grow",as:"num"},flexShrink:{css:"flex-shrink",as:"num"},aspectRatio:{css:"aspect-ratio",as:"num"},gap:{css:["row-gap","column-gap"],as:"len",rank:ee},rowGap:{css:"row-gap",as:"len"},columnGap:{css:"column-gap",as:"len"},...ft("padding",e=>`padding-${e}`),...ft("margin",e=>`margin-${e}`),inset:{css:De,as:"len",rank:ee},top:{css:"top",as:"len"},right:{css:"right",as:"len"},bottom:{css:"bottom",as:"len"},left:{css:"left",as:"len"},start:{css:"inset-inline-start",as:"len",rank:re},end:{css:"inset-inline-end",as:"len",rank:re},flexDirection:{css:"flex-direction",as:"raw"},justifyContent:{css:"justify-content",as:"raw"},alignItems:{css:"align-items",as:"raw"},alignSelf:{css:"align-self",as:"raw"},position:{css:"position",as:"raw"},flexWrap:{css:"flex-wrap",as:"raw"},boxSizing:{css:"box-sizing",as:"raw"},display:{css:"display",as:"raw"},overflow:{rank:ee,to:e=>{const t=e==="scroll"?"auto":String(e);return[["overflow-x",t],["overflow-y",t]]}},scrollDirection:{to:e=>e==="horizontal"?[["overflow-x","auto"],["overflow-y","hidden"],["flex-direction","row"]]:e==="all"?[["overflow-x","auto"],["overflow-y","auto"]]:[["overflow-x","hidden"],["overflow-y","auto"],["flex-direction","column"]],rank:re},...lo(),color:{css:"color"},backgroundColor:{css:"background-color"},borderColor:{css:De.map(e=>`border-${e}-color`),rank:ee},borderTopColor:{css:"border-top-color"},borderRightColor:{css:"border-right-color"},borderBottomColor:{css:"border-bottom-color"},borderLeftColor:{css:"border-left-color"},placeholderColor:{css:"--lc-placeholder"},refreshControlColor:{css:"--lc-refresh"},tintColor:{css:"--lc-tint"},overlayColor:{css:"--lc-overlay"},rippleColor:{none:"a browser has no ripple: the press feedback of a page is `$pressed`"},backgroundImage:{to:(e,t)=>[["--lc-bg-img",wn(e,t)]]},backgroundGradient:{to:e=>[["--lc-bg-grad",Sn(e)]]},backgroundSize:{to:e=>e==="tile"?[["background-size","auto"],["background-repeat","repeat"],["background-position","0 0"]]:[["background-size",e==="fill"?"100% 100%":String(e)],["background-repeat","no-repeat"],["background-position","center"]]},borderRadius:{to:go,rank:ee},borderTopLeftRadius:{css:"border-top-left-radius"},borderTopRightRadius:{css:"border-top-right-radius"},borderBottomRightRadius:{css:"border-bottom-right-radius"},borderBottomLeftRadius:{css:"border-bottom-left-radius"},opacity:{css:"opacity"},transform:{to:e=>[["transform",io(e)]]},transformOrigin:{css:"transform-origin",as:"lens"},pointerEvents:{to:e=>[["pointer-events",e==="none"?"none":"auto"]]},dim:{css:"--lc-dim"},fontSize:{css:"font-size"},fontWeight:{css:"font-weight",as:"raw"},fontStyle:{to:e=>[["font-style",e===2?"italic":e===0?"normal":String(e)]]},fontFamily:{to:e=>[["font-family",yo(e)]]},lineHeight:{to:e=>[["line-height",e==="normal"?"1.2":se(e)]]},letterSpacing:{css:"letter-spacing"},textAlign:{css:"text-align"},textDecoration:{css:"text-decoration-line"},lineClamp:{rank:ee,to:e=>Number(e)>0?[["display","-webkit-box"],["-webkit-box-orient","vertical"],["-webkit-line-clamp",String(Math.round(Number(e)))],["overflow-x","hidden"],["overflow-y","hidden"]]:[["-webkit-line-clamp","none"]]},textOverflow:{css:"text-overflow"},textWrap:{rank:ee,to:e=>e==="nowrap"?[["white-space","pre"],["max-width","none"],["overflow-x","hidden"],["overflow-y","hidden"],["text-overflow","ellipsis"]]:[["white-space","pre-wrap"],["max-width","100%"],["text-wrap",String(e)]]},objectFit:{to:e=>[["object-fit",String(e)],["--lc-fit",e==="fill"?"100% 100%":String(e)]]},placeholder:{attr:!0},type:{attr:!0},enterKey:{attr:!0},autocapitalize:{attr:!0},autocorrect:{attr:!0},maxLength:{attr:!0},keyboardShrink:{attr:!0},keyboardDismiss:{attr:!0},showScrollbar:{to:e=>[["scrollbar-width",vo(e)?"thin":"none"]]},overscrollMode:{to:e=>[["overscroll-behavior",Eo({default:"auto",none:"none",absorb:"contain"})(e)]]},keyboardDismissMode:{attr:!0},snap:{to:e=>e==="none"?[["scroll-snap-type","none"],["--lc-snap","none"]]:[["scroll-snap-type","both mandatory"],["--lc-snap",String(e)]]},sheetDetents:{attr:!0},sheetDetent:{attr:!0},sheetDismissible:{attr:!0},background:{to:mo,rank:ee},border:Se(De,ee),borderTop:Se(["top"],re),borderRight:Se(["right"],re),borderBottom:Se(["bottom"],re),borderLeft:Se(["left"],re),flex:{to:fo,rank:ee}},Ze=e=>qr[e]??e,wo=e=>e in $e,_n=e=>{const t=$e[e];return!!t&&"attr"in t},So={overflow:"overflow-x",pointerEvents:"pointer-events",fontFamily:"font-family",fontStyle:"font-style",lineHeight:"line-height",objectFit:"object-fit",transform:"transform",borderRadius:"border-top-left-radius",borderWidth:"border-top-width",borderColor:"border-top-color",backgroundImage:"--lc-bg-img",backgroundGradient:"--lc-bg-grad",backgroundSize:"background-size",showScrollbar:"scrollbar-width",overscrollMode:"overscroll-behavior",snap:"--lc-snap",lineClamp:"-webkit-line-clamp",textWrap:"text-wrap",borderTopWidth:"border-top-width",borderRightWidth:"border-right-width",borderBottomWidth:"border-bottom-width",borderLeftWidth:"border-left-width",borderHorizontalWidth:"border-left-width",borderVerticalWidth:"border-top-width",borderStartWidth:"border-inline-start-width",borderEndWidth:"border-inline-end-width"},_o=e=>{const t=$e[e];return t&&"css"in t&&typeof t.css=="string"?t.css:So[e]??null},ko={len:se,lens:vn,num:e=>String(e),raw:e=>String(e),color:Ce},To={color:"color",len:"len",enum:"raw",num:"num",str:"raw",layout:"raw"},Bt=e=>{const t=$e[e];return t&&"rank"in t&&t.rank!==void 0?t.rank:ke},et=(e,t,n)=>{const r=[...e].filter(([,i])=>i!=null);r.sort((i,s)=>Bt(i[0])-Bt(s[0]));const o=new Map;for(const[i,s]of r){const l=$e[i];if(!l){n==null||n(i);continue}if("attr"in l||"none"in l)continue;if("to"in l){for(const[E,_]of l.to(s,t))o.set(E,_);continue}const d=ko[l.as??To[ze[i]??"layout"]],u=d(s);if(typeof l.css=="string")o.set(l.css,u);else for(const E of l.css)o.set(E,u)}return o},Vt=e=>[...e].sort((t,n)=>t[0]<n[0]?-1:t[0]>n[0]?1:0).map(([t,n])=>`${t}:${n}`).join(";"),kn=0,Tn=1,Le=2,xe=3,Ln=4,be=65,Ge=1.70158,Me=Ge*1.525,Wt=Ge+1,zt=2*Math.PI/3,Gt=2*Math.PI/4.5,Pe=e=>e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375,dt=[["linear",e=>e],["inSine",e=>1-Math.cos(e*Math.PI/2)],["outSine",e=>Math.sin(e*Math.PI/2)],["inOutSine",e=>-(Math.cos(Math.PI*e)-1)/2],["inQuad",e=>e*e],["outQuad",e=>1-(1-e)*(1-e)],["inOutQuad",e=>e<.5?2*e*e:1-(-2*e+2)**2/2],["inCubic",e=>e*e*e],["outCubic",e=>1-(1-e)**3],["inOutCubic",e=>e<.5?4*e*e*e:1-(-2*e+2)**3/2],["inQuart",e=>e**4],["outQuart",e=>1-(1-e)**4],["inOutQuart",e=>e<.5?8*e**4:1-(-2*e+2)**4/2],["inExpo",e=>e===0?0:2**(10*e-10)],["outExpo",e=>e===1?1:1-2**(-10*e)],["inOutExpo",e=>e===0?0:e===1?1:e<.5?2**(20*e-10)/2:(2-2**(-20*e+10))/2],["inCirc",e=>1-Math.sqrt(1-e*e)],["outCirc",e=>Math.sqrt(1-(e-1)**2)],["inOutCirc",e=>e<.5?(1-Math.sqrt(1-(2*e)**2))/2:(Math.sqrt(1-(-2*e+2)**2)+1)/2],["inBack",e=>Wt*e*e*e-Ge*e*e],["outBack",e=>1+Wt*(e-1)**3+Ge*(e-1)**2],["inOutBack",e=>e<.5?(2*e)**2*((Me+1)*2*e-Me)/2:((2*e-2)**2*((Me+1)*(e*2-2)+Me)+2)/2],["inElastic",e=>e===0?0:e===1?1:-(2**(10*e-10))*Math.sin((e*10-10.75)*zt)],["outElastic",e=>e===0?0:e===1?1:2**(-10*e)*Math.sin((e*10-.75)*zt)+1],["inOutElastic",e=>e===0?0:e===1?1:e<.5?-(2**(20*e-10)*Math.sin((20*e-11.125)*Gt))/2:2**(-20*e+10)*Math.sin((20*e-11.125)*Gt)/2+1],["inBounce",e=>1-Pe(1-e)],["outBounce",Pe],["inOutBounce",e=>e<.5?(1-Pe(1-2*e))/2:(1+Pe(2*e-1))/2],["smoothstep",e=>e*e*(3-2*e)]],Lo={in:"inQuad",out:"outQuad",inOut:"inOutQuad",easeIn:"inQuad",easeOut:"outQuad",easeInOut:"inOutQuad","ease-in":"inQuad","ease-out":"outQuad","ease-in-out":"inOutQuad"},xo=e=>{const t=Lo[e]??e;for(let n=0;n<dt.length;n++)if(dt[n][0]===t)return n;return-1},Ro=[.25,.1,.25,1],Ne={kind:kn,p:[0,0,0,0]},Ao=e=>{const t=new Float32Array(be);for(let n=0;n<be;n++)t[n]=e(n/(be-1));return t[0]=0,t[be-1]=1,t},Co=e=>{if(e===void 0)return Ne;if(typeof e=="function")return{kind:Ln,p:[0,0,0,0],table:Ao(e)};if(Array.isArray(e)){const[o,i,s,l]=e;return{kind:Le,p:[o,i,s,l]}}const t=e.trim();if(t==="linear")return Ne;if(t==="ease")return{kind:Le,p:Ro};if(t==="steps")return{kind:xe,p:[1,0,0,0]};let n=/^steps\(\s*(\d+)\s*(?:,\s*(start|end|jump-start|jump-end)\s*)?\)$/.exec(t);if(n)return{kind:xe,p:[Math.max(1,parseInt(n[1],10)),n[2]==="start"||n[2]==="jump-start"?1:0,0,0]};if(n=/^cubic-bezier\(\s*([-\d.e]+)\s*,\s*([-\d.e]+)\s*,\s*([-\d.e]+)\s*,\s*([-\d.e]+)\s*\)$/.exec(t),n)return{kind:Le,p:[parseFloat(n[1]),parseFloat(n[2]),parseFloat(n[3]),parseFloat(n[4])]};const r=xo(t);return r===0?Ne:r>0?{kind:Tn,p:[r,0,0,0]}:(console.warn(`[tween] unknown easing "${t}" — using linear`),Ne)},$o=(e,t,n,r,o)=>{const i=1-3*r+3*t,s=3*r-6*t,l=3*t,d=1-3*o+3*n,u=3*o-6*n,E=3*n;let _=e;for(let A=0;A<8;A++){const g=((i*_+s)*_+l)*_-e,p=(3*i*_+2*s)*_+l;if(Math.abs(g)<1e-6||Math.abs(p)<1e-6)break;_-=g/p}return _=Math.min(1,Math.max(0,_)),((d*_+u)*_+E)*_},Oo=(e,t)=>{if(t<=0)return e.kind===xe&&e.p[1]===1?1/e.p[0]:0;if(t>=1)return 1;switch(e.kind){case Tn:return dt[e.p[0]][1](t);case Le:return $o(t,e.p[0],e.p[1],e.p[2],e.p[3]);case xe:{const n=e.p[0];return e.p[1]===1?Math.min(1,Math.ceil(t*n)/n):Math.floor(t*n)/n}case Ln:{const n=e.table,r=t*(be-1),o=Math.floor(r),i=n[o],s=n[Math.min(o+1,be-1)];return i+(s-i)*(r-o)}default:return t}},jt=24,Ht=e=>String(Math.round(e*1e4)/1e4),Uo="cubic-bezier(0.3333, 0, 0.6667, 1)",Mo=e=>{switch(e.kind){case kn:return"linear";case Le:return`cubic-bezier(${e.p.map(Ht).join(", ")})`;case xe:return`steps(${e.p[0]}, ${e.p[1]===1?"jump-start":"jump-end"})`}const t=[];for(let n=0;n<=jt;n++)t.push(Ht(Oo(e,n/jt)));return`linear(${t.join(", ")})`},Po=e=>e===void 0||e==="smoothstep"?Uo:Mo(Co(e)),xn=["lc-base","lc-bag","lc-own","lc-orient","lc-class","lc-hover","lc-press","lc-focus"],No=["--lc-bg-grad","--lc-bg-img","--lc-tint","--lc-overlay","--lc-refresh","--lc-fit","--lc-src","--lc-src-tint","--lc-iw","--lc-ih","--lc-ir","--lc-crop-size","--lc-crop-pos"],Rn="lc-app",Fo=`
2
+ ${e.stack}`:String(e);try{return JSON.stringify(e)}catch{return String(e)}},nr=(e,t)=>{const n=s=>{fetch(`${e}/log`,{method:"POST",body:JSON.stringify(s),headers:{"content-type":"application/json"},keepalive:!0}).catch(()=>{})};let r=-1;const o=async()=>{try{const{v:s}=await(await fetch(`${e}/version`,{cache:"no-store"})).json();typeof s=="number"&&t(s)}catch{}setTimeout(o,2500)};setTimeout(o,2500);const i=()=>{let s;try{s=new WebSocket(e.replace(/^http/,"ws")+"/ws")}catch{return}s.onopen=()=>s.send(JSON.stringify({type:"hello",v:r})),s.onmessage=l=>{let d={};try{d=JSON.parse(String(l.data))}catch{return}d.type==="reload"&&typeof d.v=="number"&&t(d.v)},s.onclose=()=>{setTimeout(i,2e3)}};return i(),{bundleUrl:s=>`${e}/bundle.js?t=web&v=${s}`,versionOf(s,l){const d=Number(s.headers.get("x-lecodes-v"));return s.headers.has("x-lecodes-v")&&Number.isFinite(d)?d:l},ran(s){r=s},log:(s,l)=>n({type:"log",level:s,text:l.map(tr).join(" ")}),error:s=>n({type:"error",text:s})}},rr=(e,t)=>{try{const n=new URL(e,t);return n.origin===new URL(t).origin&&(n.protocol==="http:"||n.protocol==="https:")?n.href:null}catch{return null}},mn=(e,t)=>{const n=[];for(const r of t){const o=r.halves[e];for(const i of typeof o=="string"?[o]:Array.isArray(o)?o:[]){if(typeof i!="string"||!i)continue;const s=new URL(i,r.url).href;n.includes(s)||n.push(s)}}return n},or="modulepreload",sr=function(e,t){return new URL(e,t).href},Tt={},ce=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){let s=function(E){return Promise.all(E.map(_=>Promise.resolve(_).then(A=>({status:"fulfilled",value:A}),A=>({status:"rejected",reason:A}))))};const l=document.getElementsByTagName("link"),d=document.querySelector("meta[property=csp-nonce]"),u=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));o=s(n.map(E=>{if(E=sr(E,r),E in Tt)return;Tt[E]=!0;const _=E.endsWith(".css"),A=_?'[rel="stylesheet"]':"";if(!!r)for(let y=l.length-1;y>=0;y--){const v=l[y];if(v.href===E&&(!_||v.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${E}"]${A}`))return;const p=document.createElement("link");if(p.rel=_?"stylesheet":or,_||(p.as="script"),p.crossOrigin="",p.href=E,u&&p.setAttribute("nonce",u),document.head.appendChild(p),_)return new Promise((y,v)=>{p.addEventListener("load",y),p.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${E}`)))})}))}function i(s){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=s,window.dispatchEvent(l),!l.defaultPrevented)throw s}return o.then(s=>{for(const l of s||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})},Lt="2.8.2",Xe=e=>{const t=e==null?void 0:e.match(/^(\d+)\.\d+\.\d+/);return t?Number(t[1]):null},ir=(e,t)=>Xe(e)!==null&&Xe(e)===Xe(t),ar=(e,t="woff2")=>{const n=/^\/\/ fonts: (.+)$/m.exec(e);if(!n)return[];const r=[];for(const o of n[1].split(";")){const i=o.indexOf("=");if(i===-1)continue;const s=/^(.+)@(\d+)(i?)$/.exec(o.slice(0,i));s&&r.push({family:s[1],weight:parseInt(s[2],10),italic:s[3]==="i",url:o.slice(i+1).replace("{fmt}",t)})}return r},lr=async(e,t,n=2e3)=>{const r=t??(typeof document>"u"?void 0:document);if(!(r!=null&&r.fonts)||e.length===0)return;const o=[];for(const i of e)try{const s=new FontFace(i.family,`url("${i.url}")`,{weight:String(i.weight),style:i.italic?"italic":"normal"});r.fonts.add(s),o.push(s.load().catch(()=>{}))}catch{}await Promise.race([Promise.all(o),new Promise(i=>setTimeout(i,n))])},cr=e=>{var d,u,E,_;const t=e.slice(0,2e3),n=new Set,r=t.match(/\/\/ preload: (.+)/);if(r)for(const A of r[1].split(";"))n.add(A);const o=t.includes("// gl: disable")?"off":t.includes("// gl: defer")?"defer":"on",i=((d=t.match(/^\/\/ sdk: (\d+\.\d+\.\d+\S*)/m))==null?void 0:d[1])??null,s=((E=(u=t.match(/^\/\/ name: (.+)$/m))==null?void 0:u[1])==null?void 0:E.trim())??null,l=new Set((((_=t.match(/^\/\/ plugins: (.+)$/m))==null?void 0:_[1])??"").split(";").map(A=>A.trim()).filter(Boolean));return{sdk:i,name:s,preloads:n,gl:o,is2d:t.includes("// 2d: enable"),plugins:l,bootFonts:ar(t)}},ur=1,fr=2,dr=3,pr=4,hr=5,mr=6,xt=7,gr=8,Rt=9,br=10,yr=11,vr=12,Er=13,wr=14,Sr=15,_r=16,At=17,kr=18,Tr=19,Ue=20,xi=21,Ri=22,Ai=23,Ci=24,$i=25,Lr=26,xr=27,Rr=28,Ar=29,Ct=30,$t=31,Cr=32,$r=33,Ot=34,Ut=35,Mt=36,Ie=1,Or=2,Ur=4,he=8,Mr=16,Je=32,Pr=64,Qe=128,Nr=256,Fr=512,Ir=1024,Dr=2048,Br=4096,Pt=8192,Oi=16384,Vr=32768,Wr=1<<18,zr=255,Nt=256,Ft=512,Gr=1024,te=0,jr=1,Hr=2,Kr=3,We=4,ve=255,gn=e=>{const t=e.clientWidth;if(!t)return 1;const n=e.getBoundingClientRect().width;return n>0?n/t:1},It={text:{type:"text"},password:{type:"password"},search:{type:"search"},tel:{type:"tel"},email:{type:"email"},url:{type:"url"},number:{type:"text",mode:"numeric"},decimal:{type:"text",mode:"decimal"},date:{type:"date"},time:{type:"time"}},Dt=(e,t)=>e==null?t:e===!0||e==="true"||e==="1"||typeof e=="number"&&e>.5,oe=(e,t,n)=>{n===null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)},Yr=(e,t)=>{if(e.type!=="input"&&e.type!=="textarea")return;const n=e.el,r=t("placeholder");if(oe(n,"placeholder",r==null?null:String(r)),e.type==="input"){const l=It[String(t("type")??"text")]??It.text,d=n;d.type!==l.type&&(d.type=l.type),oe(n,"inputmode",l.mode??null);const u=t("enterKey");oe(n,"enterkeyhint",u==null?null:String(u))}const o=t("autocapitalize");oe(n,"autocapitalize",o==null?null:String(o));const i=t("autocorrect");i==null?(oe(n,"autocorrect",null),oe(n,"spellcheck",null)):(oe(n,"autocorrect",Dt(i,!0)?"on":"off"),oe(n,"spellcheck",Dt(i,!0)?"true":"false"));const s=Number(t("maxLength")??0);oe(n,"maxlength",s>0?String(Math.round(s)):null)},ze={width:"layout",height:"layout",minWidth:"layout",minHeight:"layout",maxWidth:"layout",maxHeight:"layout",flexBasis:"layout",flexGrow:"layout",flexShrink:"layout",aspectRatio:"layout",gap:"layout",rowGap:"layout",columnGap:"layout",padding:"layout",paddingTop:"layout",paddingRight:"layout",paddingBottom:"layout",paddingLeft:"layout",paddingHorizontal:"layout",paddingVertical:"layout",paddingStart:"layout",paddingEnd:"layout",margin:"layout",marginTop:"layout",marginRight:"layout",marginBottom:"layout",marginLeft:"layout",marginHorizontal:"layout",marginVertical:"layout",marginStart:"layout",marginEnd:"layout",left:"layout",right:"layout",top:"layout",bottom:"layout",start:"layout",end:"layout",inset:"layout",flexDirection:"enum",justifyContent:"enum",alignItems:"enum",alignSelf:"enum",position:"enum",flexWrap:"enum",boxSizing:"enum",display:"enum",overflow:"enum",scrollDirection:"enum",borderWidth:"len",borderTopWidth:"len",borderRightWidth:"len",borderBottomWidth:"len",borderLeftWidth:"len",borderHorizontalWidth:"len",borderVerticalWidth:"len",borderStartWidth:"len",borderEndWidth:"len",color:"color",backgroundColor:"color",borderColor:"color",borderTopColor:"color",borderRightColor:"color",borderBottomColor:"color",borderLeftColor:"color",placeholderColor:"color",refreshControlColor:"color",tintColor:"color",rippleColor:"color",overlayColor:"color",backgroundImage:"str",backgroundSize:"enum",backgroundGradient:"str",borderRadius:"len",borderTopLeftRadius:"len",borderTopRightRadius:"len",borderBottomRightRadius:"len",borderBottomLeftRadius:"len",opacity:"num",transform:"str",transformOrigin:"str",pointerEvents:"enum",fontSize:"len",fontWeight:"num",fontStyle:"enum",fontFamily:"str",lineHeight:"len",letterSpacing:"len",textAlign:"enum",textDecoration:"enum",lineClamp:"num",textOverflow:"enum",textWrap:"enum",objectFit:"enum",placeholder:"str",type:"enum",enterKey:"enum",autocapitalize:"enum",autocorrect:"num",maxLength:"num",keyboardShrink:"num",keyboardDismiss:"num",showScrollbar:"num",overscrollMode:"enum",keyboardDismissMode:"enum",snap:"enum",sheetDetents:"str",sheetDetent:"num",sheetDismissible:"num",dim:"num"},qr={p:"padding",pt:"paddingTop",pr:"paddingRight",pb:"paddingBottom",pl:"paddingLeft",px:"paddingHorizontal",py:"paddingVertical",m:"margin",mt:"marginTop",mr:"marginRight",mb:"marginBottom",ml:"marginLeft",mx:"marginHorizontal",my:"marginVertical",bgColor:"backgroundColor",bgImage:"backgroundImage",bgSize:"backgroundSize",bgGradient:"backgroundGradient"},Xr=["placeholderColor","refreshControlColor","tintColor","rippleColor","overlayColor","backgroundGradient"],Jr={display:"flex",overflow:"visible",scrollDirection:"vertical",borderWidth:0,borderTopWidth:0,borderRightWidth:0,borderBottomWidth:0,borderLeftWidth:0,borderHorizontalWidth:0,borderVerticalWidth:0,borderStartWidth:0,borderEndWidth:0,backgroundColor:0,borderColor:0,borderTopColor:0,borderRightColor:0,borderBottomColor:0,borderLeftColor:0,backgroundImage:"",backgroundSize:"cover",borderRadius:0,borderTopLeftRadius:0,borderTopRightRadius:0,borderBottomRightRadius:0,borderBottomLeftRadius:0,opacity:1,transform:"identity",transformOrigin:"50% 50%",pointerEvents:"all",fontSize:14,fontWeight:400,fontStyle:"normal",lineHeight:"normal",letterSpacing:0,textAlign:"start",textDecoration:"none",lineClamp:0,textOverflow:"ellipsis",textWrap:"wrap",objectFit:"cover",placeholder:"",type:"text",enterKey:"done",autocapitalize:"sentences",autocorrect:1,maxLength:0,keyboardShrink:1,keyboardDismiss:1,showScrollbar:1,overscrollMode:"default",keyboardDismissMode:"interactive",snap:"none",sheetDetents:"",sheetDetent:0,sheetDismissible:1,dim:0},Qr=["duration","delay","layer","commit","loop","loopMode","name"];function bn(e){let t=e.trim();/\sxmlns\s*=/.test(t)||(t=t.replace(/<svg\b/,'<svg xmlns="http://www.w3.org/2000/svg"'));const n=new TextEncoder().encode(t);let r="";for(const o of n)r+=String.fromCharCode(o);return`data:image/svg+xml;base64,${btoa(r)}`}function Zr(e){const t=e.match(/viewBox\s*=\s*["']([^"']+)["']/);return t?t[1]:null}const eo=/\b(?:calc|min|max|clamp)\(/,to=e=>{if(!eo.test(e))return e;let t="";for(let n=0;n<e.length;n++){if(e.startsWith("var(",n)){let o=0;const i=n;for(;n<e.length;n++)if(e[n]==="(")o++;else if(e[n]===")"&&--o===0)break;t+=e.slice(i,Math.min(n+1,e.length));continue}const r=e[n];if(r==="+"||r==="-"){const o=t[t.length-1]??"";if(!(r==="-"&&(o==="e"&&"btlr".includes(e[n+1]??"")||e.slice(Math.max(0,n-7),n)==="comfort"))&&/[\w%.)]/.test(o)){for(t=t.trimEnd()+" "+r+" ";e[n+1]===" ";)n++;continue}}t+=r}return t.replace(/\d*\.\d+|\d+/g,(n,r,o)=>{const i=o.slice(0,r).trimEnd(),s=o.slice(r+n.length).trimStart();return/[\w.%]$/.test(i)||/^[\w.%]/.test(s)||/[*/]$/.test(i)||/^[*/]/.test(s)?n:n+"px"})},no={top:"12px",bottom:"4px",left:"16px",right:"16px"},yn=e=>`max(var(--safe-${e}, 0px), calc(var(--safe-${e}-bar, 0px) + var(--comfort-${e}, ${no[e]})))`,ro={vw:"cqw",vh:"cqh",vmin:"cqmin",vmax:"cqmax"},Ae=e=>to(e).replace(new RegExp("(?<![-\\w])comfort-(top|bottom|left|right)\\b","g"),(t,n)=>yn(n)).replace(new RegExp("(?<![-\\w])safe-(top|bottom|left|right)\\b","g"),(t,n)=>`var(--safe-${n}, 0px)`).replace(/(\d)(vmin|vmax|vw|vh)\b/g,(t,n,r)=>n+ro[r]),yt=/^-?\d*\.?\d+$/,se=e=>{if(typeof e=="number")return e+"px";const t=String(e).trim();return yt.test(t)?t+"px":Ae(t)},Ce=e=>{if(typeof e=="number")return"#"+(e>>>0).toString(16).padStart(e<=16777215?6:8,"0");const t=String(e);return t==="clear"?"transparent":t},oo=/^(rotate|skew)/,so=/^translate/,io=e=>{const t=String(e).trim();return t===""||t==="identity"?"none":t.replace(/([a-zA-Z0-9]+)\s*\(([^)]*)\)/g,(n,r,o)=>{const i=so.test(r)?"px":oo.test(r)?"deg":null;return i===null?n:`${r}(${o.split(",").map(s=>{const l=s.trim();return yt.test(l)?l+i:Ae(l)}).join(", ")})`})},vn=e=>typeof e=="number"?e+"px":String(e).trim().split(/\s+/).map(t=>yt.test(t)?t+"px":Ae(t)).join(" "),ee=0,re=1,ke=2,De=["top","right","bottom","left"],ao=(e,t)=>e==="safe-all"?`var(--safe-${t}, 0px)`:e==="comfort-all"||e==="comfort-x"||e==="comfort-y"?yn(t):se(e),ft=(e,t)=>{const n=(o,i)=>({rank:i,to:s=>o.map(l=>[t(l),ao(s,l)])}),r=o=>({rank:re,to:i=>[[t(o),se(i)]]});return{[e]:n(De,ee),[`${e}Horizontal`]:n(["left","right"],re),[`${e}Vertical`]:n(["top","bottom"],re),[`${e}Start`]:r("inline-start"),[`${e}End`]:r("inline-end"),[`${e}Top`]:n(["top"],ke),[`${e}Right`]:n(["right"],ke),[`${e}Bottom`]:n(["bottom"],ke),[`${e}Left`]:n(["left"],ke)}},lo=()=>{const e=ft("border",n=>`border-${n}-width`),t={};for(const n of Object.keys(e))t[`${n}Width`]=e[n];return t},vt=e=>{const t=[];let n=0,r="";for(const o of e.trim()){if(o==="("&&n++,o===")"&&n--,/\s/.test(o)&&n===0){r&&t.push(r),r="";continue}r+=o}return r&&t.push(r),t},co=new Set(["none","solid","dashed","dotted","double","hidden"]),uo=/^-?\d*\.?\d+([a-z%]*)$|^(calc|min|max|clamp)\(/,Se=(e,t)=>({rank:t,to:n=>{let r=null,o=null,i=null;if(typeof n=="number")r=n+"px";else for(const l of vt(String(n)))co.has(l)?i=l:uo.test(l)?r=se(l):o=Ce(l);const s=[];for(const l of e)s.push([`border-${l}-width`,r??(o?"1px":"0px")]),s.push([`border-${l}-color`,o??"transparent"]),i&&s.push([`border-${l}-style`,i]);return s}}),fo=e=>{const t=String(e).trim(),n=(i,s,l)=>[["flex-grow",i],["flex-shrink",s],["flex-basis",l]];if(t==="none")return n("0","0","auto");if(t==="auto")return n("1","1","auto");if(t==="initial")return n("0","1","auto");const r=vt(t),o=i=>i!==void 0&&/^-?\d*\.?\d+$/.test(i);return o(r[0])?r.length===1?n(r[0],"1","0%"):o(r[1])?n(r[0],r[1],r[2]!==void 0?se(r[2]):"0%"):n(r[0],"1",se(r[1])):n("1","1",se(r[0]??"auto"))},En=e=>{var t;return typeof e=="object"&&e!==null&&"_h"in e&&typeof((t=e._h)==null?void 0:t.id)=="number"},po=e=>e.replace(/<svg\b[^>]*>/,t=>t.replace(/\spreserveAspectRatio\s*=\s*("[^"]*"|'[^']*')/,"").replace(/^<svg\b/,'<svg preserveAspectRatio="none"')),wn=(e,t)=>{if(En(e))return`url("${t.bufferUrl(e._h.id)}")`;const n=String(e??"");return n===""?"none":n.startsWith("id:")?`url("${t.bufferUrl(Number(n.slice(3)))}")`:n.startsWith("svg:")?`url("${bn(po(n.slice(4)))}")`:`url("${n.replace(/["\\\n]/g,r=>"\\"+r)}")`},ho=/^\s*(repeating-)?(linear|radial|conic)-gradient\(/,Sn=e=>{const t=String(e??"").trim();return t===""?"none":Ae(t)},mo=(e,t)=>{const n=typeof e=="string"&&ho.test(e),r=En(e)||typeof e=="string"&&/^(id:|https?:|data:|blob:|\.{0,2}\/)/.test(e);return[["--lc-bg-grad",n?Sn(e):"none"],["--lc-bg-img",r?wn(e,t):"none"],["background-color",n||r?"transparent":Ce(e)]]},go=e=>{const t=typeof e=="number"?[e+"px"]:vt(String(e)).map(s=>vn(s)),[n,r=n,o=n,i=r]=t;return[["border-top-left-radius",n??"0px"],["border-top-right-radius",r??"0px"],["border-bottom-right-radius",o??"0px"],["border-bottom-left-radius",i??"0px"]]},bo=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","ui-monospace","ui-sans-serif","ui-serif","inherit"]),yo=e=>{const t=String(e).trim();return t==="monospaced"?"monospace":t.startsWith("var(")||t.includes(",")||/^["']/.test(t)||bo.has(t)?t:`"${t.replace(/"/g,'\\"')}"`},vo=e=>e===!0||e==="true"||typeof e=="number"&&e>.5||e==="1",Eo=e=>t=>e[String(t)]??String(t),$e={width:{css:"width",as:"len"},height:{css:"height",as:"len"},minWidth:{css:"min-width",as:"len"},minHeight:{css:"min-height",as:"len"},maxWidth:{css:"max-width",as:"len"},maxHeight:{css:"max-height",as:"len"},flexBasis:{css:"flex-basis",as:"len"},flexGrow:{css:"flex-grow",as:"num"},flexShrink:{css:"flex-shrink",as:"num"},aspectRatio:{css:"aspect-ratio",as:"num"},gap:{css:["row-gap","column-gap"],as:"len",rank:ee},rowGap:{css:"row-gap",as:"len"},columnGap:{css:"column-gap",as:"len"},...ft("padding",e=>`padding-${e}`),...ft("margin",e=>`margin-${e}`),inset:{css:De,as:"len",rank:ee},top:{css:"top",as:"len"},right:{css:"right",as:"len"},bottom:{css:"bottom",as:"len"},left:{css:"left",as:"len"},start:{css:"inset-inline-start",as:"len",rank:re},end:{css:"inset-inline-end",as:"len",rank:re},flexDirection:{css:"flex-direction",as:"raw"},justifyContent:{css:"justify-content",as:"raw"},alignItems:{css:"align-items",as:"raw"},alignSelf:{css:"align-self",as:"raw"},position:{css:"position",as:"raw"},flexWrap:{css:"flex-wrap",as:"raw"},boxSizing:{css:"box-sizing",as:"raw"},display:{css:"display",as:"raw"},overflow:{rank:ee,to:e=>{const t=e==="scroll"?"auto":String(e);return[["overflow-x",t],["overflow-y",t]]}},scrollDirection:{to:e=>e==="horizontal"?[["overflow-x","auto"],["overflow-y","hidden"],["flex-direction","row"]]:e==="all"?[["overflow-x","auto"],["overflow-y","auto"]]:[["overflow-x","hidden"],["overflow-y","auto"],["flex-direction","column"]],rank:re},...lo(),color:{css:"color"},backgroundColor:{css:"background-color"},borderColor:{css:De.map(e=>`border-${e}-color`),rank:ee},borderTopColor:{css:"border-top-color"},borderRightColor:{css:"border-right-color"},borderBottomColor:{css:"border-bottom-color"},borderLeftColor:{css:"border-left-color"},placeholderColor:{css:"--lc-placeholder"},refreshControlColor:{css:"--lc-refresh"},tintColor:{css:"--lc-tint"},overlayColor:{css:"--lc-overlay"},rippleColor:{none:"a browser has no ripple: the press feedback of a page is `$pressed`"},backgroundImage:{to:(e,t)=>[["--lc-bg-img",wn(e,t)]]},backgroundGradient:{to:e=>[["--lc-bg-grad",Sn(e)]]},backgroundSize:{to:e=>e==="tile"?[["background-size","auto"],["background-repeat","repeat"],["background-position","0 0"]]:[["background-size",e==="fill"?"100% 100%":String(e)],["background-repeat","no-repeat"],["background-position","center"]]},borderRadius:{to:go,rank:ee},borderTopLeftRadius:{css:"border-top-left-radius"},borderTopRightRadius:{css:"border-top-right-radius"},borderBottomRightRadius:{css:"border-bottom-right-radius"},borderBottomLeftRadius:{css:"border-bottom-left-radius"},opacity:{css:"opacity"},transform:{to:e=>[["transform",io(e)]]},transformOrigin:{css:"transform-origin",as:"lens"},pointerEvents:{to:e=>[["pointer-events",e==="none"?"none":"auto"]]},dim:{css:"--lc-dim"},fontSize:{css:"font-size"},fontWeight:{css:"font-weight",as:"raw"},fontStyle:{to:e=>[["font-style",e===2?"italic":e===0?"normal":String(e)]]},fontFamily:{to:e=>[["font-family",yo(e)]]},lineHeight:{to:e=>[["line-height",e==="normal"?"1.2":se(e)]]},letterSpacing:{css:"letter-spacing"},textAlign:{css:"text-align"},textDecoration:{css:"text-decoration-line"},lineClamp:{rank:ee,to:e=>Number(e)>0?[["display","-webkit-box"],["-webkit-box-orient","vertical"],["-webkit-line-clamp",String(Math.round(Number(e)))],["overflow-x","hidden"],["overflow-y","hidden"]]:[["-webkit-line-clamp","none"]]},textOverflow:{css:"text-overflow"},textWrap:{rank:ee,to:e=>e==="nowrap"?[["white-space","pre"],["max-width","none"],["overflow-x","hidden"],["overflow-y","hidden"],["text-overflow","ellipsis"]]:[["white-space","pre-wrap"],["max-width","100%"],["text-wrap",String(e)]]},objectFit:{to:e=>[["object-fit",String(e)],["--lc-fit",e==="fill"?"100% 100%":String(e)]]},placeholder:{attr:!0},type:{attr:!0},enterKey:{attr:!0},autocapitalize:{attr:!0},autocorrect:{attr:!0},maxLength:{attr:!0},keyboardShrink:{attr:!0},keyboardDismiss:{attr:!0},showScrollbar:{to:e=>[["scrollbar-width",vo(e)?"thin":"none"]]},overscrollMode:{to:e=>[["overscroll-behavior",Eo({default:"auto",none:"none",absorb:"contain"})(e)]]},keyboardDismissMode:{attr:!0},snap:{to:e=>e==="none"?[["scroll-snap-type","none"],["--lc-snap","none"]]:[["scroll-snap-type","both mandatory"],["--lc-snap",String(e)]]},sheetDetents:{attr:!0},sheetDetent:{attr:!0},sheetDismissible:{attr:!0},background:{to:mo,rank:ee},border:Se(De,ee),borderTop:Se(["top"],re),borderRight:Se(["right"],re),borderBottom:Se(["bottom"],re),borderLeft:Se(["left"],re),flex:{to:fo,rank:ee}},Ze=e=>qr[e]??e,wo=e=>e in $e,_n=e=>{const t=$e[e];return!!t&&"attr"in t},So={overflow:"overflow-x",pointerEvents:"pointer-events",fontFamily:"font-family",fontStyle:"font-style",lineHeight:"line-height",objectFit:"object-fit",transform:"transform",borderRadius:"border-top-left-radius",borderWidth:"border-top-width",borderColor:"border-top-color",backgroundImage:"--lc-bg-img",backgroundGradient:"--lc-bg-grad",backgroundSize:"background-size",showScrollbar:"scrollbar-width",overscrollMode:"overscroll-behavior",snap:"--lc-snap",lineClamp:"-webkit-line-clamp",textWrap:"text-wrap",borderTopWidth:"border-top-width",borderRightWidth:"border-right-width",borderBottomWidth:"border-bottom-width",borderLeftWidth:"border-left-width",borderHorizontalWidth:"border-left-width",borderVerticalWidth:"border-top-width",borderStartWidth:"border-inline-start-width",borderEndWidth:"border-inline-end-width"},_o=e=>{const t=$e[e];return t&&"css"in t&&typeof t.css=="string"?t.css:So[e]??null},ko={len:se,lens:vn,num:e=>String(e),raw:e=>String(e),color:Ce},To={color:"color",len:"len",enum:"raw",num:"num",str:"raw",layout:"raw"},Bt=e=>{const t=$e[e];return t&&"rank"in t&&t.rank!==void 0?t.rank:ke},et=(e,t,n)=>{const r=[...e].filter(([,i])=>i!=null);r.sort((i,s)=>Bt(i[0])-Bt(s[0]));const o=new Map;for(const[i,s]of r){const l=$e[i];if(!l){n==null||n(i);continue}if("attr"in l||"none"in l)continue;if("to"in l){for(const[E,_]of l.to(s,t))o.set(E,_);continue}const d=ko[l.as??To[ze[i]??"layout"]],u=d(s);if(typeof l.css=="string")o.set(l.css,u);else for(const E of l.css)o.set(E,u)}return o},Vt=e=>[...e].sort((t,n)=>t[0]<n[0]?-1:t[0]>n[0]?1:0).map(([t,n])=>`${t}:${n}`).join(";"),kn=0,Tn=1,Le=2,xe=3,Ln=4,be=65,Ge=1.70158,Me=Ge*1.525,Wt=Ge+1,zt=2*Math.PI/3,Gt=2*Math.PI/4.5,Pe=e=>e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375,dt=[["linear",e=>e],["inSine",e=>1-Math.cos(e*Math.PI/2)],["outSine",e=>Math.sin(e*Math.PI/2)],["inOutSine",e=>-(Math.cos(Math.PI*e)-1)/2],["inQuad",e=>e*e],["outQuad",e=>1-(1-e)*(1-e)],["inOutQuad",e=>e<.5?2*e*e:1-(-2*e+2)**2/2],["inCubic",e=>e*e*e],["outCubic",e=>1-(1-e)**3],["inOutCubic",e=>e<.5?4*e*e*e:1-(-2*e+2)**3/2],["inQuart",e=>e**4],["outQuart",e=>1-(1-e)**4],["inOutQuart",e=>e<.5?8*e**4:1-(-2*e+2)**4/2],["inExpo",e=>e===0?0:2**(10*e-10)],["outExpo",e=>e===1?1:1-2**(-10*e)],["inOutExpo",e=>e===0?0:e===1?1:e<.5?2**(20*e-10)/2:(2-2**(-20*e+10))/2],["inCirc",e=>1-Math.sqrt(1-e*e)],["outCirc",e=>Math.sqrt(1-(e-1)**2)],["inOutCirc",e=>e<.5?(1-Math.sqrt(1-(2*e)**2))/2:(Math.sqrt(1-(-2*e+2)**2)+1)/2],["inBack",e=>Wt*e*e*e-Ge*e*e],["outBack",e=>1+Wt*(e-1)**3+Ge*(e-1)**2],["inOutBack",e=>e<.5?(2*e)**2*((Me+1)*2*e-Me)/2:((2*e-2)**2*((Me+1)*(e*2-2)+Me)+2)/2],["inElastic",e=>e===0?0:e===1?1:-(2**(10*e-10))*Math.sin((e*10-10.75)*zt)],["outElastic",e=>e===0?0:e===1?1:2**(-10*e)*Math.sin((e*10-.75)*zt)+1],["inOutElastic",e=>e===0?0:e===1?1:e<.5?-(2**(20*e-10)*Math.sin((20*e-11.125)*Gt))/2:2**(-20*e+10)*Math.sin((20*e-11.125)*Gt)/2+1],["inBounce",e=>1-Pe(1-e)],["outBounce",Pe],["inOutBounce",e=>e<.5?(1-Pe(1-2*e))/2:(1+Pe(2*e-1))/2],["smoothstep",e=>e*e*(3-2*e)]],Lo={in:"inQuad",out:"outQuad",inOut:"inOutQuad",easeIn:"inQuad",easeOut:"outQuad",easeInOut:"inOutQuad","ease-in":"inQuad","ease-out":"outQuad","ease-in-out":"inOutQuad"},xo=e=>{const t=Lo[e]??e;for(let n=0;n<dt.length;n++)if(dt[n][0]===t)return n;return-1},Ro=[.25,.1,.25,1],Ne={kind:kn,p:[0,0,0,0]},Ao=e=>{const t=new Float32Array(be);for(let n=0;n<be;n++)t[n]=e(n/(be-1));return t[0]=0,t[be-1]=1,t},Co=e=>{if(e===void 0)return Ne;if(typeof e=="function")return{kind:Ln,p:[0,0,0,0],table:Ao(e)};if(Array.isArray(e)){const[o,i,s,l]=e;return{kind:Le,p:[o,i,s,l]}}const t=e.trim();if(t==="linear")return Ne;if(t==="ease")return{kind:Le,p:Ro};if(t==="steps")return{kind:xe,p:[1,0,0,0]};let n=/^steps\(\s*(\d+)\s*(?:,\s*(start|end|jump-start|jump-end)\s*)?\)$/.exec(t);if(n)return{kind:xe,p:[Math.max(1,parseInt(n[1],10)),n[2]==="start"||n[2]==="jump-start"?1:0,0,0]};if(n=/^cubic-bezier\(\s*([-\d.e]+)\s*,\s*([-\d.e]+)\s*,\s*([-\d.e]+)\s*,\s*([-\d.e]+)\s*\)$/.exec(t),n)return{kind:Le,p:[parseFloat(n[1]),parseFloat(n[2]),parseFloat(n[3]),parseFloat(n[4])]};const r=xo(t);return r===0?Ne:r>0?{kind:Tn,p:[r,0,0,0]}:(console.warn(`[tween] unknown easing "${t}" — using linear`),Ne)},$o=(e,t,n,r,o)=>{const i=1-3*r+3*t,s=3*r-6*t,l=3*t,d=1-3*o+3*n,u=3*o-6*n,E=3*n;let _=e;for(let A=0;A<8;A++){const g=((i*_+s)*_+l)*_-e,p=(3*i*_+2*s)*_+l;if(Math.abs(g)<1e-6||Math.abs(p)<1e-6)break;_-=g/p}return _=Math.min(1,Math.max(0,_)),((d*_+u)*_+E)*_},Oo=(e,t)=>{if(t<=0)return e.kind===xe&&e.p[1]===1?1/e.p[0]:0;if(t>=1)return 1;switch(e.kind){case Tn:return dt[e.p[0]][1](t);case Le:return $o(t,e.p[0],e.p[1],e.p[2],e.p[3]);case xe:{const n=e.p[0];return e.p[1]===1?Math.min(1,Math.ceil(t*n)/n):Math.floor(t*n)/n}case Ln:{const n=e.table,r=t*(be-1),o=Math.floor(r),i=n[o],s=n[Math.min(o+1,be-1)];return i+(s-i)*(r-o)}default:return t}},jt=24,Ht=e=>String(Math.round(e*1e4)/1e4),Uo="cubic-bezier(0.3333, 0, 0.6667, 1)",Mo=e=>{switch(e.kind){case kn:return"linear";case Le:return`cubic-bezier(${e.p.map(Ht).join(", ")})`;case xe:return`steps(${e.p[0]}, ${e.p[1]===1?"jump-start":"jump-end"})`}const t=[];for(let n=0;n<=jt;n++)t.push(Ht(Oo(e,n/jt)));return`linear(${t.join(", ")})`},Po=e=>e===void 0||e==="smoothstep"?Uo:Mo(Co(e)),xn=["lc-base","lc-bag","lc-own","lc-orient","lc-class","lc-hover","lc-press","lc-focus"],No=["--lc-bg-grad","--lc-bg-img","--lc-tint","--lc-overlay","--lc-refresh","--lc-fit","--lc-src","--lc-src-tint","--lc-iw","--lc-ih","--lc-ir","--lc-crop-size","--lc-crop-pos"],Rn="lc-app",Fo=`
3
3
  @layer ${xn.join(", ")};
4
4
 
5
5
  @layer lc-base {