lecodes-cli 2.5.0 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +267 -253
- package/package.json +10 -10
- package/runtime/materials/foliage-cards.mat +16 -2
- package/runtime/materials/foliage-impostor.mat +103 -26
- package/runtime/materials/foliage.mat +12 -1
- package/runtime/materials/grass.mat +6 -3
- package/runtime/sdk-types.json +1 -1
- package/runtime/web/VERSION.json +3 -3
- package/runtime/web/assets/{materials-Cs_z1zLi.bin → materials-DE8QZ7Hn.bin} +0 -0
- package/runtime/web/assets/materials-world-CGNyYz_-.bin +0 -0
- package/runtime/web/player.js +3 -3
- package/runtime/web-lite/lite.js +2 -2
- package/src/dev/localBackend.ts +4 -2
- package/src/hosts/desktopRenderer.ts +8 -2
- package/runtime/web/assets/materials-world-BtoAfznA.bin +0 -0
package/runtime/web-lite/lite.js
CHANGED
|
@@ -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.5.0",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,Nr=64,Qe=128,Pr=256,Fr=512,Ir=1024,Dr=2048,Br=4096,Nt=8192,Oi=16384,Vr=32768,Wr=1<<18,zr=255,Pt=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,Ne=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-Ne(1-e)],["outBounce",Ne],["inOutBounce",e=>e<.5?(1-Ne(1-2*e))/2:(1+Ne(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],Pe={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 Pe;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 Pe;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?Pe:r>0?{kind:Tn,p:[r,0,0,0]}:(console.warn(`[tween] unknown easing "${t}" — using linear`),Pe)},$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(", ")})`},No=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"],Po=["--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.6.0",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,Nr=64,Qe=128,Pr=256,Fr=512,Ir=1024,Dr=2048,Br=4096,Nt=8192,Oi=16384,Vr=32768,Wr=1<<18,zr=255,Pt=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,Ne=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-Ne(1-e)],["outBounce",Ne],["inOutBounce",e=>e<.5?(1-Ne(1-2*e))/2:(1+Ne(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],Pe={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 Pe;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 Pe;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?Pe:r>0?{kind:Tn,p:[r,0,0,0]}:(console.warn(`[tween] unknown easing "${t}" — using linear`),Pe)},$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(", ")})`},No=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"],Po=["--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 {
|
|
@@ -282,7 +282,7 @@ ${e.stack}`:String(e);try{return JSON.stringify(e)}catch{return String(e)}},nr=(
|
|
|
282
282
|
}
|
|
283
283
|
.lc-toast.lc-on { opacity: 1; transform: none; }
|
|
284
284
|
}
|
|
285
|
-
`,Io=e=>{const t=e.defaultView??window;try{t.CSS.registerProperty({name:"--lc-dim",syntax:"<number>",inherits:!0,initialValue:"0"})}catch{}for(const d of Po)try{t.CSS.registerProperty({name:d,syntax:"*",inherits:!1})}catch{}const n=e.createElement("style");n.setAttribute("data-lecodes-lite",""),n.textContent=Fo,e.head.appendChild(n);const r=n.sheet,o=(d,u)=>{const E=d.insertRule(u,d.cssRules.length);return d.cssRules[E]},i=(d,u)=>{const E=d.cssRules;for(let _=E.length-1;_>=0;_--)if(E[_]===u){d.deleteRule(_);return}},s=new Map,l=(d,u)=>{const E=u===void 0?d:`${d}.${u}`;let _=s.get(E);return _||(_=u===void 0?o(r,`@layer ${d} {}`):o(l(d),`@layer ${u} {}`),s.set(E,_)),_};for(const d of xn)d!=="lc-base"&&l(d);return{insert(d,u,E){const _=l(d,E),A=o(_,u);return{remove:()=>i(_,A)}},own(d){const u=l("lc-own"),E=o(u,`${d} {}`);return{set:(_,A)=>E.style.setProperty(_,A),unset:_=>{E.style.removeProperty(_)},remove:()=>i(u,E)}},destroy(){n.remove()}}},pt="lc-i";let Do=1;const tt=new Map,An=e=>{let t=tt.get(e);return t||tt.set(e,t=`lc-c${tt.size+1}`),t},Bo=(e,t)=>{const n=`{${t.text}}`,r=o=>`${o} .${e}, .${e}${o}`;switch(t.name){case"pressed":return{layer:"lc-press",text:`${r(`.${pt}:active`)} ${n}`};case"hovered":return{layer:"lc-hover",text:`@media (hover: hover) { ${r(`.${pt}:hover`)} ${n} }`};case"focused":return{layer:"lc-focus",text:`${r(".lc:focus-visible")} ${n}`};case"landscape":case"portrait":return{layer:"lc-orient",text:`@container ${Rn} (orientation: ${t.name}) { .${e} ${n} }`};default:{const o=An(t.name);return{layer:"lc-class",sub:o,text:`${r(`.${o}`)} ${n}`}}}},Vo=e=>e.base+""+e.transition+e.blocks.map(t=>`${t.name}${t.text}`).join(""),Wo=256,zo=e=>{const t=new Map,n=new Set,r=()=>{let o=n.size>>1;for(const i of n){if(o--<=0)break;for(const s of i.rules)s.remove();n.delete(i),t.delete(i.key)}};return{acquire(o){const i=Vo(o);let s=t.get(i);if(s)return s.refs===0&&n.delete(s),s.refs++,s;const l=`lc-s${Do++}`,d=[],u=o.transition?`${o.base?";":""}transition:${o.transition}`:"";d.push(e.insert("lc-bag",`.${l} {${o.base}${u}}`));for(const E of o.blocks){const _=Bo(l,E);d.push(e.insert(_.layer,_.text,_.sub))}return t.set(i,s={name:l,key:i,refs:1,rules:d}),s},release(o){--o.refs>0||(n.add(o),n.size>Wo&&r())},count:()=>({live:t.size-n.size,idle:n.size})}},Go=()=>({base:new Map,own:new Map,blocks:new Map,cls:null,rule:null,applied:new Map,dirty:!1}),Kt=new Set([...Qr,"easing"]),jo=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)&&!("_h"in e),Ho=(e,t,n,r)=>{const o=new Set;let i=!1;const s=new Set,l=v=>{s.has(v)||(s.add(v),r(`style: "${v}" is not a style property — ignored`))};let d=null,u=null;const E=v=>{v.style.dirty=!0,o.add(v),!i&&(i=!0,queueMicrotask(p))},_=v=>{const k=v.style,$=et(k.own,n,l);if(!($.size===0&&!k.rule)){k.rule||(k.rule=e.own(`.lc-n${v.id}`),v.el.classList.add(`lc-n${v.id}`));for(const P of k.applied.keys())$.has(P)||k.rule.unset(P);for(const[P,O]of $)k.applied.get(P)!==O&&k.rule.set(P,O);k.applied=$}},A=(v,k)=>{const $=new Map;for(const[P,O]of v){if(!(O.duration>0))continue;const F=`${O.duration}ms ${No(O.easing)} ${O.delay}ms`;for(const W of k.get(P).keys())W.startsWith("--")||$.set(W,`${W} ${F}`)}return[...$.values()].join(", ")},g=v=>{const k=v.style;k.dirty=!1;const $=Vt(et(k.base,n,l)),P=new Map,O=[];for(const[W,z]of k.blocks){const h=et(z.props,n,l);P.set(W,h),h.size>0&&O.push({name:W,text:Vt(h)})}const F=k.cls;$===""&&O.length===0?k.cls=null:k.cls=t.acquire({base:$,blocks:O,transition:A(k.blocks,P)}),F!==k.cls&&(F&&v.el.classList.remove(F.name),k.cls&&v.el.classList.add(k.cls.name)),F&&t.release(F),d==null||d(v)};function p(){if(i=!1,o.size===0)return;const v=[...o];o.clear();for(const k of v)k.style.dirty&&g(k)}const y=(v,k,$)=>{if($==null){v.blocks.delete(k);return}if(!jo($))return;let P=v.blocks.get(k);P||v.blocks.set(k,P={props:new Map,duration:0,delay:0,easing:void 0});for(const O of Object.keys($)){const F=$[O];if(O==="duration"){P.duration=Number(F)||0;continue}if(O==="delay"){P.delay=Number(F)||0;continue}if(O==="easing"){P.easing=F;continue}if(Kt.has(O)||O[0]==="$")continue;const W=Ze(O);P.props.delete(W),F!=null&&P.props.set(W,F)}};return{flush:p,set onChange(v){d=v},set onWrite(v){u=v},merge(v,k){const $=v.style;let P=!1;for(const O of Object.keys(k)){const F=k[O];if(O[0]==="$"){y($,O.slice(1),F);continue}if(Kt.has(O))continue;const W=Ze(O);$.base.delete(W),F!=null&&$.base.set(W,F),$.own.delete(W)&&(P=!0),u==null||u(v,W)}P&&_(v),E(v)},set(v,k,$){const P=v.style;if(k[0]==="$"){y(P,k.slice(1),$),E(v);return}const O=Ze(k);if(!wo(O)){l(O);return}u==null||u(v,O),$==null?(P.own.delete(O),P.base.delete(O)&&E(v)):P.own.set(O,$),_(v),(_n(O)||O==="tintColor")&&(d==null||d(v))},setClass(v,k,$){v.el.classList.toggle(An(k),$)},value(v,k){const $=v.style;return $.own.has(k)?$.own.get(k):$.base.get(k)},owns(v,k){return v.style.own.has(k)||v.style.base.has(k)},names(v,k){const $=v.style;if($.own.has(k)||$.base.has(k))return!0;for(const P of $.blocks.values())if(P.props.has(k))return!0;return!1},drop(v){const k=v.style;o.delete(v),k.cls&&(t.release(k.cls),k.cls=null),k.rule&&(k.rule.remove(),k.rule=null)}}},Ko={button:"button",input:"input",textarea:"textarea",image:"img"},Yo=(e,t)=>{const n=e.createElement(Ko[t]??"div");if(n.className=`lc lc-${t}`,t==="button"&&(n.type="button"),t==="image"){const r=n;r.alt="",r.decoding="async",r.draggable=!1}return n},qo=(e,t,n)=>({id:t,type:n,el:Yo(e,n),parent:null,flags:0,held:!0,rooted:!1,token:{},style:Go(),strings:new Map}),Cn=Symbol("lecodes.node"),ye=e=>e==null?void 0:e[Cn],$n=e=>{e.el[Cn]=e,e.el.setAttribute("data-node",String(e.id))},Te=e=>{const t=[];for(let n=e.el.firstElementChild;n;n=n.nextElementSibling){const r=ye(n);r&&r.parent===e&&t.push(r)}return t},nt=(e,t=",")=>{const n=[];let r=0,o="";for(const i of e){if(i==="("&&r++,i===")"&&r--,i===t&&r===0){n.push(o.trim()),o="";continue}o+=i}return o.trim()!==""&&n.push(o.trim()),n},Yt={"to top":0,"to right":90,"to bottom":180,"to left":270,"to top right":45,"to right top":45,"to bottom right":135,"to right bottom":135,"to bottom left":225,"to left bottom":225,"to top left":315,"to left top":315},Xo=e=>{if(e in Yt)return Yt[e];const t=/^(-?[\d.]+)(deg|rad|turn|grad)$/.exec(e);if(!t)return null;const n=parseFloat(t[1]);return t[2]==="deg"?n:t[2]==="rad"?n*180/Math.PI:t[2]==="turn"?n*360:n*.9},Jo=(e,t)=>{const n=[];for(const r of nt(e.trim())){const o=/^(?:repeating-)?(linear|radial)-gradient\((.*)\)$/s.exec(r);if(!o)return null;const i=o[1],s=nt(o[2]);let l=i==="linear"?180:0;if(s.length>0){const u=s[0],E=i==="linear"?Xo(u):null;E!==null?(l=E,s.shift()):i==="radial"&&/\b(circle|ellipse|at|closest|farthest)\b/.test(u)&&s.shift()}const d=[];for(const u of s){const E=nt(u," "),_=E[E.length-1],A=E.length>1&&/^-?[\d.]+%$/.test(_),g=A?E.slice(0,-1).join(" "):u;d.push({color:t(g)??"#00000000",position:A?parseFloat(_)/100:null})}if(d.length===0)return null;d[0].position===null&&(d[0].position=0),d[d.length-1].position===null&&(d[d.length-1].position=1);for(let u=1;u<d.length-1;u++){if(d[u].position!==null)continue;let E=u;for(;d[E].position===null;)E++;const _=d[u-1].position,A=d[E].position;for(let g=u;g<E;g++)d[g].position=_+(A-_)*(g-u+1)/(E-u+1);u=E}n.push({type:i,angle:l,stops:d.map(u=>({color:u.color,position:u.position}))})}return n.length>0?n:null},Qo=Object.keys(ze).filter(e=>ze[e]!=="layout"),le=e=>Math.max(0,Math.min(255,Math.round(e))).toString(16).padStart(2,"0"),qt=e=>{const t=/^rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)(?:\s*[,/]\s*([\d.]+%?))?\s*\)$/.exec(e.trim());if(t){const r=t[4]===void 0?1:t[4].endsWith("%")?parseFloat(t[4])/100:parseFloat(t[4]);return`#${le(+t[1])}${le(+t[2])}${le(+t[3])}${le(r*255)}`}const n=/^color\(srgb\s+([\d.]+)\s+([\d.]+)\s+([\d.]+)(?:\s*\/\s*([\d.]+))?\)$/.exec(e.trim());return n?`#${le(+n[1]*255)}${le(+n[2]*255)}${le(+n[3]*255)}${le((n[4]===void 0?1:+n[4])*255)}`:null},Zo=e=>{if(e==="none")return[1,0,0,0,1,0,0,0,1];const t=/^matrix\(([^)]+)\)$/.exec(e);if(!t)return null;const[n,r,o,i,s,l]=t[1].split(",").map(d=>parseFloat(d));return[n,r,0,o,i,0,s,l,1]},Xt={pointerEvents:{auto:"all"},overflow:{auto:"scroll"},display:{"-webkit-box":"flex",block:"flex"},showScrollbar:{none:"0",thin:"1",auto:"1"},overscrollMode:{auto:"default",contain:"absorb"},textAlign:{"-webkit-auto":"start"}},es=e=>{const t=e.root.ownerDocument,n=t.defaultView??window;let r=null;const o=u=>{r||(r=t.createElement("span"),r.style.cssText="position:absolute;visibility:hidden;pointer-events:none"),r.isConnected||e.root.appendChild(r),r.style.color="",r.style.color=u;const E=r.style.color===""?null:qt(n.getComputedStyle(r).color);return r.remove(),E},i=(u,E,_,A)=>{var y,v;if(_n(E)){const k=e.value(u,E);return k==null?null:_==="num"?Number(k===!0?1:k===!1?0:k):String(k)}const g=_o(E);if(g===null)return null;const p=A.getPropertyValue(g).trim();if(p===""&&!u.el.isConnected)return s(u,E,_);if(p==="")return null;switch(_){case"color":return g.startsWith("--")?o(p):qt(p);case"len":{const k=parseFloat(p);return Number.isFinite(k)?k:E==="lineHeight"?parseFloat(A.fontSize)*1.2:null}case"num":{if(E==="lineClamp")return p==="none"?0:parseFloat(p)||0;const k=parseFloat(((y=Xt[E])==null?void 0:y[p])??p);return Number.isFinite(k)?k:null}case"enum":return((v=Xt[E])==null?void 0:v[p])??p;default:return E==="backgroundGradient"?p==="none"?null:Jo(p,o):E==="transform"?Zo(p):E==="transformOrigin"?null:E==="fontFamily"?p.split(",")[0].trim().replace(/^["']|["']$/g,""):E==="backgroundImage"&&p==="none"?"":p}},s=(u,E,_)=>{const A=e.value(u,E)??Jr[E];if(A==null)return null;if(E==="transform")return A==="identity"||A==="none"?[1,0,0,0,1,0,0,0,1]:null;if(_==="color")return typeof A=="number"?`#${(A>>>0).toString(16).padStart(8,"0")}`:o(String(A));if(_==="len"||_==="num"){const g=typeof A=="number"?A:parseFloat(String(A));return Number.isFinite(g)?g:null}return String(A)},l=u=>{const E=n.getComputedStyle(u.el),_=[],A=[],g={};for(const p of Qo){const y=e.owns(u,p);y&&_.push(p);const v=i(u,p,ze[p],E);if(Xr.includes(p)&&!y&&(v===null||v==="none")){g[p]=null;continue}A.push(p),g[p]=v}return{present:A,dirty:[],own:_,...g}},d=u=>{const E=u.el,_={id:u.id,type:u.type},A=u.strings.get("name");A&&(_.name=A);const g=u.strings.get("text");return u.type==="text"&&g&&(_.text=g),(u.type==="input"||u.type==="textarea")&&(_.value=E.value),_.flags=u.flags,_.layout=[E.offsetLeft,E.offsetTop,E.offsetWidth,E.offsetHeight],_.paint=l(u),e.extend(u,_,d),_.children=e.held(u)?[]:Te(u).map(d),_};return{dump(){return e.flush(),JSON.stringify({roots:e.roots().map(u=>({kind:u.kind,node:d(u.node)}))})},paint(u){return u?(e.flush(),JSON.stringify(l(u))):"null"}}},rt=10,ts=500,ns=e=>{const{root:t,emit:n}=e,r=t.ownerDocument,o=r.defaultView??window,i=b=>{const m=t.getBoundingClientRect(),C=gn(t)||1;return[(b.clientX-m.left)/C,(b.clientY-m.top)/C]},s=(b,m)=>{for(let C=b instanceof Element?b:null;C&&C!==t;C=C.parentElement){if(e.boundary(C))return null;const x=ye(C);if(x&&(x.flags&m)!==0)return x}return null},l=new Map;let d=!1,u=null;const E=(b,m)=>{const C=typeof m=="number"?m:0;(C&Pt)!==0&&(b.tracked=!0,b.wantsMove=(C&Ft)!==0,b.claim=C&zr)},_=b=>{o.clearTimeout(b.timer),l.delete(b.pointerId)},A=b=>{if(b.pointerType==="mouse"&&b.button!==0)return;const m=s(b.target,Ie),[C,x]=i(b);u=[C,x],d=!1;const U={pointerId:b.pointerId,node:m,startX:C,startY:x,lastX:C,lastY:x,moved:!1,tracked:!1,wantsMove:!1,claim:0,handled:!1,timer:0};if(l.set(b.pointerId,U),!m){const N=b.target instanceof Element?e.hit(b.target,C,x):null;N!==null&&E(U,n(0,Rr,b.pointerId,C,x,N));return}E(U,n(m.id,fr,b.pointerId,C,x)),(m.flags&Ur)!==0&&(U.timer=o.setTimeout(()=>{if(l.get(U.pointerId)!==U||U.moved)return;const N=n(m.id,pr,U.pointerId,U.startX,U.startY),B=typeof N=="number"?N:0;(B&Gr)!==0&&(U.handled=!0),E(U,B)},ts))},g=b=>{const m=l.get(b.pointerId);if(m){const[C,x]=i(b);!m.moved&&Math.hypot(C-m.startX,x-m.startY)>rt&&(m.moved=!0,o.clearTimeout(m.timer));const U=C-m.lastX,N=x-m.lastY;m.lastX=C,m.lastY=x,m.tracked&&m.wantsMove&&n(0,hr,b.pointerId,C,x,U,N)}b.pointerType==="mouse"&&z(b)},p=b=>{const m=l.get(b.pointerId);if(!m)return;const[C,x]=i(b);m.tracked&&n(0,mr,b.pointerId,C,x,C-m.lastX,x-m.lastY),(m.moved||m.handled)&&(d=!0),_(m)},y=b=>{const m=l.get(b.pointerId);m&&(m.tracked&&n(0,xt,b.pointerId),d=!0,_(m))},v=b=>{if(b.cancelable){for(const m of l.values())if(m.tracked&&m.claim!==0){b.preventDefault();return}}},k=b=>{if(d){d=!1;return}const m=s(b.target,Ie);if(!m&&b.target instanceof Element){const[U,N]=i(b);if(u&&Math.hypot(U-u[0],N-u[1])>rt)return;const B=e.hit(b.target,U,N);B!==null&&n(0,Ar,b.pointerId??0,U,N,B);return}if(!m||(m.flags&Or)===0)return;let C,x;if(b.detail===0&&b.clientX===0&&b.clientY===0){const U=m.el.getBoundingClientRect();[C,x]=i({clientX:U.left+U.width/2,clientY:U.top+U.height/2})}else if([C,x]=i(b),u&&Math.hypot(C-u[0],x-u[1])>rt)return;n(m.id,dr,b.pointerId??0,C,x)};let $=null,P=!1,O=!1,F=[0,0];const W=(b,m)=>{$&&P&&(b===Ut?n(0,b):n(0,b,m[0],m[1],m[0]-F[0],m[1]-F[1])),$=null,P=!1,O=!1};function z(b){const m=i(b),C=t.contains(b.target)?s(b.target,Ie):null;if(C!==$){if(W(Ot,m),F=m,$=C,C&&(C.flags&Wr)!==0){const x=n(C.id,Cr,m[0],m[1]),U=typeof x=="number"?x:0;P=(U&Pt)!==0,O=(U&Ft)!==0}return}$&&P&&O&&n(0,$r,m[0],m[1],m[0]-F[0],m[1]-F[1]),F=m}const h=b=>{b.pointerType==="mouse"&&W(Ot,i(b))},w=b=>{const m=ye(b instanceof Element?b:null);return m&&(m.type==="input"||m.type==="textarea")?m:null},M=b=>{const m=w(b.target);m&&(m.flags&Pr)!==0&&n(m.id,vr,m.el.value)},D=b=>{const m=w(b.target);m&&(m.flags&Fr)!==0&&n(m.id,Er)},I=b=>{const m=w(b.target);m&&(m.flags&Ir)!==0&&n(m.id,wr)},V=b=>{if(b.key!=="Enter"||b.isComposing)return;const m=w(b.target);if(!m||m.type!=="input")return;b.preventDefault();const C=m.el;(m.flags&Dr)!==0&&n(m.id,Sr,C.value),e.value(m,"enterKey")!=="next"&&r.activeElement===C&&C.blur()},c=b=>{const m=o.getComputedStyle(b);return m.overflowX!=="hidden"&&m.overflowY==="hidden"},L=b=>{const m=ye(b.target instanceof Element?b.target:null);!m||(m.flags&Mr)===0||n(m.id,gr,c(m.el)?m.el.scrollLeft:m.el.scrollTop)},T=b=>{const m=ye(b.target instanceof Element?b.target:null);m&&(m.flags&Nr)!==0&&n(m.id,br)};return t.addEventListener("pointerdown",A),t.addEventListener("click",k),t.addEventListener("pointerleave",h),t.addEventListener("touchmove",v,{passive:!1}),t.addEventListener("input",M),t.addEventListener("focusin",D),t.addEventListener("focusout",I),t.addEventListener("keydown",V),t.addEventListener("scroll",L,!0),t.addEventListener("scrollend",T,!0),r.addEventListener("pointermove",g),r.addEventListener("pointerup",p),r.addEventListener("pointercancel",y),{isPressed(b){for(const m of l.values())if(m.node===b)return!0;return!1},isHovered:b=>$===b,forget(b){for(const m of[...l.values()])m.node===b&&(m.tracked&&n(0,xt,m.pointerId),_(m));$===b&&W(Ut,[0,0])},destroy(){for(const b of l.values())o.clearTimeout(b.timer);l.clear(),t.removeEventListener("pointerdown",A),t.removeEventListener("click",k),t.removeEventListener("pointerleave",h),t.removeEventListener("touchmove",v),t.removeEventListener("input",M),t.removeEventListener("focusin",D),t.removeEventListener("focusout",I),t.removeEventListener("keydown",V),t.removeEventListener("scroll",L,!0),t.removeEventListener("scrollend",T,!0),r.removeEventListener("pointermove",g),r.removeEventListener("pointerup",p),r.removeEventListener("pointercancel",y)}}},rs=e=>`url("${e.replace(/["\\\n]/g,t=>"\\"+t)}")`,os=e=>{const t=g=>g.image??(g.image={src:"",srcTint:null,rect:null,form:"img",probe:0}),n=g=>g.src.startsWith("svg:")?g.src.slice(4):null,r=new Map,o=(g,p)=>{const y=r.get(p);y!=null&&y.delete(g)&&y.size===0&&r.delete(p)},i=g=>{const p=g.src,y=n(g);return y!==null?bn(y):p.startsWith("id:")?e.bufferUrl(Number(p.slice(3))):p.startsWith("canvas:")||p.startsWith("scene2d:")?"":p},s=(g,p)=>p.src.startsWith("canvas:")?"canvas":p.rect?"crop":n(p)!==null&&(p.srcTint!==null||e.hasTint(g))?"mask":"img",l=(g,p)=>{const y=g.el;if(y.tagName.toLowerCase()===p)return;const v=e.doc.createElement(p);if(v.className=y.className,p==="img"){const $=v;$.alt="",$.decoding="async",$.draggable=!1}const k=y.getAttribute("data-name");k!==null&&v.setAttribute("data-name",k),g.el=v,$n(g),y.replaceWith(v),e.swapped(g,y)},d=g=>{for(const p of["--lc-src","--lc-src-tint","--lc-iw","--lc-ih","--lc-ir","--lc-crop-size","--lc-crop-pos"])g.style.removeProperty(p)},u=(g,p,y)=>{const[v,k,$,P]=p,[O,F]=y;g.style.setProperty("--lc-crop-size",`${O/$*100}% ${F/P*100}%`),g.style.setProperty("--lc-crop-pos",`${O===$?0:v/(O-$)*100}% ${F===P?0:k/(F-P)*100}%`)},E=new WeakMap,_=(g,p)=>{const y=g.el,v=e.drawable(p);if(!v){y.width=0,y.height=0;return}y.width!==v.pixelWidth&&(y.width=v.pixelWidth),y.height!==v.pixelHeight&&(y.height=v.pixelHeight);const k=y.getContext("2d");k&&(k.clearRect(0,0,y.width,y.height),y.width>0&&y.height>0&&k.drawImage(v.image,0,0),y.style.setProperty("--lc-iw",`${v.width}px`),v.height>0&&y.style.setProperty("--lc-ir",`${v.width} / ${v.height}`))},A=g=>{var W;const p=t(g),y=s(g,p);p.form=y,l(g,y==="img"?"img":y==="canvas"?"canvas":"div");const v=g.el;if(v.classList.toggle("lc-image-mask",y==="mask"),v.classList.toggle("lc-image-crop",y==="crop"),v.classList.toggle("lc-image-canvas",y==="canvas"),d(v),y==="canvas"){_(g,p.src);return}const k=i(p);if(y==="img"){const z=v;k===""?z.removeAttribute("src"):z.getAttribute("src")!==k&&(z.src=k);return}if(v.style.setProperty("--lc-src",k===""?"none":rs(k)),y==="mask"){p.srcTint!==null&&v.style.setProperty("--lc-src-tint",Ce(p.srcTint));const z=(W=Zr(n(p)??""))==null?void 0:W.trim().split(/[\s,]+/).map(Number),h=z==null?void 0:z[2],w=z==null?void 0:z[3];h&&w&&(v.style.setProperty("--lc-iw",`${h}px`),v.style.setProperty("--lc-ir",`${h} / ${w}`));return}const $=p.rect;v.style.setProperty("--lc-iw",`${$[2]}px`),v.style.setProperty("--lc-ih",`${$[3]}px`);const P=E.get(g);if(P&&P.url===k){u(v,$,P.size);return}if(k==="")return;const O=++p.probe,F=new Image;F.addEventListener("load",()=>{if(p.probe!==O||!p.rect)return;const z=[F.naturalWidth,F.naturalHeight];E.set(g,{url:k,size:z}),u(g.el,p.rect,z)},{once:!0}),F.src=k};return{setSrc(g,p){const y=t(g);if(y.src.startsWith("canvas:")&&o(g,y.src),y.src=p??"",y.srcTint=null,y.src.startsWith("canvas:")){let v=r.get(y.src);v||r.set(y.src,v=new Set),v.add(g)}A(g)},setSrcTint(g,p){t(g).srcTint=p,A(g)},setSourceRect(g,p){const y=t(g),v=p==null?void 0:p.trim().split(/\s+/).map(Number),k=v&&v.length===4&&v.every(O=>Number.isFinite(O))&&v[2]>0&&v[3]>0?v:null,$=!!y.rect&&!!k&&y.form==="crop"&&y.rect[2]===k[2]&&y.rect[3]===k[3];y.rect=k;const P=E.get(g);if($&&P){u(g.el,k,P.size);return}A(g)},sourceChanged(g){var p;for(const y of r.get(g)??[])((p=y.image)==null?void 0:p.form)==="canvas"&&_(y,g)},forget(g){var p;(p=g.image)!=null&&p.src.startsWith("canvas:")&&o(g,g.image.src)},restyle(g){const p=g.image;p&&s(g,p)!==p.form&&A(g)}}},ss=.5,is=64,Jt=48,as=e=>{const{root:t,emit:n}=e,r=t.ownerDocument,o=r.defaultView??window,i=new Map;let s=null;const l=p=>{let y=i.get(p);if(!y||!y.isConnected){y=r.createElement("div"),y.className="lc-refresh",y.style.setProperty("--lc-refresh-color",o.getComputedStyle(p.el).getPropertyValue("--lc-refresh").trim()||"#8e8e93");const v=p.el.parentElement;v&&(v.appendChild(y),y.style.top=`${p.el.offsetTop-36}px`,y.style.left=`${p.el.offsetLeft+p.el.offsetWidth/2}px`),i.set(p,y)}return y},d=(p,y,v)=>{const k=l(p);k.classList.toggle("lc-settling",v),k.style.translate=`0 ${y}px`,k.style.transform=`rotate(${y*3}deg)`,k.style.opacity=String(Math.min(1,y/Jt))},u=p=>{const y=i.get(p);y&&(y.classList.remove("lc-spinning"),d(p,0,!0),o.setTimeout(()=>{i.get(p)===y&&(y.remove(),i.delete(p))},220))},E=p=>{for(let y=p instanceof Element?p:null;y&&y!==t;y=y.parentElement){const v=ye(y);if(v&&(v.flags&(Qe|Je))!==0)return v}return null},_=p=>{if(s||p.touches.length!==1)return;const y=E(p.target);if(!y)return;const v=p.changedTouches[0];s={node:y,touch:v.identifier,startY:v.clientY,pulling:!1,distance:0}},A=p=>{if(!s)return;const y=[...p.changedTouches].find(k=>k.identifier===s.touch);if(!y)return;const v=y.clientY-s.startY;if(!s.pulling){if(s.node.el.scrollTop>0||v<=0){(v<0||s.node.el.scrollTop>0)&&(s.startY=y.clientY);return}s.pulling=!0}p.cancelable&&p.preventDefault(),s.distance=Math.max(0,v*ss),(s.node.flags&Je)!==0&&n(s.node.id,Rt,s.distance),(s.node.flags&Qe)!==0&&d(s.node,s.distance,!1)},g=p=>{if(!s||![...p.changedTouches].some(P=>P.identifier===s.touch))return;const{node:y,pulling:v,distance:k}=s;if(s=null,!v||((y.flags&Je)!==0&&n(y.id,Rt,0),(y.flags&Qe)===0))return;if(k<is||p.type==="touchcancel"){u(y);return}d(y,Jt,!0),l(y).classList.add("lc-spinning");const $=n(y.id,yr);Promise.resolve($).then(()=>u(y),()=>u(y))};return t.addEventListener("touchstart",_,{passive:!0}),t.addEventListener("touchmove",A,{passive:!1}),t.addEventListener("touchend",g),t.addEventListener("touchcancel",g),{forget(p){var y;(s==null?void 0:s.node)===p&&(s=null),(y=i.get(p))==null||y.remove(),i.delete(p)},destroy(){t.removeEventListener("touchstart",_),t.removeEventListener("touchmove",A),t.removeEventListener("touchend",g),t.removeEventListener("touchcancel",g);for(const p of i.values())p.remove();i.clear(),s=null}}},Qt=".lc-scrollable, .lc-vlist, .lc-pager-track, textarea.lc, input.lc",je=new WeakMap,Et=e=>{if(!e.isConnected)return;const t=[],n=r=>{(r.scrollLeft!==0||r.scrollTop!==0)&&t.push({el:r,left:r.scrollLeft,top:r.scrollTop})};e.matches(Qt)&&n(e);for(const r of e.querySelectorAll(Qt))n(r);t.length>0?je.set(e,t):je.delete(e)},On=e=>{const t=je.get(e);if(t){je.delete(e);for(const{el:n,left:r,top:o}of t)!n.isConnected||!e.contains(n)||(n.scrollLeft=r,n.scrollTop=o)}},ht=e=>{Et(e),e.remove()},Un=(e,t,n=null)=>{t.parentElement===e&&(n===null||t.nextElementSibling===n)||(t.isConnected&&Et(t),e.insertBefore(t,n),On(t))},_e=0,ge=-1,Mn={run:(e,t,n,r)=>r(),settle:()=>{},enterOnTop:()=>!0,holds:()=>!1},ls={[jr]:"a 3D scene",[Hr]:"a 2D scene",[Kr]:"a native view",[We]:"a video"},cs=e=>{const t=e.transitions??Mn;let n=null,r=[],o=[];const i=new Map,s=(h,w)=>`${h}:${w}`,l=new Set,d=h=>r.includes(h),u=h=>r.some(w=>w.node===h),E=h=>h&&h.kind===te?h.node:null,_=(h,w)=>{e.emit(h.kind===te||h.kind===We?h.id:0,w,h.kind,h.id)},A=(h,w,M,D)=>{let I=null;return(h===te||h===We)&&(I=e.node(w)??null,!I||h===te&&I.type!=="screen")?(e.warn(`navigation: ${w} is not a live ${h===te?"screen":"video"} node`),null):{kind:h,id:w,node:I,viewName:M,paramsJson:D||"{}",back:_e,retired:!1}},g=(h,w)=>{var D;const M=E(h);if(!M){if((D=e.surface)!=null&&D.call(e,h,!0)){h.node&&e.rootOwned(h.node,!0);return}l.has(h.kind)||(l.add(h.kind),e.warn(`${ls[h.kind]??"this destination"} as a destination is not built yet (docs/plans/web-lite-plan.md) — nothing is shown for it`));return}e.rootOwned(M,!0),M.el.classList.remove("lc-covered"),M.el.classList.toggle("lc-above",w),Un(e.root,M.el)},p=h=>{var M;const w=E(h);!w&&h!==n&&((M=e.surface)==null||M.call(e,h,!1)),!(!w||h===n)&&(n&&n.node===w||(w.el.classList.remove("lc-above"),u(w)?w.el.classList.add("lc-covered"):ht(w.el)))},y=h=>{const w=E(h);!w&&h.node&&!(n&&n.node===h.node)&&!u(h.node)&&(e.rootOwned(h.node,!1),h.node.parent===null&&e.emit(h.node.id,Ct)),w&&(n&&n.node===w||u(w)||(w.el.classList.remove("lc-above"),ht(w.el),e.rootOwned(w,!1),e.emit(w.id,Ct)))},v=()=>{const h=o;o=[];for(const w of h)w.node&&t.holds(w.node)?o.push(w):y(w)},k=h=>{!h||h.retired||(h.retired=!0,o.push(h),e.post(v))},$=(h,w,M)=>{const D=M===ge?_e:M,I=E(h),V=E(w);I&&V&&V.el.classList.toggle("lc-above",!I.el.classList.contains("lc-above")),t.run(I,V,D,()=>{var c;I==null||I.el.classList.remove("lc-above"),V==null||V.el.classList.remove("lc-above"),w&&p(w),o.length>0&&e.post(v),(c=e.settled)==null||c.call(e)})},P=h=>{var w;h.kind===te&&h.node&&((w=e.active)==null||w.call(e,h.node,!1)),_(h,Tr)},O=(h,w)=>{var I,V;const M=n;if(!h||M===h)return;t.settle(),M&&P(M),n=h;const D=!!E(h)&&!!E(M);g(h,!!E(h)&&(!D||t.enterOnTop(w))),_(h,kr),h.kind===te&&h.node&&((I=e.active)==null||I.call(e,h.node,!0)),M&&!d(M)&&k(M),$(h,M,w),(V=e.changed)==null||V.call(e)},F=h=>{var M;t.settle();const w=n;w&&(P(w),n=null,d(w)||k(w),$(null,w,h),(M=e.changed)==null||M.call(e))},W=(h,w)=>{O(h,w),e.emit(0,xr,h.kind,h.id)},z=h=>{const w=r.length;return h===-1?w-2:h<-1?Math.max(w-1+h,0):h===0?0:Math.min(h,w-1)};return{current:()=>n,stack:()=>r,setUrl(h,w,M){var I;M===null||M===""?i.delete(s(h,w)):i.set(s(h,w),M.startsWith("/")?M:`/${M}`),(n&&n.kind===h&&n.id===w||r.some(V=>V.kind===h&&V.id===w))&&((I=e.changed)==null||I.call(e))},address(){if(n){const w=i.get(s(n.kind,n.id));if(w!==void 0)return w}const h=n?r.lastIndexOf(n):r.length-1;for(let w=h<0?r.length-1:h;w>=0;w--){const M=i.get(s(r[w].kind,r[w].id));if(M!==void 0)return M}return null},forgetUrl(h,w){i.delete(s(h,w))},open(h,w,M,D,I){O(A(h,w,M,D),I)},close(h,w,M){!n||n.kind!==h||n.id!==w||F(M)},routerOpen(h,w,M,D){const I=A(h,w,M,D);if(!I)return;const V=r;r=[I];for(const c of V)c!==n&&k(c);O(I,_e)},routerPush(h,w,M,D,I,V){const c=A(h,w,M,D);c&&(c.back=V===ge?_e:V,r.push(c),W(c,I))},routerReplace(h,w,M,D,I,V){const c=A(h,w,M,D);if(!c)return;const L=r[r.length-1];if(!L){c.back=V===ge?_e:V,r.push(c),W(c,I);return}c.back=V===ge?L.back:V,r[r.length-1]=c,W(c,I),k(L)},routerPop(h,w){if(r.length<=1)return!1;const M=z(h);if(M<0||M>=r.length)return!1;const D=w===ge?r[r.length-1].back:w,I=r.splice(M+1);W(r[r.length-1],D);for(const V of I)k(V);return I.length>0},routerHide(h){F(h)},routerRestore(h){const w=r[r.length-1];w&&O(w,h)},reset(){var h;t.settle();for(const w of[n,...r,...o])(h=w==null?void 0:w.node)==null||h.el.remove();n=null,r=[],o=[],i.clear()}}},us=250,fs="cubic-bezier(0.2, 0.8, 0.2, 1)",ds=6,ps=e=>{const{root:t}=e,n=t.ownerDocument,r=n.defaultView??window,o=new Map,i=new Map,s=new Map,l=[],d=(c,L)=>`${c}:${L}`,u=c=>c.type==="layer",E=c=>{var T;const L=e.value(c.node,"overlayColor");if(L==null){(T=c.scrim)==null||T.remove(),c.scrim=null,c.frame.classList.remove("lc-scrimmed");return}c.scrim||(c.scrim=n.createElement("div"),c.scrim.className="lc-scrim",c.scrim.addEventListener("click",()=>{(c.node.flags&Br)!==0&&e.emit(c.node.id,_r)}),c.frame.insertBefore(c.scrim,c.frame.firstChild),c.frame.classList.add("lc-scrimmed")),c.scrim.style.backgroundColor=Ce(L)},_=c=>{const L=e.value(c,"sheetDetents");if(L==null||L==="")return null;const T=String(L).split(",").map(Number).filter(b=>Number.isFinite(b)&&b>0).sort((b,m)=>b-m);return T.length>0?T:null},A=(c,L)=>{const T=c.sheet,b=c.node.el.offsetHeight;if(L<0)return b;const m=T.detents[T.detents.length-1],C=T.detents[Math.max(0,Math.min(L,T.detents.length-1))];return b*(1-C/m)},g=(c,L,T)=>{const b=c.sheet.holder;b.style.transition=T?`transform ${us}ms ${fs}`:"none",b.style.transform=`translateY(${Math.max(0,L)}px)`},p=(c,L)=>{const T=_(c.node);if(!T||!c.sheet)return;const b=c.sheet;b.detents=T;const m=e.value(c.node,"sheetDismissible");b.dismissible=m==null||Number(m)>.5||m===!0;const C=Number(e.value(c.node,"sheetDetent")??0);if(L){g(c,A(c,-1),!1),b.holder.offsetHeight,b.detent=C,g(c,A(c,C),!0);return}C!==b.detent&&(b.detent=C,g(c,A(c,C),!0))},y=c=>{const L=c.node.el;L.addEventListener("pointerdown",T=>{const b=c.sheet;if(!b||T.pointerType==="mouse"&&T.button!==0)return;for(let B=T.target instanceof Element?T.target:null;B&&B!==L;B=B.parentElement)if(B.scrollTop>0)return;const m=A(c,b.detent);let C=!1,x=m;const U=B=>{if(B.pointerId!==T.pointerId)return;const H=B.clientY-T.clientY;if(!C){if(Math.abs(H)<ds||Math.abs(H)<Math.abs(B.clientX-T.clientX))return;C=!0}x=Math.max(0,m+H),g(c,x,!1)},N=B=>{if(B.pointerId!==T.pointerId||(n.removeEventListener("pointermove",U),n.removeEventListener("pointerup",N),n.removeEventListener("pointercancel",N),!C||!c.sheet))return;let H=0,X=1/0;for(let ae=0;ae<b.detents.length;ae++){const Z=Math.abs(A(c,ae)-x);Z<X&&(X=Z,H=ae)}const Y=A(c,0),ie=L.offsetHeight;if(b.dismissible&&x>Y+(ie-Y)/2){g(c,ie,!0),(c.node.flags&Nt)!==0&&e.emit(c.node.id,At,-1);return}b.detent=H,g(c,A(c,H),!0),(c.node.flags&Nt)!==0&&e.emit(c.node.id,At,H)};n.addEventListener("pointermove",U),n.addEventListener("pointerup",N),n.addEventListener("pointercancel",N)})},v=c=>{let L=!0,T=0,b=c.parent;for(;b;){let m=b;for(;m.parent;)m=m.parent;const C=e.ownerOf(m);if(C){e.pageShown(m)||(L=!1),T++,b=C;continue}const x=o.get(m);if(x){x.mountedIn||(L=!1),T++,b=x.parent;continue}const U=u(m)?l.includes(m):e.screenShown(m);return{outer:m,visible:L&&U,depth:T}}return{outer:null,visible:!1,depth:T}},k=c=>{const L=c.node.el;if(!L.isConnected)return e.value(c.node,"display")!=="none";const T=L.classList.contains("lc-leaving");T&&L.classList.remove("lc-leaving");const b=r.getComputedStyle(L).display!=="none";return T&&L.classList.add("lc-leaving"),b},$=c=>{const L=["lc-widget-frame",c.scrim?"lc-scrimmed":""].filter(Boolean),T=Array.from(c.parent.el.classList).filter(m=>!m.startsWith("lc"));c.frame.className=[...L,...T].join(" ");const b=c.parent.el.style;for(let m=0;m<b.length;m++){const C=b[m];C.startsWith("--")&&c.frame.style.setProperty(C,b.getPropertyValue(C))}for(const m of["data-theme-text","data-theme-font"])c.parent.el.hasAttribute(m)?c.frame.setAttribute(m,""):c.frame.removeAttribute(m)},P=c=>c.stage??(c.stage=e.stage()),O=c=>{c.leaving&&(c.leaving=!1,c.node.el.classList.remove("lc-leaving"))},F=c=>{c.pose&&P(c).run(c.node,null,c.pose,()=>{})},W=c=>{if(!c.pose){h(c,!1);return}c.leaving=!0,c.node.el.classList.add("lc-leaving"),P(c).run(null,c.node,c.pose,()=>{O(c),h(c,!1),M()})},z=c=>{c.mountedIn&&(h(c,!1),Et(c.node.el),c.frame.remove(),c.mountedIn=null)},h=(c,L)=>{c.onShow!==L&&(c.onShow=L,e.rootActive(c.node,L))};let w=!1;const M=()=>{if(w)return;w=!0,e.flush();const c=new Map;for(const T of o.values())c.set(T,v(T));const L=new Map;for(const[T,b]of c){if(!b.visible||!b.outer){T.leaving&&(P(T).settle(),O(T)),h(T,!1),z(T);continue}const m=L.get(b.outer)??[];m.push(T),L.set(b.outer,m)}for(const[T,b]of L){b.sort((C,x)=>c.get(C).depth-c.get(x).depth);let m=null;for(const C of b)$(C),C.mountedIn!==T?(C.mountedIn&&z(C),T.el.appendChild(C.frame),C.mountedIn=T,e.rootOwned(C.node,!0),On(C.node.el),C.sheet&&p(C,!0)):m&&C.frame.previousElementSibling!==m&&T.el.appendChild(C.frame),m=C.frame}for(const[T,b]of c){if(!T.mountedIn){T.intent===-1&&(T.intent=e.value(T.node,"display")!=="none"?1:0);continue}const m=k(T),C=T.intent!==-1&&(m?1:0)!==T.intent;if(T.intent===-1?(T.intent=m?1:0,m!==(e.value(T.node,"display")!=="none")&&e.emitLater(T.node.id,Mt,m?1:0)):(m?1:0)!==T.intent&&(T.intent=m?1:0,e.emitLater(T.node.id,Mt,m?1:0)),m)if(T.leaving)P(T).settle(),O(T),h(T,!0),C&&F(T);else{const x=T.onShow;h(T,!0),C&&!x&&F(T)}else T.leaving||(C&&T.onShow?W(T):h(T,!1))}w=!1};return{attach(c,L,T){if(L.type!=="screen"&&!u(L))return console.error(`[web-lite] a widget can only be a child of a screen or a layer (it belongs to the window, not to a box: a floating element of a ${L.type} is an absolute child, not a widget)`),!1;if(o.has(c))return!1;const b=n.createElement("div");b.className="lc-widget-frame";const m={node:c,parent:L,frame:b,scrim:null,sheet:null,mountedIn:null,intent:-1,pose:ot.get(c)??0,stage:null,leaving:!1,onShow:!1};if(_(c)){const x=n.createElement("div");x.className="lc-sheet",x.appendChild(c.el),b.appendChild(x),m.sheet={holder:x,detents:[1],detent:-1,dismissible:!0},y(m)}else b.appendChild(c.el);o.set(c,m);const C=i.get(L)??[];return C.splice(Math.max(0,Math.min(T,C.length)),0,c),i.set(L,C),c.parent=L,E(m),M(),!0},detach(c){const L=o.get(c);if(!L)return!1;P(L).settle(),O(L),z(L),o.delete(c);const T=i.get(L.parent);if(T){const b=T.indexOf(c);b>=0&&T.splice(b,1),T.length===0&&i.delete(L.parent)}return c.parent=null,c.el.remove(),L.frame.remove(),e.rootOwned(c,!1),!0},childrenOf:c=>i.get(c)??[],isWidget:c=>o.has(c),setPose(c,L){const T=o.get(c);T?T.pose=L:ot.set(c,L)},setLayer(c,L,T){const b=d(c,L),m=s.get(b)??null;m!==T&&(m&&D(m),T?(s.set(b,T),T.el.classList.add("lc-layer")):s.delete(b),V())},refresh(){V(),M()},scrim:c=>{var L;return((L=o.get(c))==null?void 0:L.scrim)??null},restyle(c){const L=o.get(c);L&&(E(L),$(L),L.sheet&&p(L,!1),M(),queueMicrotask(M))},forget(c){const L=o.get(c);if(L){P(L).settle(),O(L),z(L),o.delete(c);const b=i.get(L.parent);if(b){const m=b.indexOf(c);m>=0&&b.splice(m,1)}L.frame.remove()}const T=i.get(c);if(T){for(const b of T.slice())this.forget(b);i.delete(c)}for(const[b,m]of s)m===c&&(D(m),s.delete(b));ot.delete(c)},shown:()=>Array.from(o.values()).filter(c=>c.onShow).map(c=>c.node),isShown:c=>{var L;return!!((L=o.get(c))!=null&&L.onShow)},backTargets(){const c=[],L=T=>{if(!T)return;const b=Array.from(T.el.children).filter(m=>m.classList.contains("lc-widget-frame"));for(let m=b.length-1;m>=0;m--){const C=Array.from(o.values()).find(x=>x.frame===b[m]);C&&C.onShow&&!C.leaving&&(C.node.flags&Vr)!==0&&c.push(C.node)}};return L(s.get(d(ve,0))??null),L(e.currentRoot()),c},layers:()=>l.slice(),layerOf:(c,L)=>s.get(d(c,L))??null,isFrame:c=>c.classList.contains("lc-widget-frame"),toast(c,L){(!ne||!ne.isConnected)&&(ne=n.createElement("div"),ne.className="lc-toasts",t.appendChild(ne));const T=n.createElement("div");T.className="lc-toast",T.setAttribute("role","status"),T.textContent=c,ne.appendChild(T),T.offsetHeight,T.classList.add("lc-on"),r.setTimeout(()=>{T.classList.remove("lc-on"),r.setTimeout(()=>T.remove(),200)},Math.max(500,L))},destroy(){for(const c of o.values())c.frame.remove();o.clear(),i.clear();for(const c of l)c.el.remove();l.length=0,s.clear(),ne==null||ne.remove(),ne=null}};function D(c){const L=l.indexOf(c);L<0||(l.splice(L,1),e.rootActive(c,!1),c.el.remove(),e.rootOwned(c,!1))}function I(c){l.includes(c)||(l.push(c),t.appendChild(c.el),e.rootOwned(c,!0),e.rootActive(c,!0))}function V(){const c=e.current();for(const[T,b]of s)T===d(ve,0)||!!c&&T===d(c.kind,c.id)?I(b):D(b);const L=s.get(d(ve,0));L&&L.el.parentElement===t&&t.lastElementChild!==L.el&&t.appendChild(L.el)}};let ne=null;const ot=new WeakMap,Zt={pager:["pagerSetContent","pagerSelect","pagerPush","pagerPop","pagerPopToRoot","pagerReplace"],vlist:["vlistInit","vlistSetKeys","vlistInsertKeys","vlistRemoveKeys","vlistInvalidate","vlistMount","vlistScrollTo","vlistScrollToKey","vlistScrollToEnd"],plugins:["viewCall"],tween:["tweenCreate","tweenControl","tweenSeek","tweenSetRate","tweenGetTime","tweenGetElapsed","registerTweenEvent","defineTransition"]},hs=e=>{const t=e.root,n=t.ownerDocument,r=(a,f,S)=>{for(const R of Object.keys(f)){const G=f[R],j=G==null?null:typeof G=="number"?se(G):Ae(G);for(const fe of S?[`--${R}`,`--lc-app-${R}`]:[`--${R}`])j===null?a.style.removeProperty(fe):a.style.setProperty(fe,j)}},o=n.defaultView??window,i=new Set,s=a=>console.warn(`[web-lite] ${a}`),l=[],d=a=>{var f;for(const S of l){const R=(f=S.ownerOf)==null?void 0:f.call(S,a);if(R)return R}return null},u=a=>{var f;for(const S of l){const R=(f=S.roots)==null?void 0:f.call(S,a);if(R)return R}return null},E=(a,f)=>{var S;for(const R of l)(S=R.rootActive)==null||S.call(R,a,f)},_=a=>{var f;for(const S of l)(f=S.subtreeMoved)==null||f.call(S,a)},A=()=>{for(const a of l)if(a.stage)return a.stage();return Mn};let g=null;const p=()=>g??(g=e.transitions??A()),y={run:(a,f,S,R)=>p().run(a,f,S,R),settle:()=>p().settle(),enterOnTop:a=>p().enterOnTop(a),holds:a=>p().holds(a)};let v=[],k=!1;const $=a=>{v.push(a),!k&&(k=!0,queueMicrotask(()=>{k=!1;const f=v;v=[];for(const S of f)S()}))};let P=null;const O=(a,f,...S)=>{if(P)try{return P(a,f,...S)}catch(R){o.setTimeout(()=>{throw R},0);return}},F=(a,f,...S)=>$(()=>{O(a,f,...S)});t.classList.add("lc-root");const W=e.sink??Io(n),z=zo(W),h=Ho(W,z,{bufferUrl:e.bufferUrl},s),w=new Map;let M=1;const D=new ResizeObserver(a=>{for(const f of a){const S=f.target,R=w.get(Number(S.getAttribute("data-node")));!R||R.el!==S||!(R.flags&he)||O(R.id,ur,S.offsetLeft,S.offsetTop,S.offsetWidth,S.offsetHeight)}}),I=os({doc:n,bufferUrl:e.bufferUrl,drawable:a=>{var f;for(const S of l){const R=(f=S.drawable)==null?void 0:f.call(S,a);if(R)return R}return null},hasTint:a=>h.names(a,"tintColor"),swapped:(a,f)=>{D.unobserve(f),a.flags&he&&D.observe(a.el)},warn:s});h.onChange=a=>{const f=a;Yr(f,S=>h.value(f,S)),f.type==="image"&&I.restyle(f),f.type==="widget"?N.restyle(f):(f.type==="screen"||f.type==="layer")&&N.refresh()};const V=ns({root:t,emit:O,value:(a,f)=>h.value(a,f),boundary:a=>N.isFrame(a)||l.some(f=>{var S;return((S=f.boundary)==null?void 0:S.call(f,a))===!0}),hit:(a,f,S)=>{var R;for(const G of l){const j=(R=G.hit)==null?void 0:R.call(G,a,f,S);if(j!=null)return j}return null}}),c=as({root:t,emit:O}),L=new ResizeObserver(()=>{O(0,Lr,t.clientWidth,t.clientHeight)});L.observe(t),h.onWrite=(a,f)=>{var S;for(const R of l)(S=R.styled)==null||S.call(R,a,f)};const T=a=>a.parent===null&&!a.rooted,b=(a,f,S=!0)=>{var R;for(const G of l)(R=G.forget)==null||R.call(G,a);for(const G of Te(a))b(G,f,!1);S||f.push(a.id),V.forget(a),c.forget(a),I.forget(a),U.forgetUrl(te,a.id),N.forget(a),h.drop(a),D.unobserve(a.el),C.unregister(a.token),w.delete(a.id),a.parent=null,a.held=!1,S&&a.el.remove()},m=a=>{if(!w.has(a.id)||a.held||!T(a))return;const f=[];b(a,f),f.length>0&&O(0,$t,f)},C=new FinalizationRegistry(a=>{const f=w.get(a);f&&(f.held=!1,T(f)&&$(()=>m(f)))}),x=a=>{a.held||$(()=>m(a))},U=cs({root:t,emit:F,post:$,warn:s,node:a=>w.get(a),rootOwned:(a,f)=>{a.rooted=f,f||x(a)},changed:e.onNavigation,settled:()=>{N.refresh()},active:E,surface:(a,f)=>l.some(S=>{var R;return((R=S.destination)==null?void 0:R.call(S,a,f))===!0}),transitions:y}),N=ps({root:t,emit:O,emitLater:F,node:a=>w.get(a),value:(a,f)=>h.value(a,f),rootOwned:(a,f)=>{a.rooted=f,f||x(a)},rootActive:E,flush:()=>h.flush(),ownerOf:d,pageShown:a=>{var f;for(const S of l){const R=(f=S.pageShown)==null?void 0:f.call(S,a);if(R!=null)return R}return!1},screenShown:a=>{var f;return((f=U.current())==null?void 0:f.node)===a||y.holds(a)},currentRoot:()=>{const a=U.current();return a?a.kind===te?a.node??null:N.layerOf(a.kind,a.id):null},current:()=>{const a=U.current();return a?{kind:a.kind,id:a.id}:null},stage:A}),B=e.onNavigation;e.onNavigation=()=>{N.refresh(),B==null||B()};const H=()=>{var f;for(const S of N.backTargets())if(O(S.id,Ue,ve,0)===!0)return"widget";const a=U.current();if(a){const S=a.kind===te||a.kind===We?a.id:0;if(O(S,Ue,a.kind,a.id)===!0)return"destination"}for(const S of l)if(((f=S.back)==null?void 0:f.call(S))===!0)return"feature";return U.routerPop(-1,ge)?"router":O(0,Ue,ve,0)===!0?"app":"none"},X=a=>{if(!(a.key!=="Escape"||a.defaultPrevented)){for(const f of N.backTargets())if(O(f.id,Ue,ve,0)===!0){a.preventDefault();return}}};n.addEventListener("keydown",X);const Y=es({root:t,roots:()=>{const a=U.current();return[...a!=null&&a.node&&a.kind===te?[{kind:"screen",node:a.node}]:[],...N.layers().map(S=>({kind:"layer",node:S})),...N.shown().map(S=>({kind:"widget",node:S}))]},held:a=>u(a),extend:(a,f,S)=>{var R;for(const G of l)(R=G.dump)==null||R.call(G,a,f,S)},value:(a,f)=>h.value(a,f),owns:(a,f)=>h.owns(a,f),flush:()=>h.flush()}),ie=a=>{if(!a.isConnected)return null;h.flush();const f=gn(t)||1,S=t.getBoundingClientRect(),R=a.getBoundingClientRect();return R.width===0&&R.height===0&&a.offsetParent===null?null:[(R.left-S.left)/f,(R.top-S.top)/f,R.width/f,R.height/f]},Oe=()=>{const a={};for(const f of Object.keys(Zt))for(const S of Zt[f])a[S]=()=>(i.has(S)||(i.add(S),s(`${S}: this tree was made without the "${f}" feature`)),S==="tweenCreate"?null:0);return a},ae={create(a){const f=qo(n,M++,a);$n(f),w.set(f.id,f);const S={id:f.id};return C.register(S,f.id,f.token),S},destroy(a){const f=w.get(a);if(!f)return;if(!T(f)){console.error(`[web-lite] destroy: node ${a} is attached — remove / hide / close it first`);return}f.held=!1;const S=[];b(f,S),S.length>0&&O(0,$t,S)},insert(a,f,S){var _t;const R=w.get(a),G=w.get(f);if(!R||!G||G===R)return;if(u(R)){s(`insert() on a ${R.type} — what it holds goes through its own calls`);return}if(!T(G)){s(`insert: node ${f} is not a root — remove it from where it is first`);return}if(G.type==="widget"){const kt=Te(R).length;N.attach(G,R,S<kt?0:S-kt);return}const j=Te(R),fe=Math.max(0,Math.min(S,j.length));G.parent=R,Un(R.el,G.el,((_t=j[fe])==null?void 0:_t.el)??null),_(G)},remove(a,f){const S=w.get(a),R=w.get(f);if(!(!S||!R||R.parent!==S)){if(N.isWidget(R)){N.detach(R);return}R.parent=null,ht(R.el),_(R),x(R)}},parent(a){var S,R;const f=w.get(a);return f?((S=f.parent)==null?void 0:S.id)??((R=d(f))==null?void 0:R.id)??0:0},children(a){const f=w.get(a);return f?[...u(f)??Te(f),...N.childrenOf(f)].map(S=>S.id):[]},setString(a,f,S){var G;const R=w.get(a);if(R){S===null?R.strings.delete(f):R.strings.set(f,S);for(const j of l)(G=j.content)==null||G.call(j,R,f,S);switch(f){case"text":R.type==="text"&&(R.el.textContent=S??"");return;case"name":S===null?R.el.removeAttribute("data-name"):R.el.setAttribute("data-name",S);return;case"src":R.type==="image"&&I.setSrc(R,S);return;case"srcTintColor":R.type==="image"&&I.setSrcTint(R,S);return;case"sourceRect":R.type==="image"&&I.setSourceRect(R,S);return;case"value":if(R.type==="input"||R.type==="textarea"){const j=R.el;j.value!==(S??"")&&(j.value=S??"")}return;case"focus":S==="1"?R.el.focus({preventScroll:!0}):R.el.blur();return}}},setInt(a,f,S){var G;const R=w.get(a);if(R){R.strings.set(f,String(S));for(const j of l)(G=j.content)==null||G.call(j,R,f,S)}},setFlags(a,f){const S=w.get(a);if(!S)return;const R=S.flags;S.flags=f,S.el.classList.toggle(pt,(f&Ie)!==0),f&he&&!(R&he)?D.observe(S.el):!(f&he)&&R&he&&D.unobserve(S.el)},getTextValue(a){const f=w.get(a);return f&&(f.type==="input"||f.type==="textarea")?f.el.value:""},setStyle(a,f,S){const R=w.get(a);R&&h.set(R,f,S)},mergeStyle(a,f){const S=w.get(a);S&&h.merge(S,f)},setClass(a,f,S){const R=w.get(a);R&&(h.setClass(R,f,S),N.refresh())},setTheme(a){r(t,a,!0)},setNodeTheme(a,f){const S=w.get(a);S&&(r(S.el,f,!1),"text"in f&&S.el.toggleAttribute("data-theme-text",f.text!=null),"fontFamily"in f&&S.el.toggleAttribute("data-theme-font",f.fontFamily!=null),N.refresh())},open:U.open,close:U.close,routerOpen:(a,f,S,R)=>U.routerOpen(a,f,S,R),routerPush:U.routerPush,routerReplace:U.routerReplace,routerPop:(a,f)=>{U.routerPop(a,f)},routerHide:U.routerHide,routerRestore:U.routerRestore,setDestUrl:U.setUrl,isViewSupported:()=>!1,viewVersion:()=>0,setLayer(a,f,S){const R=S?w.get(S)??null:null;if(S&&(!R||R.type!=="layer")){s("setLayer: not a layer node");return}N.setLayer(a,f,R)},setWidgetPose(a,f){const S=w.get(a);S&&N.setPose(S,f>0?f:0)},registerFont(a,f,S,R,G,j){try{const fe=new o.FontFace(a,`url("${f}")`,{weight:String(S),style:R===2?"italic":"normal"});n.fonts.add(fe),fe.load().then(()=>G(),()=>j())}catch{j()}},fontFormat:"woff2",toast:(a,f)=>N.toast(a,f),isButtonPressed(a){const f=w.get(a);return!!f&&V.isPressed(f)},isHovered(a){const f=w.get(a);return!!f&&V.isHovered(f)},getBoundingClientRect(a){const f=w.get(a);return f?ie(f.el):null},getDisplaySize:()=>[t.clientWidth,t.clientHeight],debugDump:()=>Y.dump(),debugPaint:a=>Y.paint(w.get(a)),setEmitter(a){P=a}},Z={...Oe(),...ae};for(const a of["open","close","routerOpen","routerPush","routerReplace","routerPop","routerHide","routerRestore"]){const f=Z[a];Z[a]=(...S)=>{const R=f(...S);return $(()=>N.refresh()),R}}const J={root:t,emit:O,emitLater:F,post:$,warn:s,node:a=>w.get(a),rootOwned:(a,f)=>{a.rooted=f,f||x(a)},flush:()=>h.flush(),value:(a,f)=>h.value(a,f),setStyle:(a,f,S)=>h.set(a,f,S),setString:(a,f,S)=>Z.setString(a,f,S),style:{bufferUrl:e.bufferUrl},shown:a=>{var f;return((f=U.current())==null?void 0:f.node)===a||N.isShown(a)||N.layers().includes(a)},scrim:a=>N.scrim(a),stage:A,sourceChanged:a=>I.sourceChanged(a),plugins:e.plugins??null,rootsChanged:()=>$(()=>N.refresh()),rootHolds:a=>y.holds(a)},pe={};for(const a of e.features??[]){const f=a.install(J);l.push(f),Object.assign(Z,f.bridge),Object.assign(pe,f.globals)}return{bridge:Z,globals:pe,presentation:U,back:H,setSafeArea(a,f=[]){for(const S of["top","right","bottom","left"])t.style.setProperty(`--safe-${S}`,`${a[S]}px`),f.includes(S)?t.style.setProperty(`--safe-${S}-bar`,`${a[S]}px`):t.style.removeProperty(`--safe-${S}-bar`)},flush:()=>h.flush(),stats:()=>Object.assign({nodes:w.size,classes:z.count(),tweens:0},...l.map(a=>{var f;return((f=a.stats)==null?void 0:f.call(a))??{}})),destroy(){var a;P=null,U.reset();for(const f of l)(a=f.destroy)==null||a.call(f);N.destroy(),n.removeEventListener("keydown",X),V.destroy(),c.destroy(),L.disconnect(),D.disconnect();for(const f of w.values())C.unregister(f.token),f.el.remove();w.clear(),e.sink||W.destroy(),t.classList.remove("lc-root");for(const f of Array.from(t.style))f.startsWith("--")&&t.style.removeProperty(f)}}},Nn=()=>({setMatrix(){},setVisible(){},setCameraMatrix(){},setProjection(){},clearProjection(){},setBackground(){},createExternalTexture:()=>null,onFrame:()=>()=>{},readPixels:(e,t)=>t(null,0,0),viewport:()=>({width:0,height:0,rotation:0})}),ms=e=>{var r,o;const t=((o=(r=e.screen)==null?void 0:r.orientation)==null?void 0:o.angle)??e.orientation??0;return(Math.round(t/90)%4+4)%4*90},gs=(e,t)=>({width:(e==null?void 0:e.clientWidth)??0,height:(e==null?void 0:e.clientHeight)??0,rotation:ms(t)}),K=[null],wt=new TextDecoder("utf-8"),Ui=async(e,t,n,r)=>{var g;let o;if(t.body)if(typeof t.body=="object"&&Array.isArray(t.body._entries)){const p=new FormData;for(let[y,v,k]of t.body._entries)typeof v=="object"?p.append(y,new Blob([ue(v._id)]),k):p.append(y,v);o=p}else typeof t.body=="string"?o=t.body:r(new Error("Invalid body"));const i=await fetch(e,{method:t.method,body:o,headers:t.headers,mode:"cors",credentials:"omit"}),s=typeof t.onProgress=="function"?t.onProgress:null;if(!s){const p=await i.arrayBuffer();K.push(p),n(K.length-1,i.status);return}const l=(g=i.body)==null?void 0:g.getReader();if(!l){const p=await i.arrayBuffer();K.push(p),n(K.length-1,i.status);return}const d=Number(i.headers.get("content-length"))||void 0;let u=0;const E=[];for(;;){const{done:p,value:y}=await l.read();if(p)break;y&&(E.push(y),u+=y.length,s({loaded:u,total:d}))}const _=new Uint8Array(u);let A=0;for(const p of E)_.set(p,A),A+=p.length;K.push(_.buffer),n(K.length-1,i.status)},bs=e=>JSON.parse(wt.decode(ue(e))),Pn=e=>wt.decode(ue(e)),ys=e=>new Uint8Array(ue(e)).slice(),vs=(e,t,n)=>wt.decode(ue(e).slice(t,n)),Fn=e=>{const t=new Blob([K[e]]);return URL.createObjectURL(t)},In=e=>new Blob([K[e]]),ue=e=>K[e],en=e=>{K[e]=null},He=e=>(K.push(e),K.length-1),St=new Map,Mi=(e,t)=>{St.set(e,t);const n=Ke.get(e);n!==void 0&&(K[n]=t)},Ni=e=>St.has(e),Ke=new Map,Pi=e=>{for(const[t,n]of Ke)if(n===e)return t},Es=e=>{const t=Ke.get(e);if(t!==void 0)return t;const n=St.get(e);if(!n)return-1;K.push(n);const r=K.length-1;return Ke.set(e,r),r},ws=(e=Nn())=>{const t=new Map,n=new Map,r=new Set,o=new Set;let i=!1;const s=()=>{let l="pending";const d=[],u=_=>{l==="taken"?_():l==="pending"&&d.push(_)};return{host:{registerView(_,A,g=1){u(()=>t.set(_,{factory:A,version:g}))},registerService(_,A,g=1){u(()=>n.set(_,{factory:A,version:g}))},putBuffer:He,getBuffer:ue,get gl(){return u(()=>{i=!0}),e}},take(){l="taken";for(const _ of d.splice(0))_()},leave(){l="left",d.length=0}}};return{views:t,services:n,drives3d:()=>i,has:l=>r.has(l),async register(l,d){if(!(r.has(l)||o.has(l))){o.add(l);try{for(const u of d){const E=s();let _;try{_=await u(E.host)}catch(A){E.leave(),console.warn(`[web-lite] the "${l}" plugin did not register: ${A instanceof Error?A.message:A}`);continue}if(_===!1){E.leave();continue}E.take(),r.add(l);return}}finally{o.delete(l)}}}}},tn={pager:["pagerSetContent"],vlist:["vlistInit"],tween:["tweenCreate","defineTransition"],canvas:["_creatorCanvas."],video:["createVideo"],plugins:["viewCall","isViewSupported","_creatorService."]},Ss={pager:()=>ce(()=>import("./assets/pager-BZAO9gMC.js"),[],import.meta.url).then(e=>e.pager),vlist:()=>ce(()=>import("./assets/vlist-Ap-F4H5J.js"),[],import.meta.url).then(e=>e.vlist),tween:()=>ce(()=>import("./assets/tween-DbrQTld4.js"),[],import.meta.url).then(e=>e.tween),canvas:()=>ce(()=>import("./assets/canvas-wFjS40IX.js"),[],import.meta.url).then(e=>e.canvas),video:()=>ce(()=>import("./assets/video-bzR_t2i6.js"),[],import.meta.url).then(e=>e.video),plugins:()=>ce(()=>import("./assets/plugins-B7TuO_p4.js"),[],import.meta.url).then(e=>e.plugins)},Dn=Object.keys(tn).map(e=>({name:e,uses:tn[e],load:Ss[e]})),_s=e=>Dn.filter(t=>t.uses.some(n=>e.includes(n))).map(t=>t.name),ks=async e=>{const t=_s(e);return(await Promise.all(Dn.filter(r=>t.includes(r.name)).map(r=>r.load().catch(o=>(console.warn(`[web-lite] the "${r.name}" feature did not load: ${o instanceof Error?o.message:o}`),null))))).filter(r=>r!==null)},Ts=e=>{let t=null,n=null;const r=(d,u)=>{t==null||t(d,u)},o=()=>r(document.hidden?"pause":"resume"),i=()=>r("online"),s=()=>r("offline");return document.addEventListener("visibilitychange",o),window.addEventListener("online",i),window.addEventListener("offline",s),{bridge:{run(d,u,E,_){let A;try{A=Pn(d)}catch{u("run: no such buffer");return}e.rerun(A,_,u)},restart(d){e.rerun(void 0,d)},quit(){},launchUrl:()=>e.launchUrl(),registerEvent(d){t=d},setFreedEmitter(d){n=d},ownedStats:()=>e.stats(),state:()=>document.hidden?"background":"active",isOnline:()=>navigator.onLine,openUrl(d){window.open(d,"_blank","noopener")},setOrientation(d){var _,A,g,p;const u=d==="landscape"||d==="portrait"?d:"auto";if(e.onOrientation){e.onOrientation(u);return}const E=typeof screen<"u"?screen.orientation:void 0;if(E)try{u==="auto"?(_=E.unlock)==null||_.call(E):(p=(g=(A=E.lock)==null?void 0:A.call(E,u))==null?void 0:g.catch)==null||p.call(g,()=>{})}catch{}}},emit:r,freed:(d,u)=>{n==null||n(d,u)},dispose(){t=null,n=null,document.removeEventListener("visibilitychange",o),window.removeEventListener("online",i),window.removeEventListener("offline",s)}}},Ls=(e,t,n,r)=>{try{const o=document.createElement("input");o.type="file",o.multiple=n,r&&(o.accept=r),o.onchange=async()=>{const{files:i}=o;if(n){const s=[];if(!i)return e([]);for(let l of i)s.push([He(await l.arrayBuffer()),l.name,l.size]);e(s)}else{if(!i||i.length===0)return e(null);e([[He(await i[0].arrayBuffer()),i[0].name,i[0].size]])}},window.addEventListener("focus",()=>{setTimeout(()=>{(!o.files||o.files.length===0)&&e(n?[]:null)},300)},{once:!0}),o.click()}catch(o){t(o)}},Bn=e=>e==="camera"?"camera":e==="microphone"||e==="speech"?"microphone":e==="location"?"geolocation":null,Vn=(e,t,n)=>{const r=Bn(e);if(!r){n(`${e}: not a permission this host asks for`);return}const o=navigator.permissions;if(!(o!=null&&o.query)){t("prompt");return}o.query({name:r}).then(i=>t(i.state),()=>t("prompt"))},xs=(e,t,n)=>{if(!Bn(e)){n(`${e}: not a permission this host asks for`);return}const r=()=>Vn(e,t,n);if(e==="location"){if(!navigator.geolocation){t("denied");return}navigator.geolocation.getCurrentPosition(()=>t("granted"),i=>i.code===i.PERMISSION_DENIED?t("denied"):r(),{timeout:15e3,maximumAge:1/0});return}const o=navigator.mediaDevices;if(!(o!=null&&o.getUserMedia)){t("denied");return}o.getUserMedia(e==="camera"?{video:!0}:{audio:!0}).then(i=>{for(const s of i.getTracks())s.stop();t("granted")},i=>{const s=i instanceof Error?i.name:"";s==="NotAllowedError"||s==="SecurityError"?t("denied"):r()})},Rs=e=>({get platform(){return"web"},get language(){return e()},get pixelRatio(){return window.devicePixelRatio||1},vibrate(){var t;try{(t=navigator.vibrate)==null||t.call(navigator,30)}catch{}},clipboardWrite(t){var n;(n=navigator.clipboard)==null||n.writeText(t).catch(()=>{})},clipboardRead(t,n){const r=navigator.clipboard;if(!(r!=null&&r.readText)){n("Clipboard is not available");return}r.readText().then(t,o=>n(o instanceof Error?o.message:"Clipboard read failed"))},share(t,n){var l;const r=In(t),o=new File([r],"image.png",{type:"image/png"});if((l=navigator.canShare)!=null&&l.call(navigator,{files:[o]})){navigator.share({files:[o],text:n}).catch(()=>{});return}const i=URL.createObjectURL(r),s=document.createElement("a");s.href=i,s.download=o.name,document.body.appendChild(s),s.click(),s.remove(),URL.revokeObjectURL(i)},openFilePicker:(t,n,r,o)=>Ls(t,n,r,o??void 0),queryPermission:Vn,requestPermission:xs}),As=e=>{const t=e==null?void 0:e._h;return typeof e=="object"&&e!==null&&typeof(t==null?void 0:t.id)=="number"?t.id:null},Cs=e=>{if(e==null)return;if(typeof e=="string")return e;const t=e._entries;if(!Array.isArray(t))throw new Error("fetch: the body is a string or a FormData");const n=new FormData;for(const[r,o,i]of t){const s=As(o);s!==null?n.append(r,In(s),i):n.append(r,String(o))}return n},$s=()=>{const e=new Set,t=new FinalizationRegistry(i=>{e.delete(i)&&en(i)}),n=i=>{const s={id:i};return e.add(i),t.register(s,i),s};let r=!1;return{bridge:{fetch(i,s,l,d,u){const E=typeof(s==null?void 0:s.onProgress)=="function"?s.onProgress:u;if(i.startsWith("id:")){const _=Number(i.slice(3));l({id:_},ue(_)?200:404);return}(async()=>{var _;try{const A=await fetch(i,{method:s==null?void 0:s.method,headers:s==null?void 0:s.headers,body:Cs(s==null?void 0:s.body),mode:"cors",credentials:"omit"}),g=E?(_=A.body)==null?void 0:_.getReader():void 0;let p;if(!g)p=await A.arrayBuffer();else{const y=Number(A.headers.get("content-length"))||void 0,v=[];let k=0;for(;;){const{done:O,value:F}=await g.read();if(O)break;F&&(v.push(F),k+=F.length,r||E({loaded:k,total:y}))}const $=new Uint8Array(k);let P=0;for(const O of v)$.set(O,P),P+=O.length;p=$.buffer}if(r)return;l(n(He(p)),A.status)}catch(A){r||d(A instanceof Error?A:String(A))}})()},local:i=>Es(i),toJson:i=>bs(i),slice:(i,s,l)=>vs(i,s,l),toText:i=>Pn(i),toBytes:i=>ys(i)},live:()=>e.size,dispose(){r=!0;for(const i of e)en(i);e.clear()}}},nn=["MouseLeft","MouseMiddle","MouseRight","MouseBack","MouseForward"],st=["GamepadSouth","GamepadEast","GamepadWest","GamepadNorth","GamepadL1","GamepadR1","GamepadL2","GamepadR2","GamepadSelect","GamepadStart","GamepadL3","GamepadR3","GamepadUp","GamepadDown","GamepadLeft","GamepadRight"],Fe=4,it=16,rn=16,Os=.5,Us=e=>{const t=new Set;let n=null;const r=(x,U,N=-1,B=0)=>{n==null||n(x,U,N,B)},o=x=>{if(!x.code)return;const U=t.has(x.code);t.add(x.code),r(0,x.code,-1,U||x.repeat?1:0)},i=x=>{x.code&&t.delete(x.code)&&r(1,x.code)},s=()=>{for(const x of[...t])x.startsWith("Gamepad")||(t.delete(x),r(1,x))},{root:l}=e;let d=0,u=0,E=0,_=0,A=0,g=0,p=0,y=0,v=0,k=0;const $=x=>{var B;if(x.pointerType&&x.pointerType!=="mouse")return;const U=l.getBoundingClientRect(),N=((B=e.scale)==null?void 0:B.call(e))||1;d=(x.clientX-U.left)/N,u=(x.clientY-U.top)/N,E+=(x.movementX||0)/N,_+=(x.movementY||0)/N},P=x=>{const U=nn[x.button];U&&(t.add(U),r(0,U))},O=x=>{const U=nn[x.button];U&&t.delete(U)&&r(1,U)},F=x=>{const U=x.deltaMode===0?.01:1;A+=x.deltaX*U,g+=x.deltaY*U},W=x=>{document.pointerLockElement===l&&x.preventDefault()},z=[],h=[],w=[],M=()=>{var U,N;const x=typeof navigator<"u"&&navigator.getGamepads?Array.from(navigator.getGamepads()):[];for(let B=0;B<Fe;B++){const H=x[B]??null,X=!!H&&H.connected;if(X!==!!z[B]){if(z[B]=X,!X){for(const J of st)t.delete(J+"@"+B)&&(r(1,J,B),D(J));w[B]=[],h[B]=[0,0,0,0,0,0]}r(X?2:3,"",B)}if(!H||!X)continue;const Y=H.axes,ie=H.buttons,Oe=((U=ie[6])==null?void 0:U.value)??0,ae=((N=ie[7])==null?void 0:N.value)??0;h[B]=[Y[0]??0,Y[1]??0,Y[2]??0,Y[3]??0,Oe,ae];const Z=w[B]??(w[B]=[]);for(let J=0;J<st.length;J++){const pe=ie[J],a=!!pe&&(pe.pressed||pe.value>Os);if(a===!!Z[J])continue;Z[J]=a;const f=st[J];a?t.add(f+"@"+B):t.delete(f+"@"+B),D(f),r(a?0:1,f,B)}}},D=x=>{let U=!1;for(let N=0;N<Fe&&!U;N++)t.has(x+"@"+N)&&(U=!0);U?t.add(x):t.delete(x)};let I=0;const V=()=>{p=E,y=_,v=A,k=g,E=_=A=g=0,M(),I=requestAnimationFrame(V)},c=e.windows.filter((x,U,N)=>x&&N.indexOf(x)===U);for(const x of c)e.keyboard!==!1&&(x.addEventListener("keydown",o),x.addEventListener("keyup",i)),x.addEventListener("blur",s);return l.addEventListener("pointermove",$,!0),l.addEventListener("mousedown",P,!0),window.addEventListener("mouseup",O,!0),l.addEventListener("wheel",F,{passive:!0,capture:!0}),l.addEventListener("contextmenu",W,!0),typeof requestAnimationFrame=="function"&&(I=requestAnimationFrame(V)),{inputKey:(x,U)=>U>=0&&x.startsWith("Gamepad")?t.has(x+"@"+U):t.has(x),inputRead:x=>{var U;switch(x){case 0:return d;case 1:return u;case 2:return p;case 3:return y;case 4:return v;case 5:return k;case 6:return document.pointerLockElement===l?1:0;case 7:{let N=0;for(let B=0;B<Fe;B++)z[B]&&N++;return N}}if(x>=it){const N=Math.floor((x-it)/rn),B=(x-it)%rn;return N>=Fe||!z[N]?0:B===0?1:((U=h[N])==null?void 0:U[B-1])??0}return 0},inputSetPointerLock:x=>{if(!x)return document.pointerLockElement===l&&document.exitPointerLock(),!0;if(document.pointerLockElement===l)return!0;if(typeof l.requestPointerLock!="function")return!1;try{const U=l.requestPointerLock({unadjustedMovement:!0});return U&&typeof U.catch=="function"&&U.catch(()=>{try{l.requestPointerLock()}catch{}}),!0}catch{return!1}},registerInputEvent:x=>{n=x},dispose:()=>{for(const x of c)x.removeEventListener("keydown",o),x.removeEventListener("keyup",i),x.removeEventListener("blur",s);l.removeEventListener("pointermove",$,!0),l.removeEventListener("mousedown",P,!0),window.removeEventListener("mouseup",O,!0),l.removeEventListener("wheel",F,!0),l.removeEventListener("contextmenu",W,!0),I&&cancelAnimationFrame(I),document.pointerLockElement===l&&document.exitPointerLock(),t.clear(),n=null}}},Ms=e=>{const t=e.ownerDocument.defaultView??window,n=Us({windows:[t],root:e}),r=t.visualViewport,o=()=>r?Math.max(0,Math.round(t.innerHeight-r.height-r.offsetTop)):0;let i=null,s=0;const l=()=>{const u=o();u!==s&&(s=u,i==null||i(u,0))};return r==null||r.addEventListener("resize",l),{bridge:{key:n.inputKey,read:n.inputRead,setPointerLock:n.inputSetPointerLock,registerEvent(u){n.registerInputEvent(u)},keyboardHeight:o,registerKeyboardEvent(u){i=u}},dispose(){i=null,r==null||r.removeEventListener("resize",l),n.dispose()}}},q=[null],Re=new Map,Wn=e=>{if(!e.startsWith("id:"))return e;const t=Number(e.slice(3));return ue(t)?Fn(t):null},zn=e=>{const t=Re.get(e);t!==void 0&&(URL.revokeObjectURL(t),Re.delete(e))},we=[!1],Gn=(e,t,n)=>{e.addEventListener("ended",()=>{n(),we[t]&&(e.currentTime=0,e.play())})},Ns=(e,t)=>{const n=Wn(e);if(n===null)return-1;const r=document.createElement("video");document.body.appendChild(r),r.crossOrigin="anonymous",r.style="opacity: 0; position: absolute; top: 0; left: 0; width: 1px; height: 1px",r.src=n,r.playsInline=!0,r.controls=!1;const o=q.length;return n!==e&&Re.set(o,n),q.push(r),we.push(!1),Gn(r,o,t),o},Ps=(e,t)=>{const n=Wn(e);if(n===null)return-1;const r=document.createElement("audio");document.body.appendChild(r),r.style="opacity: 0; position: absolute; top: 0; left: 0; width: 1px; height: 1px",r.src=n;const o=q.length;return n!==e&&Re.set(o,n),q.push(r),we.push(!1),Gn(r,o,t),o},Fs=(e,t)=>{const n=q[e];n&&(t===0?n.muted=!0:(n.muted&&(n.muted=!1),n.volume=t))},Is=(e,t)=>{const n=q[e];n&&(t?n.play():n.pause())},Ds=(e,t)=>{we[e]=t},Bs=e=>{var t;return((t=q[e])==null?void 0:t.currentTime)??0},Vs=(e,t)=>{const n=q[e];n&&(n.currentTime=t)},Ws=e=>{var n;const t=((n=q[e])==null?void 0:n.duration)??0;return isNaN(t)?0:t},Fi=e=>q[e],jn=e=>{e.pause(),e.removeAttribute("src"),e.load(),e.remove()},zs=e=>{const t=q[e];t&&(jn(t),zn(e),q[e]=null,we[e]=!1)},Ii=()=>{for(let e of q)e&&jn(e);for(const e of[...Re.keys()])zn(e);q.length=1,we.length=1},Gs=()=>{const e=new Map;let t=null;const n=s=>{e.delete(s)&&zs(s)},r=new FinalizationRegistry(s=>{const l=e.get(s);l&&(l.held=!1,l.playing||n(s))}),o=(s,l)=>{let d=-1;if(d=s(l,()=>{const _=e.get(d);_&&(t==null||t(d),!_.loop&&(_.playing=!1,_.held||n(d)))}),d<0)return null;e.set(d,{held:!0,playing:!1,loop:!1});const E={id:d};return r.register(E,d),E};return{bridge:{createAudio:s=>o(Ps,s),createVideo:s=>o(Ns,s),setVolume:Fs,setLoop(s,l){const d=e.get(s);d&&(d.loop=l),Ds(s,l)},setPlaying(s,l){const d=e.get(s);d&&(d.playing=l,Is(s,l),!l&&!d.held&&n(s))},time:Bs,setTime:Vs,duration:Ws,setEmitter(s){t=s}},live:()=>e.size,dispose(){t=null;for(const s of[...e.keys()])n(s)}}},js=()=>{const e=[];return{bridge:{open(n,r){const o=e.length;let i;try{i=new WebSocket(n)}catch{return e.push(null),queueMicrotask(()=>r("error")),o}return i.addEventListener("open",()=>r("open")),i.addEventListener("message",s=>r("message",s.data)),i.addEventListener("close",s=>{e[o]=null,r("close",s.code)}),i.addEventListener("error",()=>r("error")),e.push(i),o},send(n,r){const o=e[n];o&&o.readyState===WebSocket.OPEN&&o.send(r)},close(n){var r;(r=e[n])==null||r.close()}},dispose(){for(const n of e)n==null||n.close();e.length=0}}},Hs=e=>{let t="default",n=null,r=!1;const o=()=>`lecodes:${e}:${t}`,i=()=>{if(n)return n;n={};try{const u=window.localStorage.getItem(o()),E=u?JSON.parse(u):null;if(E&&typeof E=="object")for(const[_,A]of Object.entries(E))typeof A=="string"&&(n[_]=A)}catch{}return n},s=()=>{if(r=!1,!!n)try{window.localStorage.setItem(o(),JSON.stringify(n))}catch{}},l=()=>{r||(r=!0,queueMicrotask(s))};return{bridge:{get:u=>i()[u]??null,set(u,E){i()[u]=String(E),l()},remove(u){delete i()[u],l()},select(u){r&&s(),t=u,n=null}},dispose(){r&&s()}}},Ks=(e,t={})=>{const n=e.ownerDocument,r=n.defaultView??window;let o=null;const i=new Map,s=new Set;let l=0,d=null,u=null;const E=()=>{if(i.size!==0)for(const[g,p]of[...i])try{p()}catch(y){s.has(g)||(s.add(g),console.error("[web-lite] a plugin's frame body failed:",y))}},_=g=>{g!==d&&(d==null||d.remove(),d=g,o&&(g&&(g.classList.add("lc-background"),g.style.cssText="position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; background: #000",e.insertBefore(g,o.canvas)),o.engine._setTransparent(!!g)))};return{facade:{...Nn(),setMatrix(g,p){o==null||o.engine.setWorldMatrix(g,Float32Array.from(p))},setVisible(g,p){o==null||o.engine.setVisible(g,p)},setCameraMatrix(g,p){o==null||o.engine.setCameraMatrix(g,Float32Array.from(p))},setProjection(g,p,y,v){o==null||o.engine.setCameraProjectionMatrix(g,Float32Array.from(p),y,v)},clearProjection(g){o==null||o.engine.clearCameraProjectionMatrix(g)},setBackground(g,p){_(p)},onFrame(g){const p=l++;return i.set(p,g),()=>{i.delete(p),s.delete(p)}},readPixels(g,p){if(!o||o.opened()!==g){p(null,0,0);return}const y=o.canvas;o.engine._renderNow();const v=n.createElement("canvas");v.width=y.width,v.height=y.height;const k=v.getContext("2d");if(!k||y.width===0||y.height===0){p(null,0,0);return}k.drawImage(y,0,0);const $=k.getImageData(0,0,y.width,y.height);p(new Uint8Array($.data.buffer),y.width,y.height)},viewport:()=>gs(o==null?void 0:o.canvas,r),async presentXR(g,p,y,v){var O;const k=o;if(!k)throw new Error("[web-lite] gl.presentXR: this world has no 3D engine");const $=await k.engine._presentXR(p,y,v,g);if(o!==k)throw $.end(),new Error("[web-lite] gl.presentXR: the world changed while the session was being presented");const P={end(){var W;const F=u===P;F&&(u=null),$.end(),F&&((W=t.onPresent)==null||W.call(t,!1))},captureCamera:$.captureCamera};return u=P,(O=t.onPresent)==null||O.call(t,!0),P}},attach(g){g!==o&&(u==null||u.end(),_(null),i.clear(),s.clear(),o==null||o.engine._beforeFrame(null),o=g,o==null||o.engine._beforeFrame(E))}}},on={scene3d:{uses:["_creator.createScene","_creator.createEntity"],module:"/web-lite/src/engines/scene3d.ts"},scene2d:{uses:["_creator2d.createScene","_creator2d.createEntity"],module:"/web-lite/src/engines/scene2d.ts"},anim:{uses:["_creator.animator","_creator.getGlbClipSet","_creator.loadClips","_creator.createClipFromTracks"],module:"/creator-anim/dist/creatorAnim.js"},physics:{uses:["_creator.physicsBuild","_creator.physicsCreate","_creator.physicsConfigure","_creator.physicsRaycast","_creator.characterCreate","_creator.vehicleCreate","_creator.ragdollCreate"],module:"/creator-physics/dist/creatorPhysics.js"},particles:{uses:["_creator.createParticleSystem","_creator.createNoise"],module:"/creator-particles/dist/creatorParticles.js"}},Ys=e=>{const t=Object.keys(on).filter(n=>on[n].uses.some(r=>e.includes(r)));return new Set(t)},sn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Hn={};for(let e=0;e<sn.length;e++)Hn[sn[e]]=e;const qs=e=>{const t=[];let n=0,r=0;for(const o of e){const i=Hn[o];if(i===void 0)break;const s=i&32;if(r+=(i&31)<<n,s)n+=5;else{const l=r&1;r>>=1,t.push(l?-r:r),r=0,n=0}}return t};class Xs{constructor(t){qe(this,"sources");qe(this,"lines");this.sources=t.sources,this.lines=[];let n=0,r=0,o=0;for(const i of t.mappings.split(";")){const s=[];let l=0;if(i)for(const d of i.split(",")){const u=qs(d);u.length!==0&&(l+=u[0],u.length>=4&&(n+=u[1],r+=u[2],o+=u[3],s.push([l,n,r,o])))}this.lines.push(s)}}originalPositionFor(t,n){const r=this.lines[t-1];if(!r||r.length===0)return null;let o=null;for(const s of r)if(s[0]<=n)o=s;else break;o??(o=r[0]);const i=this.sources[o[1]];return i===void 0?null:{source:i,line:o[2]+1,column:o[3]}}}const Js=e=>{const t=e.match(/\/\/# lecodesMap=data:application\/json;(?:charset=[^;]+;)?base64,([A-Za-z0-9+/=]+)\s*$/);if(!t)return null;try{const n=typeof atob=="function"?atob(t[1]):Buffer.from(t[1],"base64").toString("utf8");return new Xs(JSON.parse(n))}catch{return null}};let me=null;const Qs=()=>{if(me!==null)return me;try{new Function("throw new Error('chisel-calibrate')")()}catch(e){const n=(e.stack??"").match(/<anonymous>:(\d+):\d+/);return me=n?parseInt(n[1],10)-1:2,me}return me=2,me},an=(e,t)=>{const n=(e instanceof Error?e.stack:"")??"",r=Qs(),o=[];for(const i of n.split(`
|
|
285
|
+
`,Io=e=>{const t=e.defaultView??window;try{t.CSS.registerProperty({name:"--lc-dim",syntax:"<number>",inherits:!0,initialValue:"0"})}catch{}for(const d of Po)try{t.CSS.registerProperty({name:d,syntax:"*",inherits:!1})}catch{}const n=e.createElement("style");n.setAttribute("data-lecodes-lite",""),n.textContent=Fo,e.head.appendChild(n);const r=n.sheet,o=(d,u)=>{const E=d.insertRule(u,d.cssRules.length);return d.cssRules[E]},i=(d,u)=>{const E=d.cssRules;for(let _=E.length-1;_>=0;_--)if(E[_]===u){d.deleteRule(_);return}},s=new Map,l=(d,u)=>{const E=u===void 0?d:`${d}.${u}`;let _=s.get(E);return _||(_=u===void 0?o(r,`@layer ${d} {}`):o(l(d),`@layer ${u} {}`),s.set(E,_)),_};for(const d of xn)d!=="lc-base"&&l(d);return{insert(d,u,E){const _=l(d,E),A=o(_,u);return{remove:()=>i(_,A)}},own(d){const u=l("lc-own"),E=o(u,`${d} {}`);return{set:(_,A)=>E.style.setProperty(_,A),unset:_=>{E.style.removeProperty(_)},remove:()=>i(u,E)}},destroy(){n.remove()}}},pt="lc-i";let Do=1;const tt=new Map,An=e=>{let t=tt.get(e);return t||tt.set(e,t=`lc-c${tt.size+1}`),t},Bo=(e,t)=>{const n=`{${t.text}}`,r=o=>`${o} .${e}, .${e}${o}`;switch(t.name){case"pressed":return{layer:"lc-press",text:`${r(`.${pt}:active`)} ${n}`};case"hovered":return{layer:"lc-hover",text:`@media (hover: hover) { ${r(`.${pt}:hover`)} ${n} }`};case"focused":return{layer:"lc-focus",text:`${r(".lc:focus-visible")} ${n}`};case"landscape":case"portrait":return{layer:"lc-orient",text:`@container ${Rn} (orientation: ${t.name}) { .${e} ${n} }`};default:{const o=An(t.name);return{layer:"lc-class",sub:o,text:`${r(`.${o}`)} ${n}`}}}},Vo=e=>e.base+""+e.transition+e.blocks.map(t=>`${t.name}${t.text}`).join(""),Wo=256,zo=e=>{const t=new Map,n=new Set,r=()=>{let o=n.size>>1;for(const i of n){if(o--<=0)break;for(const s of i.rules)s.remove();n.delete(i),t.delete(i.key)}};return{acquire(o){const i=Vo(o);let s=t.get(i);if(s)return s.refs===0&&n.delete(s),s.refs++,s;const l=`lc-s${Do++}`,d=[],u=o.transition?`${o.base?";":""}transition:${o.transition}`:"";d.push(e.insert("lc-bag",`.${l} {${o.base}${u}}`));for(const E of o.blocks){const _=Bo(l,E);d.push(e.insert(_.layer,_.text,_.sub))}return t.set(i,s={name:l,key:i,refs:1,rules:d}),s},release(o){--o.refs>0||(n.add(o),n.size>Wo&&r())},count:()=>({live:t.size-n.size,idle:n.size})}},Go=()=>({base:new Map,own:new Map,blocks:new Map,cls:null,rule:null,applied:new Map,dirty:!1}),Kt=new Set([...Qr,"easing"]),jo=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)&&!("_h"in e),Ho=(e,t,n,r)=>{const o=new Set;let i=!1;const s=new Set,l=v=>{s.has(v)||(s.add(v),r(`style: "${v}" is not a style property — ignored`))};let d=null,u=null;const E=v=>{v.style.dirty=!0,o.add(v),!i&&(i=!0,queueMicrotask(p))},_=v=>{const k=v.style,$=et(k.own,n,l);if(!($.size===0&&!k.rule)){k.rule||(k.rule=e.own(`.lc-n${v.id}`),v.el.classList.add(`lc-n${v.id}`));for(const P of k.applied.keys())$.has(P)||k.rule.unset(P);for(const[P,O]of $)k.applied.get(P)!==O&&k.rule.set(P,O);k.applied=$}},A=(v,k)=>{const $=new Map;for(const[P,O]of v){if(!(O.duration>0))continue;const F=`${O.duration}ms ${No(O.easing)} ${O.delay}ms`;for(const W of k.get(P).keys())W.startsWith("--")||$.set(W,`${W} ${F}`)}return[...$.values()].join(", ")},g=v=>{const k=v.style;k.dirty=!1;const $=Vt(et(k.base,n,l)),P=new Map,O=[];for(const[W,z]of k.blocks){const h=et(z.props,n,l);P.set(W,h),h.size>0&&O.push({name:W,text:Vt(h)})}const F=k.cls;$===""&&O.length===0?k.cls=null:k.cls=t.acquire({base:$,blocks:O,transition:A(k.blocks,P)}),F!==k.cls&&(F&&v.el.classList.remove(F.name),k.cls&&v.el.classList.add(k.cls.name)),F&&t.release(F),d==null||d(v)};function p(){if(i=!1,o.size===0)return;const v=[...o];o.clear();for(const k of v)k.style.dirty&&g(k)}const y=(v,k,$)=>{if($==null){v.blocks.delete(k);return}if(!jo($))return;let P=v.blocks.get(k);P||v.blocks.set(k,P={props:new Map,duration:0,delay:0,easing:void 0});for(const O of Object.keys($)){const F=$[O];if(O==="duration"){P.duration=Number(F)||0;continue}if(O==="delay"){P.delay=Number(F)||0;continue}if(O==="easing"){P.easing=F;continue}if(Kt.has(O)||O[0]==="$")continue;const W=Ze(O);P.props.delete(W),F!=null&&P.props.set(W,F)}};return{flush:p,set onChange(v){d=v},set onWrite(v){u=v},merge(v,k){const $=v.style;let P=!1;for(const O of Object.keys(k)){const F=k[O];if(O[0]==="$"){y($,O.slice(1),F);continue}if(Kt.has(O))continue;const W=Ze(O);$.base.delete(W),F!=null&&$.base.set(W,F),$.own.delete(W)&&(P=!0),u==null||u(v,W)}P&&_(v),E(v)},set(v,k,$){const P=v.style;if(k[0]==="$"){y(P,k.slice(1),$),E(v);return}const O=Ze(k);if(!wo(O)){l(O);return}u==null||u(v,O),$==null?(P.own.delete(O),P.base.delete(O)&&E(v)):P.own.set(O,$),_(v),(_n(O)||O==="tintColor")&&(d==null||d(v))},setClass(v,k,$){v.el.classList.toggle(An(k),$)},value(v,k){const $=v.style;return $.own.has(k)?$.own.get(k):$.base.get(k)},owns(v,k){return v.style.own.has(k)||v.style.base.has(k)},names(v,k){const $=v.style;if($.own.has(k)||$.base.has(k))return!0;for(const P of $.blocks.values())if(P.props.has(k))return!0;return!1},drop(v){const k=v.style;o.delete(v),k.cls&&(t.release(k.cls),k.cls=null),k.rule&&(k.rule.remove(),k.rule=null)}}},Ko={button:"button",input:"input",textarea:"textarea",image:"img"},Yo=(e,t)=>{const n=e.createElement(Ko[t]??"div");if(n.className=`lc lc-${t}`,t==="button"&&(n.type="button"),t==="image"){const r=n;r.alt="",r.decoding="async",r.draggable=!1}return n},qo=(e,t,n)=>({id:t,type:n,el:Yo(e,n),parent:null,flags:0,held:!0,rooted:!1,token:{},style:Go(),strings:new Map}),Cn=Symbol("lecodes.node"),ye=e=>e==null?void 0:e[Cn],$n=e=>{e.el[Cn]=e,e.el.setAttribute("data-node",String(e.id))},Te=e=>{const t=[];for(let n=e.el.firstElementChild;n;n=n.nextElementSibling){const r=ye(n);r&&r.parent===e&&t.push(r)}return t},nt=(e,t=",")=>{const n=[];let r=0,o="";for(const i of e){if(i==="("&&r++,i===")"&&r--,i===t&&r===0){n.push(o.trim()),o="";continue}o+=i}return o.trim()!==""&&n.push(o.trim()),n},Yt={"to top":0,"to right":90,"to bottom":180,"to left":270,"to top right":45,"to right top":45,"to bottom right":135,"to right bottom":135,"to bottom left":225,"to left bottom":225,"to top left":315,"to left top":315},Xo=e=>{if(e in Yt)return Yt[e];const t=/^(-?[\d.]+)(deg|rad|turn|grad)$/.exec(e);if(!t)return null;const n=parseFloat(t[1]);return t[2]==="deg"?n:t[2]==="rad"?n*180/Math.PI:t[2]==="turn"?n*360:n*.9},Jo=(e,t)=>{const n=[];for(const r of nt(e.trim())){const o=/^(?:repeating-)?(linear|radial)-gradient\((.*)\)$/s.exec(r);if(!o)return null;const i=o[1],s=nt(o[2]);let l=i==="linear"?180:0;if(s.length>0){const u=s[0],E=i==="linear"?Xo(u):null;E!==null?(l=E,s.shift()):i==="radial"&&/\b(circle|ellipse|at|closest|farthest)\b/.test(u)&&s.shift()}const d=[];for(const u of s){const E=nt(u," "),_=E[E.length-1],A=E.length>1&&/^-?[\d.]+%$/.test(_),g=A?E.slice(0,-1).join(" "):u;d.push({color:t(g)??"#00000000",position:A?parseFloat(_)/100:null})}if(d.length===0)return null;d[0].position===null&&(d[0].position=0),d[d.length-1].position===null&&(d[d.length-1].position=1);for(let u=1;u<d.length-1;u++){if(d[u].position!==null)continue;let E=u;for(;d[E].position===null;)E++;const _=d[u-1].position,A=d[E].position;for(let g=u;g<E;g++)d[g].position=_+(A-_)*(g-u+1)/(E-u+1);u=E}n.push({type:i,angle:l,stops:d.map(u=>({color:u.color,position:u.position}))})}return n.length>0?n:null},Qo=Object.keys(ze).filter(e=>ze[e]!=="layout"),le=e=>Math.max(0,Math.min(255,Math.round(e))).toString(16).padStart(2,"0"),qt=e=>{const t=/^rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)(?:\s*[,/]\s*([\d.]+%?))?\s*\)$/.exec(e.trim());if(t){const r=t[4]===void 0?1:t[4].endsWith("%")?parseFloat(t[4])/100:parseFloat(t[4]);return`#${le(+t[1])}${le(+t[2])}${le(+t[3])}${le(r*255)}`}const n=/^color\(srgb\s+([\d.]+)\s+([\d.]+)\s+([\d.]+)(?:\s*\/\s*([\d.]+))?\)$/.exec(e.trim());return n?`#${le(+n[1]*255)}${le(+n[2]*255)}${le(+n[3]*255)}${le((n[4]===void 0?1:+n[4])*255)}`:null},Zo=e=>{if(e==="none")return[1,0,0,0,1,0,0,0,1];const t=/^matrix\(([^)]+)\)$/.exec(e);if(!t)return null;const[n,r,o,i,s,l]=t[1].split(",").map(d=>parseFloat(d));return[n,r,0,o,i,0,s,l,1]},Xt={pointerEvents:{auto:"all"},overflow:{auto:"scroll"},display:{"-webkit-box":"flex",block:"flex"},showScrollbar:{none:"0",thin:"1",auto:"1"},overscrollMode:{auto:"default",contain:"absorb"},textAlign:{"-webkit-auto":"start"}},es=e=>{const t=e.root.ownerDocument,n=t.defaultView??window;let r=null;const o=u=>{r||(r=t.createElement("span"),r.style.cssText="position:absolute;visibility:hidden;pointer-events:none"),r.isConnected||e.root.appendChild(r),r.style.color="",r.style.color=u;const E=r.style.color===""?null:qt(n.getComputedStyle(r).color);return r.remove(),E},i=(u,E,_,A)=>{var y,v;if(_n(E)){const k=e.value(u,E);return k==null?null:_==="num"?Number(k===!0?1:k===!1?0:k):String(k)}const g=_o(E);if(g===null)return null;const p=A.getPropertyValue(g).trim();if(p===""&&!u.el.isConnected)return s(u,E,_);if(p==="")return null;switch(_){case"color":return g.startsWith("--")?o(p):qt(p);case"len":{const k=parseFloat(p);return Number.isFinite(k)?k:E==="lineHeight"?parseFloat(A.fontSize)*1.2:null}case"num":{if(E==="lineClamp")return p==="none"?0:parseFloat(p)||0;const k=parseFloat(((y=Xt[E])==null?void 0:y[p])??p);return Number.isFinite(k)?k:null}case"enum":return((v=Xt[E])==null?void 0:v[p])??p;default:return E==="backgroundGradient"?p==="none"?null:Jo(p,o):E==="transform"?Zo(p):E==="transformOrigin"?null:E==="fontFamily"?p.split(",")[0].trim().replace(/^["']|["']$/g,""):E==="backgroundImage"&&p==="none"?"":p}},s=(u,E,_)=>{const A=e.value(u,E)??Jr[E];if(A==null)return null;if(E==="transform")return A==="identity"||A==="none"?[1,0,0,0,1,0,0,0,1]:null;if(_==="color")return typeof A=="number"?`#${(A>>>0).toString(16).padStart(8,"0")}`:o(String(A));if(_==="len"||_==="num"){const g=typeof A=="number"?A:parseFloat(String(A));return Number.isFinite(g)?g:null}return String(A)},l=u=>{const E=n.getComputedStyle(u.el),_=[],A=[],g={};for(const p of Qo){const y=e.owns(u,p);y&&_.push(p);const v=i(u,p,ze[p],E);if(Xr.includes(p)&&!y&&(v===null||v==="none")){g[p]=null;continue}A.push(p),g[p]=v}return{present:A,dirty:[],own:_,...g}},d=u=>{const E=u.el,_={id:u.id,type:u.type},A=u.strings.get("name");A&&(_.name=A);const g=u.strings.get("text");return u.type==="text"&&g&&(_.text=g),(u.type==="input"||u.type==="textarea")&&(_.value=E.value),_.flags=u.flags,_.layout=[E.offsetLeft,E.offsetTop,E.offsetWidth,E.offsetHeight],_.paint=l(u),e.extend(u,_,d),_.children=e.held(u)?[]:Te(u).map(d),_};return{dump(){return e.flush(),JSON.stringify({roots:e.roots().map(u=>({kind:u.kind,node:d(u.node)}))})},paint(u){return u?(e.flush(),JSON.stringify(l(u))):"null"}}},rt=10,ts=500,ns=e=>{const{root:t,emit:n}=e,r=t.ownerDocument,o=r.defaultView??window,i=b=>{const m=t.getBoundingClientRect(),C=gn(t)||1;return[(b.clientX-m.left)/C,(b.clientY-m.top)/C]},s=(b,m)=>{for(let C=b instanceof Element?b:null;C&&C!==t;C=C.parentElement){if(e.boundary(C))return null;const x=ye(C);if(x&&(x.flags&m)!==0)return x}return null},l=new Map;let d=!1,u=null;const E=(b,m)=>{const C=typeof m=="number"?m:0;(C&Pt)!==0&&(b.tracked=!0,b.wantsMove=(C&Ft)!==0,b.claim=C&zr)},_=b=>{o.clearTimeout(b.timer),l.delete(b.pointerId)},A=b=>{if(b.pointerType==="mouse"&&b.button!==0)return;const m=s(b.target,Ie),[C,x]=i(b);u=[C,x],d=!1;const U={pointerId:b.pointerId,node:m,startX:C,startY:x,lastX:C,lastY:x,moved:!1,tracked:!1,wantsMove:!1,claim:0,handled:!1,timer:0};if(l.set(b.pointerId,U),!m){const N=b.target instanceof Element?e.hit(b.target,C,x):null;N!==null&&E(U,n(0,Rr,b.pointerId,C,x,N));return}E(U,n(m.id,fr,b.pointerId,C,x)),(m.flags&Ur)!==0&&(U.timer=o.setTimeout(()=>{if(l.get(U.pointerId)!==U||U.moved)return;const N=n(m.id,pr,U.pointerId,U.startX,U.startY),B=typeof N=="number"?N:0;(B&Gr)!==0&&(U.handled=!0),E(U,B)},ts))},g=b=>{const m=l.get(b.pointerId);if(m){const[C,x]=i(b);!m.moved&&Math.hypot(C-m.startX,x-m.startY)>rt&&(m.moved=!0,o.clearTimeout(m.timer));const U=C-m.lastX,N=x-m.lastY;m.lastX=C,m.lastY=x,m.tracked&&m.wantsMove&&n(0,hr,b.pointerId,C,x,U,N)}b.pointerType==="mouse"&&z(b)},p=b=>{const m=l.get(b.pointerId);if(!m)return;const[C,x]=i(b);m.tracked&&n(0,mr,b.pointerId,C,x,C-m.lastX,x-m.lastY),(m.moved||m.handled)&&(d=!0),_(m)},y=b=>{const m=l.get(b.pointerId);m&&(m.tracked&&n(0,xt,b.pointerId),d=!0,_(m))},v=b=>{if(b.cancelable){for(const m of l.values())if(m.tracked&&m.claim!==0){b.preventDefault();return}}},k=b=>{if(d){d=!1;return}const m=s(b.target,Ie);if(!m&&b.target instanceof Element){const[U,N]=i(b);if(u&&Math.hypot(U-u[0],N-u[1])>rt)return;const B=e.hit(b.target,U,N);B!==null&&n(0,Ar,b.pointerId??0,U,N,B);return}if(!m||(m.flags&Or)===0)return;let C,x;if(b.detail===0&&b.clientX===0&&b.clientY===0){const U=m.el.getBoundingClientRect();[C,x]=i({clientX:U.left+U.width/2,clientY:U.top+U.height/2})}else if([C,x]=i(b),u&&Math.hypot(C-u[0],x-u[1])>rt)return;n(m.id,dr,b.pointerId??0,C,x)};let $=null,P=!1,O=!1,F=[0,0];const W=(b,m)=>{$&&P&&(b===Ut?n(0,b):n(0,b,m[0],m[1],m[0]-F[0],m[1]-F[1])),$=null,P=!1,O=!1};function z(b){const m=i(b),C=t.contains(b.target)?s(b.target,Ie):null;if(C!==$){if(W(Ot,m),F=m,$=C,C&&(C.flags&Wr)!==0){const x=n(C.id,Cr,m[0],m[1]),U=typeof x=="number"?x:0;P=(U&Pt)!==0,O=(U&Ft)!==0}return}$&&P&&O&&n(0,$r,m[0],m[1],m[0]-F[0],m[1]-F[1]),F=m}const h=b=>{b.pointerType==="mouse"&&W(Ot,i(b))},w=b=>{const m=ye(b instanceof Element?b:null);return m&&(m.type==="input"||m.type==="textarea")?m:null},M=b=>{const m=w(b.target);m&&(m.flags&Pr)!==0&&n(m.id,vr,m.el.value)},D=b=>{const m=w(b.target);m&&(m.flags&Fr)!==0&&n(m.id,Er)},I=b=>{const m=w(b.target);m&&(m.flags&Ir)!==0&&n(m.id,wr)},V=b=>{if(b.key!=="Enter"||b.isComposing)return;const m=w(b.target);if(!m||m.type!=="input")return;b.preventDefault();const C=m.el;(m.flags&Dr)!==0&&n(m.id,Sr,C.value),e.value(m,"enterKey")!=="next"&&r.activeElement===C&&C.blur()},c=b=>{const m=o.getComputedStyle(b);return m.overflowX!=="hidden"&&m.overflowY==="hidden"},L=b=>{const m=ye(b.target instanceof Element?b.target:null);!m||(m.flags&Mr)===0||n(m.id,gr,c(m.el)?m.el.scrollLeft:m.el.scrollTop)},T=b=>{const m=ye(b.target instanceof Element?b.target:null);m&&(m.flags&Nr)!==0&&n(m.id,br)};return t.addEventListener("pointerdown",A),t.addEventListener("click",k),t.addEventListener("pointerleave",h),t.addEventListener("touchmove",v,{passive:!1}),t.addEventListener("input",M),t.addEventListener("focusin",D),t.addEventListener("focusout",I),t.addEventListener("keydown",V),t.addEventListener("scroll",L,!0),t.addEventListener("scrollend",T,!0),r.addEventListener("pointermove",g),r.addEventListener("pointerup",p),r.addEventListener("pointercancel",y),{isPressed(b){for(const m of l.values())if(m.node===b)return!0;return!1},isHovered:b=>$===b,forget(b){for(const m of[...l.values()])m.node===b&&(m.tracked&&n(0,xt,m.pointerId),_(m));$===b&&W(Ut,[0,0])},destroy(){for(const b of l.values())o.clearTimeout(b.timer);l.clear(),t.removeEventListener("pointerdown",A),t.removeEventListener("click",k),t.removeEventListener("pointerleave",h),t.removeEventListener("touchmove",v),t.removeEventListener("input",M),t.removeEventListener("focusin",D),t.removeEventListener("focusout",I),t.removeEventListener("keydown",V),t.removeEventListener("scroll",L,!0),t.removeEventListener("scrollend",T,!0),r.removeEventListener("pointermove",g),r.removeEventListener("pointerup",p),r.removeEventListener("pointercancel",y)}}},rs=e=>`url("${e.replace(/["\\\n]/g,t=>"\\"+t)}")`,os=e=>{const t=g=>g.image??(g.image={src:"",srcTint:null,rect:null,form:"img",probe:0}),n=g=>g.src.startsWith("svg:")?g.src.slice(4):null,r=new Map,o=(g,p)=>{const y=r.get(p);y!=null&&y.delete(g)&&y.size===0&&r.delete(p)},i=g=>{const p=g.src,y=n(g);return y!==null?bn(y):p.startsWith("id:")?e.bufferUrl(Number(p.slice(3))):p.startsWith("canvas:")||p.startsWith("scene2d:")?"":p},s=(g,p)=>p.src.startsWith("canvas:")?"canvas":p.rect?"crop":n(p)!==null&&(p.srcTint!==null||e.hasTint(g))?"mask":"img",l=(g,p)=>{const y=g.el;if(y.tagName.toLowerCase()===p)return;const v=e.doc.createElement(p);if(v.className=y.className,p==="img"){const $=v;$.alt="",$.decoding="async",$.draggable=!1}const k=y.getAttribute("data-name");k!==null&&v.setAttribute("data-name",k),g.el=v,$n(g),y.replaceWith(v),e.swapped(g,y)},d=g=>{for(const p of["--lc-src","--lc-src-tint","--lc-iw","--lc-ih","--lc-ir","--lc-crop-size","--lc-crop-pos"])g.style.removeProperty(p)},u=(g,p,y)=>{const[v,k,$,P]=p,[O,F]=y;g.style.setProperty("--lc-crop-size",`${O/$*100}% ${F/P*100}%`),g.style.setProperty("--lc-crop-pos",`${O===$?0:v/(O-$)*100}% ${F===P?0:k/(F-P)*100}%`)},E=new WeakMap,_=(g,p)=>{const y=g.el,v=e.drawable(p);if(!v){y.width=0,y.height=0;return}y.width!==v.pixelWidth&&(y.width=v.pixelWidth),y.height!==v.pixelHeight&&(y.height=v.pixelHeight);const k=y.getContext("2d");k&&(k.clearRect(0,0,y.width,y.height),y.width>0&&y.height>0&&k.drawImage(v.image,0,0),y.style.setProperty("--lc-iw",`${v.width}px`),v.height>0&&y.style.setProperty("--lc-ir",`${v.width} / ${v.height}`))},A=g=>{var W;const p=t(g),y=s(g,p);p.form=y,l(g,y==="img"?"img":y==="canvas"?"canvas":"div");const v=g.el;if(v.classList.toggle("lc-image-mask",y==="mask"),v.classList.toggle("lc-image-crop",y==="crop"),v.classList.toggle("lc-image-canvas",y==="canvas"),d(v),y==="canvas"){_(g,p.src);return}const k=i(p);if(y==="img"){const z=v;k===""?z.removeAttribute("src"):z.getAttribute("src")!==k&&(z.src=k);return}if(v.style.setProperty("--lc-src",k===""?"none":rs(k)),y==="mask"){p.srcTint!==null&&v.style.setProperty("--lc-src-tint",Ce(p.srcTint));const z=(W=Zr(n(p)??""))==null?void 0:W.trim().split(/[\s,]+/).map(Number),h=z==null?void 0:z[2],w=z==null?void 0:z[3];h&&w&&(v.style.setProperty("--lc-iw",`${h}px`),v.style.setProperty("--lc-ir",`${h} / ${w}`));return}const $=p.rect;v.style.setProperty("--lc-iw",`${$[2]}px`),v.style.setProperty("--lc-ih",`${$[3]}px`);const P=E.get(g);if(P&&P.url===k){u(v,$,P.size);return}if(k==="")return;const O=++p.probe,F=new Image;F.addEventListener("load",()=>{if(p.probe!==O||!p.rect)return;const z=[F.naturalWidth,F.naturalHeight];E.set(g,{url:k,size:z}),u(g.el,p.rect,z)},{once:!0}),F.src=k};return{setSrc(g,p){const y=t(g);if(y.src.startsWith("canvas:")&&o(g,y.src),y.src=p??"",y.srcTint=null,y.src.startsWith("canvas:")){let v=r.get(y.src);v||r.set(y.src,v=new Set),v.add(g)}A(g)},setSrcTint(g,p){t(g).srcTint=p,A(g)},setSourceRect(g,p){const y=t(g),v=p==null?void 0:p.trim().split(/\s+/).map(Number),k=v&&v.length===4&&v.every(O=>Number.isFinite(O))&&v[2]>0&&v[3]>0?v:null,$=!!y.rect&&!!k&&y.form==="crop"&&y.rect[2]===k[2]&&y.rect[3]===k[3];y.rect=k;const P=E.get(g);if($&&P){u(g.el,k,P.size);return}A(g)},sourceChanged(g){var p;for(const y of r.get(g)??[])((p=y.image)==null?void 0:p.form)==="canvas"&&_(y,g)},forget(g){var p;(p=g.image)!=null&&p.src.startsWith("canvas:")&&o(g,g.image.src)},restyle(g){const p=g.image;p&&s(g,p)!==p.form&&A(g)}}},ss=.5,is=64,Jt=48,as=e=>{const{root:t,emit:n}=e,r=t.ownerDocument,o=r.defaultView??window,i=new Map;let s=null;const l=p=>{let y=i.get(p);if(!y||!y.isConnected){y=r.createElement("div"),y.className="lc-refresh",y.style.setProperty("--lc-refresh-color",o.getComputedStyle(p.el).getPropertyValue("--lc-refresh").trim()||"#8e8e93");const v=p.el.parentElement;v&&(v.appendChild(y),y.style.top=`${p.el.offsetTop-36}px`,y.style.left=`${p.el.offsetLeft+p.el.offsetWidth/2}px`),i.set(p,y)}return y},d=(p,y,v)=>{const k=l(p);k.classList.toggle("lc-settling",v),k.style.translate=`0 ${y}px`,k.style.transform=`rotate(${y*3}deg)`,k.style.opacity=String(Math.min(1,y/Jt))},u=p=>{const y=i.get(p);y&&(y.classList.remove("lc-spinning"),d(p,0,!0),o.setTimeout(()=>{i.get(p)===y&&(y.remove(),i.delete(p))},220))},E=p=>{for(let y=p instanceof Element?p:null;y&&y!==t;y=y.parentElement){const v=ye(y);if(v&&(v.flags&(Qe|Je))!==0)return v}return null},_=p=>{if(s||p.touches.length!==1)return;const y=E(p.target);if(!y)return;const v=p.changedTouches[0];s={node:y,touch:v.identifier,startY:v.clientY,pulling:!1,distance:0}},A=p=>{if(!s)return;const y=[...p.changedTouches].find(k=>k.identifier===s.touch);if(!y)return;const v=y.clientY-s.startY;if(!s.pulling){if(s.node.el.scrollTop>0||v<=0){(v<0||s.node.el.scrollTop>0)&&(s.startY=y.clientY);return}s.pulling=!0}p.cancelable&&p.preventDefault(),s.distance=Math.max(0,v*ss),(s.node.flags&Je)!==0&&n(s.node.id,Rt,s.distance),(s.node.flags&Qe)!==0&&d(s.node,s.distance,!1)},g=p=>{if(!s||![...p.changedTouches].some(P=>P.identifier===s.touch))return;const{node:y,pulling:v,distance:k}=s;if(s=null,!v||((y.flags&Je)!==0&&n(y.id,Rt,0),(y.flags&Qe)===0))return;if(k<is||p.type==="touchcancel"){u(y);return}d(y,Jt,!0),l(y).classList.add("lc-spinning");const $=n(y.id,yr);Promise.resolve($).then(()=>u(y),()=>u(y))};return t.addEventListener("touchstart",_,{passive:!0}),t.addEventListener("touchmove",A,{passive:!1}),t.addEventListener("touchend",g),t.addEventListener("touchcancel",g),{forget(p){var y;(s==null?void 0:s.node)===p&&(s=null),(y=i.get(p))==null||y.remove(),i.delete(p)},destroy(){t.removeEventListener("touchstart",_),t.removeEventListener("touchmove",A),t.removeEventListener("touchend",g),t.removeEventListener("touchcancel",g);for(const p of i.values())p.remove();i.clear(),s=null}}},Qt=".lc-scrollable, .lc-vlist, .lc-pager-track, textarea.lc, input.lc",je=new WeakMap,Et=e=>{if(!e.isConnected)return;const t=[],n=r=>{(r.scrollLeft!==0||r.scrollTop!==0)&&t.push({el:r,left:r.scrollLeft,top:r.scrollTop})};e.matches(Qt)&&n(e);for(const r of e.querySelectorAll(Qt))n(r);t.length>0?je.set(e,t):je.delete(e)},On=e=>{const t=je.get(e);if(t){je.delete(e);for(const{el:n,left:r,top:o}of t)!n.isConnected||!e.contains(n)||(n.scrollLeft=r,n.scrollTop=o)}},ht=e=>{Et(e),e.remove()},Un=(e,t,n=null)=>{t.parentElement===e&&(n===null||t.nextElementSibling===n)||(t.isConnected&&Et(t),e.insertBefore(t,n),On(t))},_e=0,ge=-1,Mn={run:(e,t,n,r)=>r(),settle:()=>{},enterOnTop:()=>!0,holds:()=>!1},ls={[jr]:"a 3D scene",[Hr]:"a 2D scene",[Kr]:"a native view",[We]:"a video"},cs=e=>{const t=e.transitions??Mn;let n=null,r=[],o=[];const i=new Map,s=(h,w)=>`${h}:${w}`,l=new Set,d=h=>r.includes(h),u=h=>r.some(w=>w.node===h),E=h=>h&&h.kind===te?h.node:null,_=(h,w)=>{e.emit(h.kind===te||h.kind===We?h.id:0,w,h.kind,h.id)},A=(h,w,M,D)=>{let I=null;return(h===te||h===We)&&(I=e.node(w)??null,!I||h===te&&I.type!=="screen")?(e.warn(`navigation: ${w} is not a live ${h===te?"screen":"video"} node`),null):{kind:h,id:w,node:I,viewName:M,paramsJson:D||"{}",back:_e,retired:!1}},g=(h,w)=>{var D;const M=E(h);if(!M){if((D=e.surface)!=null&&D.call(e,h,!0)){h.node&&e.rootOwned(h.node,!0);return}l.has(h.kind)||(l.add(h.kind),e.warn(`${ls[h.kind]??"this destination"} as a destination is not built yet (docs/plans/web-lite-plan.md) — nothing is shown for it`));return}e.rootOwned(M,!0),M.el.classList.remove("lc-covered"),M.el.classList.toggle("lc-above",w),Un(e.root,M.el)},p=h=>{var M;const w=E(h);!w&&h!==n&&((M=e.surface)==null||M.call(e,h,!1)),!(!w||h===n)&&(n&&n.node===w||(w.el.classList.remove("lc-above"),u(w)?w.el.classList.add("lc-covered"):ht(w.el)))},y=h=>{const w=E(h);!w&&h.node&&!(n&&n.node===h.node)&&!u(h.node)&&(e.rootOwned(h.node,!1),h.node.parent===null&&e.emit(h.node.id,Ct)),w&&(n&&n.node===w||u(w)||(w.el.classList.remove("lc-above"),ht(w.el),e.rootOwned(w,!1),e.emit(w.id,Ct)))},v=()=>{const h=o;o=[];for(const w of h)w.node&&t.holds(w.node)?o.push(w):y(w)},k=h=>{!h||h.retired||(h.retired=!0,o.push(h),e.post(v))},$=(h,w,M)=>{const D=M===ge?_e:M,I=E(h),V=E(w);I&&V&&V.el.classList.toggle("lc-above",!I.el.classList.contains("lc-above")),t.run(I,V,D,()=>{var c;I==null||I.el.classList.remove("lc-above"),V==null||V.el.classList.remove("lc-above"),w&&p(w),o.length>0&&e.post(v),(c=e.settled)==null||c.call(e)})},P=h=>{var w;h.kind===te&&h.node&&((w=e.active)==null||w.call(e,h.node,!1)),_(h,Tr)},O=(h,w)=>{var I,V;const M=n;if(!h||M===h)return;t.settle(),M&&P(M),n=h;const D=!!E(h)&&!!E(M);g(h,!!E(h)&&(!D||t.enterOnTop(w))),_(h,kr),h.kind===te&&h.node&&((I=e.active)==null||I.call(e,h.node,!0)),M&&!d(M)&&k(M),$(h,M,w),(V=e.changed)==null||V.call(e)},F=h=>{var M;t.settle();const w=n;w&&(P(w),n=null,d(w)||k(w),$(null,w,h),(M=e.changed)==null||M.call(e))},W=(h,w)=>{O(h,w),e.emit(0,xr,h.kind,h.id)},z=h=>{const w=r.length;return h===-1?w-2:h<-1?Math.max(w-1+h,0):h===0?0:Math.min(h,w-1)};return{current:()=>n,stack:()=>r,setUrl(h,w,M){var I;M===null||M===""?i.delete(s(h,w)):i.set(s(h,w),M.startsWith("/")?M:`/${M}`),(n&&n.kind===h&&n.id===w||r.some(V=>V.kind===h&&V.id===w))&&((I=e.changed)==null||I.call(e))},address(){if(n){const w=i.get(s(n.kind,n.id));if(w!==void 0)return w}const h=n?r.lastIndexOf(n):r.length-1;for(let w=h<0?r.length-1:h;w>=0;w--){const M=i.get(s(r[w].kind,r[w].id));if(M!==void 0)return M}return null},forgetUrl(h,w){i.delete(s(h,w))},open(h,w,M,D,I){O(A(h,w,M,D),I)},close(h,w,M){!n||n.kind!==h||n.id!==w||F(M)},routerOpen(h,w,M,D){const I=A(h,w,M,D);if(!I)return;const V=r;r=[I];for(const c of V)c!==n&&k(c);O(I,_e)},routerPush(h,w,M,D,I,V){const c=A(h,w,M,D);c&&(c.back=V===ge?_e:V,r.push(c),W(c,I))},routerReplace(h,w,M,D,I,V){const c=A(h,w,M,D);if(!c)return;const L=r[r.length-1];if(!L){c.back=V===ge?_e:V,r.push(c),W(c,I);return}c.back=V===ge?L.back:V,r[r.length-1]=c,W(c,I),k(L)},routerPop(h,w){if(r.length<=1)return!1;const M=z(h);if(M<0||M>=r.length)return!1;const D=w===ge?r[r.length-1].back:w,I=r.splice(M+1);W(r[r.length-1],D);for(const V of I)k(V);return I.length>0},routerHide(h){F(h)},routerRestore(h){const w=r[r.length-1];w&&O(w,h)},reset(){var h;t.settle();for(const w of[n,...r,...o])(h=w==null?void 0:w.node)==null||h.el.remove();n=null,r=[],o=[],i.clear()}}},us=250,fs="cubic-bezier(0.2, 0.8, 0.2, 1)",ds=6,ps=e=>{const{root:t}=e,n=t.ownerDocument,r=n.defaultView??window,o=new Map,i=new Map,s=new Map,l=[],d=(c,L)=>`${c}:${L}`,u=c=>c.type==="layer",E=c=>{var T;const L=e.value(c.node,"overlayColor");if(L==null){(T=c.scrim)==null||T.remove(),c.scrim=null,c.frame.classList.remove("lc-scrimmed");return}c.scrim||(c.scrim=n.createElement("div"),c.scrim.className="lc-scrim",c.scrim.addEventListener("click",()=>{(c.node.flags&Br)!==0&&e.emit(c.node.id,_r)}),c.frame.insertBefore(c.scrim,c.frame.firstChild),c.frame.classList.add("lc-scrimmed")),c.scrim.style.backgroundColor=Ce(L)},_=c=>{const L=e.value(c,"sheetDetents");if(L==null||L==="")return null;const T=String(L).split(",").map(Number).filter(b=>Number.isFinite(b)&&b>0).sort((b,m)=>b-m);return T.length>0?T:null},A=(c,L)=>{const T=c.sheet,b=c.node.el.offsetHeight;if(L<0)return b;const m=T.detents[T.detents.length-1],C=T.detents[Math.max(0,Math.min(L,T.detents.length-1))];return b*(1-C/m)},g=(c,L,T)=>{const b=c.sheet.holder;b.style.transition=T?`transform ${us}ms ${fs}`:"none",b.style.transform=`translateY(${Math.max(0,L)}px)`},p=(c,L)=>{const T=_(c.node);if(!T||!c.sheet)return;const b=c.sheet;b.detents=T;const m=e.value(c.node,"sheetDismissible");b.dismissible=m==null||Number(m)>.5||m===!0;const C=Number(e.value(c.node,"sheetDetent")??0);if(L){g(c,A(c,-1),!1),b.holder.offsetHeight,b.detent=C,g(c,A(c,C),!0);return}C!==b.detent&&(b.detent=C,g(c,A(c,C),!0))},y=c=>{const L=c.node.el;L.addEventListener("pointerdown",T=>{const b=c.sheet;if(!b||T.pointerType==="mouse"&&T.button!==0)return;for(let B=T.target instanceof Element?T.target:null;B&&B!==L;B=B.parentElement)if(B.scrollTop>0)return;const m=A(c,b.detent);let C=!1,x=m;const U=B=>{if(B.pointerId!==T.pointerId)return;const H=B.clientY-T.clientY;if(!C){if(Math.abs(H)<ds||Math.abs(H)<Math.abs(B.clientX-T.clientX))return;C=!0}x=Math.max(0,m+H),g(c,x,!1)},N=B=>{if(B.pointerId!==T.pointerId||(n.removeEventListener("pointermove",U),n.removeEventListener("pointerup",N),n.removeEventListener("pointercancel",N),!C||!c.sheet))return;let H=0,X=1/0;for(let ae=0;ae<b.detents.length;ae++){const Z=Math.abs(A(c,ae)-x);Z<X&&(X=Z,H=ae)}const Y=A(c,0),ie=L.offsetHeight;if(b.dismissible&&x>Y+(ie-Y)/2){g(c,ie,!0),b.detent=-1,(c.node.flags&Nt)!==0&&e.emit(c.node.id,At,-1);return}b.detent=H,g(c,A(c,H),!0),(c.node.flags&Nt)!==0&&e.emit(c.node.id,At,H)};n.addEventListener("pointermove",U),n.addEventListener("pointerup",N),n.addEventListener("pointercancel",N)})},v=c=>{let L=!0,T=0,b=c.parent;for(;b;){let m=b;for(;m.parent;)m=m.parent;const C=e.ownerOf(m);if(C){e.pageShown(m)||(L=!1),T++,b=C;continue}const x=o.get(m);if(x){x.mountedIn||(L=!1),T++,b=x.parent;continue}const U=u(m)?l.includes(m):e.screenShown(m);return{outer:m,visible:L&&U,depth:T}}return{outer:null,visible:!1,depth:T}},k=c=>{const L=c.node.el;if(!L.isConnected)return e.value(c.node,"display")!=="none";const T=L.classList.contains("lc-leaving");T&&L.classList.remove("lc-leaving");const b=r.getComputedStyle(L).display!=="none";return T&&L.classList.add("lc-leaving"),b},$=c=>{const L=["lc-widget-frame",c.scrim?"lc-scrimmed":""].filter(Boolean),T=Array.from(c.parent.el.classList).filter(m=>!m.startsWith("lc"));c.frame.className=[...L,...T].join(" ");const b=c.parent.el.style;for(let m=0;m<b.length;m++){const C=b[m];C.startsWith("--")&&c.frame.style.setProperty(C,b.getPropertyValue(C))}for(const m of["data-theme-text","data-theme-font"])c.parent.el.hasAttribute(m)?c.frame.setAttribute(m,""):c.frame.removeAttribute(m)},P=c=>c.stage??(c.stage=e.stage()),O=c=>{c.leaving&&(c.leaving=!1,c.node.el.classList.remove("lc-leaving"))},F=c=>{c.pose&&P(c).run(c.node,null,c.pose,()=>{})},W=c=>{if(!c.pose){h(c,!1);return}c.leaving=!0,c.node.el.classList.add("lc-leaving"),P(c).run(null,c.node,c.pose,()=>{O(c),h(c,!1),M()})},z=c=>{c.mountedIn&&(h(c,!1),Et(c.node.el),c.frame.remove(),c.mountedIn=null)},h=(c,L)=>{c.onShow!==L&&(c.onShow=L,e.rootActive(c.node,L))};let w=!1;const M=()=>{if(w)return;w=!0,e.flush();const c=new Map;for(const T of o.values())c.set(T,v(T));const L=new Map;for(const[T,b]of c){if(!b.visible||!b.outer){T.leaving&&(P(T).settle(),O(T)),h(T,!1),z(T);continue}const m=L.get(b.outer)??[];m.push(T),L.set(b.outer,m)}for(const[T,b]of L){b.sort((C,x)=>c.get(C).depth-c.get(x).depth);let m=null;for(const C of b)$(C),C.mountedIn!==T?(C.mountedIn&&z(C),T.el.appendChild(C.frame),C.mountedIn=T,e.rootOwned(C.node,!0),On(C.node.el),C.sheet&&p(C,!0)):m&&C.frame.previousElementSibling!==m&&T.el.appendChild(C.frame),m=C.frame}for(const[T,b]of c){if(!T.mountedIn){T.intent===-1&&(T.intent=e.value(T.node,"display")!=="none"?1:0);continue}const m=k(T),C=T.intent!==-1&&(m?1:0)!==T.intent;if(T.intent===-1?(T.intent=m?1:0,m!==(e.value(T.node,"display")!=="none")&&e.emitLater(T.node.id,Mt,m?1:0)):(m?1:0)!==T.intent&&(T.intent=m?1:0,e.emitLater(T.node.id,Mt,m?1:0)),m)if(T.leaving)P(T).settle(),O(T),h(T,!0),C&&F(T);else{const x=T.onShow;h(T,!0),C&&!x&&F(T)}else T.leaving||(C&&T.onShow?W(T):h(T,!1))}w=!1};return{attach(c,L,T){if(L.type!=="screen"&&!u(L))return console.error(`[web-lite] a widget can only be a child of a screen or a layer (it belongs to the window, not to a box: a floating element of a ${L.type} is an absolute child, not a widget)`),!1;if(o.has(c))return!1;const b=n.createElement("div");b.className="lc-widget-frame";const m={node:c,parent:L,frame:b,scrim:null,sheet:null,mountedIn:null,intent:-1,pose:ot.get(c)??0,stage:null,leaving:!1,onShow:!1};if(_(c)){const x=n.createElement("div");x.className="lc-sheet",x.appendChild(c.el),b.appendChild(x),m.sheet={holder:x,detents:[1],detent:-1,dismissible:!0},y(m)}else b.appendChild(c.el);o.set(c,m);const C=i.get(L)??[];return C.splice(Math.max(0,Math.min(T,C.length)),0,c),i.set(L,C),c.parent=L,E(m),M(),!0},detach(c){const L=o.get(c);if(!L)return!1;P(L).settle(),O(L),z(L),o.delete(c);const T=i.get(L.parent);if(T){const b=T.indexOf(c);b>=0&&T.splice(b,1),T.length===0&&i.delete(L.parent)}return c.parent=null,c.el.remove(),L.frame.remove(),e.rootOwned(c,!1),!0},childrenOf:c=>i.get(c)??[],isWidget:c=>o.has(c),setPose(c,L){const T=o.get(c);T?T.pose=L:ot.set(c,L)},setLayer(c,L,T){const b=d(c,L),m=s.get(b)??null;m!==T&&(m&&D(m),T?(s.set(b,T),T.el.classList.add("lc-layer")):s.delete(b),V())},refresh(){V(),M()},scrim:c=>{var L;return((L=o.get(c))==null?void 0:L.scrim)??null},restyle(c){const L=o.get(c);L&&(E(L),$(L),L.sheet&&p(L,!1),M(),queueMicrotask(M))},forget(c){const L=o.get(c);if(L){P(L).settle(),O(L),z(L),o.delete(c);const b=i.get(L.parent);if(b){const m=b.indexOf(c);m>=0&&b.splice(m,1)}L.frame.remove()}const T=i.get(c);if(T){for(const b of T.slice())this.forget(b);i.delete(c)}for(const[b,m]of s)m===c&&(D(m),s.delete(b));ot.delete(c)},shown:()=>Array.from(o.values()).filter(c=>c.onShow).map(c=>c.node),isShown:c=>{var L;return!!((L=o.get(c))!=null&&L.onShow)},backTargets(){const c=[],L=T=>{if(!T)return;const b=Array.from(T.el.children).filter(m=>m.classList.contains("lc-widget-frame"));for(let m=b.length-1;m>=0;m--){const C=Array.from(o.values()).find(x=>x.frame===b[m]);C&&C.onShow&&!C.leaving&&(C.node.flags&Vr)!==0&&c.push(C.node)}};return L(s.get(d(ve,0))??null),L(e.currentRoot()),c},layers:()=>l.slice(),layerOf:(c,L)=>s.get(d(c,L))??null,isFrame:c=>c.classList.contains("lc-widget-frame"),toast(c,L){(!ne||!ne.isConnected)&&(ne=n.createElement("div"),ne.className="lc-toasts",t.appendChild(ne));const T=n.createElement("div");T.className="lc-toast",T.setAttribute("role","status"),T.textContent=c,ne.appendChild(T),T.offsetHeight,T.classList.add("lc-on"),r.setTimeout(()=>{T.classList.remove("lc-on"),r.setTimeout(()=>T.remove(),200)},Math.max(500,L))},destroy(){for(const c of o.values())c.frame.remove();o.clear(),i.clear();for(const c of l)c.el.remove();l.length=0,s.clear(),ne==null||ne.remove(),ne=null}};function D(c){const L=l.indexOf(c);L<0||(l.splice(L,1),e.rootActive(c,!1),c.el.remove(),e.rootOwned(c,!1))}function I(c){l.includes(c)||(l.push(c),t.appendChild(c.el),e.rootOwned(c,!0),e.rootActive(c,!0))}function V(){const c=e.current();for(const[T,b]of s)T===d(ve,0)||!!c&&T===d(c.kind,c.id)?I(b):D(b);const L=s.get(d(ve,0));L&&L.el.parentElement===t&&t.lastElementChild!==L.el&&t.appendChild(L.el)}};let ne=null;const ot=new WeakMap,Zt={pager:["pagerSetContent","pagerSelect","pagerPush","pagerPop","pagerPopToRoot","pagerReplace"],vlist:["vlistInit","vlistSetKeys","vlistInsertKeys","vlistRemoveKeys","vlistInvalidate","vlistMount","vlistScrollTo","vlistScrollToKey","vlistScrollToEnd"],plugins:["viewCall"],tween:["tweenCreate","tweenControl","tweenSeek","tweenSetRate","tweenGetTime","tweenGetElapsed","registerTweenEvent","defineTransition"]},hs=e=>{const t=e.root,n=t.ownerDocument,r=(a,f,S)=>{for(const R of Object.keys(f)){const G=f[R],j=G==null?null:typeof G=="number"?se(G):Ae(G);for(const fe of S?[`--${R}`,`--lc-app-${R}`]:[`--${R}`])j===null?a.style.removeProperty(fe):a.style.setProperty(fe,j)}},o=n.defaultView??window,i=new Set,s=a=>console.warn(`[web-lite] ${a}`),l=[],d=a=>{var f;for(const S of l){const R=(f=S.ownerOf)==null?void 0:f.call(S,a);if(R)return R}return null},u=a=>{var f;for(const S of l){const R=(f=S.roots)==null?void 0:f.call(S,a);if(R)return R}return null},E=(a,f)=>{var S;for(const R of l)(S=R.rootActive)==null||S.call(R,a,f)},_=a=>{var f;for(const S of l)(f=S.subtreeMoved)==null||f.call(S,a)},A=()=>{for(const a of l)if(a.stage)return a.stage();return Mn};let g=null;const p=()=>g??(g=e.transitions??A()),y={run:(a,f,S,R)=>p().run(a,f,S,R),settle:()=>p().settle(),enterOnTop:a=>p().enterOnTop(a),holds:a=>p().holds(a)};let v=[],k=!1;const $=a=>{v.push(a),!k&&(k=!0,queueMicrotask(()=>{k=!1;const f=v;v=[];for(const S of f)S()}))};let P=null;const O=(a,f,...S)=>{if(P)try{return P(a,f,...S)}catch(R){o.setTimeout(()=>{throw R},0);return}},F=(a,f,...S)=>$(()=>{O(a,f,...S)});t.classList.add("lc-root");const W=e.sink??Io(n),z=zo(W),h=Ho(W,z,{bufferUrl:e.bufferUrl},s),w=new Map;let M=1;const D=new ResizeObserver(a=>{for(const f of a){const S=f.target,R=w.get(Number(S.getAttribute("data-node")));!R||R.el!==S||!(R.flags&he)||O(R.id,ur,S.offsetLeft,S.offsetTop,S.offsetWidth,S.offsetHeight)}}),I=os({doc:n,bufferUrl:e.bufferUrl,drawable:a=>{var f;for(const S of l){const R=(f=S.drawable)==null?void 0:f.call(S,a);if(R)return R}return null},hasTint:a=>h.names(a,"tintColor"),swapped:(a,f)=>{D.unobserve(f),a.flags&he&&D.observe(a.el)},warn:s});h.onChange=a=>{const f=a;Yr(f,S=>h.value(f,S)),f.type==="image"&&I.restyle(f),f.type==="widget"?N.restyle(f):(f.type==="screen"||f.type==="layer")&&N.refresh()};const V=ns({root:t,emit:O,value:(a,f)=>h.value(a,f),boundary:a=>N.isFrame(a)||l.some(f=>{var S;return((S=f.boundary)==null?void 0:S.call(f,a))===!0}),hit:(a,f,S)=>{var R;for(const G of l){const j=(R=G.hit)==null?void 0:R.call(G,a,f,S);if(j!=null)return j}return null}}),c=as({root:t,emit:O}),L=new ResizeObserver(()=>{O(0,Lr,t.clientWidth,t.clientHeight)});L.observe(t),h.onWrite=(a,f)=>{var S;for(const R of l)(S=R.styled)==null||S.call(R,a,f)};const T=a=>a.parent===null&&!a.rooted,b=(a,f,S=!0)=>{var R;for(const G of l)(R=G.forget)==null||R.call(G,a);for(const G of Te(a))b(G,f,!1);S||f.push(a.id),V.forget(a),c.forget(a),I.forget(a),U.forgetUrl(te,a.id),N.forget(a),h.drop(a),D.unobserve(a.el),C.unregister(a.token),w.delete(a.id),a.parent=null,a.held=!1,S&&a.el.remove()},m=a=>{if(!w.has(a.id)||a.held||!T(a))return;const f=[];b(a,f),f.length>0&&O(0,$t,f)},C=new FinalizationRegistry(a=>{const f=w.get(a);f&&(f.held=!1,T(f)&&$(()=>m(f)))}),x=a=>{a.held||$(()=>m(a))},U=cs({root:t,emit:F,post:$,warn:s,node:a=>w.get(a),rootOwned:(a,f)=>{a.rooted=f,f||x(a)},changed:e.onNavigation,settled:()=>{N.refresh()},active:E,surface:(a,f)=>l.some(S=>{var R;return((R=S.destination)==null?void 0:R.call(S,a,f))===!0}),transitions:y}),N=ps({root:t,emit:O,emitLater:F,node:a=>w.get(a),value:(a,f)=>h.value(a,f),rootOwned:(a,f)=>{a.rooted=f,f||x(a)},rootActive:E,flush:()=>h.flush(),ownerOf:d,pageShown:a=>{var f;for(const S of l){const R=(f=S.pageShown)==null?void 0:f.call(S,a);if(R!=null)return R}return!1},screenShown:a=>{var f;return((f=U.current())==null?void 0:f.node)===a||y.holds(a)},currentRoot:()=>{const a=U.current();return a?a.kind===te?a.node??null:N.layerOf(a.kind,a.id):null},current:()=>{const a=U.current();return a?{kind:a.kind,id:a.id}:null},stage:A}),B=e.onNavigation;e.onNavigation=()=>{N.refresh(),B==null||B()};const H=()=>{var f;for(const S of N.backTargets())if(O(S.id,Ue,ve,0)===!0)return"widget";const a=U.current();if(a){const S=a.kind===te||a.kind===We?a.id:0;if(O(S,Ue,a.kind,a.id)===!0)return"destination"}for(const S of l)if(((f=S.back)==null?void 0:f.call(S))===!0)return"feature";return U.routerPop(-1,ge)?"router":O(0,Ue,ve,0)===!0?"app":"none"},X=a=>{if(!(a.key!=="Escape"||a.defaultPrevented)){for(const f of N.backTargets())if(O(f.id,Ue,ve,0)===!0){a.preventDefault();return}}};n.addEventListener("keydown",X);const Y=es({root:t,roots:()=>{const a=U.current();return[...a!=null&&a.node&&a.kind===te?[{kind:"screen",node:a.node}]:[],...N.layers().map(S=>({kind:"layer",node:S})),...N.shown().map(S=>({kind:"widget",node:S}))]},held:a=>u(a),extend:(a,f,S)=>{var R;for(const G of l)(R=G.dump)==null||R.call(G,a,f,S)},value:(a,f)=>h.value(a,f),owns:(a,f)=>h.owns(a,f),flush:()=>h.flush()}),ie=a=>{if(!a.isConnected)return null;h.flush();const f=gn(t)||1,S=t.getBoundingClientRect(),R=a.getBoundingClientRect();return R.width===0&&R.height===0&&a.offsetParent===null?null:[(R.left-S.left)/f,(R.top-S.top)/f,R.width/f,R.height/f]},Oe=()=>{const a={};for(const f of Object.keys(Zt))for(const S of Zt[f])a[S]=()=>(i.has(S)||(i.add(S),s(`${S}: this tree was made without the "${f}" feature`)),S==="tweenCreate"?null:0);return a},ae={create(a){const f=qo(n,M++,a);$n(f),w.set(f.id,f);const S={id:f.id};return C.register(S,f.id,f.token),S},destroy(a){const f=w.get(a);if(!f)return;if(!T(f)){console.error(`[web-lite] destroy: node ${a} is attached — remove / hide / close it first`);return}f.held=!1;const S=[];b(f,S),S.length>0&&O(0,$t,S)},insert(a,f,S){var _t;const R=w.get(a),G=w.get(f);if(!R||!G||G===R)return;if(u(R)){s(`insert() on a ${R.type} — what it holds goes through its own calls`);return}if(!T(G)){s(`insert: node ${f} is not a root — remove it from where it is first`);return}if(G.type==="widget"){const kt=Te(R).length;N.attach(G,R,S<kt?0:S-kt);return}const j=Te(R),fe=Math.max(0,Math.min(S,j.length));G.parent=R,Un(R.el,G.el,((_t=j[fe])==null?void 0:_t.el)??null),_(G)},remove(a,f){const S=w.get(a),R=w.get(f);if(!(!S||!R||R.parent!==S)){if(N.isWidget(R)){N.detach(R);return}R.parent=null,ht(R.el),_(R),x(R)}},parent(a){var S,R;const f=w.get(a);return f?((S=f.parent)==null?void 0:S.id)??((R=d(f))==null?void 0:R.id)??0:0},children(a){const f=w.get(a);return f?[...u(f)??Te(f),...N.childrenOf(f)].map(S=>S.id):[]},setString(a,f,S){var G;const R=w.get(a);if(R){S===null?R.strings.delete(f):R.strings.set(f,S);for(const j of l)(G=j.content)==null||G.call(j,R,f,S);switch(f){case"text":R.type==="text"&&(R.el.textContent=S??"");return;case"name":S===null?R.el.removeAttribute("data-name"):R.el.setAttribute("data-name",S);return;case"src":R.type==="image"&&I.setSrc(R,S);return;case"srcTintColor":R.type==="image"&&I.setSrcTint(R,S);return;case"sourceRect":R.type==="image"&&I.setSourceRect(R,S);return;case"value":if(R.type==="input"||R.type==="textarea"){const j=R.el;j.value!==(S??"")&&(j.value=S??"")}return;case"focus":S==="1"?R.el.focus({preventScroll:!0}):R.el.blur();return}}},setInt(a,f,S){var G;const R=w.get(a);if(R){R.strings.set(f,String(S));for(const j of l)(G=j.content)==null||G.call(j,R,f,S)}},setFlags(a,f){const S=w.get(a);if(!S)return;const R=S.flags;S.flags=f,S.el.classList.toggle(pt,(f&Ie)!==0),f&he&&!(R&he)?D.observe(S.el):!(f&he)&&R&he&&D.unobserve(S.el)},getTextValue(a){const f=w.get(a);return f&&(f.type==="input"||f.type==="textarea")?f.el.value:""},setStyle(a,f,S){const R=w.get(a);R&&h.set(R,f,S)},mergeStyle(a,f){const S=w.get(a);S&&h.merge(S,f)},setClass(a,f,S){const R=w.get(a);R&&(h.setClass(R,f,S),N.refresh())},setTheme(a){r(t,a,!0)},setNodeTheme(a,f){const S=w.get(a);S&&(r(S.el,f,!1),"text"in f&&S.el.toggleAttribute("data-theme-text",f.text!=null),"fontFamily"in f&&S.el.toggleAttribute("data-theme-font",f.fontFamily!=null),N.refresh())},open:U.open,close:U.close,routerOpen:(a,f,S,R)=>U.routerOpen(a,f,S,R),routerPush:U.routerPush,routerReplace:U.routerReplace,routerPop:(a,f)=>{U.routerPop(a,f)},routerHide:U.routerHide,routerRestore:U.routerRestore,setDestUrl:U.setUrl,isViewSupported:()=>!1,viewVersion:()=>0,setLayer(a,f,S){const R=S?w.get(S)??null:null;if(S&&(!R||R.type!=="layer")){s("setLayer: not a layer node");return}N.setLayer(a,f,R)},setWidgetPose(a,f){const S=w.get(a);S&&N.setPose(S,f>0?f:0)},registerFont(a,f,S,R,G,j){try{const fe=new o.FontFace(a,`url("${f}")`,{weight:String(S),style:R===2?"italic":"normal"});n.fonts.add(fe),fe.load().then(()=>G(),()=>j())}catch{j()}},fontFormat:"woff2",toast:(a,f)=>N.toast(a,f),isButtonPressed(a){const f=w.get(a);return!!f&&V.isPressed(f)},isHovered(a){const f=w.get(a);return!!f&&V.isHovered(f)},getBoundingClientRect(a){const f=w.get(a);return f?ie(f.el):null},getDisplaySize:()=>[t.clientWidth,t.clientHeight],debugDump:()=>Y.dump(),debugPaint:a=>Y.paint(w.get(a)),setEmitter(a){P=a}},Z={...Oe(),...ae};for(const a of["open","close","routerOpen","routerPush","routerReplace","routerPop","routerHide","routerRestore"]){const f=Z[a];Z[a]=(...S)=>{const R=f(...S);return $(()=>N.refresh()),R}}const J={root:t,emit:O,emitLater:F,post:$,warn:s,node:a=>w.get(a),rootOwned:(a,f)=>{a.rooted=f,f||x(a)},flush:()=>h.flush(),value:(a,f)=>h.value(a,f),setStyle:(a,f,S)=>h.set(a,f,S),setString:(a,f,S)=>Z.setString(a,f,S),style:{bufferUrl:e.bufferUrl},shown:a=>{var f;return((f=U.current())==null?void 0:f.node)===a||N.isShown(a)||N.layers().includes(a)},scrim:a=>N.scrim(a),stage:A,sourceChanged:a=>I.sourceChanged(a),plugins:e.plugins??null,rootsChanged:()=>$(()=>N.refresh()),rootHolds:a=>y.holds(a)},pe={};for(const a of e.features??[]){const f=a.install(J);l.push(f),Object.assign(Z,f.bridge),Object.assign(pe,f.globals)}return{bridge:Z,globals:pe,presentation:U,back:H,setSafeArea(a,f=[]){for(const S of["top","right","bottom","left"])t.style.setProperty(`--safe-${S}`,`${a[S]}px`),f.includes(S)?t.style.setProperty(`--safe-${S}-bar`,`${a[S]}px`):t.style.removeProperty(`--safe-${S}-bar`)},flush:()=>h.flush(),stats:()=>Object.assign({nodes:w.size,classes:z.count(),tweens:0},...l.map(a=>{var f;return((f=a.stats)==null?void 0:f.call(a))??{}})),destroy(){var a;P=null,U.reset();for(const f of l)(a=f.destroy)==null||a.call(f);N.destroy(),n.removeEventListener("keydown",X),V.destroy(),c.destroy(),L.disconnect(),D.disconnect();for(const f of w.values())C.unregister(f.token),f.el.remove();w.clear(),e.sink||W.destroy(),t.classList.remove("lc-root");for(const f of Array.from(t.style))f.startsWith("--")&&t.style.removeProperty(f)}}},Nn=()=>({setMatrix(){},setVisible(){},setCameraMatrix(){},setProjection(){},clearProjection(){},setBackground(){},createExternalTexture:()=>null,onFrame:()=>()=>{},readPixels:(e,t)=>t(null,0,0),viewport:()=>({width:0,height:0,rotation:0})}),ms=e=>{var r,o;const t=((o=(r=e.screen)==null?void 0:r.orientation)==null?void 0:o.angle)??e.orientation??0;return(Math.round(t/90)%4+4)%4*90},gs=(e,t)=>({width:(e==null?void 0:e.clientWidth)??0,height:(e==null?void 0:e.clientHeight)??0,rotation:ms(t)}),K=[null],wt=new TextDecoder("utf-8"),Ui=async(e,t,n,r)=>{var g;let o;if(t.body)if(typeof t.body=="object"&&Array.isArray(t.body._entries)){const p=new FormData;for(let[y,v,k]of t.body._entries)typeof v=="object"?p.append(y,new Blob([ue(v._id)]),k):p.append(y,v);o=p}else typeof t.body=="string"?o=t.body:r(new Error("Invalid body"));const i=await fetch(e,{method:t.method,body:o,headers:t.headers,mode:"cors",credentials:"omit"}),s=typeof t.onProgress=="function"?t.onProgress:null;if(!s){const p=await i.arrayBuffer();K.push(p),n(K.length-1,i.status);return}const l=(g=i.body)==null?void 0:g.getReader();if(!l){const p=await i.arrayBuffer();K.push(p),n(K.length-1,i.status);return}const d=Number(i.headers.get("content-length"))||void 0;let u=0;const E=[];for(;;){const{done:p,value:y}=await l.read();if(p)break;y&&(E.push(y),u+=y.length,s({loaded:u,total:d}))}const _=new Uint8Array(u);let A=0;for(const p of E)_.set(p,A),A+=p.length;K.push(_.buffer),n(K.length-1,i.status)},bs=e=>JSON.parse(wt.decode(ue(e))),Pn=e=>wt.decode(ue(e)),ys=e=>new Uint8Array(ue(e)).slice(),vs=(e,t,n)=>wt.decode(ue(e).slice(t,n)),Fn=e=>{const t=new Blob([K[e]]);return URL.createObjectURL(t)},In=e=>new Blob([K[e]]),ue=e=>K[e],en=e=>{K[e]=null},He=e=>(K.push(e),K.length-1),St=new Map,Mi=(e,t)=>{St.set(e,t);const n=Ke.get(e);n!==void 0&&(K[n]=t)},Ni=e=>St.has(e),Ke=new Map,Pi=e=>{for(const[t,n]of Ke)if(n===e)return t},Es=e=>{const t=Ke.get(e);if(t!==void 0)return t;const n=St.get(e);if(!n)return-1;K.push(n);const r=K.length-1;return Ke.set(e,r),r},ws=(e=Nn())=>{const t=new Map,n=new Map,r=new Set,o=new Set;let i=!1;const s=()=>{let l="pending";const d=[],u=_=>{l==="taken"?_():l==="pending"&&d.push(_)};return{host:{registerView(_,A,g=1){u(()=>t.set(_,{factory:A,version:g}))},registerService(_,A,g=1){u(()=>n.set(_,{factory:A,version:g}))},putBuffer:He,getBuffer:ue,get gl(){return u(()=>{i=!0}),e}},take(){l="taken";for(const _ of d.splice(0))_()},leave(){l="left",d.length=0}}};return{views:t,services:n,drives3d:()=>i,has:l=>r.has(l),async register(l,d){if(!(r.has(l)||o.has(l))){o.add(l);try{for(const u of d){const E=s();let _;try{_=await u(E.host)}catch(A){E.leave(),console.warn(`[web-lite] the "${l}" plugin did not register: ${A instanceof Error?A.message:A}`);continue}if(_===!1){E.leave();continue}E.take(),r.add(l);return}}finally{o.delete(l)}}}}},tn={pager:["pagerSetContent"],vlist:["vlistInit"],tween:["tweenCreate","defineTransition"],canvas:["_creatorCanvas."],video:["createVideo"],plugins:["viewCall","isViewSupported","_creatorService."]},Ss={pager:()=>ce(()=>import("./assets/pager-BZAO9gMC.js"),[],import.meta.url).then(e=>e.pager),vlist:()=>ce(()=>import("./assets/vlist-Ap-F4H5J.js"),[],import.meta.url).then(e=>e.vlist),tween:()=>ce(()=>import("./assets/tween-DbrQTld4.js"),[],import.meta.url).then(e=>e.tween),canvas:()=>ce(()=>import("./assets/canvas-wFjS40IX.js"),[],import.meta.url).then(e=>e.canvas),video:()=>ce(()=>import("./assets/video-bzR_t2i6.js"),[],import.meta.url).then(e=>e.video),plugins:()=>ce(()=>import("./assets/plugins-B7TuO_p4.js"),[],import.meta.url).then(e=>e.plugins)},Dn=Object.keys(tn).map(e=>({name:e,uses:tn[e],load:Ss[e]})),_s=e=>Dn.filter(t=>t.uses.some(n=>e.includes(n))).map(t=>t.name),ks=async e=>{const t=_s(e);return(await Promise.all(Dn.filter(r=>t.includes(r.name)).map(r=>r.load().catch(o=>(console.warn(`[web-lite] the "${r.name}" feature did not load: ${o instanceof Error?o.message:o}`),null))))).filter(r=>r!==null)},Ts=e=>{let t=null,n=null;const r=(d,u)=>{t==null||t(d,u)},o=()=>r(document.hidden?"pause":"resume"),i=()=>r("online"),s=()=>r("offline");return document.addEventListener("visibilitychange",o),window.addEventListener("online",i),window.addEventListener("offline",s),{bridge:{run(d,u,E,_){let A;try{A=Pn(d)}catch{u("run: no such buffer");return}e.rerun(A,_,u)},restart(d){e.rerun(void 0,d)},quit(){},launchUrl:()=>e.launchUrl(),registerEvent(d){t=d},setFreedEmitter(d){n=d},ownedStats:()=>e.stats(),state:()=>document.hidden?"background":"active",isOnline:()=>navigator.onLine,openUrl(d){window.open(d,"_blank","noopener")},setOrientation(d){var _,A,g,p;const u=d==="landscape"||d==="portrait"?d:"auto";if(e.onOrientation){e.onOrientation(u);return}const E=typeof screen<"u"?screen.orientation:void 0;if(E)try{u==="auto"?(_=E.unlock)==null||_.call(E):(p=(g=(A=E.lock)==null?void 0:A.call(E,u))==null?void 0:g.catch)==null||p.call(g,()=>{})}catch{}}},emit:r,freed:(d,u)=>{n==null||n(d,u)},dispose(){t=null,n=null,document.removeEventListener("visibilitychange",o),window.removeEventListener("online",i),window.removeEventListener("offline",s)}}},Ls=(e,t,n,r)=>{try{const o=document.createElement("input");o.type="file",o.multiple=n,r&&(o.accept=r),o.onchange=async()=>{const{files:i}=o;if(n){const s=[];if(!i)return e([]);for(let l of i)s.push([He(await l.arrayBuffer()),l.name,l.size]);e(s)}else{if(!i||i.length===0)return e(null);e([[He(await i[0].arrayBuffer()),i[0].name,i[0].size]])}},window.addEventListener("focus",()=>{setTimeout(()=>{(!o.files||o.files.length===0)&&e(n?[]:null)},300)},{once:!0}),o.click()}catch(o){t(o)}},Bn=e=>e==="camera"?"camera":e==="microphone"||e==="speech"?"microphone":e==="location"?"geolocation":null,Vn=(e,t,n)=>{const r=Bn(e);if(!r){n(`${e}: not a permission this host asks for`);return}const o=navigator.permissions;if(!(o!=null&&o.query)){t("prompt");return}o.query({name:r}).then(i=>t(i.state),()=>t("prompt"))},xs=(e,t,n)=>{if(!Bn(e)){n(`${e}: not a permission this host asks for`);return}const r=()=>Vn(e,t,n);if(e==="location"){if(!navigator.geolocation){t("denied");return}navigator.geolocation.getCurrentPosition(()=>t("granted"),i=>i.code===i.PERMISSION_DENIED?t("denied"):r(),{timeout:15e3,maximumAge:1/0});return}const o=navigator.mediaDevices;if(!(o!=null&&o.getUserMedia)){t("denied");return}o.getUserMedia(e==="camera"?{video:!0}:{audio:!0}).then(i=>{for(const s of i.getTracks())s.stop();t("granted")},i=>{const s=i instanceof Error?i.name:"";s==="NotAllowedError"||s==="SecurityError"?t("denied"):r()})},Rs=e=>({get platform(){return"web"},get language(){return e()},get pixelRatio(){return window.devicePixelRatio||1},vibrate(){var t;try{(t=navigator.vibrate)==null||t.call(navigator,30)}catch{}},clipboardWrite(t){var n;(n=navigator.clipboard)==null||n.writeText(t).catch(()=>{})},clipboardRead(t,n){const r=navigator.clipboard;if(!(r!=null&&r.readText)){n("Clipboard is not available");return}r.readText().then(t,o=>n(o instanceof Error?o.message:"Clipboard read failed"))},share(t,n){var l;const r=In(t),o=new File([r],"image.png",{type:"image/png"});if((l=navigator.canShare)!=null&&l.call(navigator,{files:[o]})){navigator.share({files:[o],text:n}).catch(()=>{});return}const i=URL.createObjectURL(r),s=document.createElement("a");s.href=i,s.download=o.name,document.body.appendChild(s),s.click(),s.remove(),URL.revokeObjectURL(i)},openFilePicker:(t,n,r,o)=>Ls(t,n,r,o??void 0),queryPermission:Vn,requestPermission:xs}),As=e=>{const t=e==null?void 0:e._h;return typeof e=="object"&&e!==null&&typeof(t==null?void 0:t.id)=="number"?t.id:null},Cs=e=>{if(e==null)return;if(typeof e=="string")return e;const t=e._entries;if(!Array.isArray(t))throw new Error("fetch: the body is a string or a FormData");const n=new FormData;for(const[r,o,i]of t){const s=As(o);s!==null?n.append(r,In(s),i):n.append(r,String(o))}return n},$s=()=>{const e=new Set,t=new FinalizationRegistry(i=>{e.delete(i)&&en(i)}),n=i=>{const s={id:i};return e.add(i),t.register(s,i),s};let r=!1;return{bridge:{fetch(i,s,l,d,u){const E=typeof(s==null?void 0:s.onProgress)=="function"?s.onProgress:u;if(i.startsWith("id:")){const _=Number(i.slice(3));l({id:_},ue(_)?200:404);return}(async()=>{var _;try{const A=await fetch(i,{method:s==null?void 0:s.method,headers:s==null?void 0:s.headers,body:Cs(s==null?void 0:s.body),mode:"cors",credentials:"omit"}),g=E?(_=A.body)==null?void 0:_.getReader():void 0;let p;if(!g)p=await A.arrayBuffer();else{const y=Number(A.headers.get("content-length"))||void 0,v=[];let k=0;for(;;){const{done:O,value:F}=await g.read();if(O)break;F&&(v.push(F),k+=F.length,r||E({loaded:k,total:y}))}const $=new Uint8Array(k);let P=0;for(const O of v)$.set(O,P),P+=O.length;p=$.buffer}if(r)return;l(n(He(p)),A.status)}catch(A){r||d(A instanceof Error?A:String(A))}})()},local:i=>Es(i),toJson:i=>bs(i),slice:(i,s,l)=>vs(i,s,l),toText:i=>Pn(i),toBytes:i=>ys(i)},live:()=>e.size,dispose(){r=!0;for(const i of e)en(i);e.clear()}}},nn=["MouseLeft","MouseMiddle","MouseRight","MouseBack","MouseForward"],st=["GamepadSouth","GamepadEast","GamepadWest","GamepadNorth","GamepadL1","GamepadR1","GamepadL2","GamepadR2","GamepadSelect","GamepadStart","GamepadL3","GamepadR3","GamepadUp","GamepadDown","GamepadLeft","GamepadRight"],Fe=4,it=16,rn=16,Os=.5,Us=e=>{const t=new Set;let n=null;const r=(x,U,N=-1,B=0)=>{n==null||n(x,U,N,B)},o=x=>{if(!x.code)return;const U=t.has(x.code);t.add(x.code),r(0,x.code,-1,U||x.repeat?1:0)},i=x=>{x.code&&t.delete(x.code)&&r(1,x.code)},s=()=>{for(const x of[...t])x.startsWith("Gamepad")||(t.delete(x),r(1,x))},{root:l}=e;let d=0,u=0,E=0,_=0,A=0,g=0,p=0,y=0,v=0,k=0;const $=x=>{var B;if(x.pointerType&&x.pointerType!=="mouse")return;const U=l.getBoundingClientRect(),N=((B=e.scale)==null?void 0:B.call(e))||1;d=(x.clientX-U.left)/N,u=(x.clientY-U.top)/N,E+=(x.movementX||0)/N,_+=(x.movementY||0)/N},P=x=>{const U=nn[x.button];U&&(t.add(U),r(0,U))},O=x=>{const U=nn[x.button];U&&t.delete(U)&&r(1,U)},F=x=>{const U=x.deltaMode===0?.01:1;A+=x.deltaX*U,g+=x.deltaY*U},W=x=>{document.pointerLockElement===l&&x.preventDefault()},z=[],h=[],w=[],M=()=>{var U,N;const x=typeof navigator<"u"&&navigator.getGamepads?Array.from(navigator.getGamepads()):[];for(let B=0;B<Fe;B++){const H=x[B]??null,X=!!H&&H.connected;if(X!==!!z[B]){if(z[B]=X,!X){for(const J of st)t.delete(J+"@"+B)&&(r(1,J,B),D(J));w[B]=[],h[B]=[0,0,0,0,0,0]}r(X?2:3,"",B)}if(!H||!X)continue;const Y=H.axes,ie=H.buttons,Oe=((U=ie[6])==null?void 0:U.value)??0,ae=((N=ie[7])==null?void 0:N.value)??0;h[B]=[Y[0]??0,Y[1]??0,Y[2]??0,Y[3]??0,Oe,ae];const Z=w[B]??(w[B]=[]);for(let J=0;J<st.length;J++){const pe=ie[J],a=!!pe&&(pe.pressed||pe.value>Os);if(a===!!Z[J])continue;Z[J]=a;const f=st[J];a?t.add(f+"@"+B):t.delete(f+"@"+B),D(f),r(a?0:1,f,B)}}},D=x=>{let U=!1;for(let N=0;N<Fe&&!U;N++)t.has(x+"@"+N)&&(U=!0);U?t.add(x):t.delete(x)};let I=0;const V=()=>{p=E,y=_,v=A,k=g,E=_=A=g=0,M(),I=requestAnimationFrame(V)},c=e.windows.filter((x,U,N)=>x&&N.indexOf(x)===U);for(const x of c)e.keyboard!==!1&&(x.addEventListener("keydown",o),x.addEventListener("keyup",i)),x.addEventListener("blur",s);return l.addEventListener("pointermove",$,!0),l.addEventListener("mousedown",P,!0),window.addEventListener("mouseup",O,!0),l.addEventListener("wheel",F,{passive:!0,capture:!0}),l.addEventListener("contextmenu",W,!0),typeof requestAnimationFrame=="function"&&(I=requestAnimationFrame(V)),{inputKey:(x,U)=>U>=0&&x.startsWith("Gamepad")?t.has(x+"@"+U):t.has(x),inputRead:x=>{var U;switch(x){case 0:return d;case 1:return u;case 2:return p;case 3:return y;case 4:return v;case 5:return k;case 6:return document.pointerLockElement===l?1:0;case 7:{let N=0;for(let B=0;B<Fe;B++)z[B]&&N++;return N}}if(x>=it){const N=Math.floor((x-it)/rn),B=(x-it)%rn;return N>=Fe||!z[N]?0:B===0?1:((U=h[N])==null?void 0:U[B-1])??0}return 0},inputSetPointerLock:x=>{if(!x)return document.pointerLockElement===l&&document.exitPointerLock(),!0;if(document.pointerLockElement===l)return!0;if(typeof l.requestPointerLock!="function")return!1;try{const U=l.requestPointerLock({unadjustedMovement:!0});return U&&typeof U.catch=="function"&&U.catch(()=>{try{l.requestPointerLock()}catch{}}),!0}catch{return!1}},registerInputEvent:x=>{n=x},dispose:()=>{for(const x of c)x.removeEventListener("keydown",o),x.removeEventListener("keyup",i),x.removeEventListener("blur",s);l.removeEventListener("pointermove",$,!0),l.removeEventListener("mousedown",P,!0),window.removeEventListener("mouseup",O,!0),l.removeEventListener("wheel",F,!0),l.removeEventListener("contextmenu",W,!0),I&&cancelAnimationFrame(I),document.pointerLockElement===l&&document.exitPointerLock(),t.clear(),n=null}}},Ms=e=>{const t=e.ownerDocument.defaultView??window,n=Us({windows:[t],root:e}),r=t.visualViewport,o=()=>r?Math.max(0,Math.round(t.innerHeight-r.height-r.offsetTop)):0;let i=null,s=0;const l=()=>{const u=o();u!==s&&(s=u,i==null||i(u,0))};return r==null||r.addEventListener("resize",l),{bridge:{key:n.inputKey,read:n.inputRead,setPointerLock:n.inputSetPointerLock,registerEvent(u){n.registerInputEvent(u)},keyboardHeight:o,registerKeyboardEvent(u){i=u}},dispose(){i=null,r==null||r.removeEventListener("resize",l),n.dispose()}}},q=[null],Re=new Map,Wn=e=>{if(!e.startsWith("id:"))return e;const t=Number(e.slice(3));return ue(t)?Fn(t):null},zn=e=>{const t=Re.get(e);t!==void 0&&(URL.revokeObjectURL(t),Re.delete(e))},we=[!1],Gn=(e,t,n)=>{e.addEventListener("ended",()=>{n(),we[t]&&(e.currentTime=0,e.play())})},Ns=(e,t)=>{const n=Wn(e);if(n===null)return-1;const r=document.createElement("video");document.body.appendChild(r),r.crossOrigin="anonymous",r.style="opacity: 0; position: absolute; top: 0; left: 0; width: 1px; height: 1px",r.src=n,r.playsInline=!0,r.controls=!1;const o=q.length;return n!==e&&Re.set(o,n),q.push(r),we.push(!1),Gn(r,o,t),o},Ps=(e,t)=>{const n=Wn(e);if(n===null)return-1;const r=document.createElement("audio");document.body.appendChild(r),r.style="opacity: 0; position: absolute; top: 0; left: 0; width: 1px; height: 1px",r.src=n;const o=q.length;return n!==e&&Re.set(o,n),q.push(r),we.push(!1),Gn(r,o,t),o},Fs=(e,t)=>{const n=q[e];n&&(t===0?n.muted=!0:(n.muted&&(n.muted=!1),n.volume=t))},Is=(e,t)=>{const n=q[e];n&&(t?n.play():n.pause())},Ds=(e,t)=>{we[e]=t},Bs=e=>{var t;return((t=q[e])==null?void 0:t.currentTime)??0},Vs=(e,t)=>{const n=q[e];n&&(n.currentTime=t)},Ws=e=>{var n;const t=((n=q[e])==null?void 0:n.duration)??0;return isNaN(t)?0:t},Fi=e=>q[e],jn=e=>{e.pause(),e.removeAttribute("src"),e.load(),e.remove()},zs=e=>{const t=q[e];t&&(jn(t),zn(e),q[e]=null,we[e]=!1)},Ii=()=>{for(let e of q)e&&jn(e);for(const e of[...Re.keys()])zn(e);q.length=1,we.length=1},Gs=()=>{const e=new Map;let t=null;const n=s=>{e.delete(s)&&zs(s)},r=new FinalizationRegistry(s=>{const l=e.get(s);l&&(l.held=!1,l.playing||n(s))}),o=(s,l)=>{let d=-1;if(d=s(l,()=>{const _=e.get(d);_&&(t==null||t(d),!_.loop&&(_.playing=!1,_.held||n(d)))}),d<0)return null;e.set(d,{held:!0,playing:!1,loop:!1});const E={id:d};return r.register(E,d),E};return{bridge:{createAudio:s=>o(Ps,s),createVideo:s=>o(Ns,s),setVolume:Fs,setLoop(s,l){const d=e.get(s);d&&(d.loop=l),Ds(s,l)},setPlaying(s,l){const d=e.get(s);d&&(d.playing=l,Is(s,l),!l&&!d.held&&n(s))},time:Bs,setTime:Vs,duration:Ws,setEmitter(s){t=s}},live:()=>e.size,dispose(){t=null;for(const s of[...e.keys()])n(s)}}},js=()=>{const e=[];return{bridge:{open(n,r){const o=e.length;let i;try{i=new WebSocket(n)}catch{return e.push(null),queueMicrotask(()=>r("error")),o}return i.addEventListener("open",()=>r("open")),i.addEventListener("message",s=>r("message",s.data)),i.addEventListener("close",s=>{e[o]=null,r("close",s.code)}),i.addEventListener("error",()=>r("error")),e.push(i),o},send(n,r){const o=e[n];o&&o.readyState===WebSocket.OPEN&&o.send(r)},close(n){var r;(r=e[n])==null||r.close()}},dispose(){for(const n of e)n==null||n.close();e.length=0}}},Hs=e=>{let t="default",n=null,r=!1;const o=()=>`lecodes:${e}:${t}`,i=()=>{if(n)return n;n={};try{const u=window.localStorage.getItem(o()),E=u?JSON.parse(u):null;if(E&&typeof E=="object")for(const[_,A]of Object.entries(E))typeof A=="string"&&(n[_]=A)}catch{}return n},s=()=>{if(r=!1,!!n)try{window.localStorage.setItem(o(),JSON.stringify(n))}catch{}},l=()=>{r||(r=!0,queueMicrotask(s))};return{bridge:{get:u=>i()[u]??null,set(u,E){i()[u]=String(E),l()},remove(u){delete i()[u],l()},select(u){r&&s(),t=u,n=null}},dispose(){r&&s()}}},Ks=(e,t={})=>{const n=e.ownerDocument,r=n.defaultView??window;let o=null;const i=new Map,s=new Set;let l=0,d=null,u=null;const E=()=>{if(i.size!==0)for(const[g,p]of[...i])try{p()}catch(y){s.has(g)||(s.add(g),console.error("[web-lite] a plugin's frame body failed:",y))}},_=g=>{g!==d&&(d==null||d.remove(),d=g,o&&(g&&(g.classList.add("lc-background"),g.style.cssText="position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; background: #000",e.insertBefore(g,o.canvas)),o.engine._setTransparent(!!g)))};return{facade:{...Nn(),setMatrix(g,p){o==null||o.engine.setWorldMatrix(g,Float32Array.from(p))},setVisible(g,p){o==null||o.engine.setVisible(g,p)},setCameraMatrix(g,p){o==null||o.engine.setCameraMatrix(g,Float32Array.from(p))},setProjection(g,p,y,v){o==null||o.engine.setCameraProjectionMatrix(g,Float32Array.from(p),y,v)},clearProjection(g){o==null||o.engine.clearCameraProjectionMatrix(g)},setBackground(g,p){_(p)},onFrame(g){const p=l++;return i.set(p,g),()=>{i.delete(p),s.delete(p)}},readPixels(g,p){if(!o||o.opened()!==g){p(null,0,0);return}const y=o.canvas;o.engine._renderNow();const v=n.createElement("canvas");v.width=y.width,v.height=y.height;const k=v.getContext("2d");if(!k||y.width===0||y.height===0){p(null,0,0);return}k.drawImage(y,0,0);const $=k.getImageData(0,0,y.width,y.height);p(new Uint8Array($.data.buffer),y.width,y.height)},viewport:()=>gs(o==null?void 0:o.canvas,r),async presentXR(g,p,y,v){var O;const k=o;if(!k)throw new Error("[web-lite] gl.presentXR: this world has no 3D engine");const $=await k.engine._presentXR(p,y,v,g);if(o!==k)throw $.end(),new Error("[web-lite] gl.presentXR: the world changed while the session was being presented");const P={end(){var W;const F=u===P;F&&(u=null),$.end(),F&&((W=t.onPresent)==null||W.call(t,!1))},captureCamera:$.captureCamera};return u=P,(O=t.onPresent)==null||O.call(t,!0),P}},attach(g){g!==o&&(u==null||u.end(),_(null),i.clear(),s.clear(),o==null||o.engine._beforeFrame(null),o=g,o==null||o.engine._beforeFrame(E))}}},on={scene3d:{uses:["_creator.createScene","_creator.createEntity"],module:"/web-lite/src/engines/scene3d.ts"},scene2d:{uses:["_creator2d.createScene","_creator2d.createEntity"],module:"/web-lite/src/engines/scene2d.ts"},anim:{uses:["_creator.animator","_creator.getGlbClipSet","_creator.loadClips","_creator.createClipFromTracks"],module:"/creator-anim/dist/creatorAnim.js"},physics:{uses:["_creator.physicsBuild","_creator.physicsCreate","_creator.physicsConfigure","_creator.physicsRaycast","_creator.characterCreate","_creator.vehicleCreate","_creator.ragdollCreate"],module:"/creator-physics/dist/creatorPhysics.js"},particles:{uses:["_creator.createParticleSystem","_creator.createNoise"],module:"/creator-particles/dist/creatorParticles.js"}},Ys=e=>{const t=Object.keys(on).filter(n=>on[n].uses.some(r=>e.includes(r)));return new Set(t)},sn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Hn={};for(let e=0;e<sn.length;e++)Hn[sn[e]]=e;const qs=e=>{const t=[];let n=0,r=0;for(const o of e){const i=Hn[o];if(i===void 0)break;const s=i&32;if(r+=(i&31)<<n,s)n+=5;else{const l=r&1;r>>=1,t.push(l?-r:r),r=0,n=0}}return t};class Xs{constructor(t){qe(this,"sources");qe(this,"lines");this.sources=t.sources,this.lines=[];let n=0,r=0,o=0;for(const i of t.mappings.split(";")){const s=[];let l=0;if(i)for(const d of i.split(",")){const u=qs(d);u.length!==0&&(l+=u[0],u.length>=4&&(n+=u[1],r+=u[2],o+=u[3],s.push([l,n,r,o])))}this.lines.push(s)}}originalPositionFor(t,n){const r=this.lines[t-1];if(!r||r.length===0)return null;let o=null;for(const s of r)if(s[0]<=n)o=s;else break;o??(o=r[0]);const i=this.sources[o[1]];return i===void 0?null:{source:i,line:o[2]+1,column:o[3]}}}const Js=e=>{const t=e.match(/\/\/# lecodesMap=data:application\/json;(?:charset=[^;]+;)?base64,([A-Za-z0-9+/=]+)\s*$/);if(!t)return null;try{const n=typeof atob=="function"?atob(t[1]):Buffer.from(t[1],"base64").toString("utf8");return new Xs(JSON.parse(n))}catch{return null}};let me=null;const Qs=()=>{if(me!==null)return me;try{new Function("throw new Error('chisel-calibrate')")()}catch(e){const n=(e.stack??"").match(/<anonymous>:(\d+):\d+/);return me=n?parseInt(n[1],10)-1:2,me}return me=2,me},an=(e,t)=>{const n=(e instanceof Error?e.stack:"")??"",r=Qs(),o=[];for(const i of n.split(`
|
|
286
286
|
`)){const s=i.match(/<anonymous>:(\d+):(\d+)/);if(!s)continue;const l=parseInt(s[1],10)-r,d=parseInt(s[2],10)-1;if(l<1)continue;const u=t.originalPositionFor(l,d<0?0:d);if(!u)continue;const E=i.match(/at\s+([^\s(]+)\s*\(/);o.push({fn:E?E[1]:null,source:u.source,line:u.line,column:u.column})}return o},Zs=e=>{const t=[],n=(s,l,d)=>{var _;const u=l instanceof Error?l.message:String(l),E=d[0];console.error(E?`[lecodes] ${u}
|
|
287
287
|
at ${E.source}:${E.line}:${E.column}${E.fn?` (${E.fn})`:""}`:`[lecodes] ${u}`),(_=s.onError)==null||_.call(s,{message:u,frames:d,stack:l instanceof Error?l.stack:void 0})},r=s=>{for(let l=t.length-1;l>=0;l--){const d=t[l];if(!d.sourceMap)continue;const u=an(s,d.sourceMap);if(u.length>0)return n(d,s,u),!0}return!1},o=s=>{r(s.error??s.message)},i=s=>{r(s.reason)};return e.addEventListener("error",o),e.addEventListener("unhandledrejection",i),{track(s,l){const d={sourceMap:Js(s),onError:l};return t.push(d),{thrown(u){n(d,u,d.sourceMap?an(u,d.sourceMap):[])},drop(){const u=t.indexOf(d);u>=0&&t.splice(u,1)}}},dispose(){e.removeEventListener("error",o),e.removeEventListener("unhandledrejection",i),t.length=0}}},ei=""+new URL("assets/roboto-cyrillic-ext-1gPz9dK9.woff2",import.meta.url).href,ti=""+new URL("assets/roboto-cyrillic-DVBNKCCH.woff2",import.meta.url).href,ni=""+new URL("assets/roboto-greek-ext-D98D44EL.woff2",import.meta.url).href,ri=""+new URL("assets/roboto-greek-DVLYEgdx.woff2",import.meta.url).href,oi=""+new URL("assets/roboto-latin-ext-t610Sqxq.woff2",import.meta.url).href,si=""+new URL("assets/roboto-latin-cAJwcdBQ.woff2",import.meta.url).href,ii=""+new URL("assets/roboto-rest-C7JkyNHT.woff2",import.meta.url).href,ai=""+new URL("assets/roboto-vietnamese-w-p-nKZZ.woff2",import.meta.url).href,li="Roboto",ci="100 900",ui=[{name:"rest",file:"roboto-rest.woff2",range:"U+02D8-02D9, U+02DB, U+030F, U+2070, U+2074-208E, U+20C1, U+2105, U+2126, U+212E, U+215B-215E, U+2202, U+2206, U+220F, U+2211, U+221A, U+221E, U+222B, U+2248, U+2260, U+2264-2265, U+25A0, U+25CA-25CB, U+25CF, U+EE01-EE02, U+F6C3, U+FB01-FB04, U+FFFC",bytes:13324},{name:"cyrillic-ext",file:"roboto-cyrillic-ext.woff2",range:"U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F",bytes:36720},{name:"cyrillic",file:"roboto-cyrillic.woff2",range:"U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116",bytes:23696},{name:"greek-ext",file:"roboto-greek-ext.woff2",range:"U+1F00-1FFF",bytes:4380},{name:"greek",file:"roboto-greek.woff2",range:"U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF",bytes:17588},{name:"vietnamese",file:"roboto-vietnamese.woff2",range:"U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB",bytes:14340},{name:"latin-ext",file:"roboto-latin-ext.woff2",range:"U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF",bytes:26388},{name:"latin",file:"roboto-latin.woff2",range:"U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD",bytes:36600}],at={family:li,weight:ci,parts:ui},fi=Object.assign({"./assets/fonts/roboto-cyrillic-ext.woff2":ei,"./assets/fonts/roboto-cyrillic.woff2":ti,"./assets/fonts/roboto-greek-ext.woff2":ni,"./assets/fonts/roboto-greek.woff2":ri,"./assets/fonts/roboto-latin-ext.woff2":oi,"./assets/fonts/roboto-latin.woff2":si,"./assets/fonts/roboto-rest.woff2":ii,"./assets/fonts/roboto-vietnamese.woff2":ai}),ln="data-lecodes-lite-fonts",di=1500,pi=e=>{if(e.head.querySelector(`style[${ln}]`))return;const t=at.parts.map(r=>{const o=fi[`./assets/fonts/${r.file}`];if(!o)return"";const i=new URL(o,e.baseURI).href;return`@font-face{font-family:"${at.family}";src:url("${i}") format("woff2");font-weight:${at.weight};font-style:normal;font-display:swap;unicode-range:${r.range}}`}),n=e.createElement("style");n.setAttribute(ln,""),n.textContent=t.join(`
|
|
288
288
|
`),e.head.appendChild(n)},hi=(e,t=[],n=di)=>{const r=e.defaultView??window,o=e.fonts?e.fonts.ready.then(()=>{},()=>{}):Promise.resolve();return new Promise(i=>{const s=r.setTimeout(i,n);Promise.all([o,...t.map(l=>l.then(()=>{},()=>{}))]).then(()=>{r.clearTimeout(s),i()})})},cn=e=>typeof e=="object"&&e!==null&&e.lecodes===!0&&typeof e.level=="number",mt=(e,t={})=>{let n;if((t.mode??"hash")==="hash")n=e.hash.replace(/^#/,"");else{const r=t.base??"/";n=(e.pathname.startsWith(r)?e.pathname.slice(r.length-1):e.pathname).replace(/\/index\.html$/,"/")+e.search}return n===""||n==="/"?null:n.startsWith("/")?n:`/${n}`},mi=(e,t,n={})=>{if((n.mode??"hash")==="hash")return`${t.pathname}${t.search}${e===null?"":`#${e}`}`;const r=n.base??"/";return e===null?r:r.replace(/\/$/,"")+e},gi=(e,t,n={})=>{const r=e.history,o=e.location;let i=0,s=!1,l=0,d=!1;const u=(g,p)=>{const y={lecodes:!0,level:p},v=mi(t.address(),o,n);g==="push"?r.pushState(y,"",v):r.replaceState(y,"",v)},E=g=>{g!==0&&(l++,r.go(g))},_=()=>{if(l>0){d=!0;return}const g=t.level();if(s){i=g,u("replace",g);return}if(g>i){for(let p=i+1;p<=g;p++)u("push",p);i=g}else if(g<i){const p=g-i;i=g,E(p)}else u("replace",g)},A=g=>{if(l>0){if(l--,l>0)return;d?(d=!1,_()):u("replace",i);return}const p=g.state;if(!cn(p)){const $=mt(o,n);r.replaceState({lecodes:!0,level:i},"",o.href),$!==null&&t.link($);return}const y=p.level,v=i;s=!0;try{if(y<v)for(;t.level()>y;){const $=t.level();if(t.back(),t.level()>=$)break}else if(y>v){const $=mt(o,n);$!==null&&t.link($)}}finally{s=!1}const k=Math.max(0,t.level());if(i=y,k===y){u("replace",y);return}if(y>v&&k>v){i=k,u("replace",k);return}i=k,E(k-y)};return e.addEventListener("popstate",A),cn(r.state)?i=r.state.level:r.replaceState({lecodes:!0,level:0},"",o.href),{sync:_,reset(){const g=-i;i=0,E(g)},destroy(){e.removeEventListener("popstate",A)}}},bi=.1,yi=e=>{const t=new Set,n=new Set,r=new Map;let o=1,i=0,s=0;const l=d=>{i=0;const u=Math.min(bi,Math.max(0,(d-s)/1e3));s=d;for(const E of[...r.values()])E(u);r.size>0&&(i=e.requestAnimationFrame(l))};return{globals:{setTimeout(d,u,...E){const _=e.setTimeout(()=>{t.delete(_),d(...E)},u);return t.add(_),_},clearTimeout(d){t.delete(d),e.clearTimeout(d)},setInterval(d,u,...E){const _=e.setInterval(()=>d(...E),u);return n.add(_),_},clearInterval(d){n.delete(d),e.clearInterval(d)},setLoop(d){const u=o++;return r.set(u,d),i===0&&(s=e.performance.now(),i=e.requestAnimationFrame(l)),u},clearLoop(d){r.delete(d)}},dispose(){for(const d of t)e.clearTimeout(d);for(const d of n)e.clearInterval(d);t.clear(),n.clear(),r.clear(),i!==0&&e.cancelAnimationFrame(i),i=0}}},vi=32,Ei=["_creator","_creator2d","_creatorNav","_creatorNet","_creatorAudio","_creatorCanvas","_creatorFiles","_creatorService"],un=new Map,wi=e=>{let t=un.get(e);return t||un.set(e,t=Fn(e)),t},Si=(e,t={})=>{const n=e.ownerDocument,r=n.defaultView??window,o=Zs(r),i=t.language??(()=>(navigator.language||"en").slice(0,2));let s=null,l=!1;const d=Ks(e,{onPresent:h=>{l=h,$()}}),u=ws(d.facade),E=new Set,_=h=>Promise.all([...h].map(async w=>{if(!(!t.loadPlugin||E.has(w))){E.add(w);try{await u.register(w,await t.loadPlugin(w))}catch(M){console.warn(`[web-lite] the "${w}" plugin did not load: ${M instanceof Error?M.message:M}`)}}})),A=async(h,w,M)=>{const D=Ys(h),I=[],V=[];let c=null;if(D.has("scene3d"))try{const{createScene3d:L}=await ce(async()=>{const{createScene3d:T}=await import("./assets/scene3d-NxtMMpHd.js").then(b=>b.s);return{createScene3d:T}},[],import.meta.url);c=await L(e,{preloads:w,twins:{anim:D.has("anim"),physics:D.has("physics"),particles:D.has("particles")},alpha:M}),I.push(c.feature),V.push(c.dispose)}catch(L){console.warn(`[web-lite] the 3D engine did not start: ${L instanceof Error?L.message:L}`)}if(D.has("scene2d"))try{const{createScene2d:L}=await ce(async()=>{const{createScene2d:b}=await import("./assets/scene2d-F6T1Io7I.js");return{createScene2d:b}},[],import.meta.url),T=await L(e);I.push(T.feature),V.push(T.dispose)}catch(L){console.warn(`[web-lite] the 2D engine did not start: ${L instanceof Error?L.message:L}`)}return{features:I,scene:c,dispose(){for(const L of V)L()}}};let g=t.launchRoute!==void 0?t.launchRoute:t.history?mt(r.location,t.history):null,p=t.safeArea??null,y=0;const v=n.createElement("div");v.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.body.appendChild(v);const k=()=>{v.isConnected||n.body.appendChild(v);const h=r.getComputedStyle(v),w=M=>Math.round(parseFloat(M)||0);return{top:w(h.paddingTop),right:w(h.paddingRight),bottom:w(h.paddingBottom),left:w(h.paddingLeft)}},$=()=>{const h=p??k(),w=!p&&l&&h.top===0?vi:h.top;s==null||s.tree.setSafeArea({...h,top:w},h.bars??[])},P=new ResizeObserver($);P.observe(v,{box:"border-box"});const O=t.history?gi(r,{level:()=>Math.max(0,((s==null?void 0:s.tree.presentation.stack().length)??0)-1),address:()=>(s==null?void 0:s.tree.presentation.address())??null,back:()=>{s==null||s.tree.back()},link:h=>{g=h,s==null||s.emitApp("url",h)}},t.history):null,F=()=>{d.attach(null),s==null||s.dispose(),s=null},W=(h,w,M)=>{const D=hs({root:e,bufferUrl:wi,features:M,plugins:u,onNavigation:()=>{var N;O==null||O.sync(),(N=t.onNavigation)==null||N.call(t,D)}}),I=yi(r),V=$s(),c=Hs(t.project??"app"),L=js(),T=Ms(e),b=Gs(),m=o.track(h,w.onError),C=Ts({launchUrl:()=>g,rerun:(N,B,H)=>{B!==void 0&&(g=B);const X=N??h;r.setTimeout(()=>{z(X,w).catch(Y=>H==null?void 0:H(Y instanceof Error?Y.message:String(Y)))},0)},stats:()=>JSON.stringify({live:{tree:D.stats().nodes,fetch:V.live(),media:b.live(),tween:D.stats().tweens},pending:0}),onOrientation:t.onOrientation}),x={_creatorTree:D.bridge,_creatorApp:C.bridge,_creatorDevice:Rs(i),_creatorFetch:V.bridge,_creatorStorage:c.bridge,_creatorSocket:L.bridge,_creatorInput:T.bridge,_creatorMedia:b.bridge,...I.globals};for(const N of Ei)x[N]=void 0;Object.assign(x,D.globals),s={code:h,tree:D,emitApp:C.emit,dispose(){m.drop(),I.dispose(),L.dispose(),b.dispose(),T.dispose(),c.dispose(),V.dispose(),C.dispose(),D.destroy()}},$();const U=Object.keys(x);try{new Function(...U,h)(...U.map(N=>x[N]))}catch(N){m.thrown(N)}};async function z(h,w={}){const M=cr(h);if(!ir(M.sdk,Lt))throw new Error(`This app was built with LeCodes SDK ${M.sdk??"older than 2.0"}; this host runs SDK ${Lt}. It needs a new build.`);const D=++y;s&&(O==null||O.reset()),F(),t.defaultFont!=="system"&&pi(n);const I=lr(M.bootFonts,n),[V,c]=await Promise.all([ks(h),_(M.plugins).then(()=>A(h,M.preloads,u.drives3d()))]);if(D!==y){c.dispose();return}V.push(...c.features),d.attach(c.scene),e.style.visibility="hidden";try{W(h,w,V),s==null||s.tree.flush(),e.offsetHeight,await hi(n,[I])}finally{D===y&&(e.style.visibility="")}}return{run:z,restart(h){return s?(h!==void 0&&(g=h),z(s.code)):Promise.resolve()},tree:()=>(s==null?void 0:s.tree)??null,setSafeArea(h){p=h,$()},openRoute(h){g=h,s==null||s.emitApp("url",h)},emitAppEvent(h,w){s==null||s.emitApp(h,w)},destroy(){y++,F(),P.disconnect(),O==null||O.destroy(),v.remove(),o.dispose()}}},de=document.getElementById("app"),fn=document.getElementById("error"),Ee=new URLSearchParams(location.search),Kn=e=>{fn&&(fn.textContent=e)},dn=Ee.has("dev")?new URL(Ee.get("dev")||"..",location.href).href.replace(/\/$/,""):null,pn=e=>{const t=e.frames[0];return t?`${e.message}
|
package/src/dev/localBackend.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { spawn, type ChildProcess } from "node:child_process"
|
|
2
2
|
import { basename, dirname, join } from "node:path"
|
|
3
3
|
import { fileURLToPath } from "node:url"
|
|
4
|
-
import type
|
|
4
|
+
import { trustedCaEnv, type ChannelGroup, type InvokeResult, type RequestContext, type ServerDescription } from "lecodes-sdk/server"
|
|
5
5
|
import { LECODES_DIR } from "../project/manifest"
|
|
6
6
|
|
|
7
7
|
/*
|
|
@@ -115,7 +115,9 @@ export const startLocalBackend = (options: LocalBackendOptions): LocalBackend =>
|
|
|
115
115
|
|
|
116
116
|
const start = (bundle: string, keys: Record<string, string>): Promise<{ live: Live, notes: string[] }> => new Promise((resolve, reject) => {
|
|
117
117
|
const [exe, ...args] = selfCommand()
|
|
118
|
-
|
|
118
|
+
// the server's fetch trusts the Russian Trusted CA (Минцифры) too — GigaChat, Sber, Gosuslugi — the way the
|
|
119
|
+
// runner's does; Bun reads NODE_EXTRA_CA_CERTS at start, so it is the child's environment (sdk/server trustedCa.ts)
|
|
120
|
+
const child = spawn(exe!, [...args, BACKEND_WORKER_ARG], { cwd: options.root, stdio: ["ignore", "inherit", "inherit", "ipc"], env: { ...process.env, ...trustedCaEnv() } })
|
|
119
121
|
let exited!: () => void
|
|
120
122
|
const l: Live = { child, describe: null as unknown as ServerDescription, pending: new Map(), gone: new Promise<void>((r) => { exited = r }) }
|
|
121
123
|
let settled = false
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { execFileSync, spawn, spawnSync } from "node:child_process"
|
|
2
|
-
import { copyFileSync, existsSync, mkdirSync, mkdtempSync, readdirSync, readFileSync, rmSync, statSync, writeFileSync, linkSync } from "node:fs"
|
|
2
|
+
import { constants as fsConstants, copyFileSync, existsSync, mkdirSync, mkdtempSync, readdirSync, readFileSync, rmSync, statSync, writeFileSync, linkSync } from "node:fs"
|
|
3
3
|
import { homedir, tmpdir } from "node:os"
|
|
4
4
|
import { delimiter, join, resolve } from "node:path"
|
|
5
5
|
import { cachedArtifactSha, downloadReleaseArchive, fetchReleaseProduct, macPlatformKey, newestForPlatform, semverNewer, type ManifestFile, type ManifestVersion } from "./releases"
|
|
@@ -573,8 +573,14 @@ const stageBundle = (js: string, resources: { name: string, absPath?: string }[]
|
|
|
573
573
|
const st = statSync(r.absPath)
|
|
574
574
|
if (!st.isFile()) continue
|
|
575
575
|
const dst = join(runDir, r.name)
|
|
576
|
+
// NEVER ONTO AN EXISTING FILE: what is already there may be a hard link to another project file, and a copy
|
|
577
|
+
// over it rewrites that file IN THE PROJECT (a case-only name clash on Windows did that to a GLB, 2026-11-04).
|
|
578
|
+
// The copy is the fallback for a link across volumes, and it refuses to replace anything.
|
|
576
579
|
try { linkSync(r.absPath, dst) }
|
|
577
|
-
catch
|
|
580
|
+
catch (e) {
|
|
581
|
+
if ((e as NodeJS.ErrnoException).code === "EEXIST") throw new Error(`two resources stage as ${r.name} (names that differ only in case?): ${r.absPath}`)
|
|
582
|
+
copyFileSync(r.absPath, dst, fsConstants.COPYFILE_EXCL); copied++
|
|
583
|
+
}
|
|
578
584
|
files++
|
|
579
585
|
bytes += st.size
|
|
580
586
|
}
|
|
Binary file
|